New schemas: agent_runtime_state, agent_wakeup_requests, heartbeat_run_events. New migrations for runtime tables. Expand heartbeat types with run events, wakeup reasons, and adapter state. Add live event types. Update agent schema and shared constants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
111 lines
2.9 KiB
TypeScript
111 lines
2.9 KiB
TypeScript
export const COMPANY_STATUSES = ["active", "paused", "archived"] as const;
|
|
export type CompanyStatus = (typeof COMPANY_STATUSES)[number];
|
|
|
|
export const AGENT_STATUSES = [
|
|
"active",
|
|
"paused",
|
|
"idle",
|
|
"running",
|
|
"error",
|
|
"terminated",
|
|
] as const;
|
|
export type AgentStatus = (typeof AGENT_STATUSES)[number];
|
|
|
|
export const AGENT_CONTEXT_MODES = ["thin", "fat"] as const;
|
|
export type AgentContextMode = (typeof AGENT_CONTEXT_MODES)[number];
|
|
|
|
export const AGENT_ADAPTER_TYPES = ["process", "http", "claude_local", "codex_local"] as const;
|
|
export type AgentAdapterType = (typeof AGENT_ADAPTER_TYPES)[number];
|
|
|
|
export const AGENT_ROLES = [
|
|
"ceo",
|
|
"cto",
|
|
"cmo",
|
|
"cfo",
|
|
"engineer",
|
|
"designer",
|
|
"pm",
|
|
"qa",
|
|
"devops",
|
|
"researcher",
|
|
"general",
|
|
] as const;
|
|
export type AgentRole = (typeof AGENT_ROLES)[number];
|
|
|
|
export const ISSUE_STATUSES = [
|
|
"backlog",
|
|
"todo",
|
|
"in_progress",
|
|
"in_review",
|
|
"done",
|
|
"blocked",
|
|
"cancelled",
|
|
] as const;
|
|
export type IssueStatus = (typeof ISSUE_STATUSES)[number];
|
|
|
|
export const ISSUE_PRIORITIES = ["critical", "high", "medium", "low"] as const;
|
|
export type IssuePriority = (typeof ISSUE_PRIORITIES)[number];
|
|
|
|
export const GOAL_LEVELS = ["company", "team", "agent", "task"] as const;
|
|
export type GoalLevel = (typeof GOAL_LEVELS)[number];
|
|
|
|
export const GOAL_STATUSES = ["planned", "active", "achieved", "cancelled"] as const;
|
|
export type GoalStatus = (typeof GOAL_STATUSES)[number];
|
|
|
|
export const PROJECT_STATUSES = [
|
|
"backlog",
|
|
"planned",
|
|
"in_progress",
|
|
"completed",
|
|
"cancelled",
|
|
] as const;
|
|
export type ProjectStatus = (typeof PROJECT_STATUSES)[number];
|
|
|
|
export const APPROVAL_TYPES = ["hire_agent", "approve_ceo_strategy"] as const;
|
|
export type ApprovalType = (typeof APPROVAL_TYPES)[number];
|
|
|
|
export const APPROVAL_STATUSES = ["pending", "approved", "rejected", "cancelled"] as const;
|
|
export type ApprovalStatus = (typeof APPROVAL_STATUSES)[number];
|
|
|
|
export const HEARTBEAT_INVOCATION_SOURCES = [
|
|
"timer",
|
|
"assignment",
|
|
"on_demand",
|
|
"automation",
|
|
] as const;
|
|
export type HeartbeatInvocationSource = (typeof HEARTBEAT_INVOCATION_SOURCES)[number];
|
|
|
|
export const WAKEUP_TRIGGER_DETAILS = ["manual", "ping", "callback", "system"] as const;
|
|
export type WakeupTriggerDetail = (typeof WAKEUP_TRIGGER_DETAILS)[number];
|
|
|
|
export const WAKEUP_REQUEST_STATUSES = [
|
|
"queued",
|
|
"claimed",
|
|
"coalesced",
|
|
"skipped",
|
|
"completed",
|
|
"failed",
|
|
"cancelled",
|
|
] as const;
|
|
export type WakeupRequestStatus = (typeof WAKEUP_REQUEST_STATUSES)[number];
|
|
|
|
export const HEARTBEAT_RUN_STATUSES = [
|
|
"queued",
|
|
"running",
|
|
"succeeded",
|
|
"failed",
|
|
"cancelled",
|
|
"timed_out",
|
|
] as const;
|
|
export type HeartbeatRunStatus = (typeof HEARTBEAT_RUN_STATUSES)[number];
|
|
|
|
export const LIVE_EVENT_TYPES = [
|
|
"heartbeat.run.queued",
|
|
"heartbeat.run.status",
|
|
"heartbeat.run.event",
|
|
"heartbeat.run.log",
|
|
"agent.status",
|
|
"activity.logged",
|
|
] as const;
|
|
export type LiveEventType = (typeof LIVE_EVENT_TYPES)[number];
|