@versot/vaguspi 0.1.6 → 0.1.7
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/bin.js +20 -3
- package/dist/bin.js.map +2 -2
- package/gui/assets/index-DRbNBgQ5.js +19 -0
- package/gui/index.html +1 -1
- package/package.json +1 -1
- package/gui/assets/index-D-BjCzLC.js +0 -19
package/dist/bin.js
CHANGED
|
@@ -1971,18 +1971,35 @@ var VagusEngine = class _VagusEngine {
|
|
|
1971
1971
|
const session = this.requireSession(sessionId);
|
|
1972
1972
|
await session.steer(text);
|
|
1973
1973
|
}
|
|
1974
|
-
/** Cancels a queued message by removing it from pi's steering queue.
|
|
1974
|
+
/** Cancels a queued message by removing it from pi's steering queue.
|
|
1975
|
+
* pi keeps TWO queues in sync: AgentSession._steeringMessages (display
|
|
1976
|
+
* tracking) and Agent.steeringQueue.messages (the real send queue —
|
|
1977
|
+
* clearing only the former still delivers the message). Remove from both;
|
|
1978
|
+
* match by message text on the agent queue (AgentMessage.content text). */
|
|
1975
1979
|
async cancelQueuedMessage(sessionId, text) {
|
|
1976
1980
|
const session = this.requireSession(sessionId);
|
|
1981
|
+
let cancelled = false;
|
|
1977
1982
|
const msgs = session["_steeringMessages"];
|
|
1978
1983
|
if (msgs) {
|
|
1979
1984
|
const idx = msgs.indexOf(text);
|
|
1980
1985
|
if (idx !== -1) {
|
|
1981
1986
|
msgs.splice(idx, 1);
|
|
1982
|
-
|
|
1987
|
+
cancelled = true;
|
|
1983
1988
|
}
|
|
1984
1989
|
}
|
|
1985
|
-
|
|
1990
|
+
const agent = session["agent"];
|
|
1991
|
+
const q = agent?.steeringQueue;
|
|
1992
|
+
if (q?.messages) {
|
|
1993
|
+
const idx = q.messages.findIndex((m) => m.content.some((c) => c.type === "text" && c.text === text));
|
|
1994
|
+
if (idx !== -1) {
|
|
1995
|
+
q.messages.splice(idx, 1);
|
|
1996
|
+
cancelled = true;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
if (cancelled) {
|
|
2000
|
+
session._emitQueueUpdate?.();
|
|
2001
|
+
}
|
|
2002
|
+
return { cancelled };
|
|
1986
2003
|
}
|
|
1987
2004
|
/**
|
|
1988
2005
|
* Queues a follow-up message.
|