@agent-compose/sdk 0.8.5 → 0.8.7

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 (100) 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 +6 -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 +119 -54
  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 +771 -204
  13. package/dist/request-context/request-context.d.ts +1 -1
  14. package/dist/runtimes/_cli-agent.d.ts +185 -68
  15. package/dist/runtimes/_reported-model.d.ts +16 -0
  16. package/dist/runtimes/claude-code.d.ts +60 -1
  17. package/dist/runtimes/claude.d.ts +1 -1
  18. package/dist/runtimes/codex.d.ts +94 -6
  19. package/dist/runtimes/codex.mid-turn-hook.test.d.ts +10 -0
  20. package/dist/runtimes/model-report.test.d.ts +14 -0
  21. package/dist/runtimes/openai-desktop.js +741 -200
  22. package/dist/runtimes/opencode.d.ts +48 -11
  23. package/dist/runtimes/opencode.test.d.ts +14 -0
  24. package/dist/sandbox/baked-clis.d.ts +75 -0
  25. package/dist/sandbox/exec-stream.d.ts +1 -2
  26. package/dist/sandbox/network-policy.d.ts +23 -5
  27. package/dist/sandbox.d.ts +4 -2
  28. package/dist/step-invocation/protocol.d.ts +3 -4
  29. package/dist/step-invocation/server.d.ts +2 -2
  30. package/dist/step-invocation/types.d.ts +1 -1
  31. package/dist/types/api-conversations.d.ts +442 -29
  32. package/dist/types/api-factory.d.ts +99 -10
  33. package/dist/types/api-projects.d.ts +521 -0
  34. package/dist/types/api-runs.d.ts +83 -0
  35. package/dist/types/api-scopes.d.ts +32 -3
  36. package/dist/types/conversation-stream.d.ts +5 -0
  37. package/dist/types/execution-context.d.ts +1 -1
  38. package/dist/types/protocol.d.ts +86 -2
  39. package/dist/types/runtime.d.ts +9 -2
  40. package/dist/types/workflow-metadata.d.ts +2 -4
  41. package/dist/types/workflow-plan.d.ts +1 -3
  42. package/dist/utils/bundler.d.ts +23 -0
  43. package/dist/workflow-steps/observability.d.ts +2 -3
  44. package/dist/workflow-steps/runner.d.ts +5 -8
  45. package/dist/workflow-steps/types.d.ts +8 -10
  46. package/dist/workflow-steps/workflow.d.ts +2 -1
  47. package/dist/workflows/engine.d.ts +3 -5
  48. package/dist/workflows/invoke-child.d.ts +2 -2
  49. package/package.json +2 -2
  50. package/src/agent/agent-context.ts +168 -125
  51. package/src/agent/agent-loop.ts +7 -6
  52. package/src/agent/perf-sampler.ts +54 -3
  53. package/src/agent/run-agent.ts +1 -1
  54. package/src/client.ts +226 -71
  55. package/src/directives.ts +3 -3
  56. package/src/display.ts +12 -0
  57. package/src/errors.ts +1 -0
  58. package/src/generated/agentc-commands.ts +571 -0
  59. package/src/index.ts +57 -21
  60. package/src/pause/pause-core.ts +2 -1
  61. package/src/request-context/request-context.ts +1 -1
  62. package/src/runtimes/_cli-agent.ts +318 -122
  63. package/src/runtimes/_reported-model.ts +24 -0
  64. package/src/runtimes/claude-code.ts +195 -12
  65. package/src/runtimes/claude.ts +9 -2
  66. package/src/runtimes/codex.ts +188 -19
  67. package/src/runtimes/opencode.ts +195 -26
  68. package/src/sandbox/baked-clis.ts +86 -0
  69. package/src/sandbox/exec-stream.ts +1 -2
  70. package/src/sandbox/network-policy.ts +51 -7
  71. package/src/sandbox/providers/e2b.ts +3 -3
  72. package/src/sandbox/providers/vercel.ts +6 -6
  73. package/src/sandbox.ts +8 -2
  74. package/src/step-invocation/invoker.ts +2 -6
  75. package/src/step-invocation/protocol.ts +3 -4
  76. package/src/step-invocation/server.ts +2 -2
  77. package/src/types/api-conversations.ts +366 -23
  78. package/src/types/api-factory.ts +95 -10
  79. package/src/types/api-projects.ts +477 -0
  80. package/src/types/api-runs.ts +73 -0
  81. package/src/types/api-scopes.ts +32 -3
  82. package/src/types/conversation-stream.ts +5 -0
  83. package/src/types/execution-context.ts +1 -1
  84. package/src/types/protocol.ts +91 -2
  85. package/src/types/runtime.ts +8 -2
  86. package/src/types/sandbox-environment.ts +1 -2
  87. package/src/types/workflow-metadata.ts +2 -4
  88. package/src/types/workflow-plan.ts +1 -3
  89. package/src/utils/bundler.ts +88 -19
  90. package/src/workflow-steps/observability.ts +2 -3
  91. package/src/workflow-steps/runner.ts +5 -8
  92. package/src/workflow-steps/types.ts +8 -10
  93. package/src/workflow-steps/workflow.ts +2 -1
  94. package/src/workflows/engine.ts +3 -5
  95. package/src/workflows/invoke-child.ts +2 -2
  96. package/dist/generated/verb-synopsis.d.ts +0 -34
  97. package/dist/pause/__tests__/errors.test.d.ts +0 -1
  98. package/dist/pause/__tests__/wrappers.test.d.ts +0 -1
  99. package/dist/step-invocation/__tests__/protocol.test.d.ts +0 -1
  100. package/src/generated/verb-synopsis.ts +0 -544
@@ -96,6 +96,18 @@ export interface RegisterWorkflowInput {
96
96
  factoryDrive?: "required" | "none";
97
97
  /** Factory slug. Defaults to `"default"`. */
98
98
  factorySlug?: string;
99
+ /** Register INTO a project (`agentc register --project`, ADR-0087): the
100
+ * workflow, its schedules and its runs are visible to the project's
101
+ * members alone, read live, so leaving the project loses them — the
102
+ * registrant included (the workflow belongs to the project, with no
103
+ * personal owner). Any member with a write or owner seat in the project
104
+ * may register into it on a key that holds `invoke`; the `manage` scope
105
+ * is not needed. A read seat is refused (403 `role_read_only`); a
106
+ * project the registrant cannot see answers 404 exactly as one that does
107
+ * not exist. Omitted, a registration from a terminal or an API key is
108
+ * the whole space's and takes `manage` (403 `manage_required`
109
+ * otherwise). */
110
+ projectId?: string;
99
111
  }
100
112
  export interface TemplateRow {
101
113
  name: string;
@@ -128,9 +140,10 @@ export interface TemplateDetail {
128
140
  export interface ListTemplatesOptions {
129
141
  factorySlug?: string;
130
142
  }
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. */
143
+ /** One connector grant, as `GET /api/v1/connectors` returns it (wire shape
144
+ * verbatim — snake_case): the caller's own grants and the workspace's
145
+ * GitHub installations, never a teammate's other accounts. The typed
146
+ * subset the SDK pins; additional fields flow through untyped. */
134
147
  export interface ConnectorGrantSummary {
135
148
  id: string;
136
149
  provider: string;
@@ -304,6 +317,8 @@ export interface UpdateFactoryInput {
304
317
  }
305
318
  export interface ScheduleRow {
306
319
  id: string;
320
+ /** The factory the schedule (and the workflow it fires) lives in. */
321
+ factoryId: string;
307
322
  name: string;
308
323
  workflowName: string;
309
324
  cron: string;
@@ -366,18 +381,68 @@ export type SessionSecretInput = {
366
381
  * single-use page a session writer opens to provide the named values. */
367
382
  export interface SessionSecretRequestCreated {
368
383
  requestId: string;
369
- url: string;
384
+ /** The single-use link, the owner's to tap. Null on a DEDUPED answer: the
385
+ * open ask's link already went out and nothing new exists to send. */
386
+ url: string | null;
370
387
  expiresAt: string;
371
- /** True = a standing auto-approve set already filled the request at the
372
- * mint — nothing is pending; source the session env now. */
388
+ /** True = a standing auto-approve set or this work's grant already filled
389
+ * the request at the mint — nothing is pending. */
373
390
  autoApproved?: boolean;
391
+ /** With autoApproved: true = the values are on the session's RUNNING
392
+ * machine now (its env file, and its egress ruleset for a brokered key),
393
+ * so re-sourcing the session env loads them; false = no machine is
394
+ * running or the push failed, and they land when the next turn starts. */
395
+ loaded?: boolean;
396
+ /** Set with autoApproved when the grant came from this work's earlier
397
+ * worker (the same person's grant, carried with no card): who gave it. */
398
+ carried?: {
399
+ grantedByName: string | null;
400
+ };
401
+ /** True = an OPEN request of the same kind (or the same key set) already
402
+ * stood on this session, and this answer IS that request: no new row, no
403
+ * new card, nobody asked again. `keys` are the open request's key names,
404
+ * the names the values land under; `note` says what to do. */
405
+ deduped?: boolean;
406
+ keys?: string[];
407
+ kind?: VaultRequestKind | null;
408
+ note?: string;
409
+ /** Who holds the ask: the thread's agent (it raises the card once), the
410
+ * owner's assistant, or nobody (no owner, no agent). */
411
+ routedTo?: "agent" | "owner" | null;
412
+ /** A chat's worker: its card is in the chat, where the work was asked for. */
413
+ card?: "in the chat";
374
414
  }
375
415
  /** What KIND of credential a vault request asks for (advisory): the vault
376
416
  * page leads with the user's MATCHING standing entries. */
377
417
  export type VaultRequestKind = "login" | "password" | "api_key" | "payment_card" | "env_file" | "note" | "other";
418
+ /** How one requested key is delivered to the session: BROKERED — the egress
419
+ * edge adds `headerName: [scheme ]<value>` on requests to `host`, and the
420
+ * value never enters the machine; INJECTED — the value lands in the session
421
+ * env file. An `api_key` request declares one per key. */
422
+ export type VaultKeyShape = {
423
+ mode: "brokered";
424
+ host: string;
425
+ headerName: string;
426
+ scheme?: string;
427
+ } | {
428
+ mode: "injected";
429
+ };
430
+ /** The STANDING entry a request is for, named by its label and/or (a card)
431
+ * its last four digits — at least one. The card and the vault page lead
432
+ * with that entry, so the person sees which saved credential is meant. */
433
+ export interface RequestedVaultEntry {
434
+ label?: string;
435
+ last4?: string;
436
+ }
437
+ /** A saved payment card's receipts: its network (from the number's issuer
438
+ * prefix; null when unknown) and its last four. Never more. */
439
+ export interface VaultCardHint {
440
+ brand: string | null;
441
+ last4: string;
442
+ }
378
443
  /** 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. */
444
+ * 2026-08-31) — labels, kinds, identifiers and field NAMES only; values
445
+ * are write-only and never on this wire. */
381
446
  export interface VaultCatalogEntry {
382
447
  label: string;
383
448
  kind: string;
@@ -386,6 +451,12 @@ export interface VaultCatalogEntry {
386
451
  ownerName: string | null;
387
452
  projectName: string | null;
388
453
  lastUsedAt: string | null;
454
+ /** The account the entry belongs to, or a card's network and last four
455
+ * ("Amex •••• 1002") — how look-alike labels are told apart. Absent on
456
+ * an older server. */
457
+ identifier?: string | null;
458
+ /** The card's receipts when the entry is a card; null otherwise. */
459
+ card?: VaultCardHint | null;
389
460
  }
390
461
  /** A vault link's polled status. */
391
462
  export interface SessionSecretRequestStatus {
@@ -395,7 +466,7 @@ export interface SessionSecretRequestStatus {
395
466
  expiresAt: string;
396
467
  /** Cancellation attribution (task #111) — present on cancelled rows:
397
468
  * who ended the ask ('human' = denied; 'agent' = withdrawn) and why. */
398
- cancelledVia?: "human" | "agent";
469
+ cancelledVia?: "human" | "agent" | "thread_agent";
399
470
  cancelReason?: string | null;
400
471
  /** The denying human's display name (best-effort; 'human' via only). */
401
472
  deniedByName?: string | null;
@@ -409,12 +480,18 @@ export interface SessionSecretRequestStatus {
409
480
  export interface SessionSecretRequestSummary {
410
481
  requestId: string;
411
482
  keys: string[];
483
+ /** What kind of credential the ask is for; null when the requester did not say. */
484
+ kind: VaultRequestKind | null;
412
485
  reason: string | null;
413
486
  expiresAt: string;
414
487
  createdAt: string;
415
488
  }
416
489
  export interface CreateApiKeyInput {
417
490
  name?: string;
491
+ /** Omitted → `read` alone (the read-only default). Anything more —
492
+ * `invoke`, `manage`, `admin` — is chosen explicitly, and the server
493
+ * refuses any scope the minter does not hold (403 `scope_not_held`).
494
+ * `events:read` / `events:write` are deprecated but still accepted. */
418
495
  scopes?: string[];
419
496
  expiresAt?: string;
420
497
  factorySlug?: string;
@@ -480,6 +557,9 @@ export interface UsageResponse {
480
557
  * app-level (the platform GitHub App's own webhook) or polling — there
481
558
  * is no per-repo webhook setup (retired 2026-08-18). */
482
559
  export interface DriveRepoLink {
560
+ /** Last successful API head read; a deferred attempt does not advance it. */
561
+ lastHeadObservedAt: string | null;
562
+ headCheckDeferredUntil: string | null;
483
563
  id: string;
484
564
  factoryId: string;
485
565
  /** Linked directory prefix under the drive root (relative, no slashes
@@ -517,7 +597,16 @@ export interface DriveRepoLink {
517
597
  }>;
518
598
  lastSyncedGitSha: string | null;
519
599
  lastSyncedAcgCommit: string | null;
520
- syncState: "idle" | "syncing" | "pushing" | "error" | "conflict" | "diverged" | "reauth_required";
600
+ /** 'queued': the branch's first sync (or a full re-ingest) is waiting in
601
+ * the ingest queue; `ingestPriority` / `ingestQueueAhead` say where. */
602
+ syncState: "idle" | "queued" | "syncing" | "pushing" | "error" | "conflict" | "diverged" | "reauth_required";
603
+ /** Drain tier while queued (0 foreground, 1 active, 2 background). */
604
+ ingestPriority: number | null;
605
+ ingestQueuedAt: string | null;
606
+ /** When a runner started this branch's ingest; null when none runs. */
607
+ ingestClaimedAt: string | null;
608
+ /** Queued branches of the same repo ahead of this one (list only). */
609
+ ingestQueueAhead?: number | null;
521
610
  /** Human-readable detail when syncState is 'error' or 'conflict'. */
522
611
  syncError: string | null;
523
612
  createdBy: string | null;