@sealant/api-contracts-next 0.0.0-next.0 → 0.39.0-next.682

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE +202 -0
  2. package/dist/core-api/access-tokens.d.ts +126 -0
  3. package/dist/core-api/access-tokens.js +72 -0
  4. package/dist/core-api/budgets.d.ts +15 -0
  5. package/dist/core-api/budgets.js +13 -0
  6. package/dist/core-api/connected-accounts.d.ts +226 -0
  7. package/dist/core-api/connected-accounts.js +128 -0
  8. package/dist/core-api/control-plane.d.ts +1318 -0
  9. package/dist/core-api/control-plane.js +31 -0
  10. package/dist/core-api/github.d.ts +261 -0
  11. package/dist/core-api/github.js +153 -0
  12. package/dist/core-api/inference.d.ts +223 -0
  13. package/dist/core-api/inference.js +139 -0
  14. package/dist/core-api/oci-names.d.ts +21 -0
  15. package/dist/core-api/oci-names.js +44 -0
  16. package/dist/core-api/packages.d.ts +179 -0
  17. package/dist/core-api/packages.js +60 -0
  18. package/dist/core-api/profiles.d.ts +188 -0
  19. package/dist/core-api/profiles.js +88 -0
  20. package/dist/core-api/record-events.d.ts +209 -0
  21. package/dist/core-api/record-events.js +193 -0
  22. package/dist/core-api/registries.d.ts +106 -0
  23. package/dist/core-api/registries.js +85 -0
  24. package/dist/core-api/runs.d.ts +516 -0
  25. package/dist/core-api/runs.js +284 -0
  26. package/dist/core-api/sessions.d.ts +390 -0
  27. package/dist/core-api/sessions.js +264 -0
  28. package/dist/core-api/ssh-keys.d.ts +120 -0
  29. package/dist/core-api/ssh-keys.js +108 -0
  30. package/dist/core-api/system.d.ts +51 -0
  31. package/dist/core-api/system.js +41 -0
  32. package/dist/core-api/users.d.ts +71 -0
  33. package/dist/core-api/users.js +48 -0
  34. package/dist/core-api/workspaces.d.ts +1880 -0
  35. package/dist/core-api/workspaces.js +980 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.js +18 -0
  38. package/dist/workspace-environment.d.ts +124 -0
  39. package/dist/workspace-environment.js +259 -0
  40. package/package.json +31 -9
@@ -0,0 +1,1880 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
+ import { BudgetExceededError } from "./budgets.js";
4
+ /**
5
+ * `retained`: the workspace's executor ended (or its capture launch failed after it started)
6
+ * with work on its disk not confirmed saved. It is kept, not dead: the control plane drains or
7
+ * recovers it with the capture token it was launched with, and reports `stopped` or `failed`
8
+ * again only once the retention ends (saved and removed, discarded, or lost). A caller keeps
9
+ * what the recovery needs — the session's lease and token — while it reads `retained`. See
10
+ * `captureDrain.retained` for why and the recovery attempts.
11
+ */
12
+ export declare const workspaceStatusSchema: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
13
+ export type WorkspaceStatus = typeof workspaceStatusSchema.Type;
14
+ export declare const workspaceRuntimeSchema: Schema.Struct<{
15
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
16
+ /**
17
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
18
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
19
+ */
20
+ readonly resourceId: Schema.String;
21
+ readonly reference: Schema.String;
22
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
23
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
24
+ readonly endpoint: Schema.optional<Schema.String>;
25
+ /**
26
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
27
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
28
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
29
+ * only from control planes that predate it.
30
+ */
31
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
32
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
33
+ readonly runId: Schema.optional<Schema.String>;
34
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
35
+ readonly launchId: Schema.optional<Schema.String>;
36
+ }>;
37
+ export type WorkspaceRuntime = typeof workspaceRuntimeSchema.Type;
38
+ export declare const workspaceSshTargetSchema: Schema.Struct<{
39
+ readonly workspaceId: Schema.String;
40
+ readonly attemptId: Schema.String;
41
+ readonly runtime: Schema.Struct<{
42
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
43
+ readonly resourceId: Schema.String;
44
+ readonly reference: Schema.String;
45
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped"]>;
46
+ readonly endpoint: Schema.String;
47
+ }>;
48
+ }>;
49
+ export type WorkspaceSshTarget = typeof workspaceSshTargetSchema.Type;
50
+ export declare const workspacePublishedImageSchema: Schema.Struct<{
51
+ readonly reference: Schema.String;
52
+ readonly digestReference: Schema.String;
53
+ readonly digest: Schema.String;
54
+ }>;
55
+ export declare const workspaceErrorSchema: Schema.Struct<{
56
+ readonly message: Schema.String;
57
+ readonly code: Schema.optional<Schema.String>;
58
+ }>;
59
+ export declare const githubWorkspaceSourceSelectionSchema: Schema.Struct<{
60
+ readonly provider: Schema.Literal<"github">;
61
+ readonly installationId: Schema.String;
62
+ readonly installationRepositoryId: Schema.String;
63
+ readonly ref: Schema.optional<Schema.String>;
64
+ }>;
65
+ export type GitHubWorkspaceSourceSelection = typeof githubWorkspaceSourceSelectionSchema.Type;
66
+ export declare const createWorkspaceCredentialsSchema: Schema.Struct<{
67
+ readonly profileId: Schema.optional<Schema.String>;
68
+ readonly claude: Schema.optional<Schema.String>;
69
+ readonly codex: Schema.optional<Schema.String>;
70
+ readonly github: Schema.optional<Schema.String>;
71
+ }>;
72
+ export type CreateWorkspaceCredentials = typeof createWorkspaceCredentialsSchema.Type;
73
+ export declare const createWorkspaceRequestSchema: Schema.Struct<{
74
+ readonly ownerUserId: Schema.String;
75
+ readonly registryId: Schema.String;
76
+ readonly repository: Schema.String;
77
+ readonly tag: Schema.String;
78
+ readonly name: Schema.optional<Schema.String>;
79
+ readonly sourceSelection: Schema.optional<Schema.Struct<{
80
+ readonly provider: Schema.Literal<"github">;
81
+ readonly installationId: Schema.String;
82
+ readonly installationRepositoryId: Schema.String;
83
+ readonly ref: Schema.optional<Schema.String>;
84
+ }>>;
85
+ readonly dotfilesSelection: Schema.optional<Schema.Struct<{
86
+ readonly provider: Schema.Literal<"github">;
87
+ readonly installationId: Schema.String;
88
+ readonly installationRepositoryId: Schema.String;
89
+ readonly ref: Schema.optional<Schema.String>;
90
+ }>>;
91
+ readonly credentials: Schema.optional<Schema.Struct<{
92
+ readonly profileId: Schema.optional<Schema.String>;
93
+ readonly claude: Schema.optional<Schema.String>;
94
+ readonly codex: Schema.optional<Schema.String>;
95
+ readonly github: Schema.optional<Schema.String>;
96
+ }>>;
97
+ readonly spec: Schema.Unknown;
98
+ readonly secretEnv: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
99
+ readonly captureToken: Schema.optional<Schema.String>;
100
+ readonly ttlSeconds: Schema.optional<Schema.Int>;
101
+ /**
102
+ * Makes the create idempotent for this owner: a repeated create with the same key returns the
103
+ * workspace the first one made (`replayed: true`) instead of creating another, so a caller that
104
+ * lost the answer (a crash, a timeout) can repeat it or look the workspace up
105
+ * (`GET /v1/workspaces?idempotencyKey=`). Scoped to `ownerUserId`. The `idempotency-key` header
106
+ * means the same; this field wins when both are sent.
107
+ */
108
+ readonly idempotencyKey: Schema.optional<Schema.String>;
109
+ /**
110
+ * The caller's immutable identity for the ONE physical executor this create launches, minted
111
+ * before create (a caller that makes the create idempotent can reuse its idempotency key). It is
112
+ * recorded on the launch attempt and reported with the executor (`runtime.launchId`); a stop's
113
+ * completion attestation that names a launch must name this one.
114
+ */
115
+ readonly launchId: Schema.optional<Schema.String>;
116
+ }>;
117
+ export type CreateWorkspaceRequest = typeof createWorkspaceRequestSchema.Type;
118
+ export declare const createWorkspaceHeadersSchema: Schema.Struct<{
119
+ readonly "idempotency-key": Schema.optional<Schema.String>;
120
+ }>;
121
+ export type CreateWorkspaceHeaders = typeof createWorkspaceHeadersSchema.Type;
122
+ /**
123
+ * The `harnessId` stamped on runs created by the deterministic-exec endpoint, so consumers can tell
124
+ * check runs apart from harness runs when listing/reading runs.
125
+ */
126
+ export declare const execRunHarnessId = "exec";
127
+ /**
128
+ * Deterministic exec: run an ORDERED LIST of commands in the workspace, recorded as ONE run (a
129
+ * "check run") — e.g. a causal proof `base fails · head passes · revert fails` as three commands
130
+ * with three recorded exit codes.
131
+ *
132
+ * Semantics differ deliberately from harness runs: every command executes IN ORDER regardless of
133
+ * exit codes (a nonzero exit is a check DATUM, not an execution failure), and the run completes iff
134
+ * every command executed and was recorded. The run's `exitCode` is the LAST command's; per-command
135
+ * exit codes live in the execution record (`processExited` events). The run FAILS only when the
136
+ * execution machinery broke (workspace gone, transport dropped mid-command) — so `status` answers
137
+ * "can I trust these exit codes", not "did the checks pass".
138
+ */
139
+ export declare const execWorkspaceRequestSchema: Schema.Struct<{
140
+ readonly ownerUserId: Schema.String;
141
+ /** Commands execute sequentially in the workspace, each recorded like any other process. */
142
+ readonly commands: Schema.$Array<Schema.Struct<{
143
+ readonly executable: Schema.String;
144
+ readonly args: Schema.$Array<Schema.String>;
145
+ readonly cwd: Schema.optional<Schema.String>;
146
+ }>>;
147
+ }>;
148
+ export type ExecWorkspaceRequest = typeof execWorkspaceRequestSchema.Type;
149
+ /**
150
+ * Bind a standby workspace's working directory, or a bindable extra mount, to one subdirectory of
151
+ * its root (sealantd ADR-0014). `mountPath` defaults to the working directory; an empty `subpath`
152
+ * unbinds. The reply is the workspace's full set of live bindings, which every relaunch re-applies.
153
+ */
154
+ export declare const bindWorkspaceRequestSchema: Schema.Struct<{
155
+ readonly ownerUserId: Schema.String;
156
+ readonly mountPath: Schema.optional<Schema.String>;
157
+ readonly subpath: Schema.String;
158
+ }>;
159
+ export type BindWorkspaceRequest = typeof bindWorkspaceRequestSchema.Type;
160
+ export declare const workspaceBindSchema: Schema.Struct<{
161
+ readonly mountPath: Schema.String;
162
+ readonly subpath: Schema.String;
163
+ }>;
164
+ export declare const workspaceBindsSchema: Schema.Struct<{
165
+ readonly binds: Schema.$Array<Schema.Struct<{
166
+ readonly mountPath: Schema.String;
167
+ readonly subpath: Schema.String;
168
+ }>>;
169
+ }>;
170
+ export type WorkspaceBinds = typeof workspaceBindsSchema.Type;
171
+ /** Which flush sealantd runs: `final` (the executor is ending) or `suspend` (a checkpoint). */
172
+ export declare const workspaceCaptureFlushKindSchema: Schema.Literals<readonly ["final", "suspend"]>;
173
+ export type WorkspaceCaptureFlushKind = typeof workspaceCaptureFlushKindSchema.Type;
174
+ /**
175
+ * Flush a capture-sourced workspace's captures (sealantd ADR-0015 `capture.flush`): a capture,
176
+ * then everything staged is shipped and registered on the session channel. Synchronous over the
177
+ * daemon's control connection, bounded by `deadlineMs`. The reply is the daemon's capture status.
178
+ *
179
+ * `kind: "final"` says the executor is ending: the daemon stops its managed processes (SIGTERM,
180
+ * then SIGKILL after `graceMs`), snapshots both capture classes, ships, and reports `complete`.
181
+ * Only `complete === true` means the executor's work is saved. After a final flush the daemon
182
+ * refuses new work for good. A final flush that runs past its deadline answers `complete: false`
183
+ * and keeps shipping in the daemon, so later status reads and repeated finals converge.
184
+ * `kind: "suspend"` (the default) is a checkpoint: the executor keeps running.
185
+ */
186
+ export declare const flushWorkspaceCaptureRequestSchema: Schema.Struct<{
187
+ readonly ownerUserId: Schema.String;
188
+ /** `final` or `suspend` (the default). */
189
+ readonly kind: Schema.optional<Schema.Literals<readonly ["final", "suspend"]>>;
190
+ /** How long the daemon may take before it answers, in milliseconds. Absent: its own default. */
191
+ readonly deadlineMs: Schema.optional<Schema.Int>;
192
+ /**
193
+ * Final only: how long managed processes get between SIGTERM and SIGKILL, in milliseconds,
194
+ * counted inside `deadlineMs`. Absent: the daemon's default.
195
+ */
196
+ readonly graceMs: Schema.optional<Schema.Int>;
197
+ }>;
198
+ export type FlushWorkspaceCaptureRequest = typeof flushWorkspaceCaptureRequestSchema.Type;
199
+ /**
200
+ * Read a capture-sourced workspace's capture status (sealantd `capture.status`) without flushing:
201
+ * what a drain polls to show `saving · N left` and to know when the executor may go away.
202
+ */
203
+ export declare const getWorkspaceCaptureStatusQuerySchema: Schema.Struct<{
204
+ readonly ownerUserId: Schema.String;
205
+ }>;
206
+ export type GetWorkspaceCaptureStatusQuery = typeof getWorkspaceCaptureStatusQuerySchema.Type;
207
+ export declare const captureClassSchema: Schema.Literals<readonly ["small", "bulk"]>;
208
+ export type CaptureClass = typeof captureClassSchema.Type;
209
+ /** One capture class's snaps (sealantd `CaptureClassSnaps`). */
210
+ export declare const captureClassSnapsSchema: Schema.Struct<{
211
+ readonly class: Schema.Literals<readonly ["small", "bulk"]>;
212
+ /** Snaps of this class that failed since the daemon started. */
213
+ readonly snapsFailed: Schema.Number;
214
+ /** The last snap's error, while the last snap failed; absent once one succeeds. */
215
+ readonly lastSnapError: Schema.optional<Schema.String>;
216
+ /** When the current run of failed snaps began (Unix ms), while the last snap failed. */
217
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
218
+ }>;
219
+ export type CaptureClassSnaps = typeof captureClassSnapsSchema.Type;
220
+ /**
221
+ * Where in an executor's own history it made an answer or a seal (sealantd's stamp, decision 17):
222
+ * its capture lease epoch, the launch it runs as, the daemon boot that answered, how many daemon
223
+ * boots opened its disk (0: unknown), an observation number that only grows within that boot, and
224
+ * the capture head. Evidence about one executor is ordered by it, never by any clock: of the same
225
+ * epoch, launch and boot by `observation`; of the same epoch and launch and different boots whose
226
+ * generations are both above 0 and differ, by (`bootGeneration`, `observation`); anything else
227
+ * cannot be ordered.
228
+ */
229
+ export declare const captureExecutorOriginSchema: Schema.Struct<{
230
+ readonly epoch: Schema.Int;
231
+ readonly launch: Schema.String;
232
+ readonly bootId: Schema.String;
233
+ readonly bootGeneration: Schema.Int;
234
+ readonly observation: Schema.Int;
235
+ readonly headN: Schema.optional<Schema.Int>;
236
+ }>;
237
+ export type CaptureExecutorOrigin = typeof captureExecutorOriginSchema.Type;
238
+ /**
239
+ * A capture step running past its bound (sealantd `CaptureOverdue`): what is running, outermost
240
+ * first and `›`-separated (`small snap › git cat-file --batch-check`), when it started (Unix ms,
241
+ * display only), how long it had been running when the answer was made, and its bound (ms).
242
+ */
243
+ export declare const captureOverdueSchema: Schema.Struct<{
244
+ readonly step: Schema.String;
245
+ readonly startedUnixMs: Schema.Number;
246
+ readonly runningMs: Schema.Number;
247
+ readonly boundMs: Schema.Number;
248
+ }>;
249
+ export type CaptureOverdue = typeof captureOverdueSchema.Type;
250
+ export declare const workspaceCaptureStatusSchema: Schema.Struct<{
251
+ readonly epoch: Schema.Number;
252
+ readonly worktreeId: Schema.String;
253
+ /** The newest capture the session channel has registered for this worktree. */
254
+ readonly headN: Schema.optional<Schema.Number>;
255
+ /** Captures staged on the executor and not yet registered: the unsaved queue. */
256
+ readonly pending: Schema.Number;
257
+ readonly stagedBytes: Schema.Number;
258
+ readonly uploadedObjects: Schema.Number;
259
+ readonly uploadedBytes: Schema.Number;
260
+ readonly registered: Schema.Number;
261
+ readonly fenced: Schema.Boolean;
262
+ readonly paused: Schema.Boolean;
263
+ readonly lastSnapUnixMs: Schema.optional<Schema.Number>;
264
+ /**
265
+ * Capture classes the registrar refused for the session's byte quota: nothing of these ships
266
+ * until the next epoch or re-plan, whatever `pending` says. Non-empty means work is NOT being
267
+ * saved. Absent from control planes that predate it.
268
+ */
269
+ readonly refused: Schema.optional<Schema.$Array<Schema.Literals<readonly ["small", "bulk"]>>>;
270
+ /**
271
+ * Bytes still to ship, and bulk captures still pending (sealantd's `pending_bytes` /
272
+ * `pending_bulk`). Every field below `refused` is absent until the daemon reports it (the
273
+ * control plane's pinned sealantd wire predates them).
274
+ */
275
+ readonly pendingBytes: Schema.optional<Schema.Number>;
276
+ readonly pendingBulk: Schema.optional<Schema.Number>;
277
+ /**
278
+ * The daemon's own account of its last FINAL flush: true only when it quiesced every managed
279
+ * process, snapshotted both capture classes and registered everything. The only proof that an
280
+ * executor may go away; `pending === 0` alone is not. Absent until sealantd reports it (read
281
+ * absent as not complete).
282
+ */
283
+ readonly complete: Schema.optional<Schema.Boolean>;
284
+ /**
285
+ * Why the last final flush is not complete (`not-final`, `in-progress`, `processes-remain`,
286
+ * `sweep-unavailable`, `snapshot-failed`, `unreadable`, `fenced`, `conflict`, `deadline`,
287
+ * `ship-failed`, `pending`, `internal`). A class whose last snap failed is `snapshot-failed`.
288
+ */
289
+ readonly incompleteReason: Schema.optional<Schema.String>;
290
+ /**
291
+ * Paths the last snap of each class could not read (listed, stat'ed or opened), summed over
292
+ * both classes. Never taken as deleted: an automatic snap carries a path's last captured
293
+ * content forward, a final snap fails instead.
294
+ */
295
+ readonly unreadable: Schema.optional<Schema.Number>;
296
+ /** Of `unreadable`, the paths whose last captured content was carried forward. */
297
+ readonly carried: Schema.optional<Schema.Number>;
298
+ /**
299
+ * The first unreadable paths (at most 20), virtual: `tree/<path>` under the worktree,
300
+ * `.git/<path>`, `harness/<path>`; small class first.
301
+ */
302
+ readonly unreadablePaths: Schema.optional<Schema.$Array<Schema.String>>;
303
+ /**
304
+ * A capture the registrar refused to register that the executor is working through:
305
+ * `missing-objects` (an object it names is not in the store) or `unrestorable` (a section's
306
+ * tree would not restore). Nothing is dropped: its objects are uploaded again and it is
307
+ * rebuilt from disk in its place.
308
+ */
309
+ readonly registerRefused: Schema.optional<Schema.String>;
310
+ /** That refused capture's chain position. */
311
+ readonly registerRefusedN: Schema.optional<Schema.Number>;
312
+ /** The first keys (at most 20) the registrar named as missing. */
313
+ readonly registerMissing: Schema.optional<Schema.$Array<Schema.String>>;
314
+ /** Register refusals the daemon has seen since it started. */
315
+ readonly registerRefusals: Schema.optional<Schema.Number>;
316
+ /** The refused capture waits to be rebuilt from disk; nothing behind it registers first. */
317
+ readonly repairing: Schema.optional<Schema.Boolean>;
318
+ /**
319
+ * A bulk build is in progress: its capture is not queued yet, so `pending` and `pendingBulk`
320
+ * do not count it (`pendingBytes` counts what it has staged). A drain is not done while true.
321
+ */
322
+ readonly bulkBuilding: Schema.optional<Schema.Boolean>;
323
+ /**
324
+ * Each captured class's snaps: how many failed since the daemon started, and the last one's
325
+ * error while it fails. A snap that fails stages nothing: what changed since the last capture
326
+ * is on the executor's disk only.
327
+ */
328
+ readonly snaps: Schema.optional<Schema.$Array<Schema.Struct<{
329
+ readonly class: Schema.Literals<readonly ["small", "bulk"]>;
330
+ /** Snaps of this class that failed since the daemon started. */
331
+ readonly snapsFailed: Schema.Number;
332
+ /** The last snap's error, while the last snap failed; absent once one succeeds. */
333
+ readonly lastSnapError: Schema.optional<Schema.String>;
334
+ /** When the current run of failed snaps began (Unix ms), while the last snap failed. */
335
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
336
+ }>>>;
337
+ /**
338
+ * Derived from `snaps`: the error of the class that has been failing longest. Present means the
339
+ * executor's newest work is NOT being captured, whatever `pending` says.
340
+ */
341
+ readonly lastSnapError: Schema.optional<Schema.String>;
342
+ /** Derived from `snaps`: when the earliest current run of failed snaps began (Unix ms). */
343
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
344
+ /** Derived from `snaps`: failed snaps of every class since the daemon started. */
345
+ readonly snapsFailed: Schema.optional<Schema.Number>;
346
+ /**
347
+ * Where in the executor's own history this answer was made. Absent from a daemon that predates
348
+ * the stamp: such answers cannot be ordered by position.
349
+ */
350
+ readonly origin: Schema.optional<Schema.Struct<{
351
+ readonly epoch: Schema.Int;
352
+ readonly launch: Schema.String;
353
+ readonly bootId: Schema.String;
354
+ readonly bootGeneration: Schema.Int;
355
+ readonly observation: Schema.Int;
356
+ readonly headN: Schema.optional<Schema.Int>;
357
+ }>>;
358
+ /**
359
+ * A capture step past its bound, while one is: the executor's capture is stuck there now. Not a
360
+ * verdict: the step's own limit ends it and the snap fails (`snaps`). Absent while nothing is
361
+ * past its bound, and from a daemon or control plane that predates it.
362
+ */
363
+ readonly overdue: Schema.optional<Schema.Struct<{
364
+ readonly step: Schema.String;
365
+ readonly startedUnixMs: Schema.Number;
366
+ readonly runningMs: Schema.Number;
367
+ readonly boundMs: Schema.Number;
368
+ }>>;
369
+ }>;
370
+ export type WorkspaceCaptureStatus = typeof workspaceCaptureStatusSchema.Type;
371
+ /**
372
+ * Re-plan a capture-sourced workspace (sealantd 0.15 `capture.replan`, the claim hook): the daemon
373
+ * asks the session channel for its plan again with no worktree named, delta-materialises the
374
+ * answer over what is on disk, and captures under the answered worktree and epoch from then on.
375
+ * Synchronous over the daemon's control connection. Idempotent: `unchanged` is true when the
376
+ * answer named the worktree and epoch already in force.
377
+ */
378
+ export declare const replanWorkspaceCaptureRequestSchema: Schema.Struct<{
379
+ readonly ownerUserId: Schema.String;
380
+ }>;
381
+ export type ReplanWorkspaceCaptureRequest = typeof replanWorkspaceCaptureRequestSchema.Type;
382
+ export declare const workspaceCaptureReplannedSchema: Schema.Struct<{
383
+ readonly worktreeId: Schema.String;
384
+ readonly epoch: Schema.Number;
385
+ readonly headN: Schema.optional<Schema.Number>;
386
+ readonly headCaptureId: Schema.optional<Schema.String>;
387
+ readonly filesWritten: Schema.Number;
388
+ readonly bytesWritten: Schema.Number;
389
+ readonly filesSkipped: Schema.Number;
390
+ readonly bytesSkipped: Schema.Number;
391
+ readonly removed: Schema.Number;
392
+ readonly unchanged: Schema.Boolean;
393
+ }>;
394
+ export type WorkspaceCaptureReplanned = typeof workspaceCaptureReplannedSchema.Type;
395
+ export declare const renameWorkspaceRequestSchema: Schema.Struct<{
396
+ readonly name: Schema.String;
397
+ /** The workspace's owner. Required by the control plane: a rename that names none finds nothing. */
398
+ readonly ownerUserId: Schema.optional<Schema.String>;
399
+ }>;
400
+ export type RenameWorkspaceRequest = typeof renameWorkspaceRequestSchema.Type;
401
+ export declare const stopWorkspaceRequestSchema: Schema.Struct<{
402
+ readonly ownerUserId: Schema.String;
403
+ /**
404
+ * End the workspace WITHOUT saving its unsaved captures. A capture-sourced workspace is
405
+ * otherwise drained before it stops, and kept running for as long as its work cannot be
406
+ * confirmed saved; this is the owner's explicit way out. The request is recorded (who, when)
407
+ * and every stop path honours it: the runtime is terminated at once, and the workspace's
408
+ * `captureDrain` reads `discarded`. Accepted on a workspace already stopped whose runtime is
409
+ * still up (a kept one). Owner only.
410
+ */
411
+ readonly discardUnsaved: Schema.optional<Schema.Boolean>;
412
+ /**
413
+ * The caller's attestation that its capture store holds a SEALED final capture of this
414
+ * workspace's current executor: a FINAL flush that completed (every writer stopped, both
415
+ * classes snapshotted, everything registered) and was recorded durably by the store. It is
416
+ * permission to remove that executor's disk once it has ended, even when this control plane
417
+ * never read `complete: true` from it itself (the FINAL reply was lost, the daemon exited
418
+ * before a drain reached it). Accepted only when `executorId` names the current executor — the
419
+ * run id, or the runtime's `resourceId` / `reference` (`workspace.details().runtime`) — and
420
+ * nothing the control plane observed from the executor contradicts it: an older `epoch` than
421
+ * the executor reported, a capture past `captureN`, or — in the same epoch — a report that its
422
+ * work is NOT saved (incomplete, changed, unreadable, a failed snapshot) that the executor's
423
+ * own history does not place before the seal (`origin`; without it, any such report at or past
424
+ * `captureN` counts against the seal). Otherwise ignored, and the executor is kept as before.
425
+ * Weighed again
426
+ * when it is used: a later report that the work is not saved revokes it. A seal stands in for
427
+ * a lost FINAL answer, never for a received one that said the work is not saved. Never a
428
+ * reason to skip the drain of a running executor.
429
+ */
430
+ readonly completion: Schema.optional<Schema.Struct<{
431
+ /** The sealed capture's chain position (`n`). */
432
+ readonly captureN: Schema.Int;
433
+ /** The capture lease epoch the seal was made under. */
434
+ readonly epoch: Schema.Int;
435
+ /** The executor the seal names: run id, or runtime `resourceId` / `reference`. */
436
+ readonly executorId: Schema.String;
437
+ /**
438
+ * The launch identity the seal names (`final_seal.executor`). Required when the create named
439
+ * a `launchId`, and then it must be that one; an attestation without it, or naming another
440
+ * launch, is ignored (a seal never transfers between executors).
441
+ */
442
+ readonly launchId: Schema.optional<Schema.String>;
443
+ /**
444
+ * When the store recorded the seal (ISO 8601). Kept for display: clocks order nothing. It
445
+ * must still read as a time.
446
+ */
447
+ readonly sealedAt: Schema.optional<Schema.String>;
448
+ /**
449
+ * Where in the executor's own history the seal was made (sealantd stamps it on the
450
+ * `final_seal`): the one thing that orders the seal against a report of the same capture
451
+ * that its work is not saved. Without it, such a report at or past `captureN` counts
452
+ * against the seal.
453
+ */
454
+ readonly origin: Schema.optional<Schema.Struct<{
455
+ readonly epoch: Schema.Int;
456
+ readonly launch: Schema.String;
457
+ readonly bootId: Schema.String;
458
+ readonly bootGeneration: Schema.Int;
459
+ readonly observation: Schema.Int;
460
+ readonly headN: Schema.optional<Schema.Int>;
461
+ }>>;
462
+ }>>;
463
+ }>;
464
+ export type StopWorkspaceRequest = typeof stopWorkspaceRequestSchema.Type;
465
+ export declare const stopWorkspaceResponseSchema: Schema.Struct<{
466
+ readonly workspaceId: Schema.String;
467
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
468
+ /**
469
+ * What became of a `completion` attestation on the request: `accepted` (recorded; it lets the
470
+ * executor's disk go once it has ended) or `ignored` (it does not name this executor, or is for
471
+ * an older epoch; `detail` says which). Absent when the request carried none.
472
+ */
473
+ readonly completion: Schema.optional<Schema.Struct<{
474
+ readonly outcome: Schema.Literals<readonly ["accepted", "ignored"]>;
475
+ readonly detail: Schema.optional<Schema.String>;
476
+ }>>;
477
+ }>;
478
+ export type StopWorkspaceResponse = typeof stopWorkspaceResponseSchema.Type;
479
+ /** Owner-scoped: ask the control plane to recover the workspace's retained executor now. */
480
+ export declare const recoverWorkspaceRequestSchema: Schema.Struct<{
481
+ readonly ownerUserId: Schema.String;
482
+ }>;
483
+ export type RecoverWorkspaceRequest = typeof recoverWorkspaceRequestSchema.Type;
484
+ /**
485
+ * `requested`: the workspace's executor is retained (its disk holds work not confirmed saved) and
486
+ * a recovery attempt is due now; `recoverable` says whether its runtime can restart it on its own
487
+ * disk (Docker) or only report it (Kubernetes, MicroVM). `not-retained`: nothing is retained for
488
+ * the workspace's current run; nothing was done.
489
+ */
490
+ export declare const recoverWorkspaceResponseSchema: Schema.Struct<{
491
+ readonly workspaceId: Schema.String;
492
+ readonly state: Schema.Literals<readonly ["requested", "not-retained"]>;
493
+ readonly recoverable: Schema.optional<Schema.Boolean>;
494
+ }>;
495
+ export type RecoverWorkspaceResponse = typeof recoverWorkspaceResponseSchema.Type;
496
+ export declare const restartWorkspaceRequestSchema: Schema.Struct<{
497
+ readonly ownerUserId: Schema.String;
498
+ }>;
499
+ export type RestartWorkspaceRequest = typeof restartWorkspaceRequestSchema.Type;
500
+ export declare const restartWorkspaceResponseSchema: Schema.Struct<{
501
+ readonly workspaceId: Schema.String;
502
+ /** The new attempt driving the fresh launch. */
503
+ readonly runId: Schema.String;
504
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
505
+ }>;
506
+ export type RestartWorkspaceResponse = typeof restartWorkspaceResponseSchema.Type;
507
+ export declare const expireWorkspaceRequestSchema: Schema.Struct<{
508
+ readonly ownerUserId: Schema.String;
509
+ readonly ttlSeconds: Schema.optional<Schema.NullOr<Schema.Int>>;
510
+ }>;
511
+ export type ExpireWorkspaceRequest = typeof expireWorkspaceRequestSchema.Type;
512
+ export declare const expireWorkspaceResponseSchema: Schema.Struct<{
513
+ readonly workspaceId: Schema.String;
514
+ readonly expiresAt: Schema.NullOr<Schema.String>;
515
+ }>;
516
+ export type ExpireWorkspaceResponse = typeof expireWorkspaceResponseSchema.Type;
517
+ export declare const renameWorkspaceResponseSchema: Schema.Struct<{
518
+ readonly workspaceId: Schema.String;
519
+ readonly name: Schema.String;
520
+ readonly updatedAt: Schema.String;
521
+ }>;
522
+ export type RenameWorkspaceResponse = typeof renameWorkspaceResponseSchema.Type;
523
+ export declare const createWorkspaceResponseSchema: Schema.Struct<{
524
+ readonly workspaceId: Schema.String;
525
+ readonly name: Schema.String;
526
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
527
+ readonly registryId: Schema.String;
528
+ readonly repository: Schema.String;
529
+ readonly tag: Schema.String;
530
+ /** The launch attempt this create started (or, replayed, the workspace's latest). */
531
+ readonly runId: Schema.optional<Schema.String>;
532
+ /**
533
+ * The executor, once one exists: on a fresh create there is none yet (the launch is
534
+ * asynchronous); a replayed create carries the workspace's current one.
535
+ */
536
+ readonly runtime: Schema.optional<Schema.Struct<{
537
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
538
+ /**
539
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
540
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
541
+ */
542
+ readonly resourceId: Schema.String;
543
+ readonly reference: Schema.String;
544
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
545
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
546
+ readonly endpoint: Schema.optional<Schema.String>;
547
+ /**
548
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
549
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
550
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
551
+ * only from control planes that predate it.
552
+ */
553
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
554
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
555
+ readonly runId: Schema.optional<Schema.String>;
556
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
557
+ readonly launchId: Schema.optional<Schema.String>;
558
+ }>>;
559
+ /** `true` when an earlier create with the same `idempotencyKey` made this workspace. */
560
+ readonly replayed: Schema.optional<Schema.Boolean>;
561
+ /** The launch identity the create named (`launchId`), recorded on its attempt. */
562
+ readonly launchId: Schema.optional<Schema.String>;
563
+ }>;
564
+ export type CreateWorkspaceResponse = typeof createWorkspaceResponseSchema.Type;
565
+ /**
566
+ * What became of an idempotent create, by its key (owner-scoped):
567
+ *
568
+ * - `pending`: a create with the key started and has not committed — it may still be in flight,
569
+ * or it died before it committed. A repeat of the create finishes it; `cancel` makes sure it
570
+ * never does. `workspaceId` names a half-made workspace a create from before this record
571
+ * left, which a repeat of the create completes.
572
+ * - `found`: the create committed; `workspaceId` (and `runId`, `launchId`) name what it made.
573
+ * - `cancelled`: the key was cancelled; no create with it ever commits.
574
+ * - `none`: no create with the key has reached this control plane (yet). Point-in-time only: a
575
+ * delayed request can still arrive — `cancel` is the answer that stays true.
576
+ */
577
+ export declare const workspaceCreateStateSchema: Schema.Struct<{
578
+ readonly idempotencyKey: Schema.String;
579
+ readonly state: Schema.Literals<readonly ["pending", "found", "cancelled", "none"]>;
580
+ readonly workspaceId: Schema.optional<Schema.String>;
581
+ readonly runId: Schema.optional<Schema.String>;
582
+ readonly launchId: Schema.optional<Schema.String>;
583
+ }>;
584
+ export type WorkspaceCreateState = typeof workspaceCreateStateSchema.Type;
585
+ export declare const getWorkspaceCreateQuerySchema: Schema.Struct<{
586
+ readonly ownerUserId: Schema.String;
587
+ }>;
588
+ export type GetWorkspaceCreateQuery = typeof getWorkspaceCreateQuerySchema.Type;
589
+ /** Owner-scoped: cancel the create with this key, so it never commits. */
590
+ export declare const cancelWorkspaceCreateRequestSchema: Schema.Struct<{
591
+ readonly ownerUserId: Schema.String;
592
+ }>;
593
+ export type CancelWorkspaceCreateRequest = typeof cancelWorkspaceCreateRequestSchema.Type;
594
+ export declare const workspaceSummarySchema: Schema.Struct<{
595
+ readonly workspaceId: Schema.String;
596
+ readonly name: Schema.String;
597
+ readonly ownerUserId: Schema.String;
598
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
599
+ readonly registryId: Schema.optional<Schema.String>;
600
+ readonly repository: Schema.optional<Schema.String>;
601
+ readonly tag: Schema.optional<Schema.String>;
602
+ readonly runtime: Schema.optional<Schema.Struct<{
603
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
604
+ /**
605
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
606
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
607
+ */
608
+ readonly resourceId: Schema.String;
609
+ readonly reference: Schema.String;
610
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
611
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
612
+ readonly endpoint: Schema.optional<Schema.String>;
613
+ /**
614
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
615
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
616
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
617
+ * only from control planes that predate it.
618
+ */
619
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
620
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
621
+ readonly runId: Schema.optional<Schema.String>;
622
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
623
+ readonly launchId: Schema.optional<Schema.String>;
624
+ }>>;
625
+ readonly publishedImage: Schema.optional<Schema.Struct<{
626
+ readonly reference: Schema.String;
627
+ readonly digestReference: Schema.String;
628
+ readonly digest: Schema.String;
629
+ }>>;
630
+ readonly error: Schema.optional<Schema.Struct<{
631
+ readonly message: Schema.String;
632
+ readonly code: Schema.optional<Schema.String>;
633
+ }>>;
634
+ readonly createdAt: Schema.String;
635
+ readonly updatedAt: Schema.String;
636
+ readonly startedAt: Schema.optional<Schema.String>;
637
+ readonly finishedAt: Schema.optional<Schema.String>;
638
+ readonly expiresAt: Schema.optional<Schema.String>;
639
+ }>;
640
+ export type WorkspaceSummary = typeof workspaceSummarySchema.Type;
641
+ /**
642
+ * What the control plane last OBSERVED of a capture-sourced workspace's drain — the FINAL flush
643
+ * and queue polling every platform stop runs before it removes the runtime. A stop request is
644
+ * not a stop: until the runtime is gone, this is what is happening.
645
+ *
646
+ * - `draining`: the queue is still moving; the stop continues on the server.
647
+ * - `kept`: nothing will stop the runtime — the work is not confirmed saved (the queue stalled,
648
+ * a class was refused, the daemon is silent while the executor runs, or the daemon did not
649
+ * report its final flush complete). `detail` says which.
650
+ * - `saved`: the daemon reported its final flush complete; the runtime is being removed.
651
+ * - `gone`: the daemon is silent and the runtime reports the executor ended.
652
+ * - `stop-failed`: the drain let the stop through but removing the runtime failed (`detail`
653
+ * has the error); the control plane retries the stop.
654
+ * - `stopped`: the runtime was removed after its drain let it go.
655
+ * - `discarded`: the owner discarded the unsaved captures (`stop({ discardUnsaved: true })`);
656
+ * the runtime was terminated without a drain. `discard` records who asked, and when.
657
+ *
658
+ * `preservationStartsAt` is when the control plane starts that drain on its own ahead of the
659
+ * runtime's deadline (`runtime.deadline`), once it has planned one.
660
+ */
661
+ export declare const workspaceCaptureDrainSchema: Schema.Struct<{
662
+ readonly state: Schema.Literals<readonly ["draining", "kept", "saved", "gone", "stop-failed", "stopped", "discarded"]>;
663
+ readonly detail: Schema.optional<Schema.String>;
664
+ /** ISO-8601: when this was observed. */
665
+ readonly observedAt: Schema.optional<Schema.String>;
666
+ /** ISO-8601: when the deadline sweep starts (or started) the final drain. */
667
+ readonly preservationStartsAt: Schema.optional<Schema.String>;
668
+ /** The owner's request to discard the unsaved captures: who asked, and when (ISO-8601). */
669
+ readonly discard: Schema.optional<Schema.Struct<{
670
+ readonly requestedBy: Schema.String;
671
+ readonly requestedAt: Schema.String;
672
+ }>>;
673
+ /**
674
+ * The executor is RETAINED: kept because its disk holds work not confirmed saved. `since` and
675
+ * `reason` say when and why; recovery is attempted on a backoff (`recoveryAttempts`,
676
+ * `nextRecoveryAt`, `lastRecoveryError`); `recoverable` says whether its runtime can restart it
677
+ * on its own disk (Docker) or only report it (Kubernetes, MicroVM). Absent when nothing is
678
+ * retained.
679
+ */
680
+ readonly retained: Schema.optional<Schema.Struct<{
681
+ readonly since: Schema.String;
682
+ readonly reason: Schema.String;
683
+ readonly recoverable: Schema.Boolean;
684
+ readonly recoveryAttempts: Schema.Int;
685
+ readonly nextRecoveryAt: Schema.optional<Schema.String>;
686
+ readonly lastRecoveryError: Schema.optional<Schema.String>;
687
+ }>>;
688
+ /**
689
+ * The executor this observation is about: the run and its runtime identity (`resourceId` is
690
+ * the id a stop's `completion` names).
691
+ */
692
+ readonly executor: Schema.optional<Schema.Struct<{
693
+ readonly runId: Schema.String;
694
+ readonly adapter: Schema.String;
695
+ readonly resourceId: Schema.String;
696
+ readonly reference: Schema.optional<Schema.String>;
697
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
698
+ readonly launchId: Schema.optional<Schema.String>;
699
+ }>>;
700
+ /** The latest `completion` attestation accepted for this executor (see `stop`). */
701
+ readonly completion: Schema.optional<Schema.Struct<{
702
+ readonly executorId: Schema.String;
703
+ readonly epoch: Schema.Int;
704
+ readonly captureN: Schema.Int;
705
+ readonly attestedAt: Schema.String;
706
+ readonly launchId: Schema.optional<Schema.String>;
707
+ /** When the store recorded the seal, when the attestation said. */
708
+ readonly sealedAt: Schema.optional<Schema.String>;
709
+ /** Where in the executor's own history the seal was made, when the attestation said. */
710
+ readonly origin: Schema.optional<Schema.Struct<{
711
+ readonly epoch: Schema.Int;
712
+ readonly launch: Schema.String;
713
+ readonly bootId: Schema.String;
714
+ readonly bootGeneration: Schema.Int;
715
+ readonly observation: Schema.Int;
716
+ readonly headN: Schema.optional<Schema.Int>;
717
+ }>>;
718
+ }>>;
719
+ }>;
720
+ export type WorkspaceCaptureDrain = typeof workspaceCaptureDrainSchema.Type;
721
+ export declare const workspaceDetailsSchema: Schema.Struct<{
722
+ readonly workspaceId: Schema.String;
723
+ readonly name: Schema.String;
724
+ readonly ownerUserId: Schema.String;
725
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
726
+ readonly registryId: Schema.optional<Schema.String>;
727
+ readonly repository: Schema.optional<Schema.String>;
728
+ readonly tag: Schema.optional<Schema.String>;
729
+ readonly runtime: Schema.optional<Schema.Struct<{
730
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
731
+ /**
732
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
733
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
734
+ */
735
+ readonly resourceId: Schema.String;
736
+ readonly reference: Schema.String;
737
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
738
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
739
+ readonly endpoint: Schema.optional<Schema.String>;
740
+ /**
741
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
742
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
743
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
744
+ * only from control planes that predate it.
745
+ */
746
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
747
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
748
+ readonly runId: Schema.optional<Schema.String>;
749
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
750
+ readonly launchId: Schema.optional<Schema.String>;
751
+ }>>;
752
+ readonly publishedImage: Schema.optional<Schema.Struct<{
753
+ readonly reference: Schema.String;
754
+ readonly digestReference: Schema.String;
755
+ readonly digest: Schema.String;
756
+ }>>;
757
+ readonly error: Schema.optional<Schema.Struct<{
758
+ readonly message: Schema.String;
759
+ readonly code: Schema.optional<Schema.String>;
760
+ }>>;
761
+ readonly createdAt: Schema.String;
762
+ readonly updatedAt: Schema.String;
763
+ readonly startedAt: Schema.optional<Schema.String>;
764
+ readonly finishedAt: Schema.optional<Schema.String>;
765
+ readonly expiresAt: Schema.optional<Schema.String>;
766
+ readonly spec: Schema.optional<Schema.Unknown>;
767
+ /**
768
+ * The current runtime's capture drain as last observed (see `workspaceCaptureDrainSchema`).
769
+ * Absent while no drain or preservation schedule exists, and from older control planes.
770
+ */
771
+ readonly captureDrain: Schema.optional<Schema.Struct<{
772
+ readonly state: Schema.Literals<readonly ["draining", "kept", "saved", "gone", "stop-failed", "stopped", "discarded"]>;
773
+ readonly detail: Schema.optional<Schema.String>;
774
+ /** ISO-8601: when this was observed. */
775
+ readonly observedAt: Schema.optional<Schema.String>;
776
+ /** ISO-8601: when the deadline sweep starts (or started) the final drain. */
777
+ readonly preservationStartsAt: Schema.optional<Schema.String>;
778
+ /** The owner's request to discard the unsaved captures: who asked, and when (ISO-8601). */
779
+ readonly discard: Schema.optional<Schema.Struct<{
780
+ readonly requestedBy: Schema.String;
781
+ readonly requestedAt: Schema.String;
782
+ }>>;
783
+ /**
784
+ * The executor is RETAINED: kept because its disk holds work not confirmed saved. `since` and
785
+ * `reason` say when and why; recovery is attempted on a backoff (`recoveryAttempts`,
786
+ * `nextRecoveryAt`, `lastRecoveryError`); `recoverable` says whether its runtime can restart it
787
+ * on its own disk (Docker) or only report it (Kubernetes, MicroVM). Absent when nothing is
788
+ * retained.
789
+ */
790
+ readonly retained: Schema.optional<Schema.Struct<{
791
+ readonly since: Schema.String;
792
+ readonly reason: Schema.String;
793
+ readonly recoverable: Schema.Boolean;
794
+ readonly recoveryAttempts: Schema.Int;
795
+ readonly nextRecoveryAt: Schema.optional<Schema.String>;
796
+ readonly lastRecoveryError: Schema.optional<Schema.String>;
797
+ }>>;
798
+ /**
799
+ * The executor this observation is about: the run and its runtime identity (`resourceId` is
800
+ * the id a stop's `completion` names).
801
+ */
802
+ readonly executor: Schema.optional<Schema.Struct<{
803
+ readonly runId: Schema.String;
804
+ readonly adapter: Schema.String;
805
+ readonly resourceId: Schema.String;
806
+ readonly reference: Schema.optional<Schema.String>;
807
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
808
+ readonly launchId: Schema.optional<Schema.String>;
809
+ }>>;
810
+ /** The latest `completion` attestation accepted for this executor (see `stop`). */
811
+ readonly completion: Schema.optional<Schema.Struct<{
812
+ readonly executorId: Schema.String;
813
+ readonly epoch: Schema.Int;
814
+ readonly captureN: Schema.Int;
815
+ readonly attestedAt: Schema.String;
816
+ readonly launchId: Schema.optional<Schema.String>;
817
+ /** When the store recorded the seal, when the attestation said. */
818
+ readonly sealedAt: Schema.optional<Schema.String>;
819
+ /** Where in the executor's own history the seal was made, when the attestation said. */
820
+ readonly origin: Schema.optional<Schema.Struct<{
821
+ readonly epoch: Schema.Int;
822
+ readonly launch: Schema.String;
823
+ readonly bootId: Schema.String;
824
+ readonly bootGeneration: Schema.Int;
825
+ readonly observation: Schema.Int;
826
+ readonly headN: Schema.optional<Schema.Int>;
827
+ }>>;
828
+ }>>;
829
+ }>>;
830
+ }>;
831
+ export type WorkspaceDetails = typeof workspaceDetailsSchema.Type;
832
+ /**
833
+ * Owner scoping on a single read: the workspace must belong to `ownerUserId` (uniform 404).
834
+ * Optional on the wire for older callers; the control plane requires it.
835
+ */
836
+ export declare const getWorkspaceQuerySchema: Schema.Struct<{
837
+ readonly ownerUserId: Schema.optional<Schema.String>;
838
+ }>;
839
+ export type GetWorkspaceQuery = typeof getWorkspaceQuerySchema.Type;
840
+ export declare const listWorkspacesQuerySchema: Schema.Struct<{
841
+ readonly ownerUserId: Schema.String;
842
+ readonly status: Schema.optional<Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>>;
843
+ readonly limit: Schema.optional<Schema.String>;
844
+ /** Only the owner's workspace created with this `idempotencyKey` (none or one item). */
845
+ readonly idempotencyKey: Schema.optional<Schema.String>;
846
+ }>;
847
+ export type ListWorkspacesQuery = typeof listWorkspacesQuerySchema.Type;
848
+ export declare const listWorkspacesResponseSchema: Schema.Struct<{
849
+ readonly items: Schema.$Array<Schema.Struct<{
850
+ readonly workspaceId: Schema.String;
851
+ readonly name: Schema.String;
852
+ readonly ownerUserId: Schema.String;
853
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
854
+ readonly registryId: Schema.optional<Schema.String>;
855
+ readonly repository: Schema.optional<Schema.String>;
856
+ readonly tag: Schema.optional<Schema.String>;
857
+ readonly runtime: Schema.optional<Schema.Struct<{
858
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
859
+ /**
860
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
861
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
862
+ */
863
+ readonly resourceId: Schema.String;
864
+ readonly reference: Schema.String;
865
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
866
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
867
+ readonly endpoint: Schema.optional<Schema.String>;
868
+ /**
869
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
870
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
871
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
872
+ * only from control planes that predate it.
873
+ */
874
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
875
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
876
+ readonly runId: Schema.optional<Schema.String>;
877
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
878
+ readonly launchId: Schema.optional<Schema.String>;
879
+ }>>;
880
+ readonly publishedImage: Schema.optional<Schema.Struct<{
881
+ readonly reference: Schema.String;
882
+ readonly digestReference: Schema.String;
883
+ readonly digest: Schema.String;
884
+ }>>;
885
+ readonly error: Schema.optional<Schema.Struct<{
886
+ readonly message: Schema.String;
887
+ readonly code: Schema.optional<Schema.String>;
888
+ }>>;
889
+ readonly createdAt: Schema.String;
890
+ readonly updatedAt: Schema.String;
891
+ readonly startedAt: Schema.optional<Schema.String>;
892
+ readonly finishedAt: Schema.optional<Schema.String>;
893
+ readonly expiresAt: Schema.optional<Schema.String>;
894
+ }>>;
895
+ }>;
896
+ export type ListWorkspacesResponse = typeof listWorkspacesResponseSchema.Type;
897
+ export declare const listWorkspaceAttemptsQuerySchema: Schema.Struct<{
898
+ readonly ownerUserId: Schema.optional<Schema.String>;
899
+ readonly limit: Schema.optional<Schema.String>;
900
+ }>;
901
+ export type ListWorkspaceAttemptsQuery = typeof listWorkspaceAttemptsQuerySchema.Type;
902
+ export declare const workspaceAttemptSummarySchema: Schema.Struct<{
903
+ readonly attemptId: Schema.String;
904
+ readonly relation: Schema.Literals<readonly ["launch", "rebuild", "retry", "resume"]>;
905
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
906
+ readonly triggerType: Schema.Literals<readonly ["manual", "schedule", "api", "retry"]>;
907
+ readonly triggerRef: Schema.optional<Schema.String>;
908
+ readonly runtime: Schema.optional<Schema.Struct<{
909
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
910
+ /**
911
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
912
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
913
+ */
914
+ readonly resourceId: Schema.String;
915
+ readonly reference: Schema.String;
916
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
917
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
918
+ readonly endpoint: Schema.optional<Schema.String>;
919
+ /**
920
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
921
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
922
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
923
+ * only from control planes that predate it.
924
+ */
925
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
926
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
927
+ readonly runId: Schema.optional<Schema.String>;
928
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
929
+ readonly launchId: Schema.optional<Schema.String>;
930
+ }>>;
931
+ readonly publishedImage: Schema.optional<Schema.Struct<{
932
+ readonly reference: Schema.String;
933
+ readonly digestReference: Schema.String;
934
+ readonly digest: Schema.String;
935
+ }>>;
936
+ readonly error: Schema.optional<Schema.Struct<{
937
+ readonly message: Schema.String;
938
+ readonly code: Schema.optional<Schema.String>;
939
+ }>>;
940
+ readonly spec: Schema.optional<Schema.Unknown>;
941
+ readonly queuedAt: Schema.String;
942
+ readonly createdAt: Schema.String;
943
+ readonly updatedAt: Schema.String;
944
+ readonly linkedAt: Schema.String;
945
+ readonly startedAt: Schema.optional<Schema.String>;
946
+ readonly finishedAt: Schema.optional<Schema.String>;
947
+ readonly durationMs: Schema.optional<Schema.Number>;
948
+ }>;
949
+ export type WorkspaceAttemptSummary = typeof workspaceAttemptSummarySchema.Type;
950
+ export declare const listWorkspaceAttemptsResponseSchema: Schema.Struct<{
951
+ readonly items: Schema.$Array<Schema.Struct<{
952
+ readonly attemptId: Schema.String;
953
+ readonly relation: Schema.Literals<readonly ["launch", "rebuild", "retry", "resume"]>;
954
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
955
+ readonly triggerType: Schema.Literals<readonly ["manual", "schedule", "api", "retry"]>;
956
+ readonly triggerRef: Schema.optional<Schema.String>;
957
+ readonly runtime: Schema.optional<Schema.Struct<{
958
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
959
+ /**
960
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
961
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
962
+ */
963
+ readonly resourceId: Schema.String;
964
+ readonly reference: Schema.String;
965
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
966
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
967
+ readonly endpoint: Schema.optional<Schema.String>;
968
+ /**
969
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
970
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
971
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
972
+ * only from control planes that predate it.
973
+ */
974
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
975
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
976
+ readonly runId: Schema.optional<Schema.String>;
977
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
978
+ readonly launchId: Schema.optional<Schema.String>;
979
+ }>>;
980
+ readonly publishedImage: Schema.optional<Schema.Struct<{
981
+ readonly reference: Schema.String;
982
+ readonly digestReference: Schema.String;
983
+ readonly digest: Schema.String;
984
+ }>>;
985
+ readonly error: Schema.optional<Schema.Struct<{
986
+ readonly message: Schema.String;
987
+ readonly code: Schema.optional<Schema.String>;
988
+ }>>;
989
+ readonly spec: Schema.optional<Schema.Unknown>;
990
+ readonly queuedAt: Schema.String;
991
+ readonly createdAt: Schema.String;
992
+ readonly updatedAt: Schema.String;
993
+ readonly linkedAt: Schema.String;
994
+ readonly startedAt: Schema.optional<Schema.String>;
995
+ readonly finishedAt: Schema.optional<Schema.String>;
996
+ readonly durationMs: Schema.optional<Schema.Number>;
997
+ }>>;
998
+ }>;
999
+ export type ListWorkspaceAttemptsResponse = typeof listWorkspaceAttemptsResponseSchema.Type;
1000
+ export declare const listWorkspaceEventsQuerySchema: Schema.Struct<{
1001
+ readonly ownerUserId: Schema.optional<Schema.String>;
1002
+ readonly limit: Schema.optional<Schema.String>;
1003
+ }>;
1004
+ export type ListWorkspaceEventsQuery = typeof listWorkspaceEventsQuerySchema.Type;
1005
+ export declare const workspaceEventTypeSchema: Schema.Literals<readonly ["workspace.created", "attempt.queued", "attempt.running", "attempt.succeeded", "attempt.failed", "attempt.cancelled", "image.published", "runtime.pending", "runtime.running", "runtime.ready", "runtime.failed", "runtime.stopped"]>;
1006
+ export type WorkspaceEventType = typeof workspaceEventTypeSchema.Type;
1007
+ export declare const workspaceEventSchema: Schema.Struct<{
1008
+ readonly eventId: Schema.String;
1009
+ readonly workspaceId: Schema.String;
1010
+ readonly attemptId: Schema.optional<Schema.String>;
1011
+ readonly type: Schema.Literals<readonly ["workspace.created", "attempt.queued", "attempt.running", "attempt.succeeded", "attempt.failed", "attempt.cancelled", "image.published", "runtime.pending", "runtime.running", "runtime.ready", "runtime.failed", "runtime.stopped"]>;
1012
+ readonly occurredAt: Schema.String;
1013
+ readonly message: Schema.optional<Schema.String>;
1014
+ readonly data: Schema.optional<Schema.Unknown>;
1015
+ }>;
1016
+ export type WorkspaceEvent = typeof workspaceEventSchema.Type;
1017
+ export declare const listWorkspaceEventsResponseSchema: Schema.Struct<{
1018
+ readonly items: Schema.$Array<Schema.Struct<{
1019
+ readonly eventId: Schema.String;
1020
+ readonly workspaceId: Schema.String;
1021
+ readonly attemptId: Schema.optional<Schema.String>;
1022
+ readonly type: Schema.Literals<readonly ["workspace.created", "attempt.queued", "attempt.running", "attempt.succeeded", "attempt.failed", "attempt.cancelled", "image.published", "runtime.pending", "runtime.running", "runtime.ready", "runtime.failed", "runtime.stopped"]>;
1023
+ readonly occurredAt: Schema.String;
1024
+ readonly message: Schema.optional<Schema.String>;
1025
+ readonly data: Schema.optional<Schema.Unknown>;
1026
+ }>>;
1027
+ }>;
1028
+ export type ListWorkspaceEventsResponse = typeof listWorkspaceEventsResponseSchema.Type;
1029
+ export declare const workspaceGatewayHeadersSchema: Schema.Struct<{
1030
+ readonly "x-sealant-gateway-token": Schema.optional<Schema.String>;
1031
+ readonly "x-sealant-principal-id": Schema.optional<Schema.String>;
1032
+ }>;
1033
+ export type WorkspaceGatewayHeaders = typeof workspaceGatewayHeadersSchema.Type;
1034
+ declare const WorkspaceBadRequestError_base: Schema.Class<WorkspaceBadRequestError, Schema.TaggedStruct<"WorkspaceBadRequestError", {
1035
+ readonly message: Schema.String;
1036
+ }>, import("effect/Cause").YieldableError>;
1037
+ export declare class WorkspaceBadRequestError extends WorkspaceBadRequestError_base {
1038
+ }
1039
+ declare const WorkspaceRuntimeEnvReferencesUnsupportedError_base: Schema.Class<WorkspaceRuntimeEnvReferencesUnsupportedError, Schema.TaggedStruct<"WorkspaceRuntimeEnvReferencesUnsupportedError", {
1040
+ readonly message: Schema.String;
1041
+ readonly code: Schema.Literals<readonly ["runtime-env-references-unsupported"]>;
1042
+ }>, import("effect/Cause").YieldableError>;
1043
+ /**
1044
+ * Kubernetes-only create-time inputs (cluster env sources `runtime.envFrom`, a workspace
1045
+ * `kubernetes.serviceAccountName`) on a deployment whose workspaces do not run on Kubernetes.
1046
+ * Refused synchronously at POST /v1/workspaces — no workspace row, no build job, no failure
1047
+ * minutes later. The stable `code` doubles as the SDK consumer's capability probe: mapping this
1048
+ * code is how a caller learns the install cannot resolve cluster bindings, instead of trusting a
1049
+ * config flag that can lie.
1050
+ */
1051
+ export declare class WorkspaceRuntimeEnvReferencesUnsupportedError extends WorkspaceRuntimeEnvReferencesUnsupportedError_base {
1052
+ }
1053
+ declare const WorkspaceDockerServiceUnsupportedError_base: Schema.Class<WorkspaceDockerServiceUnsupportedError, Schema.TaggedStruct<"WorkspaceDockerServiceUnsupportedError", {
1054
+ readonly message: Schema.String;
1055
+ readonly code: Schema.Literals<readonly ["workspace-docker-unsupported"]>;
1056
+ }>, import("effect/Cause").YieldableError>;
1057
+ /**
1058
+ * `services.docker` requested on an install whose workspace runtime cannot serve it. Kubernetes
1059
+ * needs its operator-enabled rootless sidecar. Lambda MicroVMs need a separate Docker-capable
1060
+ * image, leaving the default image at its restricted Linux capability set. Refused synchronously
1061
+ * at POST /v1/workspaces; the stable `code` is the consumer's capability probe.
1062
+ */
1063
+ export declare class WorkspaceDockerServiceUnsupportedError extends WorkspaceDockerServiceUnsupportedError_base {
1064
+ }
1065
+ declare const WorkspaceUnauthorizedError_base: Schema.Class<WorkspaceUnauthorizedError, Schema.TaggedStruct<"WorkspaceUnauthorizedError", {
1066
+ readonly message: Schema.String;
1067
+ }>, import("effect/Cause").YieldableError>;
1068
+ export declare class WorkspaceUnauthorizedError extends WorkspaceUnauthorizedError_base {
1069
+ }
1070
+ declare const WorkspaceForbiddenError_base: Schema.Class<WorkspaceForbiddenError, Schema.TaggedStruct<"WorkspaceForbiddenError", {
1071
+ readonly message: Schema.String;
1072
+ }>, import("effect/Cause").YieldableError>;
1073
+ export declare class WorkspaceForbiddenError extends WorkspaceForbiddenError_base {
1074
+ }
1075
+ declare const WorkspaceNotFoundError_base: Schema.Class<WorkspaceNotFoundError, Schema.TaggedStruct<"WorkspaceNotFoundError", {
1076
+ readonly message: Schema.String;
1077
+ }>, import("effect/Cause").YieldableError>;
1078
+ export declare class WorkspaceNotFoundError extends WorkspaceNotFoundError_base {
1079
+ }
1080
+ declare const WorkspaceConflictError_base: Schema.Class<WorkspaceConflictError, Schema.TaggedStruct<"WorkspaceConflictError", {
1081
+ readonly message: Schema.String;
1082
+ /** A stable reason, where one applies (`create-cancelled`: the create's key was cancelled). */
1083
+ readonly code: Schema.optional<Schema.String>;
1084
+ }>, import("effect/Cause").YieldableError>;
1085
+ export declare class WorkspaceConflictError extends WorkspaceConflictError_base {
1086
+ }
1087
+ declare const WorkspaceBadGatewayError_base: Schema.Class<WorkspaceBadGatewayError, Schema.TaggedStruct<"WorkspaceBadGatewayError", {
1088
+ readonly message: Schema.String;
1089
+ }>, import("effect/Cause").YieldableError>;
1090
+ export declare class WorkspaceBadGatewayError extends WorkspaceBadGatewayError_base {
1091
+ }
1092
+ declare const WorkspaceServiceUnavailableError_base: Schema.Class<WorkspaceServiceUnavailableError, Schema.TaggedStruct<"WorkspaceServiceUnavailableError", {
1093
+ readonly message: Schema.String;
1094
+ }>, import("effect/Cause").YieldableError>;
1095
+ export declare class WorkspaceServiceUnavailableError extends WorkspaceServiceUnavailableError_base {
1096
+ }
1097
+ declare const WorkspaceInternalServerError_base: Schema.Class<WorkspaceInternalServerError, Schema.TaggedStruct<"WorkspaceInternalServerError", {
1098
+ readonly message: Schema.String;
1099
+ }>, import("effect/Cause").YieldableError>;
1100
+ export declare class WorkspaceInternalServerError extends WorkspaceInternalServerError_base {
1101
+ }
1102
+ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", HttpApiEndpoint.HttpApiEndpoint<"bindWorkspace", "POST", "/:workspaceId/bind", HttpApiEndpoint.StringTree<Schema.Struct<{
1103
+ readonly workspaceId: Schema.String;
1104
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1105
+ readonly ownerUserId: Schema.String;
1106
+ readonly mountPath: Schema.optional<Schema.String>;
1107
+ readonly subpath: Schema.String;
1108
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1109
+ readonly binds: Schema.$Array<Schema.Struct<{
1110
+ readonly mountPath: Schema.String;
1111
+ readonly subpath: Schema.String;
1112
+ }>>;
1113
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"cancelWorkspaceCreate", "POST", "/idempotency-keys/:idempotencyKey/cancel", HttpApiEndpoint.StringTree<Schema.Struct<{
1114
+ readonly idempotencyKey: Schema.String;
1115
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1116
+ readonly ownerUserId: Schema.String;
1117
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1118
+ readonly idempotencyKey: Schema.String;
1119
+ readonly state: Schema.Literals<readonly ["pending", "found", "cancelled", "none"]>;
1120
+ readonly workspaceId: Schema.optional<Schema.String>;
1121
+ readonly runId: Schema.optional<Schema.String>;
1122
+ readonly launchId: Schema.optional<Schema.String>;
1123
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createWorkspace", "POST", "/", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1124
+ readonly ownerUserId: Schema.String;
1125
+ readonly registryId: Schema.String;
1126
+ readonly repository: Schema.String;
1127
+ readonly tag: Schema.String;
1128
+ readonly name: Schema.optional<Schema.String>;
1129
+ readonly sourceSelection: Schema.optional<Schema.Struct<{
1130
+ readonly provider: Schema.Literal<"github">;
1131
+ readonly installationId: Schema.String;
1132
+ readonly installationRepositoryId: Schema.String;
1133
+ readonly ref: Schema.optional<Schema.String>;
1134
+ }>>;
1135
+ readonly dotfilesSelection: Schema.optional<Schema.Struct<{
1136
+ readonly provider: Schema.Literal<"github">;
1137
+ readonly installationId: Schema.String;
1138
+ readonly installationRepositoryId: Schema.String;
1139
+ readonly ref: Schema.optional<Schema.String>;
1140
+ }>>;
1141
+ readonly credentials: Schema.optional<Schema.Struct<{
1142
+ readonly profileId: Schema.optional<Schema.String>;
1143
+ readonly claude: Schema.optional<Schema.String>;
1144
+ readonly codex: Schema.optional<Schema.String>;
1145
+ readonly github: Schema.optional<Schema.String>;
1146
+ }>>;
1147
+ readonly spec: Schema.Unknown;
1148
+ readonly secretEnv: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
1149
+ readonly captureToken: Schema.optional<Schema.String>;
1150
+ readonly ttlSeconds: Schema.optional<Schema.Int>;
1151
+ /**
1152
+ * Makes the create idempotent for this owner: a repeated create with the same key returns the
1153
+ * workspace the first one made (`replayed: true`) instead of creating another, so a caller that
1154
+ * lost the answer (a crash, a timeout) can repeat it or look the workspace up
1155
+ * (`GET /v1/workspaces?idempotencyKey=`). Scoped to `ownerUserId`. The `idempotency-key` header
1156
+ * means the same; this field wins when both are sent.
1157
+ */
1158
+ readonly idempotencyKey: Schema.optional<Schema.String>;
1159
+ /**
1160
+ * The caller's immutable identity for the ONE physical executor this create launches, minted
1161
+ * before create (a caller that makes the create idempotent can reuse its idempotency key). It is
1162
+ * recorded on the launch attempt and reported with the executor (`runtime.launchId`); a stop's
1163
+ * completion attestation that names a launch must name this one.
1164
+ */
1165
+ readonly launchId: Schema.optional<Schema.String>;
1166
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
1167
+ readonly "idempotency-key": Schema.optional<Schema.String>;
1168
+ }>>, HttpApiEndpoint.Json<Schema.Struct<{
1169
+ readonly workspaceId: Schema.String;
1170
+ readonly name: Schema.String;
1171
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
1172
+ readonly registryId: Schema.String;
1173
+ readonly repository: Schema.String;
1174
+ readonly tag: Schema.String;
1175
+ /** The launch attempt this create started (or, replayed, the workspace's latest). */
1176
+ readonly runId: Schema.optional<Schema.String>;
1177
+ /**
1178
+ * The executor, once one exists: on a fresh create there is none yet (the launch is
1179
+ * asynchronous); a replayed create carries the workspace's current one.
1180
+ */
1181
+ readonly runtime: Schema.optional<Schema.Struct<{
1182
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
1183
+ /**
1184
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
1185
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
1186
+ */
1187
+ readonly resourceId: Schema.String;
1188
+ readonly reference: Schema.String;
1189
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
1190
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
1191
+ readonly endpoint: Schema.optional<Schema.String>;
1192
+ /**
1193
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
1194
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
1195
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
1196
+ * only from control planes that predate it.
1197
+ */
1198
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
1199
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
1200
+ readonly runId: Schema.optional<Schema.String>;
1201
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
1202
+ readonly launchId: Schema.optional<Schema.String>;
1203
+ }>>;
1204
+ /** `true` when an earlier create with the same `idempotencyKey` made this workspace. */
1205
+ readonly replayed: Schema.optional<Schema.Boolean>;
1206
+ /** The launch identity the create named (`launchId`), recorded on its attempt. */
1207
+ readonly launchId: Schema.optional<Schema.String>;
1208
+ }>>, HttpApiEndpoint.Json<typeof BudgetExceededError | typeof WorkspaceBadRequestError | typeof WorkspaceRuntimeEnvReferencesUnsupportedError | typeof WorkspaceDockerServiceUnsupportedError | typeof WorkspaceForbiddenError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceBadGatewayError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"execWorkspace", "POST", "/:workspaceId/exec", HttpApiEndpoint.StringTree<Schema.Struct<{
1209
+ readonly workspaceId: Schema.String;
1210
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1211
+ readonly ownerUserId: Schema.String;
1212
+ /** Commands execute sequentially in the workspace, each recorded like any other process. */
1213
+ readonly commands: Schema.$Array<Schema.Struct<{
1214
+ readonly executable: Schema.String;
1215
+ readonly args: Schema.$Array<Schema.String>;
1216
+ readonly cwd: Schema.optional<Schema.String>;
1217
+ }>>;
1218
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1219
+ readonly runId: Schema.String;
1220
+ readonly workspaceId: Schema.String;
1221
+ readonly attemptId: Schema.optional<Schema.String>;
1222
+ readonly ownerUserId: Schema.String;
1223
+ readonly harnessId: Schema.String;
1224
+ readonly mode: Schema.Literals<readonly ["one-shot", "interactive"]>;
1225
+ readonly status: Schema.Literals<readonly ["queued", "running", "completed", "failed", "cancelled"]>;
1226
+ readonly prompt: Schema.optional<Schema.String>;
1227
+ readonly command: Schema.optional<Schema.Struct<{
1228
+ readonly executable: Schema.String;
1229
+ readonly args: Schema.$Array<Schema.String>;
1230
+ readonly cwd: Schema.optional<Schema.String>;
1231
+ }>>;
1232
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1233
+ readonly exitCode: Schema.optional<Schema.Number>;
1234
+ readonly errorMessage: Schema.optional<Schema.String>;
1235
+ readonly startedAt: Schema.optional<Schema.String>;
1236
+ readonly finishedAt: Schema.optional<Schema.String>;
1237
+ readonly createdAt: Schema.String;
1238
+ readonly updatedAt: Schema.String;
1239
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"expireWorkspace", "POST", "/:workspaceId/expire", HttpApiEndpoint.StringTree<Schema.Struct<{
1240
+ readonly workspaceId: Schema.String;
1241
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1242
+ readonly ownerUserId: Schema.String;
1243
+ readonly ttlSeconds: Schema.optional<Schema.NullOr<Schema.Int>>;
1244
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1245
+ readonly workspaceId: Schema.String;
1246
+ readonly expiresAt: Schema.NullOr<Schema.String>;
1247
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"flushWorkspaceCapture", "POST", "/:workspaceId/capture/flush", HttpApiEndpoint.StringTree<Schema.Struct<{
1248
+ readonly workspaceId: Schema.String;
1249
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1250
+ readonly ownerUserId: Schema.String;
1251
+ /** `final` or `suspend` (the default). */
1252
+ readonly kind: Schema.optional<Schema.Literals<readonly ["final", "suspend"]>>;
1253
+ /** How long the daemon may take before it answers, in milliseconds. Absent: its own default. */
1254
+ readonly deadlineMs: Schema.optional<Schema.Int>;
1255
+ /**
1256
+ * Final only: how long managed processes get between SIGTERM and SIGKILL, in milliseconds,
1257
+ * counted inside `deadlineMs`. Absent: the daemon's default.
1258
+ */
1259
+ readonly graceMs: Schema.optional<Schema.Int>;
1260
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1261
+ readonly epoch: Schema.Number;
1262
+ readonly worktreeId: Schema.String;
1263
+ /** The newest capture the session channel has registered for this worktree. */
1264
+ readonly headN: Schema.optional<Schema.Number>;
1265
+ /** Captures staged on the executor and not yet registered: the unsaved queue. */
1266
+ readonly pending: Schema.Number;
1267
+ readonly stagedBytes: Schema.Number;
1268
+ readonly uploadedObjects: Schema.Number;
1269
+ readonly uploadedBytes: Schema.Number;
1270
+ readonly registered: Schema.Number;
1271
+ readonly fenced: Schema.Boolean;
1272
+ readonly paused: Schema.Boolean;
1273
+ readonly lastSnapUnixMs: Schema.optional<Schema.Number>;
1274
+ /**
1275
+ * Capture classes the registrar refused for the session's byte quota: nothing of these ships
1276
+ * until the next epoch or re-plan, whatever `pending` says. Non-empty means work is NOT being
1277
+ * saved. Absent from control planes that predate it.
1278
+ */
1279
+ readonly refused: Schema.optional<Schema.$Array<Schema.Literals<readonly ["small", "bulk"]>>>;
1280
+ /**
1281
+ * Bytes still to ship, and bulk captures still pending (sealantd's `pending_bytes` /
1282
+ * `pending_bulk`). Every field below `refused` is absent until the daemon reports it (the
1283
+ * control plane's pinned sealantd wire predates them).
1284
+ */
1285
+ readonly pendingBytes: Schema.optional<Schema.Number>;
1286
+ readonly pendingBulk: Schema.optional<Schema.Number>;
1287
+ /**
1288
+ * The daemon's own account of its last FINAL flush: true only when it quiesced every managed
1289
+ * process, snapshotted both capture classes and registered everything. The only proof that an
1290
+ * executor may go away; `pending === 0` alone is not. Absent until sealantd reports it (read
1291
+ * absent as not complete).
1292
+ */
1293
+ readonly complete: Schema.optional<Schema.Boolean>;
1294
+ /**
1295
+ * Why the last final flush is not complete (`not-final`, `in-progress`, `processes-remain`,
1296
+ * `sweep-unavailable`, `snapshot-failed`, `unreadable`, `fenced`, `conflict`, `deadline`,
1297
+ * `ship-failed`, `pending`, `internal`). A class whose last snap failed is `snapshot-failed`.
1298
+ */
1299
+ readonly incompleteReason: Schema.optional<Schema.String>;
1300
+ /**
1301
+ * Paths the last snap of each class could not read (listed, stat'ed or opened), summed over
1302
+ * both classes. Never taken as deleted: an automatic snap carries a path's last captured
1303
+ * content forward, a final snap fails instead.
1304
+ */
1305
+ readonly unreadable: Schema.optional<Schema.Number>;
1306
+ /** Of `unreadable`, the paths whose last captured content was carried forward. */
1307
+ readonly carried: Schema.optional<Schema.Number>;
1308
+ /**
1309
+ * The first unreadable paths (at most 20), virtual: `tree/<path>` under the worktree,
1310
+ * `.git/<path>`, `harness/<path>`; small class first.
1311
+ */
1312
+ readonly unreadablePaths: Schema.optional<Schema.$Array<Schema.String>>;
1313
+ /**
1314
+ * A capture the registrar refused to register that the executor is working through:
1315
+ * `missing-objects` (an object it names is not in the store) or `unrestorable` (a section's
1316
+ * tree would not restore). Nothing is dropped: its objects are uploaded again and it is
1317
+ * rebuilt from disk in its place.
1318
+ */
1319
+ readonly registerRefused: Schema.optional<Schema.String>;
1320
+ /** That refused capture's chain position. */
1321
+ readonly registerRefusedN: Schema.optional<Schema.Number>;
1322
+ /** The first keys (at most 20) the registrar named as missing. */
1323
+ readonly registerMissing: Schema.optional<Schema.$Array<Schema.String>>;
1324
+ /** Register refusals the daemon has seen since it started. */
1325
+ readonly registerRefusals: Schema.optional<Schema.Number>;
1326
+ /** The refused capture waits to be rebuilt from disk; nothing behind it registers first. */
1327
+ readonly repairing: Schema.optional<Schema.Boolean>;
1328
+ /**
1329
+ * A bulk build is in progress: its capture is not queued yet, so `pending` and `pendingBulk`
1330
+ * do not count it (`pendingBytes` counts what it has staged). A drain is not done while true.
1331
+ */
1332
+ readonly bulkBuilding: Schema.optional<Schema.Boolean>;
1333
+ /**
1334
+ * Each captured class's snaps: how many failed since the daemon started, and the last one's
1335
+ * error while it fails. A snap that fails stages nothing: what changed since the last capture
1336
+ * is on the executor's disk only.
1337
+ */
1338
+ readonly snaps: Schema.optional<Schema.$Array<Schema.Struct<{
1339
+ readonly class: Schema.Literals<readonly ["small", "bulk"]>;
1340
+ /** Snaps of this class that failed since the daemon started. */
1341
+ readonly snapsFailed: Schema.Number;
1342
+ /** The last snap's error, while the last snap failed; absent once one succeeds. */
1343
+ readonly lastSnapError: Schema.optional<Schema.String>;
1344
+ /** When the current run of failed snaps began (Unix ms), while the last snap failed. */
1345
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
1346
+ }>>>;
1347
+ /**
1348
+ * Derived from `snaps`: the error of the class that has been failing longest. Present means the
1349
+ * executor's newest work is NOT being captured, whatever `pending` says.
1350
+ */
1351
+ readonly lastSnapError: Schema.optional<Schema.String>;
1352
+ /** Derived from `snaps`: when the earliest current run of failed snaps began (Unix ms). */
1353
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
1354
+ /** Derived from `snaps`: failed snaps of every class since the daemon started. */
1355
+ readonly snapsFailed: Schema.optional<Schema.Number>;
1356
+ /**
1357
+ * Where in the executor's own history this answer was made. Absent from a daemon that predates
1358
+ * the stamp: such answers cannot be ordered by position.
1359
+ */
1360
+ readonly origin: Schema.optional<Schema.Struct<{
1361
+ readonly epoch: Schema.Int;
1362
+ readonly launch: Schema.String;
1363
+ readonly bootId: Schema.String;
1364
+ readonly bootGeneration: Schema.Int;
1365
+ readonly observation: Schema.Int;
1366
+ readonly headN: Schema.optional<Schema.Int>;
1367
+ }>>;
1368
+ /**
1369
+ * A capture step past its bound, while one is: the executor's capture is stuck there now. Not a
1370
+ * verdict: the step's own limit ends it and the snap fails (`snaps`). Absent while nothing is
1371
+ * past its bound, and from a daemon or control plane that predates it.
1372
+ */
1373
+ readonly overdue: Schema.optional<Schema.Struct<{
1374
+ readonly step: Schema.String;
1375
+ readonly startedUnixMs: Schema.Number;
1376
+ readonly runningMs: Schema.Number;
1377
+ readonly boundMs: Schema.Number;
1378
+ }>>;
1379
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getWorkspace", "GET", "/:workspaceId", HttpApiEndpoint.StringTree<Schema.Struct<{
1380
+ readonly workspaceId: Schema.String;
1381
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
1382
+ readonly ownerUserId: Schema.optional<Schema.String>;
1383
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1384
+ readonly workspaceId: Schema.String;
1385
+ readonly name: Schema.String;
1386
+ readonly ownerUserId: Schema.String;
1387
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
1388
+ readonly registryId: Schema.optional<Schema.String>;
1389
+ readonly repository: Schema.optional<Schema.String>;
1390
+ readonly tag: Schema.optional<Schema.String>;
1391
+ readonly runtime: Schema.optional<Schema.Struct<{
1392
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
1393
+ /**
1394
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
1395
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
1396
+ */
1397
+ readonly resourceId: Schema.String;
1398
+ readonly reference: Schema.String;
1399
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
1400
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
1401
+ readonly endpoint: Schema.optional<Schema.String>;
1402
+ /**
1403
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
1404
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
1405
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
1406
+ * only from control planes that predate it.
1407
+ */
1408
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
1409
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
1410
+ readonly runId: Schema.optional<Schema.String>;
1411
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
1412
+ readonly launchId: Schema.optional<Schema.String>;
1413
+ }>>;
1414
+ readonly publishedImage: Schema.optional<Schema.Struct<{
1415
+ readonly reference: Schema.String;
1416
+ readonly digestReference: Schema.String;
1417
+ readonly digest: Schema.String;
1418
+ }>>;
1419
+ readonly error: Schema.optional<Schema.Struct<{
1420
+ readonly message: Schema.String;
1421
+ readonly code: Schema.optional<Schema.String>;
1422
+ }>>;
1423
+ readonly createdAt: Schema.String;
1424
+ readonly updatedAt: Schema.String;
1425
+ readonly startedAt: Schema.optional<Schema.String>;
1426
+ readonly finishedAt: Schema.optional<Schema.String>;
1427
+ readonly expiresAt: Schema.optional<Schema.String>;
1428
+ readonly spec: Schema.optional<Schema.Unknown>;
1429
+ /**
1430
+ * The current runtime's capture drain as last observed (see `workspaceCaptureDrainSchema`).
1431
+ * Absent while no drain or preservation schedule exists, and from older control planes.
1432
+ */
1433
+ readonly captureDrain: Schema.optional<Schema.Struct<{
1434
+ readonly state: Schema.Literals<readonly ["draining", "kept", "saved", "gone", "stop-failed", "stopped", "discarded"]>;
1435
+ readonly detail: Schema.optional<Schema.String>;
1436
+ /** ISO-8601: when this was observed. */
1437
+ readonly observedAt: Schema.optional<Schema.String>;
1438
+ /** ISO-8601: when the deadline sweep starts (or started) the final drain. */
1439
+ readonly preservationStartsAt: Schema.optional<Schema.String>;
1440
+ /** The owner's request to discard the unsaved captures: who asked, and when (ISO-8601). */
1441
+ readonly discard: Schema.optional<Schema.Struct<{
1442
+ readonly requestedBy: Schema.String;
1443
+ readonly requestedAt: Schema.String;
1444
+ }>>;
1445
+ /**
1446
+ * The executor is RETAINED: kept because its disk holds work not confirmed saved. `since` and
1447
+ * `reason` say when and why; recovery is attempted on a backoff (`recoveryAttempts`,
1448
+ * `nextRecoveryAt`, `lastRecoveryError`); `recoverable` says whether its runtime can restart it
1449
+ * on its own disk (Docker) or only report it (Kubernetes, MicroVM). Absent when nothing is
1450
+ * retained.
1451
+ */
1452
+ readonly retained: Schema.optional<Schema.Struct<{
1453
+ readonly since: Schema.String;
1454
+ readonly reason: Schema.String;
1455
+ readonly recoverable: Schema.Boolean;
1456
+ readonly recoveryAttempts: Schema.Int;
1457
+ readonly nextRecoveryAt: Schema.optional<Schema.String>;
1458
+ readonly lastRecoveryError: Schema.optional<Schema.String>;
1459
+ }>>;
1460
+ /**
1461
+ * The executor this observation is about: the run and its runtime identity (`resourceId` is
1462
+ * the id a stop's `completion` names).
1463
+ */
1464
+ readonly executor: Schema.optional<Schema.Struct<{
1465
+ readonly runId: Schema.String;
1466
+ readonly adapter: Schema.String;
1467
+ readonly resourceId: Schema.String;
1468
+ readonly reference: Schema.optional<Schema.String>;
1469
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
1470
+ readonly launchId: Schema.optional<Schema.String>;
1471
+ }>>;
1472
+ /** The latest `completion` attestation accepted for this executor (see `stop`). */
1473
+ readonly completion: Schema.optional<Schema.Struct<{
1474
+ readonly executorId: Schema.String;
1475
+ readonly epoch: Schema.Int;
1476
+ readonly captureN: Schema.Int;
1477
+ readonly attestedAt: Schema.String;
1478
+ readonly launchId: Schema.optional<Schema.String>;
1479
+ /** When the store recorded the seal, when the attestation said. */
1480
+ readonly sealedAt: Schema.optional<Schema.String>;
1481
+ /** Where in the executor's own history the seal was made, when the attestation said. */
1482
+ readonly origin: Schema.optional<Schema.Struct<{
1483
+ readonly epoch: Schema.Int;
1484
+ readonly launch: Schema.String;
1485
+ readonly bootId: Schema.String;
1486
+ readonly bootGeneration: Schema.Int;
1487
+ readonly observation: Schema.Int;
1488
+ readonly headN: Schema.optional<Schema.Int>;
1489
+ }>>;
1490
+ }>>;
1491
+ }>>;
1492
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getWorkspaceCaptureStatus", "GET", "/:workspaceId/capture", HttpApiEndpoint.StringTree<Schema.Struct<{
1493
+ readonly workspaceId: Schema.String;
1494
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
1495
+ readonly ownerUserId: Schema.String;
1496
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1497
+ readonly epoch: Schema.Number;
1498
+ readonly worktreeId: Schema.String;
1499
+ /** The newest capture the session channel has registered for this worktree. */
1500
+ readonly headN: Schema.optional<Schema.Number>;
1501
+ /** Captures staged on the executor and not yet registered: the unsaved queue. */
1502
+ readonly pending: Schema.Number;
1503
+ readonly stagedBytes: Schema.Number;
1504
+ readonly uploadedObjects: Schema.Number;
1505
+ readonly uploadedBytes: Schema.Number;
1506
+ readonly registered: Schema.Number;
1507
+ readonly fenced: Schema.Boolean;
1508
+ readonly paused: Schema.Boolean;
1509
+ readonly lastSnapUnixMs: Schema.optional<Schema.Number>;
1510
+ /**
1511
+ * Capture classes the registrar refused for the session's byte quota: nothing of these ships
1512
+ * until the next epoch or re-plan, whatever `pending` says. Non-empty means work is NOT being
1513
+ * saved. Absent from control planes that predate it.
1514
+ */
1515
+ readonly refused: Schema.optional<Schema.$Array<Schema.Literals<readonly ["small", "bulk"]>>>;
1516
+ /**
1517
+ * Bytes still to ship, and bulk captures still pending (sealantd's `pending_bytes` /
1518
+ * `pending_bulk`). Every field below `refused` is absent until the daemon reports it (the
1519
+ * control plane's pinned sealantd wire predates them).
1520
+ */
1521
+ readonly pendingBytes: Schema.optional<Schema.Number>;
1522
+ readonly pendingBulk: Schema.optional<Schema.Number>;
1523
+ /**
1524
+ * The daemon's own account of its last FINAL flush: true only when it quiesced every managed
1525
+ * process, snapshotted both capture classes and registered everything. The only proof that an
1526
+ * executor may go away; `pending === 0` alone is not. Absent until sealantd reports it (read
1527
+ * absent as not complete).
1528
+ */
1529
+ readonly complete: Schema.optional<Schema.Boolean>;
1530
+ /**
1531
+ * Why the last final flush is not complete (`not-final`, `in-progress`, `processes-remain`,
1532
+ * `sweep-unavailable`, `snapshot-failed`, `unreadable`, `fenced`, `conflict`, `deadline`,
1533
+ * `ship-failed`, `pending`, `internal`). A class whose last snap failed is `snapshot-failed`.
1534
+ */
1535
+ readonly incompleteReason: Schema.optional<Schema.String>;
1536
+ /**
1537
+ * Paths the last snap of each class could not read (listed, stat'ed or opened), summed over
1538
+ * both classes. Never taken as deleted: an automatic snap carries a path's last captured
1539
+ * content forward, a final snap fails instead.
1540
+ */
1541
+ readonly unreadable: Schema.optional<Schema.Number>;
1542
+ /** Of `unreadable`, the paths whose last captured content was carried forward. */
1543
+ readonly carried: Schema.optional<Schema.Number>;
1544
+ /**
1545
+ * The first unreadable paths (at most 20), virtual: `tree/<path>` under the worktree,
1546
+ * `.git/<path>`, `harness/<path>`; small class first.
1547
+ */
1548
+ readonly unreadablePaths: Schema.optional<Schema.$Array<Schema.String>>;
1549
+ /**
1550
+ * A capture the registrar refused to register that the executor is working through:
1551
+ * `missing-objects` (an object it names is not in the store) or `unrestorable` (a section's
1552
+ * tree would not restore). Nothing is dropped: its objects are uploaded again and it is
1553
+ * rebuilt from disk in its place.
1554
+ */
1555
+ readonly registerRefused: Schema.optional<Schema.String>;
1556
+ /** That refused capture's chain position. */
1557
+ readonly registerRefusedN: Schema.optional<Schema.Number>;
1558
+ /** The first keys (at most 20) the registrar named as missing. */
1559
+ readonly registerMissing: Schema.optional<Schema.$Array<Schema.String>>;
1560
+ /** Register refusals the daemon has seen since it started. */
1561
+ readonly registerRefusals: Schema.optional<Schema.Number>;
1562
+ /** The refused capture waits to be rebuilt from disk; nothing behind it registers first. */
1563
+ readonly repairing: Schema.optional<Schema.Boolean>;
1564
+ /**
1565
+ * A bulk build is in progress: its capture is not queued yet, so `pending` and `pendingBulk`
1566
+ * do not count it (`pendingBytes` counts what it has staged). A drain is not done while true.
1567
+ */
1568
+ readonly bulkBuilding: Schema.optional<Schema.Boolean>;
1569
+ /**
1570
+ * Each captured class's snaps: how many failed since the daemon started, and the last one's
1571
+ * error while it fails. A snap that fails stages nothing: what changed since the last capture
1572
+ * is on the executor's disk only.
1573
+ */
1574
+ readonly snaps: Schema.optional<Schema.$Array<Schema.Struct<{
1575
+ readonly class: Schema.Literals<readonly ["small", "bulk"]>;
1576
+ /** Snaps of this class that failed since the daemon started. */
1577
+ readonly snapsFailed: Schema.Number;
1578
+ /** The last snap's error, while the last snap failed; absent once one succeeds. */
1579
+ readonly lastSnapError: Schema.optional<Schema.String>;
1580
+ /** When the current run of failed snaps began (Unix ms), while the last snap failed. */
1581
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
1582
+ }>>>;
1583
+ /**
1584
+ * Derived from `snaps`: the error of the class that has been failing longest. Present means the
1585
+ * executor's newest work is NOT being captured, whatever `pending` says.
1586
+ */
1587
+ readonly lastSnapError: Schema.optional<Schema.String>;
1588
+ /** Derived from `snaps`: when the earliest current run of failed snaps began (Unix ms). */
1589
+ readonly snapFailingSinceUnixMs: Schema.optional<Schema.Number>;
1590
+ /** Derived from `snaps`: failed snaps of every class since the daemon started. */
1591
+ readonly snapsFailed: Schema.optional<Schema.Number>;
1592
+ /**
1593
+ * Where in the executor's own history this answer was made. Absent from a daemon that predates
1594
+ * the stamp: such answers cannot be ordered by position.
1595
+ */
1596
+ readonly origin: Schema.optional<Schema.Struct<{
1597
+ readonly epoch: Schema.Int;
1598
+ readonly launch: Schema.String;
1599
+ readonly bootId: Schema.String;
1600
+ readonly bootGeneration: Schema.Int;
1601
+ readonly observation: Schema.Int;
1602
+ readonly headN: Schema.optional<Schema.Int>;
1603
+ }>>;
1604
+ /**
1605
+ * A capture step past its bound, while one is: the executor's capture is stuck there now. Not a
1606
+ * verdict: the step's own limit ends it and the snap fails (`snaps`). Absent while nothing is
1607
+ * past its bound, and from a daemon or control plane that predates it.
1608
+ */
1609
+ readonly overdue: Schema.optional<Schema.Struct<{
1610
+ readonly step: Schema.String;
1611
+ readonly startedUnixMs: Schema.Number;
1612
+ readonly runningMs: Schema.Number;
1613
+ readonly boundMs: Schema.Number;
1614
+ }>>;
1615
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getWorkspaceCreate", "GET", "/idempotency-keys/:idempotencyKey", HttpApiEndpoint.StringTree<Schema.Struct<{
1616
+ readonly idempotencyKey: Schema.String;
1617
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
1618
+ readonly ownerUserId: Schema.String;
1619
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1620
+ readonly idempotencyKey: Schema.String;
1621
+ readonly state: Schema.Literals<readonly ["pending", "found", "cancelled", "none"]>;
1622
+ readonly workspaceId: Schema.optional<Schema.String>;
1623
+ readonly runId: Schema.optional<Schema.String>;
1624
+ readonly launchId: Schema.optional<Schema.String>;
1625
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getWorkspaceSshTarget", "GET", "/:workspaceId/ssh-target", HttpApiEndpoint.StringTree<Schema.Struct<{
1626
+ readonly workspaceId: Schema.String;
1627
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
1628
+ readonly "x-sealant-gateway-token": Schema.optional<Schema.String>;
1629
+ readonly "x-sealant-principal-id": Schema.optional<Schema.String>;
1630
+ }>>, HttpApiEndpoint.Json<Schema.Struct<{
1631
+ readonly workspaceId: Schema.String;
1632
+ readonly attemptId: Schema.String;
1633
+ readonly runtime: Schema.Struct<{
1634
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
1635
+ readonly resourceId: Schema.String;
1636
+ readonly reference: Schema.String;
1637
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped"]>;
1638
+ readonly endpoint: Schema.String;
1639
+ }>;
1640
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceUnauthorizedError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listWorkspaceAttempts", "GET", "/:workspaceId/attempts", HttpApiEndpoint.StringTree<Schema.Struct<{
1641
+ readonly workspaceId: Schema.String;
1642
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
1643
+ readonly ownerUserId: Schema.optional<Schema.String>;
1644
+ readonly limit: Schema.optional<Schema.String>;
1645
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1646
+ readonly items: Schema.$Array<Schema.Struct<{
1647
+ readonly attemptId: Schema.String;
1648
+ readonly relation: Schema.Literals<readonly ["launch", "rebuild", "retry", "resume"]>;
1649
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
1650
+ readonly triggerType: Schema.Literals<readonly ["manual", "schedule", "api", "retry"]>;
1651
+ readonly triggerRef: Schema.optional<Schema.String>;
1652
+ readonly runtime: Schema.optional<Schema.Struct<{
1653
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
1654
+ /**
1655
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
1656
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
1657
+ */
1658
+ readonly resourceId: Schema.String;
1659
+ readonly reference: Schema.String;
1660
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
1661
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
1662
+ readonly endpoint: Schema.optional<Schema.String>;
1663
+ /**
1664
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
1665
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
1666
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
1667
+ * only from control planes that predate it.
1668
+ */
1669
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
1670
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
1671
+ readonly runId: Schema.optional<Schema.String>;
1672
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
1673
+ readonly launchId: Schema.optional<Schema.String>;
1674
+ }>>;
1675
+ readonly publishedImage: Schema.optional<Schema.Struct<{
1676
+ readonly reference: Schema.String;
1677
+ readonly digestReference: Schema.String;
1678
+ readonly digest: Schema.String;
1679
+ }>>;
1680
+ readonly error: Schema.optional<Schema.Struct<{
1681
+ readonly message: Schema.String;
1682
+ readonly code: Schema.optional<Schema.String>;
1683
+ }>>;
1684
+ readonly spec: Schema.optional<Schema.Unknown>;
1685
+ readonly queuedAt: Schema.String;
1686
+ readonly createdAt: Schema.String;
1687
+ readonly updatedAt: Schema.String;
1688
+ readonly linkedAt: Schema.String;
1689
+ readonly startedAt: Schema.optional<Schema.String>;
1690
+ readonly finishedAt: Schema.optional<Schema.String>;
1691
+ readonly durationMs: Schema.optional<Schema.Number>;
1692
+ }>>;
1693
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listWorkspaceEvents", "GET", "/:workspaceId/events", HttpApiEndpoint.StringTree<Schema.Struct<{
1694
+ readonly workspaceId: Schema.String;
1695
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
1696
+ readonly ownerUserId: Schema.optional<Schema.String>;
1697
+ readonly limit: Schema.optional<Schema.String>;
1698
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1699
+ readonly items: Schema.$Array<Schema.Struct<{
1700
+ readonly eventId: Schema.String;
1701
+ readonly workspaceId: Schema.String;
1702
+ readonly attemptId: Schema.optional<Schema.String>;
1703
+ readonly type: Schema.Literals<readonly ["workspace.created", "attempt.queued", "attempt.running", "attempt.succeeded", "attempt.failed", "attempt.cancelled", "image.published", "runtime.pending", "runtime.running", "runtime.ready", "runtime.failed", "runtime.stopped"]>;
1704
+ readonly occurredAt: Schema.String;
1705
+ readonly message: Schema.optional<Schema.String>;
1706
+ readonly data: Schema.optional<Schema.Unknown>;
1707
+ }>>;
1708
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listWorkspaces", "GET", "/", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
1709
+ readonly ownerUserId: Schema.String;
1710
+ readonly status: Schema.optional<Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>>;
1711
+ readonly limit: Schema.optional<Schema.String>;
1712
+ /** Only the owner's workspace created with this `idempotencyKey` (none or one item). */
1713
+ readonly idempotencyKey: Schema.optional<Schema.String>;
1714
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1715
+ readonly items: Schema.$Array<Schema.Struct<{
1716
+ readonly workspaceId: Schema.String;
1717
+ readonly name: Schema.String;
1718
+ readonly ownerUserId: Schema.String;
1719
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
1720
+ readonly registryId: Schema.optional<Schema.String>;
1721
+ readonly repository: Schema.optional<Schema.String>;
1722
+ readonly tag: Schema.optional<Schema.String>;
1723
+ readonly runtime: Schema.optional<Schema.Struct<{
1724
+ readonly adapter: Schema.Literals<readonly ["docker", "k8s", "k3s", "cloudflare", "microvm"]>;
1725
+ /**
1726
+ * The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
1727
+ * id. This is the id a caller records at launch and names in a stop's `completion`.
1728
+ */
1729
+ readonly resourceId: Schema.String;
1730
+ readonly reference: Schema.String;
1731
+ /** `retained`: the executor is kept with its disk for recovery (see `workspaceStatusSchema`). */
1732
+ readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped", "retained"]>;
1733
+ readonly endpoint: Schema.optional<Schema.String>;
1734
+ /**
1735
+ * ISO-8601 instant the runtime itself ends the executor, whatever anyone asks: a Lambda
1736
+ * MicroVM's maximum duration from its start. `null` where the runtime imposes no lifetime
1737
+ * (Docker, Kubernetes). A caller holding unsaved work on the executor drains before it. Absent
1738
+ * only from control planes that predate it.
1739
+ */
1740
+ readonly deadline: Schema.optional<Schema.NullOr<Schema.String>>;
1741
+ /** The run (launch attempt) this executor belongs to. Absent from older control planes. */
1742
+ readonly runId: Schema.optional<Schema.String>;
1743
+ /** The launch identity the create named for this executor (`launchId`), when it named one. */
1744
+ readonly launchId: Schema.optional<Schema.String>;
1745
+ }>>;
1746
+ readonly publishedImage: Schema.optional<Schema.Struct<{
1747
+ readonly reference: Schema.String;
1748
+ readonly digestReference: Schema.String;
1749
+ readonly digest: Schema.String;
1750
+ }>>;
1751
+ readonly error: Schema.optional<Schema.Struct<{
1752
+ readonly message: Schema.String;
1753
+ readonly code: Schema.optional<Schema.String>;
1754
+ }>>;
1755
+ readonly createdAt: Schema.String;
1756
+ readonly updatedAt: Schema.String;
1757
+ readonly startedAt: Schema.optional<Schema.String>;
1758
+ readonly finishedAt: Schema.optional<Schema.String>;
1759
+ readonly expiresAt: Schema.optional<Schema.String>;
1760
+ }>>;
1761
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"recoverWorkspace", "POST", "/:workspaceId/recover", HttpApiEndpoint.StringTree<Schema.Struct<{
1762
+ readonly workspaceId: Schema.String;
1763
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1764
+ readonly ownerUserId: Schema.String;
1765
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1766
+ readonly workspaceId: Schema.String;
1767
+ readonly state: Schema.Literals<readonly ["requested", "not-retained"]>;
1768
+ readonly recoverable: Schema.optional<Schema.Boolean>;
1769
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"renameWorkspace", "PATCH", "/:workspaceId/name", HttpApiEndpoint.StringTree<Schema.Struct<{
1770
+ readonly workspaceId: Schema.String;
1771
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1772
+ readonly name: Schema.String;
1773
+ /** The workspace's owner. Required by the control plane: a rename that names none finds nothing. */
1774
+ readonly ownerUserId: Schema.optional<Schema.String>;
1775
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1776
+ readonly workspaceId: Schema.String;
1777
+ readonly name: Schema.String;
1778
+ readonly updatedAt: Schema.String;
1779
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"replanWorkspaceCapture", "POST", "/:workspaceId/capture/replan", HttpApiEndpoint.StringTree<Schema.Struct<{
1780
+ readonly workspaceId: Schema.String;
1781
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1782
+ readonly ownerUserId: Schema.String;
1783
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1784
+ readonly worktreeId: Schema.String;
1785
+ readonly epoch: Schema.Number;
1786
+ readonly headN: Schema.optional<Schema.Number>;
1787
+ readonly headCaptureId: Schema.optional<Schema.String>;
1788
+ readonly filesWritten: Schema.Number;
1789
+ readonly bytesWritten: Schema.Number;
1790
+ readonly filesSkipped: Schema.Number;
1791
+ readonly bytesSkipped: Schema.Number;
1792
+ readonly removed: Schema.Number;
1793
+ readonly unchanged: Schema.Boolean;
1794
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"restartWorkspace", "POST", "/:workspaceId/restart", HttpApiEndpoint.StringTree<Schema.Struct<{
1795
+ readonly workspaceId: Schema.String;
1796
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1797
+ readonly ownerUserId: Schema.String;
1798
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1799
+ readonly workspaceId: Schema.String;
1800
+ /** The new attempt driving the fresh launch. */
1801
+ readonly runId: Schema.String;
1802
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
1803
+ }>>, HttpApiEndpoint.Json<typeof BudgetExceededError | typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceBadGatewayError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"stopWorkspace", "POST", "/:workspaceId/stop", HttpApiEndpoint.StringTree<Schema.Struct<{
1804
+ readonly workspaceId: Schema.String;
1805
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1806
+ readonly ownerUserId: Schema.String;
1807
+ /**
1808
+ * End the workspace WITHOUT saving its unsaved captures. A capture-sourced workspace is
1809
+ * otherwise drained before it stops, and kept running for as long as its work cannot be
1810
+ * confirmed saved; this is the owner's explicit way out. The request is recorded (who, when)
1811
+ * and every stop path honours it: the runtime is terminated at once, and the workspace's
1812
+ * `captureDrain` reads `discarded`. Accepted on a workspace already stopped whose runtime is
1813
+ * still up (a kept one). Owner only.
1814
+ */
1815
+ readonly discardUnsaved: Schema.optional<Schema.Boolean>;
1816
+ /**
1817
+ * The caller's attestation that its capture store holds a SEALED final capture of this
1818
+ * workspace's current executor: a FINAL flush that completed (every writer stopped, both
1819
+ * classes snapshotted, everything registered) and was recorded durably by the store. It is
1820
+ * permission to remove that executor's disk once it has ended, even when this control plane
1821
+ * never read `complete: true` from it itself (the FINAL reply was lost, the daemon exited
1822
+ * before a drain reached it). Accepted only when `executorId` names the current executor — the
1823
+ * run id, or the runtime's `resourceId` / `reference` (`workspace.details().runtime`) — and
1824
+ * nothing the control plane observed from the executor contradicts it: an older `epoch` than
1825
+ * the executor reported, a capture past `captureN`, or — in the same epoch — a report that its
1826
+ * work is NOT saved (incomplete, changed, unreadable, a failed snapshot) that the executor's
1827
+ * own history does not place before the seal (`origin`; without it, any such report at or past
1828
+ * `captureN` counts against the seal). Otherwise ignored, and the executor is kept as before.
1829
+ * Weighed again
1830
+ * when it is used: a later report that the work is not saved revokes it. A seal stands in for
1831
+ * a lost FINAL answer, never for a received one that said the work is not saved. Never a
1832
+ * reason to skip the drain of a running executor.
1833
+ */
1834
+ readonly completion: Schema.optional<Schema.Struct<{
1835
+ /** The sealed capture's chain position (`n`). */
1836
+ readonly captureN: Schema.Int;
1837
+ /** The capture lease epoch the seal was made under. */
1838
+ readonly epoch: Schema.Int;
1839
+ /** The executor the seal names: run id, or runtime `resourceId` / `reference`. */
1840
+ readonly executorId: Schema.String;
1841
+ /**
1842
+ * The launch identity the seal names (`final_seal.executor`). Required when the create named
1843
+ * a `launchId`, and then it must be that one; an attestation without it, or naming another
1844
+ * launch, is ignored (a seal never transfers between executors).
1845
+ */
1846
+ readonly launchId: Schema.optional<Schema.String>;
1847
+ /**
1848
+ * When the store recorded the seal (ISO 8601). Kept for display: clocks order nothing. It
1849
+ * must still read as a time.
1850
+ */
1851
+ readonly sealedAt: Schema.optional<Schema.String>;
1852
+ /**
1853
+ * Where in the executor's own history the seal was made (sealantd stamps it on the
1854
+ * `final_seal`): the one thing that orders the seal against a report of the same capture
1855
+ * that its work is not saved. Without it, such a report at or past `captureN` counts
1856
+ * against the seal.
1857
+ */
1858
+ readonly origin: Schema.optional<Schema.Struct<{
1859
+ readonly epoch: Schema.Int;
1860
+ readonly launch: Schema.String;
1861
+ readonly bootId: Schema.String;
1862
+ readonly bootGeneration: Schema.Int;
1863
+ readonly observation: Schema.Int;
1864
+ readonly headN: Schema.optional<Schema.Int>;
1865
+ }>>;
1866
+ }>>;
1867
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1868
+ readonly workspaceId: Schema.String;
1869
+ readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
1870
+ /**
1871
+ * What became of a `completion` attestation on the request: `accepted` (recorded; it lets the
1872
+ * executor's disk go once it has ended) or `ignored` (it does not name this executor, or is for
1873
+ * an older epoch; `detail` says which). Absent when the request carried none.
1874
+ */
1875
+ readonly completion: Schema.optional<Schema.Struct<{
1876
+ readonly outcome: Schema.Literals<readonly ["accepted", "ignored"]>;
1877
+ readonly detail: Schema.optional<Schema.String>;
1878
+ }>>;
1879
+ }>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceBadGatewayError | typeof WorkspaceInternalServerError>, never, never>, false>;
1880
+ export {};