@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.
- package/README.md +160 -6
- package/dist/agent.d.ts +117 -8
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +332 -25
- package/dist/agent.js.map +1 -1
- package/dist/engines/native.d.ts +5 -0
- package/dist/engines/native.d.ts.map +1 -1
- package/dist/engines/native.js +30 -10
- package/dist/engines/native.js.map +1 -1
- package/dist/engines/types.d.ts +31 -1
- package/dist/engines/types.d.ts.map +1 -1
- package/dist/events.d.ts +30 -2
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +18 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/loop.d.ts +60 -11
- package/dist/loop.d.ts.map +1 -1
- package/dist/loop.js +7 -5
- package/dist/loop.js.map +1 -1
- package/dist/models/chat.d.ts +2 -1
- package/dist/models/chat.d.ts.map +1 -1
- package/dist/models/chat.js +20 -4
- package/dist/models/chat.js.map +1 -1
- package/dist/models/types.d.ts +16 -0
- package/dist/models/types.d.ts.map +1 -1
- package/dist/models/types.js.map +1 -1
- package/dist/private.d.ts.map +1 -1
- package/dist/private.js +29 -1
- package/dist/private.js.map +1 -1
- package/dist/providers/anthropic.d.ts +30 -4
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +130 -29
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/index.d.ts +42 -6
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +132 -48
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/mock.d.ts +6 -3
- package/dist/providers/mock.d.ts.map +1 -1
- package/dist/providers/mock.js +9 -4
- package/dist/providers/mock.js.map +1 -1
- package/dist/providers/openai.d.ts +54 -8
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +164 -32
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/options.d.ts +177 -0
- package/dist/providers/options.d.ts.map +1 -0
- package/dist/providers/options.js +67 -0
- package/dist/providers/options.js.map +1 -0
- package/dist/providers/scripted.d.ts +49 -0
- package/dist/providers/scripted.d.ts.map +1 -0
- package/dist/providers/scripted.js +90 -0
- package/dist/providers/scripted.js.map +1 -0
- package/dist/providers/types.d.ts +60 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/tools/metadata.d.ts +24 -0
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +8 -0
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/registry.d.ts +10 -3
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +9 -4
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/terminal.d.ts +33 -0
- package/dist/tools/terminal.d.ts.map +1 -0
- package/dist/tools/terminal.js +32 -0
- package/dist/tools/terminal.js.map +1 -0
- package/package.json +4 -3
package/dist/agent.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { runEventEmitter, } from "./events.js";
|
|
2
2
|
import { nativeLoop, runWithEvents, } from "./loop.js";
|
|
3
|
-
import { asChatModel } from "./models/chat.js";
|
|
3
|
+
import { asChatModel, chatRequest } from "./models/chat.js";
|
|
4
4
|
import { deadlineSignal, isAbortError } from "./signals.js";
|
|
5
5
|
import { executeTool } from "./tools/registry.js";
|
|
6
|
-
import { toToolSpecs } from "./tools/metadata.js";
|
|
6
|
+
import { toToolSpecs, toolDispatch } from "./tools/metadata.js";
|
|
7
7
|
const DEFAULT_MAX_STEPS = 12;
|
|
8
8
|
const FALLBACK_MAX_DURATION_MS = 10 * 60 * 1000;
|
|
9
9
|
/** Resolve the wall-clock run budget from env, falling back to 10 minutes. */
|
|
@@ -18,7 +18,7 @@ const FALLBACK_MAX_TOOL_RESULT_BYTES = 64 * 1024;
|
|
|
18
18
|
* One place, deliberately. A {@link Loop} is handed numbers rather than
|
|
19
19
|
* optionals, so if each caller resolved its own defaults a second loop
|
|
20
20
|
* implementation could silently run to a different ceiling than the one the
|
|
21
|
-
* kernel ships. `runAgent` and `NativeEngine`
|
|
21
|
+
* kernel ships. `runAgent`, `runConversation` and `NativeEngine` all come here.
|
|
22
22
|
*/
|
|
23
23
|
export function resolveLoopLimits(limits) {
|
|
24
24
|
return {
|
|
@@ -77,48 +77,222 @@ function detach(input) {
|
|
|
77
77
|
return { ...input };
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The result a tool call gets when the run stopped before it could start. A
|
|
82
|
+
* stopped run must still return a transcript with every call answered: a
|
|
83
|
+
* consumer that stores `messages` and resumes the conversation sends it back
|
|
84
|
+
* to a provider, and every provider rejects a tool call with no result.
|
|
85
|
+
*/
|
|
86
|
+
function notRun(callId) {
|
|
87
|
+
return {
|
|
88
|
+
toolCallId: callId,
|
|
89
|
+
content: "not run: the run was stopped before this tool call",
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
80
93
|
function truncate(text, max = maxToolResultBytes()) {
|
|
81
94
|
return text.length <= max
|
|
82
95
|
? text
|
|
83
96
|
: `${text.slice(0, max)}\n…[truncated ${text.length - max} bytes]`;
|
|
84
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Add one call's usage to the running total. Only token usage is summed: a
|
|
100
|
+
* unit-billed kind (`units`) has no place in a chat loop's total, and a call
|
|
101
|
+
* that reported nothing leaves the total as it was rather than zeroing it.
|
|
102
|
+
*/
|
|
103
|
+
function addUsage(total, next) {
|
|
104
|
+
if (!next || "units" in next)
|
|
105
|
+
return total;
|
|
106
|
+
const sum = { ...(total ?? {}) };
|
|
107
|
+
for (const key of [
|
|
108
|
+
"inputTokens",
|
|
109
|
+
"outputTokens",
|
|
110
|
+
"totalTokens",
|
|
111
|
+
"cacheReadTokens",
|
|
112
|
+
"cacheWriteTokens",
|
|
113
|
+
"reasoningTokens",
|
|
114
|
+
]) {
|
|
115
|
+
const n = next[key];
|
|
116
|
+
if (typeof n === "number")
|
|
117
|
+
sum[key] = (sum[key] ?? 0) + n;
|
|
118
|
+
}
|
|
119
|
+
// Cost is summed by amount. Every reporter bills in USD today, and the type
|
|
120
|
+
// admits nothing else, so there is no mixed-currency case to guard.
|
|
121
|
+
if (next.reportedCost) {
|
|
122
|
+
sum.reportedCost = {
|
|
123
|
+
amount: (sum.reportedCost?.amount ?? 0) + next.reportedCost.amount,
|
|
124
|
+
currency: next.reportedCost.currency,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return sum;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A call whose raw arguments were cut off: the dialect delivered text and that
|
|
131
|
+
* text does not parse as a JSON object. The parsed `input` is `{}` in that
|
|
132
|
+
* case, which would run the tool with nothing, so the loop refuses the call
|
|
133
|
+
* instead. Empty or whitespace text is the ambiguous case: some upstreams emit
|
|
134
|
+
* it for a genuine zero-argument call, and a turn cut off before the JSON
|
|
135
|
+
* began looks identical. It is read as truncated only when the turn's
|
|
136
|
+
* `finishReason` is `length`, which is the one situation where the cut-off
|
|
137
|
+
* reading is the safe one. A dialect that delivers no text (Anthropic) cannot
|
|
138
|
+
* be judged here.
|
|
139
|
+
*/
|
|
140
|
+
export function isTruncatedCall(call, finishReason) {
|
|
141
|
+
const raw = call.argumentsText;
|
|
142
|
+
if (raw === undefined)
|
|
143
|
+
return false;
|
|
144
|
+
if (raw.trim() === "")
|
|
145
|
+
return finishReason === "length";
|
|
146
|
+
try {
|
|
147
|
+
const parsed = JSON.parse(raw);
|
|
148
|
+
return !(parsed !== null && typeof parsed === "object" && !Array.isArray(parsed));
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** The seed a loop can continue: non-empty, and not waiting on the caller. */
|
|
155
|
+
function assertSeed(messages) {
|
|
156
|
+
const last = messages[messages.length - 1];
|
|
157
|
+
if (!last) {
|
|
158
|
+
throw new Error("conversation seed is empty: the loop needs at least one user message to answer");
|
|
159
|
+
}
|
|
160
|
+
if (last.role === "assistant") {
|
|
161
|
+
throw new Error("conversation seed ends with an assistant message, so the model has nothing to answer: " +
|
|
162
|
+
"end it with a user message, or with the tool results the model is waiting for");
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** The finer reason a custom loop's bare outcome implies, when it reported none. */
|
|
166
|
+
function stopReasonFor(outcome) {
|
|
167
|
+
return outcome === "completed" ? "end_turn" : outcome;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Thrown by {@link runAgent} when the model's final prose was cut off at the
|
|
171
|
+
* output token cap (`stopReason: "length"`, or a budget summary that ended
|
|
172
|
+
* with `finishReason: "length"`). A bare string cannot say "this is not whole", and a caller
|
|
173
|
+
* that got one would apply it as an answer, so the single-shot form refuses
|
|
174
|
+
* instead. The partial text and the full result ride on the error for a
|
|
175
|
+
* caller that wants them; {@link runConversation} returns the same run with
|
|
176
|
+
* `stopReason: "length"` and never throws for it.
|
|
177
|
+
*/
|
|
178
|
+
export class TruncatedAnswerError extends Error {
|
|
179
|
+
/** The cut-off prose, exactly as the model left it. */
|
|
180
|
+
text;
|
|
181
|
+
/** The whole run, as `runConversation` would have returned it. */
|
|
182
|
+
result;
|
|
183
|
+
constructor(result) {
|
|
184
|
+
super("the answer was cut off at the output token limit and is not whole; raise " +
|
|
185
|
+
"providerOptions.maxTokens or use runConversation(), which returns the partial " +
|
|
186
|
+
'text with stopReason "length" instead of throwing');
|
|
187
|
+
this.name = "TruncatedAnswerError";
|
|
188
|
+
this.text = result.text;
|
|
189
|
+
this.result = result;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
85
192
|
/**
|
|
86
193
|
* Drives a provider-agnostic tool-use loop: the model converses, the runner
|
|
87
194
|
* executes any requested tools in the sandbox, feeds the results back, and
|
|
88
195
|
* repeats until the model stops calling tools (or the step budget is hit). The
|
|
89
196
|
* model orchestrates; deterministic work happens in the tools.
|
|
197
|
+
*
|
|
198
|
+
* This is the single-shot form: one user prompt in, the final prose out. It is
|
|
199
|
+
* {@link runConversation} with a one-message seed, kept because most callers
|
|
200
|
+
* want exactly that and nothing more. The one thing a string cannot carry is
|
|
201
|
+
* "cut off", so a `length` stop throws {@link TruncatedAnswerError} here
|
|
202
|
+
* rather than returning partial prose that reads as complete.
|
|
90
203
|
*/
|
|
91
204
|
export async function runAgent(options) {
|
|
205
|
+
const { userPrompt, ...rest } = options;
|
|
206
|
+
const result = await runConversation({
|
|
207
|
+
...rest,
|
|
208
|
+
messages: [{ role: "user", text: userPrompt }],
|
|
209
|
+
});
|
|
210
|
+
// `stopReason: "length"` is the plain case; a budget summary cut at the cap
|
|
211
|
+
// ends `steps_exhausted` with `finishReason: "length"`, and its text is just
|
|
212
|
+
// as partial. A canceled or timed-out run is not judged here: the
|
|
213
|
+
// cancellation contract is that it resolves with its note, never rejects,
|
|
214
|
+
// even when the last turn to land before the stop happened to be cut.
|
|
215
|
+
const stopped = result.outcome === "canceled" || result.outcome === "timed_out";
|
|
216
|
+
if (!stopped && (result.stopReason === "length" || result.finishReason === "length")) {
|
|
217
|
+
throw new TruncatedAnswerError(result);
|
|
218
|
+
}
|
|
219
|
+
return result.text;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Run the tool-use loop over a conversation: the stored history plus the new
|
|
223
|
+
* user turn in, the whole transcript out, with the structured answer when a
|
|
224
|
+
* terminal tool gave one.
|
|
225
|
+
*
|
|
226
|
+
* The kernel stores nothing between calls. A conversational application keeps
|
|
227
|
+
* `result.messages` wherever it keeps its state and seeds the next call with
|
|
228
|
+
* it; what the kernel owes it is a faithful transcript, a summed bill, the
|
|
229
|
+
* reason the run stopped, and the name of what served it.
|
|
230
|
+
*/
|
|
231
|
+
export async function runConversation(options) {
|
|
92
232
|
// A `Provider` is adapted onto the model seam; a `ChatModel` passes straight
|
|
93
233
|
// through. Either way the loop talks to one interface, so a
|
|
94
234
|
// middleware-wrapped or registry-resolved model drives it identically.
|
|
95
235
|
const log = options.log ?? (() => { });
|
|
236
|
+
const model = asChatModel(options.provider);
|
|
237
|
+
// Recorded before the caller's sink sees each event, so a sink that throws
|
|
238
|
+
// (which the emitter absorbs) still leaves the recording complete.
|
|
239
|
+
const events = [];
|
|
240
|
+
const sink = (event) => {
|
|
241
|
+
events.push(event);
|
|
242
|
+
options.emit?.(event);
|
|
243
|
+
};
|
|
96
244
|
const result = await runWithEvents(nativeLoop, {
|
|
97
|
-
model
|
|
245
|
+
model,
|
|
98
246
|
system: options.system,
|
|
99
|
-
|
|
247
|
+
messages: options.messages,
|
|
100
248
|
tools: options.tools,
|
|
101
249
|
limits: resolveLoopLimits(options),
|
|
250
|
+
...(options.providerOptions ? { providerOptions: options.providerOptions } : {}),
|
|
102
251
|
}, {
|
|
103
252
|
log,
|
|
104
|
-
events: runEventEmitter(
|
|
253
|
+
events: runEventEmitter(sink, log),
|
|
105
254
|
...(options.signal ? { signal: options.signal } : {}),
|
|
106
255
|
...(options.runId !== undefined ? { runId: options.runId } : {}),
|
|
107
256
|
});
|
|
108
|
-
return
|
|
257
|
+
return {
|
|
258
|
+
text: result.text,
|
|
259
|
+
// A custom loop that reports no transcript still must not hand the caller
|
|
260
|
+
// its own seed array back: the doc promises a new one.
|
|
261
|
+
messages: result.messages ?? [...options.messages],
|
|
262
|
+
events,
|
|
263
|
+
steps: result.steps,
|
|
264
|
+
outcome: result.outcome,
|
|
265
|
+
stopReason: result.stopReason ?? stopReasonFor(result.outcome),
|
|
266
|
+
provider: result.provider ?? model.id,
|
|
267
|
+
responseIds: result.responseIds ?? [],
|
|
268
|
+
...(result.model !== undefined ? { model: result.model } : {}),
|
|
269
|
+
...(result.upstream !== undefined ? { upstream: result.upstream } : {}),
|
|
270
|
+
...(result.finishReason !== undefined ? { finishReason: result.finishReason } : {}),
|
|
271
|
+
...(result.usage ? { usage: result.usage } : {}),
|
|
272
|
+
...(result.terminal ? { terminal: result.terminal } : {}),
|
|
273
|
+
};
|
|
109
274
|
}
|
|
110
275
|
/**
|
|
111
276
|
* The native tool-use loop, as a {@link Loop}.
|
|
112
277
|
*
|
|
113
278
|
* Exported for `loop.ts` to wrap; applications reach it through `nativeLoop`
|
|
114
279
|
* rather than calling this directly. It is the whole of the kernel's control
|
|
115
|
-
* flow, and the only place any of it lives — `runAgent
|
|
116
|
-
* come here, so
|
|
280
|
+
* flow, and the only place any of it lives — `runAgent`, `runConversation` and
|
|
281
|
+
* `nativeLoop` all come here, so they cannot drift.
|
|
117
282
|
*/
|
|
118
283
|
export async function runNativeLoop(req, loopCtx) {
|
|
119
|
-
const { model, system,
|
|
284
|
+
const { model, system, tools, providerOptions } = req;
|
|
120
285
|
const { maxSteps, maxDurationMs } = req.limits;
|
|
121
286
|
const log = loopCtx.log;
|
|
287
|
+
// Both checks come before the first model call: a bad seed or a tool this
|
|
288
|
+
// loop cannot dispatch is a configuration error, and the cheapest failure is
|
|
289
|
+
// the one that spends no tokens.
|
|
290
|
+
assertSeed(req.messages);
|
|
291
|
+
const external = tools.filter((t) => toolDispatch(t) === "external").map((t) => t.spec.name);
|
|
292
|
+
if (external.length > 0) {
|
|
293
|
+
throw new Error(`tool(s) ${external.join(", ")} declare dispatch "external", which needs a loop that can ` +
|
|
294
|
+
"suspend on a pending call and resume with its result; the native loop cannot yet");
|
|
295
|
+
}
|
|
122
296
|
// One signal for the whole run: the caller's cancel merged with the run's own
|
|
123
297
|
// deadline. It reaches every model call (through `InvokeContext.signal`, down
|
|
124
298
|
// to the provider's HTTP request) and every tool (through `ToolContext`), so
|
|
@@ -131,7 +305,12 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
131
305
|
const events = loopCtx.events;
|
|
132
306
|
const byName = new Map(tools.map((t) => [t.spec.name, t]));
|
|
133
307
|
const specs = toToolSpecs(tools);
|
|
134
|
-
|
|
308
|
+
// The seed is the caller's. It is copied so the loop's appends never reach
|
|
309
|
+
// the array it was handed: a service that kept the seed for its own records
|
|
310
|
+
// must not find it grown.
|
|
311
|
+
const messages = [...req.messages];
|
|
312
|
+
const request = (toolSpecs) => chatRequest(system, messages, toolSpecs, undefined, providerOptions);
|
|
313
|
+
const provider = model.id;
|
|
135
314
|
const deadlineAt = Date.now() + maxDurationMs;
|
|
136
315
|
let finalText = "";
|
|
137
316
|
let lastAssistantText = "";
|
|
@@ -139,6 +318,29 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
139
318
|
let timedOut = false;
|
|
140
319
|
let stepsTaken = 0;
|
|
141
320
|
let step = 0;
|
|
321
|
+
let usage;
|
|
322
|
+
let servedModel;
|
|
323
|
+
let servedUpstream;
|
|
324
|
+
let terminal;
|
|
325
|
+
let lastFinish;
|
|
326
|
+
let cutOff = false;
|
|
327
|
+
const responseIds = [];
|
|
328
|
+
/** Everything a result carries besides the three the caller decides per path. */
|
|
329
|
+
const result = (text, outcome, stopReason) => ({
|
|
330
|
+
text,
|
|
331
|
+
steps: stepsTaken,
|
|
332
|
+
outcome,
|
|
333
|
+
stopReason,
|
|
334
|
+
messages,
|
|
335
|
+
provider,
|
|
336
|
+
responseIds,
|
|
337
|
+
...(servedModel !== undefined ? { model: servedModel } : {}),
|
|
338
|
+
...(servedUpstream !== undefined ? { upstream: servedUpstream } : {}),
|
|
339
|
+
...(lastFinish !== undefined ? { finishReason: lastFinish } : {}),
|
|
340
|
+
...(usage ? { usage } : {}),
|
|
341
|
+
// Only a run that ended BECAUSE of the terminal call reports it.
|
|
342
|
+
...(terminal && stopReason === "terminal_tool" ? { terminal } : {}),
|
|
343
|
+
});
|
|
142
344
|
/**
|
|
143
345
|
* The run was stopped mid-flight. `signal.reason` says by whom: the deadline
|
|
144
346
|
* signal's own reason means the budget ran out (`timed_out`); anything else
|
|
@@ -152,12 +354,12 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
152
354
|
log(`reached run time budget (${maxDurationMs}ms) during step ${step}; in-flight work aborted`);
|
|
153
355
|
events.emit({ type: "run.budget_exhausted", kind: "duration", step });
|
|
154
356
|
const text = `${accumulated}\n\n[run stopped: wall-clock budget of ${maxDurationMs}ms exceeded]`;
|
|
155
|
-
return
|
|
357
|
+
return result(text, "timed_out", "timed_out");
|
|
156
358
|
}
|
|
157
359
|
const why = describeReason(signal.reason);
|
|
158
360
|
log(`run canceled during step ${step}${why ? `: ${why}` : ""}`);
|
|
159
361
|
const text = `${accumulated}\n\n[run stopped: canceled${why ? ` (${why})` : ""}]`;
|
|
160
|
-
return
|
|
362
|
+
return result(text, "canceled", "canceled");
|
|
161
363
|
};
|
|
162
364
|
try {
|
|
163
365
|
for (; step < maxSteps; step += 1) {
|
|
@@ -172,34 +374,63 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
172
374
|
break;
|
|
173
375
|
}
|
|
174
376
|
signal.throwIfAborted();
|
|
175
|
-
const turnResult = await model.invoke(
|
|
377
|
+
const turnResult = await model.invoke(request(specs), ctx);
|
|
176
378
|
const turn = turnResult.value;
|
|
177
379
|
stepsTaken = step + 1;
|
|
178
|
-
|
|
380
|
+
// The transcript keeps a detached copy of each call: a tool is handed its
|
|
381
|
+
// own copy below, so an executor that mutates its input can rewrite
|
|
382
|
+
// neither what the model said nor what is replayed on the next request.
|
|
383
|
+
const calls = turn.toolCalls.map((c) => ({ ...c, input: detach(c.input) }));
|
|
384
|
+
messages.push({ role: "assistant", text: turn.text, toolCalls: calls });
|
|
179
385
|
if (turn.text)
|
|
180
386
|
lastAssistantText = turn.text;
|
|
387
|
+
usage = addUsage(usage, turnResult.usage);
|
|
388
|
+
// Both describe the LAST response, so a response that names neither
|
|
389
|
+
// clears an earlier value rather than letting it stand in an audit.
|
|
390
|
+
servedModel = turn.model;
|
|
391
|
+
servedUpstream = turn.upstream;
|
|
392
|
+
if (turn.responseId)
|
|
393
|
+
responseIds.push(turn.responseId);
|
|
394
|
+
lastFinish = turn.finishReason;
|
|
181
395
|
events.emit({
|
|
182
396
|
type: "model.turn",
|
|
183
397
|
step,
|
|
184
398
|
text: turn.text,
|
|
185
399
|
toolCalls: turn.toolCalls.map((c) => ({ id: c.id, name: c.name })),
|
|
186
400
|
...(turnResult.usage ? { usage: turnResult.usage } : {}),
|
|
401
|
+
...(turn.model ? { model: turn.model } : {}),
|
|
402
|
+
...(turn.responseId ? { responseId: turn.responseId } : {}),
|
|
403
|
+
...(turn.upstream ? { upstream: turn.upstream } : {}),
|
|
404
|
+
...(turn.finishReason ? { finishReason: turn.finishReason } : {}),
|
|
187
405
|
});
|
|
188
406
|
// A model that ignored its signal can still answer after the stop. The
|
|
189
407
|
// turn happened, so it is recorded above and its prose is kept, but the
|
|
190
408
|
// outcome is the stop's — `canceled` or `timed_out`, never `completed` —
|
|
191
|
-
// and none of the tools it asked for run.
|
|
192
|
-
|
|
409
|
+
// and none of the tools it asked for run. Each call it asked for still
|
|
410
|
+
// gets a result, so the transcript it leaves behind can be resumed.
|
|
411
|
+
if (signal.aborted) {
|
|
412
|
+
if (calls.length > 0) {
|
|
413
|
+
messages.push({ role: "tool", results: calls.map((c) => notRun(c.id)) });
|
|
414
|
+
}
|
|
193
415
|
return stopped();
|
|
194
|
-
|
|
416
|
+
}
|
|
417
|
+
if (calls.length === 0) {
|
|
195
418
|
finalText = turn.text;
|
|
419
|
+
// A prose answer the output cap cut short. The run still completes,
|
|
420
|
+
// but `stopReason: "length"` tells the caller not to apply the text
|
|
421
|
+
// as if it were whole.
|
|
422
|
+
cutOff = turn.finishReason === "length";
|
|
196
423
|
break;
|
|
197
424
|
}
|
|
198
425
|
const results = [];
|
|
199
|
-
for (const call of
|
|
426
|
+
for (const call of calls) {
|
|
200
427
|
// Never START a tool once the run is stopping: a side effect begun
|
|
201
|
-
// after a cancel is the one thing a cancel must prevent.
|
|
202
|
-
|
|
428
|
+
// after a cancel is the one thing a cancel must prevent. The call is
|
|
429
|
+
// answered as not run rather than skipped, so the turn still closes.
|
|
430
|
+
if (signal.aborted) {
|
|
431
|
+
results.push(notRun(call.id));
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
203
434
|
const tool = byName.get(call.name);
|
|
204
435
|
if (!tool) {
|
|
205
436
|
results.push({
|
|
@@ -218,6 +449,36 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
218
449
|
});
|
|
219
450
|
continue;
|
|
220
451
|
}
|
|
452
|
+
// A call the output cap cut off is never run and never an answer. A
|
|
453
|
+
// terminal call on a `length` turn is refused even when its arguments
|
|
454
|
+
// parsed: the turn was cut, so the answer cannot be trusted whole. On
|
|
455
|
+
// a `length` turn any other call runs only when its raw arguments are
|
|
456
|
+
// present and parse (proof it was whole); a dialect that delivers no
|
|
457
|
+
// raw text (Anthropic) cannot give that proof, so its calls on a cut
|
|
458
|
+
// turn are refused too. On a whole turn, only arguments that do not
|
|
459
|
+
// parse are refused, since running `{}` would be running something the
|
|
460
|
+
// model did not say. The model is told, and answers again within its
|
|
461
|
+
// budgets.
|
|
462
|
+
const cut = turn.finishReason === "length";
|
|
463
|
+
const refusal = cut && toolDispatch(tool) === "terminal"
|
|
464
|
+
? "answer cut off at the output token limit; it was not accepted. Answer again, more briefly."
|
|
465
|
+
: (cut && call.argumentsText === undefined) || isTruncatedCall(call, turn.finishReason)
|
|
466
|
+
? "tool call arguments were cut off at the output token limit and did not parse; " +
|
|
467
|
+
"the call was not run. Call again, more briefly."
|
|
468
|
+
: undefined;
|
|
469
|
+
if (refusal !== undefined) {
|
|
470
|
+
results.push({ toolCallId: call.id, content: refusal, isError: true });
|
|
471
|
+
log(`tool ${call.name} refused: truncated`);
|
|
472
|
+
events.emit({
|
|
473
|
+
type: "tool.failed",
|
|
474
|
+
step,
|
|
475
|
+
callId: call.id,
|
|
476
|
+
name: call.name,
|
|
477
|
+
reason: "truncated",
|
|
478
|
+
error: refusal,
|
|
479
|
+
});
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
221
482
|
// Emitted BEFORE execution: a process that dies mid-tool still leaves
|
|
222
483
|
// evidence that the effect may have started, which is the one case a
|
|
223
484
|
// rollback consumer cannot afford to infer from silence.
|
|
@@ -233,7 +494,8 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
233
494
|
// Uses the tool's structured executor when it has one, so a typed
|
|
234
495
|
// payload survives alongside the string the model sees. Tools without
|
|
235
496
|
// one take the original string path unchanged.
|
|
236
|
-
|
|
497
|
+
// The tool gets its own copy; `call.input` stays the model's words.
|
|
498
|
+
const output = await executeTool(tool, detach(call.input), {
|
|
237
499
|
signal,
|
|
238
500
|
callId: call.id,
|
|
239
501
|
...(loopCtx.runId !== undefined ? { runId: loopCtx.runId } : {}),
|
|
@@ -255,6 +517,13 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
255
517
|
bytes: Buffer.byteLength(output.content, "utf8"),
|
|
256
518
|
...undoFields(tool.meta),
|
|
257
519
|
});
|
|
520
|
+
// A terminal tool that returned is the run's answer. Its executor
|
|
521
|
+
// ran like any other (a throw above is an ordinary tool error the
|
|
522
|
+
// model gets to correct), and the rest of this turn's calls still
|
|
523
|
+
// get their results so the transcript stays whole.
|
|
524
|
+
if (!terminal && toolDispatch(tool) === "terminal") {
|
|
525
|
+
terminal = { callId: call.id, name: call.name, input: call.input, output };
|
|
526
|
+
}
|
|
258
527
|
}
|
|
259
528
|
catch (err) {
|
|
260
529
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -275,6 +544,19 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
275
544
|
}
|
|
276
545
|
}
|
|
277
546
|
messages.push({ role: "tool", results });
|
|
547
|
+
// A tool that ignored its signal can still return after the stop. Its
|
|
548
|
+
// result is kept (the transcript stays whole), but the outcome is the
|
|
549
|
+
// stop's — a terminal call that landed after a cancel is not an answer
|
|
550
|
+
// the caller asked for, so it is not reported as one.
|
|
551
|
+
if (signal.aborted)
|
|
552
|
+
return stopped();
|
|
553
|
+
// Checked before the step budget, so an answer given on the last allowed
|
|
554
|
+
// step is still `completed` rather than `steps_exhausted`.
|
|
555
|
+
if (terminal) {
|
|
556
|
+
log(`terminal tool ${terminal.name} answered; ending the run`);
|
|
557
|
+
finalText = turn.text;
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
278
560
|
if (step === maxSteps - 1) {
|
|
279
561
|
exhausted = true;
|
|
280
562
|
events.emit({ type: "run.budget_exhausted", kind: "steps", step });
|
|
@@ -290,12 +572,17 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
290
572
|
return stopped();
|
|
291
573
|
throw err;
|
|
292
574
|
}
|
|
575
|
+
// A terminal tool answered: the prose is whatever the turn said (often
|
|
576
|
+
// nothing), and the structured answer rides on `terminal`. No placeholder
|
|
577
|
+
// text — an empty string is the honest value here.
|
|
578
|
+
if (terminal)
|
|
579
|
+
return result(finalText, "completed", "terminal_tool");
|
|
293
580
|
// Ran out of time mid-loop: don't spend more of the (already-blown) budget on
|
|
294
581
|
// a summary call — just return whatever prose we accumulated, clearly noted.
|
|
295
582
|
if (!finalText && timedOut) {
|
|
296
583
|
const accumulated = lastAssistantText || "(no output before time budget exhausted)";
|
|
297
584
|
const text = `${accumulated}\n\n[run stopped: wall-clock budget of ${maxDurationMs}ms exceeded]`;
|
|
298
|
-
return
|
|
585
|
+
return result(text, "timed_out", "timed_out");
|
|
299
586
|
}
|
|
300
587
|
// Hit the step budget mid-tool-use: ask once more with no tools so the model
|
|
301
588
|
// can summarize, falling back to its last prose rather than losing the work.
|
|
@@ -306,8 +593,14 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
306
593
|
if (signal.aborted)
|
|
307
594
|
return stopped();
|
|
308
595
|
try {
|
|
309
|
-
const summaryResult = await model.invoke(
|
|
596
|
+
const summaryResult = await model.invoke(request([]), ctx);
|
|
310
597
|
const summary = summaryResult.value;
|
|
598
|
+
usage = addUsage(usage, summaryResult.usage);
|
|
599
|
+
servedModel = summary.model;
|
|
600
|
+
servedUpstream = summary.upstream;
|
|
601
|
+
if (summary.responseId)
|
|
602
|
+
responseIds.push(summary.responseId);
|
|
603
|
+
lastFinish = summary.finishReason;
|
|
311
604
|
// Emitted like any other turn: `run.finished.text` can come from this
|
|
312
605
|
// call, and a terminal event whose text traces back to no turn in the
|
|
313
606
|
// transcript would break the stream's one promise.
|
|
@@ -317,7 +610,14 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
317
610
|
text: summary.text,
|
|
318
611
|
toolCalls: [],
|
|
319
612
|
...(summaryResult.usage ? { usage: summaryResult.usage } : {}),
|
|
613
|
+
...(summary.model ? { model: summary.model } : {}),
|
|
614
|
+
...(summary.responseId ? { responseId: summary.responseId } : {}),
|
|
615
|
+
...(summary.upstream ? { upstream: summary.upstream } : {}),
|
|
616
|
+
...(summary.finishReason ? { finishReason: summary.finishReason } : {}),
|
|
320
617
|
});
|
|
618
|
+
// The summary is part of the conversation too: a caller that stores
|
|
619
|
+
// `messages` and resumes later should see what the model last said.
|
|
620
|
+
messages.push({ role: "assistant", text: summary.text, toolCalls: [] });
|
|
321
621
|
finalText = summary.text || lastAssistantText;
|
|
322
622
|
// Same rule as a turn: a summary that arrives after the stop is kept,
|
|
323
623
|
// but the run still ends with the stop's outcome.
|
|
@@ -347,9 +647,16 @@ export async function runNativeLoop(req, loopCtx) {
|
|
|
347
647
|
// `steps_exhausted`, because the distinction is exactly what a consumer needs
|
|
348
648
|
// to know about the trustworthiness of the answer.
|
|
349
649
|
const outcome = timedOut ? "timed_out" : exhausted ? "steps_exhausted" : "completed";
|
|
650
|
+
const stopReason = timedOut
|
|
651
|
+
? "timed_out"
|
|
652
|
+
: exhausted
|
|
653
|
+
? "steps_exhausted"
|
|
654
|
+
: cutOff
|
|
655
|
+
? "length"
|
|
656
|
+
: "end_turn";
|
|
350
657
|
// `runWithEvents` builds the terminal event from exactly this result, so the
|
|
351
658
|
// return value and the stream cannot disagree — there is one source now, not
|
|
352
659
|
// two that happen to be written from the same variables.
|
|
353
|
-
return
|
|
660
|
+
return result(text, outcome, stopReason);
|
|
354
661
|
}
|
|
355
662
|
//# sourceMappingURL=agent.js.map
|
package/dist/agent.js.map
CHAN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@@ export declare class NativeEngine implements AgentEngine {
|
|
|
43
43
|
private readonly loop;
|
|
44
44
|
constructor(options?: NativeEngineOptions);
|
|
45
45
|
/**
|
|
46
|
+
* A run is refused here, with a reason, when its provider cannot be resolved
|
|
47
|
+
* to a credential: the same check `selectProvider` makes, surfaced before any
|
|
48
|
+
* sandbox is prepared. Set `provider.allowMockFallback` (or
|
|
49
|
+
* `provider.preferred: "mock"`) to run offline instead.
|
|
50
|
+
*
|
|
46
51
|
* A private run must stay on local inference, and that is a guarantee, not a
|
|
47
52
|
* preference: it is refused unless the run names the `local` provider AND the
|
|
48
53
|
* host has one configured. There is no fallback to a cloud provider found in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../src/engines/native.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1F,OAAO,EAA6B,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAMjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAElG;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAA;AAE9D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAA;IACpC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AAED;;;;;;GAMG;AACH,qBAAa,YAAa,YAAW,WAAW;IAC9C,QAAQ,CAAC,IAAI,YAAW;IAExB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;IAC/C,OAAO,CAAC,QAAQ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