@rarebit-one/harness-kernel 0.10.0 → 0.11.0-next.1

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 (71) hide show
  1. package/README.md +160 -6
  2. package/dist/agent.d.ts +117 -8
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +332 -25
  5. package/dist/agent.js.map +1 -1
  6. package/dist/engines/native.d.ts +5 -0
  7. package/dist/engines/native.d.ts.map +1 -1
  8. package/dist/engines/native.js +30 -10
  9. package/dist/engines/native.js.map +1 -1
  10. package/dist/engines/types.d.ts +31 -1
  11. package/dist/engines/types.d.ts.map +1 -1
  12. package/dist/events.d.ts +30 -2
  13. package/dist/events.d.ts.map +1 -1
  14. package/dist/events.js.map +1 -1
  15. package/dist/index.d.ts +18 -12
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +7 -4
  18. package/dist/index.js.map +1 -1
  19. package/dist/loop.d.ts +60 -11
  20. package/dist/loop.d.ts.map +1 -1
  21. package/dist/loop.js +7 -5
  22. package/dist/loop.js.map +1 -1
  23. package/dist/models/chat.d.ts +2 -1
  24. package/dist/models/chat.d.ts.map +1 -1
  25. package/dist/models/chat.js +20 -4
  26. package/dist/models/chat.js.map +1 -1
  27. package/dist/models/types.d.ts +16 -0
  28. package/dist/models/types.d.ts.map +1 -1
  29. package/dist/models/types.js.map +1 -1
  30. package/dist/private.d.ts.map +1 -1
  31. package/dist/private.js +29 -1
  32. package/dist/private.js.map +1 -1
  33. package/dist/providers/anthropic.d.ts +30 -4
  34. package/dist/providers/anthropic.d.ts.map +1 -1
  35. package/dist/providers/anthropic.js +130 -29
  36. package/dist/providers/anthropic.js.map +1 -1
  37. package/dist/providers/index.d.ts +42 -6
  38. package/dist/providers/index.d.ts.map +1 -1
  39. package/dist/providers/index.js +132 -48
  40. package/dist/providers/index.js.map +1 -1
  41. package/dist/providers/mock.d.ts +6 -3
  42. package/dist/providers/mock.d.ts.map +1 -1
  43. package/dist/providers/mock.js +9 -4
  44. package/dist/providers/mock.js.map +1 -1
  45. package/dist/providers/openai.d.ts +54 -8
  46. package/dist/providers/openai.d.ts.map +1 -1
  47. package/dist/providers/openai.js +164 -32
  48. package/dist/providers/openai.js.map +1 -1
  49. package/dist/providers/options.d.ts +177 -0
  50. package/dist/providers/options.d.ts.map +1 -0
  51. package/dist/providers/options.js +67 -0
  52. package/dist/providers/options.js.map +1 -0
  53. package/dist/providers/scripted.d.ts +49 -0
  54. package/dist/providers/scripted.d.ts.map +1 -0
  55. package/dist/providers/scripted.js +90 -0
  56. package/dist/providers/scripted.js.map +1 -0
  57. package/dist/providers/types.d.ts +60 -0
  58. package/dist/providers/types.d.ts.map +1 -1
  59. package/dist/tools/metadata.d.ts +24 -0
  60. package/dist/tools/metadata.d.ts.map +1 -1
  61. package/dist/tools/metadata.js +8 -0
  62. package/dist/tools/metadata.js.map +1 -1
  63. package/dist/tools/registry.d.ts +10 -3
  64. package/dist/tools/registry.d.ts.map +1 -1
  65. package/dist/tools/registry.js +9 -4
  66. package/dist/tools/registry.js.map +1 -1
  67. package/dist/tools/terminal.d.ts +33 -0
  68. package/dist/tools/terminal.d.ts.map +1 -0
  69. package/dist/tools/terminal.js +32 -0
  70. package/dist/tools/terminal.js.map +1 -0
  71. package/package.json +4 -3
package/README.md CHANGED
@@ -46,9 +46,9 @@ ESM-only, Node >= 22.
46
46
  | Area | Exports |
47
47
  |------|---------|
48
48
  | **Model seam** | `ModelInvocation` — one arrow for every model kind, with declared capabilities, a uniform result envelope and `probe()` |
49
- | **Providers** | `Provider` interface + `selectProvider()` over Anthropic, OpenAI, OpenRouter, a self-hosted `local` (any OpenAI-compatible server), and an offline `mock`; `chatModel()` puts any of them on the seam |
50
- | **Agent loop** | `runAgent()` — a provider-neutral tool-use loop with step and wall-clock budgets, cancellable through an `AbortSignal` |
51
- | **Loop** | `Loop` + `nativeLoop` — the control loop as a seam; the kernel ships one and it is the loop `runAgent` has always run |
49
+ | **Providers** | `Provider` interface + `selectProvider()` over Anthropic, OpenAI, OpenRouter, a self-hosted `local` (any OpenAI-compatible server), an offline `mock` (by request) and a `ScriptedProvider` for recorded evals; `chatModel()` puts any of them on the seam; typed per-call `ProviderOptions` (prompt caching, token cap, response format, OpenRouter routing) |
50
+ | **Agent loop** | `runConversation()` — a provider-neutral tool-use loop over a seeded conversation, with step and wall-clock budgets, terminal (final-answer) tools, summed usage and the served model in the result; `runAgent()` is its one-prompt form |
51
+ | **Loop** | `Loop` + `nativeLoop` — the control loop as a seam; the kernel ships one and it is the loop `runAgent` and `runConversation` have always run |
52
52
  | **Run events** | `RunEvent` — an ordered, structured account of a run (turns, tool calls, budgets, outcome), emitted to an optional sink |
53
53
  | **Tools** | `Tool` (+ `ToolContext`), `primitiveTools()` (`run_code`, `read_file`, `list_files`, `http_fetch`), `connectorTools()`, `modelAsTool()`, metadata + projections (`replaySafeTools`, …) |
54
54
  | **Connectors** | `connectMcp()` — MCP clients over stdio / streamable HTTP / SSE |
@@ -297,9 +297,163 @@ const text = await runAgent({
297
297
  })
298
298
  ```
299
299
 
300
- With no provider API key configured, `selectProvider` falls back to the offline
301
- `mock` provider — so the whole loop runs end to end with no keys and no network.
302
- That is deliberate: the test suite depends on it, and so can yours.
300
+ **`selectProvider` fails loud.** A preferred provider with no credential, or no
301
+ preference and no credential at all, throws a `ProviderCredentialsError` naming
302
+ the env var and the BYO slot that would have satisfied it; it never falls
303
+ through to another configured provider, and a name it does not know (a typo, a
304
+ provider with no adapter) is refused the same way rather than read as "no
305
+ preference". `providerAvailability()` gives the same
306
+ answer as a reason instead of a throw, and `NativeEngine.supports()` uses it, so
307
+ a run with no key is refused before a sandbox is prepared. The offline `mock`
308
+ is reached only by request (`selectProvider("mock")`) or by explicit opt-in
309
+ (`{ allowMockFallback: true }`), which is what a keyless test rig sets. Until
310
+ 0.11 a keyless run landed on the mock silently and reported success; nothing on
311
+ the wire told that run from a real one.
312
+
313
+ ### Conversations and terminal tools
314
+
315
+ `runAgent` is single-shot. A conversational application seeds the loop with its
316
+ stored history and gets the whole transcript back:
317
+
318
+ ```ts
319
+ import { runConversation, terminalTool } from "@rarebit-one/harness-kernel"
320
+
321
+ const reply = terminalTool({
322
+ name: "reply",
323
+ description: "Send the final answer to the user.",
324
+ inputSchema: {
325
+ type: "object",
326
+ properties: { text: { type: "string" }, quick_replies: { type: "array", items: { type: "string" } } },
327
+ required: ["text"],
328
+ },
329
+ })
330
+
331
+ const result = await runConversation({
332
+ provider,
333
+ system,
334
+ messages: [...storedHistory, { role: "user", text: incoming }],
335
+ tools: [...lookupTools, reply],
336
+ providerOptions: { promptCache: {} },
337
+ })
338
+
339
+ result.stopReason // "end_turn" | "terminal_tool" | "steps_exhausted" | "timed_out" | "canceled"
340
+ result.terminal?.input // { text, quick_replies } when the model called `reply`
341
+ result.messages // store this; seed the next turn with it
342
+ result.usage // summed over every model call
343
+ result.provider, result.model // what actually served the run
344
+ ```
345
+
346
+ A tool with `meta.dispatch: "terminal"` is a **final-answer tool**: the loop
347
+ still runs its executor (so it can validate, or send), appends the tool result
348
+ so the transcript carries no dangling call, and then ends the run with
349
+ `stopReason: "terminal_tool"` and the call on `result.terminal`. An executor
350
+ that throws turns the call into an ordinary tool error the model gets to
351
+ correct. `terminalTool()` builds one with a no-op executor; the structured
352
+ answer is the call's `input`, which the kernel does not validate against the
353
+ schema (run your own validator on it, or supply an executor that throws).
354
+
355
+ The seed must end with a user message or with the tool results the model is
356
+ waiting for; the loop copies it and never mutates the array it was handed.
357
+ `result.events` is this call's event stream (the same events reached `emit`),
358
+ recorded for a caller with nowhere else to put them; the kernel still stores
359
+ nothing between calls.
360
+
361
+ **Cut-off answers are never answers.** Every `ConverseResult` carries a
362
+ `finishReason` (`stop`, `tool_calls`, `length`, `content_filter`, `unknown`),
363
+ mapped from Anthropic's `stop_reason` and the OpenAI dialect's `finish_reason`
364
+ and echoed on `model.turn` and `ConversationResult.finishReason`. When a turn
365
+ ends with `length`, a terminal call on it is refused even if its arguments
366
+ parsed, and so is any call whose raw `argumentsText` does not parse: nothing
367
+ runs, the model gets an error result saying so (`tool.failed` with reason
368
+ `truncated`), and the loop continues so it can answer again within its budgets.
369
+ A cut-off prose answer completes with `stopReason: "length"`, so a consumer can
370
+ decline to apply text that is not whole; `runAgent()`, whose bare string could
371
+ not say so, throws a `TruncatedAnswerError` (carrying the partial `text` and
372
+ the full `result`) in that case instead. `ToolCall.argumentsText` is the exact
373
+ bytes the model emitted (the OpenAI dialect keeps and replays them verbatim;
374
+ Anthropic hands over an object and leaves it absent), and `ToolCall.meta` is an
375
+ opaque per-call bag that rides through history for an adapter that needs it.
376
+
377
+ `dispatch: "external"` is reserved for a tool the *caller* executes: the loop
378
+ would return the pending call and resume when given its result. The native
379
+ loop refuses it today (a custom `Loop` may honour it); native suspend/resume is
380
+ a later release.
381
+
382
+ ### Provider options and prompt caching
383
+
384
+ `providerOptions` rides on every model call a run makes and each adapter maps it
385
+ onto its own wire format. An option an adapter cannot honour throws a
386
+ `ProviderOptionsError` rather than being dropped.
387
+
388
+ ```ts
389
+ providerOptions: {
390
+ maxTokens: 1024, // per-call completion cap
391
+ temperature: 0.2,
392
+ toolChoice: { name: "reply" }, // "auto" | "required" | "none" | { name }; omitted on a tools-free call
393
+ promptCache: { ttl: "1h" }, // system + tools + last message cached
394
+ responseFormat: { type: "json_object" }, // OpenAI-compatible adapters only
395
+ openrouter: { // OpenRouter adapter only
396
+ models: ["anthropic/claude-sonnet-4.5", "openai/gpt-4.1"], // fallbacks
397
+ provider: { data_collection: "deny", zdr: true }, // data policy
398
+ usage: { include: true },
399
+ },
400
+ }
401
+ ```
402
+
403
+ `promptCache: {}` means "cache this prompt the usual way". On **Anthropic** that
404
+ is a `cache_control` breakpoint on the system prompt, the last tool definition
405
+ and the last message (`trailingMessages` up to 2, `ttl` `5m` or `1h`). On
406
+ **OpenRouter** the breakpoints go on the system prompt and the trailing
407
+ messages as content parts, which the upstreams that cache (Anthropic, Gemini)
408
+ honour. On **OpenAI** caching is automatic, so only `promptCache.key` does
409
+ anything (it becomes `prompt_cache_key`). The `local` adapter accepts it and
410
+ lets the server's own prefix cache do the work.
411
+
412
+ Every result reports what served it: `ConverseResult.model` is the model id the
413
+ response named (with a fallback list it can differ from the one requested),
414
+ `responseId` is the provider's own id for the response (a generation id on
415
+ OpenRouter), and, behind OpenRouter, `upstream` names who actually processed the
416
+ prompt, which is what a zero-data-retention audit needs. `model.turn` events
417
+ carry `model`, `responseId` and `upstream` too; `ConversationResult.responseIds`
418
+ lists every id in call order and `ConversationResult.upstream` names who served
419
+ the last turn, so a cross-vendor fallback chain can still be audited.
420
+
421
+ The package also exports its own `package.json`
422
+ (`import pkg from "@rarebit-one/harness-kernel/package.json" with { type: "json" }`)
423
+ so a service can report the kernel version it runs.
424
+
425
+ Usage carries what the provider prices: beside the token counts, `TokenUsage`
426
+ has `cacheWriteTokens`, `reasoningTokens` and `reportedCost`
427
+ (`{ amount, currency: "USD" }`, from OpenRouter's `usage.cost`) when the
428
+ response reports them, on every `model.turn` event and summed by amount on the
429
+ result, so a per-turn cost cap can abort the run through its `signal`. Absent
430
+ means unknown, never free.
431
+
432
+ Two more per-call knobs: `maxRetries` overrides the SDK retry count for one
433
+ call (set `0` alongside an OpenRouter `models` chain, or the SDK and the router
434
+ both retry), and the `openai` adapter sends the cap as `max_completion_tokens`
435
+ (its current field; reasoning models reject `max_tokens`) while OpenRouter and
436
+ local servers get `max_tokens`. `connectorTools(..., { toolName })` names MCP
437
+ tools your way when the default `<connector>__<tool>` prefix is in the way.
438
+
439
+ ### Recorded evals with `ScriptedProvider`
440
+
441
+ ```ts
442
+ import { ScriptedProvider } from "@rarebit-one/harness-kernel"
443
+
444
+ const provider = new ScriptedProvider([
445
+ { text: "", toolCalls: [{ id: "c1", name: "lookup", input: { q: "balance" } }] },
446
+ (req) => ({ text: "", toolCalls: [{ id: "r1", name: "reply", input: { text: "S$120" } }] }),
447
+ ])
448
+ const result = await runConversation({ provider, system, messages, tools })
449
+ provider.requests // every request the loop built, for assertions
450
+ provider.remaining // 0 when the whole script was consumed; a longer loop throws
451
+ ```
452
+
453
+ It plays a recorded script of model turns in order, records each request it was
454
+ given, honours `signal`, and throws `ScriptExhaustedError` rather than invent a
455
+ turn, so an eval that drifts from its recording fails instead of passing
456
+ quietly.
303
457
 
304
458
  **Self-hosted (`local`).** `selectProvider("local")` runs against any
305
459
  OpenAI-compatible server — llama-server, vLLM, LM Studio, Ollama's OpenAI
package/dist/agent.d.ts CHANGED
@@ -1,9 +1,12 @@
1
- import { type RunEventSink } from "./events.js";
2
- import { type LoopContext, type LoopRequest, type LoopResult } from "./loop.js";
1
+ import { type RunEvent, type RunEventSink, type RunOutcome, type StopReason } from "./events.js";
2
+ import { type LoopContext, type LoopRequest, type LoopResult, type TerminalCall } from "./loop.js";
3
3
  import { type ChatModel } from "./models/chat.js";
4
- import type { Provider } from "./providers/types.js";
4
+ import type { TokenUsage } from "./models/types.js";
5
+ import type { ProviderOptions } from "./providers/options.js";
6
+ import type { AgentMessage, FinishReason, Provider, ToolCall } from "./providers/types.js";
5
7
  import { type Tool } from "./tools/registry.js";
6
- export interface RunAgentOptions {
8
+ /** What {@link runAgent} and {@link runConversation} share. */
9
+ export interface LoopRunOptions {
7
10
  /**
8
11
  * The chat model driving the loop. A bare {@link Provider} is accepted and
9
12
  * adapted onto the model seam internally, so existing callers are unaffected;
@@ -12,8 +15,13 @@ export interface RunAgentOptions {
12
15
  */
13
16
  provider: Provider | ChatModel;
14
17
  system: string;
15
- userPrompt: string;
16
18
  tools: Tool[];
19
+ /**
20
+ * Per-call provider options — token cap, prompt caching, response format,
21
+ * OpenRouter routing — sent on every model call the run makes. See
22
+ * `providers/options.ts`.
23
+ */
24
+ providerOptions?: ProviderOptions;
17
25
  maxSteps?: number;
18
26
  /**
19
27
  * Wall-clock budget for the whole loop in ms. Enforced both between steps and
@@ -39,13 +47,69 @@ export interface RunAgentOptions {
39
47
  */
40
48
  emit?: RunEventSink;
41
49
  }
50
+ /** A single-shot run: one user prompt in, the final prose out. */
51
+ export interface RunAgentOptions extends LoopRunOptions {
52
+ userPrompt: string;
53
+ }
54
+ /** A conversational run: the history so far in, the whole transcript out. */
55
+ export interface RunConversationOptions extends LoopRunOptions {
56
+ /**
57
+ * The conversation so far, oldest first, ending with the new user message
58
+ * (or with the tool results the model is waiting for). The array is not
59
+ * mutated; the result carries a new one.
60
+ */
61
+ messages: AgentMessage[];
62
+ }
63
+ /**
64
+ * What {@link runConversation} returns: everything a conversational caller
65
+ * needs to store the turn, bill it, and answer with it.
66
+ */
67
+ export interface ConversationResult {
68
+ /** The final assistant prose. Empty when a terminal tool answered without prose. */
69
+ text: string;
70
+ /** The seed followed by every message the loop appended. Store this; seed the next turn with it. */
71
+ messages: AgentMessage[];
72
+ /**
73
+ * This run's full event stream, in order. The same events reached `emit` as
74
+ * they happened; this is a per-call recording for a caller with nowhere else
75
+ * to put them, not a store — nothing is kept between calls.
76
+ */
77
+ events: RunEvent[];
78
+ /** Token usage summed over every model call that reported it; absent if none did. */
79
+ usage?: TokenUsage;
80
+ steps: number;
81
+ outcome: RunOutcome;
82
+ stopReason: StopReason;
83
+ /** The terminal-tool call that ended the run, when one did. Its `input` is the structured answer. */
84
+ terminal?: TerminalCall;
85
+ /** Which adapter served the run (`"anthropic"`, `"openrouter"`, `"mock"`, a custom model's id). */
86
+ provider: string;
87
+ /** The model id the last response named, else the adapter's configured model. */
88
+ model?: string;
89
+ /** Every response id the provider reported, in call order. */
90
+ responseIds: string[];
91
+ /**
92
+ * Behind an aggregator, who actually served the last response (OpenRouter's
93
+ * response-level `provider`, e.g. "Anthropic"). This is what a data-policy
94
+ * audit reads: `provider` names the adapter, `upstream` names the vendor the
95
+ * prompt reached. Absent for direct adapters.
96
+ */
97
+ upstream?: string;
98
+ /**
99
+ * Why the last model call stopped generating. `length` together with
100
+ * `stopReason: "length"` is a cut-off prose answer; a cut-off tool call never
101
+ * becomes the answer (the loop refuses it), so after `terminal_tool` this is
102
+ * never `length`.
103
+ */
104
+ finishReason?: FinishReason;
105
+ }
42
106
  /**
43
107
  * Resolve a partial budget to the concrete numbers a {@link LoopRequest} needs.
44
108
  *
45
109
  * One place, deliberately. A {@link Loop} is handed numbers rather than
46
110
  * optionals, so if each caller resolved its own defaults a second loop
47
111
  * implementation could silently run to a different ceiling than the one the
48
- * kernel ships. `runAgent` and `NativeEngine` both come here.
112
+ * kernel ships. `runAgent`, `runConversation` and `NativeEngine` all come here.
49
113
  */
50
114
  export declare function resolveLoopLimits(limits?: {
51
115
  maxSteps?: number | undefined;
@@ -61,20 +125,65 @@ export declare function resolveLoopLimits(limits?: {
61
125
  * per call so a changed env takes effect without a reload.
62
126
  */
63
127
  export declare function maxToolResultBytes(): number;
128
+ /**
129
+ * A call whose raw arguments were cut off: the dialect delivered text and that
130
+ * text does not parse as a JSON object. The parsed `input` is `{}` in that
131
+ * case, which would run the tool with nothing, so the loop refuses the call
132
+ * instead. Empty or whitespace text is the ambiguous case: some upstreams emit
133
+ * it for a genuine zero-argument call, and a turn cut off before the JSON
134
+ * began looks identical. It is read as truncated only when the turn's
135
+ * `finishReason` is `length`, which is the one situation where the cut-off
136
+ * reading is the safe one. A dialect that delivers no text (Anthropic) cannot
137
+ * be judged here.
138
+ */
139
+ export declare function isTruncatedCall(call: ToolCall, finishReason?: FinishReason): boolean;
140
+ /**
141
+ * Thrown by {@link runAgent} when the model's final prose was cut off at the
142
+ * output token cap (`stopReason: "length"`, or a budget summary that ended
143
+ * with `finishReason: "length"`). A bare string cannot say "this is not whole", and a caller
144
+ * that got one would apply it as an answer, so the single-shot form refuses
145
+ * instead. The partial text and the full result ride on the error for a
146
+ * caller that wants them; {@link runConversation} returns the same run with
147
+ * `stopReason: "length"` and never throws for it.
148
+ */
149
+ export declare class TruncatedAnswerError extends Error {
150
+ /** The cut-off prose, exactly as the model left it. */
151
+ readonly text: string;
152
+ /** The whole run, as `runConversation` would have returned it. */
153
+ readonly result: ConversationResult;
154
+ constructor(result: ConversationResult);
155
+ }
64
156
  /**
65
157
  * Drives a provider-agnostic tool-use loop: the model converses, the runner
66
158
  * executes any requested tools in the sandbox, feeds the results back, and
67
159
  * repeats until the model stops calling tools (or the step budget is hit). The
68
160
  * model orchestrates; deterministic work happens in the tools.
161
+ *
162
+ * This is the single-shot form: one user prompt in, the final prose out. It is
163
+ * {@link runConversation} with a one-message seed, kept because most callers
164
+ * want exactly that and nothing more. The one thing a string cannot carry is
165
+ * "cut off", so a `length` stop throws {@link TruncatedAnswerError} here
166
+ * rather than returning partial prose that reads as complete.
69
167
  */
70
168
  export declare function runAgent(options: RunAgentOptions): Promise<string>;
169
+ /**
170
+ * Run the tool-use loop over a conversation: the stored history plus the new
171
+ * user turn in, the whole transcript out, with the structured answer when a
172
+ * terminal tool gave one.
173
+ *
174
+ * The kernel stores nothing between calls. A conversational application keeps
175
+ * `result.messages` wherever it keeps its state and seeds the next call with
176
+ * it; what the kernel owes it is a faithful transcript, a summed bill, the
177
+ * reason the run stopped, and the name of what served it.
178
+ */
179
+ export declare function runConversation(options: RunConversationOptions): Promise<ConversationResult>;
71
180
  /**
72
181
  * The native tool-use loop, as a {@link Loop}.
73
182
  *
74
183
  * Exported for `loop.ts` to wrap; applications reach it through `nativeLoop`
75
184
  * rather than calling this directly. It is the whole of the kernel's control
76
- * flow, and the only place any of it lives — `runAgent` and `nativeLoop` both
77
- * come here, so the two cannot drift.
185
+ * flow, and the only place any of it lives — `runAgent`, `runConversation` and
186
+ * `nativeLoop` all come here, so they cannot drift.
78
187
  */
79
188
  export declare function runNativeLoop(req: LoopRequest, loopCtx: LoopContext): Promise<LoopResult>;
80
189
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAA;AACpB,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAA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