@moxt-ai/mobius 0.0.188 → 0.0.189
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/codex/agent.d.ts.map +1 -1
- package/dist/acp/codex/agent.js +32 -10
- package/dist/acp/codex/agent.js.map +1 -1
- package/dist/acp/codex/app-server-protocol.d.ts +7 -0
- package/dist/acp/codex/app-server-protocol.d.ts.map +1 -1
- package/dist/acp/codex/app-server-protocol.js +5 -0
- package/dist/acp/codex/app-server-protocol.js.map +1 -1
- package/dist/cli.js +47 -10
- package/dist/cli.js.map +2 -2
- package/dist/index.js +46 -9
- package/dist/index.js.map +2 -2
- package/dist/runtime.js +46 -9
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33842,6 +33842,11 @@ var threadLifecycleResponseSchema = external_exports.object({
|
|
|
33842
33842
|
serviceTier: boundedText(256).nullish(),
|
|
33843
33843
|
thread: external_exports.object({ id: boundedText(256), turns: threadTurnsSchema })
|
|
33844
33844
|
});
|
|
33845
|
+
var CODEX_HISTORY_TURN_PAGE_LIMIT = 20;
|
|
33846
|
+
var threadTurnsPageSchema = external_exports.object({
|
|
33847
|
+
data: external_exports.array(threadTurnSchema).max(CODEX_HISTORY_TURN_PAGE_LIMIT),
|
|
33848
|
+
nextCursor: boundedText(1024).nullish()
|
|
33849
|
+
});
|
|
33845
33850
|
var threadResumeResponseSchema = threadLifecycleResponseSchema;
|
|
33846
33851
|
var threadForkResponseSchema = threadLifecycleResponseSchema;
|
|
33847
33852
|
var threadTitleSchema = external_exports.string().transform((value) => value.slice(0, 500));
|
|
@@ -34916,14 +34921,14 @@ var CodexAcpAgent = class {
|
|
|
34916
34921
|
const resumed = threadResumeResponseSchema.parse(
|
|
34917
34922
|
await this.#appServer.request(
|
|
34918
34923
|
"thread/resume",
|
|
34919
|
-
{ cwd: context.params.cwd, excludeTurns:
|
|
34924
|
+
{ cwd: context.params.cwd, excludeTurns: true, threadId: context.params.sessionId },
|
|
34920
34925
|
AbortSignal.any([context.signal, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS2)])
|
|
34921
34926
|
)
|
|
34922
34927
|
);
|
|
34923
34928
|
this.#nativeSessionId = resumed.thread.id;
|
|
34924
34929
|
this.#settings.selectRestoredThread(resumed);
|
|
34925
34930
|
await this.#settings.probeCollaborationMode(this.#nativeSessionId, context.signal);
|
|
34926
|
-
await this.#
|
|
34931
|
+
await this.#replaySavedHistory(context.signal);
|
|
34927
34932
|
await this.#emitAvailableCommands();
|
|
34928
34933
|
return { configOptions: this.#settings.configOptions() };
|
|
34929
34934
|
}).onRequest(methods4.agent.session.fork, async (context) => {
|
|
@@ -35018,14 +35023,46 @@ var CodexAcpAgent = class {
|
|
|
35018
35023
|
}
|
|
35019
35024
|
return this.#closePromise;
|
|
35020
35025
|
};
|
|
35021
|
-
|
|
35022
|
-
|
|
35023
|
-
|
|
35024
|
-
|
|
35025
|
-
|
|
35026
|
-
|
|
35027
|
-
for (
|
|
35026
|
+
// ACP load requires chronological replay. Resume only restores execution;
|
|
35027
|
+
// native pages supply history without a single full-transcript response.
|
|
35028
|
+
#replaySavedHistory = async (signal) => {
|
|
35029
|
+
const deadline = AbortSignal.any([signal, AbortSignal.timeout(6e4)]);
|
|
35030
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
35031
|
+
let cursor = null;
|
|
35032
|
+
for (; ; ) {
|
|
35033
|
+
deadline.throwIfAborted();
|
|
35034
|
+
const page = threadTurnsPageSchema.parse(
|
|
35035
|
+
await this.#appServer.request(
|
|
35036
|
+
"thread/turns/list",
|
|
35037
|
+
{
|
|
35038
|
+
threadId: this.#nativeSessionId,
|
|
35039
|
+
limit: CODEX_HISTORY_TURN_PAGE_LIMIT,
|
|
35040
|
+
sortDirection: "asc",
|
|
35041
|
+
itemsView: "full",
|
|
35042
|
+
...cursor === null ? {} : { cursor }
|
|
35043
|
+
},
|
|
35044
|
+
deadline
|
|
35045
|
+
)
|
|
35046
|
+
);
|
|
35047
|
+
await this.#replayHistory(page.data, deadline);
|
|
35048
|
+
if (page.nextCursor == null) {
|
|
35049
|
+
return;
|
|
35050
|
+
}
|
|
35051
|
+
if (page.data.length === 0 || seenCursors.has(page.nextCursor)) {
|
|
35052
|
+
throw new AcpExecutionError(
|
|
35053
|
+
"Codex repeated a history page cursor",
|
|
35054
|
+
{},
|
|
35055
|
+
"invalid_native_session_response"
|
|
35056
|
+
);
|
|
35057
|
+
}
|
|
35058
|
+
seenCursors.add(page.nextCursor);
|
|
35059
|
+
cursor = page.nextCursor;
|
|
35060
|
+
}
|
|
35061
|
+
};
|
|
35062
|
+
#replayHistory = async (turns, signal) => {
|
|
35063
|
+
for (const turn of turns) {
|
|
35028
35064
|
for (const rawItem of turn.items) {
|
|
35065
|
+
signal.throwIfAborted();
|
|
35029
35066
|
const item = decodeThreadItem(rawItem);
|
|
35030
35067
|
if (item === null) {
|
|
35031
35068
|
continue;
|