@moxt-ai/mobius 0.0.394 → 0.0.399
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-CHYQFODX.js → chunk-3GLSEDI2.js} +186 -148
- package/dist/{chunk-CHYQFODX.js.map → chunk-3GLSEDI2.js.map} +3 -3
- package/dist/{chunk-X4NQKPXV.js → chunk-L3C522E4.js} +2 -2
- package/dist/{chunk-X4NQKPXV.js.map → chunk-L3C522E4.js.map} +1 -1
- package/dist/{cli-BYEX4UJU.js → cli-LC6I6RAE.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/engine/session/live/agent-session.d.ts.map +1 -1
- package/dist/engine/session/live/agent-session.js +1 -6
- package/dist/engine/session/live/agent-session.js.map +1 -1
- package/dist/engine/session/live/session-configurations.d.ts +9 -0
- package/dist/engine/session/live/session-configurations.d.ts.map +1 -1
- package/dist/engine/session/live/session-configurations.js +32 -25
- package/dist/engine/session/live/session-configurations.js.map +1 -1
- package/dist/engine/session/manager/session-manager.d.ts.map +1 -1
- package/dist/engine/session/manager/session-manager.js +13 -31
- package/dist/engine/session/manager/session-manager.js.map +1 -1
- package/dist/engine/session/prompt/apply-session-configuration.d.ts.map +1 -1
- package/dist/engine/session/prompt/apply-session-configuration.js +2 -18
- package/dist/engine/session/prompt/apply-session-configuration.js.map +1 -1
- package/dist/engine/session/prompt/prompt-lifecycle.d.ts +6 -2
- package/dist/engine/session/prompt/prompt-lifecycle.d.ts.map +1 -1
- package/dist/engine/session/prompt/prompt-lifecycle.js +6 -3
- package/dist/engine/session/prompt/prompt-lifecycle.js.map +1 -1
- package/dist/engine/session/settings/configuration-dependencies.d.ts +12 -0
- package/dist/engine/session/settings/configuration-dependencies.d.ts.map +1 -0
- package/dist/engine/session/settings/configuration-dependencies.js +24 -0
- package/dist/engine/session/settings/configuration-dependencies.js.map +1 -0
- package/dist/engine/session/settings/discover-agent-settings.d.ts.map +1 -1
- package/dist/engine/session/settings/discover-agent-settings.js +2 -1
- package/dist/engine/session/settings/discover-agent-settings.js.map +1 -1
- package/dist/engine/session/turn/execution-receipts.d.ts.map +1 -1
- package/dist/engine/session/turn/execution-receipts.js +129 -85
- package/dist/engine/session/turn/execution-receipts.js.map +1 -1
- package/dist/engine.js +2 -2
- package/package.json +2 -2
- /package/dist/{cli-BYEX4UJU.js.map → cli-LC6I6RAE.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-L3C522E4.js";
|
|
7
7
|
|
|
8
8
|
// src/engine/runtime/relay/runtime-revocation.ts
|
|
9
9
|
var runtimeRevocationCloseCode = 1008;
|
|
@@ -85920,6 +85920,26 @@ var SessionInteractions = class {
|
|
|
85920
85920
|
};
|
|
85921
85921
|
};
|
|
85922
85922
|
|
|
85923
|
+
// src/engine/session/settings/configuration-dependencies.ts
|
|
85924
|
+
function isModelOption(option) {
|
|
85925
|
+
return option.id === "model" || option.category === "model";
|
|
85926
|
+
}
|
|
85927
|
+
function dependencyRank(configId, options) {
|
|
85928
|
+
const category = options.find((option) => option.id === configId)?.category ?? "";
|
|
85929
|
+
if (isModelOption({ category, id: configId })) {
|
|
85930
|
+
return 0;
|
|
85931
|
+
}
|
|
85932
|
+
if (configId === "reasoning_effort" || category === "thought_level") {
|
|
85933
|
+
return 1;
|
|
85934
|
+
}
|
|
85935
|
+
return category === "model_config" ? 2 : 3;
|
|
85936
|
+
}
|
|
85937
|
+
function inDependencyOrder(selections, options) {
|
|
85938
|
+
return selections.toSorted(
|
|
85939
|
+
(left, right) => dependencyRank(left.configId, options) - dependencyRank(right.configId, options) || left.configId.localeCompare(right.configId)
|
|
85940
|
+
);
|
|
85941
|
+
}
|
|
85942
|
+
|
|
85923
85943
|
// src/engine/session/live/session-configurations.ts
|
|
85924
85944
|
var storedSessionConfigurationSchema = external_exports.discriminatedUnion("type", [
|
|
85925
85945
|
external_exports.object({ booleanValue: external_exports.boolean(), configId: external_exports.string().max(128), type: external_exports.literal("boolean") }),
|
|
@@ -85929,43 +85949,43 @@ var decodeStoredSessionConfigurations = (value) => external_exports.array(extern
|
|
|
85929
85949
|
const decoded = storedSessionConfigurationSchema.safeParse(configuration);
|
|
85930
85950
|
return decoded.success ? [decoded.data] : [];
|
|
85931
85951
|
});
|
|
85952
|
+
var storedSessionConfiguration = (option) => option.type === "boolean" ? { booleanValue: option.booleanValue, configId: option.id, type: "boolean" } : { configId: option.id, type: "select", value: option.currentValue };
|
|
85953
|
+
async function replaySessionConfigurations(selections, options, apply, signal) {
|
|
85954
|
+
for (const selection of inDependencyOrder(selections, options())) {
|
|
85955
|
+
const current = options().find((option) => option.id === selection.configId && option.type === selection.type);
|
|
85956
|
+
if (current === void 0) {
|
|
85957
|
+
continue;
|
|
85958
|
+
}
|
|
85959
|
+
if (selection.type === "boolean") {
|
|
85960
|
+
if (current.booleanValue !== selection.booleanValue) {
|
|
85961
|
+
await apply(selection, signal);
|
|
85962
|
+
}
|
|
85963
|
+
continue;
|
|
85964
|
+
}
|
|
85965
|
+
if (current.currentValue !== selection.value && current.values.some((value) => value.value === selection.value)) {
|
|
85966
|
+
await apply(selection, signal);
|
|
85967
|
+
}
|
|
85968
|
+
}
|
|
85969
|
+
}
|
|
85932
85970
|
var SessionConfigurations = class {
|
|
85933
85971
|
#selected = [];
|
|
85934
85972
|
stored = () => this.#selected;
|
|
85973
|
+
/** Follows the Agent's own changes, such as leaving Plan mode, to the settings a user chose. */
|
|
85935
85974
|
capture = (options) => {
|
|
85936
85975
|
this.#selected = this.#selected.map((selection) => {
|
|
85937
85976
|
const current = options.find(
|
|
85938
85977
|
(option) => option.id === selection.configId && option.type === selection.type
|
|
85939
85978
|
);
|
|
85940
|
-
|
|
85941
|
-
return selection;
|
|
85942
|
-
}
|
|
85943
|
-
return current.type === "boolean" ? { booleanValue: current.booleanValue, configId: current.id, type: "boolean" } : { configId: current.id, type: "select", value: current.currentValue };
|
|
85979
|
+
return current === void 0 ? selection : storedSessionConfiguration(current);
|
|
85944
85980
|
});
|
|
85945
85981
|
};
|
|
85946
85982
|
select = (option) => {
|
|
85947
|
-
const selected = option
|
|
85983
|
+
const selected = storedSessionConfiguration(option);
|
|
85948
85984
|
this.#selected = [...this.#selected.filter((selection) => selection.configId !== selected.configId), selected];
|
|
85949
85985
|
};
|
|
85950
85986
|
restore = async (stored, options, apply, signal) => {
|
|
85951
85987
|
this.#selected = stored;
|
|
85952
|
-
|
|
85953
|
-
const current = options().find(
|
|
85954
|
-
(option) => option.id === selection.configId && option.type === selection.type
|
|
85955
|
-
);
|
|
85956
|
-
if (current === void 0) {
|
|
85957
|
-
continue;
|
|
85958
|
-
}
|
|
85959
|
-
if (selection.type === "boolean") {
|
|
85960
|
-
if (current.booleanValue !== selection.booleanValue) {
|
|
85961
|
-
await apply(selection, signal);
|
|
85962
|
-
}
|
|
85963
|
-
continue;
|
|
85964
|
-
}
|
|
85965
|
-
if (current.currentValue !== selection.value && current.values.some((value) => value.value === selection.value)) {
|
|
85966
|
-
await apply(selection, signal);
|
|
85967
|
-
}
|
|
85968
|
-
}
|
|
85988
|
+
await replaySessionConfigurations(stored, options, apply, signal);
|
|
85969
85989
|
};
|
|
85970
85990
|
};
|
|
85971
85991
|
|
|
@@ -86475,11 +86495,8 @@ var AgentSession = class _AgentSession {
|
|
|
86475
86495
|
}
|
|
86476
86496
|
};
|
|
86477
86497
|
restoreStoredConfigurations = async (session, signal, intent = "restore") => {
|
|
86478
|
-
const configurations = intent === "fork" ? session.configurations.toSorted(
|
|
86479
|
-
(left, right) => Number(right.configId === "model") - Number(left.configId === "model")
|
|
86480
|
-
) : session.configurations;
|
|
86481
86498
|
await this.#sessionConfigurations.restore(
|
|
86482
|
-
configurations,
|
|
86499
|
+
session.configurations,
|
|
86483
86500
|
() => this.#configOptions,
|
|
86484
86501
|
this.#applyConfiguration,
|
|
86485
86502
|
signal
|
|
@@ -87372,35 +87389,21 @@ var SessionManager2 = class {
|
|
|
87372
87389
|
)
|
|
87373
87390
|
);
|
|
87374
87391
|
try {
|
|
87375
|
-
|
|
87376
|
-
|
|
87377
|
-
|
|
87378
|
-
|
|
87379
|
-
}
|
|
87380
|
-
if (desired.type === "boolean") {
|
|
87381
|
-
if (current.booleanValue !== desired.booleanValue) {
|
|
87382
|
-
await runtime.applyConfiguration({
|
|
87383
|
-
...options,
|
|
87384
|
-
booleanValue: desired.booleanValue,
|
|
87385
|
-
configId: desired.id,
|
|
87386
|
-
requestId: `execution-prepare-${desired.id}`,
|
|
87387
|
-
value: "",
|
|
87388
|
-
valueType: "boolean"
|
|
87389
|
-
});
|
|
87390
|
-
}
|
|
87391
|
-
continue;
|
|
87392
|
-
}
|
|
87393
|
-
if (current.currentValue !== desired.currentValue && current.values.some((value) => value.value === desired.currentValue)) {
|
|
87392
|
+
await replaySessionConfigurations(
|
|
87393
|
+
desiredConfigOptions.map(storedSessionConfiguration),
|
|
87394
|
+
() => runtime.prepared().configOptions,
|
|
87395
|
+
async (desired) => {
|
|
87394
87396
|
await runtime.applyConfiguration({
|
|
87395
87397
|
...options,
|
|
87396
|
-
booleanValue:
|
|
87397
|
-
configId: desired.
|
|
87398
|
-
requestId: `execution-prepare-${desired.
|
|
87399
|
-
value: desired.
|
|
87400
|
-
valueType:
|
|
87398
|
+
booleanValue: desired.type === "boolean" && desired.booleanValue,
|
|
87399
|
+
configId: desired.configId,
|
|
87400
|
+
requestId: `execution-prepare-${desired.configId}`,
|
|
87401
|
+
value: desired.type === "select" ? desired.value : "",
|
|
87402
|
+
valueType: desired.type
|
|
87401
87403
|
});
|
|
87402
|
-
}
|
|
87403
|
-
|
|
87404
|
+
},
|
|
87405
|
+
options.signal
|
|
87406
|
+
);
|
|
87404
87407
|
} catch (error62) {
|
|
87405
87408
|
await this.#retireSessionProcess(options.sessionId, runtime, async () => await runtime.close());
|
|
87406
87409
|
throw error62;
|
|
@@ -87534,9 +87537,7 @@ var SessionManager2 = class {
|
|
|
87534
87537
|
const prepared = runtime.prepared();
|
|
87535
87538
|
const discoveredModelEffort = runtime.agentSettingsModelEffort();
|
|
87536
87539
|
const model = options2.model;
|
|
87537
|
-
const modelOption2 = prepared.configOptions.find(
|
|
87538
|
-
(option) => option.id === "model" || option.category === "model"
|
|
87539
|
-
);
|
|
87540
|
+
const modelOption2 = prepared.configOptions.find(isModelOption);
|
|
87540
87541
|
const modelIsFixed = modelOption2?.type === "select" && modelOption2.values.length < 2 && modelOption2.currentValue === model;
|
|
87541
87542
|
const configOptions = model === void 0 || modelIsFixed ? prepared.configOptions : (await runtime.applyConfiguration({
|
|
87542
87543
|
...options2,
|
|
@@ -88614,10 +88615,13 @@ var PromptLifecycle = class {
|
|
|
88614
88615
|
);
|
|
88615
88616
|
}
|
|
88616
88617
|
};
|
|
88617
|
-
/**
|
|
88618
|
+
/**
|
|
88619
|
+
* Settles a failed command; whether it failed before or after starting is its receipt's fact. The unsettled
|
|
88620
|
+
* receipt, not the queue registration, admits the failure: a turn that ended without recording its terminal
|
|
88621
|
+
* event has already left the queue, and its abandonment must still settle it.
|
|
88622
|
+
*/
|
|
88618
88623
|
failed = async (sessionId, commandId, attemptId, code, message) => {
|
|
88619
|
-
|
|
88620
|
-
if (request?.sessionId !== sessionId || this.#executions.isTerminalExecution(commandId, sessionId)) {
|
|
88624
|
+
if (this.#executions.findUnsettledAttemptId(commandId, sessionId) === null) {
|
|
88621
88625
|
return;
|
|
88622
88626
|
}
|
|
88623
88627
|
const recorded = await this.#recordLifecycle(sessionId, {
|
|
@@ -88684,6 +88688,13 @@ function cancelledBeforeStart(state) {
|
|
|
88684
88688
|
const outcome = decodeKnownSessionEventPayload(JSON.parse(state.outcome));
|
|
88685
88689
|
return outcome?.type === "lifecycle-metadata" && outcome.payload.kind === "prompt.completed" && promptCompletion(outcome.payload).kind === "cancelled";
|
|
88686
88690
|
}
|
|
88691
|
+
function restartedBeforeStart(state) {
|
|
88692
|
+
if (state.kind !== "settled-before-start") {
|
|
88693
|
+
return false;
|
|
88694
|
+
}
|
|
88695
|
+
const outcome = decodeKnownSessionEventPayload(JSON.parse(state.outcome));
|
|
88696
|
+
return outcome?.type === "lifecycle-metadata" && outcome.payload.kind === "prompt.failed-before-start" && outcome.payload.code === "runtime_restarted";
|
|
88697
|
+
}
|
|
88687
88698
|
function executionOutcome(state) {
|
|
88688
88699
|
switch (state.kind) {
|
|
88689
88700
|
case "pending":
|
|
@@ -88701,6 +88712,31 @@ function executionOutcome(state) {
|
|
|
88701
88712
|
function settledExecution(state, outcome) {
|
|
88702
88713
|
return { kind: executionStarted(state) ? "settled-after-start" : "settled-before-start", outcome };
|
|
88703
88714
|
}
|
|
88715
|
+
function commandStanding({ receipt, identity: identity2, cancellation }, sessionId) {
|
|
88716
|
+
if (receipt !== void 0) {
|
|
88717
|
+
if (receipt.sessionId !== sessionId) {
|
|
88718
|
+
return { kind: "foreign" };
|
|
88719
|
+
}
|
|
88720
|
+
if (!executionStarted(receipt.state) && !cancelledBeforeStart(receipt.state) && cancellation?.sessionId === sessionId) {
|
|
88721
|
+
return { kind: "cancelled", receipt };
|
|
88722
|
+
}
|
|
88723
|
+
return restartedBeforeStart(receipt.state) ? { kind: "retryable", receipt } : { kind: "retained", receipt };
|
|
88724
|
+
}
|
|
88725
|
+
if (identity2 !== void 0) {
|
|
88726
|
+
return identity2.sessionId === sessionId ? { kind: "expired", commandHash: identity2.commandHash } : { kind: "foreign" };
|
|
88727
|
+
}
|
|
88728
|
+
if (cancellation !== void 0) {
|
|
88729
|
+
return cancellation.sessionId === sessionId ? { kind: "cancelled", receipt: void 0 } : { kind: "foreign" };
|
|
88730
|
+
}
|
|
88731
|
+
return { kind: "unseen" };
|
|
88732
|
+
}
|
|
88733
|
+
var cancelledBeforeStartOutcome = (commandId) => ({
|
|
88734
|
+
type: "lifecycle-metadata",
|
|
88735
|
+
payload: { kind: "prompt.completed", commandId, stopReason: "cancelled", execution: "not-started" }
|
|
88736
|
+
});
|
|
88737
|
+
var unexpectedStanding = (standing) => {
|
|
88738
|
+
throw new Error("Unexpected command standing", { cause: standing });
|
|
88739
|
+
};
|
|
88704
88740
|
var ExecutionReceipts = class {
|
|
88705
88741
|
#executions = /* @__PURE__ */ new Map();
|
|
88706
88742
|
#recoveredCommands = /* @__PURE__ */ new Set();
|
|
@@ -88727,6 +88763,19 @@ var ExecutionReceipts = class {
|
|
|
88727
88763
|
}
|
|
88728
88764
|
cancellations.retain(retained);
|
|
88729
88765
|
}
|
|
88766
|
+
/** Reads every ledger that can still change the answer and classifies the identifier for the Session. */
|
|
88767
|
+
#standing = (commandId, sessionId) => {
|
|
88768
|
+
const receipt = this.#executions.get(commandId);
|
|
88769
|
+
const final = receipt !== void 0 && (executionStarted(receipt.state) || cancelledBeforeStart(receipt.state));
|
|
88770
|
+
return commandStanding(
|
|
88771
|
+
{
|
|
88772
|
+
receipt,
|
|
88773
|
+
identity: receipt === void 0 ? this.#table.identity(commandId) : void 0,
|
|
88774
|
+
cancellation: final ? void 0 : this.#cancellations.read(commandId)
|
|
88775
|
+
},
|
|
88776
|
+
sessionId
|
|
88777
|
+
);
|
|
88778
|
+
};
|
|
88730
88779
|
#remember = (commandId, receipt, evicted) => {
|
|
88731
88780
|
this.#executions.set(commandId, receipt);
|
|
88732
88781
|
for (const evictedCommandId of evicted) {
|
|
@@ -88776,14 +88825,22 @@ var ExecutionReceipts = class {
|
|
|
88776
88825
|
};
|
|
88777
88826
|
/** The command's delivery as these receipts know it; another Session's command reads as unknown. */
|
|
88778
88827
|
delivery = (commandId, sessionId) => {
|
|
88779
|
-
const
|
|
88780
|
-
|
|
88781
|
-
|
|
88782
|
-
|
|
88783
|
-
|
|
88784
|
-
|
|
88828
|
+
const standing = this.#standing(commandId, sessionId);
|
|
88829
|
+
switch (standing.kind) {
|
|
88830
|
+
case "unseen":
|
|
88831
|
+
case "foreign":
|
|
88832
|
+
return { state: "unknown" };
|
|
88833
|
+
case "expired":
|
|
88834
|
+
return { state: "expired" };
|
|
88835
|
+
case "cancelled":
|
|
88836
|
+
return { state: "completed", stopReason: "cancelled" };
|
|
88837
|
+
case "retryable":
|
|
88838
|
+
case "retained":
|
|
88839
|
+
break;
|
|
88840
|
+
default:
|
|
88841
|
+
return unexpectedStanding(standing);
|
|
88785
88842
|
}
|
|
88786
|
-
if (executionOutcome(receipt.state) === null) {
|
|
88843
|
+
if (executionOutcome(standing.receipt.state) === null) {
|
|
88787
88844
|
return { state: "accepted" };
|
|
88788
88845
|
}
|
|
88789
88846
|
const outcome = this.outcome(commandId);
|
|
@@ -88836,38 +88893,43 @@ var ExecutionReceipts = class {
|
|
|
88836
88893
|
};
|
|
88837
88894
|
/** Started identities remain authoritative after their detailed receipt is evicted. */
|
|
88838
88895
|
hasStarted = (commandId, sessionId) => {
|
|
88839
|
-
const
|
|
88840
|
-
|
|
88896
|
+
const standing = this.#standing(commandId, sessionId);
|
|
88897
|
+
switch (standing.kind) {
|
|
88898
|
+
case "unseen":
|
|
88899
|
+
case "foreign":
|
|
88900
|
+
case "cancelled":
|
|
88901
|
+
case "retryable":
|
|
88902
|
+
return false;
|
|
88903
|
+
case "expired":
|
|
88904
|
+
return true;
|
|
88905
|
+
case "retained":
|
|
88906
|
+
return executionStarted(standing.receipt.state);
|
|
88907
|
+
default:
|
|
88908
|
+
return unexpectedStanding(standing);
|
|
88909
|
+
}
|
|
88841
88910
|
};
|
|
88842
88911
|
/** Reserves an unseen command for cancellation before a delayed prompt can claim its identity. */
|
|
88843
88912
|
recordCancellationBeforeAdmission = (commandId, sessionId) => {
|
|
88844
|
-
const
|
|
88845
|
-
|
|
88846
|
-
|
|
88847
|
-
|
|
88848
|
-
|
|
88849
|
-
|
|
88850
|
-
|
|
88851
|
-
|
|
88852
|
-
|
|
88853
|
-
|
|
88854
|
-
|
|
88855
|
-
|
|
88856
|
-
|
|
88857
|
-
|
|
88858
|
-
|
|
88859
|
-
|
|
88860
|
-
|
|
88861
|
-
|
|
88862
|
-
stopReason: "cancelled",
|
|
88863
|
-
execution: "not-started"
|
|
88864
|
-
}
|
|
88865
|
-
} : void 0;
|
|
88913
|
+
const standing = this.#standing(commandId, sessionId);
|
|
88914
|
+
switch (standing.kind) {
|
|
88915
|
+
case "foreign":
|
|
88916
|
+
return void 0;
|
|
88917
|
+
case "retryable":
|
|
88918
|
+
case "retained":
|
|
88919
|
+
return this.outcome(commandId);
|
|
88920
|
+
case "expired":
|
|
88921
|
+
return {
|
|
88922
|
+
type: "lifecycle-metadata",
|
|
88923
|
+
payload: { kind: "prompt.completed", commandId, stopReason: "cancelled" }
|
|
88924
|
+
};
|
|
88925
|
+
case "cancelled":
|
|
88926
|
+
return cancelledBeforeStartOutcome(commandId);
|
|
88927
|
+
case "unseen":
|
|
88928
|
+
break;
|
|
88929
|
+
default:
|
|
88930
|
+
return unexpectedStanding(standing);
|
|
88866
88931
|
}
|
|
88867
|
-
const outcome =
|
|
88868
|
-
type: "lifecycle-metadata",
|
|
88869
|
-
payload: { kind: "prompt.completed", commandId, stopReason: "cancelled", execution: "not-started" }
|
|
88870
|
-
};
|
|
88932
|
+
const outcome = cancelledBeforeStartOutcome(commandId);
|
|
88871
88933
|
const commandHash = createHash8("sha256").update(
|
|
88872
88934
|
encodeSessionCancelBeforeStartCommand({
|
|
88873
88935
|
commandId,
|
|
@@ -88923,16 +88985,8 @@ var ExecutionReceipts = class {
|
|
|
88923
88985
|
const recovered = [];
|
|
88924
88986
|
for (const [commandId, receipt] of [...this.#executions]) {
|
|
88925
88987
|
const outcome = executionOutcome(receipt.state);
|
|
88926
|
-
const restoreCancellation =
|
|
88927
|
-
const event = restoreCancellation ? {
|
|
88928
|
-
type: "lifecycle-metadata",
|
|
88929
|
-
payload: {
|
|
88930
|
-
kind: "prompt.completed",
|
|
88931
|
-
commandId,
|
|
88932
|
-
stopReason: "cancelled",
|
|
88933
|
-
execution: "not-started"
|
|
88934
|
-
}
|
|
88935
|
-
} : outcome === null ? {
|
|
88988
|
+
const restoreCancellation = this.#standing(commandId, receipt.sessionId).kind === "cancelled";
|
|
88989
|
+
const event = restoreCancellation ? cancelledBeforeStartOutcome(commandId) : outcome === null ? {
|
|
88936
88990
|
type: "lifecycle-metadata",
|
|
88937
88991
|
payload: executionStarted(receipt.state) ? {
|
|
88938
88992
|
kind: "prompt.failed",
|
|
@@ -88963,31 +89017,32 @@ var ExecutionReceipts = class {
|
|
|
88963
89017
|
};
|
|
88964
89018
|
claimExecution = (commandId, sessionId, commandJson) => {
|
|
88965
89019
|
const commandHash = createHash8("sha256").update(commandJson).digest("hex");
|
|
88966
|
-
|
|
88967
|
-
|
|
88968
|
-
|
|
88969
|
-
|
|
88970
|
-
this.#executions.delete(commandId);
|
|
88971
|
-
this.#recoveredCommands.delete(commandId);
|
|
88972
|
-
existing = void 0;
|
|
88973
|
-
}
|
|
88974
|
-
if (existing !== void 0) {
|
|
88975
|
-
if (existing.sessionId !== sessionId || existing.commandHash !== commandHash) {
|
|
89020
|
+
const standing = this.#standing(commandId, sessionId);
|
|
89021
|
+
switch (standing.kind) {
|
|
89022
|
+
case "foreign":
|
|
89023
|
+
case "cancelled":
|
|
88976
89024
|
return { kind: "conflict" };
|
|
88977
|
-
|
|
88978
|
-
|
|
88979
|
-
|
|
88980
|
-
|
|
88981
|
-
|
|
88982
|
-
|
|
88983
|
-
|
|
88984
|
-
|
|
88985
|
-
|
|
88986
|
-
|
|
88987
|
-
|
|
88988
|
-
|
|
88989
|
-
|
|
88990
|
-
|
|
89025
|
+
case "retained":
|
|
89026
|
+
if (standing.receipt.commandHash !== commandHash) {
|
|
89027
|
+
return { kind: "conflict" };
|
|
89028
|
+
}
|
|
89029
|
+
return {
|
|
89030
|
+
attemptId: standing.receipt.attemptId,
|
|
89031
|
+
commandId,
|
|
89032
|
+
kind: "duplicate",
|
|
89033
|
+
outcome: this.#recoveredCommands.has(commandId) ? this.outcome(commandId) : void 0
|
|
89034
|
+
};
|
|
89035
|
+
case "expired":
|
|
89036
|
+
return standing.commandHash === commandHash ? { kind: "expired" } : { kind: "conflict" };
|
|
89037
|
+
case "retryable":
|
|
89038
|
+
this.#table.remove(commandId);
|
|
89039
|
+
this.#executions.delete(commandId);
|
|
89040
|
+
this.#recoveredCommands.delete(commandId);
|
|
89041
|
+
return this.claimExecution(commandId, sessionId, commandJson);
|
|
89042
|
+
case "unseen":
|
|
89043
|
+
break;
|
|
89044
|
+
default:
|
|
89045
|
+
return unexpectedStanding(standing);
|
|
88991
89046
|
}
|
|
88992
89047
|
const attemptId = randomUUID15();
|
|
88993
89048
|
this.#save(commandId, {
|
|
@@ -90771,7 +90826,7 @@ function withoutUnsupportedModels(settings, modelSettingId, unsupportedModelIds2
|
|
|
90771
90826
|
});
|
|
90772
90827
|
}
|
|
90773
90828
|
function modelOption(options) {
|
|
90774
|
-
return options.find(
|
|
90829
|
+
return options.find(isModelOption);
|
|
90775
90830
|
}
|
|
90776
90831
|
function effortOption(options) {
|
|
90777
90832
|
return options.find((option) => option.id === "reasoning_effort" || option.category === "thought_level");
|
|
@@ -91803,19 +91858,6 @@ function sessionConfigurationMatches(option, selection) {
|
|
|
91803
91858
|
validateSessionConfigurationSelection(option, selection);
|
|
91804
91859
|
return option.type === "boolean" ? option.booleanValue === selection.booleanValue : option.currentValue === selection.value;
|
|
91805
91860
|
}
|
|
91806
|
-
function sessionConfigurationPriority(selection, options) {
|
|
91807
|
-
const option = options.find((candidate) => candidate.id === selection.configId);
|
|
91808
|
-
if (selection.configId === "model" || option?.category === "model") {
|
|
91809
|
-
return 0;
|
|
91810
|
-
}
|
|
91811
|
-
if (selection.configId === "reasoning_effort" || option?.category === "thought_level") {
|
|
91812
|
-
return 1;
|
|
91813
|
-
}
|
|
91814
|
-
if (option?.category === "model_config") {
|
|
91815
|
-
return 2;
|
|
91816
|
-
}
|
|
91817
|
-
return 3;
|
|
91818
|
-
}
|
|
91819
91861
|
function assertAppliedSessionConfiguration(options, selections) {
|
|
91820
91862
|
const selectionsById = new Map(selections.map((selection) => [selection.configId, selection]));
|
|
91821
91863
|
for (const option of options) {
|
|
@@ -91906,11 +91948,7 @@ async function applySessionConfigurationSelection(sessions, options, selection,
|
|
|
91906
91948
|
}
|
|
91907
91949
|
async function applyCompleteSessionConfiguration(sessions, initialOptions, selections, agent, adapter, cwd, additionalDirectories, commandId, sessionId, signal) {
|
|
91908
91950
|
let options = initialOptions;
|
|
91909
|
-
const
|
|
91910
|
-
const priority = sessionConfigurationPriority(left, initialOptions) - sessionConfigurationPriority(right, initialOptions);
|
|
91911
|
-
return priority === 0 ? left.configId.localeCompare(right.configId) : priority;
|
|
91912
|
-
});
|
|
91913
|
-
for (const selection of orderedSelections) {
|
|
91951
|
+
for (const selection of inDependencyOrder(selections, initialOptions)) {
|
|
91914
91952
|
options = await applySessionConfigurationSelection(
|
|
91915
91953
|
sessions,
|
|
91916
91954
|
options,
|
|
@@ -93839,4 +93877,4 @@ export {
|
|
|
93839
93877
|
* MIT Licensed
|
|
93840
93878
|
*)
|
|
93841
93879
|
*/
|
|
93842
|
-
//# sourceMappingURL=chunk-
|
|
93880
|
+
//# sourceMappingURL=chunk-3GLSEDI2.js.map
|