poly-weaver 0.4.3 → 0.5.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 (125) hide show
  1. package/dist/agents/implementors/handler.d.ts.map +1 -1
  2. package/dist/agents/implementors/handler.js +7 -2
  3. package/dist/agents/implementors/handler.js.map +1 -1
  4. package/dist/agents/planners/adapter.d.ts.map +1 -1
  5. package/dist/agents/planners/adapter.js +1 -0
  6. package/dist/agents/planners/adapter.js.map +1 -1
  7. package/dist/agents/planners/handler.d.ts.map +1 -1
  8. package/dist/agents/planners/handler.js +7 -2
  9. package/dist/agents/planners/handler.js.map +1 -1
  10. package/dist/agents/planners/types.d.ts +1 -0
  11. package/dist/agents/planners/types.d.ts.map +1 -1
  12. package/dist/agents/reviewers/adapter.d.ts +3 -2
  13. package/dist/agents/reviewers/adapter.d.ts.map +1 -1
  14. package/dist/agents/reviewers/adapter.js +14 -2
  15. package/dist/agents/reviewers/adapter.js.map +1 -1
  16. package/dist/agents/reviewers/dsl.d.ts +11 -1
  17. package/dist/agents/reviewers/dsl.d.ts.map +1 -1
  18. package/dist/agents/reviewers/dsl.js.map +1 -1
  19. package/dist/agents/reviewers/handler.d.ts.map +1 -1
  20. package/dist/agents/reviewers/handler.js +51 -2
  21. package/dist/agents/reviewers/handler.js.map +1 -1
  22. package/dist/agents/reviewers/index.d.ts +3 -3
  23. package/dist/agents/reviewers/index.d.ts.map +1 -1
  24. package/dist/agents/reviewers/index.js +9 -5
  25. package/dist/agents/reviewers/index.js.map +1 -1
  26. package/dist/agents/reviewers/prompts.d.ts +14 -2
  27. package/dist/agents/reviewers/prompts.d.ts.map +1 -1
  28. package/dist/agents/reviewers/prompts.js +106 -2
  29. package/dist/agents/reviewers/prompts.js.map +1 -1
  30. package/dist/agents/reviewers/types.d.ts +19 -1
  31. package/dist/agents/reviewers/types.d.ts.map +1 -1
  32. package/dist/agents/reviewers/types.js.map +1 -1
  33. package/dist/agents/runner.d.ts +9 -0
  34. package/dist/agents/runner.d.ts.map +1 -1
  35. package/dist/agents/runner.js +2 -1
  36. package/dist/agents/runner.js.map +1 -1
  37. package/dist/agents/simplifiers/adapter.d.ts.map +1 -1
  38. package/dist/agents/simplifiers/adapter.js +1 -0
  39. package/dist/agents/simplifiers/adapter.js.map +1 -1
  40. package/dist/agents/simplifiers/handler.d.ts.map +1 -1
  41. package/dist/agents/simplifiers/handler.js +7 -2
  42. package/dist/agents/simplifiers/handler.js.map +1 -1
  43. package/dist/cli.js +9 -1
  44. package/dist/cli.js.map +1 -1
  45. package/dist/flow/built-in/default.d.ts +1 -0
  46. package/dist/flow/built-in/default.d.ts.map +1 -1
  47. package/dist/flow/built-in/default.js +37 -0
  48. package/dist/flow/built-in/default.js.map +1 -1
  49. package/dist/flow/built-in/default.ts +43 -0
  50. package/dist/flow/built-in/why-so-serious.d.ts +1 -0
  51. package/dist/flow/built-in/why-so-serious.d.ts.map +1 -1
  52. package/dist/flow/built-in/why-so-serious.js +37 -0
  53. package/dist/flow/built-in/why-so-serious.js.map +1 -1
  54. package/dist/flow/diagram.d.ts.map +1 -1
  55. package/dist/flow/diagram.js +26 -11
  56. package/dist/flow/diagram.js.map +1 -1
  57. package/dist/flow/dsl.d.ts +7 -0
  58. package/dist/flow/dsl.d.ts.map +1 -1
  59. package/dist/flow/dsl.js +35 -0
  60. package/dist/flow/dsl.js.map +1 -1
  61. package/dist/flow/executor.d.ts.map +1 -1
  62. package/dist/flow/executor.js +17 -0
  63. package/dist/flow/executor.js.map +1 -1
  64. package/dist/flow/types.d.ts +17 -0
  65. package/dist/flow/types.d.ts.map +1 -1
  66. package/dist/flow/types.js.map +1 -1
  67. package/dist/orchestrator.d.ts.map +1 -1
  68. package/dist/orchestrator.js +14 -0
  69. package/dist/orchestrator.js.map +1 -1
  70. package/dist/prompts.d.ts.map +1 -1
  71. package/dist/prompts.js +8 -1
  72. package/dist/prompts.js.map +1 -1
  73. package/dist/providers/claude/completion-plan-mode.d.ts +30 -0
  74. package/dist/providers/claude/completion-plan-mode.d.ts.map +1 -0
  75. package/dist/providers/claude/completion-plan-mode.js +151 -0
  76. package/dist/providers/claude/completion-plan-mode.js.map +1 -0
  77. package/dist/providers/claude/completion.d.ts +9 -48
  78. package/dist/providers/claude/completion.d.ts.map +1 -1
  79. package/dist/providers/claude/completion.js +21 -274
  80. package/dist/providers/claude/completion.js.map +1 -1
  81. package/dist/providers/claude/session.d.ts +24 -4
  82. package/dist/providers/claude/session.d.ts.map +1 -1
  83. package/dist/providers/claude/session.js +90 -15
  84. package/dist/providers/claude/session.js.map +1 -1
  85. package/dist/providers/claude/strategy.d.ts +4 -3
  86. package/dist/providers/claude/strategy.d.ts.map +1 -1
  87. package/dist/providers/claude/strategy.js +8 -7
  88. package/dist/providers/claude/strategy.js.map +1 -1
  89. package/dist/providers/claude/tool-tracking.d.ts +28 -0
  90. package/dist/providers/claude/tool-tracking.d.ts.map +1 -0
  91. package/dist/providers/claude/tool-tracking.js +149 -0
  92. package/dist/providers/claude/tool-tracking.js.map +1 -0
  93. package/dist/providers/codex/strategy.d.ts +3 -1
  94. package/dist/providers/codex/strategy.d.ts.map +1 -1
  95. package/dist/providers/codex/strategy.js +1 -1
  96. package/dist/providers/codex/strategy.js.map +1 -1
  97. package/dist/providers/copilot/strategy.d.ts +3 -1
  98. package/dist/providers/copilot/strategy.d.ts.map +1 -1
  99. package/dist/providers/copilot/strategy.js +1 -1
  100. package/dist/providers/copilot/strategy.js.map +1 -1
  101. package/dist/providers/invoke.js +1 -1
  102. package/dist/providers/invoke.js.map +1 -1
  103. package/dist/providers/types.d.ts +3 -1
  104. package/dist/providers/types.d.ts.map +1 -1
  105. package/dist/user/curate-handler.d.ts +32 -0
  106. package/dist/user/curate-handler.d.ts.map +1 -0
  107. package/dist/user/curate-handler.js +156 -0
  108. package/dist/user/curate-handler.js.map +1 -0
  109. package/dist/user/curate-prompt.d.ts +41 -0
  110. package/dist/user/curate-prompt.d.ts.map +1 -0
  111. package/dist/user/curate-prompt.js +473 -0
  112. package/dist/user/curate-prompt.js.map +1 -0
  113. package/dist/user/dsl.d.ts +1 -0
  114. package/dist/user/dsl.d.ts.map +1 -1
  115. package/dist/user/dsl.js +1 -0
  116. package/dist/user/dsl.js.map +1 -1
  117. package/dist/user/index.d.ts +3 -0
  118. package/dist/user/index.d.ts.map +1 -1
  119. package/dist/user/index.js +2 -0
  120. package/dist/user/index.js.map +1 -1
  121. package/dist/user/prompt.d.ts +11 -0
  122. package/dist/user/prompt.d.ts.map +1 -1
  123. package/dist/user/prompt.js +40 -7
  124. package/dist/user/prompt.js.map +1 -1
  125. package/package.json +2 -2
@@ -1,299 +1,46 @@
1
- import { CLAUDE_PLAN_FILE_PATH_REGEX, extractClaudeResponse } from "./session.js";
2
1
  import { AbstractCompletionDetector } from "../base-completion.js";
2
+ import { extractClaudeResponse } from "./session.js";
3
+ import { trackPendingToolUses } from "./tool-tracking.js";
3
4
  /**
4
- * Resolution signal for any Claude Code tool launched asynchronously
5
- * (Agent fork/subagent, Bash with run_in_background, Monitor, etc.).
6
- * The launch-ack `tool_result` for these arrives with
7
- * `toolUseResult.isAsync === true` and is intentionally not treated as
8
- * resolution; the actual completion lands later as a `type: "user"` line
9
- * whose string `content` matches this regex. Capture group 1 is the
10
- * original `tool_use_id`.
11
- */
12
- const TASK_NOTIFICATION_REGEX = /^<task-notification>[\s\S]*?<tool-use-id>([^<]+)<\/tool-use-id>/;
13
- /**
14
- * Claude completion detection using the two-signal rule:
15
- *
16
- * 1. **Tool-use tracking (primary)**: Track tool_use IDs in assistant messages,
17
- * mark resolved when matching tool_result appears. Complete when pending set
18
- * is empty AND at least one text output was emitted.
19
- *
20
- * 2. **Quiet debounce (secondary)**: No new JSONL lines for `quietMs` after
21
- * the primary signal fires.
5
+ * Claude completion detection for normal turns using the two-signal rule:
22
6
  *
23
- * Both signals must agree before the turn is considered complete.
7
+ * 1. Track tool_use IDs in assistant messages and mark them resolved when a
8
+ * matching tool_result or async <task-notification> appears.
9
+ * 2. Complete only after pending tools are empty, assistant text exists after
10
+ * the latest tool activity, and the quiet debounce elapses.
24
11
  *
25
- * **Async-launched tools**: When a tool is launched asynchronously
26
- * (`Agent` with or without `subagent_type`, `Bash` with
27
- * `run_in_background: true`, `Monitor`, etc.), the immediate `tool_result`
28
- * is a launch acknowledgement carrying outer field
29
- * `toolUseResult.isAsync === true` — *not* a real result. We deliberately
30
- * do not remove the `tool_use_id` from `pendingToolUses` for these acks.
31
- * The real resolution arrives later as a `type: "user"` line whose
32
- * string `message.content` begins with `<task-notification>` and embeds
33
- * the original `<tool-use-id>`. That message clears the pending set and
34
- * bumps `lastToolActivityIdx`, forcing the detector to wait for a fresh
35
- * assistant turn (narrative text or `ExitPlanMode`) before firing.
36
- *
37
- * **Plan-exit prefetch fallback (Claude Code ≥ 2.1.74 deferred-tools era)**:
38
- * Since 2.1.114, `ExitPlanMode` ships as a deferred tool — Claude must call
39
- * `ToolSearch({query:"select:ExitPlanMode"})` to load its schema before it can
40
- * call `ExitPlanMode`. Sometimes the PTY stalls after the ToolSearch returns
41
- * and the real `ExitPlanMode` call never lands. When we observe the full
42
- * pre-exit pattern (plan-file `Write`/`Edit` resolved **and** the
43
- * `ExitPlanMode` ToolSearch resolved), we arm a narrow staleness fallback via
44
- * `isStaleFallbackReady`: the plan artifact is already on disk, so resolving
45
- * off it is safe. The arm is deliberately narrow to avoid the
46
- * extended-thinking false-positives that forced removal of the broad
47
- * staleness fallback (commit `9ccbd83`).
48
- *
49
- * The ToolSearch prefetch is a **session-scoped** fact: once Claude has
50
- * resolved `ToolSearch(select:ExitPlanMode)` anywhere in the session, the
51
- * schema stays loaded for every subsequent turn. So the prefetch check
52
- * inspects both the current turn (`currentLines`) and the pre-resume
53
- * prefix (`priorLines`). The plan-file Write/Edit half remains
54
- * **turn-scoped** — iteration N must do its own edit before the fallback
55
- * arms, so a stale plan from iteration 1 cannot resolve iteration 2
56
- * before any work happens.
12
+ * This detector deliberately contains no plan-mode behavior. Native plan-mode
13
+ * planner and simplifier turns use ClaudePlanModeDetector instead.
57
14
  */
58
- export class ClaudeCompletionStrategy extends AbstractCompletionDetector {
59
- exitToolName;
60
- // Two-signal state
15
+ export class ClaudePrimaryDetector extends AbstractCompletionDetector {
61
16
  pendingToolUses = new Set();
62
17
  hasTextOutput = false;
63
18
  primaryFired = false;
64
- exitToolCalled = false;
65
- planExitPrefetchComplete = false;
66
- constructor(pollMs = 500, quietMs = 500, exitToolName, staleFallbackMs = Infinity) {
67
- super(pollMs, quietMs, staleFallbackMs);
68
- this.exitToolName = exitToolName;
19
+ constructor(pollMs = 500, quietMs = 500) {
20
+ super(pollMs, quietMs, Infinity);
69
21
  }
70
22
  analyzeLines(currentLines) {
71
- this.pendingToolUses.clear();
72
- this.hasTextOutput = false;
73
- this.exitToolCalled = false;
74
- this.planExitPrefetchComplete = false;
75
- let hasAnyToolUse = false;
76
- let lastToolActivityIdx = -1;
77
- let lastAssistantTextIdx = -1;
78
- let lastAssistantStopReason;
79
- // Collect all tool_result IDs so we can reconcile out-of-order lines.
80
- // Claude Code's JSONL writer can append tool_result before the
81
- // corresponding tool_use when parallel tool calls are dispatched.
82
- const resolvedIds = new Set();
83
- // Track per-message-id whether stop_reason was "tool_use" and whether a
84
- // tool_use block has actually been observed for that id. Claude Code's
85
- // session writer splits multi-block messages across separate JSONL
86
- // lines (one per content block) and the gap between a text block and
87
- // the corresponding tool_use block can exceed the quiet-debounce
88
- // window — observed at 12 s in dump 2026-04-30T09-40-25-745Z.
89
- const stopReasonToolUseMessages = new Set();
90
- const messagesWithToolUseBlock = new Set();
91
- // Track the tool_use IDs that participate in the deferred-ExitPlanMode
92
- // dance, so we can flip `planExitPrefetchComplete` once both have their
93
- // matching tool_result.
94
- const planFileWriteIds = new Set();
95
- const exitPlanModePrefetchIds = new Set();
96
- for (let idx = 0; idx < currentLines.length; idx++) {
97
- const line = currentLines[idx];
98
- if (line.type === "assistant") {
99
- const message = line.message;
100
- if (!message?.content)
101
- continue;
102
- lastAssistantStopReason = message.stop_reason;
103
- const messageId = message.id;
104
- if (messageId && message.stop_reason === "tool_use") {
105
- stopReasonToolUseMessages.add(messageId);
106
- }
107
- for (const block of message.content) {
108
- if (block.type === "tool_use" && block.id) {
109
- if (messageId)
110
- messagesWithToolUseBlock.add(messageId);
111
- // If this is the plan-exit tool, mark it and skip tracking
112
- if (this.exitToolName && block.name === this.exitToolName) {
113
- this.exitToolCalled = true;
114
- continue;
115
- }
116
- this.pendingToolUses.add(block.id);
117
- hasAnyToolUse = true;
118
- lastToolActivityIdx = idx;
119
- // Plan-file Write/Edit — artifact-on-disk half of the dance.
120
- if ((block.name === "Write" || block.name === "Edit") &&
121
- typeof block.input?.file_path === "string" &&
122
- CLAUDE_PLAN_FILE_PATH_REGEX.test(block.input.file_path)) {
123
- planFileWriteIds.add(block.id);
124
- }
125
- // ToolSearch pre-loading the ExitPlanMode schema — the other half.
126
- if (block.name === "ToolSearch" &&
127
- typeof block.input?.query === "string" &&
128
- block.input.query.includes("ExitPlanMode")) {
129
- exitPlanModePrefetchIds.add(block.id);
130
- }
131
- }
132
- if (block.type === "text" && block.text) {
133
- this.hasTextOutput = true;
134
- lastAssistantTextIdx = idx;
135
- }
136
- }
137
- }
138
- else if (line.type === "user") {
139
- const message = line.message;
140
- if (!message?.content)
141
- continue;
142
- // String content is rare in tool-result lines but is exactly how
143
- // Claude Code delivers async-tool completion notifications.
144
- if (typeof message.content === "string") {
145
- const m = TASK_NOTIFICATION_REGEX.exec(message.content);
146
- if (m) {
147
- const id = m[1];
148
- this.pendingToolUses.delete(id);
149
- resolvedIds.add(id);
150
- lastToolActivityIdx = idx;
151
- }
152
- continue;
153
- }
154
- // Async-launch ack: the outer line carries
155
- // `toolUseResult.isAsync === true`. Treat as activity but do not
156
- // resolve — the matching `<task-notification>` will arrive later.
157
- const tur = line
158
- .toolUseResult;
159
- const isAsyncLaunch = !!tur && tur.isAsync === true;
160
- for (const block of message.content) {
161
- if (block.type === "tool_result" && block.tool_use_id) {
162
- if (isAsyncLaunch) {
163
- lastToolActivityIdx = idx;
164
- continue;
165
- }
166
- this.pendingToolUses.delete(block.tool_use_id);
167
- resolvedIds.add(block.tool_use_id);
168
- lastToolActivityIdx = idx;
169
- }
170
- }
171
- }
172
- }
173
- // Reconcile out-of-order lines: remove tool_use IDs whose tool_result
174
- // appeared earlier in the file (before the tool_use line).
175
- for (const id of resolvedIds)
176
- this.pendingToolUses.delete(id);
177
- // Prefetch is "complete" when both halves of the dance have their
178
- // matching tool_result — order-independent, so this works whether the
179
- // ToolSearch came before or after the plan-file Write.
180
- let sawResolvedPlanFileWrite = false;
181
- for (const id of planFileWriteIds) {
182
- if (resolvedIds.has(id)) {
183
- sawResolvedPlanFileWrite = true;
184
- break;
185
- }
186
- }
187
- let sawResolvedExitPlanModePrefetch = false;
188
- for (const id of exitPlanModePrefetchIds) {
189
- if (resolvedIds.has(id)) {
190
- sawResolvedExitPlanModePrefetch = true;
191
- break;
192
- }
193
- }
194
- // Prefetch is session-scoped: a resolved ToolSearch(ExitPlanMode) in any
195
- // prior turn keeps the schema loaded for the current turn too. Only
196
- // scan `priorLines` if the current slice did not already observe one,
197
- // since the in-slice scan is strictly more authoritative (same data).
198
- if (!sawResolvedExitPlanModePrefetch && this.priorLines.length > 0) {
199
- sawResolvedExitPlanModePrefetch = didResolveExitPlanModePrefetch(this.priorLines);
200
- }
201
- this.planExitPrefetchComplete =
202
- sawResolvedPlanFileWrite && sawResolvedExitPlanModePrefetch;
203
- // A message whose stop_reason is "tool_use" is guaranteed to contain at
204
- // least one tool_use block. If we have not yet observed any tool_use
205
- // block from such a message, the message is still being written to
206
- // JSONL and the response is not done.
207
- let awaitingPromisedToolUse = false;
208
- for (const id of stopReasonToolUseMessages) {
209
- if (!messagesWithToolUseBlock.has(id)) {
210
- awaitingPromisedToolUse = true;
211
- break;
212
- }
213
- }
214
- // Guard: suppress the primary signal while the response is provably
215
- // not done.
216
- // - stop_reason === null → API response still streaming blocks.
217
- // - stop_reason === "stop_sequence" → synthetic resume responses.
218
- // - awaitingPromisedToolUse → a message with stop_reason "tool_use"
219
- // has emitted text but its tool_use block has not yet been written
220
- // to JSONL (Claude Code splits multi-block messages across lines and
221
- // the gap can exceed the quiet-debounce window — observed at 12 s
222
- // in dump 2026-04-30T09-40-25-745Z).
223
- // undefined (missing field, e.g. in test data) falls through.
224
- const responseIncomplete = lastAssistantStopReason === null ||
225
- lastAssistantStopReason === "stop_sequence" ||
226
- awaitingPromisedToolUse;
227
- // Primary signal:
228
- // - the last assistant response is not mid-stream
229
- // - no pending tool uses
230
- // - at least one assistant text output
231
- // - if tools were used, we require assistant text to appear after the
232
- // most recent tool activity (prevents resolving between tool_result and
233
- // the final narrative/verdict message).
23
+ const tracking = trackPendingToolUses(currentLines);
24
+ this.pendingToolUses = tracking.pendingToolUses;
25
+ this.hasTextOutput = tracking.hasTextOutput;
26
+ const responseIncomplete = tracking.lastAssistantStopReason === null ||
27
+ tracking.lastAssistantStopReason === "stop_sequence" ||
28
+ tracking.awaitingPromisedToolUse;
234
29
  this.primaryFired =
235
30
  !responseIncomplete &&
236
31
  this.pendingToolUses.size === 0 &&
237
32
  this.hasTextOutput &&
238
- (!hasAnyToolUse || lastAssistantTextIdx > lastToolActivityIdx);
33
+ (tracking.perToolUseInfo.size === 0 ||
34
+ tracking.lastAssistantTextIdx > tracking.lastToolActivityIdx);
239
35
  }
240
36
  isPrimarySignalFired() {
241
37
  return this.primaryFired;
242
38
  }
243
- shouldShortCircuit(_lines) {
244
- return this.exitToolCalled && this.pendingToolUses.size === 0;
245
- }
246
- isStaleFallbackReady() {
247
- return this.planExitPrefetchComplete && this.pendingToolUses.size === 0;
248
- }
249
39
  shouldSuppressPtyTimerReset() {
250
- return (this.primaryFired ||
251
- (this.exitToolCalled && this.pendingToolUses.size === 0) ||
252
- (this.planExitPrefetchComplete && this.pendingToolUses.size === 0));
40
+ return this.primaryFired;
253
41
  }
254
42
  extractResponse(lines) {
255
43
  return extractClaudeResponse(lines);
256
44
  }
257
45
  }
258
- /**
259
- * Scan a slice of session lines for a resolved
260
- * `ToolSearch({query: includes("ExitPlanMode")})` invocation. Used to detect
261
- * whether the deferred-tool schema was loaded in any prior turn of a resumed
262
- * Claude session.
263
- */
264
- function didResolveExitPlanModePrefetch(lines) {
265
- const prefetchIds = new Set();
266
- const resolvedIds = new Set();
267
- for (const line of lines) {
268
- if (line.type === "assistant") {
269
- const message = line.message;
270
- if (!message?.content)
271
- continue;
272
- for (const block of message.content) {
273
- if (block.type === "tool_use" &&
274
- block.id &&
275
- block.name === "ToolSearch" &&
276
- typeof block.input?.query === "string" &&
277
- block.input.query.includes("ExitPlanMode")) {
278
- prefetchIds.add(block.id);
279
- }
280
- }
281
- }
282
- else if (line.type === "user") {
283
- const message = line.message;
284
- if (!message?.content || typeof message.content === "string")
285
- continue;
286
- for (const block of message.content) {
287
- if (block.type === "tool_result" && block.tool_use_id) {
288
- resolvedIds.add(block.tool_use_id);
289
- }
290
- }
291
- }
292
- }
293
- for (const id of prefetchIds) {
294
- if (resolvedIds.has(id))
295
- return true;
296
- }
297
- return false;
298
- }
299
46
  //# sourceMappingURL=completion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"completion.js","sourceRoot":"","sources":["../../../src/providers/claude/completion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAC3B,iEAAiE,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,OAAO,wBAAyB,SAAQ,0BAA0B;IAWnD;IAVnB,mBAAmB;IACX,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,aAAa,GAAG,KAAK,CAAC;IACtB,YAAY,GAAG,KAAK,CAAC;IACrB,cAAc,GAAG,K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AI;YACzC,QAAQ,CAAC,uBAAuB,KAAK,eAAe;YACpD,QAAQ,CAAC,uBAAuB,CAAC;QAEnC,IAAI,CAAC,YAAY;YACf,CAAC,kBAAkB;gBACnB,IAAI,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC;gBAC/B,IAAI,CAAC,aAAa;gBAClB,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;oBACjC,QAAQ,CAAC,oBAAoB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACpE,CAAC;IAES,oBAAoB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAEkB,2BAA2B;QAC5C,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAES,eAAe,CAAC,KAAoB;QAC5C,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -22,7 +22,7 @@ export declare function extractClaudeResponse(lines: SessionLine[]): string;
22
22
  /**
23
23
  * Path pattern for Claude's native plan-file location under
24
24
  * `~/.claude/plans/`. Shared by `extractClaudePlanFilePath` (artifact
25
- * extraction) and `ClaudeCompletionStrategy` (completion detection) so the
25
+ * extraction) and the Claude completion detectors so the
26
26
  * two stay in lockstep.
27
27
  */
28
28
  export declare const CLAUDE_PLAN_FILE_PATH_REGEX: RegExp;
@@ -34,12 +34,32 @@ export declare const CLAUDE_PLAN_FILE_PATH_REGEX: RegExp;
34
34
  * (always re-scanned on each run to avoid staleness).
35
35
  */
36
36
  export declare function extractClaudePlanFilePath(lines: SessionLine[]): string | undefined;
37
+ /**
38
+ * Thrown when an `AskUserQuestion` tool result has a missing or malformed
39
+ * `toolUseResult` field. Carries `noRetry = true` so
40
+ * `runPhaseWithRetries` skips re-parsing the same broken JSONL and the
41
+ * orchestrator's executor-level hook triggers a session dump before the
42
+ * error propagates and the CLI exits.
43
+ */
44
+ export declare class ClaudeQACaptureError extends Error {
45
+ readonly noRetry = true;
46
+ constructor(message: string);
47
+ }
37
48
  /**
38
49
  * Extract AskUserQuestion Q&A pairs from Claude session lines.
39
50
  *
40
- * Walks forward to pair `tool_use` blocks (name === "AskUserQuestion") with
41
- * their corresponding `tool_result` responses. Multi-question calls have
42
- * their questions joined with "; ". Unmatched tool_use blocks are skipped.
51
+ * Reads the structured `toolUseResult` field on the user line (top-level,
52
+ * alongside `message`) `{ questions, answers, annotations }` and emits
53
+ * one `UserClarification` per sub-question, with `preview` populated from
54
+ * `annotations[q].preview` when present.
55
+ *
56
+ * Strict-throw contract: when a tracked `AskUserQuestion` round has a
57
+ * missing or malformed `toolUseResult`, throws `ClaudeQACaptureError`
58
+ * (with `noRetry: true`) instead of fabricating a fallback entry. The
59
+ * orchestrator's executor-level hook triggers a session dump before the
60
+ * error propagates so the broken JSONL is preserved alongside the failed
61
+ * step's artifacts. `tool_result` lines whose `tool_use_id` was not from
62
+ * `AskUserQuestion` are ignored (no throw).
43
63
  */
44
64
  export declare function extractClaudeClarifications(lines: SessionLine[]): UserClarification[];
45
65
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/providers/claude/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,CA0BlE;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAiC,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CA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G;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,CA0BlE;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAiC,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,GAAG,SAAS,CA4BlF;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,OAAO,QAAQ;gBACZ,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,iBAAiB,EAAE,CAmDrF;AAiED;;;;;GAKG;AACH,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;gBAEjC,aAAa,CAAC,EAAE,MAAM,MAAM;IAIxC,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAKxD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAOnD,eAAe,CACnB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC;IAOZ,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D,qBAAqB,CACzB,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIzB,mBAAmB,CACvB,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;YAIhB,YAAY;CAI3B"}
@@ -49,7 +49,7 @@ export function extractClaudeResponse(lines) {
49
49
  /**
50
50
  * Path pattern for Claude's native plan-file location under
51
51
  * `~/.claude/plans/`. Shared by `extractClaudePlanFilePath` (artifact
52
- * extraction) and `ClaudeCompletionStrategy` (completion detection) so the
52
+ * extraction) and the Claude completion detectors so the
53
53
  * two stay in lockstep.
54
54
  */
55
55
  export const CLAUDE_PLAN_FILE_PATH_REGEX = /[/\\]\.claude[/\\]plans[/\\]/;
@@ -84,16 +84,42 @@ export function extractClaudePlanFilePath(lines) {
84
84
  }
85
85
  return undefined;
86
86
  }
87
+ /**
88
+ * Thrown when an `AskUserQuestion` tool result has a missing or malformed
89
+ * `toolUseResult` field. Carries `noRetry = true` so
90
+ * `runPhaseWithRetries` skips re-parsing the same broken JSONL and the
91
+ * orchestrator's executor-level hook triggers a session dump before the
92
+ * error propagates and the CLI exits.
93
+ */
94
+ export class ClaudeQACaptureError extends Error {
95
+ noRetry = true;
96
+ constructor(message) {
97
+ super(message);
98
+ this.name = "ClaudeQACaptureError";
99
+ }
100
+ }
87
101
  /**
88
102
  * Extract AskUserQuestion Q&A pairs from Claude session lines.
89
103
  *
90
- * Walks forward to pair `tool_use` blocks (name === "AskUserQuestion") with
91
- * their corresponding `tool_result` responses. Multi-question calls have
92
- * their questions joined with "; ". Unmatched tool_use blocks are skipped.
104
+ * Reads the structured `toolUseResult` field on the user line (top-level,
105
+ * alongside `message`) `{ questions, answers, annotations }` and emits
106
+ * one `UserClarification` per sub-question, with `preview` populated from
107
+ * `annotations[q].preview` when present.
108
+ *
109
+ * Strict-throw contract: when a tracked `AskUserQuestion` round has a
110
+ * missing or malformed `toolUseResult`, throws `ClaudeQACaptureError`
111
+ * (with `noRetry: true`) instead of fabricating a fallback entry. The
112
+ * orchestrator's executor-level hook triggers a session dump before the
113
+ * error propagates so the broken JSONL is preserved alongside the failed
114
+ * step's artifacts. `tool_result` lines whose `tool_use_id` was not from
115
+ * `AskUserQuestion` are ignored (no throw).
93
116
  */
94
117
  export function extractClaudeClarifications(lines) {
95
118
  const clarifications = [];
96
- const questionMap = new Map(); // tool_use_id question text
119
+ // tool_use_id joined-"; " question text. Used to (a) filter unrelated
120
+ // tool_result lines so strictness only kicks in on AskUserQuestion
121
+ // rounds, and (b) supply joined-question context to error messages.
122
+ const questionMap = new Map();
97
123
  for (const line of lines) {
98
124
  if (line.type === "assistant") {
99
125
  const message = line.message;
@@ -119,21 +145,70 @@ export function extractClaudeClarifications(lines) {
119
145
  if (!message?.content)
120
146
  continue;
121
147
  for (const block of message.content) {
122
- if (block.type === "tool_result" && block.tool_use_id) {
123
- const question = questionMap.get(block.tool_use_id);
124
- if (!question)
125
- continue;
126
- const answer = typeof block.content === "string"
127
- ? block.content
128
- : JSON.stringify(block.content);
129
- clarifications.push({ question, answer });
130
- questionMap.delete(block.tool_use_id);
131
- }
148
+ if (block.type !== "tool_result" || !block.tool_use_id)
149
+ continue;
150
+ const question = questionMap.get(block.tool_use_id);
151
+ if (!question)
152
+ continue;
153
+ const structured = extractStructuredClarifications(line.toolUseResult, block.tool_use_id, question);
154
+ clarifications.push(...structured);
155
+ questionMap.delete(block.tool_use_id);
132
156
  }
133
157
  }
134
158
  }
135
159
  return clarifications;
136
160
  }
161
+ /**
162
+ * Parse a Claude `toolUseResult` payload into per-sub-question
163
+ * `UserClarification` entries. Throws `ClaudeQACaptureError` with a
164
+ * specific reason when the payload is missing or malformed.
165
+ */
166
+ function extractStructuredClarifications(toolUseResult, toolUseId, joinedQuestion) {
167
+ const ctx = `tool_use_id=${toolUseId} question="${joinedQuestion}"`;
168
+ if (toolUseResult === undefined || toolUseResult === null) {
169
+ throw new ClaudeQACaptureError(`toolUseResult missing (${ctx})`);
170
+ }
171
+ if (typeof toolUseResult !== "object") {
172
+ throw new ClaudeQACaptureError(`toolUseResult is not an object (${ctx})`);
173
+ }
174
+ const tur = toolUseResult;
175
+ if (!Array.isArray(tur.questions) || tur.questions.length === 0) {
176
+ throw new ClaudeQACaptureError(`questions field is not a non-empty array (${ctx})`);
177
+ }
178
+ if (!tur.answers || typeof tur.answers !== "object" || Array.isArray(tur.answers)) {
179
+ throw new ClaudeQACaptureError(`answers field is not a non-array object (${ctx})`);
180
+ }
181
+ const answers = tur.answers;
182
+ const annotations = (tur.annotations && typeof tur.annotations === "object" && !Array.isArray(tur.annotations))
183
+ ? tur.annotations
184
+ : undefined;
185
+ const questions = tur.questions;
186
+ const out = [];
187
+ for (let i = 0; i < questions.length; i++) {
188
+ const q = questions[i];
189
+ if (!q || typeof q !== "object") {
190
+ throw new ClaudeQACaptureError(`questions[${i}] is not an object (${ctx})`);
191
+ }
192
+ const questionText = q.question;
193
+ if (typeof questionText !== "string") {
194
+ throw new ClaudeQACaptureError(`questions[${i}].question is not a string (${ctx})`);
195
+ }
196
+ const answer = answers[questionText];
197
+ if (typeof answer !== "string") {
198
+ throw new ClaudeQACaptureError(`answers["${questionText}"] is not a string (${ctx})`);
199
+ }
200
+ const entry = { question: questionText, answer };
201
+ const annotation = annotations?.[questionText];
202
+ if (annotation && typeof annotation === "object") {
203
+ const preview = annotation.preview;
204
+ if (typeof preview === "string" && preview.length > 0) {
205
+ entry.preview = preview;
206
+ }
207
+ }
208
+ out.push(entry);
209
+ }
210
+ return out;
211
+ }
137
212
  /**
138
213
  * Claude session handler.
139
214
  *
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/providers/claude/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,eAAe,EAAoB,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAGlC;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,OAAO,GAAG,CAAC,OAAO,CAAC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CAAC;IAC3F,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,eAAuB,EACvB,UAAkB;QAElB,OAAO,yBAAyB,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC;IACzF,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,eAAuB,EAAE,UAAkB;QACpE,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,eAAe,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;CACF"}
@@ -1,5 +1,4 @@
1
- import type { PlanModeConfig, ProviderStrategy, SessionHandler, BuildArgsOpts } from "../types.js";
2
- import { ClaudeCompletionStrategy } from "./completion.js";
1
+ import type { PlanModeConfig, ProviderStrategy, SessionHandler, BuildArgsOpts, CompletionDetector } from "../types.js";
3
2
  export declare class ClaudeStrategy implements ProviderStrategy {
4
3
  readonly name = "claude";
5
4
  readonly displayName = "Claude Code";
@@ -9,6 +8,8 @@ export declare class ClaudeStrategy implements ProviderStrategy {
9
8
  version: string | undefined;
10
9
  get planMode(): PlanModeConfig;
11
10
  buildArgs(prompt: string, opts: BuildArgsOpts): Promise<string[]>;
12
- createDetector(): ClaudeCompletionStrategy;
11
+ createDetector(opts?: {
12
+ planMode?: boolean;
13
+ }): CompletionDetector;
13
14
  }
14
15
  //# sourceMappingURL=strategy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../../src/providers/claude/strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,qBAAa,cAAe,YAAW,gBAAgB;IACrD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,iBAAiB;IACrC,QAAQ,CAAC,OAAO,YAAY;IAC5B,QAAQ,CAAC,UAAU,aAAa;IAChC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAA8B;IAC9D,OAAO,EAAE,MAAM,GAAG,SAAS,CAAa;IAExC,IAAI,QAAQ,IAAI,cAAc,CAO7B;IAEK,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAcvE,cAAc,IAAI,wBAAwB;CAO3C"}
1
+ {"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../../src/providers/claude/strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAOvH,qBAAa,cAAe,YAAW,gBAAgB;IACrD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,iBAAiB;IACrC,QAAQ,CAAC,OAAO,YAAY;IAC5B,QAAQ,CAAC,UAAU,aAAa;IAChC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAA8B;IAC9D,OAAO,EAAE,MAAM,GAAG,SAAS,CAAa;IAExC,IAAI,QAAQ,IAAI,cAAc,CAO7B;IAEK,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAcvE,cAAc,CAAC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,kBAAkB;CAalE"}
@@ -1,6 +1,7 @@
1
1
  import { flagIf } from "../types.js";
2
2
  import { versionGte } from "../version.js";
3
- import { ClaudeCompletionStrategy } from "./completion.js";
3
+ import { ClaudePrimaryDetector } from "./completion.js";
4
+ import { ClaudePlanModeDetector } from "./completion-plan-mode.js";
4
5
  import { ClaudeSessionHandler } from "./session.js";
5
6
  export class ClaudeStrategy {
6
7
  name = "claude";
@@ -31,12 +32,12 @@ export class ClaudeStrategy {
31
32
  args.push(prompt);
32
33
  return args;
33
34
  }
34
- createDetector() {
35
- // staleFallbackMs = 15s: only armed once the narrow prefetch pattern
36
- // (plan-file Write + ToolSearch(select:ExitPlanMode)) has been observed,
37
- // so false positives during extended thinking are impossible by
38
- // construction — see ClaudeCompletionStrategy.isStaleFallbackReady.
39
- return new ClaudeCompletionStrategy(200, 500, this.planMode.exitToolName, 15_000);
35
+ createDetector(opts) {
36
+ const useNativePlanMode = opts?.planMode === true && this.planMode.nativePlanFile === true;
37
+ if (useNativePlanMode) {
38
+ return new ClaudePlanModeDetector(200, 500, this.planMode.exitToolName, 30_000);
39
+ }
40
+ return new ClaudePrimaryDetector(200, 500);
40
41
  }
41
42
  }
42
43
  //# sourceMappingURL=strategy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../../src/providers/claude/strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,OAAO,cAAc;IAChB,IAAI,GAAG,QAAQ,CAAC;IAChB,WAAW,GAAG,aAAa,CAAC;IAC5B,OAAO,GAAG,QAAQ,CAAC;IACnB,UAAU,GAAG,SAAS,CAAC;IACvB,OAAO,GAAmB,IAAI,oBAAoB,EAAE,CAAC;IAC9D,OAAO,GAAuB,SAAS,CAAC;IAExC,IAAI,QAAQ;QACV,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAClD,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,yBAAyB;YAC3D,YAAY,EAAE,cAAc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