@moxt-ai/mobius 0.0.163 → 0.0.165
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/agent-runtime-manager.d.ts +3 -2
- package/dist/acp/agent-runtime-manager.d.ts.map +1 -1
- package/dist/acp/agent-runtime-manager.js +17 -1
- package/dist/acp/agent-runtime-manager.js.map +1 -1
- package/dist/acp/codex/app-server-client.d.ts.map +1 -1
- package/dist/acp/codex/app-server-client.js +23 -12
- package/dist/acp/codex/app-server-client.js.map +1 -1
- package/dist/agent-catalog/agents/pi-agent.d.ts +1 -1
- package/dist/agent-catalog/agents/pi-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/pi-agent.js +1 -1
- package/dist/agent-catalog/agents/pi-agent.js.map +1 -1
- package/dist/agent-installation/pi-managed-packages.js +2 -2
- package/dist/agent-installation/pi-managed-packages.js.map +1 -1
- package/dist/cli.js +123 -40
- package/dist/cli.js.map +2 -2
- package/dist/index.js +122 -39
- package/dist/index.js.map +2 -2
- package/dist/native-sessions/codex-history.d.ts.map +1 -1
- package/dist/native-sessions/codex-history.js +22 -11
- package/dist/native-sessions/codex-history.js.map +1 -1
- package/dist/native-sessions/service.d.ts.map +1 -1
- package/dist/native-sessions/service.js +1 -0
- package/dist/native-sessions/service.js.map +1 -1
- 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 +17 -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 +1 -1
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +122 -39
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -19765,6 +19765,7 @@ var SESSION_LIST_KIND = "session.list";
|
|
|
19765
19765
|
var SESSION_LISTED_KIND = "session.listed";
|
|
19766
19766
|
var SESSION_QUERY_KIND = "session.query";
|
|
19767
19767
|
var SESSION_QUERIED_KIND = "session.queried";
|
|
19768
|
+
var SESSION_STATUS_CHANGED_KIND = "session.status.changed";
|
|
19768
19769
|
var SESSION_CONFIGURE_KIND = "session.configure";
|
|
19769
19770
|
var SESSION_CONFIG_UPDATED_KIND = "session.config.updated";
|
|
19770
19771
|
var SESSION_USAGE_UPDATED_KIND = "session.usage.updated";
|
|
@@ -19804,6 +19805,18 @@ var workspaceEntrySchema = external_exports.strictObject({
|
|
|
19804
19805
|
directoryId: DIRECTORY_IDENTIFIER,
|
|
19805
19806
|
name: external_exports.string().min(1).max(255)
|
|
19806
19807
|
}).readonly();
|
|
19808
|
+
var sessionStatusSchema = external_exports.discriminatedUnion("kind", [
|
|
19809
|
+
external_exports.strictObject({ kind: external_exports.literal("idle") }).readonly(),
|
|
19810
|
+
external_exports.strictObject({
|
|
19811
|
+
commandId: identifierStringSchema,
|
|
19812
|
+
kind: external_exports.literal("working")
|
|
19813
|
+
}).readonly()
|
|
19814
|
+
]);
|
|
19815
|
+
var sessionStatusChangedEventSchema = external_exports.strictObject({
|
|
19816
|
+
kind: external_exports.literal(SESSION_STATUS_CHANGED_KIND),
|
|
19817
|
+
sessionId: identifierStringSchema,
|
|
19818
|
+
status: sessionStatusSchema
|
|
19819
|
+
}).readonly();
|
|
19807
19820
|
var sessionMetadataSchema = external_exports.strictObject({
|
|
19808
19821
|
additionalDirectories: external_exports.array(workspaceEntrySchema).max(16).readonly(),
|
|
19809
19822
|
agentId: identifierStringSchema,
|
|
@@ -19811,6 +19824,7 @@ var sessionMetadataSchema = external_exports.strictObject({
|
|
|
19811
19824
|
directoryLabel: external_exports.string().min(1).max(2048),
|
|
19812
19825
|
prompted: external_exports.boolean(),
|
|
19813
19826
|
sessionId: identifierStringSchema,
|
|
19827
|
+
status: sessionStatusSchema,
|
|
19814
19828
|
title: external_exports.string().max(500),
|
|
19815
19829
|
updatedAt: external_exports.iso.datetime({ offset: true })
|
|
19816
19830
|
}).readonly();
|
|
@@ -20385,6 +20399,8 @@ var decodeSessionQueryCommand = (encoded) => decode3(encoded, sessionQueryComman
|
|
|
20385
20399
|
var encodeSessionQueryCommand = (message) => encode3(message, sessionQueryCommandSchema);
|
|
20386
20400
|
var decodeSessionsQueriedEvent = (encoded) => decode3(encoded, sessionsQueriedEventSchema);
|
|
20387
20401
|
var encodeSessionsQueriedEvent = (message) => encode3(message, sessionsQueriedEventSchema);
|
|
20402
|
+
var decodeSessionStatusChangedEvent = (encoded) => decode3(encoded, sessionStatusChangedEventSchema);
|
|
20403
|
+
var encodeSessionStatusChangedEvent = (message) => encode3(message, sessionStatusChangedEventSchema);
|
|
20388
20404
|
var decodeSessionPrepareCommand = (encoded) => decode3(encoded, sessionPrepareCommandSchema);
|
|
20389
20405
|
var encodeSessionPrepareCommand = (message) => encode3(message, sessionPrepareCommandSchema);
|
|
20390
20406
|
var decodeSessionReadyEvent = (encoded) => decode3(encoded, sessionReadyEventSchema);
|
|
@@ -21993,6 +22009,11 @@ var daemonToServiceSignatures = {
|
|
|
21993
22009
|
encodeSessionsQueriedEvent,
|
|
21994
22010
|
decodeSessionsQueriedEvent
|
|
21995
22011
|
),
|
|
22012
|
+
[SESSION_STATUS_CHANGED_KIND]: defineMessageSignature(
|
|
22013
|
+
SESSION_STATUS_CHANGED_KIND,
|
|
22014
|
+
encodeSessionStatusChangedEvent,
|
|
22015
|
+
decodeSessionStatusChangedEvent
|
|
22016
|
+
),
|
|
21996
22017
|
[SESSION_QUEUED_KIND]: defineMessageSignature(
|
|
21997
22018
|
SESSION_QUEUED_KIND,
|
|
21998
22019
|
encodeSessionQueuedEvent,
|
|
@@ -23728,7 +23749,7 @@ var threadSettingsUpdatedSchema = external_exports.object({
|
|
|
23728
23749
|
|
|
23729
23750
|
// src/acp/codex/app-server-client.ts
|
|
23730
23751
|
var INITIALIZE_TIMEOUT_MILLISECONDS = 3e4;
|
|
23731
|
-
var
|
|
23752
|
+
var MESSAGE_OUTPUT_LIMIT_BYTES = 32 * 1024 * 1024;
|
|
23732
23753
|
var CodexAppServerError = class extends AcpExecutionError {
|
|
23733
23754
|
constructor(code, message, options = {}) {
|
|
23734
23755
|
super(message, options, code);
|
|
@@ -23745,8 +23766,8 @@ var CodexAppServerClient = class {
|
|
|
23745
23766
|
kind: "open"
|
|
23746
23767
|
};
|
|
23747
23768
|
#nextRequestId = 1;
|
|
23748
|
-
#
|
|
23749
|
-
#
|
|
23769
|
+
#pendingBytes = 0;
|
|
23770
|
+
#pendingFragments = [];
|
|
23750
23771
|
constructor(options) {
|
|
23751
23772
|
this.#handlers = options.handlers;
|
|
23752
23773
|
this.#child = spawn2(options.command, ["app-server"], {
|
|
@@ -23822,25 +23843,39 @@ var CodexAppServerClient = class {
|
|
|
23822
23843
|
return;
|
|
23823
23844
|
}
|
|
23824
23845
|
try {
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
throw new CodexAppServerError(
|
|
23828
|
-
"codex_app_server_output_limit",
|
|
23829
|
-
"The Codex app-server produced too much output"
|
|
23830
|
-
);
|
|
23831
|
-
}
|
|
23832
|
-
this.#pendingBuffer += chunk;
|
|
23833
|
-
let newline = this.#pendingBuffer.indexOf("\n");
|
|
23846
|
+
let cursor = 0;
|
|
23847
|
+
let newline = chunk.indexOf("\n");
|
|
23834
23848
|
while (newline >= 0) {
|
|
23835
|
-
const
|
|
23836
|
-
|
|
23837
|
-
|
|
23849
|
+
const fragment = chunk.slice(cursor, newline);
|
|
23850
|
+
const lineBytes = this.#pendingBytes + Buffer.byteLength(fragment);
|
|
23851
|
+
if (lineBytes > MESSAGE_OUTPUT_LIMIT_BYTES) {
|
|
23852
|
+
throw new CodexAppServerError(
|
|
23853
|
+
"codex_app_server_output_limit",
|
|
23854
|
+
"The Codex app-server produced an oversized message"
|
|
23855
|
+
);
|
|
23856
|
+
}
|
|
23857
|
+
const line = this.#pendingFragments.length === 0 ? fragment : [...this.#pendingFragments, fragment].join("");
|
|
23858
|
+
this.#pendingBytes = 0;
|
|
23859
|
+
this.#pendingFragments = [];
|
|
23860
|
+
cursor = newline + 1;
|
|
23861
|
+
newline = chunk.indexOf("\n", cursor);
|
|
23838
23862
|
if (line.trim().length === 0) {
|
|
23839
23863
|
continue;
|
|
23840
23864
|
}
|
|
23841
23865
|
const value = JSON.parse(line);
|
|
23842
23866
|
this.#dispatch(decodeAppServerMessage(value));
|
|
23843
23867
|
}
|
|
23868
|
+
const remainder = chunk.slice(cursor);
|
|
23869
|
+
if (remainder.length > 0) {
|
|
23870
|
+
this.#pendingBytes += Buffer.byteLength(remainder);
|
|
23871
|
+
if (this.#pendingBytes > MESSAGE_OUTPUT_LIMIT_BYTES) {
|
|
23872
|
+
throw new CodexAppServerError(
|
|
23873
|
+
"codex_app_server_output_limit",
|
|
23874
|
+
"The Codex app-server produced an oversized message"
|
|
23875
|
+
);
|
|
23876
|
+
}
|
|
23877
|
+
this.#pendingFragments.push(remainder);
|
|
23878
|
+
}
|
|
23844
23879
|
} catch (error62) {
|
|
23845
23880
|
this.#fail(
|
|
23846
23881
|
error62 instanceof CodexAppServerError ? error62 : new CodexAppServerError(
|
|
@@ -26195,17 +26230,17 @@ import {
|
|
|
26195
26230
|
// src/agent-installation/pi-managed-packages.ts
|
|
26196
26231
|
var PI_ACP_PACKAGE = new SriManagedNpmPackageDefinition(
|
|
26197
26232
|
"pi-acp",
|
|
26198
|
-
"0.0.
|
|
26233
|
+
"0.0.34",
|
|
26199
26234
|
"pi-acp",
|
|
26200
|
-
"sha512-
|
|
26201
|
-
"https://registry.npmjs.org/pi-acp/-/pi-acp-0.0.
|
|
26235
|
+
"sha512-MrCp37UbpUzkTkzTIMJQf1RYrT+kr4fgGDGFoLmBN26UupuCZp0XxVIY+7XYsMo3yDnzDeZUJ0jPyM3Si6Bkkg==",
|
|
26236
|
+
"https://registry.npmjs.org/pi-acp/-/pi-acp-0.0.34.tgz"
|
|
26202
26237
|
);
|
|
26203
26238
|
var PI_AGENT_PACKAGE = new SriManagedNpmPackageDefinition(
|
|
26204
26239
|
"@earendil-works/pi-coding-agent",
|
|
26205
|
-
"
|
|
26240
|
+
"1.1.0",
|
|
26206
26241
|
"pi",
|
|
26207
|
-
"sha512-
|
|
26208
|
-
"https://registry.npmjs.org/@earendil-works/pi-coding-agent/-/pi-coding-agent-
|
|
26242
|
+
"sha512-SeEi/4hdcHNgA9UWlefZl7ZZpm3dzi2OoxNjDHsBJ9o298LNOtbL4DGKgitlEj6uCTccvtw6f2hlCkTPVJ2RXg==",
|
|
26243
|
+
"https://registry.npmjs.org/@earendil-works/pi-coding-agent/-/pi-coding-agent-1.1.0.tgz"
|
|
26209
26244
|
);
|
|
26210
26245
|
|
|
26211
26246
|
// src/agent-catalog/agents/pi-agent.ts
|
|
@@ -26221,7 +26256,7 @@ var PiAgentSpecification = class extends BridgedAcpAgentDefinition {
|
|
|
26221
26256
|
agentOverrideVariable = "MOBIUS_PI_PATH";
|
|
26222
26257
|
id = "pi";
|
|
26223
26258
|
label = "Pi";
|
|
26224
|
-
minimumSupportedAgentVersion =
|
|
26259
|
+
minimumSupportedAgentVersion = "0.85.0";
|
|
26225
26260
|
maximumTestedAgentVersion = PI_AGENT_PACKAGE.version;
|
|
26226
26261
|
managedAdapterExecutablePath = [
|
|
26227
26262
|
"adapters",
|
|
@@ -36750,12 +36785,14 @@ var AgentRuntimeManager = class {
|
|
|
36750
36785
|
#store;
|
|
36751
36786
|
#nativeHistoryReader;
|
|
36752
36787
|
#sessionIdentity;
|
|
36788
|
+
#onSessionStatusChanged;
|
|
36753
36789
|
#observer;
|
|
36754
|
-
constructor(observer = new NullAcpSessionObserver(), store = new MemoryAcpSessionStore(), nativeHistoryReader = null, sessionIdentity = "assigned") {
|
|
36790
|
+
constructor(observer = new NullAcpSessionObserver(), store = new MemoryAcpSessionStore(), nativeHistoryReader = null, sessionIdentity = "assigned", onSessionStatusChanged = () => void 0) {
|
|
36755
36791
|
this.#observer = observer;
|
|
36756
36792
|
this.#store = store;
|
|
36757
36793
|
this.#nativeHistoryReader = nativeHistoryReader;
|
|
36758
36794
|
this.#sessionIdentity = sessionIdentity;
|
|
36795
|
+
this.#onSessionStatusChanged = onSessionStatusChanged;
|
|
36759
36796
|
}
|
|
36760
36797
|
setObserver = (observer) => {
|
|
36761
36798
|
this.#observer = observer;
|
|
@@ -37062,6 +37099,11 @@ var AgentRuntimeManager = class {
|
|
|
37062
37099
|
}
|
|
37063
37100
|
this.#executions.begin(options2.sessionId, options2.commandId);
|
|
37064
37101
|
try {
|
|
37102
|
+
this.#onSessionStatusChanged({
|
|
37103
|
+
kind: "session.status.changed",
|
|
37104
|
+
sessionId: options2.sessionId,
|
|
37105
|
+
status: { commandId: options2.commandId, kind: "working" }
|
|
37106
|
+
});
|
|
37065
37107
|
if (this.#executions.cancellation(options2.sessionId) !== void 0) {
|
|
37066
37108
|
return { stopReason: "cancelled" };
|
|
37067
37109
|
}
|
|
@@ -37105,6 +37147,11 @@ var AgentRuntimeManager = class {
|
|
|
37105
37147
|
await this.#executions.cancellation(options2.sessionId);
|
|
37106
37148
|
} finally {
|
|
37107
37149
|
this.#executions.finish(options2.sessionId, options2.commandId);
|
|
37150
|
+
this.#onSessionStatusChanged({
|
|
37151
|
+
kind: "session.status.changed",
|
|
37152
|
+
sessionId: options2.sessionId,
|
|
37153
|
+
status: { kind: "idle" }
|
|
37154
|
+
});
|
|
37108
37155
|
this.#executionProcesses.touch(options2.sessionId);
|
|
37109
37156
|
this.#processes.notifyChanged();
|
|
37110
37157
|
}
|
|
@@ -37137,6 +37184,10 @@ var AgentRuntimeManager = class {
|
|
|
37137
37184
|
const stored = this.#store.read(sessionId);
|
|
37138
37185
|
return stored instanceof FoundAcpStoredSession ? [stored.session] : [];
|
|
37139
37186
|
});
|
|
37187
|
+
sessionStatus = (sessionId) => {
|
|
37188
|
+
const commandId = this.#executions.command(sessionId);
|
|
37189
|
+
return commandId === void 0 ? { kind: "idle" } : { commandId, kind: "working" };
|
|
37190
|
+
};
|
|
37140
37191
|
listSessions = (limit) => this.#store.list().filter((session) => session.prompted).slice(0, limit);
|
|
37141
37192
|
findLinkedSessions = (agentId, nativeSessionId) => this.#store.findNative(agentId, nativeSessionId);
|
|
37142
37193
|
hasPreparedSession = (sessionId, agentId, cwd, additionalDirectories) => this.#executionProcesses.get(sessionId)?.belongsTo(agentId, cwd, additionalDirectories) === true;
|
|
@@ -39582,8 +39633,8 @@ async function readCodexHistoryWithOptions(agent, cwd, nativeSessionId, signal,
|
|
|
39582
39633
|
const response = Promise.withResolvers();
|
|
39583
39634
|
let state = { kind: "initializing", requestId: 1 };
|
|
39584
39635
|
const seenCursors = /* @__PURE__ */ new Set();
|
|
39585
|
-
let
|
|
39586
|
-
let
|
|
39636
|
+
let pendingBytes = 0;
|
|
39637
|
+
let pendingFragments = [];
|
|
39587
39638
|
const fail = (cause) => response.reject(
|
|
39588
39639
|
cause instanceof AcpExecutionError ? cause : new AcpExecutionError(
|
|
39589
39640
|
"Saved Codex history could not be read.",
|
|
@@ -39597,20 +39648,23 @@ async function readCodexHistoryWithOptions(agent, cwd, nativeSessionId, signal,
|
|
|
39597
39648
|
};
|
|
39598
39649
|
const onData = (chunk) => {
|
|
39599
39650
|
try {
|
|
39600
|
-
|
|
39601
|
-
|
|
39602
|
-
throw new AcpExecutionError(
|
|
39603
|
-
"This saved conversation is too large to preview.",
|
|
39604
|
-
{},
|
|
39605
|
-
"native_history_too_large"
|
|
39606
|
-
);
|
|
39607
|
-
}
|
|
39608
|
-
pending += chunk;
|
|
39609
|
-
let newline = pending.indexOf("\n");
|
|
39651
|
+
let cursor = 0;
|
|
39652
|
+
let newline = chunk.indexOf("\n");
|
|
39610
39653
|
while (newline >= 0) {
|
|
39611
|
-
const
|
|
39612
|
-
|
|
39613
|
-
|
|
39654
|
+
const fragment = chunk.slice(cursor, newline);
|
|
39655
|
+
const lineBytes = pendingBytes + Buffer.byteLength(fragment);
|
|
39656
|
+
if (lineBytes > 32 * 1024 * 1024) {
|
|
39657
|
+
throw new AcpExecutionError(
|
|
39658
|
+
"This saved conversation is too large to preview.",
|
|
39659
|
+
{},
|
|
39660
|
+
"native_history_too_large"
|
|
39661
|
+
);
|
|
39662
|
+
}
|
|
39663
|
+
const line = pendingFragments.length === 0 ? fragment : [...pendingFragments, fragment].join("");
|
|
39664
|
+
pendingBytes = 0;
|
|
39665
|
+
pendingFragments = [];
|
|
39666
|
+
cursor = newline + 1;
|
|
39667
|
+
newline = chunk.indexOf("\n", cursor);
|
|
39614
39668
|
if (line.trim().length === 0) {
|
|
39615
39669
|
continue;
|
|
39616
39670
|
}
|
|
@@ -39706,6 +39760,18 @@ async function readCodexHistoryWithOptions(agent, cwd, nativeSessionId, signal,
|
|
|
39706
39760
|
}
|
|
39707
39761
|
}
|
|
39708
39762
|
}
|
|
39763
|
+
const remainder = chunk.slice(cursor);
|
|
39764
|
+
if (remainder.length > 0) {
|
|
39765
|
+
pendingBytes += Buffer.byteLength(remainder);
|
|
39766
|
+
if (pendingBytes > 32 * 1024 * 1024) {
|
|
39767
|
+
throw new AcpExecutionError(
|
|
39768
|
+
"This saved conversation is too large to preview.",
|
|
39769
|
+
{},
|
|
39770
|
+
"native_history_too_large"
|
|
39771
|
+
);
|
|
39772
|
+
}
|
|
39773
|
+
pendingFragments.push(remainder);
|
|
39774
|
+
}
|
|
39709
39775
|
} catch (cause) {
|
|
39710
39776
|
fail(cause);
|
|
39711
39777
|
}
|
|
@@ -40224,6 +40290,7 @@ var NativeSessionService = class {
|
|
|
40224
40290
|
directoryLabel: directory.label,
|
|
40225
40291
|
prompted: session.prompted,
|
|
40226
40292
|
sessionId: session.sessionId,
|
|
40293
|
+
status: this.#sessions.sessionStatus(session.sessionId),
|
|
40227
40294
|
title: session.title || "Untitled session",
|
|
40228
40295
|
updatedAt: session.updatedAt
|
|
40229
40296
|
});
|
|
@@ -43438,6 +43505,21 @@ var DaemonSessionEventPublisher = class {
|
|
|
43438
43505
|
this.publish(sessionId, event);
|
|
43439
43506
|
}
|
|
43440
43507
|
};
|
|
43508
|
+
publishStatus = (event) => {
|
|
43509
|
+
const socket = this.#socket;
|
|
43510
|
+
if (socket === null || socket.readyState !== WebSocket9.OPEN) {
|
|
43511
|
+
return;
|
|
43512
|
+
}
|
|
43513
|
+
const encoded = encodeDaemonToServiceMessage(event);
|
|
43514
|
+
if (socket.bufferedAmount + Buffer.byteLength(encoded, "utf8") > MAX_BUFFERED_BYTES) {
|
|
43515
|
+
socket.close(1013, "Live event transport overloaded");
|
|
43516
|
+
return;
|
|
43517
|
+
}
|
|
43518
|
+
try {
|
|
43519
|
+
socket.send(encoded);
|
|
43520
|
+
} catch {
|
|
43521
|
+
}
|
|
43522
|
+
};
|
|
43441
43523
|
publishV2 = (event) => {
|
|
43442
43524
|
this.#store.appendExecutingPromptEventV2(event);
|
|
43443
43525
|
const socket = this.#socket;
|
|
@@ -43750,7 +43832,8 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
43750
43832
|
nativeTurn
|
|
43751
43833
|
)).history : null
|
|
43752
43834
|
},
|
|
43753
|
-
"native"
|
|
43835
|
+
"native",
|
|
43836
|
+
publisher.publishStatus
|
|
43754
43837
|
);
|
|
43755
43838
|
const directories = new WorkspaceDirectoryService(config2.bindingId, config2.defaultWorkspace);
|
|
43756
43839
|
const installationObserver = new DaemonInstallationObserver();
|