|
| 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 ForgeFedTicket = { |
| 106 | + readonly id: string |
| 107 | + readonly attributedTo: string |
| 108 | + readonly summary: string |
| 109 | + readonly content: string |
| 110 | + readonly mediaType?: string | undefined |
| 111 | + readonly source?: string | undefined |
| 112 | + readonly published?: string | undefined |
| 113 | + readonly updated?: string | undefined |
| 114 | + readonly url?: string | undefined |
| 115 | +} |
| 116 | + |
| 117 | +export type FederationIssueStatus = "offered" | "accepted" | "rejected" |
| 118 | + |
| 119 | +export type FederationIssueRecord = { |
| 120 | + readonly issueId: string |
| 121 | + readonly offerId?: string | undefined |
| 122 | + readonly tracker?: string | undefined |
| 123 | + readonly status: FederationIssueStatus |
| 124 | + readonly receivedAt: string |
| 125 | + readonly ticket: ForgeFedTicket |
| 126 | +} |
| 127 | + |
| 128 | +export type CreateFollowRequest = { |
| 129 | + readonly actor?: string | undefined |
| 130 | + readonly object: string |
| 131 | + readonly domain?: string | undefined |
| 132 | + readonly inbox?: string | undefined |
| 133 | + readonly to?: ReadonlyArray<string> | undefined |
| 134 | + readonly capability?: string | undefined |
| 135 | +} |
| 136 | + |
| 137 | +export type FollowStatus = "pending" | "accepted" | "rejected" |
| 138 | + |
| 139 | +export type ActivityPubFollowActivity = { |
| 140 | + readonly "@context": "https://www.w3.org/ns/activitystreams" |
| 141 | + readonly id: string |
| 142 | + readonly type: "Follow" |
| 143 | + readonly actor: string |
| 144 | + readonly object: string |
| 145 | + readonly to?: ReadonlyArray<string> | undefined |
| 146 | + readonly capability?: string | undefined |
| 147 | +} |
| 148 | + |
| 149 | +export type ActivityPubPerson = { |
| 150 | + readonly "@context": "https://www.w3.org/ns/activitystreams" |
| 151 | + readonly type: "Person" |
| 152 | + readonly id: string |
| 153 | + readonly name: string |
| 154 | + readonly preferredUsername: string |
| 155 | + readonly summary: string |
| 156 | + readonly inbox: string |
| 157 | + readonly outbox: string |
| 158 | + readonly followers: string |
| 159 | + readonly following: string |
| 160 | + readonly liked: string |
| 161 | +} |
| 162 | + |
| 163 | +export type ActivityPubOrderedCollection = { |
| 164 | + readonly "@context": "https://www.w3.org/ns/activitystreams" |
| 165 | + readonly type: "OrderedCollection" |
| 166 | + readonly id: string |
| 167 | + readonly totalItems: number |
| 168 | + readonly orderedItems: ReadonlyArray<unknown> |
| 169 | +} |
| 170 | + |
| 171 | +export type FollowSubscription = { |
| 172 | + readonly id: string |
| 173 | + readonly activityId: string |
| 174 | + readonly actor: string |
| 175 | + readonly object: string |
| 176 | + readonly inbox?: string | undefined |
| 177 | + readonly to: ReadonlyArray<string> |
| 178 | + readonly capability?: string | undefined |
| 179 | + readonly status: FollowStatus |
| 180 | + readonly createdAt: string |
| 181 | + readonly updatedAt: string |
| 182 | + readonly activity: ActivityPubFollowActivity |
| 183 | +} |
| 184 | + |
| 185 | +export type FollowSubscriptionCreated = { |
| 186 | + readonly subscription: FollowSubscription |
| 187 | + readonly activity: ActivityPubFollowActivity |
| 188 | +} |
| 189 | + |
| 190 | +export type FederationInboxResult = |
| 191 | + | { |
| 192 | + readonly kind: "issue.offer" |
| 193 | + readonly issue: FederationIssueRecord |
| 194 | + } |
| 195 | + | { |
| 196 | + readonly kind: "issue.ticket" |
| 197 | + readonly issue: FederationIssueRecord |
| 198 | + } |
| 199 | + | { |
| 200 | + readonly kind: "follow.accept" |
| 201 | + readonly subscription: FollowSubscription |
| 202 | + } |
| 203 | + | { |
| 204 | + readonly kind: "follow.reject" |
| 205 | + readonly subscription: FollowSubscription |
| 206 | + } |
| 207 | + |
| 208 | +export type ApiEventType = |
| 209 | + | "snapshot" |
| 210 | + | "project.created" |
| 211 | + | "project.deleted" |
| 212 | + | "project.deployment.status" |
| 213 | + | "project.deployment.log" |
| 214 | + | "agent.started" |
| 215 | + | "agent.output" |
| 216 | + | "agent.exited" |
| 217 | + | "agent.stopped" |
| 218 | + | "agent.error" |
| 219 | + |
| 220 | +export type ApiEvent = { |
| 221 | + readonly seq: number |
| 222 | + readonly projectId: string |
| 223 | + readonly type: ApiEventType |
| 224 | + readonly at: string |
| 225 | + readonly payload: unknown |
| 226 | +} |
0 commit comments