@moxt-ai/mobius 0.0.382 → 0.0.384
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/{chunk-3GTWYIU4.js → chunk-4INIQJPN.js} +51 -92
- package/dist/{chunk-3GTWYIU4.js.map → chunk-4INIQJPN.js.map} +3 -3
- package/dist/{chunk-WGPROR4Q.js → chunk-F2V4THMG.js} +2 -2
- package/dist/{chunk-WGPROR4Q.js.map → chunk-F2V4THMG.js.map} +1 -1
- package/dist/{chunk-6JSBDO2X.js → chunk-QO4TCOUF.js} +2 -2
- package/dist/{cli-XRZYWC74.js → cli-DXKP3IY6.js} +4 -4
- package/dist/cli.js +3 -3
- package/dist/engine/runtime/command/registry/interactions.js +3 -3
- package/dist/engine/runtime/command/registry/interactions.js.map +1 -1
- package/dist/engine/session/manager/session-manager.d.ts +2 -1
- package/dist/engine/session/manager/session-manager.d.ts.map +1 -1
- package/dist/engine/session/manager/session-manager.js +12 -10
- package/dist/engine/session/manager/session-manager.js.map +1 -1
- package/dist/engine/session/prompt/execute-prompt.d.ts +1 -1
- package/dist/engine/session/prompt/execute-prompt.d.ts.map +1 -1
- package/dist/engine/session/prompt/execute-prompt.js +3 -1
- package/dist/engine/session/prompt/execute-prompt.js.map +1 -1
- package/dist/engine/session/turn/active-executions.d.ts +5 -2
- package/dist/engine/session/turn/active-executions.d.ts.map +1 -1
- package/dist/engine/session/turn/active-executions.js +16 -53
- package/dist/engine/session/turn/active-executions.js.map +1 -1
- package/dist/engine/session/turn/active-turn.d.ts +10 -2
- package/dist/engine/session/turn/active-turn.d.ts.map +1 -1
- package/dist/engine/session/turn/active-turn.js +5 -5
- package/dist/engine/session/turn/active-turn.js.map +1 -1
- package/dist/engine.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-6JSBDO2X.js.map → chunk-QO4TCOUF.js.map} +0 -0
- /package/dist/{cli-XRZYWC74.js.map → cli-DXKP3IY6.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__export,
|
|
4
4
|
__using,
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F2V4THMG.js";
|
|
7
7
|
|
|
8
8
|
// src/engine/runtime/relay/runtime-revocation.ts
|
|
9
9
|
var runtimeRevocationCloseCode = 1008;
|
|
@@ -22878,8 +22878,8 @@ function acpEndpointTerminationError(termination) {
|
|
|
22878
22878
|
case "closed":
|
|
22879
22879
|
return new AcpExecutionError("The ACP endpoint is closed", {}, "acp_endpoint_closed");
|
|
22880
22880
|
default: {
|
|
22881
|
-
const
|
|
22882
|
-
return
|
|
22881
|
+
const unreachable2 = termination;
|
|
22882
|
+
return unreachable2;
|
|
22883
22883
|
}
|
|
22884
22884
|
}
|
|
22885
22885
|
}
|
|
@@ -61555,7 +61555,7 @@ function parseTaskListOutput(content) {
|
|
|
61555
61555
|
const tasks = [];
|
|
61556
61556
|
const lines = text2.trim().split("\n");
|
|
61557
61557
|
for (const line of lines) {
|
|
61558
|
-
const match = /^#(\S+) \[(pending|in_progress|completed)\] (.+?)(?: \(([^()]*)\))?(?: \[blocked by ((
|
|
61558
|
+
const match = /^#(\S+) \[(pending|in_progress|completed)\] (.+?)(?: \(([^()]*)\))?(?: \[blocked by (#[^,\]]+(?:, #[^,\]]+)*(?:, )?)\])?$/.exec(line);
|
|
61559
61559
|
if (!match) {
|
|
61560
61560
|
tasks.length = 0;
|
|
61561
61561
|
break;
|
|
@@ -77933,8 +77933,8 @@ var AcpQuerySession = class _AcpQuerySession {
|
|
|
77933
77933
|
case "terminated":
|
|
77934
77934
|
return true;
|
|
77935
77935
|
default: {
|
|
77936
|
-
const
|
|
77937
|
-
return
|
|
77936
|
+
const unreachable2 = this.#lifecycle;
|
|
77937
|
+
return unreachable2;
|
|
77938
77938
|
}
|
|
77939
77939
|
}
|
|
77940
77940
|
};
|
|
@@ -86549,8 +86549,8 @@ var AgentSession = class _AgentSession {
|
|
|
86549
86549
|
return !this.#writingNativeHistory() && this.#nativeHistoryBaseline === baseline && current.kind === "tracked" && current.latestEntryId !== baseline.latestEntryId;
|
|
86550
86550
|
}
|
|
86551
86551
|
default: {
|
|
86552
|
-
const
|
|
86553
|
-
throw new AcpExecutionError("Unexpected native history baseline", { cause:
|
|
86552
|
+
const unreachable2 = baseline;
|
|
86553
|
+
throw new AcpExecutionError("Unexpected native history baseline", { cause: unreachable2 });
|
|
86554
86554
|
}
|
|
86555
86555
|
}
|
|
86556
86556
|
};
|
|
@@ -87011,76 +87011,30 @@ function nativeSessionQuery(options) {
|
|
|
87011
87011
|
}
|
|
87012
87012
|
|
|
87013
87013
|
// src/engine/session/turn/active-executions.ts
|
|
87014
|
-
var unreachable2 = (state) => {
|
|
87015
|
-
throw new AcpExecutionError("Unexpected execution state", { cause: state });
|
|
87016
|
-
};
|
|
87017
87014
|
var ActiveExecutions = class {
|
|
87018
87015
|
#entries = /* @__PURE__ */ new Map();
|
|
87019
|
-
command = (id) =>
|
|
87020
|
-
const state = this.#entries.get(id);
|
|
87021
|
-
switch (state?.kind) {
|
|
87022
|
-
case "running":
|
|
87023
|
-
case "cancelling":
|
|
87024
|
-
return state.commandId;
|
|
87025
|
-
case "cancelled-before-start":
|
|
87026
|
-
case void 0:
|
|
87027
|
-
return void 0;
|
|
87028
|
-
default:
|
|
87029
|
-
return unreachable2(state);
|
|
87030
|
-
}
|
|
87031
|
-
};
|
|
87016
|
+
command = (id) => this.#entries.get(id)?.commandId;
|
|
87032
87017
|
cancellation = (id) => {
|
|
87033
87018
|
const state = this.#entries.get(id);
|
|
87034
|
-
|
|
87035
|
-
case "cancelling":
|
|
87036
|
-
case "cancelled-before-start":
|
|
87037
|
-
return state.completion;
|
|
87038
|
-
case "running":
|
|
87039
|
-
case void 0:
|
|
87040
|
-
return void 0;
|
|
87041
|
-
default:
|
|
87042
|
-
return unreachable2(state);
|
|
87043
|
-
}
|
|
87019
|
+
return state?.kind === "cancelling" ? state.completion : void 0;
|
|
87044
87020
|
};
|
|
87045
87021
|
isBusy = (id) => this.#entries.has(id);
|
|
87046
87022
|
begin = (id, commandId) => {
|
|
87047
|
-
|
|
87048
|
-
|
|
87049
|
-
case "running":
|
|
87050
|
-
case "cancelling":
|
|
87051
|
-
throw new AcpExecutionError(
|
|
87052
|
-
"Another prompt is already running in this conversation",
|
|
87053
|
-
{},
|
|
87054
|
-
"session_busy"
|
|
87055
|
-
);
|
|
87056
|
-
case "cancelled-before-start":
|
|
87057
|
-
case void 0:
|
|
87058
|
-
break;
|
|
87059
|
-
default:
|
|
87060
|
-
unreachable2(state);
|
|
87023
|
+
if (this.#entries.has(id)) {
|
|
87024
|
+
throw new AcpExecutionError("Another prompt is already running in this conversation", {}, "session_busy");
|
|
87061
87025
|
}
|
|
87062
|
-
this.#entries.set(
|
|
87063
|
-
id,
|
|
87064
|
-
state?.kind === "cancelled-before-start" ? { kind: "cancelling", commandId, completion: state.completion } : { kind: "running", commandId }
|
|
87065
|
-
);
|
|
87026
|
+
this.#entries.set(id, { kind: "running", commandId });
|
|
87066
87027
|
};
|
|
87067
|
-
cancel = (id, stop) => {
|
|
87028
|
+
cancel = (id, commandId, stop) => {
|
|
87068
87029
|
const state = this.#entries.get(id);
|
|
87069
|
-
|
|
87070
|
-
|
|
87071
|
-
|
|
87072
|
-
|
|
87073
|
-
|
|
87074
|
-
case void 0:
|
|
87075
|
-
break;
|
|
87076
|
-
default:
|
|
87077
|
-
return unreachable2(state);
|
|
87030
|
+
if (state?.commandId !== commandId) {
|
|
87031
|
+
return Promise.resolve();
|
|
87032
|
+
}
|
|
87033
|
+
if (state.kind === "cancelling") {
|
|
87034
|
+
return state.completion;
|
|
87078
87035
|
}
|
|
87079
87036
|
const completion = Promise.withResolvers();
|
|
87080
|
-
this.#entries.set(
|
|
87081
|
-
id,
|
|
87082
|
-
state?.kind === "running" ? { kind: "cancelling", commandId: state.commandId, completion: completion.promise } : { kind: "cancelled-before-start", completion: completion.promise }
|
|
87083
|
-
);
|
|
87037
|
+
this.#entries.set(id, { kind: "cancelling", commandId, completion: completion.promise });
|
|
87084
87038
|
void (async () => await stop())().then(completion.resolve, completion.reject);
|
|
87085
87039
|
return completion.promise;
|
|
87086
87040
|
};
|
|
@@ -87547,8 +87501,9 @@ var SessionManager2 = class {
|
|
|
87547
87501
|
return await runtime.renameSession(title2, options2.signal);
|
|
87548
87502
|
})
|
|
87549
87503
|
);
|
|
87550
|
-
|
|
87551
|
-
|
|
87504
|
+
/** Cancels the named command's Agent execution; a command that is not executing has nothing to stop. */
|
|
87505
|
+
cancelPrompt = async (sessionId, commandId, signal = AbortSignal.timeout(3e4)) => this.#operations.run({ signal }, async ({ signal: signal2 }) => {
|
|
87506
|
+
await this.#executions.cancel(sessionId, commandId, async () => {
|
|
87552
87507
|
const runtime = this.#executionProcesses.get(sessionId);
|
|
87553
87508
|
if (runtime !== void 0) {
|
|
87554
87509
|
const outcome = await runtime.cancel(signal2);
|
|
@@ -87559,8 +87514,8 @@ var SessionManager2 = class {
|
|
|
87559
87514
|
await this.#stopSessionProcess(sessionId, runtime);
|
|
87560
87515
|
break;
|
|
87561
87516
|
default: {
|
|
87562
|
-
const
|
|
87563
|
-
throw new AcpExecutionError("Unexpected cancellation outcome", { cause:
|
|
87517
|
+
const unreachable2 = outcome;
|
|
87518
|
+
throw new AcpExecutionError("Unexpected cancellation outcome", { cause: unreachable2 });
|
|
87564
87519
|
}
|
|
87565
87520
|
}
|
|
87566
87521
|
}
|
|
@@ -87613,30 +87568,31 @@ var SessionManager2 = class {
|
|
|
87613
87568
|
throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
|
|
87614
87569
|
}
|
|
87615
87570
|
this.#executions.begin(options2.sessionId, options2.commandId);
|
|
87571
|
+
const cancelled = () => options2.cancellationRequested?.() === true || this.#executions.cancellation(options2.sessionId) !== void 0;
|
|
87616
87572
|
try {
|
|
87617
87573
|
this.#onSessionStatusChanged({
|
|
87618
87574
|
kind: "session.status.changed",
|
|
87619
87575
|
sessionId: options2.sessionId,
|
|
87620
87576
|
status: { commandId: options2.commandId, kind: "working" }
|
|
87621
87577
|
});
|
|
87622
|
-
if (
|
|
87578
|
+
if (cancelled()) {
|
|
87623
87579
|
return { stopReason: "cancelled" };
|
|
87624
87580
|
}
|
|
87625
87581
|
const runtime = await this.ensureSession(options2);
|
|
87626
87582
|
if (this.#nativeOperations.has(nativeOperationKey(options2.agent.id, runtime.nativeSessionId()))) {
|
|
87627
87583
|
throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
|
|
87628
87584
|
}
|
|
87629
|
-
if (
|
|
87585
|
+
if (cancelled()) {
|
|
87630
87586
|
return { stopReason: "cancelled" };
|
|
87631
87587
|
}
|
|
87632
87588
|
try {
|
|
87633
87589
|
const result = await runtime.prompt({
|
|
87634
87590
|
...options2,
|
|
87635
|
-
cancellationRequested:
|
|
87591
|
+
cancellationRequested: cancelled
|
|
87636
87592
|
});
|
|
87637
|
-
return
|
|
87593
|
+
return cancelled() ? { stopReason: "cancelled" } : result;
|
|
87638
87594
|
} catch (error62) {
|
|
87639
|
-
if (
|
|
87595
|
+
if (cancelled()) {
|
|
87640
87596
|
await this.#executions.cancellation(options2.sessionId);
|
|
87641
87597
|
return { stopReason: "cancelled" };
|
|
87642
87598
|
}
|
|
@@ -87651,7 +87607,7 @@ var SessionManager2 = class {
|
|
|
87651
87607
|
async () => await failedRuntime.close()
|
|
87652
87608
|
);
|
|
87653
87609
|
}
|
|
87654
|
-
if (
|
|
87610
|
+
if (cancelled()) {
|
|
87655
87611
|
return { stopReason: "cancelled" };
|
|
87656
87612
|
}
|
|
87657
87613
|
if (error62 instanceof AcpExecutionError) {
|
|
@@ -88567,8 +88523,8 @@ function executionStarted(state) {
|
|
|
88567
88523
|
case "settled-after-start":
|
|
88568
88524
|
return true;
|
|
88569
88525
|
default: {
|
|
88570
|
-
const
|
|
88571
|
-
throw new Error("Unexpected execution state", { cause:
|
|
88526
|
+
const unreachable2 = state;
|
|
88527
|
+
throw new Error("Unexpected execution state", { cause: unreachable2 });
|
|
88572
88528
|
}
|
|
88573
88529
|
}
|
|
88574
88530
|
}
|
|
@@ -88581,8 +88537,8 @@ function executionOutcome(state) {
|
|
|
88581
88537
|
case "settled-after-start":
|
|
88582
88538
|
return state.outcome;
|
|
88583
88539
|
default: {
|
|
88584
|
-
const
|
|
88585
|
-
throw new Error("Unexpected execution state", { cause:
|
|
88540
|
+
const unreachable2 = state;
|
|
88541
|
+
throw new Error("Unexpected execution state", { cause: unreachable2 });
|
|
88586
88542
|
}
|
|
88587
88543
|
}
|
|
88588
88544
|
}
|
|
@@ -88856,8 +88812,8 @@ var ExecutionReceipts = class {
|
|
|
88856
88812
|
case "settled-after-start":
|
|
88857
88813
|
throw new Error("The runtime execution transition is invalid");
|
|
88858
88814
|
default: {
|
|
88859
|
-
const
|
|
88860
|
-
throw new Error("Unexpected execution state", { cause:
|
|
88815
|
+
const unreachable2 = state;
|
|
88816
|
+
throw new Error("Unexpected execution state", { cause: unreachable2 });
|
|
88861
88817
|
}
|
|
88862
88818
|
}
|
|
88863
88819
|
};
|
|
@@ -88994,8 +88950,8 @@ var ActiveRuntimeTurn = class {
|
|
|
88994
88950
|
finish = () => {
|
|
88995
88951
|
this.#finished.resolve();
|
|
88996
88952
|
};
|
|
88997
|
-
activate = () => {
|
|
88998
|
-
this.#dispatch = { kind: "running" };
|
|
88953
|
+
activate = (execution) => {
|
|
88954
|
+
this.#dispatch = { kind: "running", execution };
|
|
88999
88955
|
return { epoch: this.#epoch, sequence: 0 };
|
|
89000
88956
|
};
|
|
89001
88957
|
promoteQueuedPrompt = (command) => {
|
|
@@ -89061,14 +89017,14 @@ var ActiveRuntimeTurn = class {
|
|
|
89061
89017
|
matchesInteraction = (interactionId, sessionId) => this.command.sessionId === sessionId && this.#interaction?.interactionId === interactionId;
|
|
89062
89018
|
requestCancellation = () => {
|
|
89063
89019
|
if (this.#cancellationRequested) {
|
|
89064
|
-
return "already-requested";
|
|
89020
|
+
return { kind: "already-requested" };
|
|
89065
89021
|
}
|
|
89066
89022
|
this.#cancellationRequested = true;
|
|
89067
89023
|
if (this.#dispatch.kind !== "running") {
|
|
89068
89024
|
this.#controller.abort(new Error("The queued Agent turn was cancelled"));
|
|
89069
|
-
return "pending";
|
|
89025
|
+
return { kind: "pending" };
|
|
89070
89026
|
}
|
|
89071
|
-
return "running";
|
|
89027
|
+
return { kind: "running", execution: this.#dispatch.execution };
|
|
89072
89028
|
};
|
|
89073
89029
|
cancellationRequested = () => this.#cancellationRequested;
|
|
89074
89030
|
get signal() {
|
|
@@ -91357,11 +91313,11 @@ var sessionCancelCommand = {
|
|
|
91357
91313
|
});
|
|
91358
91314
|
return;
|
|
91359
91315
|
}
|
|
91360
|
-
const
|
|
91361
|
-
if (
|
|
91316
|
+
const cancellation = turn.requestCancellation();
|
|
91317
|
+
if (cancellation.kind !== "running") {
|
|
91362
91318
|
return;
|
|
91363
91319
|
}
|
|
91364
|
-
void sessions.cancelPrompt(message.sessionId, signal).catch((error62) => {
|
|
91320
|
+
void sessions.cancelPrompt(message.sessionId, cancellation.execution, signal).catch((error62) => {
|
|
91365
91321
|
console.error("Mobius daemon could not cancel the agent turn", error62);
|
|
91366
91322
|
});
|
|
91367
91323
|
}
|
|
@@ -91868,7 +91824,9 @@ async function executePrompt({
|
|
|
91868
91824
|
);
|
|
91869
91825
|
}
|
|
91870
91826
|
}
|
|
91871
|
-
const stream = activateAttempt(
|
|
91827
|
+
const stream = activateAttempt(
|
|
91828
|
+
availability.disposition === SessionPromptDisposition.Steer ? command.targetCommandId : command.commandId
|
|
91829
|
+
);
|
|
91872
91830
|
const lifecycle = eventProjection.started(
|
|
91873
91831
|
command.sessionId,
|
|
91874
91832
|
command.commandId,
|
|
@@ -91905,6 +91863,7 @@ async function executePrompt({
|
|
|
91905
91863
|
} else {
|
|
91906
91864
|
const result = await sessions.runPrompt({
|
|
91907
91865
|
adapter,
|
|
91866
|
+
cancellationRequested,
|
|
91908
91867
|
...externalizeSessionUpdate === void 0 ? {} : { externalizeSessionUpdate },
|
|
91909
91868
|
additionalDirectories: resolved.additionalDirectories,
|
|
91910
91869
|
agent: executionAgent,
|
|
@@ -93636,4 +93595,4 @@ export {
|
|
|
93636
93595
|
* MIT Licensed
|
|
93637
93596
|
*)
|
|
93638
93597
|
*/
|
|
93639
|
-
//# sourceMappingURL=chunk-
|
|
93598
|
+
//# sourceMappingURL=chunk-4INIQJPN.js.map
|