|
| 1 | +export type ProjectStatus = "running" | "stopped" | "unknown" |
| 2 | + |
| 3 | +export type AgentProvider = "codex" | "opencode" | "claude" | "custom" |
| 4 | + |
| 5 | +export type AgentStatus = "starting" | "running" | "stopping" | "stopped" | "exited" | "failed" |
| 6 | + |
| 7 | +export type ProjectSummary = { |
| 8 | + readonly id: string |
| 9 | + readonly displayName: string |
| 10 | + readonly repoUrl: string |
| 11 | + readonly repoRef: string |
| 12 | + readonly status: ProjectStatus |
| 13 | + readonly statusLabel: string |
| 14 | +} |
| 15 | + |
| 16 | +export type ProjectDetails = ProjectSummary & { |
| 17 | + readonly containerName: string |
| 18 | + readonly serviceName: string |
| 19 | + readonly sshUser: string |
| 20 | + readonly sshPort: number |
| 21 | + readonly targetDir: string |
| 22 | + readonly projectDir: string |
| 23 | + readonly sshCommand: string |
| 24 | + readonly envGlobalPath: string |
| 25 | + readonly envProjectPath: string |
| 26 | + readonly codexAuthPath: string |
| 27 | + readonly codexHome: string |
| 28 | +} |
| 29 | + |
| 30 | +export type CreateProjectRequest = { |
| 31 | + readonly repoUrl?: string | undefined |
| 32 | + readonly repoRef?: string | undefined |
| 33 | + readonly targetDir?: string | undefined |
| 34 | + readonly sshPort?: string | undefined |
| 35 | + readonly sshUser?: string | undefined |
| 36 | + readonly containerName?: string | undefined |
| 37 | + readonly serviceName?: string | undefined |
| 38 | + readonly volumeName?: string | undefined |
| 39 | + readonly secretsRoot?: string | undefined |
| 40 | + readonly authorizedKeysPath?: string | undefined |
| 41 | + readonly envGlobalPath?: string | undefined |
| 42 | + readonly envProjectPath?: string | undefined |
| 43 | + readonly codexAuthPath?: string | undefined |
| 44 | + readonly codexHome?: string | undefined |
| 45 | + readonly dockerNetworkMode?: string | undefined |
| 46 | + readonly dockerSharedNetworkName?: string | undefined |
| 47 | + readonly enableMcpPlaywright?: boolean | undefined |
| 48 | + readonly outDir?: string | undefined |
| 49 | + readonly gitTokenLabel?: string | undefined |
| 50 | + readonly codexTokenLabel?: string | undefined |
| 51 | + readonly claudeTokenLabel?: string | undefined |
| 52 | + readonly up?: boolean | undefined |
| 53 | + readonly openSsh?: boolean | undefined |
| 54 | + readonly force?: boolean | undefined |
| 55 | + readonly forceEnv?: boolean | undefined |
| 56 | +} |
| 57 | + |
| 58 | +export type AgentEnvVar = { |
| 59 | + readonly key: string |
| 60 | + readonly value: string |
| 61 | +} |
| 62 | + |
| 63 | +export type CreateAgentRequest = { |
| 64 | + readonly provider: AgentProvider |
| 65 | + readonly command?: string | undefined |
| 66 | + readonly args?: ReadonlyArray<string> | undefined |
| 67 | + readonly cwd?: string | undefined |
| 68 | + readonly env?: ReadonlyArray<AgentEnvVar> | undefined |
| 69 | + readonly label?: string | undefined |
| 70 | +} |
| 71 | + |
| 72 | +export type AgentSession = { |
| 73 | + readonly id: string |
| 74 | + readonly projectId: string |
| 75 | + readonly provider: AgentProvider |
| 76 | + readonly label: string |
| 77 | + readonly command: string |
| 78 | + readonly containerName: string |
| 79 | + readonly status: AgentStatus |
| 80 | + readonly source: string |
| 81 | + readonly pidFile: string |
| 82 | + readonly hostPid: number | null |
| 83 | + readonly startedAt: string |
| 84 | + readonly updatedAt: string |
| 85 | + readonly stoppedAt?: string | undefined |
| 86 | + readonly exitCode?: number | undefined |
| 87 | + readonly signal?: string | undefined |
| 88 | +} |
| 89 | + |
| 90 | +export type AgentLogLine = { |
| 91 | + readonly at: string |
| 92 | + readonly stream: "stdout" | "stderr" |
| 93 | + readonly line: string |
| 94 | +} |
| 95 | + |
| 96 | +export type AgentAttachInfo = { |
| 97 | + readonly projectId: string |
| 98 | + readonly agentId: string |
| 99 | + readonly containerName: string |
| 100 | + readonly pidFile: string |
| 101 | + readonly inspectCommand: string |
| 102 | + readonly shellCommand: string |
| 103 | +} |
| 104 | + |
| 105 | +export type ApiEventType = |
| 106 | + | "snapshot" |
| 107 | + | "project.created" |
| 108 | + | "project.deleted" |
| 109 | + | "project.deployment.status" |
| 110 | + | "project.deployment.log" |
| 111 | + | "agent.started" |
| 112 | + | "agent.output" |
| 113 | + | "agent.exited" |
| 114 | + | "agent.stopped" |
| 115 | + | "agent.error" |
| 116 | + |
| 117 | +export type ApiEvent = { |
| 118 | + readonly seq: number |
| 119 | + readonly projectId: string |
| 120 | + readonly type: ApiEventType |
| 121 | + readonly at: string |
| 122 | + readonly payload: unknown |
| 123 | +} |
0 commit comments