stitchkit 0.129.0 → 0.130.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 (156) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/agent-executor/acp/v1-connect.d.ts +87 -19
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +4 -2
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-handlers.d.ts +56 -0
  7. package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -0
  8. package/dist/agent-executor/acp/v1-map.d.ts +13 -2
  9. package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
  10. package/dist/agent-executor/acp/v1-permission.d.ts +44 -0
  11. package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -0
  12. package/dist/agent-executor/acp/v1-protocol.d.ts +63 -10
  13. package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
  14. package/dist/agent-executor/acp/v1-session.d.ts +34 -7
  15. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  16. package/dist/agent-executor/acp/v1-turn.d.ts +51 -13
  17. package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
  18. package/dist/agent-executor/claude/classify.d.ts +10 -0
  19. package/dist/agent-executor/claude/classify.d.ts.map +1 -1
  20. package/dist/agent-executor/claude/cli-driver.d.ts +4 -1
  21. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  22. package/dist/agent-executor/claude/events.d.ts +146 -0
  23. package/dist/agent-executor/claude/events.d.ts.map +1 -0
  24. package/dist/agent-executor/claude/limits.d.ts +7 -1
  25. package/dist/agent-executor/claude/limits.d.ts.map +1 -1
  26. package/dist/agent-executor/claude/protocol.d.ts +49 -9
  27. package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
  28. package/dist/agent-executor/claude/session.d.ts +2 -0
  29. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  30. package/dist/agent-executor/claude-sdk/controls.d.ts +10 -1
  31. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
  32. package/dist/agent-executor/claude-sdk/driver.d.ts +97 -3
  33. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  34. package/dist/agent-executor/claude-sdk/probe.d.ts +29 -0
  35. package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -0
  36. package/dist/agent-executor/claude-sdk/query-loop.d.ts +53 -5
  37. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  38. package/dist/agent-executor/claude-sdk/query-options.d.ts +2 -0
  39. package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
  40. package/dist/agent-executor/claude-sdk/session.d.ts +2 -3
  41. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  42. package/dist/agent-executor/claude-sdk/turn-usage.d.ts +81 -0
  43. package/dist/agent-executor/claude-sdk/turn-usage.d.ts.map +1 -0
  44. package/dist/agent-executor/codex/classify.d.ts +4 -0
  45. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  46. package/dist/agent-executor/codex/connect.d.ts +2 -1
  47. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  48. package/dist/agent-executor/codex/control-client.d.ts +168 -0
  49. package/dist/agent-executor/codex/control-client.d.ts.map +1 -0
  50. package/dist/agent-executor/codex/driver.d.ts +22 -2
  51. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  52. package/dist/agent-executor/codex/handlers.d.ts +47 -0
  53. package/dist/agent-executor/codex/handlers.d.ts.map +1 -0
  54. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  55. package/dist/agent-executor/codex/protocol.d.ts +124 -0
  56. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  57. package/dist/agent-executor/codex/request-answers.d.ts +101 -0
  58. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -0
  59. package/dist/agent-executor/codex/session-controls.d.ts +91 -51
  60. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
  61. package/dist/agent-executor/codex/session.d.ts +34 -12
  62. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  63. package/dist/agent-executor/codex/shared-server.d.ts +29 -0
  64. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -0
  65. package/dist/agent-executor/codex/shared-thread.d.ts +46 -0
  66. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -0
  67. package/dist/agent-executor/codex/thread-controls.d.ts +128 -0
  68. package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -0
  69. package/dist/agent-executor/codex/turn-input.d.ts +30 -0
  70. package/dist/agent-executor/codex/turn-input.d.ts.map +1 -0
  71. package/dist/agent-executor/contract.d.ts +77 -0
  72. package/dist/agent-executor/contract.d.ts.map +1 -1
  73. package/dist/agent-executor/engine.d.ts +6 -2
  74. package/dist/agent-executor/engine.d.ts.map +1 -1
  75. package/dist/agent-executor/executor-contract.d.ts +54 -0
  76. package/dist/agent-executor/executor-contract.d.ts.map +1 -1
  77. package/dist/agent-executor/handoff-schemas.d.ts +407 -0
  78. package/dist/agent-executor/handoff-schemas.d.ts.map +1 -0
  79. package/dist/agent-executor/handoff.d.ts +12 -0
  80. package/dist/agent-executor/handoff.d.ts.map +1 -0
  81. package/dist/agent-executor/hello.d.ts +72 -0
  82. package/dist/agent-executor/hello.d.ts.map +1 -1
  83. package/dist/agent-executor/image-input.d.ts +22 -0
  84. package/dist/agent-executor/image-input.d.ts.map +1 -1
  85. package/dist/agent-executor/projection.d.ts +2 -2
  86. package/dist/agent-executor/projection.d.ts.map +1 -1
  87. package/dist/agent-executor/session-primitives.d.ts +10 -1
  88. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  89. package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
  90. package/dist/agent-executor/testing/replay-driver.d.ts +41 -0
  91. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -0
  92. package/dist/agent-executor/testing/replay-gate.d.ts +11 -0
  93. package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -0
  94. package/dist/agent-executor/testing/replay-runner.d.ts +27 -0
  95. package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -0
  96. package/dist/agent-executor/testing/replay-scenarios.d.ts +21 -0
  97. package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -0
  98. package/dist/agent-executor/testing/replay-transcript.d.ts +296 -0
  99. package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -0
  100. package/dist/agent-executor/vocabulary.d.ts +135 -0
  101. package/dist/agent-executor/vocabulary.d.ts.map +1 -1
  102. package/dist/agent-runtime/branch-provider.d.ts +2 -2
  103. package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -1
  104. package/dist/entrypoints/agent-executor/acp.d.ts +4 -1
  105. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  106. package/dist/entrypoints/agent-executor/acp.js +847 -214
  107. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +5 -1
  108. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  109. package/dist/entrypoints/agent-executor/claude-sdk.js +713 -205
  110. package/dist/entrypoints/agent-executor/claude.js +44 -19
  111. package/dist/entrypoints/agent-executor/codex.d.ts +9 -2
  112. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  113. package/dist/entrypoints/agent-executor/codex.js +1775 -359
  114. package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
  115. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  116. package/dist/entrypoints/agent-executor/testing.js +1002 -2
  117. package/dist/entrypoints/agent-executor.d.ts +4 -2
  118. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  119. package/dist/entrypoints/agent-executor.js +411 -23
  120. package/dist/entrypoints/agent-runtime.js +4 -23
  121. package/dist/entrypoints/tools/mcp.d.ts +1 -0
  122. package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
  123. package/dist/entrypoints/tools/mcp.js +1 -1
  124. package/dist/entrypoints/tools/toolkit.js +1 -1
  125. package/dist/{index-wv2amqm4.js → index-2s8sy57y.js} +36 -103
  126. package/dist/{index-afb6z77w.js → index-dbp6xemn.js} +75 -7
  127. package/dist/{index-bjmj2q1z.js → index-jrn3prgm.js} +1 -1
  128. package/dist/index-kne9g2c5.js +30 -0
  129. package/dist/index-p1qmpq0p.js +1300 -0
  130. package/dist/{index-7jqn3b3g.js → index-v759mzed.js} +152 -2
  131. package/dist/{index-cbhxhma2.js → index-x5ayy5bn.js} +1 -0
  132. package/dist/index-y0a4gt1s.js +142 -0
  133. package/dist/tools/internal/rank-tools.d.ts +10 -0
  134. package/dist/tools/internal/rank-tools.d.ts.map +1 -0
  135. package/dist/tools/mcp/handler.d.ts +7 -3
  136. package/dist/tools/mcp/handler.d.ts.map +1 -1
  137. package/dist/tools/mcp/lazy-discovery.d.ts +47 -0
  138. package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -0
  139. package/dist/tools/mcp/mount.d.ts +7 -0
  140. package/dist/tools/mcp/mount.d.ts.map +1 -1
  141. package/dist/tools/mcp/register.d.ts +2 -2
  142. package/dist/tools/mcp/register.d.ts.map +1 -1
  143. package/llms/agent-executor-acp.txt +7 -8
  144. package/llms/agent-executor-claude-sdk.txt +4 -2
  145. package/llms/agent-executor-codex.txt +8 -4
  146. package/llms/agent-executor-testing.txt +5 -1
  147. package/llms/agent-executor.txt +7 -6
  148. package/llms/stitchkit.txt +74 -74
  149. package/llms/tools-mcp.txt +3 -2
  150. package/llms/tools.txt +24 -0
  151. package/llms/{upgrading-0.128.0-0.129.0.txt → upgrading-0.128.0-0.130.0.txt} +30 -3
  152. package/llms/upgrading.txt +1 -1
  153. package/llms-full.txt +159 -97
  154. package/llms.txt +8 -8
  155. package/package.json +1 -1
  156. package/dist/index-y71zn1gw.js +0 -586
@@ -1 +1 @@
1
- {"version":3,"file":"v1-session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-session.ts"],"names":[],"mappings":"A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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;AAiFD,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,UAAU,CAAC,CAsKrB"}
@@ -1,25 +1,63 @@
1
+ import type { AgentMessagePart } from '../../agent-parts/parts.js';
1
2
  import type { AgentEngineTurn } from '../engine.js';
2
3
  import { type EngineRequestTurn } from '../engine-requests.js';
3
4
  import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
4
- import { type AcpUpdateTrack } from './v1-map.js';
5
- /** The answer to a permission request nobody will choose an option for. */
6
- export declare const ACP_CANCELLED: JsonRpcValue;
7
- /** One running `session/prompt`: its deltas and the permission requests it waits on, with their options. */
8
- export interface AcpTurnSlot extends EngineRequestTurn<JsonRpcValue, {
9
- options: {
10
- optionId: string;
11
- kind: string;
12
- }[];
13
- }> {
5
+ import { type ExecutorTokenUsage } from '../vocabulary.js';
6
+ import type { AcpDriverConfig, AcpPromptOutcomeOverride } from './v1-connect.js';
7
+ import { type AcpPromptLimits, type AcpUpdateTrack } from './v1-map.js';
8
+ import { type AcpPermissionDetail } from './v1-permission.js';
9
+ import { type AcpPromptResult } from './v1-protocol.js';
10
+ /** Checker returned by `watchPromptOutcome` before `session/prompt` and consulted after it settles. */
11
+ export type AcpCheckPromptOutcome = (result: AcpPromptResult) => Promise<AcpPromptOutcomeOverride | undefined> | AcpPromptOutcomeOverride | undefined;
12
+ /** One running ACP turn (possibly spanning multiple steered `session/prompt` generations). */
13
+ export interface AcpTurnSlot extends EngineRequestTurn<JsonRpcValue, AcpPermissionDetail> {
14
14
  chunk: number;
15
15
  track: AcpUpdateTrack;
16
+ /** Monotonic generation of the latest `session/prompt` sent for this turn (1 for initial, 2+ for steers). */
17
+ promptGeneration: number;
18
+ /** Normalized token counters summed across all prompt generations of this turn. */
19
+ accumulatedUsage: ExecutorTokenUsage | undefined;
20
+ /** True once `turn-end` or channel failure has settled this turn. */
21
+ settled: boolean;
16
22
  }
17
23
  export declare function newAcpTurn(turnId: string): AcpTurnSlot;
18
24
  /**
19
- * Send the prompt and end the turn with its answer: usage, a failure by
20
- * kind, the outcome. `done` releases the active turn slot.
25
+ * Send one `session/prompt` generation and settle the turn once the latest generation completes:
26
+ * accumulated usage, optional `watchPromptOutcome` override (`errorKind`, `threadDisposition`),
27
+ * failure by kind, and `turn-end`. Earlier steered prompt generations fold their usage into the
28
+ * turn without closing `turn.channel`.
21
29
  */
22
- export declare function runAcpPrompt(peer: JsonRpcPeer, sessionId: string, prompt: readonly JsonRpcValue[], turn: AcpTurnSlot, done: () => void): void;
30
+ export declare function runAcpPrompt(input: {
31
+ peer: JsonRpcPeer;
32
+ sessionId: string;
33
+ prompt: readonly JsonRpcValue[];
34
+ turn: AcpTurnSlot;
35
+ generation: number;
36
+ usageInputIncludesCachedRead?: boolean;
37
+ checkOutcome?: AcpCheckPromptOutcome;
38
+ done: () => void;
39
+ }): void;
23
40
  /** The turn as the executor steers it: interrupt with `session/cancel`, answer permission requests. */
24
41
  export declare function acpTurnHandle(peer: JsonRpcPeer, sessionId: string, turn: AcpTurnSlot): AgentEngineTurn;
42
+ /** Build `startTurn` and `steerTurn` for an open ACP session. */
43
+ export declare function createAcpTurnControls(input: {
44
+ config: AcpDriverConfig;
45
+ peer: JsonRpcPeer;
46
+ sessionId: string;
47
+ limits: AcpPromptLimits;
48
+ ensureAlive(): void;
49
+ getTurn(): AcpTurnSlot | undefined;
50
+ setTurn(turn: AcpTurnSlot | undefined): void;
51
+ }): {
52
+ startTurn(turnInput: {
53
+ turnId: string;
54
+ clientId: string;
55
+ input: readonly AgentMessagePart[];
56
+ }): Promise<AgentEngineTurn>;
57
+ steerTurn(steerInput: {
58
+ readonly input: readonly AgentMessagePart[];
59
+ }): Promise<{
60
+ readonly turnId: string;
61
+ }>;
62
+ };
25
63
  //# sourceMappingURL=v1-turn.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v1-turn.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAGL,KAAK,iBAAiB,EAGvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,KAAK,cAAc,EAAqC,MAAM,UAAU,CAAC;AAGlF,2EAA2E;AAC3E,eAAO,MAAM,aAAa,EAAE,YAAoD,CAAC;AAEjF,4GAA4G;AAC5G,MAAM,WAAW,WACf,SAAQ,iBAAiB,CAAC,YAAY,EAAE;IAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC;IAC1F,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAQtD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE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+1,12 @@
1
1
  import type { ExecutorDelta } from '../vocabulary.js';
2
+ import { type ClaudeRuntimeEvent } from './events.js';
2
3
  /** What one turn has seen so far: which tool each call named, and whether it was asked to stop. */
3
4
  export interface ClaudeTurnState {
4
5
  readonly turnId: string;
5
6
  readonly toolNames: Map<string, string>;
6
7
  interruptRequested: boolean;
8
+ compactCount: number;
9
+ primaryModel?: string;
7
10
  }
8
11
  export declare function newClaudeTurnState(turnId: string): ClaudeTurnState;
9
12
  /**
@@ -21,6 +24,10 @@ export type ClaudeVerdict = {
21
24
  type: 'request';
22
25
  }>;
23
26
  input: unknown;
27
+ /** Validated raw tool name when non-empty; `undefined` refuses session-scoped rules. */
28
+ toolName: string | undefined;
29
+ /** When `true`, the engine asked not to persist a session-scoped allow rule. */
30
+ suppressSessionRule: boolean;
24
31
  } | {
25
32
  kind: 'end';
26
33
  deltas: ExecutorDelta[];
@@ -28,6 +35,9 @@ export type ClaudeVerdict = {
28
35
  } | {
29
36
  kind: 'limits';
30
37
  info: Record<string, unknown>;
38
+ } | {
39
+ kind: 'event';
40
+ event: ClaudeRuntimeEvent;
31
41
  } | {
32
42
  kind: 'session';
33
43
  sessionId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/classify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AAGtE,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAElE;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAA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;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AA4JD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,aAAa,CAuL1F"}
@@ -1,4 +1,5 @@
1
1
  import type { AgentEngineDriver } from '../engine.js';
2
+ import type { ExecutorDriverCapabilities } from '../hello.js';
2
3
  /** Configuration for {@link createClaudeCliDriver}. */
3
4
  export interface ClaudeCliDriverConfig {
4
5
  /** The CLI to run. Default `claude`, found on the engine's `PATH`. */
@@ -27,5 +28,7 @@ export interface ClaudeCliDriverConfig {
27
28
  * with a control request, and learns whether an input arrived from the
28
29
  * session's transcript in the profile.
29
30
  */
30
- export declare function createClaudeCliDriver(config?: ClaudeCliDriverConfig): AgentEngineDriver;
31
+ export declare function createClaudeCliDriver(config?: ClaudeCliDriverConfig): AgentEngineDriver & {
32
+ readonly capabilities: ExecutorDriverCapabilities;
33
+ };
31
34
  //# sourceMappingURL=cli-driver.d.ts.map
@@ -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;AAqCnD,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,CAAC,MAAM,GAAE,qBAA0B,GAAG,iBAAiB,CA0F3F"}
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"}
@@ -0,0 +1,146 @@
1
+ import { z } from 'zod';
2
+ /** Token, tool-use and duration counters reported on Claude task progress/notification events. */
3
+ export declare const ClaudeTaskUsageSchema: z.ZodObject<{
4
+ totalTokens: z.ZodInt;
5
+ toolUses: z.ZodInt;
6
+ durationMs: z.ZodNumber;
7
+ }, z.core.$strict>;
8
+ /** Inferred from {@link ClaudeTaskUsageSchema}. */
9
+ export type ClaudeTaskUsage = z.infer<typeof ClaudeTaskUsageSchema>;
10
+ /**
11
+ * Typed non-delta runtime events emitted by Claude Code and the Claude Agent SDK
12
+ * (`task_*`, `background_tasks_changed`, `api_retry`, `elicitation_complete`, `tool_progress`).
13
+ * Delivered out-of-band via `onEvent` so high-frequency progress and post-turn background
14
+ * notifications never flood `TurnReport.deltas` (512-delta cap).
15
+ */
16
+ export declare const ClaudeRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ uuid: z.ZodOptional<z.ZodString>;
18
+ sessionId: z.ZodOptional<z.ZodString>;
19
+ type: z.ZodLiteral<"task_started">;
20
+ taskId: z.ZodString;
21
+ runId: z.ZodOptional<z.ZodString>;
22
+ toolUseId: z.ZodOptional<z.ZodString>;
23
+ description: z.ZodString;
24
+ subagentType: z.ZodOptional<z.ZodString>;
25
+ isBackgrounded: z.ZodOptional<z.ZodBoolean>;
26
+ spawnDepth: z.ZodOptional<z.ZodInt>;
27
+ parentTaskId: z.ZodOptional<z.ZodString>;
28
+ taskType: z.ZodOptional<z.ZodString>;
29
+ workflowName: z.ZodOptional<z.ZodString>;
30
+ prompt: z.ZodOptional<z.ZodString>;
31
+ skipTranscript: z.ZodOptional<z.ZodBoolean>;
32
+ ambient: z.ZodOptional<z.ZodBoolean>;
33
+ }, z.core.$strict>, z.ZodObject<{
34
+ uuid: z.ZodOptional<z.ZodString>;
35
+ sessionId: z.ZodOptional<z.ZodString>;
36
+ type: z.ZodLiteral<"task_updated">;
37
+ taskId: z.ZodString;
38
+ runId: z.ZodOptional<z.ZodString>;
39
+ patch: z.ZodObject<{
40
+ status: z.ZodOptional<z.ZodString>;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ endTime: z.ZodOptional<z.ZodNumber>;
43
+ totalPausedMs: z.ZodOptional<z.ZodNumber>;
44
+ error: z.ZodOptional<z.ZodString>;
45
+ isBackgrounded: z.ZodOptional<z.ZodBoolean>;
46
+ }, z.core.$strict>;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ uuid: z.ZodOptional<z.ZodString>;
49
+ sessionId: z.ZodOptional<z.ZodString>;
50
+ type: z.ZodLiteral<"task_progress">;
51
+ taskId: z.ZodString;
52
+ runId: z.ZodOptional<z.ZodString>;
53
+ toolUseId: z.ZodOptional<z.ZodString>;
54
+ description: z.ZodString;
55
+ subagentType: z.ZodOptional<z.ZodString>;
56
+ usage: z.ZodOptional<z.ZodObject<{
57
+ totalTokens: z.ZodInt;
58
+ toolUses: z.ZodInt;
59
+ durationMs: z.ZodNumber;
60
+ }, z.core.$strict>>;
61
+ lastToolName: z.ZodOptional<z.ZodString>;
62
+ summary: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ uuid: z.ZodOptional<z.ZodString>;
65
+ sessionId: z.ZodOptional<z.ZodString>;
66
+ type: z.ZodLiteral<"task_notification">;
67
+ taskId: z.ZodString;
68
+ runId: z.ZodOptional<z.ZodString>;
69
+ toolUseId: z.ZodOptional<z.ZodString>;
70
+ status: z.ZodString;
71
+ reason: z.ZodOptional<z.ZodString>;
72
+ outputFile: z.ZodOptional<z.ZodString>;
73
+ summary: z.ZodString;
74
+ usage: z.ZodOptional<z.ZodObject<{
75
+ totalTokens: z.ZodInt;
76
+ toolUses: z.ZodInt;
77
+ durationMs: z.ZodNumber;
78
+ }, z.core.$strict>>;
79
+ skipTranscript: z.ZodOptional<z.ZodBoolean>;
80
+ ambient: z.ZodOptional<z.ZodBoolean>;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ uuid: z.ZodOptional<z.ZodString>;
83
+ sessionId: z.ZodOptional<z.ZodString>;
84
+ type: z.ZodLiteral<"background_tasks_changed">;
85
+ tasks: z.ZodArray<z.ZodObject<{
86
+ taskId: z.ZodString;
87
+ runId: z.ZodOptional<z.ZodString>;
88
+ taskType: z.ZodString;
89
+ subagentType: z.ZodOptional<z.ZodString>;
90
+ description: z.ZodString;
91
+ parentTaskId: z.ZodOptional<z.ZodString>;
92
+ ambient: z.ZodOptional<z.ZodBoolean>;
93
+ }, z.core.$strict>>;
94
+ }, z.core.$strict>, z.ZodObject<{
95
+ uuid: z.ZodOptional<z.ZodString>;
96
+ sessionId: z.ZodOptional<z.ZodString>;
97
+ type: z.ZodLiteral<"api_retry">;
98
+ attempt: z.ZodInt;
99
+ maxRetries: z.ZodInt;
100
+ retryDelayMs: z.ZodNumber;
101
+ errorStatus: z.ZodNullable<z.ZodInt>;
102
+ error: z.ZodString;
103
+ noResponse: z.ZodOptional<z.ZodObject<{
104
+ waitedMs: z.ZodNumber;
105
+ retryWaitMs: z.ZodNumber;
106
+ }, z.core.$strict>>;
107
+ }, z.core.$strict>, z.ZodObject<{
108
+ uuid: z.ZodOptional<z.ZodString>;
109
+ sessionId: z.ZodOptional<z.ZodString>;
110
+ type: z.ZodLiteral<"elicitation_complete">;
111
+ mcpServerName: z.ZodString;
112
+ elicitationId: z.ZodString;
113
+ }, z.core.$strict>, z.ZodObject<{
114
+ uuid: z.ZodOptional<z.ZodString>;
115
+ sessionId: z.ZodOptional<z.ZodString>;
116
+ type: z.ZodLiteral<"tool_progress">;
117
+ toolUseId: z.ZodString;
118
+ toolName: z.ZodString;
119
+ parentToolUseId: z.ZodNullable<z.ZodString>;
120
+ elapsedTimeSeconds: z.ZodNumber;
121
+ taskId: z.ZodOptional<z.ZodString>;
122
+ heartbeat: z.ZodOptional<z.ZodBoolean>;
123
+ subagentType: z.ZodOptional<z.ZodString>;
124
+ subagentRetry: z.ZodOptional<z.ZodObject<{
125
+ agentId: z.ZodString;
126
+ attempt: z.ZodInt;
127
+ maxRetries: z.ZodInt;
128
+ retryDelayMs: z.ZodNumber;
129
+ errorStatus: z.ZodNullable<z.ZodInt>;
130
+ errorCategory: z.ZodString;
131
+ }, z.core.$strict>>;
132
+ }, z.core.$strict>], "type">;
133
+ /** Typed non-delta runtime event inferred from {@link ClaudeRuntimeEventSchema}. */
134
+ export type ClaudeRuntimeEvent = z.infer<typeof ClaudeRuntimeEventSchema>;
135
+ /** Whether a Claude `system` record subtype maps to a {@link ClaudeRuntimeEvent}. */
136
+ export declare function isClaudeRuntimeSystemSubtype(subtype: string): boolean;
137
+ /**
138
+ * Parse a validated Claude `system` (task/retry/elicitation) or top-level `tool_progress`
139
+ * wire record into a normalized {@link ClaudeRuntimeEvent}. Returns `undefined` when required
140
+ * fields are missing or malformed so the classifier can surface `unhandled` fail-closed.
141
+ */
142
+ export declare function parseClaudeRuntimeEvent(record: {
143
+ readonly type: string;
144
+ readonly subtype?: string;
145
+ }): ClaudeRuntimeEvent | undefined;
146
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,kGAAkG;AAClG,eAAO,MAAM,qBAAqB;;;;kBAIhC,CAAC;AAEH,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAyCpE;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAsFnC,CAAC;AAEH,oFAAoF;AACpF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AA6J1E,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErE;AAkJD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,kBAAkB,GAAG,SAAS,CA6BjC"}
@@ -1,4 +1,10 @@
1
- import { type PlanWindow } from '../hello.js';
1
+ import { type PlanLimits, type PlanWindow } from '../hello.js';
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`.
6
+ */
7
+ export declare function claudeUsagePlanLimits(raw: unknown, now: Date): PlanLimits;
2
8
  /**
3
9
  * Claude's `rate_limit_event` as windows: `unifiedWindows` when present
4
10
  * (`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,EAAE,KAAK,UAAU,EAAoB,MAAM,UAAU,CAAC;AAc7D;;;;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":"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,5 +1,7 @@
1
1
  import { z } from 'zod';
2
+ import { type InteractionReply } from '../executor-contract.js';
2
3
  import { type InlinedPart, type SupportedImageMediaType } from '../image-input.js';
4
+ type JsonValue = z.infer<ReturnType<typeof z.json>>;
3
5
  export declare const ClaudeContentBlockSchema: z.ZodUnion<readonly [z.ZodObject<{
4
6
  type: z.ZodLiteral<"text">;
5
7
  text: z.ZodString;
@@ -24,6 +26,7 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
26
  subtype: z.ZodString;
25
27
  session_id: z.ZodOptional<z.ZodString>;
26
28
  model: z.ZodOptional<z.ZodString>;
29
+ uuid: z.ZodOptional<z.ZodString>;
27
30
  }, z.core.$loose>, z.ZodObject<{
28
31
  type: z.ZodLiteral<"user">;
29
32
  uuid: z.ZodOptional<z.ZodString>;
@@ -51,8 +54,10 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
51
54
  }, z.core.$loose>;
52
55
  }, z.core.$loose>, z.ZodObject<{
53
56
  type: z.ZodLiteral<"assistant">;
57
+ parent_tool_use_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
58
  message: z.ZodObject<{
55
59
  id: z.ZodString;
60
+ model: z.ZodOptional<z.ZodString>;
56
61
  content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
57
62
  type: z.ZodLiteral<"text">;
58
63
  text: z.ZodString;
@@ -101,11 +106,16 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
101
106
  api_error_status: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodInt, z.ZodString]>>>;
102
107
  result: z.ZodOptional<z.ZodString>;
103
108
  total_cost_usd: z.ZodOptional<z.ZodNumber>;
104
- usage: z.ZodOptional<z.ZodObject<{
105
- input_tokens: z.ZodOptional<z.ZodInt>;
106
- output_tokens: z.ZodOptional<z.ZodInt>;
107
- cache_read_input_tokens: z.ZodOptional<z.ZodInt>;
108
- }, z.core.$loose>>;
109
+ usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
110
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
111
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
112
+ cache_read_input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
113
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
114
+ output_tokens_details: z.ZodOptional<z.ZodNullable<z.ZodObject<{
115
+ thinking_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
116
+ }, z.core.$loose>>>;
117
+ }, z.core.$loose>>>;
118
+ modelUsage: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
109
119
  }, z.core.$loose>, z.ZodObject<{
110
120
  type: z.ZodLiteral<"rate_limit_event">;
111
121
  rate_limit_info: z.ZodObject<{}, z.core.$loose>;
@@ -117,6 +127,7 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
117
127
  tool_name: z.ZodOptional<z.ZodString>;
118
128
  input: z.ZodOptional<z.ZodJSONSchema>;
119
129
  tool_use_id: z.ZodOptional<z.ZodString>;
130
+ suppress_always_allow_rule: z.ZodOptional<z.ZodBoolean>;
120
131
  }, z.core.$loose>;
121
132
  }, z.core.$loose>, z.ZodObject<{
122
133
  type: z.ZodLiteral<"control_response">;
@@ -128,6 +139,8 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
128
139
  type: z.ZodLiteral<"command_lifecycle">;
129
140
  command_uuid: z.ZodOptional<z.ZodString>;
130
141
  state: z.ZodString;
142
+ }, z.core.$loose>, z.ZodObject<{
143
+ type: z.ZodLiteral<"tool_progress">;
131
144
  }, z.core.$loose>], "type">;
132
145
  export type ClaudeRecord = z.infer<typeof ClaudeRecordSchema>;
133
146
  /** A record whose `type` this driver does not know: carried as `unhandled`, never dropped. */
@@ -166,14 +179,38 @@ export declare function claudeUserMessage(input: {
166
179
  parent_tool_use_id: null;
167
180
  session_id: string;
168
181
  };
169
- /** An answer to `can_use_tool`, in the dialect's own form: `deny` always carries a message. */
170
- export declare function claudePermissionResponse(requestId: string, decision: {
182
+ /** Session-scoped allow rule attached to a Claude `can_use_tool` allow response. */
183
+ export interface ClaudeSessionAllowRule {
184
+ readonly type: 'addRules';
185
+ readonly rules: readonly {
186
+ readonly toolName: string;
187
+ }[];
188
+ readonly behavior: 'allow';
189
+ readonly destination: 'session';
190
+ }
191
+ /** Metadata kept with one held Claude permission request (CLI `control_request` or SDK `canUseTool`). */
192
+ export interface ClaudePendingPermissionDetail<TInput = unknown> {
193
+ readonly input: TInput;
194
+ readonly toolName: string | undefined;
195
+ readonly suppressSessionRule: boolean;
196
+ }
197
+ /** Normalized decision produced from a host `InteractionReply` for a pending Claude permission request. */
198
+ export type ClaudePermissionDecision<TInput = unknown> = {
171
199
  behavior: 'allow';
172
- input: unknown;
200
+ input: TInput | Record<string, JsonValue>;
201
+ updatedPermissions?: readonly ClaudeSessionAllowRule[];
173
202
  } | {
174
203
  behavior: 'deny';
175
204
  message: string;
176
- }): {
205
+ interrupt?: boolean;
206
+ };
207
+ /**
208
+ * Validate a host `InteractionReply` against a held Claude permission request without mutating
209
+ * pending state on refusal. Shared by both Claude CLI and Claude SDK drivers.
210
+ */
211
+ export declare function resolveClaudePermissionReply<TInput>(detail: ClaudePendingPermissionDetail<TInput>, rawReply: InteractionReply['reply']): ClaudePermissionDecision<TInput>;
212
+ /** An answer to `can_use_tool`, in the dialect's own form: `deny` always carries a message. */
213
+ export declare function claudePermissionResponse(requestId: string, decision: ClaudePermissionDecision): {
177
214
  type: string;
178
215
  response: {
179
216
  subtype: string;
@@ -181,9 +218,11 @@ export declare function claudePermissionResponse(requestId: string, decision: {
181
218
  response: {
182
219
  behavior: string;
183
220
  updatedInput: unknown;
221
+ updatedPermissions?: readonly ClaudeSessionAllowRule[] | undefined;
184
222
  } | {
185
223
  behavior: string;
186
224
  message: string;
225
+ interrupt?: boolean | undefined;
187
226
  };
188
227
  };
189
228
  };
@@ -203,4 +242,5 @@ export declare function claudeInterrupt(requestId: string): {
203
242
  subtype: string;
204
243
  };
205
244
  };
245
+ export {};
206
246
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,uBAAuB,EAC7B,MAAM,gBAAgB,CAAC;AA4BxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;mBAMnC,CAAC;AAQH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAsE7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,8FAA8F;AAC9F,eAAO,MAAM,yBAAyB;;iBAAsC,CAAC;AAE7E,kEAAkE;AAClE,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;QACxB,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;QAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAEN;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,WAAW,EAAE,GAC5B,MAAM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QAAI,OAAO;;EAC5E"}
@@ -2,6 +2,7 @@ import type { AgentEngineSession } from '../engine.js';
2
2
  import type { PlanLimits } from '../hello.js';
3
3
  import { type DriverImageOptions } from '../image-input.js';
4
4
  import { type ExecutorProfileConfig } from '../profile.js';
5
+ import type { ExecutorStartupPhase } from '../vocabulary.js';
5
6
  /**
6
7
  * One Claude Code process for one connection: spawned with the session's
7
8
  * flags, read by one loop for its whole life, each turn's records routed to
@@ -18,6 +19,7 @@ export declare function openClaudeSession(config: DriverImageOptions & {
18
19
  profile: ExecutorProfileConfig;
19
20
  cwd: string;
20
21
  nativeThreadId?: string;
22
+ onStartupPhase?: (phase: ExecutorStartupPhase) => void;
21
23
  signal?: AbortSignal;
22
24
  }): Promise<AgentEngineSession>;
23
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;AAWrE,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;AA8D1F;;;;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,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,kBAAkB,CAAC,CA8K7B"}
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,5 +1,6 @@
1
1
  import type { Options, Query } from '@anthropic-ai/claude-agent-sdk';
2
- import type { ClaudeSdkRun, ClaudeSdkSession } from './driver.js';
2
+ import { type PlanLimits } from '../hello.js';
3
+ import type { ClaudeSdkRun, ClaudeSdkSession, ClaudeSdkUsageRead } from './driver.js';
3
4
  export type ClaudeSdkFlagSettings = Parameters<Query['applyFlagSettings']>[0];
4
5
  type LiveMethods = Omit<ClaudeSdkSession, 'nativeThreadId' | 'providerPid' | 'startTurn' | 'close'>;
5
6
  /** Session state needed by live-control operations on an active Claude SDK query. */
@@ -12,7 +13,15 @@ export interface ClaudeSdkControlHost {
12
13
  setActiveModel(model: string | undefined): void;
13
14
  setActivePermissionMode(mode: NonNullable<Options['permissionMode']>): void;
14
15
  recordFlagSettings(settings: ClaudeSdkFlagSettings): void;
16
+ recordPlanLimits(limits: PlanLimits): void;
17
+ recordPlanLimitsFailure(error: unknown): void;
15
18
  }
19
+ /** Build a `ClaudeSdkUsageRead` for an SDK build without the experimental usage endpoint. */
20
+ export declare function unpublishedClaudeSdkUsageRead(now?: Date): ClaudeSdkUsageRead;
21
+ /** Normalize a raw Claude SDK usage payload into a {@link ClaudeSdkUsageRead} and optionally cache known/no-plan limits. */
22
+ export declare function normalizeClaudeSdkUsageRead(raw: Extract<ClaudeSdkUsageRead, {
23
+ readonly supported: true;
24
+ }>['raw'], recordPlanLimits?: (limits: PlanLimits) => void, now?: Date): ClaudeSdkUsageRead;
16
25
  /** Create the live-session control and inspection methods exposed on {@link ClaudeSdkSession}. */
17
26
  export declare function createClaudeSdkControls(host: ClaudeSdkControlHost): LiveMethods;
18
27
  export {};
@@ -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;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAA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