@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
package/src/index.ts CHANGED
@@ -100,6 +100,8 @@ export type {
100
100
  AgentMessageDone,
101
101
  AgentMessageError,
102
102
  AgentMessageUsage,
103
+ AgentMessageModelUsage,
104
+ AgentMessagePlanLimits,
103
105
  AgentMessageTaskNotification,
104
106
  AgentMessageTaskProgress,
105
107
  WorkflowProgressEntry,
@@ -125,7 +127,7 @@ export type {
125
127
  InlineWorkflowPayload, InvokeInlineOptions, InvokeInlineAndWaitOptions,
126
128
  ListSnapshotsOptions, TemplateRow, ListTemplatesOptions,
127
129
  CreateFactoryInput, UpdateFactoryInput,
128
- SecretOptions, SetSecretResult, SecretListEntry, SessionSecretEntry, SessionSecretInput, SessionSecretRequestCreated, SessionSecretRequestStatus, SessionSecretRequestSummary, VaultRequestKind, VaultCatalogEntry,
130
+ SecretOptions, SetSecretResult, SecretListEntry, SessionSecretEntry, SessionSecretInput, SessionSecretRequestCreated, SessionSecretRequestStatus, SessionSecretRequestSummary, VaultRequestKind, VaultKeyShape, VaultCatalogEntry,
129
131
  CreateApiKeyInput, StreamRunLogsOptions,
130
132
  TeamMember, Mention, CreateMentionsInput,
131
133
  EventSubjectType, EventRow, ReportEventInput, ListEventsOptions, ListEventsResult,
@@ -141,9 +143,12 @@ export type {
141
143
  SendAgentMessageOptions, SendAgentMessageResponse,
142
144
  AnswerSteerOptions,
143
145
  ResumePauseOptions, ResumePauseResponse, ResumePauseSuccess, ResumePausePending, ResumePauseActor,
144
- ConversationMessagePart, ConversationRow, ConversationMessageRow,
145
- CreateChatInput, ChannelIvyState, ProjectIvyConnection,
146
+ ConversationMessagePart, ConversationRow, ConversationProject, ConversationMessageRow,
147
+ CreateChatInput, ChannelIvyState, IvyConnection, HiddenIvyConnection, IvyConnectionsView, IvyConnectionScope, ListingPage,
148
+ DriveShareItem, DriveShare, HiddenDriveShare, DriveSharesView,
149
+ WorkspaceConnection, WorkspaceConnectionAudienceEntry, WorkspaceConnectionsScopeView,
146
150
  ConversationsPage, ConversationDetail, ConversationThread,
151
+ ConversationUnreadSummary, ConversationUnreadThreads, ConversationReadInput, ConversationReadResult,
147
152
  ConversationPageContext, SendConversationMessageInput, SendConversationMessageResult,
148
153
  UnnotifiedMention,
149
154
  ConversationTurnState, ConversationPresenceSnapshot, StreamConversationOptions, AgentListRow,
@@ -151,8 +156,11 @@ export type {
151
156
  // Cloud-session developer surface (ADR-0052)
152
157
  SessionPreview, PreviewOpened, OpenPreviewInput, SessionForked, BackgroundWorkHeld,
153
158
  BackgroundWorkChildDecl, BackgroundWorkStatus,
159
+ // Session waits (owner ruling 2026-09-23: the platform senses, the session is woken)
160
+ SessionWaitKind, SessionWaitState, CreateSessionWaitInput, SessionWait, SessionWaitCheck, SessionWaitCheckResult, SessionWaitCheckReview, SessionWaitCreated, SessionWaitList,
154
161
  // Session branch proposals (ADR-0053)
155
162
  SessionFileChange, SessionChangeSet, SessionChangeStats, SessionDiffReviewBound, ReviewSuggestion,
163
+ SessionFileHold, SessionFilePlane,
156
164
  ReviewSuggestionInput, ReviewNotesPublished, ReviewGitCredential, SessionReviewDocument,
157
165
  ReviewSuggestionDecision, ReviewSuggestionDecisions,
158
166
  SessionMergeReportDetail, SessionMergeReport, SessionMergeGated, SessionDiscardReport,
@@ -160,7 +168,7 @@ export type {
160
168
  // User drive mounts (`agentc files mount` on a human's own machine)
161
169
  DriveMountSession, CreateDriveMountSessionInput,
162
170
  // Channel-attached sessions (ADR-0057)
163
- ChannelSessionStatus, ChannelSessionRow, ChannelSessionsResponse, SessionChannelMessagePosted,
171
+ ChannelSessionStatus, ChannelSessionRow, ChannelWorkerFacts, ChannelSessionsResponse,
164
172
  // Session→session messaging + branch claims
165
173
  SessionDirectMessageSent, BranchClaimInfo, BranchClaimGranted, BranchClaimsReleased, BranchClaimState,
166
174
  // Sandbox perf history (session_perf_rollups)
@@ -173,10 +181,16 @@ export type {
173
181
  DocumentCapability, TemplateCapability, ScopeGrant, ArtifactScope,
174
182
  RunContext, SetScopeGrantsInput, SetTemplateScopeInput, TemplateDetail,
175
183
  // Projects (ADR-0045 projects extension)
176
- Project, ProjectsPage, ProjectRole, ProjectMember,
177
- ProjectObject, ProjectObjectsPage, ProjectSkippedFile, ProjectPreviewFile,
184
+ Project, ProjectUpdate, ProjectsPage, ProjectRole, ProjectMember,
185
+ ProjectObject, ProjectObjectsPage, ProjectObjectCounts, ProjectSkippedFile, ProjectPreviewFile,
178
186
  ProjectAddPreview, AddProjectObjectInput, AddProjectObjectResult,
179
187
  RefreshProjectObjectResult,
188
+ ProjectStatus, ProjectStatusThread, ProjectStatusTask, ProjectStatusPerson, ProjectStatusWorker, ProjectStatusActivity,
189
+ ProjectStatusActivityKind, ProjectStatusWaitingOn, ProjectStatusWaitingCount, ProjectStatusCounts,
190
+ ThreadStatus, ThreadStatusWorker, ThreadStatusWorkerState, ThreadStatusWorkerEffort, ThreadStatusTodo, ThreadStatusDirector, ThreadStatusOutput, ThreadStatusEvent,
191
+ ThreadStatusWaitingOn, ThreadStatusAssignee, ThreadStatusTodoActivity, ChatTodoPatch, ChatTodoComment,
192
+ ChatWork, ChatWorkThread,
193
+ MeStatus, MeStatusCounts,
180
194
  // Break-glass compliance sessions (ADR-0051)
181
195
  ComplianceScopeKind, ComplianceStatus, ComplianceSession, ComplianceAccess,
182
196
  RequestComplianceSessionInput, ListComplianceSessionsOptions, ComplianceSessionsPage,
@@ -259,7 +273,9 @@ export type { GatewayModelId } from "ai";
259
273
  // CLI-agent runtimes — drive an external agentic CLI (codex / amp) inside the
260
274
  // sandbox and stream-parse its JSONL. No heavy npm deps (the CLI lives in the
261
275
  // sandbox image), so these are root-exported like claudeRuntime.
262
- export { createCodexRuntime, codexSpec } from "./runtimes/codex.js";
276
+ export {
277
+ createCodexRuntime, codexSpec, CODEX_PLATFORM_HOOKS, RTK_CODEX_HOOK_COMMAND, CODEX_MID_TURN_HOOK_COMMAND,
278
+ } from "./runtimes/codex.js";
263
279
  export type { CodexRuntimeConfig, CodexReasoningEffort } from "./runtimes/codex.js";
264
280
  export { default as codexRuntime } from "./runtimes/codex.js";
265
281
  // Reasoning-effort level a CLI runtime turn may carry (claude-code / codex).
@@ -270,27 +286,34 @@ export type { CliReasoningEffort } from "./runtimes/_cli-agent.js";
270
286
  // of truth for the guest file contract. Server-side consumers only (these
271
287
  // modules read process.env at load; never import them into a workflow VM).
272
288
  export {
273
- shellQuote, uniquePromptPath,
289
+ shellQuote, uniquePromptPath, recoverLaunchPid,
274
290
  turnLivenessProbeCommand, parseTurnProbeOutput, livenessVerdictFromReading,
275
291
  runnerBusySentinelFragment, exitEventPushCommand,
276
292
  injectAppendAndAckCommand, INJECT_ACK_EXEC_TIMEOUT_MS, wrapMidTurnUserMessage,
277
- streamInputFeederFragment, sessionEnvSourceFragment, credEnvSourceFragment,
293
+ stdinStreamInputOf, toolHookInboxFragment, MID_TURN_INBOX_ENV, MID_TURN_DELIVERED_ENV,
294
+ streamInputFeederFragment, sessionEnvSourceFragment, sessionEnvFingerprintCommand, credEnvSourceFragment,
278
295
  residentFeederFragment, residentIdleCheckFragment, residentIdleWatchdogFragment,
279
- residentResultCountCommand, deferredExitEventPushCommand,
280
- RESIDENT_IDLE_TTL_S, RESIDENT_WATCHDOG_POLL_S, RESIDENT_RESULT_LINE_PREFIX,
296
+ residentResultCountCommand, residentLastResultCommand, cliResultCountCommand,
297
+ deferredExitEventPushCommand,
298
+ RESIDENT_IDLE_TTL_S, RESIDENT_WATCHDOG_POLL_S, CLI_RESULT_LINE_AWK,
281
299
  SESSION_ENV_FILE_RELPATH,
282
300
  LAUNCH_EXEC_TIMEOUT_MS, TURN_PROBE_TIMEOUT_MS,
283
301
  INSTALL_PROBE_TIMEOUT_MS, CLI_INSTALL_TIMEOUT_MS,
284
302
  RUNNER_HEARTBEAT_INTERVAL_SECONDS, RUNNER_HEARTBEAT_STALE_MS,
303
+ RUNNER_BUSY_TASK_FRESH_MINUTES,
304
+ } from "./runtimes/_cli-agent.js";
305
+ export type {
306
+ TurnProbeReading, CliAgentSpec, MidTurnEnvelopeOptions,
307
+ MidTurnInputSpec, StdinStreamInputSpec, ToolHookInputSpec,
285
308
  } from "./runtimes/_cli-agent.js";
286
- export type { TurnProbeReading, CliAgentSpec } from "./runtimes/_cli-agent.js";
287
309
  // Guest perf sampling (the `.perf` token contract riding the durable trio).
288
310
  export {
289
311
  perfSamplerFunctionFragment, standalonePerfProbeCommand,
290
- parsePerfToken, parsePerfProbeOutput,
312
+ parsePerfToken, parsePerfProbeOutput, parseTopProcesses,
291
313
  PERF_SAMPLE_EVERY_BEATS, PERF_PROBE_WINDOW_SECONDS, PERF_TOKEN_MAX_CHARS,
314
+ PERF_TOP_PROCESSES, PERF_TOP_NAME_MAX,
292
315
  } from "./agent/perf-sampler.js";
293
- export type { GuestPerfSample } from "./agent/perf-sampler.js";
316
+ export type { GuestPerfSample, GuestTopProcess } from "./agent/perf-sampler.js";
294
317
  export { createAmpRuntime } from "./runtimes/amp.js";
295
318
  export type { AmpRuntimeConfig } from "./runtimes/amp.js";
296
319
  export { default as ampRuntime } from "./runtimes/amp.js";
@@ -310,7 +333,10 @@ export { default as droidRuntime } from "./runtimes/droid.js";
310
333
  // adapter) — the cloud-hostable counterpart of `claudeRuntime` (claude.ts,
311
334
  // which drives the Agent SDK in the calling process and so can never run a
312
335
  // server-driven cloud-session turn).
313
- export { createClaudeCodeRuntime, claudeCodeSpec, CLAUDE_CODE_ACP_ADAPTER, CLAUDE_CODE_EFFORT_LEVELS } from "./runtimes/claude-code.js";
336
+ export {
337
+ createClaudeCodeRuntime, claudeCodeSpec, CLAUDE_CODE_ACP_ADAPTER, CLAUDE_CODE_EFFORT_LEVELS,
338
+ CLAUDE_CODE_PLATFORM_SETTINGS, RTK_BASH_HOOK_COMMAND,
339
+ } from "./runtimes/claude-code.js";
314
340
  export type { ClaudeCodeRuntimeConfig } from "./runtimes/claude-code.js";
315
341
  export { default as claudeCodeRuntime } from "./runtimes/claude-code.js";
316
342
 
@@ -324,7 +350,7 @@ export type { RunEvent } from "./types/events.js";
324
350
  // Sandbox providers
325
351
  export { createSandbox, reconnectSandbox, killAllSandboxes, killSandboxById,
326
352
  getSandboxQuotas, listOwnedSandboxes, deleteSandboxSnapshot, snapshotResolves,
327
- isSandboxSourceNotFoundError,
353
+ isSandboxSourceNotFoundError, openEgressExcept,
328
354
  makeSandboxProvider, makeDesktopSandboxProvider,
329
355
  parseSseExecStream, AGENT_COMPOSE_TAG,
330
356
  SANDBOX_SIZES, SANDBOX_MACHINES, SANDBOX_VCPUS, DEFAULT_SANDBOX_SIZE, SESSION_DEFAULT_SANDBOX_SIZE,
@@ -335,7 +361,14 @@ export { createSandbox, reconnectSandbox, killAllSandboxes, killSandboxById,
335
361
  isPlatformE2bTemplateAlias,
336
362
  // ADR-0038 "Computer" — the per-member persistent desktop machine template.
337
363
  E2B_DEVBOX_TEMPLATE, E2B_DEVBOX_SPEC, E2B_DEVBOX_RECIPE_VERSION,
338
- e2bDevboxTemplateRef } from "./sandbox.js";
364
+ e2bDevboxTemplateRef,
365
+ // Harness CLI versions the E2B session image bakes (one source for the
366
+ // image recipe and the runtime specs' on-demand installs), the rtk the
367
+ // sessions' shell hooks call, and the switches that keep each CLI from
368
+ // updating itself inside a machine.
369
+ CLAUDE_CODE_VERSION, CODEX_CLI_VERSION, OPENCODE_CLI_VERSION, RTK_VERSION,
370
+ CLAUDE_CODE_NO_SELF_UPDATE_ENV, CODEX_NO_SELF_UPDATE_CONFIG_LINE, OPENCODE_NO_SELF_UPDATE_CONFIG,
371
+ } from "./sandbox.js";
339
372
  export { SandboxUnavailableError, SANDBOX_UNAVAILABLE_PREFIX } from "./sandbox-errors.js";
340
373
  export type {
341
374
  SandboxCreateOpts, SandboxNetworkPolicy, SandboxNetworkHeaderTransform,
@@ -435,12 +468,12 @@ export type { AgentOpts } from "./agent/run-agent.js";
435
468
  export { AGENT_COMPOSE_MANUAL, buildAgentContextDoc, writeAgentContext, buildAddedSessionBrief } from "./agent/agent-context.js";
436
469
  export type { AgentConnectorInfo, AddedSessionBriefParams } from "./agent/agent-context.js";
437
470
  // The complete `agentc` verb list, GENERATED from the CLI's commander
438
- // registry (cli/scripts/generate-verb-synopsis.ts) and checked in. Both
471
+ // registry (cli/scripts/generate-command-list.ts) and checked in. Both
439
472
  // agent-facing contexts ship it verbatim — the in-sandbox manual above and
440
473
  // the server's cloud-session prompt — so a verb can never drift out of what
441
474
  // agents believe the CLI can do. Never hand-edit the generated module.
442
- export { AGENTC_VERBS, AGENTC_VERB_SYNOPSIS, AGENTC_VERB_SYNOPSIS_MD } from "./generated/verb-synopsis.js";
443
- export type { AgentcVerbEntry } from "./generated/verb-synopsis.js";
475
+ export { AGENTC_COMMANDS, AGENTC_COMMAND_LIST, AGENTC_COMMAND_LIST_MD } from "./generated/agentc-commands.js";
476
+ export type { AgentcCommand } from "./generated/agentc-commands.js";
444
477
  export {
445
478
  AC_OPEN_PATH, AC_OPEN_STATE_DIR, AC_OPEN_SHIM_PATHS, AC_OPEN_SCRIPT, AC_OPEN_SHIM,
446
479
  installDesktopOpenCmd,
@@ -478,7 +511,7 @@ export {
478
511
  DRIVE_PATH_MAX_CHARS, isPlausibleDrivePath,
479
512
  serializeDisplayMarker, parseDisplayMarker, findDisplayMarker, clampPlanEntries,
480
513
  clampTableData, clampChartSeries, clampChartAxisLabel, clampAskOptions,
481
- detectAgentcInvocation, shellWords, createDisplayPromoter,
514
+ detectAgentcInvocation, shellWords, createDisplayPromoter, DISPLAY_PROMOTED_TOOL_NAMES,
482
515
  } from "./display.js";
483
516
  export type {
484
517
  DisplayMarker, DisplayPlanEntry, DisplayPlanStatus,
@@ -169,7 +169,8 @@ function scopeOf(coord: PauseCoordinate): string {
169
169
 
170
170
  // Per-scope ordinal. Module-level so it resets on a fresh subprocess (the
171
171
  // resume boundary) — which is exactly what makes the k-th pause in a scope
172
- // recompute the same id across re-entry. Mirrors `nextAgentCallIndexByStep`.
172
+ // recompute the same id across re-entry. Mirrors the per-step agent-call
173
+ // counter (`nextAgentCallInActiveStep`).
173
174
  const pauseOrdinalByScope = new Map<string, number>();
174
175
 
175
176
  function nextPauseOrdinal(scope: string): number {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * RequestContext — one typed bag carrying tenant identity + freeform
3
3
  * per-run state across the boundary between server, dispatch, runner,
4
- * workflow body, agent loop, and (future) processors.
4
+ * workflow body, agent loop, and processors.
5
5
  *
6
6
  * Two halves:
7
7
  *