@agent-compose/sdk 0.8.2 → 0.8.4

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 (43) hide show
  1. package/dist/agent/__tests__/perf-sampler.test.d.ts +10 -0
  2. package/dist/agent/agent-context.d.ts +1 -1
  3. package/dist/agent/agent-loop.d.ts +9 -1
  4. package/dist/agent/desktop-open.d.ts +184 -0
  5. package/dist/agent/perf-sampler.d.ts +99 -0
  6. package/dist/agent/services-manifest.d.ts +88 -0
  7. package/dist/agent/services-restore.d.ts +58 -0
  8. package/dist/client.d.ts +164 -8
  9. package/dist/display.d.ts +17 -0
  10. package/dist/index.d.ts +14 -5
  11. package/dist/index.js +1393 -53
  12. package/dist/runtimes/_cli-agent.d.ts +359 -2
  13. package/dist/runtimes/claude-code.d.ts +12 -0
  14. package/dist/runtimes/codex.d.ts +8 -0
  15. package/dist/runtimes/openai-desktop.js +1329 -53
  16. package/dist/runtimes/session-env.test.d.ts +14 -0
  17. package/dist/sandbox.d.ts +1 -1
  18. package/dist/types/api-conversations.d.ts +309 -1
  19. package/dist/types/api-factory.d.ts +115 -10
  20. package/dist/types/api-runs.d.ts +21 -0
  21. package/dist/types/protocol.d.ts +44 -1
  22. package/dist/types/runtime.d.ts +120 -0
  23. package/package.json +1 -1
  24. package/src/agent/agent-context.ts +100 -11
  25. package/src/agent/agent-loop.ts +15 -3
  26. package/src/agent/desktop-open.ts +418 -0
  27. package/src/agent/perf-sampler.ts +202 -0
  28. package/src/agent/services-manifest.ts +356 -0
  29. package/src/agent/services-restore.ts +195 -0
  30. package/src/client.ts +328 -12
  31. package/src/display.ts +44 -1
  32. package/src/index.ts +65 -2
  33. package/src/runtimes/_cli-agent.ts +911 -35
  34. package/src/runtimes/claude-code.ts +198 -14
  35. package/src/runtimes/codex.ts +58 -1
  36. package/src/sandbox/providers/e2b.ts +29 -1
  37. package/src/sandbox/providers/local.ts +16 -4
  38. package/src/sandbox.ts +1 -1
  39. package/src/types/api-conversations.ts +307 -3
  40. package/src/types/api-factory.ts +118 -10
  41. package/src/types/api-runs.ts +23 -0
  42. package/src/types/protocol.ts +44 -1
  43. package/src/types/runtime.ts +122 -0
package/src/index.ts CHANGED
@@ -24,8 +24,10 @@ export type {
24
24
  AgentRuntime,
25
25
  McpServerConfig,
26
26
  ModelExecutionContract,
27
+ RunnerLivenessVerdict,
27
28
  ToolCallGateResult,
28
29
  RuntimeOptions,
30
+ TurnExitNotify,
29
31
  } from "./types/runtime.js";
30
32
 
31
33
  // Workflow types and runtime utilities
@@ -98,6 +100,8 @@ export type {
98
100
  AgentMessageDone,
99
101
  AgentMessageError,
100
102
  AgentMessageUsage,
103
+ AgentMessageTaskNotification,
104
+ AgentMessageHarnessNotice,
101
105
  AgentStatus,
102
106
  } from "./types/protocol.js";
103
107
 
@@ -117,13 +121,14 @@ export type {
117
121
  InlineWorkflowPayload, InvokeInlineOptions, InvokeInlineAndWaitOptions,
118
122
  ListSnapshotsOptions, TemplateRow, ListTemplatesOptions,
119
123
  CreateFactoryInput, UpdateFactoryInput,
120
- SecretOptions, SetSecretResult, SecretListEntry,
124
+ SecretOptions, SetSecretResult, SecretListEntry, SessionSecretEntry, SessionSecretInput, SessionSecretRequestCreated, SessionSecretRequestStatus,
121
125
  CreateApiKeyInput, StreamRunLogsOptions,
122
126
  TeamMember, Mention, CreateMentionsInput,
123
127
  EventSubjectType, EventRow, ReportEventInput, ListEventsOptions, ListEventsResult,
124
128
  RunLogLine, ListRunLogsOptions,
125
129
  RunListEntry, ListRunsOptions, RunDetail,
126
130
  FundingLane, RunFundingStamp, RunFundingUsageRow, RunFundingResponse,
131
+ RunStepUsage, RunStepUsageResponse,
127
132
  RegisteredRuntime, RunState, RunStatus, FactoryRow, SnapshotListEntry, SnapshotListResponse,
128
133
  ApiKey, ApiKeyCreated, ListApiKeysOptions, ApiKeyPage,
129
134
  UsageRollupRow, UsageResponse,
@@ -142,13 +147,21 @@ export type {
142
147
  SessionPreview, PreviewOpened, OpenPreviewInput, SessionForked, BackgroundWorkHeld,
143
148
  // Session branch proposals (ADR-0053)
144
149
  SessionFileChange, SessionChangeSet, SessionChangeStats, SessionDiffReviewBound, ReviewSuggestion,
150
+ ReviewSuggestionInput, ReviewNotesPublished, ReviewGitCredential, SessionReviewDocument,
145
151
  ReviewSuggestionDecision, ReviewSuggestionDecisions,
146
152
  SessionMergeReportDetail, SessionMergeReport, SessionMergeGated, SessionDiscardReport,
153
+ SessionPreflightFileRow, SessionChangePreflight, SessionRebaseReport,
147
154
  // User drive mounts (`agentc files mount` on a human's own machine)
148
155
  DriveMountSession, CreateDriveMountSessionInput,
149
156
  // Channel-attached sessions (ADR-0057)
150
157
  ChannelSessionStatus, ChannelSessionRow, ChannelSessionsResponse, SessionChannelMessagePosted,
158
+ // Session→session messaging + branch claims
159
+ SessionDirectMessageSent, BranchClaimInfo, BranchClaimGranted, BranchClaimsReleased, BranchClaimState,
160
+ // Sandbox perf history (session_perf_rollups)
161
+ SessionPerfBucket, SessionPerfHistoryPage, FactoryPerfSummary,
151
162
  FactoryFileSearchRow, FactoryFolderSearchRow, SearchFactoryFilesOptions, FactoryFileSearchResult, PublicFileLinkState,
163
+ // Drive file listing (live + browse-at-head)
164
+ FactoryFileListRow, ListFactoryFilesOptions, FactoryFileListPage,
152
165
  // Membership-scoped authorization (ADR-0045)
153
166
  ConversationMemberRole, ConversationMember,
154
167
  DocumentCapability, TemplateCapability, ScopeGrant, ArtifactScope,
@@ -245,6 +258,33 @@ export type { CodexRuntimeConfig, CodexReasoningEffort } from "./runtimes/codex.
245
258
  export { default as codexRuntime } from "./runtimes/codex.js";
246
259
  // Reasoning-effort level a CLI runtime turn may carry (claude-code / codex).
247
260
  export type { CliReasoningEffort } from "./runtimes/_cli-agent.js";
261
+ // Guest durable-plane helpers (ADR-0068): the server-side CloudTurnWorkflow
262
+ // activities launch/probe/tail the SAME durable trio the CLI-agent transport
263
+ // writes, so the shell fragments and probe parsers are shared — one source
264
+ // of truth for the guest file contract. Server-side consumers only (these
265
+ // modules read process.env at load; never import them into a workflow VM).
266
+ export {
267
+ shellQuote, uniquePromptPath,
268
+ turnLivenessProbeCommand, parseTurnProbeOutput, livenessVerdictFromReading,
269
+ runnerBusySentinelFragment, exitEventPushCommand,
270
+ injectAppendAndAckCommand, INJECT_ACK_EXEC_TIMEOUT_MS, wrapMidTurnUserMessage,
271
+ streamInputFeederFragment, sessionEnvSourceFragment, credEnvSourceFragment,
272
+ residentFeederFragment, residentIdleCheckFragment, residentIdleWatchdogFragment,
273
+ residentResultCountCommand, deferredExitEventPushCommand,
274
+ RESIDENT_IDLE_TTL_S, RESIDENT_WATCHDOG_POLL_S, RESIDENT_RESULT_LINE_PREFIX,
275
+ SESSION_ENV_FILE_RELPATH,
276
+ LAUNCH_EXEC_TIMEOUT_MS, TURN_PROBE_TIMEOUT_MS,
277
+ INSTALL_PROBE_TIMEOUT_MS, CLI_INSTALL_TIMEOUT_MS,
278
+ RUNNER_HEARTBEAT_INTERVAL_SECONDS, RUNNER_HEARTBEAT_STALE_MS,
279
+ } from "./runtimes/_cli-agent.js";
280
+ export type { TurnProbeReading, CliAgentSpec } from "./runtimes/_cli-agent.js";
281
+ // Guest perf sampling (the `.perf` token contract riding the durable trio).
282
+ export {
283
+ perfSamplerFunctionFragment, standalonePerfProbeCommand,
284
+ parsePerfToken, parsePerfProbeOutput,
285
+ PERF_SAMPLE_EVERY_BEATS, PERF_PROBE_WINDOW_SECONDS, PERF_TOKEN_MAX_CHARS,
286
+ } from "./agent/perf-sampler.js";
287
+ export type { GuestPerfSample } from "./agent/perf-sampler.js";
248
288
  export { createAmpRuntime } from "./runtimes/amp.js";
249
289
  export type { AmpRuntimeConfig } from "./runtimes/amp.js";
250
290
  export { default as ampRuntime } from "./runtimes/amp.js";
@@ -284,7 +324,7 @@ export { createSandbox, reconnectSandbox, killAllSandboxes, killSandboxById,
284
324
  E2B_TEMPLATE_SIZES, E2B_MAX_VCPUS, E2B_MAX_MEMORY_MB,
285
325
  VERCEL_MEMORY_MB_PER_VCPU,
286
326
  isE2bSupportedSize, isVercelSupportedSize, sandboxSizeLabel,
287
- e2bMachineSpec, e2bBaseTemplate, e2bAgentEnvTemplate,
327
+ e2bMachineSpec, e2bBaseTemplate, e2bAgentEnvTemplate, e2bMaxSandboxMs,
288
328
  isPlatformE2bTemplateAlias,
289
329
  // ADR-0038 "Computer" — the per-member persistent desktop machine template.
290
330
  E2B_DEVBOX_TEMPLATE, E2B_DEVBOX_SPEC, E2B_DEVBOX_RECIPE_VERSION,
@@ -387,6 +427,28 @@ export { agent } from "./agent/run-agent.js";
387
427
  export type { AgentOpts } from "./agent/run-agent.js";
388
428
  export { AGENT_COMPOSE_MANUAL, buildAgentContextDoc, writeAgentContext, buildAddedSessionBrief } from "./agent/agent-context.js";
389
429
  export type { AgentConnectorInfo, AddedSessionBriefParams } from "./agent/agent-context.js";
430
+ export {
431
+ AC_OPEN_PATH, AC_OPEN_STATE_DIR, AC_OPEN_SHIM_PATHS, AC_OPEN_SCRIPT, AC_OPEN_SHIM,
432
+ installDesktopOpenCmd,
433
+ BROWSER_BACKFILL_PIDFILE, BROWSER_BACKFILL_LOG, BROWSER_BACKFILL_FAILED,
434
+ BROWSER_INSTALL_IN_PROGRESS_MSG, browserBackfillCmd, browserBackfillStatusCmd,
435
+ CHROMIUM_DEFAULTS, CHROMIUM_DEFAULTS_PATH, installChromiumDefaultsCmd,
436
+ } from "./agent/desktop-open.js";
437
+ // Durable services manifest (.ac/services.yml) — the machine is cattle, the
438
+ // manifest is the pet. Shared by the server's fresh-boot auto-restore, the
439
+ // resize pre-kill dump hook, and `agentc services`.
440
+ export {
441
+ SERVICES_MANIFEST_RELPATH, SERVICES_MAX, SERVICE_NAME_RE,
442
+ parseServicesManifest, renderServicesManifest,
443
+ } from "./agent/services-manifest.js";
444
+ export type {
445
+ ServiceEntry, ServiceHealth, ServiceDataHooks, ServicesManifest, ParseServicesManifestResult,
446
+ } from "./agent/services-manifest.js";
447
+ export {
448
+ SERVICES_STATE_DIR, SERVICE_STATUS_PREFIX, SERVICE_HEALTH_TIMEOUT_S,
449
+ servicesRestoreScript, servicesDumpScript, parseServicesRestoreOutput, formatServicesRestoreSummary,
450
+ } from "./agent/services-restore.js";
451
+ export type { ServiceRestoreOutcome, ServiceRestoreStatus } from "./agent/services-restore.js";
390
452
  export { AgentMessageSchema, parseAgentResponse } from "./agent/protocol.js";
391
453
  export { importSourceModule, TMP_DIR, LATEST_VERSION } from "./utils/source-loader.js";
392
454
 
@@ -398,6 +460,7 @@ export {
398
460
  TABLE_MAX_COLUMNS, TABLE_MAX_ROWS, TABLE_CELL_MAX_CHARS,
399
461
  CHART_MAX_SERIES, CHART_MAX_POINTS_PER_SERIES, CHART_LABEL_MAX_CHARS,
400
462
  ASK_PROMPT_MAX_CHARS, ASK_MAX_OPTIONS, ASK_OPTION_ID_MAX_CHARS, ASK_OPTION_LABEL_MAX_CHARS,
463
+ DESKTOP_NOTE_MAX_CHARS,
401
464
  DRIVE_PATH_MAX_CHARS, isPlausibleDrivePath,
402
465
  serializeDisplayMarker, parseDisplayMarker, findDisplayMarker, clampPlanEntries,
403
466
  clampTableData, clampChartSeries, clampChartAxisLabel, clampAskOptions,