@livx.cc/agentx 0.99.37 → 0.99.38
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 +12 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as AgentOptions, H as Hooks, i as RunResult, A as Agent } from './Agent-
|
|
2
|
-
export { C as ChatFragment, b as CompactResult, D as DEFAULT_MUTATING, c as Decision, P as PermissionOptions, d as PermissionPolicy, e as PermissionRule, f as PreToolUseDecision, R as ReasoningEffort, g as RecordingHooks, h as RecordingLifecycle, T as ToolUse, j as ToolUseMeta, k as composeHooks, l as estimateTokens, p as planMode, r as reasoningToChatFragment } from './Agent-
|
|
1
|
+
import { a as AgentOptions, H as Hooks, i as RunResult, A as Agent } from './Agent-DJwg1g8V.js';
|
|
2
|
+
export { C as ChatFragment, b as CompactResult, D as DEFAULT_MUTATING, c as Decision, P as PermissionOptions, d as PermissionPolicy, e as PermissionRule, f as PreToolUseDecision, R as ReasoningEffort, g as RecordingHooks, h as RecordingLifecycle, T as ToolUse, j as ToolUseMeta, k as composeHooks, l as estimateTokens, p as planMode, r as reasoningToChatFragment } from './Agent-DJwg1g8V.js';
|
|
3
3
|
export { MODEL_ALIASES, ModelSwitch, ResolveModelSwitchOpts, modelShortLabel, resolveModelAlias, resolveModelSwitch } from './models.js';
|
|
4
4
|
import { IFilesystem, FileMetadata } from '@livx.cc/wcli/core';
|
|
5
5
|
export { CommandExecutor, FileMetadata, IFilesystem, IndexedDbFilesystem, MemFilesystem, registerHeadlessCommands } from '@livx.cc/wcli/core';
|
package/dist/index.js
CHANGED
|
@@ -4064,7 +4064,8 @@ var Agent = class _Agent {
|
|
|
4064
4064
|
const kill = (finishReason) => {
|
|
4065
4065
|
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` : ""})`);
|
|
4066
4066
|
this.ctx.jobs?.killAll();
|
|
4067
|
-
|
|
4067
|
+
const claims = this.survivingClaims();
|
|
4068
|
+
return { text: lastAssistantText(this.transcript), steps, finishReason, messages: this.transcript, usage, usageEstimated, ...claims.length ? { fabricatedToolClaims: claims } : {} };
|
|
4068
4069
|
};
|
|
4069
4070
|
while (true) {
|
|
4070
4071
|
if (o.signal?.aborted) return kill("aborted");
|
|
@@ -4227,7 +4228,8 @@ var Agent = class _Agent {
|
|
|
4227
4228
|
await this.ctx.jobs?.drain();
|
|
4228
4229
|
this.releaseStaleImages();
|
|
4229
4230
|
await this.activeHooks?.onStop?.(res.content ?? "");
|
|
4230
|
-
|
|
4231
|
+
const claims = this.survivingClaims();
|
|
4232
|
+
return { text: res.content ?? "", steps, finishReason: "stop", messages: this.transcript, usage, usageEstimated, ...claims.length ? { fabricatedToolClaims: claims } : {} };
|
|
4231
4233
|
}
|
|
4232
4234
|
const fp = toolCalls.map((tc) => tc.function.name + ":" + (tc.function.arguments ?? "")).join("|");
|
|
4233
4235
|
repeats = fp === lastFp ? repeats + 1 : 1;
|
|
@@ -4402,6 +4404,14 @@ var Agent = class _Agent {
|
|
|
4402
4404
|
}
|
|
4403
4405
|
return out;
|
|
4404
4406
|
}
|
|
4407
|
+
/** The claims still standing at return time: named in this run's prose, and STILL absent from the
|
|
4408
|
+
* invocation ledger. Re-checked here rather than trusted from detection because the ledger moves —
|
|
4409
|
+
* the recovery nudge can succeed, and then the host would tell the user "I never ran it" about a
|
|
4410
|
+
* call that demonstrably ran. See `RunResult.fabricatedToolClaims`. */
|
|
4411
|
+
survivingClaims() {
|
|
4412
|
+
if (!this.fabricatedClaims.size) return [];
|
|
4413
|
+
return [...this.fabricatedClaims].filter((n) => !this.invokedTools.has(n));
|
|
4414
|
+
}
|
|
4405
4415
|
async dispatch(tc) {
|
|
4406
4416
|
this.invokedTools.add(tc.function.name);
|
|
4407
4417
|
const tool = this.activeTools.find((t) => t.name === tc.function.name);
|