@jini-ai/agent-runtime 0.2.1 → 0.3.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.
- package/README.md +2 -2
- package/dist/agent-protocol/acp/session.d.ts +206 -1
- package/dist/agent-protocol/acp/session.d.ts.map +1 -1
- package/dist/agent-protocol/acp/session.js +505 -350
- package/dist/agent-protocol/acp/session.js.map +1 -1
- package/dist/agent-protocol/core/json-line-stream.d.ts +53 -0
- package/dist/agent-protocol/core/json-line-stream.d.ts.map +1 -1
- package/dist/agent-protocol/core/json-line-stream.js +307 -255
- package/dist/agent-protocol/core/json-line-stream.js.map +1 -1
- package/dist/agent-protocol/pi-rpc/events.d.ts +22 -1
- package/dist/agent-protocol/pi-rpc/events.d.ts.map +1 -1
- package/dist/agent-protocol/pi-rpc/events.js +189 -153
- package/dist/agent-protocol/pi-rpc/events.js.map +1 -1
- package/dist/agent-protocol/pi-rpc/session.d.ts +39 -0
- package/dist/agent-protocol/pi-rpc/session.d.ts.map +1 -1
- package/dist/agent-protocol/pi-rpc/session.js +143 -107
- package/dist/agent-protocol/pi-rpc/session.js.map +1 -1
- package/dist/claude-stream.d.ts +64 -1
- package/dist/claude-stream.d.ts.map +1 -1
- package/dist/claude-stream.js +568 -441
- package/dist/claude-stream.js.map +1 -1
- package/dist/defs/aider.d.ts.map +1 -1
- package/dist/defs/aider.js +13 -1
- package/dist/defs/aider.js.map +1 -1
- package/dist/defs/amp.d.ts.map +1 -1
- package/dist/defs/amp.js +16 -1
- package/dist/defs/amp.js.map +1 -1
- package/dist/defs/amr.d.ts +2 -1
- package/dist/defs/amr.d.ts.map +1 -1
- package/dist/defs/amr.js +12 -1
- package/dist/defs/amr.js.map +1 -1
- package/dist/defs/antigravity.d.ts +41 -2
- package/dist/defs/antigravity.d.ts.map +1 -1
- package/dist/defs/antigravity.js +201 -22
- package/dist/defs/antigravity.js.map +1 -1
- package/dist/defs/claude.d.ts +2 -0
- package/dist/defs/claude.d.ts.map +1 -1
- package/dist/defs/claude.js +58 -3
- package/dist/defs/claude.js.map +1 -1
- package/dist/defs/codebuddy.d.ts.map +1 -1
- package/dist/defs/codebuddy.js +9 -1
- package/dist/defs/codebuddy.js.map +1 -1
- package/dist/defs/codex.d.ts +1 -0
- package/dist/defs/codex.d.ts.map +1 -1
- package/dist/defs/codex.js +34 -0
- package/dist/defs/codex.js.map +1 -1
- package/dist/defs/copilot.d.ts.map +1 -1
- package/dist/defs/copilot.js +15 -1
- package/dist/defs/copilot.js.map +1 -1
- package/dist/defs/cursor-agent.d.ts.map +1 -1
- package/dist/defs/cursor-agent.js +24 -2
- package/dist/defs/cursor-agent.js.map +1 -1
- package/dist/defs/deepseek.d.ts.map +1 -1
- package/dist/defs/deepseek.js +12 -0
- package/dist/defs/deepseek.js.map +1 -1
- package/dist/defs/devin.d.ts +2 -1
- package/dist/defs/devin.d.ts.map +1 -1
- package/dist/defs/devin.js +12 -7
- package/dist/defs/devin.js.map +1 -1
- package/dist/defs/grok-build.d.ts.map +1 -1
- package/dist/defs/grok-build.js +10 -0
- package/dist/defs/grok-build.js.map +1 -1
- package/dist/defs/hermes.d.ts +1 -0
- package/dist/defs/hermes.d.ts.map +1 -1
- package/dist/defs/hermes.js +3 -0
- package/dist/defs/hermes.js.map +1 -1
- package/dist/defs/kilo.d.ts +1 -0
- package/dist/defs/kilo.d.ts.map +1 -1
- package/dist/defs/kilo.js +3 -0
- package/dist/defs/kilo.js.map +1 -1
- package/dist/defs/kimi.d.ts +1 -0
- package/dist/defs/kimi.d.ts.map +1 -1
- package/dist/defs/kimi.js +3 -0
- package/dist/defs/kimi.js.map +1 -1
- package/dist/defs/kiro.d.ts +1 -0
- package/dist/defs/kiro.d.ts.map +1 -1
- package/dist/defs/kiro.js +3 -0
- package/dist/defs/kiro.js.map +1 -1
- package/dist/defs/pi.d.ts +1 -1
- package/dist/defs/pi.d.ts.map +1 -1
- package/dist/defs/pi.js +6 -1
- package/dist/defs/pi.js.map +1 -1
- package/dist/defs/qoder.d.ts +1 -0
- package/dist/defs/qoder.d.ts.map +1 -1
- package/dist/defs/qoder.js +15 -0
- package/dist/defs/qoder.js.map +1 -1
- package/dist/defs/qwen.d.ts.map +1 -1
- package/dist/defs/qwen.js +9 -0
- package/dist/defs/qwen.js.map +1 -1
- package/dist/defs/reasonix.d.ts +1 -0
- package/dist/defs/reasonix.d.ts.map +1 -1
- package/dist/defs/reasonix.js +3 -0
- package/dist/defs/reasonix.js.map +1 -1
- package/dist/defs/shared.d.ts +31 -1
- package/dist/defs/shared.d.ts.map +1 -1
- package/dist/defs/shared.js +35 -0
- package/dist/defs/shared.js.map +1 -1
- package/dist/defs/trae-cli.d.ts +1 -0
- package/dist/defs/trae-cli.d.ts.map +1 -1
- package/dist/defs/trae-cli.js +3 -0
- package/dist/defs/trae-cli.js.map +1 -1
- package/dist/defs/vibe.d.ts +1 -0
- package/dist/defs/vibe.d.ts.map +1 -1
- package/dist/defs/vibe.js +3 -0
- package/dist/defs/vibe.js.map +1 -1
- package/dist/detection.d.ts +1 -1
- package/dist/detection.d.ts.map +1 -1
- package/dist/detection.js +7 -2
- package/dist/detection.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/log-file.d.ts +23 -0
- package/dist/log-file.d.ts.map +1 -0
- package/dist/log-file.js +56 -0
- package/dist/log-file.js.map +1 -0
- package/dist/model-registry.d.ts +7 -45
- package/dist/model-registry.d.ts.map +1 -1
- package/dist/model-registry.js.map +1 -1
- package/dist/providers/anthropic-messages.d.ts +198 -6
- package/dist/providers/anthropic-messages.d.ts.map +1 -1
- package/dist/providers/anthropic-messages.js +317 -140
- package/dist/providers/anthropic-messages.js.map +1 -1
- package/dist/providers/azure-chat.d.ts +113 -3
- package/dist/providers/azure-chat.d.ts.map +1 -1
- package/dist/providers/azure-chat.js +114 -21
- package/dist/providers/azure-chat.js.map +1 -1
- package/dist/providers/connection-guard.d.ts +121 -1
- package/dist/providers/connection-guard.d.ts.map +1 -1
- package/dist/providers/connection-guard.js +205 -3
- package/dist/providers/connection-guard.js.map +1 -1
- package/dist/providers/connection-test.d.ts +62 -0
- package/dist/providers/connection-test.d.ts.map +1 -0
- package/dist/providers/connection-test.js +404 -0
- package/dist/providers/connection-test.js.map +1 -0
- package/dist/providers/elevenlabs.d.ts.map +1 -1
- package/dist/providers/elevenlabs.js +3 -2
- package/dist/providers/elevenlabs.js.map +1 -1
- package/dist/providers/google-messages.d.ts +208 -7
- package/dist/providers/google-messages.d.ts.map +1 -1
- package/dist/providers/google-messages.js +331 -105
- package/dist/providers/google-messages.js.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/model-catalog.d.ts.map +1 -1
- package/dist/providers/model-catalog.js +21 -0
- package/dist/providers/model-catalog.js.map +1 -1
- package/dist/providers/ollama-chat.d.ts +190 -1
- package/dist/providers/ollama-chat.d.ts.map +1 -1
- package/dist/providers/ollama-chat.js +319 -110
- package/dist/providers/ollama-chat.js.map +1 -1
- package/dist/providers/openai-chat.d.ts +222 -14
- package/dist/providers/openai-chat.d.ts.map +1 -1
- package/dist/providers/openai-chat.js +377 -128
- package/dist/providers/openai-chat.js.map +1 -1
- package/dist/providers/sse-decode.d.ts +2 -2
- package/dist/providers/sse-decode.js +2 -2
- package/dist/types.d.ts +169 -87
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -4
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
* `role-marker-guard.ts`'s contamination detector, and the
|
|
19
19
|
* "one file per vendor's stream-parsing shape" precedent
|
|
20
20
|
* `claude-stream.ts`/`copilot-stream.ts`/`qoder-stream.ts` already
|
|
21
|
-
* establish) rather than duplicating any of that inside `@jini-ai/http` — see
|
|
21
|
+
* establish) rather than duplicating any of that inside `@jini-ai/http-kit` — see
|
|
22
22
|
* the proposal's "real question: where does provider-specific wire-protocol
|
|
23
23
|
* logic belong?" section for the placement decision this file implements.
|
|
24
24
|
*
|
|
25
25
|
* **Scope for this pass:** the Anthropic Messages API only (native
|
|
26
|
-
* `x-api-key`/`anthropic-version` auth), text + tool-use content
|
|
27
|
-
* and the tool-execution loop. Extended thinking is deliberately out
|
|
28
|
-
* scope — this adapter never sends a `thinking` request parameter, so
|
|
26
|
+
* `x-api-key`/`anthropic-version` auth), text + tool-use + image content
|
|
27
|
+
* blocks, and the tool-execution loop. Extended thinking is deliberately out
|
|
28
|
+
* of scope — this adapter never sends a `thinking` request parameter, so
|
|
29
29
|
* Anthropic never emits `thinking`/`signature_delta` content blocks in the
|
|
30
30
|
* response (per the streaming docs: thinking blocks are opt-in), which
|
|
31
31
|
* means there is nothing to parse. A future pass can add it by following
|
|
@@ -34,6 +34,24 @@
|
|
|
34
34
|
* channel, since thinking content is never re-serialized as a transcript
|
|
35
35
|
* turn boundary).
|
|
36
36
|
*
|
|
37
|
+
* **Image ("vision") support**, added for the vision self-check loop (render
|
|
38
|
+
* the model's own in-progress HTML, screenshot it, hand the PNG back to the
|
|
39
|
+
* model inside a tool result so the next turn sees what it built): the wire
|
|
40
|
+
* shape for `AnthropicImageBlockParam`/`AnthropicBase64ImageSource`/
|
|
41
|
+
* `AnthropicUrlImageSource` is modeled on Anthropic's real, current
|
|
42
|
+
* `ImageBlockParam`/`Base64ImageSource`/`URLImageSource` types
|
|
43
|
+
* (`github.com/anthropics/anthropic-sdk-typescript/blob/main/src/resources/
|
|
44
|
+
* messages/messages.ts`), and the 10 MB base64/4-format size guard below is
|
|
45
|
+
* modeled on the real, current direct-API limits documented at
|
|
46
|
+
* `platform.claude.com/docs/en/build-with-claude/vision#request-limits`
|
|
47
|
+
* (10 MB base64-encoded per image on the direct API; jpeg/png/gif/webp
|
|
48
|
+
* only — the lower 5 MB Bedrock/Google Cloud limit does not apply, since
|
|
49
|
+
* this adapter only ever speaks the direct API). Deliberately narrower than
|
|
50
|
+
* the real API: the real `ToolResultBlockParam.content` union also allows
|
|
51
|
+
* `DocumentBlockParam`/`SearchResultBlockParam`/`ToolReferenceBlockParam`
|
|
52
|
+
* blocks — those are out of scope, since the driving use case only needs
|
|
53
|
+
* text + image.
|
|
54
|
+
*
|
|
37
55
|
* **Two confirmed OD bugs fixed here, not carried forward** (both per the
|
|
38
56
|
* proposal doc above):
|
|
39
57
|
* 1. **Product-identity leak.** OD's OpenRouter branch hardcoded
|
|
@@ -56,7 +74,7 @@
|
|
|
56
74
|
* for the integration-level regression proof.
|
|
57
75
|
*/
|
|
58
76
|
import { createRoleMarkerGuard } from '../role-marker-guard.js';
|
|
59
|
-
import { redactSecrets,
|
|
77
|
+
import { defaultDnsLookup, pinnedFetch, redactSecrets, validateBaseUrlResolved } from './connection-guard.js';
|
|
60
78
|
import { decodeSseStream } from './sse-decode.js';
|
|
61
79
|
import { createTurnEndGuard } from './turn-end-guard.js';
|
|
62
80
|
const DEFAULT_ANTHROPIC_BASE_URL = 'https://api.anthropic.com';
|
|
@@ -65,11 +83,11 @@ const DEFAULT_MAX_TOOL_TURNS = 8;
|
|
|
65
83
|
function isRecord(value) {
|
|
66
84
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
67
85
|
}
|
|
68
|
-
function anthropicRequestUrl(baseUrl) {
|
|
86
|
+
export function anthropicRequestUrl(baseUrl) {
|
|
69
87
|
const base = (baseUrl ?? DEFAULT_ANTHROPIC_BASE_URL).replace(/\/+$/, '');
|
|
70
88
|
return `${base}/v1/messages`;
|
|
71
89
|
}
|
|
72
|
-
function anthropicHeaders(options) {
|
|
90
|
+
export function anthropicHeaders(options) {
|
|
73
91
|
return {
|
|
74
92
|
'content-type': 'application/json',
|
|
75
93
|
'x-api-key': options.apiKey,
|
|
@@ -77,7 +95,7 @@ function anthropicHeaders(options) {
|
|
|
77
95
|
...(options.extraHeaders ?? {}),
|
|
78
96
|
};
|
|
79
97
|
}
|
|
80
|
-
function anthropicRequestBody(options, messages) {
|
|
98
|
+
export function anthropicRequestBody(options, messages) {
|
|
81
99
|
return {
|
|
82
100
|
model: options.model,
|
|
83
101
|
max_tokens: options.maxTokens,
|
|
@@ -88,7 +106,7 @@ function anthropicRequestBody(options, messages) {
|
|
|
88
106
|
...(options.tools && options.tools.length > 0 ? { tools: options.tools } : {}),
|
|
89
107
|
};
|
|
90
108
|
}
|
|
91
|
-
function extractAnthropicErrorDetail(rawText) {
|
|
109
|
+
export function extractAnthropicErrorDetail(rawText) {
|
|
92
110
|
try {
|
|
93
111
|
const parsed = JSON.parse(rawText);
|
|
94
112
|
if (isRecord(parsed) && isRecord(parsed.error) && typeof parsed.error.message === 'string') {
|
|
@@ -100,29 +118,237 @@ function extractAnthropicErrorDetail(rawText) {
|
|
|
100
118
|
}
|
|
101
119
|
return rawText.trim().slice(0, 500);
|
|
102
120
|
}
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
const ANTHROPIC_ALLOWED_IMAGE_MEDIA_TYPES = new Set([
|
|
122
|
+
'image/jpeg',
|
|
123
|
+
'image/png',
|
|
124
|
+
'image/gif',
|
|
125
|
+
'image/webp',
|
|
126
|
+
]);
|
|
127
|
+
/**
|
|
128
|
+
* Direct-API base64 image limit is 10 MB (see module doc's "Image support" section for the
|
|
129
|
+
* verified docs URL). Approximated from the base64 *string* length rather than decoded byte
|
|
130
|
+
* count — that string is what actually crosses the wire, and checking its length is O(1) with no
|
|
131
|
+
* decode step, at the cost of a small (~1 char in 10^7) rounding slack from base64's 4/3 expansion
|
|
132
|
+
* ratio, which is immaterial at this size.
|
|
133
|
+
*/
|
|
134
|
+
const MAX_IMAGE_BASE64_CHARS = Math.ceil((10 * 1024 * 1024 * 4) / 3);
|
|
135
|
+
/**
|
|
136
|
+
* Validates one tool-result content block against the real API's format/size constraints.
|
|
137
|
+
* Returns the violation reason, or `null` when the block is legal to send.
|
|
138
|
+
*
|
|
139
|
+
* URL-sourced images are intentionally not size-checked here: Anthropic's servers fetch that URL,
|
|
140
|
+
* not this adapter, so there is no local payload to bound (a different threat model than
|
|
141
|
+
* `connection-guard.ts`'s SSRF guard, which protects *this adapter's own* outbound `baseUrl`
|
|
142
|
+
* request).
|
|
143
|
+
*
|
|
144
|
+
* @complexity O(1) — reads `data.length`, never decodes or parses the base64 payload.
|
|
145
|
+
* @overallScore 100
|
|
146
|
+
*/
|
|
147
|
+
export function invalidToolResultContentBlockReason(block) {
|
|
148
|
+
if (block.type === 'text')
|
|
149
|
+
return null;
|
|
150
|
+
if (block.source.type === 'url')
|
|
151
|
+
return null;
|
|
152
|
+
if (!ANTHROPIC_ALLOWED_IMAGE_MEDIA_TYPES.has(block.source.media_type)) {
|
|
153
|
+
return `unsupported image media_type ${JSON.stringify(block.source.media_type)} (direct API supports image/jpeg, image/png, image/gif, image/webp)`;
|
|
154
|
+
}
|
|
155
|
+
if (block.source.data.length > MAX_IMAGE_BASE64_CHARS) {
|
|
156
|
+
return `image exceeds the direct API's 10 MB base64 size limit (${block.source.data.length} base64 chars)`;
|
|
157
|
+
}
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Runtime guard applied to every `AnthropicToolExecutor` result before it is wired onto the
|
|
162
|
+
* outbound request or reported via `onEvent`. `AnthropicToolResult` is host-owned (see
|
|
163
|
+
* `AnthropicToolExecutor`'s "Host-owned tool execution" doc comment) — the TS content-block union
|
|
164
|
+
* only constrains a well-behaved host at compile time, not a buggy one at runtime, e.g. a
|
|
165
|
+
* screenshot helper that hands back an oversized PNG or a HEIC file mislabeled as `image/jpeg`.
|
|
166
|
+
* Rather than forwarding an invalid block and letting Anthropic reject the *entire* turn with an
|
|
167
|
+
* opaque upstream 400, this substitutes a normal `is_error` tool_result the model can see and
|
|
168
|
+
* react to — matching this module's existing security-conscious posture
|
|
169
|
+
* (`connection-guard.ts`'s SSRF guard, `role-marker-guard.ts`'s contamination guard).
|
|
170
|
+
*
|
|
171
|
+
* @param result - The (host-supplied, not yet trusted) return value of one `executeTool` call.
|
|
172
|
+
* @returns `result` unchanged when valid; otherwise a replacement `{ content, isError: true }`
|
|
173
|
+
* describing the violation.
|
|
174
|
+
* @complexity O(n) in the number of content blocks; O(1) per block (see
|
|
175
|
+
* `invalidToolResultContentBlockReason`).
|
|
176
|
+
* @overallScore 100
|
|
177
|
+
*/
|
|
178
|
+
export function guardToolResult(result) {
|
|
179
|
+
if (typeof result.content === 'string')
|
|
180
|
+
return result;
|
|
181
|
+
for (const block of result.content) {
|
|
182
|
+
const reason = invalidToolResultContentBlockReason(block);
|
|
183
|
+
if (reason) {
|
|
184
|
+
return { content: `[rejected tool result] ${reason}`, isError: true };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
/** Parses one SSE frame's data as a JSON object, or `null` for a malformed/empty keep-alive frame or a non-object payload — both are tolerated by the caller as "nothing to do this frame". */
|
|
190
|
+
export function parseAnthropicSseData(raw) {
|
|
191
|
+
let data;
|
|
192
|
+
try {
|
|
193
|
+
data = JSON.parse(raw);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
return isRecord(data) ? data : null;
|
|
199
|
+
}
|
|
200
|
+
export function handleContentBlockStart(state, data) {
|
|
201
|
+
if (!isRecord(data.content_block) || typeof data.index !== 'number')
|
|
202
|
+
return;
|
|
203
|
+
const block = data.content_block;
|
|
204
|
+
if (block.type === 'text') {
|
|
205
|
+
state.blocks.set(data.index, { type: 'text', text: '', inputJson: '' });
|
|
206
|
+
}
|
|
207
|
+
else if (block.type === 'tool_use' && typeof block.id === 'string' && typeof block.name === 'string') {
|
|
208
|
+
state.blocks.set(data.index, { type: 'tool_use', text: '', toolId: block.id, toolName: block.name, inputJson: '' });
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
state.blocks.set(data.index, { type: 'other', text: '', inputJson: '' });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Feeds one text delta through the role-marker guard and emits the safe portion. Returns
|
|
216
|
+
* `'break'` once the guard flags contamination (the caller ends the turn immediately), otherwise
|
|
217
|
+
* `'continue'`.
|
|
218
|
+
*/
|
|
219
|
+
export function handleAnthropicTextDelta(state, index, text, onEvent) {
|
|
220
|
+
const blockState = state.blocks.get(index);
|
|
221
|
+
if (blockState)
|
|
222
|
+
blockState.text += text;
|
|
223
|
+
// No `guard.contaminated` pre-check here: the only way it can become true is the `'break'`
|
|
224
|
+
// this function returns, which the caller turns into an immediate loop `break` — a later text
|
|
225
|
+
// delta in the same request can never reach this point already contaminated. (`feedText` itself
|
|
226
|
+
// is still safe to call unconditionally regardless — it early-returns `''` once contaminated,
|
|
227
|
+
// per its own doc.)
|
|
228
|
+
const safe = state.guard.feedText(text);
|
|
229
|
+
if (safe.length > 0) {
|
|
230
|
+
state.fullText += safe;
|
|
231
|
+
onEvent({ type: 'text_delta', delta: safe });
|
|
232
|
+
}
|
|
233
|
+
if (!state.guard.contaminated)
|
|
234
|
+
return 'continue';
|
|
235
|
+
const warn = state.guard.warningEvent();
|
|
236
|
+
if (warn)
|
|
237
|
+
onEvent(warn);
|
|
238
|
+
return 'break';
|
|
239
|
+
}
|
|
240
|
+
export function handleAnthropicInputJsonDelta(state, index, partialJson) {
|
|
241
|
+
const blockState = state.blocks.get(index);
|
|
242
|
+
if (!blockState)
|
|
243
|
+
return;
|
|
244
|
+
blockState.inputJson += partialJson;
|
|
245
|
+
}
|
|
246
|
+
export function handleContentBlockDelta(state, data, onEvent) {
|
|
247
|
+
if (!isRecord(data.delta) || typeof data.index !== 'number')
|
|
248
|
+
return 'continue';
|
|
249
|
+
const { delta, index } = data;
|
|
250
|
+
if (delta.type === 'text_delta' && typeof delta.text === 'string') {
|
|
251
|
+
return handleAnthropicTextDelta(state, index, delta.text, onEvent);
|
|
252
|
+
}
|
|
253
|
+
if (delta.type === 'input_json_delta' && typeof delta.partial_json === 'string') {
|
|
254
|
+
handleAnthropicInputJsonDelta(state, index, delta.partial_json);
|
|
255
|
+
}
|
|
256
|
+
return 'continue';
|
|
257
|
+
}
|
|
258
|
+
/** Parses one tool_use block's accumulated `input_json_delta` text, falling back to `{}` for empty or malformed JSON — mirrors OpenAI's identical fallback for `tool_calls[].function.arguments` in `openai-chat.ts`. */
|
|
259
|
+
export function parseAccumulatedToolInputJson(inputJson) {
|
|
260
|
+
if (!inputJson.trim())
|
|
261
|
+
return {};
|
|
262
|
+
try {
|
|
263
|
+
return JSON.parse(inputJson);
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
return {};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
export function handleContentBlockStop(state, data, onEvent) {
|
|
270
|
+
if (typeof data.index !== 'number')
|
|
271
|
+
return;
|
|
272
|
+
const blockState = state.blocks.get(data.index);
|
|
273
|
+
if (blockState?.type === 'tool_use' && blockState.toolId && blockState.toolName) {
|
|
274
|
+
const call = { id: blockState.toolId, name: blockState.toolName, input: parseAccumulatedToolInputJson(blockState.inputJson) };
|
|
275
|
+
state.toolCalls.push(call);
|
|
276
|
+
onEvent({ type: 'tool_use', id: call.id, name: call.name, input: call.input });
|
|
277
|
+
}
|
|
278
|
+
state.blocks.delete(data.index);
|
|
279
|
+
}
|
|
280
|
+
export function handleMessageDelta(state, data, onEvent) {
|
|
281
|
+
if (isRecord(data.delta) && typeof data.delta.stop_reason === 'string') {
|
|
282
|
+
state.stopReason = data.delta.stop_reason;
|
|
283
|
+
}
|
|
284
|
+
if (isRecord(data.usage)) {
|
|
285
|
+
state.usage = data.usage;
|
|
286
|
+
onEvent({ type: 'usage', usage: data.usage });
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
export function handleAnthropicErrorFrame(data, onEvent, apiKey) {
|
|
290
|
+
const errorDetail = isRecord(data.error) && typeof data.error.message === 'string' ? data.error.message : 'upstream error';
|
|
291
|
+
const errorType = isRecord(data.error) && typeof data.error.type === 'string' ? data.error.type : undefined;
|
|
292
|
+
onEvent({ type: 'error', message: redactSecrets(errorDetail, [apiKey]), ...(errorType ? { code: errorType } : {}) });
|
|
293
|
+
}
|
|
294
|
+
/** The SSE event's dispatch key: `data.type` when present (every real Anthropic frame carries one), else the record's `event:` line, else `''` — a key that intentionally matches no entry in {@link ANTHROPIC_FRAME_HANDLERS} (`message_start`/`message_stop`/`ping`/future event types fall through as no-ops, same as before this frame was a lookup table). */
|
|
295
|
+
export function anthropicFrameKind(data, frameEvent) {
|
|
296
|
+
if (typeof data.type === 'string')
|
|
297
|
+
return data.type;
|
|
298
|
+
return frameEvent ?? '';
|
|
299
|
+
}
|
|
300
|
+
/** One entry per SSE event kind this adapter reacts to. Replaces a sequential if-chain over `kind` — every branch below is now a single object-key lookup instead of N nesting-penalized `if` statements (see `runSingleAnthropicRequest`'s doc for the resulting flat loop). */
|
|
301
|
+
const ANTHROPIC_FRAME_HANDLERS = {
|
|
302
|
+
content_block_start: (state, data) => {
|
|
303
|
+
handleContentBlockStart(state, data);
|
|
304
|
+
return { action: 'continue' };
|
|
305
|
+
},
|
|
306
|
+
content_block_delta: (state, data, onEvent) => handleContentBlockDelta(state, data, onEvent) === 'break' ? { action: 'end', reason: 'contaminated' } : { action: 'continue' },
|
|
307
|
+
content_block_stop: (state, data, onEvent) => {
|
|
308
|
+
handleContentBlockStop(state, data, onEvent);
|
|
309
|
+
return { action: 'continue' };
|
|
310
|
+
},
|
|
311
|
+
message_delta: (state, data, onEvent) => {
|
|
312
|
+
handleMessageDelta(state, data, onEvent);
|
|
313
|
+
return { action: 'continue' };
|
|
314
|
+
},
|
|
315
|
+
error: (_state, data, onEvent, apiKey) => {
|
|
316
|
+
handleAnthropicErrorFrame(data, onEvent, apiKey);
|
|
317
|
+
return { action: 'end', reason: 'error' };
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Validates `options.baseUrl` and opens the streaming POST, returning the response's readable
|
|
322
|
+
* body once every pre-stream failure mode (SSRF-guard rejection, network error, non-2xx status,
|
|
323
|
+
* missing body) has been ruled out. Calls `emitEnd('error')` and returns `null` itself on any of
|
|
324
|
+
* those — the caller only has to check for `null`, keeping the single `ended` flag as the sole
|
|
325
|
+
* gate for every exit path (see `runAnthropicToolTurn`'s doc).
|
|
326
|
+
*/
|
|
327
|
+
async function openAnthropicResponseStream(options, messages, emitEnd) {
|
|
105
328
|
const { onEvent } = options;
|
|
106
|
-
|
|
329
|
+
// DNS-resolving, not merely textual — see the identical note in `openai-chat.ts`. A literal
|
|
330
|
+
// private IP was already rejected; a hostname resolving to one was not.
|
|
331
|
+
const baseUrlCheck = await validateBaseUrlResolved(options.baseUrl ?? DEFAULT_ANTHROPIC_BASE_URL, options.dnsLookup ?? defaultDnsLookup);
|
|
107
332
|
if (baseUrlCheck.error) {
|
|
108
333
|
onEvent({ type: 'error', message: baseUrlCheck.error });
|
|
109
334
|
emitEnd('error');
|
|
110
|
-
return
|
|
335
|
+
return null;
|
|
111
336
|
}
|
|
112
337
|
let response;
|
|
113
338
|
try {
|
|
114
|
-
response =
|
|
339
|
+
response = await (options.fetchImpl ?? pinnedFetch)(anthropicRequestUrl(options.baseUrl), {
|
|
115
340
|
method: 'POST',
|
|
116
341
|
headers: anthropicHeaders(options),
|
|
117
342
|
body: JSON.stringify(anthropicRequestBody(options, messages)),
|
|
343
|
+
redirect: 'error',
|
|
118
344
|
...(options.signal ? { signal: options.signal } : {}),
|
|
119
|
-
})
|
|
345
|
+
}, baseUrlCheck.pinnedAddress);
|
|
120
346
|
}
|
|
121
347
|
catch (error) {
|
|
122
348
|
const message = error instanceof Error ? error.message : String(error);
|
|
123
349
|
onEvent({ type: 'error', message: redactSecrets(message, [options.apiKey]) });
|
|
124
350
|
emitEnd('error');
|
|
125
|
-
return
|
|
351
|
+
return null;
|
|
126
352
|
}
|
|
127
353
|
if (!response.ok) {
|
|
128
354
|
const rawText = await response.text();
|
|
@@ -132,126 +358,57 @@ async function runSingleAnthropicRequest(options, messages, emitEnd) {
|
|
|
132
358
|
code: String(response.status),
|
|
133
359
|
});
|
|
134
360
|
emitEnd('error');
|
|
135
|
-
return
|
|
361
|
+
return null;
|
|
136
362
|
}
|
|
137
363
|
if (!response.body) {
|
|
138
364
|
onEvent({ type: 'error', message: 'Anthropic response had no body' });
|
|
139
365
|
emitEnd('error');
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
return response.body;
|
|
369
|
+
}
|
|
370
|
+
/** Runs exactly one Anthropic Messages API streaming request and reduces its SSE events into a single outcome. Calls `emitEnd` directly (and only) on contamination or a fatal request/stream error — the caller (`runAnthropicToolTurn`) is responsible for the normal-completion `emitEnd` call once the tool loop actually concludes, so the single `ended` flag stays the sole gate for every exit path. */
|
|
371
|
+
async function runSingleAnthropicRequest(options, messages, emitEnd) {
|
|
372
|
+
const { onEvent } = options;
|
|
373
|
+
const body = await openAnthropicResponseStream(options, messages, emitEnd);
|
|
374
|
+
if (!body) {
|
|
140
375
|
return { stopReason: null, toolCalls: [], text: '' };
|
|
141
376
|
}
|
|
142
377
|
onEvent({ type: 'status', label: 'requesting' });
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
378
|
+
const state = {
|
|
379
|
+
guard: createRoleMarkerGuard('anthropic-turn'),
|
|
380
|
+
blocks: new Map(),
|
|
381
|
+
toolCalls: [],
|
|
382
|
+
fullText: '',
|
|
383
|
+
stopReason: null,
|
|
384
|
+
usage: null,
|
|
385
|
+
};
|
|
386
|
+
for await (const frame of decodeSseStream(body)) {
|
|
150
387
|
// No `isEnded()` re-check at the top of this loop: every `emitEnd(...)` call site below is
|
|
151
388
|
// immediately followed by `break`, so `ended` can never be true when a new iteration starts
|
|
152
|
-
// — traced across all six call sites in this function (the four pre-
|
|
153
|
-
// the two in-loop
|
|
389
|
+
// — traced across all six call sites in this function and its handlers (the four pre-stream
|
|
390
|
+
// early returns inside `openAnthropicResponseStream` plus the two in-loop
|
|
391
|
+
// contamination/error branches below). Verified, not assumed; see
|
|
154
392
|
// `__tests__/anthropic-messages.test.ts`'s duplicate-end-event regression case.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
continue; //
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
const kind = typeof data.type === 'string' ? data.type : frame.event;
|
|
165
|
-
if (kind === 'content_block_start' && isRecord(data.content_block) && typeof data.index === 'number') {
|
|
166
|
-
const block = data.content_block;
|
|
167
|
-
if (block.type === 'text') {
|
|
168
|
-
blocks.set(data.index, { type: 'text', text: '', inputJson: '' });
|
|
169
|
-
}
|
|
170
|
-
else if (block.type === 'tool_use' && typeof block.id === 'string' && typeof block.name === 'string') {
|
|
171
|
-
blocks.set(data.index, { type: 'tool_use', text: '', toolId: block.id, toolName: block.name, inputJson: '' });
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
blocks.set(data.index, { type: 'other', text: '', inputJson: '' });
|
|
175
|
-
}
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (kind === 'content_block_delta' && isRecord(data.delta) && typeof data.index === 'number') {
|
|
179
|
-
const state = blocks.get(data.index);
|
|
180
|
-
const delta = data.delta;
|
|
181
|
-
if (delta.type === 'text_delta' && typeof delta.text === 'string') {
|
|
182
|
-
if (state)
|
|
183
|
-
state.text += delta.text;
|
|
184
|
-
// No `guard.contaminated` pre-check here: the only way it can become
|
|
185
|
-
// true is the `emitEnd('contaminated'); break;` a few lines below,
|
|
186
|
-
// which exits this loop immediately — a later text_delta in the same
|
|
187
|
-
// request can never reach this point already contaminated. (`feedText`
|
|
188
|
-
// itself is still safe to call unconditionally regardless — it
|
|
189
|
-
// early-returns `''` once contaminated, per its own doc.)
|
|
190
|
-
const safe = guard.feedText(delta.text);
|
|
191
|
-
if (safe.length > 0) {
|
|
192
|
-
fullText += safe;
|
|
193
|
-
onEvent({ type: 'text_delta', delta: safe });
|
|
194
|
-
}
|
|
195
|
-
if (guard.contaminated) {
|
|
196
|
-
const warn = guard.warningEvent();
|
|
197
|
-
if (warn)
|
|
198
|
-
onEvent(warn);
|
|
199
|
-
emitEnd('contaminated');
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
else if (delta.type === 'input_json_delta' && typeof delta.partial_json === 'string' && state) {
|
|
204
|
-
state.inputJson += delta.partial_json;
|
|
205
|
-
}
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
if (kind === 'content_block_stop' && typeof data.index === 'number') {
|
|
209
|
-
const state = blocks.get(data.index);
|
|
210
|
-
if (state?.type === 'tool_use' && state.toolId && state.toolName) {
|
|
211
|
-
let input = {};
|
|
212
|
-
if (state.inputJson.trim()) {
|
|
213
|
-
try {
|
|
214
|
-
input = JSON.parse(state.inputJson);
|
|
215
|
-
}
|
|
216
|
-
catch {
|
|
217
|
-
input = {};
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const call = { id: state.toolId, name: state.toolName, input };
|
|
221
|
-
toolCalls.push(call);
|
|
222
|
-
onEvent({ type: 'tool_use', id: call.id, name: call.name, input: call.input });
|
|
223
|
-
}
|
|
224
|
-
blocks.delete(data.index);
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
if (kind === 'message_delta') {
|
|
228
|
-
if (isRecord(data.delta) && typeof data.delta.stop_reason === 'string') {
|
|
229
|
-
stopReason = data.delta.stop_reason;
|
|
230
|
-
}
|
|
231
|
-
if (isRecord(data.usage)) {
|
|
232
|
-
usage = data.usage;
|
|
233
|
-
onEvent({ type: 'usage', usage });
|
|
234
|
-
}
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
if (kind === 'error') {
|
|
238
|
-
const errorDetail = isRecord(data.error) && typeof data.error.message === 'string' ? data.error.message : 'upstream error';
|
|
239
|
-
const errorType = isRecord(data.error) && typeof data.error.type === 'string' ? data.error.type : undefined;
|
|
240
|
-
onEvent({ type: 'error', message: redactSecrets(errorDetail, [options.apiKey]), ...(errorType ? { code: errorType } : {}) });
|
|
241
|
-
emitEnd('error');
|
|
393
|
+
const data = parseAnthropicSseData(frame.data);
|
|
394
|
+
if (!data)
|
|
395
|
+
continue; // malformed/empty keep-alive frame, or a non-object payload
|
|
396
|
+
const handler = ANTHROPIC_FRAME_HANDLERS[anthropicFrameKind(data, frame.event)];
|
|
397
|
+
if (!handler)
|
|
398
|
+
continue; // `message_start`, `message_stop`, `ping`, or a future event type — nothing to do
|
|
399
|
+
const outcome = handler(state, data, onEvent, options.apiKey);
|
|
400
|
+
if (outcome.action === 'end') {
|
|
401
|
+
emitEnd(outcome.reason);
|
|
242
402
|
break;
|
|
243
403
|
}
|
|
244
|
-
// `message_start`, `message_stop`, `ping`, and any future event type per
|
|
245
|
-
// Anthropic's own versioning policy ("your code should handle unknown
|
|
246
|
-
// event types gracefully") — nothing to do.
|
|
247
404
|
}
|
|
248
|
-
return { stopReason, toolCalls, text: fullText };
|
|
405
|
+
return { stopReason: state.stopReason, toolCalls: state.toolCalls, text: state.fullText };
|
|
249
406
|
}
|
|
250
407
|
/**
|
|
251
408
|
* Runs a full Anthropic Messages API turn, including the tool-execution
|
|
252
409
|
* loop when `options.executeTool` is supplied and the model requests tool
|
|
253
410
|
* use. Emits a generic event stream via `options.onEvent` — a caller (e.g.
|
|
254
|
-
* `@jini-ai/http`'s `model-proxy.ts`) adapts those events onto an outbound SSE
|
|
411
|
+
* `@jini-ai/http-kit`'s `model-proxy.ts`) adapts those events onto an outbound SSE
|
|
255
412
|
* channel; this module has no knowledge of HTTP/Express.
|
|
256
413
|
*
|
|
257
414
|
* Guarantees exactly one `{type: 'end'}` event per call, regardless of which
|
|
@@ -259,8 +416,44 @@ async function runSingleAnthropicRequest(options, messages, emitEnd) {
|
|
|
259
416
|
* request/stream error) triggers it — the fix for OD's confirmed duplicate-
|
|
260
417
|
* `end`-event bug (see module doc).
|
|
261
418
|
*/
|
|
419
|
+
/**
|
|
420
|
+
* Decides why the tool loop should stop after one request, or returns `null` when it should
|
|
421
|
+
* instead proceed to execute the pending tool calls. Pure — no events, no I/O — so the three
|
|
422
|
+
* "stop" conditions (no/empty tool_use, no executor, turn ceiling reached) are exercised as plain
|
|
423
|
+
* value-in/value-out assertions rather than through the full request/event-emission machinery.
|
|
424
|
+
*/
|
|
425
|
+
export function anthropicLoopExitReason(outcome, toolTurns, maxToolTurns) {
|
|
426
|
+
if (outcome.stopReason !== 'tool_use' || outcome.toolCalls.length === 0)
|
|
427
|
+
return 'stop';
|
|
428
|
+
if (toolTurns >= maxToolTurns)
|
|
429
|
+
return 'max_tool_turns';
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
export function buildAnthropicAssistantContent(text, toolCalls) {
|
|
433
|
+
return [
|
|
434
|
+
...(text ? [{ type: 'text', text }] : []),
|
|
435
|
+
...toolCalls.map((call) => ({ type: 'tool_use', id: call.id, name: call.name, input: call.input })),
|
|
436
|
+
];
|
|
437
|
+
}
|
|
438
|
+
/** Runs every pending tool call in order and reduces the results into the `tool_result` blocks the next request's `user` message carries. Emits one `tool_result` event per call as it goes. */
|
|
439
|
+
export async function executeAnthropicToolCalls(executeTool, calls, onEvent) {
|
|
440
|
+
const toolResultBlocks = [];
|
|
441
|
+
for (const call of calls) {
|
|
442
|
+
const rawResult = await executeTool(call);
|
|
443
|
+
const result = guardToolResult(rawResult);
|
|
444
|
+
onEvent({ type: 'tool_result', toolUseId: call.id, content: result.content, isError: result.isError ?? false });
|
|
445
|
+
toolResultBlocks.push({
|
|
446
|
+
type: 'tool_result',
|
|
447
|
+
tool_use_id: call.id,
|
|
448
|
+
content: result.content,
|
|
449
|
+
...(result.isError !== undefined ? { is_error: result.isError } : {}),
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
return toolResultBlocks;
|
|
453
|
+
}
|
|
262
454
|
export async function runAnthropicToolTurn(options) {
|
|
263
455
|
const maxToolTurns = options.maxToolTurns ?? DEFAULT_MAX_TOOL_TURNS;
|
|
456
|
+
const executeTool = options.executeTool;
|
|
264
457
|
const endGuard = createTurnEndGuard(options.onEvent, (reason) => ({ type: 'end', reason }));
|
|
265
458
|
const emitEnd = endGuard.emitEnd;
|
|
266
459
|
let messages = options.messages.slice();
|
|
@@ -271,37 +464,21 @@ export async function runAnthropicToolTurn(options) {
|
|
|
271
464
|
lastStopReason = outcome.stopReason;
|
|
272
465
|
if (endGuard.hasEnded())
|
|
273
466
|
break;
|
|
274
|
-
|
|
275
|
-
|
|
467
|
+
const exitReason = anthropicLoopExitReason(outcome, toolTurns, maxToolTurns);
|
|
468
|
+
if (exitReason) {
|
|
469
|
+
emitEnd(exitReason);
|
|
276
470
|
break;
|
|
277
471
|
}
|
|
278
|
-
if (!
|
|
472
|
+
if (!executeTool) {
|
|
279
473
|
// Pending tool calls were already emitted as `tool_use` events above;
|
|
280
474
|
// with no executor to run them, the turn ends here rather than
|
|
281
475
|
// silently retrying forever.
|
|
282
476
|
emitEnd('stop');
|
|
283
477
|
break;
|
|
284
478
|
}
|
|
285
|
-
if (toolTurns >= maxToolTurns) {
|
|
286
|
-
emitEnd('max_tool_turns');
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
479
|
toolTurns += 1;
|
|
290
|
-
const assistantContent =
|
|
291
|
-
|
|
292
|
-
...outcome.toolCalls.map((call) => ({ type: 'tool_use', id: call.id, name: call.name, input: call.input })),
|
|
293
|
-
];
|
|
294
|
-
const toolResultBlocks = [];
|
|
295
|
-
for (const call of outcome.toolCalls) {
|
|
296
|
-
const result = await options.executeTool(call);
|
|
297
|
-
options.onEvent({ type: 'tool_result', toolUseId: call.id, content: result.content, isError: result.isError ?? false });
|
|
298
|
-
toolResultBlocks.push({
|
|
299
|
-
type: 'tool_result',
|
|
300
|
-
tool_use_id: call.id,
|
|
301
|
-
content: result.content,
|
|
302
|
-
...(result.isError !== undefined ? { is_error: result.isError } : {}),
|
|
303
|
-
});
|
|
304
|
-
}
|
|
480
|
+
const assistantContent = buildAnthropicAssistantContent(outcome.text, outcome.toolCalls);
|
|
481
|
+
const toolResultBlocks = await executeAnthropicToolCalls(executeTool, outcome.toolCalls, options.onEvent);
|
|
305
482
|
messages = [
|
|
306
483
|
...messages,
|
|
307
484
|
{ role: 'assistant', content: assistantContent },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-messages.js","sourceRoot":"","sources":["../../src/providers/anthropic-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AAiG7E,MAAM,0BAA0B,GAAG,2BAA2B,CAAC;AAC/D,MAAM,yBAAyB,GAAG,YAAY,CAAC;AAC/C,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEjC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,mBAAmB,CAAC,OAA2B;IACtD,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,0BAA0B,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzE,OAAO,GAAG,IAAI,cAAc,CAAC;AAC/B,CAAC;AAED,SAAS,gBAAgB,CAAC,OAA6B;IACrD,OAAO;QACL,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,OAAO,CAAC,MAAM;QAC3B,mBAAmB,EAAE,OAAO,CAAC,UAAU,IAAI,yBAAy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