@moxt-ai/mobius 0.0.46 → 0.0.47
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/acp/session-manager.d.ts +1 -0
- package/dist/acp/session-manager.d.ts.map +1 -1
- package/dist/acp/session-manager.js +23 -12
- package/dist/acp/session-manager.js.map +1 -1
- package/dist/cli.js +24 -13
- package/dist/cli.js.map +3 -3
- package/dist/index.js +23 -12
- package/dist/index.js.map +3 -3
- package/dist/runtime.js +23 -12
- package/dist/runtime.js.map +3 -3
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -33710,7 +33710,7 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
33710
33710
|
#preSessionUpdateBytes = 0;
|
|
33711
33711
|
#agentName = "";
|
|
33712
33712
|
#agentVersion = "";
|
|
33713
|
-
#bufferedAgentText =
|
|
33713
|
+
#bufferedAgentText = [];
|
|
33714
33714
|
#capabilities = {
|
|
33715
33715
|
additionalDirectories: false,
|
|
33716
33716
|
audioPrompt: false,
|
|
@@ -33899,20 +33899,30 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
33899
33899
|
});
|
|
33900
33900
|
};
|
|
33901
33901
|
bufferAgentText = async (text3, messageId) => {
|
|
33902
|
-
|
|
33903
|
-
|
|
33904
|
-
this.#bufferedAgentText =
|
|
33902
|
+
const previous2 = this.#bufferedAgentText.at(-1);
|
|
33903
|
+
if (previous2?.messageId === messageId) {
|
|
33904
|
+
this.#bufferedAgentText = [
|
|
33905
|
+
...this.#bufferedAgentText.slice(0, -1),
|
|
33906
|
+
{ chunks: [...previous2.chunks, text3], messageId }
|
|
33907
|
+
];
|
|
33908
|
+
return;
|
|
33905
33909
|
}
|
|
33906
|
-
this.#bufferedAgentText = {
|
|
33907
|
-
chunks: [...this.#bufferedAgentText?.chunks ?? [], text3],
|
|
33908
|
-
messageId
|
|
33909
|
-
};
|
|
33910
|
+
this.#bufferedAgentText = [...this.#bufferedAgentText, { chunks: [text3], messageId }];
|
|
33910
33911
|
};
|
|
33911
33912
|
flushAgentText = async () => {
|
|
33912
33913
|
const buffered = this.#bufferedAgentText;
|
|
33913
|
-
this.#bufferedAgentText =
|
|
33914
|
-
|
|
33915
|
-
await this.emitAgentMessage(
|
|
33914
|
+
this.#bufferedAgentText = [];
|
|
33915
|
+
for (const message of buffered) {
|
|
33916
|
+
await this.emitAgentMessage(message.chunks, message.messageId);
|
|
33917
|
+
}
|
|
33918
|
+
};
|
|
33919
|
+
recordBufferedAgentTextAsProgress = async () => {
|
|
33920
|
+
const buffered = this.#bufferedAgentText;
|
|
33921
|
+
this.#bufferedAgentText = [];
|
|
33922
|
+
for (const message of buffered) {
|
|
33923
|
+
for (const chunk of message.chunks) {
|
|
33924
|
+
await this.#turn.activities.recordNarrative("progress", message.messageId, chunk);
|
|
33925
|
+
}
|
|
33916
33926
|
}
|
|
33917
33927
|
};
|
|
33918
33928
|
prepareAgentContent = async (content3) => {
|
|
@@ -34426,7 +34436,7 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
34426
34436
|
cause: error62
|
|
34427
34437
|
});
|
|
34428
34438
|
} finally {
|
|
34429
|
-
this.#bufferedAgentText =
|
|
34439
|
+
this.#bufferedAgentText = [];
|
|
34430
34440
|
this.#turn = new IdleAcpTurn();
|
|
34431
34441
|
}
|
|
34432
34442
|
};
|
|
@@ -34741,6 +34751,7 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
34741
34751
|
return;
|
|
34742
34752
|
}
|
|
34743
34753
|
if (update.sessionUpdate === "tool_call") {
|
|
34754
|
+
await this.recordBufferedAgentTextAsProgress();
|
|
34744
34755
|
await this.#turn.activities.recordToolCall(update);
|
|
34745
34756
|
return;
|
|
34746
34757
|
}
|