stitchkit 0.130.1 → 0.131.0

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 (152) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/agent-executor/acp/v1-connect.d.ts +40 -26
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +10 -4
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-handlers.d.ts +6 -2
  7. package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
  8. package/dist/agent-executor/acp/v1-probe.d.ts +38 -0
  9. package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -0
  10. package/dist/agent-executor/acp/v1-protocol.d.ts +15 -0
  11. package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
  12. package/dist/agent-executor/acp/v1-session.d.ts +9 -7
  13. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  14. package/dist/agent-executor/claude/cli-driver.d.ts +7 -7
  15. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  16. package/dist/agent-executor/claude/limits.d.ts +6 -4
  17. package/dist/agent-executor/claude/limits.d.ts.map +1 -1
  18. package/dist/agent-executor/claude/session.d.ts +3 -3
  19. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  20. package/dist/agent-executor/claude-sdk/controls.d.ts +1 -0
  21. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
  22. package/dist/agent-executor/claude-sdk/driver.d.ts +51 -50
  23. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  24. package/dist/agent-executor/claude-sdk/probe.d.ts +3 -3
  25. package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -1
  26. package/dist/agent-executor/claude-sdk/query-loop.d.ts +2 -1
  27. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  28. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  29. package/dist/agent-executor/codex/connect.d.ts +7 -7
  30. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  31. package/dist/agent-executor/codex/control-client.d.ts +86 -99
  32. package/dist/agent-executor/codex/control-client.d.ts.map +1 -1
  33. package/dist/agent-executor/codex/control-read-methods.d.ts +7 -0
  34. package/dist/agent-executor/codex/control-read-methods.d.ts.map +1 -0
  35. package/dist/agent-executor/codex/driver.d.ts +29 -28
  36. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  37. package/dist/agent-executor/codex/event-routing.d.ts +14 -0
  38. package/dist/agent-executor/codex/event-routing.d.ts.map +1 -0
  39. package/dist/agent-executor/codex/handlers.d.ts +2 -2
  40. package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
  41. package/dist/agent-executor/codex/limits.d.ts +9 -3
  42. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  43. package/dist/agent-executor/codex/notifications.d.ts +183 -0
  44. package/dist/agent-executor/codex/notifications.d.ts.map +1 -0
  45. package/dist/agent-executor/codex/pagination.d.ts +54 -0
  46. package/dist/agent-executor/codex/pagination.d.ts.map +1 -0
  47. package/dist/agent-executor/codex/protocol.d.ts +586 -148
  48. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  49. package/dist/agent-executor/codex/request-answers.d.ts +4 -2
  50. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
  51. package/dist/agent-executor/codex/responses.d.ts +855 -0
  52. package/dist/agent-executor/codex/responses.d.ts.map +1 -0
  53. package/dist/agent-executor/codex/session-bind.d.ts +410 -0
  54. package/dist/agent-executor/codex/session-bind.d.ts.map +1 -0
  55. package/dist/agent-executor/codex/session-controls.d.ts +19 -190
  56. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
  57. package/dist/agent-executor/codex/session-types.d.ts +190 -0
  58. package/dist/agent-executor/codex/session-types.d.ts.map +1 -0
  59. package/dist/agent-executor/codex/session.d.ts +1 -1
  60. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  61. package/dist/agent-executor/codex/shared-server.d.ts +4 -4
  62. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
  63. package/dist/agent-executor/codex/shared-thread.d.ts +5 -5
  64. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
  65. package/dist/agent-executor/codex/thread-controls.d.ts +45 -36
  66. package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -1
  67. package/dist/agent-executor/codex/thread-list-query.d.ts +5 -0
  68. package/dist/agent-executor/codex/thread-list-query.d.ts.map +1 -0
  69. package/dist/agent-executor/codex/thread-open.d.ts +20 -20
  70. package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
  71. package/dist/agent-executor/codex/turn-input.d.ts +4 -3
  72. package/dist/agent-executor/codex/turn-input.d.ts.map +1 -1
  73. package/dist/agent-executor/codex/unix-socket-target.d.ts +12 -3
  74. package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -1
  75. package/dist/agent-executor/codex/ws-frame.d.ts +4 -1
  76. package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -1
  77. package/dist/agent-executor/contract.d.ts +3 -1
  78. package/dist/agent-executor/contract.d.ts.map +1 -1
  79. package/dist/agent-executor/engine-process.d.ts +4 -4
  80. package/dist/agent-executor/engine-process.d.ts.map +1 -1
  81. package/dist/agent-executor/engine.d.ts +3 -3
  82. package/dist/agent-executor/engine.d.ts.map +1 -1
  83. package/dist/agent-executor/handoff.d.ts.map +1 -1
  84. package/dist/agent-executor/hello.d.ts +7 -0
  85. package/dist/agent-executor/hello.d.ts.map +1 -1
  86. package/dist/agent-executor/json-rpc-peer.d.ts +9 -4
  87. package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -1
  88. package/dist/agent-executor/leases.d.ts +1 -1
  89. package/dist/agent-executor/leases.d.ts.map +1 -1
  90. package/dist/agent-executor/plan-limits.d.ts +12 -1
  91. package/dist/agent-executor/plan-limits.d.ts.map +1 -1
  92. package/dist/agent-executor/profile.d.ts +7 -0
  93. package/dist/agent-executor/profile.d.ts.map +1 -1
  94. package/dist/agent-executor/session-primitives.d.ts +8 -0
  95. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  96. package/dist/agent-executor/testing/consumer-stubs.d.ts +45 -0
  97. package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -0
  98. package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts +88 -0
  99. package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts.map +1 -0
  100. package/dist/agent-executor/testing/fake-codex-app-server.d.ts +56 -0
  101. package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -0
  102. package/dist/agent-executor/testing/fixtures.d.ts +26 -0
  103. package/dist/agent-executor/testing/fixtures.d.ts.map +1 -0
  104. package/dist/agent-executor/testing/replay-driver.d.ts +8 -8
  105. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
  106. package/dist/agent-executor/testing/replay-runner.d.ts +3 -2
  107. package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -1
  108. package/dist/agent-executor/testing/replay-transcript.d.ts +5 -3
  109. package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
  110. package/dist/agent-runtime/branch-observations.d.ts +19 -19
  111. package/dist/agent-runtime/sql-rows.d.ts +10 -10
  112. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
  113. package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
  114. package/dist/agent-runtime/terminal-commit.d.ts +10 -10
  115. package/dist/entrypoints/agent-executor/acp.d.ts +2 -1
  116. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  117. package/dist/entrypoints/agent-executor/acp.js +284 -82
  118. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +4 -0
  119. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  120. package/dist/entrypoints/agent-executor/claude-sdk.js +58 -32
  121. package/dist/entrypoints/agent-executor/claude.d.ts +2 -2
  122. package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -1
  123. package/dist/entrypoints/agent-executor/claude.js +25 -20
  124. package/dist/entrypoints/agent-executor/codex.d.ts +9 -5
  125. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  126. package/dist/entrypoints/agent-executor/codex.js +1724 -1557
  127. package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
  128. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  129. package/dist/entrypoints/agent-executor/testing.js +880 -18
  130. package/dist/entrypoints/agent-executor.d.ts +3 -3
  131. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  132. package/dist/entrypoints/agent-executor.js +42 -8
  133. package/dist/entrypoints/process.js +3 -3
  134. package/dist/{index-jrn3prgm.js → index-32vaajec.js} +29 -4
  135. package/dist/{index-p1qmpq0p.js → index-64e9p079.js} +92 -56
  136. package/dist/{index-dbp6xemn.js → index-g2d9kws8.js} +199 -3
  137. package/dist/index-gm9yz82v.js +56 -0
  138. package/dist/index-j15dhkda.js +749 -0
  139. package/dist/{index-1q0n6zek.js → index-kwsr7j5k.js} +84 -44
  140. package/llms/agent-executor-acp.txt +5 -5
  141. package/llms/agent-executor-claude-sdk.txt +3 -1
  142. package/llms/agent-executor-claude.txt +2 -2
  143. package/llms/agent-executor-codex.txt +11 -8
  144. package/llms/agent-executor-testing.txt +5 -1
  145. package/llms/agent-executor.txt +4 -4
  146. package/llms/stitchkit.txt +75 -74
  147. package/llms/{upgrading-0.128.0-0.130.0.txt → upgrading-0.128.0-0.131.0.txt} +56 -3
  148. package/llms/upgrading.txt +1 -1
  149. package/llms-full.txt +158 -95
  150. package/llms.txt +8 -8
  151. package/package.json +3 -3
  152. package/dist/index-2s8sy57y.js +0 -229
package/CHANGELOG.md CHANGED
@@ -15,6 +15,48 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.131.0] - 2026-11-27
19
+
20
+ ### ⚠️ Breaking changes
21
+
22
+ **Who must act:** every caller of `stitchkit/agent-executor/codex` that treats `CodexControlClient` / `CodexSession` RPC replies as raw `JsonRpcValue`, reads `CodexThreadContext.sandbox` as a plain string or `approvalPolicy` as raw `JsonRpcValue`, or passes untyped `JsonRpcValue` to `CodexTurnInput.sandboxPolicy` ([migration](docs/guide/upgrading.md#codex-typed-control-dtos)); every caller of `stitchkit/agent-executor/claude-sdk` that assumes `ClaudeSdkSession.setPermissionMode` resolves to `void`, mutates `ClaudeSdkPermissionRequestMeta.input` in place, or pins `@anthropic-ai/claude-agent-sdk` below `0.3.332` ([migration](docs/guide/upgrading.md#claude-sdk-03332-and-typed-permission-controls)); and every caller of `planLimitsDue` from `stitchkit/agent-executor` that expected clean `no-plan-limit` or `unpublished` answers to become due after `maxAgeMs` ([migration](docs/guide/upgrading.md#plan-limits-due-clean-answers)).
23
+
24
+ - `stitchkit/agent-executor/codex` — `CodexControlClient` (and `CodexSession` / `CodexControlConnection` / `CodexSharedServer`) RPCs now validate and return typed loose Zod DTOs (`CodexConfigReadResponse`, `CodexReadThreadResponse`, `CodexResumeThreadResponse`, `CodexCollaborationModesResponse`, `CodexTurnsPage`, `CodexItemsPage`, `CodexMcpServerStatusPage`, `CodexSkillsListResponse`, `CodexModelsPage`, `CodexAccountReadResponse`, `CodexRateLimitsResponse`, `CodexThreadsPage`, `CodexLoadedThreadsPage`, `CodexThreadUnsubscribeResponse`, `CodexThreadUnarchiveResponse`, `CodexThreadMetadataUpdateResponse`) and `Promise<void>` for empty mutators (`injectItems`, `archiveThread`, `setThreadName`) instead of raw `JsonRpcValue`, throwing `CodexProtocolError` on malformed server replies; `CodexThreadContext.sandbox` and `CodexTurnInput.sandboxPolicy` now use `CodexSandboxPolicySchema`, `CodexThreadContext.approvalPolicy` uses `CodexApprovalPolicySchema`, and `CodexThreadContext.thread` / `CodexRevertThreadResult.thread` use `CodexThreadSchema`.
25
+ `const raw = (await session.readThread({ threadId })) as { thread: { id: string } }` → `const { thread } = await session.readThread({ threadId })`.
26
+ **Affects:** `stitchkit/agent-executor/codex` createCodexDriver(open, connectControl, openSharedServer), CodexDriver, CodexSession, CodexControlClient, CodexControlConnection, CodexSharedServer, CodexThreadContext, CodexTurnInput, CodexRevertThreadResult
27
+ - `stitchkit/agent-executor/claude-sdk` — `ClaudeSdkSession.setPermissionMode` now returns `Promise<SDKControlSetPermissionModeResponse | undefined>` (recording the server's effective `mode`) instead of `Promise<void>`; `ClaudeSdkPermissionRequestMeta.input` is narrowed to `Readonly<Record<string, JsonRpcValue>>`; and the optional peer range for `@anthropic-ai/claude-agent-sdk` is raised to `^0.3.332`.
28
+ `meta.input.command = 'rewritten'` → `const updatedInput = { ...meta.input, command: 'rewritten' }`.
29
+ **Affects:** `stitchkit/agent-executor/claude-sdk` createClaudeSdkDriver(open), ClaudeSdkDriver, ClaudeSdkSession, ClaudeSdkPermissionRequestMeta
30
+ - `stitchkit/agent-executor` — `planLimitsDue` now returns `false` for clean `no-plan-limit` and `unpublished` `PlanLimits` answers without an `error`, avoiding periodic re-polling when no plan limits exist or the provider has not published any yet (errored answers still retry once `maxAgeMs` elapses).
31
+ `planLimitsDue({ limits: noPlanLimit, now, maxAgeMs }) // was true past maxAgeMs` → `planLimitsDue({ limits: noPlanLimit, now, maxAgeMs }) // false unless limits.error is set`.
32
+ **Affects:** `stitchkit/agent-executor` planLimitsDue
33
+
34
+ ### Added
35
+
36
+ - `stitchkit/agent-executor/codex` — added threadless `CodexControlClient.startThreadTurn(CodexControlStartTurnParams, CodexRpcCallOptions?)` (`turn/start` without occupying a local session turn slot), per-call `CodexRpcCallOptions` (`{ timeoutMs?, signal? }`) across every `CodexControlClient` and `CodexSession` RPC method, loose Zod schemas and open-variant types for Codex responses and protocol objects (`CodexProtocolError`, `CodexThreadSchema`, `CodexThreadStatusSchema`, `CodexSandboxPolicySchema`, `CodexTurnStatusSchema`, `CodexTurnItemsViewSchema`, `CODEX_THREAD_SOURCE_KINDS`, `CODEX_TOOL_ITEMS`), discriminated `parseCodexNotification` / `CodexNotificationParams` covering all 14 documented server notifications (including 5 quiet lifecycle events), bounded cursor pagination (`iterateCodexPages`, `findCodexTurnByClientId`), and `codexPlanLimits` (supporting camelCase and snake_case rollout `token_count` envelopes, epoch seconds/milliseconds/ISO `resetsAt`, and `plan_type`).
37
+ - `stitchkit/agent-executor/claude`, `stitchkit/agent-executor/claude-sdk` — exported standalone `findTranscriptInput`, `claudeTranscriptHasUuid`, and open-bucket `claudeUsagePlanLimits` (handling both SDK `rate_limits` envelopes and flat `/api/oauth/usage` payloads while preserving `plan`) from both leaves; re-exported 14 `@anthropic-ai/claude-agent-sdk` types and `ClaudeSdkFlagSettings` from `stitchkit/agent-executor/claude-sdk`.
38
+ - `stitchkit/agent-executor/acp` — added `AcpSession.providerPid` (cleared on exit/close), open-only `AcpDriverConfig.onProviderPid`, non-inference `AcpDriver.probeCapabilities(AcpProbeCapabilitiesInput)` (`AcpCapabilitiesProbe`, active regardless of `probeMode`, capturing `available_commands_update` / `config_option_update`), opt-in `AcpDriverConfig.permissionRequestDelivery` (`'external-only' | 'all'`) with `duringActiveTurn` on `AcpPermissionRequestEvent`, `acpOptionChoices` (`AcpConfigOptionChoice`) / `acpOptionValues`, and public ACP v1 Zod schemas (`AcpInitializeResultSchema`, `AcpConfigOptionSchema`, `AcpSessionUpdateSchema`, `AcpPermissionOptionSchema`, `AcpPermissionRequestSchema`).
39
+ - `stitchkit/agent-executor` — added per-call `signal?: AbortSignal` on `JsonRpcPeer.request` (aborting only that request without closing the peer), exported `JsonRpcValueSchema` / `JsonRpcRecordSchema`, `EXECUTOR_ENV_KEY_PATTERN` / `sanitizeProfileEnv`, `planWindowDurationMins`, optional `PlanLimits.plan` (preserved across `mergeRateLimitEvent`) and `PlanWindow.scope`, and `exactOptionalPropertyTypes: true` compatibility across option-bag interfaces.
40
+ - `stitchkit/agent-executor/testing` — added portable Unix-socket WebSocket JSON-RPC `createFakeCodexAppServer`, scripted multi-turn `createFakeClaudeSdkQuery`, 8 fail-loud typed consumer stub factories (`createStubCodexControlClient`, `createStubCodexControlConnection`, `createStubCodexSession`, `createStubCodexSharedServer`, `createStubCodexTurn`, `createStubAgentEngineTurn`, `createStubClaudeSdkSession`, `createStubAcpSession` with `StubOverrides<T>`), and schema-validated fixtures (`makeExecutorDelta`, `makeCodexNotificationEvent`, `makeCodexThreadFixture`).
41
+
42
+ ### Fixed
43
+
44
+ - `stitchkit/agent-executor/codex` `createCodexDriver` (`unix-connect` and `unix-listen` transports) now iteratively follows Unix socket symlink chains and calls `realpathSync` only on parent directories rather than socket inodes, preventing macOS APFS `EOPNOTSUPP` failures while still enforcing private directory permissions, hop ceilings, and non-socket/trailing-slash refusals.
45
+ **Affects:** `stitchkit/agent-executor/codex` createCodexDriver(open, connectControl, status, findInput)
46
+ - `stitchkit/agent-executor/claude-sdk` `ClaudeSdkRun` void mutator return types now accept `Promise<unknown>` so native `query` from `@anthropic-ai/claude-agent-sdk >= 0.3.332` assigns directly to `ClaudeSdkQuery` without casts, including under `exactOptionalPropertyTypes: true`.
47
+ **Affects:** `stitchkit/agent-executor/claude-sdk` ClaudeSdkQuery, ClaudeSdkRun, createClaudeSdkDriver
48
+ - `stitchkit/agent-executor/codex` `CodexListedTurnSchema` now models `itemsView` (`'notLoaded' | 'summary' | 'full'` plus open string fallback) and optional timing fields (`startedAt`, `completedAt`, `durationMs`, `rootTurnId`), and `findCodexTurnByClientId` / `findInput` fail closed on non-`'full'` turns.
49
+ **Affects:** `stitchkit/agent-executor/codex` CodexListedTurnSchema, findCodexTurnByClientId, createCodexDriver(findInput)
50
+ - `stitchkit/agent-executor/acp` ephemeral probes attempt all advertised cleanup operations for the session they created. Capability probes report cleanup failures with their operation and preserve a malformed session reply as the primary cause.
51
+ **Affects:** `stitchkit/agent-executor/acp` createAcpDriver(info, status, probeCapabilities)
52
+
53
+ - `stitchkit/agent-executor/codex` routes notifications and requests by native thread and turn, including events received before the start reply. A fork or previous turn can complete without ending the current iterator. Full quota reads replace the cached snapshot, and unrecognized login status returns `unknown`.
54
+ **Affects:** `stitchkit/agent-executor/codex` createCodexDriver(open, openSharedServer, status)
55
+ - `stitchkit/agent-executor/testing` verifies each required replay reply in its scripted turn. Aborting a fake Claude SDK run releases its input iterator and preserves unused scripted turns.
56
+ **Affects:** `stitchkit/agent-executor/testing` createReplayExecutorDriver, createFakeClaudeSdkQuery
57
+ - `stitchkit/agent-executor` skips omitted-ID width measurements at a zero ID limit and measures each candidate once for a positive limit when building a context handoff.
58
+ **Affects:** `stitchkit/agent-executor` buildContextHandoff
59
+
18
60
  ## [0.130.1] - 2026-11-26
19
61
 
20
62
  ### Added
@@ -11,10 +11,10 @@ export type AcpSteerMode = 'none' | 'prompt';
11
11
  export type AcpSessionMetaInput = Readonly<Record<string, JsonRpcValue>> | ((initialized: AcpInitializeResult) => Readonly<Record<string, JsonRpcValue>> | undefined);
12
12
  /** Structured failure override returned by {@link AcpWatchPromptOutcome} to reclassify a prompt response. */
13
13
  export interface AcpPromptOutcomeOverride {
14
- readonly outcome?: 'failed';
14
+ readonly outcome?: 'failed' | undefined;
15
15
  readonly errorKind: ExecutorErrorKind;
16
16
  readonly message: string;
17
- readonly threadDisposition?: ExecutorThreadDisposition;
17
+ readonly threadDisposition?: ExecutorThreadDisposition | undefined;
18
18
  }
19
19
  /**
20
20
  * Optional hook run before each `session/prompt` request; returns a checker invoked once the
@@ -30,69 +30,81 @@ export interface AcpDriverConfig {
30
30
  /** The agent to run: `agy`, `gemini`. */
31
31
  executable: string;
32
32
  /** Its arguments: `['acp']`, `['acp', '--sandbox']`, `['--experimental-acp']`. */
33
- args?: readonly string[];
33
+ args?: readonly string[] | undefined;
34
34
  /** Optional `clientInfo` sent on `initialize`. */
35
- clientInfo?: AcpClientInfo;
35
+ clientInfo?: AcpClientInfo | undefined;
36
36
  /** Optional `_meta` object (or factory over the `initialize` response) sent on session open/resume/load. */
37
- sessionMeta?: AcpSessionMetaInput;
37
+ sessionMeta?: AcpSessionMetaInput | undefined;
38
38
  /**
39
39
  * Optional filter invoked on every stdout line before JSON-RPC parsing; returning `false`
40
40
  * skips non-protocol lines (such as OAuth prompts) instead of failing the connection.
41
41
  */
42
- stdoutLineFilter?: (line: string) => boolean;
42
+ stdoutLineFilter?: ((line: string) => boolean) | undefined;
43
43
  /**
44
44
  * How `info()` and `status()` probe the agent: `'ephemeral-session'` (default, runs `initialize`
45
45
  * and an ephemeral `session/new`), `'initialize-only'` (skips `session/new`), or `'passive'`
46
46
  * (spawns zero processes and reports honest `unknown`/`not-asked`).
47
47
  */
48
- probeMode?: AcpProbeMode;
48
+ probeMode?: AcpProbeMode | undefined;
49
49
  /** Version reported by `info()` when `probeMode` is `'passive'` (defaults to `'unknown'`). */
50
- passiveVersion?: string;
50
+ passiveVersion?: string | undefined;
51
51
  /** Set at open through the option of category `model`; refused if the agent offers none or not this value. */
52
- model?: string;
52
+ model?: string | undefined;
53
53
  /** Set at open through the option of category `thought_level`, after the model, which may narrow it. */
54
- thoughtLevel?: string;
54
+ thoughtLevel?: string | undefined;
55
55
  /**
56
56
  * Set at open through the option of category `mode`. Negotiates the agent's advertised mode
57
57
  * value only; it does not enforce host-side pre-execution tool approval (`approvalEnforcement`
58
58
  * is `'agent-initiated'`). Whether an agent sends `session/request_permission` before a tool
59
59
  * runs depends on the agent's own permission policy.
60
60
  */
61
- mode?: string;
61
+ mode?: string | undefined;
62
62
  /** MCP servers the agent connects to, passed on `session/new`, `session/load` and `session/resume`. */
63
- mcpServers?: readonly AcpMcpServer[];
63
+ mcpServers?: readonly AcpMcpServer[] | undefined;
64
64
  /** Optional transformer normalizing, expanding, or dropping incoming `session/update` records before mapping. */
65
- transformUpdate?: AcpTransformUpdate;
65
+ transformUpdate?: AcpTransformUpdate | undefined;
66
66
  /** Optional observer invoked for `session/update` notifications on an open session (including post-settle). */
67
- onUpdate?: (event: AcpUpdateEvent) => void;
67
+ onUpdate?: ((event: AcpUpdateEvent) => void) | undefined;
68
68
  /**
69
- * Optional handler for `session/request_permission` arriving outside an active `startTurn()`.
69
+ * Optional handler for `session/request_permission`. By default invoked only outside an active
70
+ * `startTurn()` (post-settle background work); set `permissionRequestDelivery: 'all'` to also
71
+ * receive typed permission requests with full `request.options` during an active `startTurn()`.
70
72
  * When omitted, requests outside an active turn are refused with `-32601`.
71
73
  */
72
- onPermissionRequest?: (event: AcpPermissionRequestEvent) => Promise<void> | void;
74
+ onPermissionRequest?: ((event: AcpPermissionRequestEvent) => Promise<void> | void) | undefined;
75
+ /**
76
+ * Controls which `session/request_permission` calls reach `onPermissionRequest`:
77
+ * `'external-only'` (default, only requests outside `startTurn()`) or `'all'` (also notifies
78
+ * `onPermissionRequest` during active `startTurn()` with `duringActiveTurn: true`, backed by the
79
+ * same single-shot `turn.pending` slot). Setting `'all'` requires `onPermissionRequest`.
80
+ */
81
+ permissionRequestDelivery?: 'external-only' | 'all' | undefined;
82
+ /** Optional callback invoked with the spawned ACP child PID during `open()`. */
83
+ onProviderPid?: ((pid: number) => void) | undefined;
73
84
  /** Optional callback invoked when an opened session drops unexpectedly before `close()` or caller abort. */
74
- onDisconnect?: (error: Error) => void;
85
+ onDisconnect?: ((error: Error) => void) | undefined;
75
86
  /**
76
87
  * Optional hook started before `session/prompt` and consulted after it settles so hidden API
77
88
  * errors masked as `end_turn` can fail the turn with an error kind and `threadDisposition`.
78
89
  */
79
- watchPromptOutcome?: AcpWatchPromptOutcome;
90
+ watchPromptOutcome?: AcpWatchPromptOutcome | undefined;
80
91
  /**
81
92
  * Whether the agent's `usage.inputTokens` already includes `cachedReadTokens`. Default `true`.
82
93
  * Set `false` for agents that report uncached input separately so `cachedReadTokens` is added.
83
94
  */
84
- usageInputIncludesCachedRead?: boolean;
95
+ usageInputIncludesCachedRead?: boolean | undefined;
85
96
  /** Whether `session.steerTurn()` is disabled (`'none'`, default) or steers via a new `session/prompt` (`'prompt'`). */
86
- steerMode?: AcpSteerMode;
97
+ steerMode?: AcpSteerMode | undefined;
87
98
  /** The bytes behind a `file` part's `reference`; without it a file part is refused. */
88
- resolveFile?: (reference: string) => Promise<Uint8Array>;
99
+ resolveFile?: ((reference: string) => Promise<Uint8Array>) | undefined;
89
100
  /** The largest image sent. Default 5 MiB. */
90
- maxImageBytes?: number;
101
+ maxImageBytes?: number | undefined;
91
102
  /** The longest line the agent may write — a replayed image is one line. Default 8 MiB. */
92
- maxFrameBytes?: number;
93
- ambient?: Readonly<Record<string, string | undefined>>;
103
+ maxFrameBytes?: number | undefined;
104
+ /** Environment variables inherited by the spawned ACP agent process. */
105
+ ambient?: Readonly<Record<string, string | undefined>> | undefined;
94
106
  /** How long one request (`initialize`, `session/new`) may take. Default 60 s. */
95
- requestTimeoutMs?: number;
107
+ requestTimeoutMs?: number | undefined;
96
108
  }
97
109
  /** Bounded timeout for `session/close` and `session/delete`: capped at 5 s and never longer than `requestTimeoutMs`. */
98
110
  export declare function closeRequestTimeoutMs(config: Pick<AcpDriverConfig, 'requestTimeoutMs'>): number;
@@ -105,13 +117,15 @@ export type AcpHandlers = {
105
117
  onNotification?: Parameters<typeof createJsonRpcPeer>[0]['onNotification'];
106
118
  onEnd?: (error: Error) => void;
107
119
  onStartupPhase?: (phase: ExecutorStartupPhase) => void;
120
+ onProviderPid?: (pid: number) => void;
108
121
  };
109
122
  /** Spawn the agent and perform the ACP v1 handshake; ACP v2 (`"info" in raw`) or version < 1 is refused. */
110
123
  export declare function connectAcp(config: AcpDriverConfig, profile: ExecutorProfileConfig, cwd: string, signal: AbortSignal, handlers?: AcpHandlers): Promise<{
111
124
  engine: import("../engine-process.js").EngineProcess;
112
125
  peer: {
113
126
  request(method: string, params?: JsonRpcValue, options?: {
114
- readonly timeoutMs?: number | null;
127
+ readonly timeoutMs?: number | null | undefined;
128
+ readonly signal?: AbortSignal | undefined;
115
129
  }): Promise<JsonRpcValue>;
116
130
  notify(method: string, params?: JsonRpcValue): void;
117
131
  receive(line: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"v1-connect.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-connect.ts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EF,4GAA4G;AAC5G,wBAAsB,UAAU,CAC9B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,qBAAqB,EAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,WAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8F3B;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAEnE,qHAAqH;AACrH,wBAAgB,MAAM,CACpB,UAAU,EAAE,aAAa,EACzB,UAAU,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAC1D,OAAO,CAGT"}
@@ -2,17 +2,18 @@ import type { AgentEngineDriver } from '../engine.js';
2
2
  import type { ExecutorDriverCapabilities } from '../hello.js';
3
3
  import { type ExecutorProfileConfig } from '../profile.js';
4
4
  import { type AcpDriverConfig } from './v1-connect.js';
5
+ import { type AcpCapabilitiesProbe, type AcpProbeCapabilitiesInput } from './v1-probe.js';
5
6
  import { type AcpApprovalEnforcement, type AcpOpenInput, type AcpSession } from './v1-session.js';
6
7
  export type { AcpDriverConfig } from './v1-connect.js';
7
8
  export type { AcpApprovalEnforcement, AcpSession } from './v1-session.js';
8
9
  /** A session the agent keeps, as `session/list` answers. */
9
10
  export interface AcpSessionSummary {
10
11
  sessionId: string;
11
- cwd?: string;
12
- title?: string;
13
- updatedAt?: string;
12
+ cwd?: string | undefined;
13
+ title?: string | undefined;
14
+ updatedAt?: string | undefined;
14
15
  }
15
- /** An {@link AgentEngineDriver} speaking ACP v1, adding session listing and session config options. */
16
+ /** An {@link AgentEngineDriver} speaking ACP v1, adding capability probing, session listing, and session config options. */
16
17
  export interface AcpDriver extends AgentEngineDriver {
17
18
  readonly capabilities: ExecutorDriverCapabilities;
18
19
  /**
@@ -27,6 +28,11 @@ export interface AcpDriver extends AgentEngineDriver {
27
28
  profile: ExecutorProfileConfig;
28
29
  cwd: string;
29
30
  }): Promise<AcpSessionSummary[]>;
31
+ /**
32
+ * Run a non-inference capability probe (`initialize`, ephemeral `session/new`, `configOptions`,
33
+ * `commands`, `models`) with guaranteed `session/close` + `session/delete` cleanup.
34
+ */
35
+ probeCapabilities(input: AcpProbeCapabilitiesInput): Promise<AcpCapabilitiesProbe>;
30
36
  }
31
37
  /**
32
38
  * An agent speaking the Agent Client Protocol v1 over stdio. A session per
@@ -1 +1 @@
1
- {"version":3,"file":"v1-driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAsB,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,KAAK,qBAAqB,EAAiB,MAAM,YAAY,CAAC;AAEvE,OAAO,EAEL,KAAK,eAAe,EAKrB,MAAM,cAAc,CAAC;AAOtB,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvE,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uGAAuG;AACvG,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,sBAAsB,CAAC;IACrD,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,UAA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B,EAAE,sBAAsB,CAAC;IACrD,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE;QACd,OAAO,EAAE,qBAAqB,CAAC;QAC/B,GAAG,EAAE,MAAM,CAAC;KACb,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACjC;;;OAGG;IACH,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpF;AAeD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CA0HlE"}
@@ -17,7 +17,7 @@ export interface AcpUpdateEvent {
17
17
  /** Normalized executor deltas produced for this update. */
18
18
  readonly deltas: readonly ExecutorDelta[];
19
19
  }
20
- /** `session/request_permission` received outside an active `startTurn()` (post-settle background work). */
20
+ /** `session/request_permission` received from ACP (outside `startTurn()`, or also during `startTurn()` when `permissionRequestDelivery` is `'all'`). */
21
21
  export interface AcpPermissionRequestEvent {
22
22
  /** JSON-RPC request identifier as a string, also carried on `delta.interactionId`. */
23
23
  readonly interactionId: string;
@@ -25,11 +25,13 @@ export interface AcpPermissionRequestEvent {
25
25
  readonly sessionId: string;
26
26
  /** Parsed ACP permission request payload including `toolCall` and full `options`. */
27
27
  readonly request: AcpPermissionRequest;
28
+ /** `true` when a driver-initiated `startTurn()` owned the session as this request arrived. */
29
+ readonly duringActiveTurn: boolean;
28
30
  /** Normalized executor `request` delta preserving tool input and option metadata. */
29
31
  readonly delta: Extract<ExecutorDelta, {
30
32
  type: 'request';
31
33
  }>;
32
- /** Answer this post-settle permission request once; throws `TypeError` if invalid or already resolved. */
34
+ /** Answer this permission request once; throws `TypeError` if invalid or already resolved. */
33
35
  respond(reply: InteractionReply['reply']): Promise<void>;
34
36
  }
35
37
  interface AcpHandlersState {
@@ -44,8 +46,10 @@ interface AcpHandlersState {
44
46
  transformUpdate?: AcpTransformUpdate;
45
47
  onUpdate?: (event: AcpUpdateEvent) => void;
46
48
  onPermissionRequest?: (event: AcpPermissionRequestEvent) => Promise<void> | void;
49
+ permissionRequestDelivery?: 'external-only' | 'all';
47
50
  onEnd: (error: Error) => void;
48
51
  }
52
+ export declare function normalizeTransformedUpdates(raw: AcpSessionUpdate, transform: AcpTransformUpdate | undefined): readonly AcpSessionUpdate[];
49
53
  /** Create JSON-RPC notification, permission-request, and disconnect handlers for an ACP session. */
50
54
  export declare function createAcpHandlers(state: AcpHandlersState): {
51
55
  onNotification: (method: string, params: JsonRpcValue | undefined) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"v1-handlers.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EAGtB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,sGAAsG;AACtG,MAAM,MAAM,kBAAkB,GAAG,CAC/B,MAAM,EAAE,gBAAgB,KACrB,gBAAgB,GAAG,SAAS,gBAAgB,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvE,qGAAqG;AACrG,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,6FAA6F;IAC7F,QAAQ,CAAC,gBAAgB,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AAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB;IAMrD,cAAc,WAAW,MAAM,UAAU,YAAY,GAAG,SAAS;IAEjE,SAAS,WAAW,MAAM,UAAU,YAAY,GAAG,SAAS,MAAM,MAAM,GAAG,MAAM;IAEjF,KAAK,UAxPQ,KAAK,KAAK,IAAI;EA0P9B"}
@@ -0,0 +1,38 @@
1
+ import { type ExecutorProfileConfig } from '../profile.js';
2
+ import type { ExecutorStartupPhase } from '../vocabulary.js';
3
+ import { type AcpConnection, type AcpDriverConfig } from './v1-connect.js';
4
+ import { type AcpConfigOption, type AcpInitializeResult } from './v1-protocol.js';
5
+ /** Input for {@link AcpDriver.probeCapabilities}. */
6
+ export interface AcpProbeCapabilitiesInput {
7
+ /** Profile whose environment and `HOME` will be used for the probe process. */
8
+ readonly profile: ExecutorProfileConfig;
9
+ /** Working directory passed to `session/new`. */
10
+ readonly cwd: string;
11
+ /** Optional cancellation signal aborting the probe and stopping its process. */
12
+ readonly signal?: AbortSignal | undefined;
13
+ /** Maximum milliseconds to wait for initialization, `session/new`, and cleanup. Default 30 000 ms. */
14
+ readonly timeoutMs?: number | undefined;
15
+ /** Optional observer invoked with startup phases (`spawning`, `initializing`) during the probe. */
16
+ readonly onStartupPhase?: ((phase: ExecutorStartupPhase) => void) | undefined;
17
+ }
18
+ /** Result of a structured non-inference {@link AcpDriver.probeCapabilities} call. */
19
+ export interface AcpCapabilitiesProbe {
20
+ /** Parsed `initialize` result returned by the agent. */
21
+ readonly initialized: AcpInitializeResult;
22
+ /** Latest session configuration options reported by `session/new` or `config_option_update`. */
23
+ readonly configOptions: readonly AcpConfigOption[];
24
+ /** Slash command names advertised via `available_commands_update` during session startup. */
25
+ readonly commands: readonly string[];
26
+ /** Model identifiers discovered from the `model` config option or `session.models.availableModels`. */
27
+ readonly models: readonly string[];
28
+ }
29
+ /** The values of the session's model option, or its model list; none when the agent offers neither. */
30
+ export declare function probeAcpModels(config: AcpDriverConfig, connection: AcpConnection, cwd: string): Promise<string[]>;
31
+ /**
32
+ * Run a bounded, non-inference capability probe (`initialize` + ephemeral `session/new` +
33
+ * `session/close` + `session/delete`), capturing asynchronous `available_commands_update` and
34
+ * `config_option_update` notifications and always cleaning up the session and process in `finally`.
35
+ * Runs actively regardless of `config.probeMode`.
36
+ */
37
+ export declare function probeAcpCapabilities(config: AcpDriverConfig, input: AcpProbeCapabilitiesInput): Promise<AcpCapabilitiesProbe>;
38
+ //# sourceMappingURL=v1-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v1-probe.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-probe.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,qBAAqB,EAAiB,MAAM,YAAY,CAAC;AAEvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EAMrB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAKzB,MAAM,eAAe,CAAC;AAIvB,qDAAqD;AACrD,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,iDAAiD;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,sGAAsG;IACtG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,mGAAmG;IACnG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC/E;AAED,qFAAqF;AACrF,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,gGAAgG;IAChG,QAAQ,CAAC,aAAa,EAAE,SAAS,eAAe,EAAE,CAAC;IACnD,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,uGAAuG;IACvG,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAyED,uGAAuG;AACvG,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,aAAa,EACzB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB;AA8BD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAwD/B"}
@@ -28,6 +28,7 @@ export declare const AcpClientInfoSchema: z.ZodObject<{
28
28
  }, z.core.$strict>;
29
29
  /** ACP client implementation metadata inferred from `AcpClientInfoSchema`. */
30
30
  export type AcpClientInfo = z.infer<typeof AcpClientInfoSchema>;
31
+ /** Loose Zod schema for ACP v1 `initialize` response. */
31
32
  export declare const AcpInitializeResultSchema: z.ZodObject<{
32
33
  protocolVersion: z.ZodInt;
33
34
  agentCapabilities: z.ZodOptional<z.ZodObject<{
@@ -74,6 +75,17 @@ export declare const AcpConfigOptionSchema: z.ZodObject<{
74
75
  }, z.core.$loose>;
75
76
  /** ACP session configuration option inferred from `AcpConfigOptionSchema`. */
76
77
  export type AcpConfigOption = z.infer<typeof AcpConfigOptionSchema>;
78
+ /** Flattened choice extracted from a flat or grouped {@link AcpConfigOption}. */
79
+ export interface AcpConfigOptionChoice {
80
+ /** Selectable option value passed to `session/set_config_option`. */
81
+ readonly value: string;
82
+ /** Human-readable display label when advertised by the agent. */
83
+ readonly name?: string | undefined;
84
+ /** Parent group label when the choice came from a grouped option list. */
85
+ readonly group?: string | undefined;
86
+ }
87
+ /** Flatten a flat or grouped {@link AcpConfigOption} into selectable choices preserving `name` and `group`. */
88
+ export declare function acpOptionChoices(option: AcpConfigOption): AcpConfigOptionChoice[];
77
89
  /** Every value an option accepts, its groups flattened. */
78
90
  export declare function acpOptionValues(option: AcpConfigOption): string[];
79
91
  /** What `session/new`, `session/load` and `session/resume` answer about the session. */
@@ -191,6 +203,7 @@ export declare const AcpMcpServerSchema: z.ZodUnion<readonly [z.ZodObject<{
191
203
  }, z.core.$strict>]>;
192
204
  /** ACP v1 MCP server connection descriptor inferred from `AcpMcpServerSchema`. */
193
205
  export type AcpMcpServer = z.infer<typeof AcpMcpServerSchema>;
206
+ /** Loose Zod schema for one ACP v1 `session/update` payload. */
194
207
  export declare const AcpSessionUpdateSchema: z.ZodObject<{
195
208
  sessionUpdate: z.ZodString;
196
209
  content: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -293,6 +306,7 @@ export declare const AcpPromptResultSchema: z.ZodObject<{
293
306
  }, z.core.$loose>;
294
307
  /** ACP v1 `session/prompt` response inferred from `AcpPromptResultSchema`. */
295
308
  export type AcpPromptResult = z.infer<typeof AcpPromptResultSchema>;
309
+ /** Loose Zod schema for one selectable permission option on ACP `session/request_permission`. */
296
310
  export declare const AcpPermissionOptionSchema: z.ZodObject<{
297
311
  optionId: z.ZodString;
298
312
  kind: z.ZodString;
@@ -301,6 +315,7 @@ export declare const AcpPermissionOptionSchema: z.ZodObject<{
301
315
  }, z.core.$loose>;
302
316
  /** One selectable option on `session/request_permission`, inferred from `AcpPermissionOptionSchema`. */
303
317
  export type AcpPermissionOption = z.infer<typeof AcpPermissionOptionSchema>;
318
+ /** Loose Zod schema for ACP v1 `session/request_permission` request params. */
304
319
  export declare const AcpPermissionRequestSchema: z.ZodObject<{
305
320
  sessionId: z.ZodString;
306
321
  toolCall: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"v1-protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,K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AAyB,CAAC,CAAC;AAE5E,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;iBAWrC,CAAC;AACH,8FAA8F;AAC9F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -16,23 +16,25 @@ export interface AcpOpenInput {
16
16
  readonly profile: ExecutorProfileConfig;
17
17
  readonly cwd: string;
18
18
  /** Resume or load this native session; a fresh one is started without it. */
19
- readonly nativeThreadId?: string;
19
+ readonly nativeThreadId?: string | undefined;
20
20
  /** Per-session model override (overrides {@link AcpDriverConfig.model}). */
21
- readonly model?: string;
21
+ readonly model?: string | undefined;
22
22
  /** Per-session thought level override (overrides {@link AcpDriverConfig.thoughtLevel}). */
23
- readonly thoughtLevel?: string;
23
+ readonly thoughtLevel?: string | undefined;
24
24
  /** Per-session mode override (overrides {@link AcpDriverConfig.mode}). */
25
- readonly mode?: string;
25
+ readonly mode?: string | undefined;
26
26
  /** Optional observer invoked with startup phases (`spawning`, `initializing`) during open. */
27
- readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
28
- readonly signal?: AbortSignal;
27
+ readonly onStartupPhase?: ((phase: ExecutorStartupPhase) => void) | undefined;
28
+ readonly signal?: AbortSignal | undefined;
29
29
  }
30
30
  /** Input to {@link AcpSession.steerTurn} when `steerMode` is `'prompt'`. */
31
31
  export interface AcpSteerTurnInput {
32
32
  readonly input: readonly AgentMessagePart[];
33
33
  }
34
- /** A session with what ACP says about it besides turns: its settings, title, commands, steering, and post-settle replies. */
34
+ /** A session with what ACP says about it besides turns: its PID, settings, title, commands, steering, and post-settle replies. */
35
35
  export interface AcpSession extends AgentEngineSession {
36
+ /** OS process id of the active spawned ACP child, or `undefined` once the session has exited or closed. */
37
+ readonly providerPid: number | undefined;
36
38
  /** Always `'agent-initiated'`: whether a tool pauses for host approval is decided by the agent. */
37
39
  readonly approvalEnforcement: AcpApprovalEnforcement;
38
40
  /** The agent's settings as last reported: on open, on a change, and on `config_option_update`. */
@@ -1 +1 @@
1
- {"version":3,"file":"v1-session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,KAAK,eAAe,EAMrB,MAAM,cAAc,CAAC;AAOtB,OAAO,EACL,KAAK,eAAe,EAMrB,MAAM,eAAe,CAAC;AAGvB;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAEvD,4GAA4G;AAC5G,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,8FAA8F;IAC9F,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAA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,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,wFAAwF;IACxF,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAAC;IACtF,oHAAoH;IACpH,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3E;AAwID,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,UAAU,CAAC,CAiLrB"}
@@ -3,23 +3,23 @@ import type { ExecutorDriverCapabilities } from '../hello.js';
3
3
  /** Configuration for {@link createClaudeCliDriver}. */
4
4
  export interface ClaudeCliDriverConfig {
5
5
  /** The CLI to run. Default `claude`, found on the engine's `PATH`. */
6
- executable?: string;
6
+ executable?: string | undefined;
7
7
  /** Arguments before the driver's own — a runtime running a script, as a fake engine is run. */
8
- prefixArgs?: readonly string[];
8
+ prefixArgs?: readonly string[] | undefined;
9
9
  /** Passed as `--model` when set. */
10
- model?: string;
10
+ model?: string | undefined;
11
11
  /**
12
12
  * Passed as `--permission-mode`. Default `default`: every tool the profile
13
13
  * does not already allow is asked of the host, so the server decides. A
14
14
  * profile's own setting (`auto`, `acceptEdits`) is not inherited by accident.
15
15
  */
16
- permissionMode?: 'default' | 'acceptEdits' | 'plan' | 'bypassPermissions' | 'auto';
16
+ permissionMode?: 'default' | 'acceptEdits' | 'plan' | 'bypassPermissions' | 'auto' | undefined;
17
17
  /** Read the bytes behind a `file` part's `reference`; without it a file part is refused. */
18
- resolveFile?: (reference: string) => Promise<Uint8Array>;
18
+ resolveFile?: ((reference: string) => Promise<Uint8Array>) | undefined;
19
19
  /** Maximum decoded size of one image attachment in bytes. Default 5 MiB. */
20
- maxImageBytes?: number;
20
+ maxImageBytes?: number | undefined;
21
21
  /** The executor's own environment, read for the allowlist. Default `process.env`. */
22
- ambient?: Readonly<Record<string, string | undefined>>;
22
+ ambient?: Readonly<Record<string, string | undefined>> | undefined;
23
23
  }
24
24
  /**
25
25
  * Claude Code, unmodified, driven through `--print` with `stream-json` on
@@ -1 +1 @@
1
- {"version":3,"file":"cli-driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/cli-driver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAc,MAAM,UAAU,CAAC;AAoCvE,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,mBAAmB,GAAG,MAAM,CAAC;IACnF,4FAA4F;IAC5F,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACzD,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,qBAA0B,GACjC,iBAAiB,GAAG;IAAE,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAA;CAAE,CA4G3E"}
1
+ {"version":3,"file":"cli-driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/cli-driver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAc,MAAM,UAAU,CAAC;AAoCvE,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC3C,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EACX,SAAS,GACT,aAAa,GACb,MAAM,GACN,mBAAmB,GACnB,MAAM,GACN,SAAS,CAAC;IACd,4FAA4F;IAC5F,WAAW,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,SAAS,CAAC;IACvE,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,qFAAqF;IACrF,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;CACpE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,qBAA0B,GACjC,iBAAiB,GAAG;IAAE,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAA;CAAE,CA4G3E"}
@@ -1,10 +1,12 @@
1
1
  import { type PlanLimits, type PlanWindow } from '../hello.js';
2
2
  /**
3
- * Normalize an active Claude SDK `get_usage` response (`SDKControlGetUsageResponse`) into
4
- * {@link PlanLimits}. Unlike passive `rate_limit_event` (0–1 fraction + epoch seconds),
5
- * `get_usage` reports utilization in percent (0–100, nullable) and ISO-8601 `resets_at`.
3
+ * Normalize an active Claude SDK `get_usage` response (`SDKControlGetUsageResponse`) or flat
4
+ * `/api/oauth/usage` payload into {@link PlanLimits}, preserving `plan` (`subscription_type`) and
5
+ * reading any window-shaped quota buckets while skipping non-window fields (`extra_usage`,
6
+ * `limits`, `spend`). Unlike passive `rate_limit_event` (0–1 fraction + epoch seconds), usage
7
+ * payloads report utilization in percent (0–100, nullable) and ISO-8601 `resets_at`.
6
8
  */
7
- export declare function claudeUsagePlanLimits(raw: unknown, now: Date): PlanLimits;
9
+ export declare function claudeUsagePlanLimits(raw: unknown, now?: Date): PlanLimits;
8
10
  /**
9
11
  * Claude's `rate_limit_event` as windows: `unifiedWindows` when present
10
12
  * (`five_hour`, `seven_day`), else the one window it names. Utilization is a
@@ -1 +1 @@
1
- {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/limits.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAC;AAkDlB;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,GAAG,UAAU,CAuEzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,EAAE,CAwB7D"}
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/limits.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAC;AAiIlB;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,GAAE,IAAiB,GAAG,UAAU,CAmCtF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,EAAE,CAwB7D"}
@@ -18,8 +18,8 @@ export declare function openClaudeSession(config: DriverImageOptions & {
18
18
  }, input: {
19
19
  profile: ExecutorProfileConfig;
20
20
  cwd: string;
21
- nativeThreadId?: string;
22
- onStartupPhase?: (phase: ExecutorStartupPhase) => void;
23
- signal?: AbortSignal;
21
+ nativeThreadId?: string | undefined;
22
+ onStartupPhase?: ((phase: ExecutorStartupPhase) => void) | undefined;
23
+ signal?: AbortSignal | undefined;
24
24
  }): Promise<AgentEngineSession>;
25
25
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,WAAW,CAAC;AAUrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,qBAAqB,EAAoC,MAAM,YAAY,CAAC;AAQ1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAwD1D;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,kBAAkB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACjC,EACD,KAAK,EAAE;IACL,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,kBAAkB,CAAC,CAgL7B"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,WAAW,CAAC;AAUrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,qBAAqB,EAAoC,MAAM,YAAY,CAAC;AAQ1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAwD1D;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,kBAAkB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACjC,EACD,KAAK,EAAE;IACL,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACrE,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC,GACA,OAAO,CAAC,kBAAkB,CAAC,CAgL7B"}
@@ -1,6 +1,7 @@
1
1
  import type { Options, Query } from '@anthropic-ai/claude-agent-sdk';
2
2
  import { type PlanLimits } from '../hello.js';
3
3
  import type { ClaudeSdkRun, ClaudeSdkSession, ClaudeSdkUsageRead } from './driver.js';
4
+ /** Shallow-merged flag settings payload accepted by {@link ClaudeSdkSession.applyFlagSettings}. */
4
5
  export type ClaudeSdkFlagSettings = Parameters<Query['applyFlagSettings']>[0];
5
6
  type LiveMethods = Omit<ClaudeSdkSession, 'nativeThreadId' | 'providerPid' | 'startTurn' | 'close'>;
6
7
  /** Session state needed by live-control operations on an active Claude SDK query. */
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude-sdk/controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,KAAK,WAAW,GAAG,IAAI,CACrB,gBAAgB,EAChB,gBAAgB,GAAG,aAAa,GAAG,WAAW,GAAG,OAAO,CACzD,CAAC;AAEF,qFAAqF;AACrF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,IAAI,OAAO,CAAC;IACpB,WAAW,IAAI,OAAO,CAAC;QAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;IACzD,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAChD,uBAAuB,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC;IAC5E,kBAAkB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAA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