@livx.cc/agentx 0.99.94 → 0.99.95
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/cli.js +36 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -10308,6 +10308,37 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
10308
10308
|
}
|
|
10309
10309
|
if (this.silentTurn && res?.finishReason === "error" && refusedCall(res.error)) this.emitHost({ kind: "text_delta", message: fallback ?? _DuplexAgent.FALLBACK_ERROR });
|
|
10310
10310
|
else if (this.silentTurn) await this.ackIfSilent(fallback);
|
|
10311
|
+
else if (this.hollowPromise) await this.followThrough();
|
|
10312
|
+
}
|
|
10313
|
+
/** The turn SAID it is on it ("got it — checking…") but called no tool and nothing is running: a promise nothing
|
|
10314
|
+
* keeps — the user waits on silence (live Para #798: a follow-up while the reflex believed a finished task still ran). */
|
|
10315
|
+
get hollowPromise() {
|
|
10316
|
+
if (!this.options.host || this.turnDispatched || this.leakHit || this.fabricationCut) return false;
|
|
10317
|
+
if (this.voice.transcript.slice(this.turnBase).some((m) => m.tool_calls?.length)) return false;
|
|
10318
|
+
if ([...this.tasks.values()].some((t) => t.status === "running")) return false;
|
|
10319
|
+
return _DuplexAgent.PROMISE_RE.test(this.turnSpoken);
|
|
10320
|
+
}
|
|
10321
|
+
static PROMISE_RE = /\b(?:checking|looking (?:into|it up)|let me (?:check|look|see|find|pull)|i(?:'ll| will) (?:check|look|find|pull)|on it|one (?:moment|sec(?:ond)?))\b/i;
|
|
10322
|
+
static FOLLOW_THROUGH = "[reminder] You told the user you are checking, but no task is running and you called no tool. Keep that promise now: if a finished task result above already answers it, give that answer; otherwise call Act with a clear brief. Do not acknowledge again.";
|
|
10323
|
+
/** Re-prompt the reflex ONCE, tools allowed, to keep its hollow promise; the reminder never stays in the transcript. */
|
|
10324
|
+
async followThrough() {
|
|
10325
|
+
const base = this.voice.transcript.length, reminder = _DuplexAgent.FOLLOW_THROUGH;
|
|
10326
|
+
this.notify("diag", "hollow_promise", { text: this.turnSpoken.trim().slice(0, 80) });
|
|
10327
|
+
this.turnSpoken = "";
|
|
10328
|
+
this.reflexBuf = "";
|
|
10329
|
+
this.reflexForwarded = 0;
|
|
10330
|
+
this.stepMarks = [];
|
|
10331
|
+
this.dropJudge();
|
|
10332
|
+
try {
|
|
10333
|
+
await this.voice.send(reminder);
|
|
10334
|
+
} catch (e) {
|
|
10335
|
+
log21.warn(`follow-through nudge failed: ${e instanceof Error ? e.message : e}`);
|
|
10336
|
+
} finally {
|
|
10337
|
+
const i = this.voice.transcript.findIndex((m, k) => k >= base && m.role === "user" && m.content === reminder);
|
|
10338
|
+
if (i >= 0) this.voice.transcript.splice(i, 1);
|
|
10339
|
+
await this.drainReflex();
|
|
10340
|
+
this.scrubLeakFromTranscript();
|
|
10341
|
+
}
|
|
10311
10342
|
}
|
|
10312
10343
|
/** Rewrite the UNFORWARDED reflex text: drop complete stage-direction parentheticals (STAGE_DIRECTION_RE) and spoken
|
|
10313
10344
|
* junk (scrubSpokenJunk). Only the unforwarded region is touched — already-spoken audio can't be unsent, and
|
|
@@ -14046,10 +14077,11 @@ var SecondChannel = class {
|
|
|
14046
14077
|
if (this[k]) clearTimeout(this[k]);
|
|
14047
14078
|
this[k] = null;
|
|
14048
14079
|
}
|
|
14049
|
-
|
|
14080
|
+
const wait = Math.max(this.o.bridgeDelayMs, this.o.minGapMs - (this.o.now() - this.lastAt));
|
|
14081
|
+
if (wait > 0) this.bridgeTimer = setTimeout(() => {
|
|
14050
14082
|
this.bridgeTimer = null;
|
|
14051
14083
|
void this.consider("working");
|
|
14052
|
-
},
|
|
14084
|
+
}, wait);
|
|
14053
14085
|
else void this.consider("working");
|
|
14054
14086
|
}
|
|
14055
14087
|
}
|
|
@@ -14133,7 +14165,8 @@ var SecondChannel = class {
|
|
|
14133
14165
|
if (this.o.decide) {
|
|
14134
14166
|
const d = await withBudget(this.o.decide(this.tail(), this.state(pauseMs)), this.o.decisionBudgetMs, "channel decision");
|
|
14135
14167
|
choice = d?.choice;
|
|
14136
|
-
if (choice && choice in CHANNEL_ACTIONS) kind = choice;
|
|
14168
|
+
if (choice && choice in CHANNEL_ACTIONS && (choice === "silence" || this.allowed(choice))) kind = choice;
|
|
14169
|
+
else if (choice && choice in CHANNEL_ACTIONS) log30.debug(`decider chose ${choice} for a ${rule} moment \u2014 the rule stands`);
|
|
14137
14170
|
}
|
|
14138
14171
|
if (kind === "silence") return ev({ choice, acted: "silence" });
|
|
14139
14172
|
if (stale()) return ev({ choice, kind, acted: "stale" });
|