@moxt-ai/mobius 0.0.292 → 0.0.294
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/harness/codex/agent.d.ts.map +1 -1
- package/dist/acp/harness/codex/agent.js +8 -2
- package/dist/acp/harness/codex/agent.js.map +1 -1
- package/dist/acp/harness/codex/borrowed-agent.d.ts +2 -4
- package/dist/acp/harness/codex/borrowed-agent.d.ts.map +1 -1
- package/dist/acp/harness/codex/borrowed-agent.js +2 -1
- package/dist/acp/harness/codex/borrowed-agent.js.map +1 -1
- package/dist/acp/harness/codex/owned-agent.d.ts +1 -0
- package/dist/acp/harness/codex/owned-agent.d.ts.map +1 -1
- package/dist/acp/harness/codex/owned-agent.js +1 -0
- package/dist/acp/harness/codex/owned-agent.js.map +1 -1
- package/dist/acp/harness/codex/session-agent.d.ts +1 -0
- package/dist/acp/harness/codex/session-agent.d.ts.map +1 -1
- package/dist/acp/protocol/session-capabilities.d.ts +2 -0
- package/dist/acp/protocol/session-capabilities.d.ts.map +1 -1
- package/dist/acp/protocol/session-capabilities.js +11 -0
- package/dist/acp/protocol/session-capabilities.js.map +1 -1
- package/dist/cli.js +135 -13
- package/dist/cli.js.map +4 -4
- package/dist/daemon/lifecycle/worker.d.ts.map +1 -1
- package/dist/daemon/lifecycle/worker.js +4 -1
- package/dist/daemon/lifecycle/worker.js.map +1 -1
- package/dist/daemon/upgrades/upgrade.d.ts +2 -1
- package/dist/daemon/upgrades/upgrade.d.ts.map +1 -1
- package/dist/daemon/upgrades/upgrade.js +101 -10
- package/dist/daemon/upgrades/upgrade.js.map +1 -1
- package/dist/runtime/command/registry/prompt.d.ts.map +1 -1
- package/dist/runtime/command/registry/prompt.js +10 -0
- package/dist/runtime/command/registry/prompt.js.map +1 -1
- package/dist/runtime/engine.d.ts +2 -0
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +1 -0
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/relay/run-relay-connection.d.ts.map +1 -1
- package/dist/runtime/relay/run-relay-connection.js +2 -0
- package/dist/runtime/relay/run-relay-connection.js.map +1 -1
- package/dist/runtime/relay/session-event-publisher.d.ts +1 -0
- package/dist/runtime/relay/session-event-publisher.d.ts.map +1 -1
- package/dist/runtime/relay/session-event-publisher.js +5 -0
- package/dist/runtime/relay/session-event-publisher.js.map +1 -1
- package/dist/runtime/run.d.ts +2 -0
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +1 -0
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime.js +100 -7
- package/dist/runtime.js.map +4 -4
- package/dist/session/api/session-layer.d.ts +2 -0
- package/dist/session/api/session-layer.d.ts.map +1 -1
- package/dist/session/api/session-layer.js +1 -1
- package/dist/session/api/session-layer.js.map +1 -1
- package/dist/session/live/agent-session-restore.d.ts +1 -0
- package/dist/session/live/agent-session-restore.d.ts.map +1 -1
- package/dist/session/live/agent-session.d.ts +1 -0
- package/dist/session/live/agent-session.d.ts.map +1 -1
- package/dist/session/live/agent-session.js +5 -1
- package/dist/session/live/agent-session.js.map +1 -1
- package/dist/session/live/session-restore.d.ts.map +1 -1
- package/dist/session/live/session-restore.js +1 -0
- package/dist/session/live/session-restore.js.map +1 -1
- package/dist/session/turn/runtime-turn-activity.d.ts +11 -0
- package/dist/session/turn/runtime-turn-activity.d.ts.map +1 -0
- package/dist/session/turn/runtime-turn-activity.js +45 -0
- package/dist/session/turn/runtime-turn-activity.js.map +1 -0
- package/dist/session/turn/session-turns.d.ts +3 -1
- package/dist/session/turn/session-turns.d.ts.map +1 -1
- package/dist/session/turn/session-turns.js +11 -2
- package/dist/session/turn/session-turns.js.map +1 -1
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -958,6 +958,16 @@ function normalizeAcpCapabilities(initialized) {
|
|
|
958
958
|
unstableForkSession: session?.fork != null
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
|
+
function restrictAcpSessionCapabilities(capabilities, response) {
|
|
962
|
+
if (!isRecord(response) || !isRecord(response["_meta"])) {
|
|
963
|
+
return capabilities;
|
|
964
|
+
}
|
|
965
|
+
const steering = response["_meta"]["steering"];
|
|
966
|
+
if (!isRecord(steering) || steering["supported"] !== false) {
|
|
967
|
+
return capabilities;
|
|
968
|
+
}
|
|
969
|
+
return Object.freeze({ ...capabilities, steering: false });
|
|
970
|
+
}
|
|
961
971
|
|
|
962
972
|
// src/acp/agent/agent-definition.ts
|
|
963
973
|
var AgentDefinition = class {
|
|
@@ -22572,7 +22582,7 @@ import { fetch as fetch3 } from "undici";
|
|
|
22572
22582
|
// package.json
|
|
22573
22583
|
var package_default = {
|
|
22574
22584
|
name: "@moxt-ai/mobius",
|
|
22575
|
-
version: "0.0.
|
|
22585
|
+
version: "0.0.294",
|
|
22576
22586
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
22577
22587
|
type: "module",
|
|
22578
22588
|
bin: {
|
|
@@ -67317,6 +67327,7 @@ var queuePageSchema = external_exports.object({
|
|
|
67317
67327
|
nextCursor: external_exports.string().nullish()
|
|
67318
67328
|
});
|
|
67319
67329
|
var CodexBorrowedAcpAgent = class {
|
|
67330
|
+
steeringSupported = false;
|
|
67320
67331
|
#client;
|
|
67321
67332
|
#threadId;
|
|
67322
67333
|
#emit;
|
|
@@ -67538,7 +67549,7 @@ var CodexBorrowedAcpAgent = class {
|
|
|
67538
67549
|
nativeTurnId = () => null;
|
|
67539
67550
|
steer = async (_params, signal) => {
|
|
67540
67551
|
signal.throwIfAborted();
|
|
67541
|
-
|
|
67552
|
+
throw new AcpExecutionError("This Codex session only supports queued input", {}, "steering_unsupported");
|
|
67542
67553
|
};
|
|
67543
67554
|
// The reader connection cannot receive or control the owner's live turn.
|
|
67544
67555
|
onNotification = async (_method, _params) => {
|
|
@@ -67678,6 +67689,7 @@ function userInputSchema(questions) {
|
|
|
67678
67689
|
return { properties, required: required2, type: "object" };
|
|
67679
67690
|
}
|
|
67680
67691
|
var CodexOwnedAcpAgent = class {
|
|
67692
|
+
steeringSupported = true;
|
|
67681
67693
|
#context;
|
|
67682
67694
|
#appServer;
|
|
67683
67695
|
#settings;
|
|
@@ -68729,7 +68741,10 @@ var CodexAcpAgent = class {
|
|
|
68729
68741
|
await this.#resume(context.params.sessionId, context.params.cwd, context.signal);
|
|
68730
68742
|
await this.#replaySavedHistory(context.signal);
|
|
68731
68743
|
this.#advertiseCompactCommand();
|
|
68732
|
-
return {
|
|
68744
|
+
return {
|
|
68745
|
+
_meta: { steering: { supported: this.#sessionAgent.steeringSupported } },
|
|
68746
|
+
configOptions: this.#settings.configOptions()
|
|
68747
|
+
};
|
|
68733
68748
|
}).onRequest(methods3.agent.session.fork, async (context) => {
|
|
68734
68749
|
const forked = threadForkResponseSchema.parse(
|
|
68735
68750
|
await this.#appServer.request(
|
|
@@ -68752,7 +68767,10 @@ var CodexAcpAgent = class {
|
|
|
68752
68767
|
}).onRequest(methods3.agent.session.resume, async (context) => {
|
|
68753
68768
|
await this.#resume(context.params.sessionId, context.params.cwd, context.signal);
|
|
68754
68769
|
this.#advertiseCompactCommand();
|
|
68755
|
-
return {
|
|
68770
|
+
return {
|
|
68771
|
+
_meta: { steering: { supported: this.#sessionAgent.steeringSupported } },
|
|
68772
|
+
configOptions: this.#settings.configOptions()
|
|
68773
|
+
};
|
|
68756
68774
|
}).onRequest(methods3.agent.session.prompt, async (context) => {
|
|
68757
68775
|
if (isCompactCommand(context.params.prompt)) {
|
|
68758
68776
|
return await this.#sessionAgent.compact(context.signal);
|
|
@@ -83630,6 +83648,7 @@ async function restoreSession(session, signal, recovery, origin) {
|
|
|
83630
83648
|
session.setNativeHistoryOwnership({ kind: "fresh-session" });
|
|
83631
83649
|
lifecycleResponse2 = created;
|
|
83632
83650
|
}
|
|
83651
|
+
session.restrictSessionCapabilities(lifecycleResponse2);
|
|
83633
83652
|
session.setConfigOptions(session.sessionConfigProtocol.normalizeLifecycle(lifecycleResponse2));
|
|
83634
83653
|
if (stored instanceof FoundStoredSession && session.restored) {
|
|
83635
83654
|
await session.restoreStoredConfigurations(stored.session, signal);
|
|
@@ -83882,6 +83901,9 @@ var AgentSession = class _AgentSession {
|
|
|
83882
83901
|
signal
|
|
83883
83902
|
);
|
|
83884
83903
|
};
|
|
83904
|
+
restrictSessionCapabilities = (response) => {
|
|
83905
|
+
this.#capabilities = restrictAcpSessionCapabilities(this.#capabilities, response);
|
|
83906
|
+
};
|
|
83885
83907
|
prepared = () => new PreparedSession(
|
|
83886
83908
|
this.#agentName,
|
|
83887
83909
|
this.#agentVersion,
|
|
@@ -83955,6 +83977,7 @@ var AgentSession = class _AgentSession {
|
|
|
83955
83977
|
);
|
|
83956
83978
|
await this.#updates.drained();
|
|
83957
83979
|
signal.throwIfAborted();
|
|
83980
|
+
this.restrictSessionCapabilities(response);
|
|
83958
83981
|
const loaded = { history, kind: "loaded", response };
|
|
83959
83982
|
this.#sessionLoad = loaded;
|
|
83960
83983
|
return loaded;
|
|
@@ -86536,6 +86559,50 @@ var ExecutionReceipts = class {
|
|
|
86536
86559
|
};
|
|
86537
86560
|
};
|
|
86538
86561
|
|
|
86562
|
+
// src/session/turn/runtime-turn-activity.ts
|
|
86563
|
+
var RuntimeTurnActivity = class {
|
|
86564
|
+
#turns = /* @__PURE__ */ new Set();
|
|
86565
|
+
#admission = { kind: "open" };
|
|
86566
|
+
acceptsPrompts = () => this.#admission.kind !== "reserved";
|
|
86567
|
+
count = () => this.#turns.size;
|
|
86568
|
+
start = (turn) => {
|
|
86569
|
+
this.#turns.add(turn);
|
|
86570
|
+
};
|
|
86571
|
+
finish = (turn) => {
|
|
86572
|
+
this.#turns.delete(turn);
|
|
86573
|
+
if (this.#turns.size === 0 && this.#admission.kind === "waiting") {
|
|
86574
|
+
this.#admission.reserve();
|
|
86575
|
+
}
|
|
86576
|
+
};
|
|
86577
|
+
reserveWhenIdle = (signal) => {
|
|
86578
|
+
signal.throwIfAborted();
|
|
86579
|
+
if (this.#admission.kind !== "open") {
|
|
86580
|
+
throw new Error("A daemon upgrade already owns admission");
|
|
86581
|
+
}
|
|
86582
|
+
return new Promise((resolve18, reject2) => {
|
|
86583
|
+
const abort = () => {
|
|
86584
|
+
this.#admission = { kind: "open" };
|
|
86585
|
+
signal.removeEventListener("abort", abort);
|
|
86586
|
+
reject2(signal.reason);
|
|
86587
|
+
};
|
|
86588
|
+
const reserve = () => {
|
|
86589
|
+
this.#admission = { kind: "reserved" };
|
|
86590
|
+
signal.removeEventListener("abort", abort);
|
|
86591
|
+
resolve18({
|
|
86592
|
+
[Symbol.dispose]: () => {
|
|
86593
|
+
this.#admission = { kind: "open" };
|
|
86594
|
+
}
|
|
86595
|
+
});
|
|
86596
|
+
};
|
|
86597
|
+
this.#admission = { kind: "waiting", reserve };
|
|
86598
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
86599
|
+
if (this.#turns.size === 0) {
|
|
86600
|
+
reserve();
|
|
86601
|
+
}
|
|
86602
|
+
});
|
|
86603
|
+
};
|
|
86604
|
+
};
|
|
86605
|
+
|
|
86539
86606
|
// src/session/turn/active-turn.ts
|
|
86540
86607
|
import { randomUUID as randomUUID14 } from "node:crypto";
|
|
86541
86608
|
var ActiveRuntimeTurn = class {
|
|
@@ -86752,9 +86819,12 @@ var SessionExecutionState = class {
|
|
|
86752
86819
|
var SessionTurns = class {
|
|
86753
86820
|
#bySessionId = /* @__PURE__ */ new Map();
|
|
86754
86821
|
#operations;
|
|
86755
|
-
|
|
86822
|
+
#activity;
|
|
86823
|
+
constructor(operations, activity2 = new RuntimeTurnActivity()) {
|
|
86756
86824
|
this.#operations = operations;
|
|
86825
|
+
this.#activity = activity2;
|
|
86757
86826
|
}
|
|
86827
|
+
acceptsPrompts = () => this.#activity.acceptsPrompts();
|
|
86758
86828
|
session = (sessionId) => {
|
|
86759
86829
|
let session = this.#bySessionId.get(sessionId);
|
|
86760
86830
|
if (session === void 0) {
|
|
@@ -86764,10 +86834,15 @@ var SessionTurns = class {
|
|
|
86764
86834
|
return session;
|
|
86765
86835
|
};
|
|
86766
86836
|
get = (commandId, sessionId) => this.#bySessionId.get(sessionId)?.get(commandId);
|
|
86767
|
-
start = (command, attemptId) =>
|
|
86837
|
+
start = (command, attemptId) => {
|
|
86838
|
+
const turn = this.session(command.sessionId).start(command, attemptId);
|
|
86839
|
+
this.#activity.start(turn);
|
|
86840
|
+
return turn;
|
|
86841
|
+
};
|
|
86768
86842
|
finish = (turn) => {
|
|
86769
86843
|
this.#bySessionId.get(turn.command.sessionId)?.finish(turn);
|
|
86770
86844
|
this.sweep();
|
|
86845
|
+
this.#activity.finish(turn);
|
|
86771
86846
|
};
|
|
86772
86847
|
recordEvent = (event) => "sessionId" in event ? this.#bySessionId.get(event.sessionId)?.recordEvent(event) ?? event : event;
|
|
86773
86848
|
recordSessionEvent = (event) => {
|
|
@@ -87009,7 +87084,7 @@ function buildSessionLayer(options) {
|
|
|
87009
87084
|
const sessionStore = new SqliteSessionStore(new AcpSessionTable(sessionDatabase), events);
|
|
87010
87085
|
const externalContent = new LocalExternalContentStore(stateDirectory);
|
|
87011
87086
|
const operations = new ExecutionReceipts();
|
|
87012
|
-
const activeSessions = new SessionTurns(operations);
|
|
87087
|
+
const activeSessions = new SessionTurns(operations, options.turnActivity);
|
|
87013
87088
|
const directories = new WorkspaceDirectoryService(bindingId, defaultWorkspace);
|
|
87014
87089
|
const manager = new SessionManager2({
|
|
87015
87090
|
observer: new SessionLayerObserver((event) => eventProjection.record(event), sink.publishInfo),
|
|
@@ -89070,6 +89145,16 @@ var sessionPromptCommand = {
|
|
|
89070
89145
|
if (message.kind !== SESSION_PROMPT_KIND) {
|
|
89071
89146
|
throw new Error("Command kind mismatch");
|
|
89072
89147
|
}
|
|
89148
|
+
if (!context.sessionTurns.acceptsPrompts()) {
|
|
89149
|
+
send(context.socket, {
|
|
89150
|
+
code: "runtime_upgrading",
|
|
89151
|
+
requestId: message.commandId,
|
|
89152
|
+
kind: "session.operation.failed",
|
|
89153
|
+
message: "The Runtime is upgrading. Retry after it reconnects.",
|
|
89154
|
+
sessionId: message.sessionId
|
|
89155
|
+
});
|
|
89156
|
+
return;
|
|
89157
|
+
}
|
|
89073
89158
|
const receipt = context.operations.claimExecution(
|
|
89074
89159
|
message.commandId,
|
|
89075
89160
|
message.sessionId,
|
|
@@ -89875,6 +89960,7 @@ async function runRelayConnection({
|
|
|
89875
89960
|
reject2(failure2);
|
|
89876
89961
|
};
|
|
89877
89962
|
const stop = () => {
|
|
89963
|
+
publisher.flush();
|
|
89878
89964
|
diagnostics.connectionClosed(connectionEpoch, 1e3, "Daemon stopped", "daemon_stop");
|
|
89879
89965
|
closeRelaySocket(socket, 1e3, "Daemon stopped");
|
|
89880
89966
|
resolveConnection();
|
|
@@ -90030,6 +90116,11 @@ var RuntimeSessionEventPublisher = class {
|
|
|
90030
90116
|
this.#socket = null;
|
|
90031
90117
|
this.dropPendingEvents();
|
|
90032
90118
|
};
|
|
90119
|
+
flush = () => {
|
|
90120
|
+
if (this.#socket !== null) {
|
|
90121
|
+
this.flushEvents(this.#socket);
|
|
90122
|
+
}
|
|
90123
|
+
};
|
|
90033
90124
|
publishOperationFailure = (sessionId, requestId, code, message) => {
|
|
90034
90125
|
this.#send({ kind: "session.operation.failed", sessionId, requestId, code, message });
|
|
90035
90126
|
};
|
|
@@ -90163,6 +90254,7 @@ async function runRuntime(config2, parentSignal, timer = systemTimer, options =
|
|
|
90163
90254
|
);
|
|
90164
90255
|
const publisher = new RuntimeSessionEventPublisher(timer);
|
|
90165
90256
|
const layer = buildSessionLayer({
|
|
90257
|
+
...options.turnActivity === void 0 ? {} : { turnActivity: options.turnActivity },
|
|
90166
90258
|
bindingId: config2.bindingId,
|
|
90167
90259
|
channelId: config2.channelId,
|
|
90168
90260
|
defaultWorkspace: config2.defaultWorkspace,
|
|
@@ -90406,6 +90498,7 @@ var MobiusRuntimeEngine = class {
|
|
|
90406
90498
|
this.#state = new RunningMobiusRuntimeState();
|
|
90407
90499
|
try {
|
|
90408
90500
|
await runRuntime(this.#config, signal, void 0, {
|
|
90501
|
+
...this.#options.turnActivity === void 0 ? {} : { turnActivity: this.#options.turnActivity },
|
|
90409
90502
|
...this.#options.onConnectionStatus === void 0 ? {} : { onConnectionStatus: this.#options.onConnectionStatus },
|
|
90410
90503
|
...this.#options.reportUpgradeAvailability === void 0 ? {} : { reportUpgradeAvailability: this.#options.reportUpgradeAvailability },
|
|
90411
90504
|
...this.#options.processLogsDirectory === void 0 ? {} : { processLogsDirectory: this.#options.processLogsDirectory }
|