@moxt-ai/mobius 0.0.389 → 0.0.390
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-Z6ERJZ2H.js → chunk-KWRP3J26.js} +2 -2
- package/dist/{chunk-Z6ERJZ2H.js.map → chunk-KWRP3J26.js.map} +1 -1
- package/dist/{chunk-77O2RBRQ.js → chunk-ZW763PCS.js} +63 -39
- package/dist/{chunk-77O2RBRQ.js.map → chunk-ZW763PCS.js.map} +4 -4
- package/dist/{cli-I4NLPVNV.js → cli-K2JBHPL5.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/engine/runtime/command/registry/session.d.ts.map +1 -1
- package/dist/engine/runtime/command/registry/session.js +1 -2
- package/dist/engine/runtime/command/registry/session.js.map +1 -1
- package/dist/engine/session/api/session-api.d.ts +6 -3
- package/dist/engine/session/api/session-api.d.ts.map +1 -1
- package/dist/engine/session/api/session-api.js.map +1 -1
- package/dist/engine/session/live/agent-session.d.ts +3 -1
- package/dist/engine/session/live/agent-session.d.ts.map +1 -1
- package/dist/engine/session/live/agent-session.js +22 -17
- package/dist/engine/session/live/agent-session.js.map +1 -1
- package/dist/engine/session/live/configuration-revision.d.ts +11 -0
- package/dist/engine/session/live/configuration-revision.d.ts.map +1 -0
- package/dist/engine/session/live/configuration-revision.js +24 -0
- package/dist/engine/session/live/configuration-revision.js.map +1 -0
- package/dist/engine/session/manager/session-manager.d.ts +4 -1
- package/dist/engine/session/manager/session-manager.d.ts.map +1 -1
- package/dist/engine/session/manager/session-manager.js +11 -6
- 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 +1 -2
- package/dist/engine/session/prompt/apply-session-configuration.js.map +1 -1
- package/dist/engine.js +2 -2
- package/package.json +1 -1
- /package/dist/{cli-I4NLPVNV.js.map → cli-K2JBHPL5.js.map} +0 -0
|
@@ -80,7 +80,7 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
80
80
|
// package.json
|
|
81
81
|
var package_default = {
|
|
82
82
|
name: "@moxt-ai/mobius",
|
|
83
|
-
version: "0.0.
|
|
83
|
+
version: "0.0.390",
|
|
84
84
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
85
85
|
type: "module",
|
|
86
86
|
bin: {
|
|
@@ -171,4 +171,4 @@ export {
|
|
|
171
171
|
__callDispose,
|
|
172
172
|
package_default
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
174
|
+
//# sourceMappingURL=chunk-KWRP3J26.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../package.json"],
|
|
4
|
-
"sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.
|
|
4
|
+
"sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.390\",\n \"description\": \"Mobius CLI for pairing and running local AI agent services.\",\n \"type\": \"module\",\n \"bin\": {\n \"mobius\": \"dist/cli.js\"\n },\n \"exports\": {\n \"./engine\": {\n \"mobius-source\": \"./src/exports/engine.ts\",\n \"types\": \"./dist/exports/engine.d.ts\",\n \"default\": \"./dist/engine.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.txt\"\n ],\n \"engines\": {\n \"node\": \">=22.19.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"exports\": {\n \"./engine\": {\n \"types\": \"./dist/exports/engine.d.ts\",\n \"import\": \"./dist/engine.js\",\n \"default\": \"./dist/engine.js\"\n }\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/moxt-ai/mobius.git\",\n \"directory\": \"packages/cli\"\n },\n \"scripts\": {\n \"prebuild\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"build\": \"node scripts/build.ts && tsc --project tsconfig.build.json\",\n \"dev\": \"node --watch src/cli/entrypoint.ts\",\n \"pretypecheck\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"prepack\": \"pnpm build\",\n \"start\": \"node dist/cli.js\",\n \"typecheck\": \"tsc --project tsconfig.json && tsc --project tests/tsconfig.json\",\n \"pretest:controlled\": \"pnpm build\",\n \"test:controlled\": \"vitest run tests/sessions tests/runtime\",\n \"pretest:manual\": \"pnpm pretest:controlled\",\n \"test:manual\": \"vitest run tests/manual\",\n \"pretest:agents\": \"pnpm build\",\n \"test:agents\": \"vitest run tests/agents --maxWorkers=2\",\n \"pretest:pressure\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"test:pressure\": \"node tests/pressure/concurrent-sessions.mjs\"\n },\n \"dependencies\": {\n \"@agentclientprotocol/sdk\": \"^1.4.0\",\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.257\",\n \"commander\": \"15.0.0\",\n \"semver\": \"^7.8.5\",\n \"undici\": \"8.12.2\",\n \"zod\": \"^4.6.7\"\n },\n \"devDependencies\": {\n \"@anthropic-ai/sdk\": \"0.122.0\",\n \"@moxt-ai/mobius-sdk\": \"workspace:*\",\n \"@moxt-ai/mobius-test\": \"workspace:*\",\n \"@types/node\": \"^24.13.5\",\n \"@types/semver\": \"^7.8.0\",\n \"@types/ws\": \"^8.18.1\",\n \"drizzle-kit\": \"1.0.0-rc.4\",\n \"drizzle-orm\": \"1.0.0-rc.4\",\n \"esbuild\": \"0.28.2\",\n \"valibot\": \"1.5.0\",\n \"ws\": \"^8.21.3\"\n },\n \"keywords\": [],\n \"author\": \"Moxt\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/moxt-ai/mobius/issues\"\n },\n \"homepage\": \"https://github.com/moxt-ai/mobius#readme\"\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACI,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,KAAO;AAAA,IACH,QAAU;AAAA,EACd;AAAA,EACA,SAAW;AAAA,IACP,YAAY;AAAA,MACR,iBAAiB;AAAA,MACjB,OAAS;AAAA,MACT,SAAW;AAAA,IACf;AAAA,EACJ;AAAA,EACA,OAAS;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,SAAW;AAAA,IACP,MAAQ;AAAA,EACZ;AAAA,EACA,eAAiB;AAAA,IACb,QAAU;AAAA,IACV,SAAW;AAAA,MACP,YAAY;AAAA,QACR,OAAS;AAAA,QACT,QAAU;AAAA,QACV,SAAW;AAAA,MACf;AAAA,IACJ;AAAA,EACJ;AAAA,EACA,YAAc;AAAA,IACV,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACjB;AAAA,EACA,SAAW;AAAA,IACP,UAAY;AAAA,IACZ,OAAS;AAAA,IACT,KAAO;AAAA,IACP,cAAgB;AAAA,IAChB,SAAW;AAAA,IACX,OAAS;AAAA,IACT,WAAa;AAAA,IACb,sBAAsB;AAAA,IACtB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,EACrB;AAAA,EACA,cAAgB;AAAA,IACZ,4BAA4B;AAAA,IAC5B,kCAAkC;AAAA,IAClC,WAAa;AAAA,IACb,QAAU;AAAA,IACV,QAAU;AAAA,IACV,KAAO;AAAA,EACX;AAAA,EACA,iBAAmB;AAAA,IACf,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,wBAAwB;AAAA,IACxB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,eAAe;AAAA,IACf,SAAW;AAAA,IACX,SAAW;AAAA,IACX,IAAM;AAAA,EACV;AAAA,EACA,UAAY,CAAC;AAAA,EACb,QAAU;AAAA,EACV,SAAW;AAAA,EACX,MAAQ;AAAA,IACJ,KAAO;AAAA,EACX;AAAA,EACA,UAAY;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__export,
|
|
4
4
|
__using,
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KWRP3J26.js";
|
|
7
7
|
|
|
8
8
|
// src/engine/runtime/relay/runtime-revocation.ts
|
|
9
9
|
var runtimeRevocationCloseCode = 1008;
|
|
@@ -85244,7 +85244,7 @@ var PreparedSession = class {
|
|
|
85244
85244
|
prompted;
|
|
85245
85245
|
restored;
|
|
85246
85246
|
configurationRevision;
|
|
85247
|
-
constructor(agentName, agentVersion, capabilities, commands, configOptions, prompted, restored,
|
|
85247
|
+
constructor(agentName, agentVersion, capabilities, commands, configOptions, prompted, restored, configurationRevision2) {
|
|
85248
85248
|
this.agentName = agentName;
|
|
85249
85249
|
this.agentVersion = agentVersion;
|
|
85250
85250
|
this.capabilities = capabilities;
|
|
@@ -85252,7 +85252,7 @@ var PreparedSession = class {
|
|
|
85252
85252
|
this.configOptions = configOptions;
|
|
85253
85253
|
this.prompted = prompted;
|
|
85254
85254
|
this.restored = restored;
|
|
85255
|
-
this.configurationRevision =
|
|
85255
|
+
this.configurationRevision = configurationRevision2;
|
|
85256
85256
|
}
|
|
85257
85257
|
};
|
|
85258
85258
|
var AgentSettingsSnapshot = class {
|
|
@@ -86026,6 +86026,23 @@ var SqliteSessionStore = class {
|
|
|
86026
86026
|
};
|
|
86027
86027
|
};
|
|
86028
86028
|
|
|
86029
|
+
// src/engine/session/live/configuration-revision.ts
|
|
86030
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
86031
|
+
var configurationRevision = (options) => {
|
|
86032
|
+
const canonical = options.map(
|
|
86033
|
+
(option) => JSON.stringify(
|
|
86034
|
+
option.type === "boolean" ? [option.id, option.type, option.category, option.booleanValue] : [
|
|
86035
|
+
option.id,
|
|
86036
|
+
option.type,
|
|
86037
|
+
option.category,
|
|
86038
|
+
option.currentValue,
|
|
86039
|
+
option.values.map((value) => value.value).toSorted()
|
|
86040
|
+
]
|
|
86041
|
+
)
|
|
86042
|
+
).toSorted();
|
|
86043
|
+
return createHash6("sha256").update(JSON.stringify(canonical)).digest("hex");
|
|
86044
|
+
};
|
|
86045
|
+
|
|
86029
86046
|
// src/engine/session/live/session-restore.ts
|
|
86030
86047
|
function hasMethodNotFoundCode(cause) {
|
|
86031
86048
|
const visited = /* @__PURE__ */ new Set();
|
|
@@ -86229,7 +86246,6 @@ var AgentSession = class _AgentSession {
|
|
|
86229
86246
|
#agentVersion = "";
|
|
86230
86247
|
#capabilities = unsupportedSessionCapabilities();
|
|
86231
86248
|
#commands = [];
|
|
86232
|
-
#configRevision = crypto.randomUUID();
|
|
86233
86249
|
#configurationChanges = new SerialTaskQueue();
|
|
86234
86250
|
#configOptions = [];
|
|
86235
86251
|
#sessionConfigurations = new SessionConfigurations();
|
|
@@ -86438,7 +86454,7 @@ var AgentSession = class _AgentSession {
|
|
|
86438
86454
|
this.#configOptions,
|
|
86439
86455
|
this.#prompted,
|
|
86440
86456
|
this.#restored,
|
|
86441
|
-
this.#
|
|
86457
|
+
configurationRevision(this.#configOptions)
|
|
86442
86458
|
);
|
|
86443
86459
|
ensureHistoryLoaded = async (signal) => {
|
|
86444
86460
|
if (!this.#capabilities.loadSession) {
|
|
@@ -86623,38 +86639,45 @@ var AgentSession = class _AgentSession {
|
|
|
86623
86639
|
this.#mobiusSessionId = sessionId;
|
|
86624
86640
|
};
|
|
86625
86641
|
#applyConfiguration = async (selection, signal) => {
|
|
86626
|
-
const
|
|
86642
|
+
const before = this.#configOptions;
|
|
86627
86643
|
const configured = await this.#writeNativeHistory(
|
|
86628
86644
|
async () => await this.#adapter.configureSession({ ...this.#target(), selection, signal })
|
|
86629
86645
|
);
|
|
86630
|
-
if (this.#
|
|
86646
|
+
if (this.#configOptions === before) {
|
|
86631
86647
|
this.#configOptions = configured;
|
|
86632
|
-
this.#configRevision = crypto.randomUUID();
|
|
86633
86648
|
await this.#publishConfiguration();
|
|
86634
86649
|
}
|
|
86635
86650
|
};
|
|
86636
|
-
// The revision check and Agent mutation share one queue
|
|
86651
|
+
// The revision check and Agent mutation share one queue with the settings the Runtime applies itself.
|
|
86637
86652
|
// A lost response may have committed: reread after a conflict, never replay an edit blindly.
|
|
86638
86653
|
configure = async (options) => this.#configurationChanges.run(async (signal) => {
|
|
86639
|
-
if (options.expectedConfigurationRevision !==
|
|
86654
|
+
if (options.expectedConfigurationRevision !== configurationRevision(this.#configOptions)) {
|
|
86640
86655
|
throw new AcpExecutionError(
|
|
86641
86656
|
"Session settings changed. Review the current settings before applying your selection again.",
|
|
86642
86657
|
{},
|
|
86643
86658
|
"session_configuration_conflict"
|
|
86644
86659
|
);
|
|
86645
86660
|
}
|
|
86661
|
+
return await this.#change(options, signal);
|
|
86662
|
+
}, options.signal);
|
|
86663
|
+
/** Applies a setting the Runtime owns, whatever the configuration's current revision. */
|
|
86664
|
+
applyConfiguration = async (change) => this.#configurationChanges.run(async (signal) => await this.#change(change, signal), change.signal);
|
|
86665
|
+
#change = async (change, signal) => {
|
|
86646
86666
|
await this.#applyConfiguration(
|
|
86647
|
-
|
|
86667
|
+
change.valueType === "boolean" ? { type: "boolean", configId: change.configId, booleanValue: change.booleanValue } : { type: "select", configId: change.configId, value: change.value },
|
|
86648
86668
|
signal
|
|
86649
86669
|
);
|
|
86650
|
-
const applied = this.#configOptions.find((option) => option.id ===
|
|
86670
|
+
const applied = this.#configOptions.find((option) => option.id === change.configId);
|
|
86651
86671
|
if (applied === void 0) {
|
|
86652
86672
|
throw new AcpExecutionError("The requested ACP configuration option is unavailable");
|
|
86653
86673
|
}
|
|
86654
86674
|
this.#sessionConfigurations.select(applied);
|
|
86655
86675
|
this.writeStoredSession((/* @__PURE__ */ new Date()).toISOString());
|
|
86656
|
-
return {
|
|
86657
|
-
|
|
86676
|
+
return {
|
|
86677
|
+
configOptions: this.#configOptions,
|
|
86678
|
+
configurationRevision: configurationRevision(this.#configOptions)
|
|
86679
|
+
};
|
|
86680
|
+
};
|
|
86658
86681
|
#publishConfiguration = async () => {
|
|
86659
86682
|
const event = this.#store.events.append(this.#mobiusSessionId, {
|
|
86660
86683
|
type: "acp",
|
|
@@ -86884,7 +86907,6 @@ var AgentSession = class _AgentSession {
|
|
|
86884
86907
|
this.#configOptions = event.kind === "configuration" ? event.configOptions : this.#configOptions.map(
|
|
86885
86908
|
(option) => option.category === "mode" ? { ...option, currentValue: event.modeId } : option
|
|
86886
86909
|
);
|
|
86887
|
-
this.#configRevision = crypto.randomUUID();
|
|
86888
86910
|
this.#captureSelectedConfigurationValues();
|
|
86889
86911
|
}
|
|
86890
86912
|
if (this.#sessionLoad.kind === "capturing") {
|
|
@@ -86967,7 +86989,6 @@ var AgentSession = class _AgentSession {
|
|
|
86967
86989
|
openSessionWithReplay = async (signal) => (await this.#loadSession(signal)).opened;
|
|
86968
86990
|
setConfigOptions(options) {
|
|
86969
86991
|
this.#configOptions = options;
|
|
86970
|
-
this.#configRevision = crypto.randomUUID();
|
|
86971
86992
|
}
|
|
86972
86993
|
setNativeHistoryOwnership(ownership) {
|
|
86973
86994
|
this.#nativeHistoryOwnership = ownership;
|
|
@@ -86989,7 +87010,7 @@ var AgentSession = class _AgentSession {
|
|
|
86989
87010
|
emitConfigUpdate = async () => {
|
|
86990
87011
|
await this.#getObserver().onConfig({
|
|
86991
87012
|
configOptions: this.#configOptions,
|
|
86992
|
-
configurationRevision: this.#
|
|
87013
|
+
configurationRevision: configurationRevision(this.#configOptions),
|
|
86993
87014
|
kind: SESSION_CONFIG_UPDATED_KIND,
|
|
86994
87015
|
requestId: `agent-update-${crypto.randomUUID()}`,
|
|
86995
87016
|
sessionId: this.#mobiusSessionId
|
|
@@ -87297,11 +87318,10 @@ var SessionManager2 = class {
|
|
|
87297
87318
|
}
|
|
87298
87319
|
if (desired.type === "boolean") {
|
|
87299
87320
|
if (current.booleanValue !== desired.booleanValue) {
|
|
87300
|
-
await runtime.
|
|
87321
|
+
await runtime.applyConfiguration({
|
|
87301
87322
|
...options,
|
|
87302
87323
|
booleanValue: desired.booleanValue,
|
|
87303
87324
|
configId: desired.id,
|
|
87304
|
-
expectedConfigurationRevision: null,
|
|
87305
87325
|
requestId: `execution-prepare-${desired.id}`,
|
|
87306
87326
|
value: "",
|
|
87307
87327
|
valueType: "boolean"
|
|
@@ -87310,11 +87330,10 @@ var SessionManager2 = class {
|
|
|
87310
87330
|
continue;
|
|
87311
87331
|
}
|
|
87312
87332
|
if (current.currentValue !== desired.currentValue && current.values.some((value) => value.value === desired.currentValue)) {
|
|
87313
|
-
await runtime.
|
|
87333
|
+
await runtime.applyConfiguration({
|
|
87314
87334
|
...options,
|
|
87315
87335
|
booleanValue: false,
|
|
87316
87336
|
configId: desired.id,
|
|
87317
|
-
expectedConfigurationRevision: null,
|
|
87318
87337
|
requestId: `execution-prepare-${desired.id}`,
|
|
87319
87338
|
value: desired.currentValue,
|
|
87320
87339
|
valueType: "select"
|
|
@@ -87458,11 +87477,10 @@ var SessionManager2 = class {
|
|
|
87458
87477
|
(option) => option.id === "model" || option.category === "model"
|
|
87459
87478
|
);
|
|
87460
87479
|
const modelIsFixed = modelOption2?.type === "select" && modelOption2.values.length < 2 && modelOption2.currentValue === model;
|
|
87461
|
-
const configOptions = model === void 0 || modelIsFixed ? prepared.configOptions : (await runtime.
|
|
87480
|
+
const configOptions = model === void 0 || modelIsFixed ? prepared.configOptions : (await runtime.applyConfiguration({
|
|
87462
87481
|
...options2,
|
|
87463
87482
|
booleanValue: false,
|
|
87464
87483
|
configId: modelOption2?.id ?? "model",
|
|
87465
|
-
expectedConfigurationRevision: null,
|
|
87466
87484
|
requestId: "agent-settings-model",
|
|
87467
87485
|
sessionId: `agent-settings-${crypto.randomUUID()}`,
|
|
87468
87486
|
value: model,
|
|
@@ -87539,12 +87557,20 @@ var SessionManager2 = class {
|
|
|
87539
87557
|
}
|
|
87540
87558
|
return (await this.#replaceExecutionPreparation(existing, options2)).prepared();
|
|
87541
87559
|
});
|
|
87560
|
+
/** Applies a client's edit only while the Session's configuration still has the revision the client read. */
|
|
87542
87561
|
configureSession = async (options) => this.#operations.run(options, async (options2) => {
|
|
87543
87562
|
return await this.#executionProcesses.use(options2.sessionId, async () => {
|
|
87544
87563
|
const runtime = await this.ensureSession(options2);
|
|
87545
87564
|
return await runtime.configure(options2);
|
|
87546
87565
|
});
|
|
87547
87566
|
});
|
|
87567
|
+
/** Applies a setting the Runtime owns, such as one a prompt or a preparation requested. */
|
|
87568
|
+
applySessionConfiguration = async (change) => this.#operations.run(change, async (change2) => {
|
|
87569
|
+
return await this.#executionProcesses.use(change2.sessionId, async () => {
|
|
87570
|
+
const runtime = await this.ensureSession(change2);
|
|
87571
|
+
return await runtime.applyConfiguration(change2);
|
|
87572
|
+
});
|
|
87573
|
+
});
|
|
87548
87574
|
renameSession = async (options, title2) => await this.#executionProcesses.use(
|
|
87549
87575
|
options.sessionId,
|
|
87550
87576
|
async () => this.#operations.run(options, async (options2) => {
|
|
@@ -88326,7 +88352,7 @@ var NativeSessionService = class {
|
|
|
88326
88352
|
};
|
|
88327
88353
|
|
|
88328
88354
|
// src/engine/session/prompt/prompt-artifacts.ts
|
|
88329
|
-
import { createHash as
|
|
88355
|
+
import { createHash as createHash7 } from "node:crypto";
|
|
88330
88356
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
88331
88357
|
var PromptArtifactError = class extends OperationError {
|
|
88332
88358
|
constructor(code, message, options = {}) {
|
|
@@ -88352,7 +88378,7 @@ async function resolvePromptArtifacts(read, attachments, signal) {
|
|
|
88352
88378
|
signal.throwIfAborted();
|
|
88353
88379
|
const artifact = await read(attachment, signal);
|
|
88354
88380
|
const { bytes } = artifact;
|
|
88355
|
-
if (bytes.byteLength !== attachment.byteLength ||
|
|
88381
|
+
if (bytes.byteLength !== attachment.byteLength || createHash7("sha256").update(bytes).digest("hex") !== attachment.contentKey) {
|
|
88356
88382
|
throw new PromptArtifactError(
|
|
88357
88383
|
"artifact_integrity_failed",
|
|
88358
88384
|
"The prompt attachment failed integrity validation"
|
|
@@ -88574,7 +88600,7 @@ async function settleAbandonedTurn(projection, operations, cancellation) {
|
|
|
88574
88600
|
}
|
|
88575
88601
|
|
|
88576
88602
|
// src/engine/session/turn/execution-receipts.ts
|
|
88577
|
-
import { createHash as
|
|
88603
|
+
import { createHash as createHash8, randomUUID as randomUUID15 } from "node:crypto";
|
|
88578
88604
|
var MAX_TERMINAL_RECEIPTS = 1024;
|
|
88579
88605
|
function executionStarted(state) {
|
|
88580
88606
|
switch (state.kind) {
|
|
@@ -88747,7 +88773,7 @@ var ExecutionReceipts = class {
|
|
|
88747
88773
|
type: "lifecycle-metadata",
|
|
88748
88774
|
payload: { kind: "prompt.completed", commandId, stopReason: "cancelled", execution: "not-started" }
|
|
88749
88775
|
};
|
|
88750
|
-
const commandHash =
|
|
88776
|
+
const commandHash = createHash8("sha256").update(
|
|
88751
88777
|
encodeSessionCancelBeforeStartCommand({
|
|
88752
88778
|
commandId,
|
|
88753
88779
|
kind: "session.cancel-before-start",
|
|
@@ -88832,7 +88858,7 @@ var ExecutionReceipts = class {
|
|
|
88832
88858
|
return recovered;
|
|
88833
88859
|
};
|
|
88834
88860
|
claimExecution = (commandId, sessionId, commandJson) => {
|
|
88835
|
-
const commandHash =
|
|
88861
|
+
const commandHash = createHash8("sha256").update(commandJson).digest("hex");
|
|
88836
88862
|
let existing = this.#executions.get(commandId);
|
|
88837
88863
|
const previous = this.outcome(commandId);
|
|
88838
88864
|
if (existing?.sessionId === sessionId && !executionStarted(existing.state) && previous?.type === "lifecycle-metadata" && previous.payload.kind === "prompt.failed-before-start" && previous.payload.code === "runtime_restarted") {
|
|
@@ -89570,7 +89596,7 @@ function buildSessionLayer(options) {
|
|
|
89570
89596
|
}
|
|
89571
89597
|
|
|
89572
89598
|
// src/engine/session/content/external-content-store.ts
|
|
89573
|
-
import { createHash as
|
|
89599
|
+
import { createHash as createHash9 } from "node:crypto";
|
|
89574
89600
|
import { extname as extname2, join as join29 } from "node:path";
|
|
89575
89601
|
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
89576
89602
|
|
|
@@ -89705,7 +89731,7 @@ var LocalExternalContentStore = class {
|
|
|
89705
89731
|
const active = AbortSignal.any([signal, this.#lifetime.signal]);
|
|
89706
89732
|
active.throwIfAborted();
|
|
89707
89733
|
const metadata = metadataSchema.parse({ kind, mediaType, name: name2 });
|
|
89708
|
-
const key =
|
|
89734
|
+
const key = createHash9("sha256").update(bytes).digest("hex");
|
|
89709
89735
|
const request = `mobius-content:${kind}:${key}`;
|
|
89710
89736
|
const existing = this.#entries.get(request);
|
|
89711
89737
|
if (existing !== void 0 && existing.expiresAt > Date.now()) {
|
|
@@ -90425,7 +90451,7 @@ var SessionError = class extends OperationError {
|
|
|
90425
90451
|
};
|
|
90426
90452
|
|
|
90427
90453
|
// src/engine/session/settings/discover-agent-settings.ts
|
|
90428
|
-
import { createHash as
|
|
90454
|
+
import { createHash as createHash10 } from "node:crypto";
|
|
90429
90455
|
|
|
90430
90456
|
// src/engine/agent/settings/agent-settings-base.ts
|
|
90431
90457
|
var AgentSettingsLaunchSelectionResult = class {
|
|
@@ -90743,7 +90769,7 @@ function settingsRevision(agent, reportedAgentVersion, settings, modelEffort) {
|
|
|
90743
90769
|
unsupportedModelIds: modelEffort.unsupportedModelIds,
|
|
90744
90770
|
valuesByModel: {}
|
|
90745
90771
|
};
|
|
90746
|
-
return
|
|
90772
|
+
return createHash10("sha256").update(
|
|
90747
90773
|
JSON.stringify({
|
|
90748
90774
|
adapterVersion: agent.adapterVersion,
|
|
90749
90775
|
agentId: agent.id,
|
|
@@ -90899,7 +90925,7 @@ function createAgentSettingsCommands(context) {
|
|
|
90899
90925
|
}
|
|
90900
90926
|
|
|
90901
90927
|
// src/engine/runtime/command/registry/content-write/index.ts
|
|
90902
|
-
import { createHash as
|
|
90928
|
+
import { createHash as createHash11 } from "node:crypto";
|
|
90903
90929
|
function createContentWriteCommands(context) {
|
|
90904
90930
|
const pending = /* @__PURE__ */ new Map();
|
|
90905
90931
|
const operations = /* @__PURE__ */ new Set();
|
|
@@ -90929,7 +90955,7 @@ function createContentWriteCommands(context) {
|
|
|
90929
90955
|
pending.set(message.requestId, {
|
|
90930
90956
|
bytes: new Uint8Array(message.byteLength),
|
|
90931
90957
|
command: message,
|
|
90932
|
-
hash:
|
|
90958
|
+
hash: createHash11("sha256"),
|
|
90933
90959
|
receivedBytes: 0,
|
|
90934
90960
|
sequence: 0
|
|
90935
90961
|
});
|
|
@@ -91749,13 +91775,12 @@ async function applySessionConfigurationSelection(sessions, options, selection,
|
|
|
91749
91775
|
if (sessionConfigurationMatches(option, selection)) {
|
|
91750
91776
|
return options;
|
|
91751
91777
|
}
|
|
91752
|
-
return (await sessions.
|
|
91778
|
+
return (await sessions.applySessionConfiguration({
|
|
91753
91779
|
adapter,
|
|
91754
91780
|
additionalDirectories,
|
|
91755
91781
|
agent,
|
|
91756
91782
|
booleanValue: selection.booleanValue,
|
|
91757
91783
|
configId: selection.configId,
|
|
91758
|
-
expectedConfigurationRevision: null,
|
|
91759
91784
|
cwd,
|
|
91760
91785
|
requestId: `cfg_${randomUUID18()}`,
|
|
91761
91786
|
sessionId,
|
|
@@ -92100,11 +92125,10 @@ async function prepareSession(command, recovery, closed, config2, resolveAgent,
|
|
|
92100
92125
|
const configuration = command.configuration;
|
|
92101
92126
|
const snapshot = configuration === void 0 ? prepared : await metrics.measure(
|
|
92102
92127
|
"configuration",
|
|
92103
|
-
async () => await sessions.
|
|
92128
|
+
async () => await sessions.applySessionConfiguration({
|
|
92104
92129
|
...preparation,
|
|
92105
92130
|
booleanValue: configuration.booleanValue,
|
|
92106
92131
|
configId: configuration.configId,
|
|
92107
|
-
expectedConfigurationRevision: null,
|
|
92108
92132
|
requestId: command.requestId,
|
|
92109
92133
|
value: configuration.value,
|
|
92110
92134
|
valueType: configuration.valueType
|
|
@@ -93631,4 +93655,4 @@ export {
|
|
|
93631
93655
|
* MIT Licensed
|
|
93632
93656
|
*)
|
|
93633
93657
|
*/
|
|
93634
|
-
//# sourceMappingURL=chunk-
|
|
93658
|
+
//# sourceMappingURL=chunk-ZW763PCS.js.map
|