@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/index.js
CHANGED
|
@@ -31676,7 +31676,7 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
31676
31676
|
#preSessionUpdateBytes = 0;
|
|
31677
31677
|
#agentName = "";
|
|
31678
31678
|
#agentVersion = "";
|
|
31679
|
-
#bufferedAgentText =
|
|
31679
|
+
#bufferedAgentText = [];
|
|
31680
31680
|
#capabilities = {
|
|
31681
31681
|
additionalDirectories: false,
|
|
31682
31682
|
audioPrompt: false,
|
|
@@ -31865,20 +31865,30 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
31865
31865
|
});
|
|
31866
31866
|
};
|
|
31867
31867
|
bufferAgentText = async (text3, messageId) => {
|
|
31868
|
-
|
|
31869
|
-
|
|
31870
|
-
this.#bufferedAgentText =
|
|
31868
|
+
const previous2 = this.#bufferedAgentText.at(-1);
|
|
31869
|
+
if (previous2?.messageId === messageId) {
|
|
31870
|
+
this.#bufferedAgentText = [
|
|
31871
|
+
...this.#bufferedAgentText.slice(0, -1),
|
|
31872
|
+
{ chunks: [...previous2.chunks, text3], messageId }
|
|
31873
|
+
];
|
|
31874
|
+
return;
|
|
31871
31875
|
}
|
|
31872
|
-
this.#bufferedAgentText = {
|
|
31873
|
-
chunks: [...this.#bufferedAgentText?.chunks ?? [], text3],
|
|
31874
|
-
messageId
|
|
31875
|
-
};
|
|
31876
|
+
this.#bufferedAgentText = [...this.#bufferedAgentText, { chunks: [text3], messageId }];
|
|
31876
31877
|
};
|
|
31877
31878
|
flushAgentText = async () => {
|
|
31878
31879
|
const buffered = this.#bufferedAgentText;
|
|
31879
|
-
this.#bufferedAgentText =
|
|
31880
|
-
|
|
31881
|
-
await this.emitAgentMessage(
|
|
31880
|
+
this.#bufferedAgentText = [];
|
|
31881
|
+
for (const message of buffered) {
|
|
31882
|
+
await this.emitAgentMessage(message.chunks, message.messageId);
|
|
31883
|
+
}
|
|
31884
|
+
};
|
|
31885
|
+
recordBufferedAgentTextAsProgress = async () => {
|
|
31886
|
+
const buffered = this.#bufferedAgentText;
|
|
31887
|
+
this.#bufferedAgentText = [];
|
|
31888
|
+
for (const message of buffered) {
|
|
31889
|
+
for (const chunk of message.chunks) {
|
|
31890
|
+
await this.#turn.activities.recordNarrative("progress", message.messageId, chunk);
|
|
31891
|
+
}
|
|
31882
31892
|
}
|
|
31883
31893
|
};
|
|
31884
31894
|
prepareAgentContent = async (content3) => {
|
|
@@ -32392,7 +32402,7 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
32392
32402
|
cause: error62
|
|
32393
32403
|
});
|
|
32394
32404
|
} finally {
|
|
32395
|
-
this.#bufferedAgentText =
|
|
32405
|
+
this.#bufferedAgentText = [];
|
|
32396
32406
|
this.#turn = new IdleAcpTurn();
|
|
32397
32407
|
}
|
|
32398
32408
|
};
|
|
@@ -32707,6 +32717,7 @@ var AcpProcessSession = class _AcpProcessSession {
|
|
|
32707
32717
|
return;
|
|
32708
32718
|
}
|
|
32709
32719
|
if (update.sessionUpdate === "tool_call") {
|
|
32720
|
+
await this.recordBufferedAgentTextAsProgress();
|
|
32710
32721
|
await this.#turn.activities.recordToolCall(update);
|
|
32711
32722
|
return;
|
|
32712
32723
|
}
|