@moxt-ai/mobius 0.0.188 → 0.0.190
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 +59 -10
- package/dist/cli.js.map +3 -3
- package/dist/index.js +58 -9
- package/dist/index.js.map +3 -3
- package/dist/relay-connection/session-event-publisher.d.ts +2 -1
- package/dist/relay-connection/session-event-publisher.d.ts.map +1 -1
- package/dist/relay-connection/session-event-publisher.js +1 -0
- package/dist/relay-connection/session-event-publisher.js.map +1 -1
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +3 -0
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +58 -9
- package/dist/runtime.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20242,6 +20242,7 @@ var sessionCommandsUpdatedEventSchema = external_exports.object({
|
|
|
20242
20242
|
}).readonly();
|
|
20243
20243
|
var sessionInfoUpdatedEventSchema = external_exports.object({
|
|
20244
20244
|
kind: external_exports.literal(SESSION_INFO_UPDATED_KIND),
|
|
20245
|
+
projectId: identifierStringSchema.optional(),
|
|
20245
20246
|
sessionId: identifierStringSchema,
|
|
20246
20247
|
title: external_exports.string().max(500).nullable(),
|
|
20247
20248
|
updatedAt: external_exports.string().max(128)
|
|
@@ -20427,6 +20428,8 @@ var decodeSessionConfigureCommand = (encoded) => decode3(encoded, sessionConfigu
|
|
|
20427
20428
|
var encodeSessionConfigureCommand = (message) => encode3(message, sessionConfigureCommandSchema);
|
|
20428
20429
|
var decodeSessionConfigUpdatedEvent = (encoded) => decode3(encoded, sessionConfigUpdatedEventSchema);
|
|
20429
20430
|
var encodeSessionConfigUpdatedEvent = (message) => encode3(message, sessionConfigUpdatedEventSchema);
|
|
20431
|
+
var decodeSessionInfoUpdatedEvent = (encoded) => decode3(encoded, sessionInfoUpdatedEventSchema);
|
|
20432
|
+
var encodeSessionInfoUpdatedEvent = (message) => encode3(message, sessionInfoUpdatedEventSchema);
|
|
20430
20433
|
var decodeSessionPermissionRespondCommand = (encoded) => decode3(encoded, sessionPermissionRespondCommandSchema);
|
|
20431
20434
|
var encodeSessionPermissionRespondCommand = (message) => encode3(message, sessionPermissionRespondCommandSchema);
|
|
20432
20435
|
var decodeSessionElicitationRespondCommand = (encoded) => decode3(encoded, sessionElicitationRespondCommandSchema);
|
|
@@ -21663,6 +21666,11 @@ var daemonToServiceSignatures = {
|
|
|
21663
21666
|
encodeSessionStatusChangedEvent,
|
|
21664
21667
|
decodeSessionStatusChangedEvent
|
|
21665
21668
|
),
|
|
21669
|
+
[SESSION_INFO_UPDATED_KIND]: defineMessageSignature(
|
|
21670
|
+
SESSION_INFO_UPDATED_KIND,
|
|
21671
|
+
encodeSessionInfoUpdatedEvent,
|
|
21672
|
+
decodeSessionInfoUpdatedEvent
|
|
21673
|
+
),
|
|
21666
21674
|
[SESSION_QUEUED_KIND]: defineMessageSignature(
|
|
21667
21675
|
SESSION_QUEUED_KIND,
|
|
21668
21676
|
encodeSessionQueuedEvent,
|
|
@@ -33842,6 +33850,11 @@ var threadLifecycleResponseSchema = external_exports.object({
|
|
|
33842
33850
|
serviceTier: boundedText(256).nullish(),
|
|
33843
33851
|
thread: external_exports.object({ id: boundedText(256), turns: threadTurnsSchema })
|
|
33844
33852
|
});
|
|
33853
|
+
var CODEX_HISTORY_TURN_PAGE_LIMIT = 20;
|
|
33854
|
+
var threadTurnsPageSchema = external_exports.object({
|
|
33855
|
+
data: external_exports.array(threadTurnSchema).max(CODEX_HISTORY_TURN_PAGE_LIMIT),
|
|
33856
|
+
nextCursor: boundedText(1024).nullish()
|
|
33857
|
+
});
|
|
33845
33858
|
var threadResumeResponseSchema = threadLifecycleResponseSchema;
|
|
33846
33859
|
var threadForkResponseSchema = threadLifecycleResponseSchema;
|
|
33847
33860
|
var threadTitleSchema = external_exports.string().transform((value) => value.slice(0, 500));
|
|
@@ -34916,14 +34929,14 @@ var CodexAcpAgent = class {
|
|
|
34916
34929
|
const resumed = threadResumeResponseSchema.parse(
|
|
34917
34930
|
await this.#appServer.request(
|
|
34918
34931
|
"thread/resume",
|
|
34919
|
-
{ cwd: context.params.cwd, excludeTurns:
|
|
34932
|
+
{ cwd: context.params.cwd, excludeTurns: true, threadId: context.params.sessionId },
|
|
34920
34933
|
AbortSignal.any([context.signal, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS2)])
|
|
34921
34934
|
)
|
|
34922
34935
|
);
|
|
34923
34936
|
this.#nativeSessionId = resumed.thread.id;
|
|
34924
34937
|
this.#settings.selectRestoredThread(resumed);
|
|
34925
34938
|
await this.#settings.probeCollaborationMode(this.#nativeSessionId, context.signal);
|
|
34926
|
-
await this.#
|
|
34939
|
+
await this.#replaySavedHistory(context.signal);
|
|
34927
34940
|
await this.#emitAvailableCommands();
|
|
34928
34941
|
return { configOptions: this.#settings.configOptions() };
|
|
34929
34942
|
}).onRequest(methods4.agent.session.fork, async (context) => {
|
|
@@ -35018,14 +35031,46 @@ var CodexAcpAgent = class {
|
|
|
35018
35031
|
}
|
|
35019
35032
|
return this.#closePromise;
|
|
35020
35033
|
};
|
|
35021
|
-
|
|
35022
|
-
|
|
35023
|
-
|
|
35024
|
-
|
|
35025
|
-
|
|
35026
|
-
|
|
35027
|
-
for (
|
|
35034
|
+
// ACP load requires chronological replay. Resume only restores execution;
|
|
35035
|
+
// native pages supply history without a single full-transcript response.
|
|
35036
|
+
#replaySavedHistory = async (signal) => {
|
|
35037
|
+
const deadline = AbortSignal.any([signal, AbortSignal.timeout(6e4)]);
|
|
35038
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
35039
|
+
let cursor = null;
|
|
35040
|
+
for (; ; ) {
|
|
35041
|
+
deadline.throwIfAborted();
|
|
35042
|
+
const page = threadTurnsPageSchema.parse(
|
|
35043
|
+
await this.#appServer.request(
|
|
35044
|
+
"thread/turns/list",
|
|
35045
|
+
{
|
|
35046
|
+
threadId: this.#nativeSessionId,
|
|
35047
|
+
limit: CODEX_HISTORY_TURN_PAGE_LIMIT,
|
|
35048
|
+
sortDirection: "asc",
|
|
35049
|
+
itemsView: "full",
|
|
35050
|
+
...cursor === null ? {} : { cursor }
|
|
35051
|
+
},
|
|
35052
|
+
deadline
|
|
35053
|
+
)
|
|
35054
|
+
);
|
|
35055
|
+
await this.#replayHistory(page.data, deadline);
|
|
35056
|
+
if (page.nextCursor == null) {
|
|
35057
|
+
return;
|
|
35058
|
+
}
|
|
35059
|
+
if (page.data.length === 0 || seenCursors.has(page.nextCursor)) {
|
|
35060
|
+
throw new AcpExecutionError(
|
|
35061
|
+
"Codex repeated a history page cursor",
|
|
35062
|
+
{},
|
|
35063
|
+
"invalid_native_session_response"
|
|
35064
|
+
);
|
|
35065
|
+
}
|
|
35066
|
+
seenCursors.add(page.nextCursor);
|
|
35067
|
+
cursor = page.nextCursor;
|
|
35068
|
+
}
|
|
35069
|
+
};
|
|
35070
|
+
#replayHistory = async (turns, signal) => {
|
|
35071
|
+
for (const turn of turns) {
|
|
35028
35072
|
for (const rawItem of turn.items) {
|
|
35073
|
+
signal.throwIfAborted();
|
|
35029
35074
|
const item = decodeThreadItem(rawItem);
|
|
35030
35075
|
if (item === null) {
|
|
35031
35076
|
continue;
|
|
@@ -43607,6 +43652,7 @@ var DaemonSessionEventPublisher = class {
|
|
|
43607
43652
|
this.#send({ kind: "session.operation.failed", sessionId, requestId, code, message });
|
|
43608
43653
|
};
|
|
43609
43654
|
publishStatus = (event) => this.#send(event);
|
|
43655
|
+
publishInfo = (event) => this.#send(event);
|
|
43610
43656
|
#send = (message) => {
|
|
43611
43657
|
const socket = this.#socket;
|
|
43612
43658
|
if (socket === null || socket.readyState !== WebSocket8.OPEN) {
|
|
@@ -43913,6 +43959,9 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
43913
43959
|
const agentRuntime = new AgentRuntimeManager(
|
|
43914
43960
|
new DaemonAcpObserver((_sessionId, event) => {
|
|
43915
43961
|
activeTurns.recordEvent(event);
|
|
43962
|
+
if (event.kind === "session.info.updated") {
|
|
43963
|
+
publisher.publishInfo(event);
|
|
43964
|
+
}
|
|
43916
43965
|
}, eventLogV2.record),
|
|
43917
43966
|
sessionStore,
|
|
43918
43967
|
{
|