@moxt-ai/mobius 0.0.135 → 0.0.136
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 +43 -37
- package/dist/cli.js.map +2 -2
- package/dist/daemon-active-turn.d.ts +1 -0
- package/dist/daemon-active-turn.d.ts.map +1 -1
- package/dist/daemon-active-turn.js +16 -17
- package/dist/daemon-active-turn.js.map +1 -1
- package/dist/daemon-turn-registry.d.ts +1 -1
- package/dist/daemon-turn-registry.d.ts.map +1 -1
- package/dist/daemon-turn-registry.js +6 -2
- package/dist/daemon-turn-registry.js.map +1 -1
- package/dist/index.js +42 -36
- package/dist/index.js.map +2 -2
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +1 -2
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +42 -36
- 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.136",
|
|
3385
3385
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
3386
3386
|
type: "module",
|
|
3387
3387
|
bin: {
|
|
@@ -29475,7 +29475,6 @@ var nativeMessagePageSchema = external_exports.discriminatedUnion("status", [
|
|
|
29475
29475
|
var NATIVE_SESSION_REQUEST_KIND = "native.session.request";
|
|
29476
29476
|
var NATIVE_SESSION_RESULT_KIND = "native.session.result";
|
|
29477
29477
|
var NATIVE_SESSION_CANCEL_KIND = "native.session.cancel";
|
|
29478
|
-
var ACTIVE_TURN_TEXT_LIMIT = 1e6;
|
|
29479
29478
|
var directoryId = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
|
|
29480
29479
|
var envelope = {
|
|
29481
29480
|
requestId: identifierStringSchema,
|
|
@@ -29494,6 +29493,18 @@ var activeTurnActivitySchema = external_exports.strictObject({
|
|
|
29494
29493
|
title: external_exports.string().max(500),
|
|
29495
29494
|
toolKind: external_exports.string().max(64)
|
|
29496
29495
|
}).readonly();
|
|
29496
|
+
var activeTurnSnapshotSchema = external_exports.strictObject({
|
|
29497
|
+
activities: external_exports.array(activeTurnActivitySchema).readonly(),
|
|
29498
|
+
commandId: identifierStringSchema,
|
|
29499
|
+
content: external_exports.array(displayContentSchema).readonly(),
|
|
29500
|
+
prompt: external_exports.string().max(1e5),
|
|
29501
|
+
text: external_exports.string(),
|
|
29502
|
+
truncated: external_exports.boolean(),
|
|
29503
|
+
epoch: identifierStringSchema,
|
|
29504
|
+
interaction: external_exports.discriminatedUnion("kind", [sessionPermissionRequestedEventSchema, sessionElicitationRequestedEventSchema]).nullable(),
|
|
29505
|
+
sequence: external_exports.number().int().nonnegative(),
|
|
29506
|
+
state: external_exports.literal("running")
|
|
29507
|
+
}).readonly();
|
|
29497
29508
|
var identity = {
|
|
29498
29509
|
...envelope,
|
|
29499
29510
|
kind: external_exports.literal(NATIVE_SESSION_REQUEST_KIND),
|
|
@@ -29575,21 +29586,7 @@ var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
|
|
|
29575
29586
|
images: external_exports.array(promptImageSchema).max(8).readonly()
|
|
29576
29587
|
}).readonly()
|
|
29577
29588
|
).readonly(),
|
|
29578
|
-
turn:
|
|
29579
|
-
activities: external_exports.array(activeTurnActivitySchema).max(100).readonly(),
|
|
29580
|
-
commandId: identifierStringSchema,
|
|
29581
|
-
content: external_exports.array(displayContentSchema).max(100).readonly(),
|
|
29582
|
-
prompt: external_exports.string().max(1e5),
|
|
29583
|
-
text: external_exports.string().max(ACTIVE_TURN_TEXT_LIMIT),
|
|
29584
|
-
truncated: external_exports.boolean(),
|
|
29585
|
-
epoch: identifierStringSchema,
|
|
29586
|
-
interaction: external_exports.discriminatedUnion("kind", [
|
|
29587
|
-
sessionPermissionRequestedEventSchema,
|
|
29588
|
-
sessionElicitationRequestedEventSchema
|
|
29589
|
-
]).nullable(),
|
|
29590
|
-
sequence: external_exports.number().int().nonnegative(),
|
|
29591
|
-
state: external_exports.literal("running")
|
|
29592
|
-
}).readonly().nullable()
|
|
29589
|
+
turn: activeTurnSnapshotSchema.nullable()
|
|
29593
29590
|
}).readonly(),
|
|
29594
29591
|
external_exports.strictObject({
|
|
29595
29592
|
...resultEnvelope,
|
|
@@ -29665,6 +29662,13 @@ var committedEventSchema = external_exports.strictObject({
|
|
|
29665
29662
|
}).readonly();
|
|
29666
29663
|
var SESSION_QUEUE_CHANGED_KIND = "session.queue.changed";
|
|
29667
29664
|
var sessionQueueChangedSchema = external_exports.strictObject({ kind: external_exports.literal(SESSION_QUEUE_CHANGED_KIND), sessionId: identifierStringSchema }).readonly();
|
|
29665
|
+
var SESSION_TURN_UPDATED_KIND = "session.turn.updated";
|
|
29666
|
+
var sessionTurnUpdatedSchema = external_exports.strictObject({
|
|
29667
|
+
kind: external_exports.literal(SESSION_TURN_UPDATED_KIND),
|
|
29668
|
+
sessionId: identifierStringSchema,
|
|
29669
|
+
turn: activeTurnSnapshotSchema
|
|
29670
|
+
}).readonly();
|
|
29671
|
+
var decodeSessionTurnUpdatedEvent = (encoded) => decode5(encoded, sessionTurnUpdatedSchema);
|
|
29668
29672
|
function decode5(encoded, schema) {
|
|
29669
29673
|
let value;
|
|
29670
29674
|
try {
|
|
@@ -29694,6 +29698,8 @@ var encodeSessionEventEnvelope = (message) => encode4(message, eventEnvelopeSche
|
|
|
29694
29698
|
function decodeRecordedSessionEvent(encoded) {
|
|
29695
29699
|
const kind = decodeMessageKind(encoded);
|
|
29696
29700
|
switch (kind) {
|
|
29701
|
+
case SESSION_TURN_UPDATED_KIND:
|
|
29702
|
+
return decodeSessionTurnUpdatedEvent(encoded);
|
|
29697
29703
|
case SESSION_QUEUE_CHANGED_KIND:
|
|
29698
29704
|
return decode5(encoded, sessionQueueChangedSchema);
|
|
29699
29705
|
case AGENT_ACTIVITY_KIND:
|
|
@@ -42071,7 +42077,6 @@ var ActiveDaemonTurn = class {
|
|
|
42071
42077
|
#text = "";
|
|
42072
42078
|
#activities = /* @__PURE__ */ new Map();
|
|
42073
42079
|
#content = /* @__PURE__ */ new Map();
|
|
42074
|
-
#truncated = false;
|
|
42075
42080
|
#sequence = 0;
|
|
42076
42081
|
#interaction = null;
|
|
42077
42082
|
#epoch = decodeIdentifier(randomUUID2());
|
|
@@ -42114,21 +42119,8 @@ var ActiveDaemonTurn = class {
|
|
|
42114
42119
|
effectiveDisposition = () => this.#dispatch.kind === "promoted" ? SessionPromptDisposition.Steer : this.command.disposition;
|
|
42115
42120
|
recordEvent = (event) => {
|
|
42116
42121
|
if (event.kind === AGENT_MESSAGE_DELTA_KIND) {
|
|
42117
|
-
this.#sequence += 1;
|
|
42118
42122
|
this.#text += event.text;
|
|
42119
|
-
|
|
42120
|
-
this.#text = this.#text.slice(-ACTIVE_TURN_TEXT_LIMIT);
|
|
42121
|
-
this.#truncated = true;
|
|
42122
|
-
}
|
|
42123
|
-
return {
|
|
42124
|
-
commandId: this.command.commandId,
|
|
42125
|
-
epoch: this.#epoch,
|
|
42126
|
-
kind: AGENT_MESSAGE_DELTA_KIND,
|
|
42127
|
-
messageId: event.messageId,
|
|
42128
|
-
sequence: this.#sequence,
|
|
42129
|
-
sessionId: this.command.sessionId,
|
|
42130
|
-
text: event.text
|
|
42131
|
-
};
|
|
42123
|
+
return this.updated();
|
|
42132
42124
|
}
|
|
42133
42125
|
if (event.sessionId !== this.command.sessionId || "commandId" in event && event.commandId !== this.command.commandId) {
|
|
42134
42126
|
return event;
|
|
@@ -42169,15 +42161,26 @@ var ActiveDaemonTurn = class {
|
|
|
42169
42161
|
} else if ((event.kind === SESSION_PERMISSION_RESOLVED_KIND || event.kind === SESSION_ELICITATION_RESOLVED_KIND) && this.#interaction?.interactionId === event.interactionId) {
|
|
42170
42162
|
this.#interaction = null;
|
|
42171
42163
|
}
|
|
42164
|
+
if (event.kind === AGENT_ACTIVITY_KIND || event.kind === AGENT_ACTIVITY_NARRATION_KIND || event.kind === AGENT_CONTENT_KIND) {
|
|
42165
|
+
return this.updated();
|
|
42166
|
+
}
|
|
42172
42167
|
return event;
|
|
42173
42168
|
};
|
|
42169
|
+
updated = () => {
|
|
42170
|
+
this.#sequence += 1;
|
|
42171
|
+
const turn = this.snapshot();
|
|
42172
|
+
if (turn === null) {
|
|
42173
|
+
throw new Error("Only a running turn can publish a snapshot");
|
|
42174
|
+
}
|
|
42175
|
+
return { kind: "session.turn.updated", sessionId: this.command.sessionId, turn };
|
|
42176
|
+
};
|
|
42174
42177
|
snapshot = () => this.#dispatch.kind === "running" ? {
|
|
42175
42178
|
activities: [...this.#activities.values()].sort((left, right) => left.sequence - right.sequence),
|
|
42176
42179
|
commandId: decodeIdentifier(this.command.commandId),
|
|
42177
42180
|
content: [...this.#content.values()],
|
|
42178
42181
|
prompt: this.command.prompt,
|
|
42179
42182
|
text: this.#text,
|
|
42180
|
-
truncated:
|
|
42183
|
+
truncated: false,
|
|
42181
42184
|
epoch: this.#epoch,
|
|
42182
42185
|
interaction: this.#interaction,
|
|
42183
42186
|
sequence: this.#sequence,
|
|
@@ -42246,9 +42249,13 @@ var DaemonTurnRegistry = class {
|
|
|
42246
42249
|
turn.finish();
|
|
42247
42250
|
};
|
|
42248
42251
|
recordEvent = (event) => {
|
|
42249
|
-
|
|
42250
|
-
turn.
|
|
42252
|
+
if ("commandId" in event) {
|
|
42253
|
+
const turn = this.#turns.get(event.commandId);
|
|
42254
|
+
if (turn !== void 0 && turn.command.sessionId === event.sessionId) {
|
|
42255
|
+
return turn.recordEvent(event);
|
|
42256
|
+
}
|
|
42251
42257
|
}
|
|
42258
|
+
return event;
|
|
42252
42259
|
};
|
|
42253
42260
|
executionSnapshot = async (matches) => {
|
|
42254
42261
|
const matching = [];
|
|
@@ -46257,8 +46264,7 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
46257
46264
|
const publisher = new DaemonSessionEventPublisher();
|
|
46258
46265
|
const activeTurns = new DaemonTurnRegistry(operations);
|
|
46259
46266
|
const recordSessionEvent = (sessionId, event) => {
|
|
46260
|
-
activeTurns.recordEvent(event);
|
|
46261
|
-
publisher.publish(sessionId, event);
|
|
46267
|
+
publisher.publish(sessionId, activeTurns.recordEvent(event));
|
|
46262
46268
|
};
|
|
46263
46269
|
const agentRuntime = new AgentRuntimeManager(
|
|
46264
46270
|
new DaemonAcpObserver(recordSessionEvent),
|