@moxt-ai/mobius 0.0.102 → 0.0.104
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/cli.js +45 -9
- package/dist/cli.js.map +2 -2
- package/dist/daemon-session-commands.d.ts +7 -1
- package/dist/daemon-session-commands.d.ts.map +1 -1
- package/dist/daemon-session-commands.js +12 -4
- package/dist/daemon-session-commands.js.map +1 -1
- package/dist/daemon-turn-reconciliation.d.ts +8 -2
- package/dist/daemon-turn-reconciliation.d.ts.map +1 -1
- package/dist/daemon-turn-reconciliation.js +2 -0
- package/dist/daemon-turn-reconciliation.js.map +1 -1
- package/dist/index.js +44 -8
- package/dist/index.js.map +2 -2
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +14 -4
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +44 -8
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3381,7 +3381,7 @@ var program = new Command();
|
|
|
3381
3381
|
// package.json
|
|
3382
3382
|
var package_default = {
|
|
3383
3383
|
name: "@moxt-ai/mobius",
|
|
3384
|
-
version: "0.0.
|
|
3384
|
+
version: "0.0.104",
|
|
3385
3385
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
3386
3386
|
type: "module",
|
|
3387
3387
|
bin: {
|
|
@@ -28883,23 +28883,36 @@ function decodeRuntimeDeliveryCommitted(encoded) {
|
|
|
28883
28883
|
}
|
|
28884
28884
|
function decodeSessionStartedEvent(encoded) {
|
|
28885
28885
|
const value = parseJson2(encoded);
|
|
28886
|
-
assertExactKeys(value, ["commandId", "kind", "attemptId", "sessionId"]);
|
|
28886
|
+
assertExactKeys(value, ["commandId", "epoch", "kind", "attemptId", "prompt", "sequence", "sessionId"]);
|
|
28887
28887
|
assertKind(value, SESSION_STARTED_KIND);
|
|
28888
|
+
const sequence = readSequence(value, "sequence");
|
|
28889
|
+
if (sequence !== 0) {
|
|
28890
|
+
throw new ProtocolMessageError("Invalid live start sequence");
|
|
28891
|
+
}
|
|
28888
28892
|
return {
|
|
28889
28893
|
commandId: readIdentifier(value, "commandId"),
|
|
28894
|
+
epoch: readIdentifier(value, "epoch"),
|
|
28890
28895
|
kind: SESSION_STARTED_KIND,
|
|
28891
28896
|
attemptId: readIdentifier(value, "attemptId"),
|
|
28897
|
+
prompt: readText(value, "prompt", MAX_PROMPT_LENGTH),
|
|
28898
|
+
sequence,
|
|
28892
28899
|
sessionId: readIdentifier(value, "sessionId")
|
|
28893
28900
|
};
|
|
28894
28901
|
}
|
|
28895
28902
|
function decodeAgentMessageDeltaEvent(encoded) {
|
|
28896
28903
|
const value = parseJson2(encoded);
|
|
28897
|
-
assertExactKeys(value, ["commandId", "kind", "messageId", "sessionId", "text"]);
|
|
28904
|
+
assertExactKeys(value, ["commandId", "epoch", "kind", "messageId", "sequence", "sessionId", "text"]);
|
|
28898
28905
|
assertKind(value, AGENT_MESSAGE_DELTA_KIND);
|
|
28906
|
+
const sequence = readSequence(value, "sequence");
|
|
28907
|
+
if (sequence === 0) {
|
|
28908
|
+
throw new ProtocolMessageError("Invalid live sequence");
|
|
28909
|
+
}
|
|
28899
28910
|
return {
|
|
28900
28911
|
commandId: readIdentifier(value, "commandId"),
|
|
28912
|
+
epoch: readIdentifier(value, "epoch"),
|
|
28901
28913
|
kind: AGENT_MESSAGE_DELTA_KIND,
|
|
28902
28914
|
messageId: value["messageId"] === void 0 ? "" : readText(value, "messageId", 255),
|
|
28915
|
+
sequence,
|
|
28903
28916
|
sessionId: readIdentifier(value, "sessionId"),
|
|
28904
28917
|
text: readString(value, "text", MAX_EVENT_TEXT_LENGTH)
|
|
28905
28918
|
};
|
|
@@ -37332,7 +37345,7 @@ async function executeSessionConfigure(publisher, socket, command, config2, dire
|
|
|
37332
37345
|
reportOperationFailure(socket, command.requestId, command.sessionId, error62);
|
|
37333
37346
|
}
|
|
37334
37347
|
}
|
|
37335
|
-
async function executePrompt(outbox, publisher, command, config2, directories, audit, sessions, attemptId, activateAttempt, timer, signal, recordLiveText) {
|
|
37348
|
+
async function executePrompt(outbox, publisher, command, config2, directories, audit, sessions, attemptId, activateAttempt, sessionAvailable, timer, signal, recordLiveText) {
|
|
37336
37349
|
const activities = new CoalescingDaemonActivityPublisher(timer, (activity2) => {
|
|
37337
37350
|
publisher.recordAttempt(command.sessionId, daemonActivity(command, activity2), attemptId);
|
|
37338
37351
|
});
|
|
@@ -37359,12 +37372,15 @@ async function executePrompt(outbox, publisher, command, config2, directories, a
|
|
|
37359
37372
|
const text = new CoalescingTextPublisher(
|
|
37360
37373
|
timer,
|
|
37361
37374
|
(messageId, delta) => {
|
|
37375
|
+
const stream = recordLiveText(delta);
|
|
37362
37376
|
publisher.recordAttempt(
|
|
37363
37377
|
command.sessionId,
|
|
37364
37378
|
{
|
|
37365
37379
|
commandId: command.commandId,
|
|
37380
|
+
epoch: stream.epoch,
|
|
37366
37381
|
kind: AGENT_MESSAGE_DELTA_KIND,
|
|
37367
37382
|
messageId,
|
|
37383
|
+
sequence: stream.sequence,
|
|
37368
37384
|
sessionId: command.sessionId,
|
|
37369
37385
|
text: delta
|
|
37370
37386
|
},
|
|
@@ -37377,12 +37393,15 @@ async function executePrompt(outbox, publisher, command, config2, directories, a
|
|
|
37377
37393
|
try {
|
|
37378
37394
|
const resolved = await resolveSessionDirectories(
|
|
37379
37395
|
directories,
|
|
37380
|
-
|
|
37396
|
+
command.bindingId,
|
|
37381
37397
|
command.directoryId,
|
|
37382
37398
|
command.additionalDirectoryIds,
|
|
37383
37399
|
signal
|
|
37384
37400
|
);
|
|
37385
37401
|
const agent = config2.catalog.find(command.agentId);
|
|
37402
|
+
if (!sessionAvailable()) {
|
|
37403
|
+
throw new AcpExecutionError("Another prompt is already running in this conversation", {}, "session_busy");
|
|
37404
|
+
}
|
|
37386
37405
|
if (command.disposition === SessionPromptDisposition.Queue && !outbox.isTerminalExecution(command.targetCommandId, command.sessionId)) {
|
|
37387
37406
|
throw new AcpExecutionError(
|
|
37388
37407
|
"The queued prompt target is unavailable",
|
|
@@ -37424,17 +37443,20 @@ async function executePrompt(outbox, publisher, command, config2, directories, a
|
|
|
37424
37443
|
sessionId: command.sessionId
|
|
37425
37444
|
});
|
|
37426
37445
|
outbox.transitionExecution(command.commandId, "running");
|
|
37446
|
+
const stream = activateAttempt();
|
|
37427
37447
|
publisher.recordAttempt(
|
|
37428
37448
|
command.sessionId,
|
|
37429
37449
|
{
|
|
37430
37450
|
commandId: command.commandId,
|
|
37451
|
+
epoch: stream.epoch,
|
|
37431
37452
|
kind: SESSION_STARTED_KIND,
|
|
37432
37453
|
attemptId,
|
|
37454
|
+
prompt: command.prompt,
|
|
37455
|
+
sequence: stream.sequence,
|
|
37433
37456
|
sessionId: command.sessionId
|
|
37434
37457
|
},
|
|
37435
37458
|
attemptId
|
|
37436
37459
|
);
|
|
37437
|
-
activateAttempt();
|
|
37438
37460
|
const attachments = await resolvePromptArtifacts(config2, command, signal);
|
|
37439
37461
|
let stopReason;
|
|
37440
37462
|
if (command.disposition === SessionPromptDisposition.Steer) {
|
|
@@ -37465,7 +37487,6 @@ async function executePrompt(outbox, publisher, command, config2, directories, a
|
|
|
37465
37487
|
return Promise.resolve();
|
|
37466
37488
|
},
|
|
37467
37489
|
onText: (delta, messageId) => {
|
|
37468
|
-
recordLiveText(delta);
|
|
37469
37490
|
text.record(messageId, delta);
|
|
37470
37491
|
return Promise.resolve();
|
|
37471
37492
|
},
|
|
@@ -37678,6 +37699,7 @@ var ActiveDaemonTurn = class {
|
|
|
37678
37699
|
finish = () => this.#finished.resolve();
|
|
37679
37700
|
accept = () => {
|
|
37680
37701
|
this.#accepted = true;
|
|
37702
|
+
return { epoch: this.#epoch, sequence: 0 };
|
|
37681
37703
|
};
|
|
37682
37704
|
recordText = (delta) => {
|
|
37683
37705
|
this.#sequence += 1;
|
|
@@ -37686,6 +37708,7 @@ var ActiveDaemonTurn = class {
|
|
|
37686
37708
|
this.#text = this.#text.slice(-ACTIVE_TURN_TEXT_LIMIT);
|
|
37687
37709
|
this.#truncated = true;
|
|
37688
37710
|
}
|
|
37711
|
+
return { epoch: this.#epoch, sequence: this.#sequence };
|
|
37689
37712
|
};
|
|
37690
37713
|
snapshot = () => this.#accepted ? {
|
|
37691
37714
|
commandId: this.command.commandId,
|
|
@@ -40127,6 +40150,15 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40127
40150
|
rejectConnection(failure2);
|
|
40128
40151
|
};
|
|
40129
40152
|
const processingDeliveryIds = /* @__PURE__ */ new Set();
|
|
40153
|
+
const sessionAvailable = (command) => {
|
|
40154
|
+
if (command.disposition === SessionPromptDisposition.Steer) {
|
|
40155
|
+
return true;
|
|
40156
|
+
}
|
|
40157
|
+
const first = [...activeTurns.values()].find(
|
|
40158
|
+
(turn) => turn.command.sessionId === command.sessionId && turn.command.disposition !== SessionPromptDisposition.Steer
|
|
40159
|
+
);
|
|
40160
|
+
return first === void 0 || first.command.commandId === command.commandId;
|
|
40161
|
+
};
|
|
40130
40162
|
const processDeliveredPrompt = async (delivery, command, trackActiveAttempt, execute) => {
|
|
40131
40163
|
if (command.sessionId !== delivery.sessionId) {
|
|
40132
40164
|
throw new Error("Runtime delivery Session identity does not match its payload");
|
|
@@ -40156,10 +40188,11 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40156
40188
|
const turn = new ActiveDaemonTurn(command, receipt.attemptId);
|
|
40157
40189
|
activeTurns.set(command.commandId, turn);
|
|
40158
40190
|
const activateAttempt = () => {
|
|
40159
|
-
turn.accept();
|
|
40191
|
+
const stream = turn.accept();
|
|
40160
40192
|
if (trackActiveAttempt) {
|
|
40161
40193
|
activeAttemptIds.set(command.sessionId, receipt.attemptId);
|
|
40162
40194
|
}
|
|
40195
|
+
return stream;
|
|
40163
40196
|
};
|
|
40164
40197
|
try {
|
|
40165
40198
|
await execute(receipt.attemptId, activateAttempt, turn.signal, turn);
|
|
@@ -40262,6 +40295,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40262
40295
|
sessions,
|
|
40263
40296
|
attemptId,
|
|
40264
40297
|
activateAttempt,
|
|
40298
|
+
() => sessionAvailable(command),
|
|
40265
40299
|
timer,
|
|
40266
40300
|
executionSignal,
|
|
40267
40301
|
turn.recordText
|
|
@@ -41015,11 +41049,13 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
41015
41049
|
sessions,
|
|
41016
41050
|
receipt.attemptId,
|
|
41017
41051
|
() => {
|
|
41018
|
-
turn.accept();
|
|
41052
|
+
const stream = turn.accept();
|
|
41019
41053
|
if (command.disposition !== SessionPromptDisposition.Steer) {
|
|
41020
41054
|
activeAttemptIds.set(command.sessionId, receipt.attemptId);
|
|
41021
41055
|
}
|
|
41056
|
+
return stream;
|
|
41022
41057
|
},
|
|
41058
|
+
() => sessionAvailable(command),
|
|
41023
41059
|
timer,
|
|
41024
41060
|
turn.signal,
|
|
41025
41061
|
turn.recordText
|