@agent-compose/sdk 0.8.5 → 0.8.6

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 (97) hide show
  1. package/README.md +213 -189
  2. package/dist/agent/agent-context.d.ts +3 -3
  3. package/dist/agent/agent-loop.d.ts +4 -5
  4. package/dist/agent/perf-sampler.d.ts +27 -2
  5. package/dist/agent/run-agent.d.ts +1 -1
  6. package/dist/client.d.ts +105 -52
  7. package/dist/directives.d.ts +3 -3
  8. package/dist/display.d.ts +7 -0
  9. package/dist/errors.d.ts +1 -1
  10. package/dist/generated/agentc-commands.d.ts +34 -0
  11. package/dist/index.d.ts +12 -12
  12. package/dist/index.js +716 -203
  13. package/dist/request-context/request-context.d.ts +1 -1
  14. package/dist/runtimes/_cli-agent.d.ts +182 -68
  15. package/dist/runtimes/claude-code.d.ts +60 -1
  16. package/dist/runtimes/claude.d.ts +1 -1
  17. package/dist/runtimes/codex.d.ts +94 -6
  18. package/dist/runtimes/codex.mid-turn-hook.test.d.ts +10 -0
  19. package/dist/runtimes/openai-desktop.js +686 -199
  20. package/dist/runtimes/opencode.d.ts +48 -11
  21. package/dist/runtimes/opencode.test.d.ts +14 -0
  22. package/dist/sandbox/baked-clis.d.ts +75 -0
  23. package/dist/sandbox/exec-stream.d.ts +1 -2
  24. package/dist/sandbox/network-policy.d.ts +23 -5
  25. package/dist/sandbox.d.ts +4 -2
  26. package/dist/step-invocation/protocol.d.ts +3 -4
  27. package/dist/step-invocation/server.d.ts +2 -2
  28. package/dist/step-invocation/types.d.ts +1 -1
  29. package/dist/types/api-conversations.d.ts +442 -29
  30. package/dist/types/api-factory.d.ts +78 -8
  31. package/dist/types/api-projects.d.ts +480 -0
  32. package/dist/types/api-runs.d.ts +8 -0
  33. package/dist/types/api-scopes.d.ts +32 -3
  34. package/dist/types/conversation-stream.d.ts +5 -0
  35. package/dist/types/execution-context.d.ts +1 -1
  36. package/dist/types/protocol.d.ts +65 -2
  37. package/dist/types/runtime.d.ts +9 -2
  38. package/dist/types/workflow-metadata.d.ts +2 -4
  39. package/dist/types/workflow-plan.d.ts +1 -3
  40. package/dist/utils/bundler.d.ts +23 -0
  41. package/dist/workflow-steps/observability.d.ts +2 -3
  42. package/dist/workflow-steps/runner.d.ts +5 -8
  43. package/dist/workflow-steps/types.d.ts +8 -10
  44. package/dist/workflow-steps/workflow.d.ts +2 -1
  45. package/dist/workflows/engine.d.ts +3 -5
  46. package/dist/workflows/invoke-child.d.ts +2 -2
  47. package/package.json +2 -2
  48. package/src/agent/agent-context.ts +168 -125
  49. package/src/agent/agent-loop.ts +5 -4
  50. package/src/agent/perf-sampler.ts +54 -3
  51. package/src/agent/run-agent.ts +1 -1
  52. package/src/client.ts +191 -71
  53. package/src/directives.ts +3 -3
  54. package/src/display.ts +12 -0
  55. package/src/errors.ts +1 -0
  56. package/src/generated/agentc-commands.ts +571 -0
  57. package/src/index.ts +54 -21
  58. package/src/pause/pause-core.ts +2 -1
  59. package/src/request-context/request-context.ts +1 -1
  60. package/src/runtimes/_cli-agent.ts +306 -122
  61. package/src/runtimes/claude-code.ts +179 -9
  62. package/src/runtimes/claude.ts +1 -1
  63. package/src/runtimes/codex.ts +188 -19
  64. package/src/runtimes/opencode.ts +195 -26
  65. package/src/sandbox/baked-clis.ts +86 -0
  66. package/src/sandbox/exec-stream.ts +1 -2
  67. package/src/sandbox/network-policy.ts +51 -7
  68. package/src/sandbox/providers/e2b.ts +3 -3
  69. package/src/sandbox/providers/vercel.ts +6 -6
  70. package/src/sandbox.ts +8 -2
  71. package/src/step-invocation/invoker.ts +2 -6
  72. package/src/step-invocation/protocol.ts +3 -4
  73. package/src/step-invocation/server.ts +2 -2
  74. package/src/types/api-conversations.ts +366 -23
  75. package/src/types/api-factory.ts +74 -8
  76. package/src/types/api-projects.ts +443 -0
  77. package/src/types/api-runs.ts +5 -0
  78. package/src/types/api-scopes.ts +32 -3
  79. package/src/types/conversation-stream.ts +5 -0
  80. package/src/types/execution-context.ts +1 -1
  81. package/src/types/protocol.ts +67 -1
  82. package/src/types/runtime.ts +8 -2
  83. package/src/types/sandbox-environment.ts +1 -2
  84. package/src/types/workflow-metadata.ts +2 -4
  85. package/src/types/workflow-plan.ts +1 -3
  86. package/src/utils/bundler.ts +88 -19
  87. package/src/workflow-steps/observability.ts +2 -3
  88. package/src/workflow-steps/runner.ts +5 -8
  89. package/src/workflow-steps/types.ts +8 -10
  90. package/src/workflow-steps/workflow.ts +2 -1
  91. package/src/workflows/engine.ts +3 -5
  92. package/src/workflows/invoke-child.ts +2 -2
  93. package/dist/generated/verb-synopsis.d.ts +0 -34
  94. package/dist/pause/__tests__/errors.test.d.ts +0 -1
  95. package/dist/pause/__tests__/wrappers.test.d.ts +0 -1
  96. package/dist/step-invocation/__tests__/protocol.test.d.ts +0 -1
  97. package/src/generated/verb-synopsis.ts +0 -544
@@ -128,9 +128,10 @@ export interface TemplateDetail {
128
128
  export interface ListTemplatesOptions {
129
129
  factorySlug?: string;
130
130
  }
131
- /** One team connector grant, as `GET /api/v1/connectors` returns it (wire
132
- * shape verbatim — snake_case). The typed subset the SDK pins; additional
133
- * fields flow through untyped. */
131
+ /** One connector grant, as `GET /api/v1/connectors` returns it (wire shape
132
+ * verbatim — snake_case): the caller's own grants and the workspace's
133
+ * GitHub installations, never a teammate's other accounts. The typed
134
+ * subset the SDK pins; additional fields flow through untyped. */
134
135
  export interface ConnectorGrantSummary {
135
136
  id: string;
136
137
  provider: string;
@@ -366,18 +367,63 @@ export type SessionSecretInput = {
366
367
  * single-use page a session writer opens to provide the named values. */
367
368
  export interface SessionSecretRequestCreated {
368
369
  requestId: string;
369
- url: string;
370
+ /** The single-use link, the owner's to tap. Null on a DEDUPED answer: the
371
+ * open ask's link already went out and nothing new exists to send. */
372
+ url: string | null;
370
373
  expiresAt: string;
371
374
  /** True = a standing auto-approve set already filled the request at the
372
375
  * mint — nothing is pending; source the session env now. */
373
376
  autoApproved?: boolean;
377
+ /** Set with autoApproved when the grant came from this work's earlier
378
+ * worker (the same person's grant, carried with no card): who gave it. */
379
+ carried?: {
380
+ grantedByName: string | null;
381
+ };
382
+ /** True = an OPEN request of the same kind (or the same key set) already
383
+ * stood on this session, and this answer IS that request: no new row, no
384
+ * new card, nobody asked again. `keys` are the open request's key names,
385
+ * the names the values land under; `note` says what to do. */
386
+ deduped?: boolean;
387
+ keys?: string[];
388
+ kind?: VaultRequestKind | null;
389
+ note?: string;
390
+ /** Who holds the ask: the thread's agent (it raises the card once), the
391
+ * owner's assistant, or nobody (no owner, no agent). */
392
+ routedTo?: "agent" | "owner" | null;
393
+ /** A chat's worker: its card is in the chat, where the work was asked for. */
394
+ card?: "in the chat";
374
395
  }
375
396
  /** What KIND of credential a vault request asks for (advisory): the vault
376
397
  * page leads with the user's MATCHING standing entries. */
377
398
  export type VaultRequestKind = "login" | "password" | "api_key" | "payment_card" | "env_file" | "note" | "other";
399
+ /** How one requested key is delivered to the session: BROKERED — the egress
400
+ * edge adds `headerName: [scheme ]<value>` on requests to `host`, and the
401
+ * value never enters the machine; INJECTED — the value lands in the session
402
+ * env file. An `api_key` request declares one per key. */
403
+ export type VaultKeyShape = {
404
+ mode: "brokered";
405
+ host: string;
406
+ headerName: string;
407
+ scheme?: string;
408
+ } | {
409
+ mode: "injected";
410
+ };
411
+ /** The STANDING entry a request is for, named by its label and/or (a card)
412
+ * its last four digits — at least one. The card and the vault page lead
413
+ * with that entry, so the person sees which saved credential is meant. */
414
+ export interface RequestedVaultEntry {
415
+ label?: string;
416
+ last4?: string;
417
+ }
418
+ /** A saved payment card's receipts: its network (from the number's issuer
419
+ * prefix; null when unknown) and its last four. Never more. */
420
+ export interface VaultCardHint {
421
+ brand: string | null;
422
+ last4: string;
423
+ }
378
424
  /** One STANDING vault entry usable for a session (the catalog read,
379
- * 2026-08-31) — labels, kinds, and field NAMES only; values are write-only
380
- * and never on this wire. */
425
+ * 2026-08-31) — labels, kinds, identifiers and field NAMES only; values
426
+ * are write-only and never on this wire. */
381
427
  export interface VaultCatalogEntry {
382
428
  label: string;
383
429
  kind: string;
@@ -386,6 +432,12 @@ export interface VaultCatalogEntry {
386
432
  ownerName: string | null;
387
433
  projectName: string | null;
388
434
  lastUsedAt: string | null;
435
+ /** The account the entry belongs to, or a card's network and last four
436
+ * ("Amex •••• 1002") — how look-alike labels are told apart. Absent on
437
+ * an older server. */
438
+ identifier?: string | null;
439
+ /** The card's receipts when the entry is a card; null otherwise. */
440
+ card?: VaultCardHint | null;
389
441
  }
390
442
  /** A vault link's polled status. */
391
443
  export interface SessionSecretRequestStatus {
@@ -395,7 +447,7 @@ export interface SessionSecretRequestStatus {
395
447
  expiresAt: string;
396
448
  /** Cancellation attribution (task #111) — present on cancelled rows:
397
449
  * who ended the ask ('human' = denied; 'agent' = withdrawn) and why. */
398
- cancelledVia?: "human" | "agent";
450
+ cancelledVia?: "human" | "agent" | "thread_agent";
399
451
  cancelReason?: string | null;
400
452
  /** The denying human's display name (best-effort; 'human' via only). */
401
453
  deniedByName?: string | null;
@@ -409,12 +461,18 @@ export interface SessionSecretRequestStatus {
409
461
  export interface SessionSecretRequestSummary {
410
462
  requestId: string;
411
463
  keys: string[];
464
+ /** What kind of credential the ask is for; null when the requester did not say. */
465
+ kind: VaultRequestKind | null;
412
466
  reason: string | null;
413
467
  expiresAt: string;
414
468
  createdAt: string;
415
469
  }
416
470
  export interface CreateApiKeyInput {
417
471
  name?: string;
472
+ /** Omitted → `read` alone (the read-only default). Anything more —
473
+ * `invoke`, `manage`, `admin` — is chosen explicitly, and the server
474
+ * refuses any scope the minter does not hold (403 `scope_not_held`).
475
+ * `events:read` / `events:write` are deprecated but still accepted. */
418
476
  scopes?: string[];
419
477
  expiresAt?: string;
420
478
  factorySlug?: string;
@@ -480,6 +538,9 @@ export interface UsageResponse {
480
538
  * app-level (the platform GitHub App's own webhook) or polling — there
481
539
  * is no per-repo webhook setup (retired 2026-08-18). */
482
540
  export interface DriveRepoLink {
541
+ /** Last successful API head read; a deferred attempt does not advance it. */
542
+ lastHeadObservedAt: string | null;
543
+ headCheckDeferredUntil: string | null;
483
544
  id: string;
484
545
  factoryId: string;
485
546
  /** Linked directory prefix under the drive root (relative, no slashes
@@ -517,7 +578,16 @@ export interface DriveRepoLink {
517
578
  }>;
518
579
  lastSyncedGitSha: string | null;
519
580
  lastSyncedAcgCommit: string | null;
520
- syncState: "idle" | "syncing" | "pushing" | "error" | "conflict" | "diverged" | "reauth_required";
581
+ /** 'queued': the branch's first sync (or a full re-ingest) is waiting in
582
+ * the ingest queue; `ingestPriority` / `ingestQueueAhead` say where. */
583
+ syncState: "idle" | "queued" | "syncing" | "pushing" | "error" | "conflict" | "diverged" | "reauth_required";
584
+ /** Drain tier while queued (0 foreground, 1 active, 2 background). */
585
+ ingestPriority: number | null;
586
+ ingestQueuedAt: string | null;
587
+ /** When a runner started this branch's ingest; null when none runs. */
588
+ ingestClaimedAt: string | null;
589
+ /** Queued branches of the same repo ahead of this one (list only). */
590
+ ingestQueueAhead?: number | null;
521
591
  /** Human-readable detail when syncState is 'error' or 'conflict'. */
522
592
  syncError: string | null;
523
593
  createdBy: string | null;
@@ -30,6 +30,22 @@ export interface Project {
30
30
  role: ProjectRole;
31
31
  memberCount: number;
32
32
  objectCount: number;
33
+ /** The overview's words and dates (owner 2026-10-05): a short
34
+ * description, and the start and target dates as calendar days
35
+ * (`YYYY-MM-DD`); null until someone sets them. */
36
+ description: string | null;
37
+ startDate: string | null;
38
+ targetDate: string | null;
39
+ }
40
+ /** What `updateProject` may set: each field absent = untouched, null =
41
+ * cleared. `name` and the details need `write`; `visibility` needs a
42
+ * project owner or a team admin. */
43
+ export interface ProjectUpdate {
44
+ name?: string;
45
+ visibility?: "public" | "private";
46
+ description?: string | null;
47
+ startDate?: string | null;
48
+ targetDate?: string | null;
33
49
  }
34
50
  /** A page of projects, newest-activity first. Cursor-paginated: pass the
35
51
  * previous page's `next_cursor` (null when exhausted). */
@@ -84,6 +100,15 @@ export interface ProjectObjectsPage {
84
100
  objects: ProjectObject[];
85
101
  next_cursor: string | null;
86
102
  }
103
+ /** How many objects of each kind a project holds for the caller — the
104
+ * whole project's counts under the list's own visibility, never a
105
+ * page's. `GET /projects/:id/objects/counts`. */
106
+ export interface ProjectObjectCounts {
107
+ file: number;
108
+ conversation: number;
109
+ session: number;
110
+ folder: number;
111
+ }
87
112
  /** One file the caller could NOT contribute to a project when adding a
88
113
  * session — only files the caller OWNS are materialized. `path` is present
89
114
  * only when visible to the caller; paths concealed from the caller are
@@ -129,3 +154,458 @@ export interface RefreshProjectObjectResult {
129
154
  objects: ProjectObject[];
130
155
  skipped: ProjectSkippedFile[];
131
156
  }
157
+ /** A person on a project status row, identity merged server-side. `email`
158
+ * rides only while they share the workspace with the viewer: the
159
+ * dashboard's label rule (name, else email, else "Teammate") picks. */
160
+ export interface ProjectStatusPerson {
161
+ id: string;
162
+ name: string | null;
163
+ email: string | null;
164
+ image: string | null;
165
+ avatarUrl: string | null;
166
+ }
167
+ /** Whom a thread waits on (owner 2026-10-01: status "is multiplayer, could
168
+ * be needs Chris or Westan"; it names people). A plan task that waits on a
169
+ * person, as the thread agent wrote it (a teammate, or someone outside by
170
+ * name), or a worker's question owed an answer, which waits on the person
171
+ * who asked for the work (the thread's opening message), else the last
172
+ * person to speak on the thread. */
173
+ export interface ProjectStatusWaitingOn {
174
+ /** The teammate, when known. */
175
+ person: ProjectStatusPerson | null;
176
+ /** How the thread names them: the teammate's name, "Dana's IT team", or
177
+ * "an answer" when a worker's question has nobody to wait on yet. */
178
+ who: string;
179
+ /** What they will do or answer, in the people's terms. */
180
+ what: string | null;
181
+ kind: "task" | "question";
182
+ /** The chat message where the person said it, when the thread agent
183
+ * recorded one: the way to the ask. Null otherwise. */
184
+ messageId: string | null;
185
+ }
186
+ /** Whom a TASK waits on (owner 2026-10-05: a todo may wait on more than one
187
+ * person's answer or sign-off): every teammate it names, as people, and
188
+ * the words the thread agent (or the person who set it) wrote for whoever
189
+ * they are. */
190
+ export interface ThreadStatusWaitingOn {
191
+ /** The teammates, the one whose act comes first first; empty for a wait
192
+ * on someone the workspace cannot name ("Dana's IT team"). */
193
+ people: ProjectStatusPerson[];
194
+ /** How the thread names them. */
195
+ who: string;
196
+ /** What they will do or answer, in the people's terms; null when a person
197
+ * set the wait without saying for what. */
198
+ what: string | null;
199
+ /** The chat message where the person said it, when one was recorded. */
200
+ messageId: string | null;
201
+ }
202
+ /** Who a todo is assigned to (owner 2026-10-05, like an issue's assignee):
203
+ * Ivy, or one person. Null on the todo = nobody, after a person took the
204
+ * assignee off. */
205
+ export type ThreadStatusAssignee = {
206
+ kind: "ivy";
207
+ } | ({
208
+ kind: "person";
209
+ } & ProjectStatusPerson);
210
+ /** One plan task of a thread, as the thread agent's plan view reads it. */
211
+ export interface ProjectStatusTask {
212
+ id: string;
213
+ objective: string;
214
+ status: "open" | "done";
215
+ dueAt: string | null;
216
+ overdue: boolean;
217
+ /** Open and waiting on a task that is not done. */
218
+ blocked: boolean;
219
+ criteria: {
220
+ met: number;
221
+ total: number;
222
+ };
223
+ /** Open and waiting on a person. */
224
+ waitingOn: ThreadStatusWaitingOn | null;
225
+ assignee: ThreadStatusAssignee | null;
226
+ }
227
+ /** What a thread's workers are doing, from platform rows: `waiting` a
228
+ * worker's question is owed an answer; `working` a worker has a live turn;
229
+ * `idle` workers exist and none is running; `done` the thread is closed;
230
+ * `none` no worker was started. */
231
+ export type ProjectStatusWorker = "working" | "waiting" | "idle" | "done" | "none";
232
+ /** One outcome thread born in one of the project's chats. */
233
+ export interface ProjectStatusThread {
234
+ id: string;
235
+ title: string;
236
+ state: "open" | "waiting" | "snoozed" | "closed";
237
+ note: string | null;
238
+ /** The chat the thread was born in, and whether it is public or private. */
239
+ conversation: {
240
+ id: string;
241
+ title: string | null;
242
+ access: "public" | "private";
243
+ };
244
+ /** The chat message the thread opened on, for a deep link; null if none. */
245
+ openingMessageId: string | null;
246
+ /** Who holds the next move: a person while the thread waits on people,
247
+ * else Ivy. */
248
+ owner: {
249
+ kind: "ivy";
250
+ } | ({
251
+ kind: "person";
252
+ } & ProjectStatusPerson);
253
+ /** The people who spoke on the thread, most recent first. */
254
+ people: ProjectStatusPerson[];
255
+ /** The now line: what its running worker is doing (`worker`), else the
256
+ * thread agent's note, its own reading of where things stand (`note`);
257
+ * null when there is neither. `at` is when the text was set (ISO). */
258
+ now: {
259
+ kind: "worker" | "note";
260
+ text: string;
261
+ at: string | null;
262
+ } | null;
263
+ /** `running`: how many of its workers have a live turn. `line`: while
264
+ * `status` is working, the one-line status its running worker set most
265
+ * recently ("Reading the Fly logs") and when (ISO); null otherwise. */
266
+ worker: {
267
+ status: ProjectStatusWorker;
268
+ sessions: number;
269
+ running: number;
270
+ line: {
271
+ text: string;
272
+ at: string;
273
+ } | null;
274
+ };
275
+ /** Whom the thread waits on, named; empty when it waits on nobody. */
276
+ waitingOn: ProjectStatusWaitingOn[];
277
+ /** The next open task deadline, else the thread agent's check-in. */
278
+ next: {
279
+ at: string;
280
+ what: string;
281
+ kind: "deadline" | "check_in";
282
+ } | null;
283
+ progress: {
284
+ done: number;
285
+ total: number;
286
+ };
287
+ tasks: ProjectStatusTask[];
288
+ overdue: number;
289
+ blocked: number;
290
+ unmetCriteria: number;
291
+ lastMovementAt: string;
292
+ closedAt: string | null;
293
+ }
294
+ /** What moved: a task done, a thread opened or closed, a result or decision
295
+ * the thread agent raised to the people, a worker's declared result, or a
296
+ * person's answer (`by` names them). */
297
+ export type ProjectStatusActivityKind = "task_done" | "thread_closed" | "thread_opened" | "result" | "decision" | "answer";
298
+ export interface ProjectStatusActivity {
299
+ at: string;
300
+ kind: ProjectStatusActivityKind;
301
+ threadId: string;
302
+ threadTitle: string;
303
+ text: string;
304
+ by: ProjectStatusPerson | null;
305
+ }
306
+ /** How many live threads wait on one person (or one named outsider). */
307
+ export interface ProjectStatusWaitingCount {
308
+ person: ProjectStatusPerson | null;
309
+ who: string;
310
+ threads: number;
311
+ }
312
+ /** The header's counts: "3 in progress, waiting on Chris (2) and Westan (1),
313
+ * 4 done this week". */
314
+ export interface ProjectStatusCounts {
315
+ /** Live threads (open, waiting or snoozed). */
316
+ inProgress: number;
317
+ /** Threads closed in the last seven days. */
318
+ doneThisWeek: number;
319
+ waitingOn: ProjectStatusWaitingCount[];
320
+ }
321
+ /** GET /projects/:id/status. `threads` (the live ones) is cursor-paginated
322
+ * by last movement; `recentlyClosed` rides the first page only (empty on
323
+ * later pages). The project facts (`sources`, `progress`, `dueAt`,
324
+ * `nextCheckIn`, `activity`) span every thread the viewer may read, on
325
+ * every page. */
326
+ export interface ProjectStatus {
327
+ project: {
328
+ id: string;
329
+ name: string;
330
+ visibility: "public" | "private";
331
+ role: ProjectRole;
332
+ };
333
+ /** The chats in the project, where its threads are born. */
334
+ sources: number;
335
+ progress: {
336
+ done: number;
337
+ total: number;
338
+ };
339
+ /** The latest deadline of an open task: the project's finish line. */
340
+ dueAt: string | null;
341
+ nextCheckIn: {
342
+ at: string;
343
+ threadId: string;
344
+ threadTitle: string;
345
+ conversationId: string;
346
+ with: ProjectStatusPerson | null;
347
+ } | null;
348
+ counts: ProjectStatusCounts;
349
+ threads: ProjectStatusThread[];
350
+ /** Closed in the last seven days. */
351
+ recentlyClosed: ProjectStatusThread[];
352
+ activity: ProjectStatusActivity[];
353
+ generatedAt: string;
354
+ next_cursor: string | null;
355
+ }
356
+ /** A worker's state as the chat's chips say it: working (a live turn, or
357
+ * parked on a question), starting (nothing produced yet), done, failed,
358
+ * stopped. */
359
+ export type ThreadStatusWorkerState = "starting" | "working" | "done" | "failed" | "stopped";
360
+ /** The effort a worker was started with; null = the harness's own default. */
361
+ export type ThreadStatusWorkerEffort = "low" | "medium" | "high" | "xhigh" | "max";
362
+ export interface ThreadStatusWorker {
363
+ /** The worker's session (its page is /conversations/:id). */
364
+ conversationId: string;
365
+ title: string | null;
366
+ state: ThreadStatusWorkerState;
367
+ /** Its one-line status while working; null otherwise. */
368
+ line: {
369
+ text: string;
370
+ at: string;
371
+ } | null;
372
+ startedAt: string;
373
+ /** When a settled worker last spoke, or its session ended. */
374
+ finishedAt: string | null;
375
+ /** The result it declared, when it did. */
376
+ result: string | null;
377
+ /** The question it is parked on, while one is owed. */
378
+ asking: string | null;
379
+ /** The model stamped at birth; null = the runtime's own default. */
380
+ model: string | null;
381
+ effort: ThreadStatusWorkerEffort | null;
382
+ /** The harness it runs ("claude-code", "codex", ...); null when unknown. */
383
+ runtime: string | null;
384
+ /** Where it runs: a cloud sandbox or the person's machine; null when
385
+ * unknown. */
386
+ executor: "local" | "cloud" | null;
387
+ /** When its running turn started (ISO); null while no turn runs. */
388
+ workingSince: string | null;
389
+ /** Its machine has a live desktop to show (the Desktop pill's own
390
+ * verdict, for the session's current machine): the chat draws a door to
391
+ * it on the step the worker is on. False for a local session, a machine
392
+ * with no GUI, or a session no longer on a machine. */
393
+ desktopCapable: boolean;
394
+ }
395
+ /** A message that directed a step: who wrote it and the opening of what
396
+ * they said, where it sits (its chat and, for a reply, the root of its
397
+ * chat thread; null for the chat's top level) and when. */
398
+ export interface ThreadStatusDirector {
399
+ messageId: string;
400
+ conversationId: string;
401
+ threadRootId: string | null;
402
+ /** The person who wrote it, as the status wire names people; null for a
403
+ * message Ivy wrote. */
404
+ author: ProjectStatusPerson | null;
405
+ /** The opening of what they said, in plain words (links read as their
406
+ * labels), capped; null when the message shows no words. */
407
+ excerpt: string | null;
408
+ /** When it was said (ISO). */
409
+ at: string;
410
+ }
411
+ /** Something a worker produced, filed under the step it was on: a desktop
412
+ * screenshot or a capture pushed with a need (`path`, a drive file), or
413
+ * its declared result (`text`, its words). */
414
+ export interface ThreadStatusOutput {
415
+ id: string;
416
+ kind: "screenshot" | "capture" | "result";
417
+ /** When it landed (ISO). */
418
+ at: string;
419
+ /** The drive path of a picture; null for words. */
420
+ path: string | null;
421
+ /** The words: a result's own, a picture's summary. */
422
+ text: string;
423
+ }
424
+ /** What a person did on a todo in the chat's todo view (owner 2026-10-05):
425
+ * a comment, or an edit of its assignee, details, status or whom it waits
426
+ * on. The todo's Activity, with the platform's own history. */
427
+ export interface ThreadStatusTodoActivity {
428
+ id: string;
429
+ /** When (ISO). */
430
+ at: string;
431
+ kind: "comment" | "assignee" | "description" | "status" | "waiting_on";
432
+ /** Who did it; null for a person the workspace cannot name. */
433
+ by: ProjectStatusPerson | null;
434
+ /** A comment's words, or the details written; null otherwise. */
435
+ text: string | null;
436
+ /** The assignee set (`kind` assignee); null for nobody. */
437
+ assignee: ThreadStatusAssignee | null;
438
+ /** The status set (`kind` status). */
439
+ status: "open" | "in_progress" | "waiting" | "done" | null;
440
+ /** The people set (`kind` waiting_on). */
441
+ waitingOn: ProjectStatusPerson[];
442
+ }
443
+ /** One step of the thread's plan. */
444
+ export interface ThreadStatusTodo {
445
+ id: string;
446
+ objective: string;
447
+ status: "open" | "done";
448
+ dueAt: string | null;
449
+ overdue: boolean;
450
+ /** Open and waiting on a step that is not done. */
451
+ blocked: boolean;
452
+ /** The steps it waits on, by their objective. */
453
+ blockedOn: string[];
454
+ /** Open and waiting on people. */
455
+ waitingOn: ThreadStatusWaitingOn | null;
456
+ /** Who it is assigned to: Ivy, one person, or nobody (owner 2026-10-05).
457
+ * Stored on the server; the plan's default is the first person it waits
458
+ * on, else Ivy, and a person's choice stands over the plan's. */
459
+ assignee: ThreadStatusAssignee | null;
460
+ /** The details a person wrote on it, plain text with line breaks; null
461
+ * when none. */
462
+ description: string | null;
463
+ /** What people did on it (edits and comments), oldest first, bounded. */
464
+ activity: ThreadStatusTodoActivity[];
465
+ /** Its done criteria, as counts. */
466
+ criteria: {
467
+ met: number;
468
+ total: number;
469
+ };
470
+ /** The thread's worker on this step (the thread agent's stamp), or null. */
471
+ workerConversationId: string | null;
472
+ /** Done, and completed with this note: what it produced, in one line. */
473
+ result: string | null;
474
+ /** When a worker was first put on the step (ISO): its own clock in the
475
+ * chat, never a worker's turn. Null until then. */
476
+ startedAt: string | null;
477
+ /** Done at this moment (ISO): when its check-off lands in the chat. Null
478
+ * while open. */
479
+ completedAt: string | null;
480
+ /** The messages that directed the step (the request or follow-up that
481
+ * added it, then every steer, from another chat thread too), oldest
482
+ * first. Empty = the job's request alone. The step's status shows in the
483
+ * chat thread of each. */
484
+ directedBy: ThreadStatusDirector[];
485
+ /** What the worker produced for the step, newest first (bounded): its
486
+ * screenshots and captures, and its declared result. */
487
+ outputs: ThreadStatusOutput[];
488
+ }
489
+ /** One of the last things that happened on the thread: a worker's stream
490
+ * event (its type), or the thread's record ("said" for a person's words,
491
+ * "raised" for what the agent put to the people, "worker_result", ...). */
492
+ export interface ThreadStatusEvent {
493
+ at: string;
494
+ kind: string;
495
+ text: string;
496
+ by: ProjectStatusPerson | null;
497
+ }
498
+ /** One thread's work, as the card under the message that started it reads
499
+ * it: the thread, the root it opened on, the note, its workers and its
500
+ * steps. */
501
+ export interface ChatWorkThread {
502
+ thread: ProjectStatusThread;
503
+ /** The message the thread opened on, in this chat: the job's request —
504
+ * who asked for it, their words, where it sits (the job's started mark
505
+ * shows there) and when. Null when the thread opened on no message here
506
+ * (the chat shows no card for it, but its workers still count in the
507
+ * chat's working status), or the viewer cannot see it. */
508
+ request: ThreadStatusDirector | null;
509
+ /** The job's latest place: the newest agent-authored message after the
510
+ * request in the request's own chat thread (the thread under a room
511
+ * request, or the reply thread the request sits in), else the room's
512
+ * newest after it for a room request answered inline. "Jump to latest"
513
+ * lands here. Null while nothing has answered; the request is then its
514
+ * place. */
515
+ latestMessageId: string | null;
516
+ /** The chat thread that latest message sits in (null for the room's top
517
+ * level); null with no latest message. */
518
+ latestThreadRootId: string | null;
519
+ /** The thread agent's rolling note: where things stand, in its words. */
520
+ summary: string | null;
521
+ /** When the thread was opened (ISO): the job's start, the beginning of
522
+ * its total time. */
523
+ openedAt: string;
524
+ /** Working first, then starting, then what settled (newest first). */
525
+ workers: ThreadStatusWorker[];
526
+ /** The plan's steps, in plan order (oldest first). */
527
+ todos: ThreadStatusTodo[];
528
+ }
529
+ export interface ThreadStatus extends ChatWorkThread {
530
+ events: ThreadStatusEvent[];
531
+ generatedAt: string;
532
+ }
533
+ /** GET /conversations/:id/work: the chat's threads, most recently moved
534
+ * first and bounded (the server's CHAT_WORK_THREADS), each with its work.
535
+ * 404 for a chat the viewer cannot read. */
536
+ export interface ChatWork {
537
+ threads: ChatWorkThread[];
538
+ /** The project the chat is filed in, as the viewer may see it; null for
539
+ * a chat in none. A todo's Properties name it. */
540
+ project: {
541
+ id: string;
542
+ name: string;
543
+ } | null;
544
+ generatedAt: string;
545
+ }
546
+ /** PATCH /conversations/:id/todos/:todoId (owner 2026-10-05: "change the
547
+ * assignee", "write details in here myself"): what a person who can read
548
+ * the chat may change on a todo. Each field is optional; one call may
549
+ * carry several. Answers the chat's whole work read (ChatWork), so the
550
+ * surfaces redraw from one truth. */
551
+ export interface ChatTodoPatch {
552
+ /** The one assignee: Ivy, a person who can read the chat, or null for
553
+ * nobody. */
554
+ assignee?: {
555
+ kind: "ivy";
556
+ } | {
557
+ kind: "person";
558
+ userId: string;
559
+ } | null;
560
+ /** The details, plain text with line breaks; null or "" clears. */
561
+ description?: string | null;
562
+ /** Where it stands, in the plan's own states: open (not started), in
563
+ * progress, waiting (on the people given, or the ones it already waits
564
+ * on), done. A done todo stays done. */
565
+ status?: "open" | "in_progress" | "waiting" | "done";
566
+ /** Whom it waits on: people who can read the chat (several allowed), and
567
+ * for what; [] or null clears the wait. */
568
+ waitingOn?: {
569
+ userIds: string[];
570
+ what?: string | null;
571
+ } | null;
572
+ }
573
+ /** POST /conversations/:id/todos/:todoId/comments: a comment on the todo,
574
+ * which lands in its Activity and reaches the thread's agent. Answers the
575
+ * chat's whole work read. */
576
+ export interface ChatTodoComment {
577
+ text: string;
578
+ }
579
+ export interface MeStatusCounts {
580
+ waitingOnYou: number;
581
+ inProgress: number;
582
+ /** The viewer's projects with a relevant live thread. */
583
+ projects: number;
584
+ doneThisWeek: number;
585
+ }
586
+ /** GET /me/status, for the current workspace: the threads relevant to the
587
+ * viewer (they posted, were mentioned, asked, have a to-do, or are in the
588
+ * chat), never the whole workspace. `threads` is cursor-paginated by last
589
+ * movement; `waitingOnYou`, `recentlyClosed` and `activity` ride the first
590
+ * page. The client groups by `chatProjects` (the viewer's project for each
591
+ * chat; a chat absent there is in none of theirs). */
592
+ export interface MeStatus {
593
+ counts: MeStatusCounts;
594
+ /** Live threads a task of which waits on the viewer, or whose worker's
595
+ * question is owed and the viewer asked for the work (else spoke last). */
596
+ waitingOnYou: ProjectStatusThread[];
597
+ threads: ProjectStatusThread[];
598
+ recentlyClosed: ProjectStatusThread[];
599
+ chatProjects: Array<{
600
+ conversationId: string;
601
+ project: {
602
+ id: string;
603
+ name: string;
604
+ };
605
+ }>;
606
+ activity: Array<ProjectStatusActivity & {
607
+ conversationId: string | null;
608
+ }>;
609
+ generatedAt: string;
610
+ next_cursor: string | null;
611
+ }
@@ -90,6 +90,14 @@ export interface InvokeInlineAndWaitOptions extends InvokeInlineOptions {
90
90
  }
91
91
  export interface InvokeResult {
92
92
  id: string;
93
+ /** The run is PARKED for its funding plan's reset: the person whose plan
94
+ * pays for it has every plan out, so nothing runs until `until`, when it
95
+ * starts by itself; `text` is the one line to pass on. Absent for a run
96
+ * that boots now. */
97
+ hold?: {
98
+ until: string;
99
+ text: string;
100
+ };
93
101
  }
94
102
  export interface StreamRunLogsOptions {
95
103
  lastEventId?: number;