@namzu/sdk 52.0.0 → 52.2.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 (157) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +1 -1
  3. package/dist/compaction/verifier.d.ts.map +1 -1
  4. package/dist/compaction/verifier.js +57 -17
  5. package/dist/compaction/verifier.js.map +1 -1
  6. package/dist/connector/tools/adapter.d.ts +2 -2
  7. package/dist/contracts/a2a.d.ts +94 -94
  8. package/dist/manager/resident/learning.d.ts +6 -6
  9. package/dist/manager/resident/store.d.ts +4 -4
  10. package/dist/pals/activity/subscription-schema.d.ts +48 -48
  11. package/dist/pals/communication/ingress-schema.d.ts +192 -192
  12. package/dist/pals/communication/schema.d.ts +18 -18
  13. package/dist/peers/protocol.d.ts +36 -36
  14. package/dist/provider/capabilities.d.ts +9 -0
  15. package/dist/provider/capabilities.d.ts.map +1 -1
  16. package/dist/provider/capabilities.js +15 -0
  17. package/dist/provider/capabilities.js.map +1 -1
  18. package/dist/provider/errors.d.ts.map +1 -1
  19. package/dist/provider/errors.js +13 -0
  20. package/dist/provider/errors.js.map +1 -1
  21. package/dist/provider/fallback.d.ts.map +1 -1
  22. package/dist/provider/fallback.js +10 -0
  23. package/dist/provider/fallback.js.map +1 -1
  24. package/dist/provider/idle-timeout.d.ts.map +1 -1
  25. package/dist/provider/idle-timeout.js +5 -0
  26. package/dist/provider/idle-timeout.js.map +1 -1
  27. package/dist/provider/image-input-refusal.d.ts +9 -0
  28. package/dist/provider/image-input-refusal.d.ts.map +1 -0
  29. package/dist/provider/image-input-refusal.js +54 -0
  30. package/dist/provider/image-input-refusal.js.map +1 -0
  31. package/dist/provider/index.d.ts +2 -1
  32. package/dist/provider/index.d.ts.map +1 -1
  33. package/dist/provider/index.js +2 -1
  34. package/dist/provider/index.js.map +1 -1
  35. package/dist/provider/retry.d.ts +7 -2
  36. package/dist/provider/retry.d.ts.map +1 -1
  37. package/dist/provider/retry.js +38 -4
  38. package/dist/provider/retry.js.map +1 -1
  39. package/dist/public-runtime.d.ts +2 -1
  40. package/dist/public-runtime.d.ts.map +1 -1
  41. package/dist/public-runtime.js +1 -1
  42. package/dist/public-runtime.js.map +1 -1
  43. package/dist/public-tools.d.ts +1 -0
  44. package/dist/public-tools.d.ts.map +1 -1
  45. package/dist/public-tools.js +1 -0
  46. package/dist/public-tools.js.map +1 -1
  47. package/dist/runtime/query/deferred-sandbox.d.ts +54 -0
  48. package/dist/runtime/query/deferred-sandbox.d.ts.map +1 -0
  49. package/dist/runtime/query/deferred-sandbox.js +75 -0
  50. package/dist/runtime/query/deferred-sandbox.js.map +1 -0
  51. package/dist/runtime/query/executor.d.ts +11 -0
  52. package/dist/runtime/query/executor.d.ts.map +1 -1
  53. package/dist/runtime/query/executor.js +25 -3
  54. package/dist/runtime/query/executor.js.map +1 -1
  55. package/dist/runtime/query/index.d.ts +2 -0
  56. package/dist/runtime/query/index.d.ts.map +1 -1
  57. package/dist/runtime/query/index.js +94 -25
  58. package/dist/runtime/query/index.js.map +1 -1
  59. package/dist/runtime/query/iteration/index.d.ts +26 -0
  60. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  61. package/dist/runtime/query/iteration/index.js +164 -21
  62. package/dist/runtime/query/iteration/index.js.map +1 -1
  63. package/dist/runtime/query/iteration/phases/compaction-breaker.d.ts +10 -7
  64. package/dist/runtime/query/iteration/phases/compaction-breaker.d.ts.map +1 -1
  65. package/dist/runtime/query/iteration/phases/compaction-breaker.js +10 -7
  66. package/dist/runtime/query/iteration/phases/compaction-breaker.js.map +1 -1
  67. package/dist/runtime/query/iteration/phases/compaction.d.ts +42 -1
  68. package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
  69. package/dist/runtime/query/iteration/phases/compaction.js +119 -21
  70. package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
  71. package/dist/runtime/query/iteration/provider-rejected-image.d.ts +21 -1
  72. package/dist/runtime/query/iteration/provider-rejected-image.d.ts.map +1 -1
  73. package/dist/runtime/query/iteration/provider-rejected-image.js +53 -7
  74. package/dist/runtime/query/iteration/provider-rejected-image.js.map +1 -1
  75. package/dist/runtime/query/iteration/request-repair.d.ts +108 -0
  76. package/dist/runtime/query/iteration/request-repair.d.ts.map +1 -0
  77. package/dist/runtime/query/iteration/request-repair.js +593 -0
  78. package/dist/runtime/query/iteration/request-repair.js.map +1 -0
  79. package/dist/runtime/query/iteration/stream-turn.d.ts +6 -0
  80. package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
  81. package/dist/runtime/query/iteration/stream-turn.js +2 -2
  82. package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
  83. package/dist/runtime/query/request-rich-content.d.ts +5 -1
  84. package/dist/runtime/query/request-rich-content.d.ts.map +1 -1
  85. package/dist/runtime/query/request-rich-content.js +67 -25
  86. package/dist/runtime/query/request-rich-content.js.map +1 -1
  87. package/dist/runtime/query/tooling.d.ts +1 -0
  88. package/dist/runtime/query/tooling.d.ts.map +1 -1
  89. package/dist/runtime/query/tooling.js +1 -0
  90. package/dist/runtime/query/tooling.js.map +1 -1
  91. package/dist/tools/builtins/browser.d.ts +4 -4
  92. package/dist/tools/builtins/code-analysis.d.ts +49 -0
  93. package/dist/tools/builtins/code-analysis.d.ts.map +1 -0
  94. package/dist/tools/builtins/code-analysis.js +409 -0
  95. package/dist/tools/builtins/code-analysis.js.map +1 -0
  96. package/dist/tools/builtins/computer-use.d.ts +25 -25
  97. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  98. package/dist/tools/builtins/computer-use.js +12 -5
  99. package/dist/tools/builtins/computer-use.js.map +1 -1
  100. package/dist/tools/builtins/index.d.ts +1 -0
  101. package/dist/tools/builtins/index.d.ts.map +1 -1
  102. package/dist/tools/builtins/index.js +1 -0
  103. package/dist/tools/builtins/index.js.map +1 -1
  104. package/dist/tools/builtins/lsp.d.ts +1 -1
  105. package/dist/tools/builtins/skill.d.ts +2 -2
  106. package/dist/types/code-analysis/index.d.ts +299 -0
  107. package/dist/types/code-analysis/index.d.ts.map +1 -0
  108. package/dist/types/code-analysis/index.js +30 -0
  109. package/dist/types/code-analysis/index.js.map +1 -0
  110. package/dist/types/plugin/index.d.ts +6 -6
  111. package/dist/types/provider/errors.d.ts.map +1 -1
  112. package/dist/types/provider/errors.js +30 -5
  113. package/dist/types/provider/errors.js.map +1 -1
  114. package/dist/types/provider/interface.d.ts +12 -0
  115. package/dist/types/provider/interface.d.ts.map +1 -1
  116. package/dist/types/provider/stream.d.ts +1 -1
  117. package/dist/types/session/config.d.ts +14 -0
  118. package/dist/types/session/config.d.ts.map +1 -1
  119. package/dist/types/session/events.d.ts +20 -5
  120. package/dist/types/session/events.d.ts.map +1 -1
  121. package/dist/types/session/events.js.map +1 -1
  122. package/dist/types/session/records.d.ts +127 -127
  123. package/dist/types/tool/index.d.ts +9 -0
  124. package/dist/types/tool/index.d.ts.map +1 -1
  125. package/dist/types/tool/index.js.map +1 -1
  126. package/package.json +2 -2
  127. package/src/compaction/verifier.ts +57 -20
  128. package/src/provider/capabilities.ts +17 -0
  129. package/src/provider/errors.ts +13 -0
  130. package/src/provider/fallback.ts +10 -0
  131. package/src/provider/idle-timeout.ts +5 -0
  132. package/src/provider/image-input-refusal.ts +54 -0
  133. package/src/provider/index.ts +2 -0
  134. package/src/provider/retry.ts +42 -4
  135. package/src/public-runtime.ts +28 -0
  136. package/src/public-tools.ts +5 -0
  137. package/src/runtime/query/deferred-sandbox.ts +110 -0
  138. package/src/runtime/query/executor.ts +27 -3
  139. package/src/runtime/query/index.ts +127 -49
  140. package/src/runtime/query/iteration/index.ts +188 -23
  141. package/src/runtime/query/iteration/phases/compaction-breaker.ts +10 -8
  142. package/src/runtime/query/iteration/phases/compaction.ts +151 -35
  143. package/src/runtime/query/iteration/provider-rejected-image.ts +71 -5
  144. package/src/runtime/query/iteration/request-repair.ts +743 -0
  145. package/src/runtime/query/iteration/stream-turn.ts +11 -1
  146. package/src/runtime/query/request-rich-content.ts +77 -27
  147. package/src/runtime/query/tooling.ts +2 -0
  148. package/src/tools/builtins/code-analysis.ts +486 -0
  149. package/src/tools/builtins/computer-use.ts +13 -4
  150. package/src/tools/builtins/index.ts +5 -0
  151. package/src/types/code-analysis/index.ts +325 -0
  152. package/src/types/provider/errors.ts +33 -5
  153. package/src/types/provider/interface.ts +13 -0
  154. package/src/types/provider/stream.ts +1 -1
  155. package/src/types/session/config.ts +14 -0
  156. package/src/types/session/events.ts +25 -5
  157. package/src/types/tool/index.ts +9 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 52.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1fde185: Add the `code_analysis` tool and the `CodeAnalysisProvider` interface it calls. Nothing changes for a host that does not opt in: the tool is not part of `getBuiltinTools()` and is registered only when a host passes a provider (`getCodeAnalysisTools(provider)`, with `QueryParams.codeAnalysis` / `ToolContext.codeAnalysis` carrying it into the turn). The tool answers cited, paged lookups over a JavaScript/TypeScript index: `index`, `find_literal`, `enclosing_function`, `function_source`, `callers_of` and `imports`. Every result says what was observed, what was inferred (a callee matched by text, not by scope) and whether coverage is complete. Every provider call takes an optional `signal`, which the tool fills from the turn's abort signal so Esc stops an index; `IndexRequest.scope` indexes part of a root, and `IndexSummary.truncated` says when a call stopped at a limit and what to do next. Hits and call sites carry `stale: 'changed' | 'deleted'` when their file no longer matches the index. Paths go through the same resolver and review route as `read`, and a sandboxed turn is refused because the index reads the host file system. To use it, construct a provider (`@namzu/analysis` ships one) and pass it as `codeAnalysis` to `query()`; mount the tool with `deferred(toolset(...))` to keep its roughly 1,000-token schema out of requests that never need it.
8
+
9
+ ### Patch Changes
10
+
11
+ - 791f431: The package description and README now call `@namzu/sdk` an AI kernel that runs an agent the way an operating system runs a process, and the terminal app's README no longer leads with "asks before it acts". Wording only; nothing to do to take this.
12
+
13
+ ## 52.1.0
14
+
15
+ ### Minor Changes
16
+
17
+ - dac0dd7: A context overflow now recovers in up to two reactive compactions instead of one: if the first relief sheds too little or the retry still overflows, a deeper pass keeps only the newest round-group verbatim (when three or more remain) and clears oversized tool results even inside the recent window. A 400, 413 or statusless failure saying the request is larger than or exceeds the "context window", or "input length and `max_tokens` exceed context limit" is now filed as a context overflow instead of an invalid request, so it reaches compaction. A failed `llmVerification` summary call no longer replaces the overflow as the turn's error; the pass uses the extracted state, and its own overflow is retried with less of the excerpt. When the ladder is spent and compaction errored, the thrown error's message ends in ` · automatic compaction failed: <cause>`.
18
+
19
+ Nothing to change for callers. With `compactionConfig.circuitBreaker`, the `compaction_failed` event with `cause: 'breaker_open'` no longer carries an `error` line (the cause stays in the union), and the refill breaker's `error` text no longer suggests `/clear`. A host that showed the `breaker_open` line should stop showing it: it only stops proactive compaction, and a real overflow still gets relief. The turn's stop reasons and settlement are unchanged.
20
+
21
+ With `compactionConfig.circuitBreaker: true`, a new way for a turn to end: a context overflow relief (including one that only cleared tool results) now counts toward the refill limit when it follows the previous compaction within three iterations. The third such overflow in a row stops the turn with stop reason `error`, the refill line as `lastError`, and a `compaction_failed` event with `cause: 'refilling'`; before, a tool that refilled the window on every call was cleared and called again until the cleared placeholders filled the window (61 provider calls in one measured case, now 8). Hosts that already handle the refill stop need no change; a host that relied on such a loop running on should not set `circuitBreaker`.
22
+
23
+ - dac0dd7: A request the provider rejects as invalid (a 400 that is not a context overflow) is now repaired and resent where the rejection names something fixable, instead of ending the turn. Nothing breaks and nothing needs changing: a turn that used to fail with `bad_request` can now complete. Tool pairing is repaired before each model call, rejected reasoning blocks are stripped, a refused `effort`, `thinking`, `temperature`, `topP` or `responseFormat` is dropped for that provider and model for the rest of the run, and rejected images or documents are replaced by a text note in the outgoing request (the stored conversation keeps them). Because a refused parameter is now dropped rather than failing, a host that relied on that failure to notice an unsupported setting should read it from the debug log. Nothing is remembered for the run unless a resend without it was accepted. `capability_warning.contentSource` gains `'media-removed'`, `'media-removed-current'` and `'media-limit'`: a switch over it that assumed `'tool-result'` or `'history'` needs a default arm.
24
+ - dac0dd7: `turnConfig.sandbox.acquire` chooses when a turn acquires its sandbox: `'eager'` (the default, and what every sandboxed turn did before), `'concurrent'`, or `'on-first-use'`. With `'concurrent'` the first model request no longer waits for the provider to allocate; the first tool batch does, bounded by the turn timeout and cancelled by the abort signal. With `'on-first-use'` nothing is allocated until a tool call needs it. A failed or timed-out acquisition ends the turn with the stop reason an eager one gives, at the first tool call or at turn end, and `sandbox_created` is emitted when the handle arrives, so with `'concurrent'` it can follow the start of the first model response. Nothing changes unless you set the option. An unknown `acquire` value fails the turn with `invalid_config`, with or without a sandbox provider. A deferred acquisition that is cancelled or times out is recorded as a `cancelled` step rather than an `error` one.
25
+ - dac0dd7: A conversation that holds an image no longer dies on a model that cannot read one. Nothing breaks and nothing needs changing: where the old behaviour was a hard provider refusal, the request now goes out with each image replaced by a short text note (the stored history keeps the bytes). New optional `LLMProvider.supportsImageInputFor(model)`, `modelReadsImages(provider, model)`, `isImageInputRefusal` and `isImageInputRefusalMessage`; a provider that answers a request holding images with "text input only" or "does not support images" is retried once without them and a `capability_warning` with `contentSource: 'history'` and `model` is emitted. `computerUseUnavailableReason` takes an optional model, and `capability_warning.contentSource` gains `'history'`: a switch over it that assumed only `'tool-result'` needs a default arm.
26
+
27
+ ### Patch Changes
28
+
29
+ - dac0dd7: `classifyProviderError` now classifies undici's `TypeError: terminated` (a response body the peer cut mid-stream) as `network` wherever it sits on the cause chain. Before, it was `unknown` and so not retried whenever a vendor SDK had dropped the socket error that normally travels with it as the cause. Such a cut is now retried with the usual backoff and `provider_retry` notice instead of ending the turn. A plain `Error('terminated')` is unaffected. Nothing to do to take this.
30
+ - dac0dd7: A model call whose stream was cut (a connection reset, `terminated`) after sending only reasoning, and before any text or tool call, is now retried like a failure before the first chunk, with the same backoff and `provider_retry` notice. Before, it failed the turn. The notice carries `restart: true`, so a host that showed the thinking drops it; the turn already replaces it, so the answer holds the second attempt's reasoning once. Nothing to do to take this: it needs no option, and `retryMidStream` still governs only a stream that had produced text. A stream that had begun a tool call is still never retried. A caller that relied on a reasoning-only cut surfacing as an error on the first failure will now see one or more `provider_retry` notices before the error.
31
+
3
32
  ## 52.0.0
4
33
 
5
34
  ### Major Changes
package/README.md CHANGED
@@ -176,7 +176,7 @@ Your tools and `runAgent` call stay the same when you change the driver.
176
176
  | `@namzu/openrouter` | Many hosted models behind one key |
177
177
  | `@namzu/zen` | Hosted models with native protocol routing |
178
178
  | `@namzu/ollama` | Local models, no key needed |
179
- | `@namzu/lmstudio` | Local models through a local model server, with tool use |
179
+ | `@namzu/lmstudio` | Local models through a local model server, chat only (no tool use) |
180
180
  | `@namzu/http` | Zero-dependency driver for compatible HTTP endpoints |
181
181
 
182
182
  Every driver registers through `ProviderRegistry`. For per-model rates and
@@ -1 +1 @@
1
- {"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../src/compaction/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAsC,MAAM,2BAA2B,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAsGvD;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;AAEnD,8EAA8E;AAC9E,MAAM,WAAW,6BAA6B;IAC7C,kFAAkF;IAClF,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,+EAA+E;AAC/E,eAAO,MAAM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AAA;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,+EAA+E;AAC/E,eAAO,MAAM,iCAAiC,OAAQ,CAAA;AAWtD,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,OAAO,EAAE,EACxB,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,SAAS;AACnB;;;;;;GAMG;AACH,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,GAAE,6BAAkC,GACzC,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;;;;GAKG;AACH,wBAAsB,uCAAuC,CAC5D,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,OAAO,EAAE,EACxB,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,WAAW,EACpB,YAAY,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CAYjB"}
@@ -1,5 +1,6 @@
1
1
  import { collectChatCompletion } from '../provider/collect-chat-completion.js';
2
2
  import { resolveStreamIdleTimeoutMs, withStreamIdleTimeout } from '../provider/idle-timeout.js';
3
+ import { classifyProviderError } from '../types/provider/errors.js';
3
4
  import { serializeState } from './serializer.js';
4
5
  const VERIFICATION_PROMPT = `You are a context compaction verifier. You are given a structured state summary extracted from a conversation, plus a truncated excerpt of the older conversation that was summarized.
5
6
 
@@ -78,6 +79,21 @@ function* conversationExcerpt(messages) {
78
79
  }
79
80
  }
80
81
  }
82
+ /** Verifier requests dropped to a shorter excerpt before the extracted state stands alone. */
83
+ const MAX_VERIFIER_HEAD_TRUNCATIONS = 3;
84
+ /** What stands where the older half of a verifier excerpt was cut. */
85
+ const EXCERPT_TRUNCATED_PLACEHOLDER = '[earlier conversation truncated for compaction retry]';
86
+ /** Drop the older half of an excerpt, keeping the newer half behind a placeholder. */
87
+ function truncateExcerptHead(excerpt) {
88
+ const body = excerpt.startsWith(EXCERPT_TRUNCATED_PLACEHOLDER)
89
+ ? excerpt.slice(EXCERPT_TRUNCATED_PLACEHOLDER.length).trimStart()
90
+ : excerpt;
91
+ let kept = body.slice(Math.floor(body.length / 2));
92
+ const first = kept.charCodeAt(0);
93
+ if (first >= 0xdc00 && first <= 0xdfff)
94
+ kept = kept.slice(1);
95
+ return `${EXCERPT_TRUNCATED_PLACEHOLDER}\n\n${kept}`;
96
+ }
81
97
  function truncateMessages(messages, budget) {
82
98
  if (budget <= 0)
83
99
  return '';
@@ -149,23 +165,47 @@ async function buildVerifiedSummaryWithProvider(manager, olderMessages, provider
149
165
  if (!conversationExcerpt.trim()) {
150
166
  return serialized;
151
167
  }
152
- const verificationMessages = [
153
- {
154
- role: 'system',
155
- content: withInstructions(VERIFICATION_PROMPT, instructions),
156
- },
157
- {
158
- role: 'user',
159
- content: `## Structured State\n\n${serialized}\n\n## Conversation Excerpt\n\n${conversationExcerpt}`,
160
- },
161
- ];
162
- const response = await collectChatCompletion(provider.chatStream({
163
- model: model ?? '',
164
- messages: verificationMessages,
165
- maxTokens: config.llmVerificationMaxTokens,
166
- temperature: 0,
167
- ...(signal ? { signal } : {}),
168
- }));
168
+ // The verifier's own request can overflow a small window. The reference
169
+ // terminal answers that with a ladder: send less, and when nothing is left to
170
+ // cut, work from everything it already has. Here "less" is the older half of
171
+ // the excerpt dropped behind a placeholder, at most three times, and
172
+ // "everything it already has" is the extracted state, which the verifier only
173
+ // ever adds to.
174
+ let excerpt = conversationExcerpt;
175
+ let truncations = 0;
176
+ let response;
177
+ for (;;) {
178
+ const verificationMessages = [
179
+ {
180
+ role: 'system',
181
+ content: withInstructions(VERIFICATION_PROMPT, instructions),
182
+ },
183
+ {
184
+ role: 'user',
185
+ content: `## Structured State\n\n${serialized}\n\n## Conversation Excerpt\n\n${excerpt}`,
186
+ },
187
+ ];
188
+ try {
189
+ response = await collectChatCompletion(provider.chatStream({
190
+ model: model ?? '',
191
+ messages: verificationMessages,
192
+ maxTokens: config.llmVerificationMaxTokens,
193
+ temperature: 0,
194
+ ...(signal ? { signal } : {}),
195
+ }));
196
+ break;
197
+ }
198
+ catch (error) {
199
+ if (signal?.aborted)
200
+ throw error;
201
+ if (classifyProviderError(error).code !== 'context_length_exceeded')
202
+ throw error;
203
+ if (truncations >= MAX_VERIFIER_HEAD_TRUNCATIONS)
204
+ return serialized;
205
+ truncations++;
206
+ excerpt = truncateExcerptHead(excerpt);
207
+ }
208
+ }
169
209
  onUsage?.(response.usage);
170
210
  const responseText = response.message.content?.trim() ?? '';
171
211
  // `COMPLETE` is the verifier saying it found nothing to add. An EMPTY reply
@@ -1 +1 @@
1
- {"version":3,"file":"verifier.js","sourceRoot":"","sources":["../../src/compaction/verifier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAK/F,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,mBAAmB,GAAG;;;;;;;;;;;2KAW+I,CAAA;AAE3K,QAAQ,CAAC,CAAC,iBAAiB,CAC1B,UAA0E;IAE1E,MAAM,IAAI,GACT,UAAU,CAAC,IAAI,KAAK,QAAQ;QAC3B,CAAC,CAAC,UAAU,CAAC,IAAI;QACjB,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,UAAU;YAC/B,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,OAAO,CAAA;IACZ,MAAM,IAAI,IAAI,EAAE,CAAA;IAChB,IAAI,MAAM,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAA;QACV,MAAM,UAAU,CAAC,IAAI,CAAA;QACrB,MAAM,GAAG,CAAA;IACV,CAAC;IACD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B,CAAC;IAED,OAAO,GAAG,UAAU,wCAAwC,YAAY,EAAE,CAAA;AAC3E,CAAC"}
@@ -12,14 +12,14 @@ declare const ConnectorRouterInputSchema: z.ZodObject<{
12
12
  method: z.ZodString;
13
13
  input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
14
14
  }, "strip", z.ZodTypeAny, {
15
+ method: string;
15
16
  input: Record<string, unknown>;
16
17
  instanceId: string;
17
- method: string;
18
18
  connectorId: string;
19
19
  }, {
20
+ method: string;
20
21
  input: Record<string, unknown>;
21
22
  instanceId: string;
22
- method: string;
23
23
  connectorId: string;
24
24
  }>;
25
25
  export type ConnectorRouterInput = z.infer<typeof ConnectorRouterInputSchema>;