@livx.cc/agentx 0.99.37 → 0.99.39
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/dist/{Agent-B--fZNJy.d.ts → Agent-DJwg1g8V.d.ts} +14 -4
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +15 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/tools.shell.js +3 -2
- package/dist/tools.shell.js.map +1 -1
- package/package.json +1 -1
|
@@ -199,10 +199,15 @@ interface RunResult {
|
|
|
199
199
|
};
|
|
200
200
|
/** True if ANY turn's usage was estimated (provider gave none) rather than exact — lets the UI mark cost `~`. */
|
|
201
201
|
usageEstimated?: boolean;
|
|
202
|
-
/** Advertised tools the model NAMED in
|
|
203
|
-
* to them — a fabricated tool use, proven against ground truth rather than guessed
|
|
204
|
-
*
|
|
205
|
-
*
|
|
202
|
+
/** Advertised tools the model NAMED in the reply it is handing back while the run's invocation ledger
|
|
203
|
+
* shows zero calls to them — a fabricated tool use, proven against ground truth rather than guessed
|
|
204
|
+
* from phrasing. A host can use it to tell the user plainly instead of shipping the invented result.
|
|
205
|
+
*
|
|
206
|
+
* Re-evaluated at RETURN time, not frozen at detection: a claim the recovery nudge rescued (the model
|
|
207
|
+
* went and made the real call) is dropped. It used to survive, on the reading that the field recorded
|
|
208
|
+
* "this turn needed rescuing" — but the only consumer turns it into a sentence for the user ("I never
|
|
209
|
+
* ran it"), and on the guard's own success path that sentence is false. Whether a turn needed rescuing
|
|
210
|
+
* is a telemetry question, and the `log.warn` at the nudge already answers it. */
|
|
206
211
|
fabricatedToolClaims?: string[];
|
|
207
212
|
error?: unknown;
|
|
208
213
|
}
|
|
@@ -546,6 +551,11 @@ declare class Agent {
|
|
|
546
551
|
* a rarer case at the cost of the common honest one.
|
|
547
552
|
*/
|
|
548
553
|
private fabricatedToolNames;
|
|
554
|
+
/** The claims still standing at return time: named in this run's prose, and STILL absent from the
|
|
555
|
+
* invocation ledger. Re-checked here rather than trusted from detection because the ledger moves —
|
|
556
|
+
* the recovery nudge can succeed, and then the host would tell the user "I never ran it" about a
|
|
557
|
+
* call that demonstrably ran. See `RunResult.fabricatedToolClaims`. */
|
|
558
|
+
private survivingClaims;
|
|
549
559
|
private dispatch;
|
|
550
560
|
/** `/compact` aims to land the transcript at this fraction of the context window. */
|
|
551
561
|
private static readonly COMPACT_TARGET;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { H as Hooks, i as RunResult, R as ReasoningEffort, A as Agent } from './Agent-
|
|
2
|
+
import { H as Hooks, i as RunResult, R as ReasoningEffort, A as Agent } from './Agent-DJwg1g8V.js';
|
|
3
3
|
import { IFilesystem } from '@livx.cc/wcli/core';
|
|
4
4
|
import { M as Message, U as UserQuestion, H as HostBridge, c as ContentPart, g as MessageContent } from './tools-Byyh_bae.js';
|
|
5
5
|
|
package/dist/cli.js
CHANGED
|
@@ -2150,9 +2150,10 @@ function makeRealShellTool(options) {
|
|
|
2150
2150
|
timeoutMs: { type: "number", description: "wall-clock cap for THIS command, overriding the default (clamped to the tool max)" }
|
|
2151
2151
|
}
|
|
2152
2152
|
},
|
|
2153
|
-
async run({ command, background, timeoutMs: askedTimeoutMs }, ctx) {
|
|
2153
|
+
async run({ command, background, timeoutMs: askedTimeoutMs, timeout: aliasTimeout }, ctx) {
|
|
2154
2154
|
const cmd = String(command ?? "");
|
|
2155
|
-
const
|
|
2155
|
+
const asked = Number.isFinite(askedTimeoutMs) ? askedTimeoutMs : aliasTimeout;
|
|
2156
|
+
const timeoutMs = Number.isFinite(asked) && Number(asked) > 0 ? Math.min(Number(asked), maxTimeoutMs) : defaultTimeoutMs;
|
|
2156
2157
|
if (!cmd.trim()) return "[exit 1] empty command";
|
|
2157
2158
|
if (background) {
|
|
2158
2159
|
if (!options.registry) return "Error: background execution is not enabled in this host (no job registry).";
|
|
@@ -4099,7 +4100,8 @@ var Agent = class _Agent {
|
|
|
4099
4100
|
const kill = (finishReason) => {
|
|
4100
4101
|
log6.warn(`kill-switch: ${finishReason} (steps=${steps}, tokens=${usage.totalTokens}, budgetTokens=${Math.round(usage.totalTokens - 0.9 * usage.cacheReadTokens)}, ms=${Date.now() - start - this.parkedMs}${finishReason === "timeout" ? `, idle=${Date.now() - lastProgressAt - this.parkedMs}ms` : ""}${this.parkedMs ? ` +${this.parkedMs} parked` : ""})`);
|
|
4101
4102
|
this.ctx.jobs?.killAll();
|
|
4102
|
-
|
|
4103
|
+
const claims = this.survivingClaims();
|
|
4104
|
+
return { text: lastAssistantText(this.transcript), steps, finishReason, messages: this.transcript, usage, usageEstimated, ...claims.length ? { fabricatedToolClaims: claims } : {} };
|
|
4103
4105
|
};
|
|
4104
4106
|
while (true) {
|
|
4105
4107
|
if (o.signal?.aborted) return kill("aborted");
|
|
@@ -4262,7 +4264,8 @@ var Agent = class _Agent {
|
|
|
4262
4264
|
await this.ctx.jobs?.drain();
|
|
4263
4265
|
this.releaseStaleImages();
|
|
4264
4266
|
await this.activeHooks?.onStop?.(res.content ?? "");
|
|
4265
|
-
|
|
4267
|
+
const claims = this.survivingClaims();
|
|
4268
|
+
return { text: res.content ?? "", steps, finishReason: "stop", messages: this.transcript, usage, usageEstimated, ...claims.length ? { fabricatedToolClaims: claims } : {} };
|
|
4266
4269
|
}
|
|
4267
4270
|
const fp = toolCalls.map((tc) => tc.function.name + ":" + (tc.function.arguments ?? "")).join("|");
|
|
4268
4271
|
repeats = fp === lastFp ? repeats + 1 : 1;
|
|
@@ -4437,6 +4440,14 @@ var Agent = class _Agent {
|
|
|
4437
4440
|
}
|
|
4438
4441
|
return out;
|
|
4439
4442
|
}
|
|
4443
|
+
/** The claims still standing at return time: named in this run's prose, and STILL absent from the
|
|
4444
|
+
* invocation ledger. Re-checked here rather than trusted from detection because the ledger moves —
|
|
4445
|
+
* the recovery nudge can succeed, and then the host would tell the user "I never ran it" about a
|
|
4446
|
+
* call that demonstrably ran. See `RunResult.fabricatedToolClaims`. */
|
|
4447
|
+
survivingClaims() {
|
|
4448
|
+
if (!this.fabricatedClaims.size) return [];
|
|
4449
|
+
return [...this.fabricatedClaims].filter((n) => !this.invokedTools.has(n));
|
|
4450
|
+
}
|
|
4440
4451
|
async dispatch(tc) {
|
|
4441
4452
|
this.invokedTools.add(tc.function.name);
|
|
4442
4453
|
const tool = this.activeTools.find((t) => t.name === tc.function.name);
|