omnius 1.0.953 → 1.0.955
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/_types/execution/native-file-write-observation.d.ts +19 -0
- package/dist/_types/execution/native-memory-view-provider.d.ts +84 -0
- package/dist/_types/execution/shell-runs.d.ts +4 -0
- package/dist/_types/execution/tool-output-spool.d.ts +61 -0
- package/dist/_types/execution/tools/file-write.d.ts +53 -0
- package/dist/_types/execution/types.d.ts +34 -0
- package/dist/_types/execution/work-mode-capability.d.ts +23 -0
- package/dist/_types/memory/candidateCoverage.d.ts +23 -0
- package/dist/_types/memory/embeddings.d.ts +1 -1
- package/dist/_types/memory/memoryCapability.d.ts +259 -0
- package/dist/_types/memory/memorySourceResolver.d.ts +131 -0
- package/dist/_types/memory/memoryTypes.d.ts +16 -0
- package/dist/_types/memory/structuredMemoryStore.d.ts +63 -6
- package/dist/_types/memory/unifiedMemoryStore.d.ts +12 -1
- package/dist/_types/orchestrator/agenticRunner.d.ts +236 -48
- package/dist/_types/orchestrator/authored-instruction-context.d.ts +59 -0
- package/dist/_types/orchestrator/authored-instruction-revisions.d.ts +56 -0
- package/dist/_types/orchestrator/authored-instruction-sources.d.ts +60 -0
- package/dist/_types/orchestrator/auxiliary-context-operation.d.ts +196 -0
- package/dist/_types/orchestrator/brokered-tool-composition.d.ts +141 -0
- package/dist/_types/orchestrator/completionReadiness.d.ts +2 -2
- package/dist/_types/orchestrator/confined-composition-worker.d.ts +45 -0
- package/dist/_types/orchestrator/contentAddressedArtifactStore.d.ts +173 -0
- package/dist/_types/orchestrator/contextWindowDump.d.ts +4 -0
- package/dist/_types/orchestrator/explicit-work-mode.d.ts +92 -0
- package/dist/_types/orchestrator/interruption-lifecycle.d.ts +3 -0
- package/dist/_types/orchestrator/memory-capability-context.d.ts +49 -0
- package/dist/_types/orchestrator/owned-inference-wait.d.ts +123 -0
- package/dist/_types/orchestrator/owned-model-wait.d.ts +26 -0
- package/dist/_types/orchestrator/provider-context-contract.d.ts +78 -0
- package/dist/_types/orchestrator/request-tool-capabilities.d.ts +52 -0
- package/dist/_types/orchestrator/structured-memory-extraction-worker.d.ts +20 -0
- package/dist/_types/orchestrator/structuredMemoryInference.d.ts +12 -0
- package/dist/_types/orchestrator/successful-procedure-memory.d.ts +35 -0
- package/dist/api/py-embed.js +70 -17
- package/dist/index.js +2 -2
- package/dist/library.js +115267 -108004
- package/dist/memory-maintenance-worker.js +486 -81
- package/dist/omni-setup-worker.js +83 -30
- package/dist/tui/native/worker.js +3 -1
- package/dist/update-worker-runtime.js +270 -126
- package/docs/DISCOVERY.json +63 -0
- package/docs/DISCOVERY.md +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -4700,7 +4700,7 @@ function registerProcessLease(args, options) {
|
|
|
4700
4700
|
...inspected,
|
|
4701
4701
|
commandHash: inspected.commandHash || (inspected.command ? hashProcessCommand(inspected.command) : void 0)
|
|
4702
4702
|
} : void 0;
|
|
4703
|
-
const
|
|
4703
|
+
const record2 = {
|
|
4704
4704
|
leaseId,
|
|
4705
4705
|
pid: args.pid,
|
|
4706
4706
|
pgid: args.pgid ?? identity?.pgid,
|
|
@@ -4723,11 +4723,11 @@ function registerProcessLease(args, options) {
|
|
|
4723
4723
|
};
|
|
4724
4724
|
const store = readActiveStore(options);
|
|
4725
4725
|
const withoutCurrent = store.leases.filter((lease) => lease.leaseId !== leaseId);
|
|
4726
|
-
withoutCurrent.push(
|
|
4726
|
+
withoutCurrent.push(record2);
|
|
4727
4727
|
const next = { version: 1, updatedAt: now, leases: withoutCurrent };
|
|
4728
4728
|
writeActiveStore(next, options);
|
|
4729
|
-
appendLeaseEvent("register",
|
|
4730
|
-
return
|
|
4729
|
+
appendLeaseEvent("register", record2, options);
|
|
4730
|
+
return record2;
|
|
4731
4731
|
}
|
|
4732
4732
|
function listProcessLeases(options) {
|
|
4733
4733
|
const leases = readActiveStore(options).leases;
|
|
@@ -5047,6 +5047,15 @@ var init_network_egress_policy = __esm({
|
|
|
5047
5047
|
}
|
|
5048
5048
|
});
|
|
5049
5049
|
|
|
5050
|
+
// packages/execution/dist/tool-output-spool.js
|
|
5051
|
+
var TOOL_OUTPUT_LIMITS;
|
|
5052
|
+
var init_tool_output_spool = __esm({
|
|
5053
|
+
"packages/execution/dist/tool-output-spool.js"() {
|
|
5054
|
+
"use strict";
|
|
5055
|
+
TOOL_OUTPUT_LIMITS = Object.freeze({ perProcessBytes: 16 * 1024 * 1024, workspaceBytes: 256 * 1024 * 1024, pageBytes: 65536, entries: 4096 });
|
|
5056
|
+
}
|
|
5057
|
+
});
|
|
5058
|
+
|
|
5050
5059
|
// packages/execution/dist/shell-runs.js
|
|
5051
5060
|
var init_shell_runs = __esm({
|
|
5052
5061
|
"packages/execution/dist/shell-runs.js"() {
|
|
@@ -5142,6 +5151,7 @@ var init_shell_observation_only = __esm({
|
|
|
5142
5151
|
var init_shell = __esm({
|
|
5143
5152
|
"packages/execution/dist/tools/shell.js"() {
|
|
5144
5153
|
"use strict";
|
|
5154
|
+
init_tool_output_spool();
|
|
5145
5155
|
init_shell_runs();
|
|
5146
5156
|
init_shell_run_control();
|
|
5147
5157
|
init_process_kill();
|
|
@@ -5157,6 +5167,71 @@ var init_shell = __esm({
|
|
|
5157
5167
|
}
|
|
5158
5168
|
});
|
|
5159
5169
|
|
|
5170
|
+
// packages/execution/dist/work-mode-capability.js
|
|
5171
|
+
var init_work_mode_capability = __esm({
|
|
5172
|
+
"packages/execution/dist/work-mode-capability.js"() {
|
|
5173
|
+
"use strict";
|
|
5174
|
+
}
|
|
5175
|
+
});
|
|
5176
|
+
|
|
5177
|
+
// packages/execution/dist/tools/change-log.js
|
|
5178
|
+
import { randomBytes } from "node:crypto";
|
|
5179
|
+
var _sessionId;
|
|
5180
|
+
var init_change_log = __esm({
|
|
5181
|
+
"packages/execution/dist/tools/change-log.js"() {
|
|
5182
|
+
"use strict";
|
|
5183
|
+
_sessionId = `session-${Date.now()}-${randomBytes(3).toString("hex")}`;
|
|
5184
|
+
}
|
|
5185
|
+
});
|
|
5186
|
+
|
|
5187
|
+
// packages/execution/dist/tools/edit-metadata.js
|
|
5188
|
+
var init_edit_metadata = __esm({
|
|
5189
|
+
"packages/execution/dist/tools/edit-metadata.js"() {
|
|
5190
|
+
"use strict";
|
|
5191
|
+
}
|
|
5192
|
+
});
|
|
5193
|
+
|
|
5194
|
+
// packages/execution/dist/tools/text-encoding.js
|
|
5195
|
+
import { TextDecoder as TextDecoder2 } from "node:util";
|
|
5196
|
+
var UTF8_DECODER;
|
|
5197
|
+
var init_text_encoding = __esm({
|
|
5198
|
+
"packages/execution/dist/tools/text-encoding.js"() {
|
|
5199
|
+
"use strict";
|
|
5200
|
+
UTF8_DECODER = new TextDecoder2("utf-8", { fatal: true });
|
|
5201
|
+
}
|
|
5202
|
+
});
|
|
5203
|
+
|
|
5204
|
+
// packages/execution/dist/tools/file-mutation.js
|
|
5205
|
+
import { TextDecoder as TextDecoder3 } from "node:util";
|
|
5206
|
+
var utf8;
|
|
5207
|
+
var init_file_mutation = __esm({
|
|
5208
|
+
"packages/execution/dist/tools/file-mutation.js"() {
|
|
5209
|
+
"use strict";
|
|
5210
|
+
init_edit_metadata();
|
|
5211
|
+
utf8 = new TextDecoder3("utf-8", { fatal: true, ignoreBOM: true });
|
|
5212
|
+
}
|
|
5213
|
+
});
|
|
5214
|
+
|
|
5215
|
+
// packages/execution/dist/tools/file-write.js
|
|
5216
|
+
var init_file_write = __esm({
|
|
5217
|
+
"packages/execution/dist/tools/file-write.js"() {
|
|
5218
|
+
"use strict";
|
|
5219
|
+
init_work_mode_capability();
|
|
5220
|
+
init_change_log();
|
|
5221
|
+
init_edit_metadata();
|
|
5222
|
+
init_text_encoding();
|
|
5223
|
+
init_file_mutation();
|
|
5224
|
+
}
|
|
5225
|
+
});
|
|
5226
|
+
|
|
5227
|
+
// packages/execution/dist/native-file-write-observation.js
|
|
5228
|
+
var init_native_file_write_observation = __esm({
|
|
5229
|
+
"packages/execution/dist/native-file-write-observation.js"() {
|
|
5230
|
+
"use strict";
|
|
5231
|
+
init_file_write();
|
|
5232
|
+
}
|
|
5233
|
+
});
|
|
5234
|
+
|
|
5160
5235
|
// packages/execution/dist/tools/debate.js
|
|
5161
5236
|
var init_debate = __esm({
|
|
5162
5237
|
"packages/execution/dist/tools/debate.js"() {
|
|
@@ -5178,13 +5253,6 @@ var init_semantic_map = __esm({
|
|
|
5178
5253
|
}
|
|
5179
5254
|
});
|
|
5180
5255
|
|
|
5181
|
-
// packages/execution/dist/tools/edit-metadata.js
|
|
5182
|
-
var init_edit_metadata = __esm({
|
|
5183
|
-
"packages/execution/dist/tools/edit-metadata.js"() {
|
|
5184
|
-
"use strict";
|
|
5185
|
-
}
|
|
5186
|
-
});
|
|
5187
|
-
|
|
5188
5256
|
// packages/execution/dist/tools/file-read-output.js
|
|
5189
5257
|
var init_file_read_output = __esm({
|
|
5190
5258
|
"packages/execution/dist/tools/file-read-output.js"() {
|
|
@@ -5196,6 +5264,7 @@ var init_file_read_output = __esm({
|
|
|
5196
5264
|
var init_file_read = __esm({
|
|
5197
5265
|
"packages/execution/dist/tools/file-read.js"() {
|
|
5198
5266
|
"use strict";
|
|
5267
|
+
init_work_mode_capability();
|
|
5199
5268
|
init_semantic_map();
|
|
5200
5269
|
init_edit_metadata();
|
|
5201
5270
|
init_file_read_output();
|
|
@@ -5347,48 +5416,6 @@ except BaseException as error:
|
|
|
5347
5416
|
}
|
|
5348
5417
|
});
|
|
5349
5418
|
|
|
5350
|
-
// packages/execution/dist/tools/change-log.js
|
|
5351
|
-
import { randomBytes } from "node:crypto";
|
|
5352
|
-
var _sessionId;
|
|
5353
|
-
var init_change_log = __esm({
|
|
5354
|
-
"packages/execution/dist/tools/change-log.js"() {
|
|
5355
|
-
"use strict";
|
|
5356
|
-
_sessionId = `session-${Date.now()}-${randomBytes(3).toString("hex")}`;
|
|
5357
|
-
}
|
|
5358
|
-
});
|
|
5359
|
-
|
|
5360
|
-
// packages/execution/dist/tools/text-encoding.js
|
|
5361
|
-
import { TextDecoder as TextDecoder2 } from "node:util";
|
|
5362
|
-
var UTF8_DECODER;
|
|
5363
|
-
var init_text_encoding = __esm({
|
|
5364
|
-
"packages/execution/dist/tools/text-encoding.js"() {
|
|
5365
|
-
"use strict";
|
|
5366
|
-
UTF8_DECODER = new TextDecoder2("utf-8", { fatal: true });
|
|
5367
|
-
}
|
|
5368
|
-
});
|
|
5369
|
-
|
|
5370
|
-
// packages/execution/dist/tools/file-mutation.js
|
|
5371
|
-
import { TextDecoder as TextDecoder3 } from "node:util";
|
|
5372
|
-
var utf8;
|
|
5373
|
-
var init_file_mutation = __esm({
|
|
5374
|
-
"packages/execution/dist/tools/file-mutation.js"() {
|
|
5375
|
-
"use strict";
|
|
5376
|
-
init_edit_metadata();
|
|
5377
|
-
utf8 = new TextDecoder3("utf-8", { fatal: true, ignoreBOM: true });
|
|
5378
|
-
}
|
|
5379
|
-
});
|
|
5380
|
-
|
|
5381
|
-
// packages/execution/dist/tools/file-write.js
|
|
5382
|
-
var init_file_write = __esm({
|
|
5383
|
-
"packages/execution/dist/tools/file-write.js"() {
|
|
5384
|
-
"use strict";
|
|
5385
|
-
init_change_log();
|
|
5386
|
-
init_edit_metadata();
|
|
5387
|
-
init_text_encoding();
|
|
5388
|
-
init_file_mutation();
|
|
5389
|
-
}
|
|
5390
|
-
});
|
|
5391
|
-
|
|
5392
5419
|
// packages/execution/dist/tools/grep-search.js
|
|
5393
5420
|
import { execFile as execFile2 } from "node:child_process";
|
|
5394
5421
|
import { promisify as promisify2 } from "node:util";
|
|
@@ -7256,6 +7283,7 @@ var init_esm3 = __esm({
|
|
|
7256
7283
|
var init_glob_find = __esm({
|
|
7257
7284
|
"packages/execution/dist/tools/glob-find.js"() {
|
|
7258
7285
|
"use strict";
|
|
7286
|
+
init_work_mode_capability();
|
|
7259
7287
|
init_esm3();
|
|
7260
7288
|
}
|
|
7261
7289
|
});
|
|
@@ -53779,6 +53807,7 @@ var init_edit_snippet_finder = __esm({
|
|
|
53779
53807
|
var init_file_edit = __esm({
|
|
53780
53808
|
"packages/execution/dist/tools/file-edit.js"() {
|
|
53781
53809
|
"use strict";
|
|
53810
|
+
init_work_mode_capability();
|
|
53782
53811
|
init_change_log();
|
|
53783
53812
|
init_edit_snippet_finder();
|
|
53784
53813
|
init_edit_metadata();
|
|
@@ -53787,6 +53816,78 @@ var init_file_edit = __esm({
|
|
|
53787
53816
|
}
|
|
53788
53817
|
});
|
|
53789
53818
|
|
|
53819
|
+
// packages/memory/dist/memoryCapability.js
|
|
53820
|
+
import { createHash as createHash3, randomUUID as randomUUID3 } from "node:crypto";
|
|
53821
|
+
function canonical(value, depth = 0) {
|
|
53822
|
+
if (depth > 32)
|
|
53823
|
+
throw new MemoryContractError("value_depth_exceeded");
|
|
53824
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
53825
|
+
return JSON.stringify(value);
|
|
53826
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
53827
|
+
return JSON.stringify(value);
|
|
53828
|
+
if (Array.isArray(value))
|
|
53829
|
+
return `[${value.map((v) => canonical(v, depth + 1)).join(",")}]`;
|
|
53830
|
+
if (record(value) && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null))
|
|
53831
|
+
return `{${Object.keys(value).filter((k) => value[k] !== void 0).sort().map((k) => `${JSON.stringify(k)}:${canonical(value[k], depth + 1)}`).join(",")}}`;
|
|
53832
|
+
throw new MemoryContractError("non_json_value");
|
|
53833
|
+
}
|
|
53834
|
+
var MEMORY_NAMESPACES, MEMORY_CONTRACT_LIMITS, MemoryContractError, record, memoryContentHash, stableMemoryHash, UNBOUND;
|
|
53835
|
+
var init_memoryCapability = __esm({
|
|
53836
|
+
"packages/memory/dist/memoryCapability.js"() {
|
|
53837
|
+
"use strict";
|
|
53838
|
+
MEMORY_NAMESPACES = Object.freeze({
|
|
53839
|
+
projectUnified: "project_unified_memory",
|
|
53840
|
+
projectLegacy: "project_legacy_memory",
|
|
53841
|
+
telegramChat: "telegram_chat",
|
|
53842
|
+
task: "task_evidence",
|
|
53843
|
+
structured: "structured_records",
|
|
53844
|
+
folds: "context_folds",
|
|
53845
|
+
procedures: "successful_procedures"
|
|
53846
|
+
});
|
|
53847
|
+
MEMORY_CONTRACT_LIMITS = Object.freeze({
|
|
53848
|
+
scopes: 64,
|
|
53849
|
+
scopeIds: 256,
|
|
53850
|
+
matches: 100,
|
|
53851
|
+
branches: 16,
|
|
53852
|
+
stages: 64,
|
|
53853
|
+
sourceRefs: 512,
|
|
53854
|
+
spans: 128,
|
|
53855
|
+
parents: 128,
|
|
53856
|
+
textChars: 65536,
|
|
53857
|
+
fieldChars: 512,
|
|
53858
|
+
routes: 32,
|
|
53859
|
+
traceBytes: 262144
|
|
53860
|
+
});
|
|
53861
|
+
MemoryContractError = class extends Error {
|
|
53862
|
+
code;
|
|
53863
|
+
constructor(code) {
|
|
53864
|
+
super(`Memory contract: ${code}`);
|
|
53865
|
+
this.code = code;
|
|
53866
|
+
this.name = "MemoryContractError";
|
|
53867
|
+
}
|
|
53868
|
+
};
|
|
53869
|
+
record = (x) => !!x && typeof x === "object" && !Array.isArray(x);
|
|
53870
|
+
memoryContentHash = (value) => createHash3("sha256").update(value).digest("hex");
|
|
53871
|
+
stableMemoryHash = (value) => memoryContentHash(canonical(value));
|
|
53872
|
+
UNBOUND = stableMemoryHash({ memoryBinding: "unavailable" });
|
|
53873
|
+
}
|
|
53874
|
+
});
|
|
53875
|
+
|
|
53876
|
+
// packages/memory/dist/memorySourceResolver.js
|
|
53877
|
+
var init_memorySourceResolver = __esm({
|
|
53878
|
+
"packages/memory/dist/memorySourceResolver.js"() {
|
|
53879
|
+
"use strict";
|
|
53880
|
+
init_memoryCapability();
|
|
53881
|
+
}
|
|
53882
|
+
});
|
|
53883
|
+
|
|
53884
|
+
// packages/memory/dist/candidateCoverage.js
|
|
53885
|
+
var init_candidateCoverage = __esm({
|
|
53886
|
+
"packages/memory/dist/candidateCoverage.js"() {
|
|
53887
|
+
"use strict";
|
|
53888
|
+
}
|
|
53889
|
+
});
|
|
53890
|
+
|
|
53790
53891
|
// packages/memory/dist/db.js
|
|
53791
53892
|
var init_db = __esm({
|
|
53792
53893
|
"packages/memory/dist/db.js"() {
|
|
@@ -53850,6 +53951,7 @@ var init_evidenceIngestion = __esm({
|
|
|
53850
53951
|
var init_structuredMemoryStore = __esm({
|
|
53851
53952
|
"packages/memory/dist/structuredMemoryStore.js"() {
|
|
53852
53953
|
"use strict";
|
|
53954
|
+
init_memoryCapability();
|
|
53853
53955
|
}
|
|
53854
53956
|
});
|
|
53855
53957
|
|
|
@@ -53895,6 +53997,7 @@ var MEMORY_JOB_CLAIM_LEASE_MS;
|
|
|
53895
53997
|
var init_unifiedMemoryStore = __esm({
|
|
53896
53998
|
"packages/memory/dist/unifiedMemoryStore.js"() {
|
|
53897
53999
|
"use strict";
|
|
54000
|
+
init_candidateCoverage();
|
|
53898
54001
|
init_memoryChunker();
|
|
53899
54002
|
MEMORY_JOB_CLAIM_LEASE_MS = 5 * 6e4;
|
|
53900
54003
|
}
|
|
@@ -53904,6 +54007,7 @@ var init_unifiedMemoryStore = __esm({
|
|
|
53904
54007
|
var init_hybridMemoryRetriever = __esm({
|
|
53905
54008
|
"packages/memory/dist/hybridMemoryRetriever.js"() {
|
|
53906
54009
|
"use strict";
|
|
54010
|
+
init_candidateCoverage();
|
|
53907
54011
|
init_unifiedMemoryStore();
|
|
53908
54012
|
}
|
|
53909
54013
|
});
|
|
@@ -54045,6 +54149,7 @@ var init_embodiedTrace = __esm({
|
|
|
54045
54149
|
var init_pprRetrieval = __esm({
|
|
54046
54150
|
"packages/memory/dist/pprRetrieval.js"() {
|
|
54047
54151
|
"use strict";
|
|
54152
|
+
init_candidateCoverage();
|
|
54048
54153
|
init_zettelkasten();
|
|
54049
54154
|
init_homeostaticRegulation();
|
|
54050
54155
|
init_socialInfluence();
|
|
@@ -54057,6 +54162,7 @@ var init_episodeStore = __esm({
|
|
|
54057
54162
|
"packages/memory/dist/episodeStore.js"() {
|
|
54058
54163
|
"use strict";
|
|
54059
54164
|
init_db();
|
|
54165
|
+
init_candidateCoverage();
|
|
54060
54166
|
init_zettelkasten();
|
|
54061
54167
|
init_homeostaticRegulation();
|
|
54062
54168
|
init_socialInfluence();
|
|
@@ -54106,6 +54212,7 @@ var init_speakerIdentityStore = __esm({
|
|
|
54106
54212
|
var init_temporalGraph = __esm({
|
|
54107
54213
|
"packages/memory/dist/temporalGraph.js"() {
|
|
54108
54214
|
"use strict";
|
|
54215
|
+
init_candidateCoverage();
|
|
54109
54216
|
init_db();
|
|
54110
54217
|
}
|
|
54111
54218
|
});
|
|
@@ -55186,7 +55293,10 @@ var init_evidence_retirement = __esm({
|
|
|
55186
55293
|
var init_dist3 = __esm({
|
|
55187
55294
|
"packages/memory/dist/index.js"() {
|
|
55188
55295
|
"use strict";
|
|
55296
|
+
init_memorySourceResolver();
|
|
55297
|
+
init_candidateCoverage();
|
|
55189
55298
|
init_db();
|
|
55299
|
+
init_memoryCapability();
|
|
55190
55300
|
init_contextMemoryLedger();
|
|
55191
55301
|
init_immutableEvidenceStore();
|
|
55192
55302
|
init_artifactReviewSourceIndex();
|
|
@@ -55255,11 +55365,29 @@ var init_dist3 = __esm({
|
|
|
55255
55365
|
}
|
|
55256
55366
|
});
|
|
55257
55367
|
|
|
55368
|
+
// packages/execution/dist/tools/legacy-memory-view.js
|
|
55369
|
+
var init_legacy_memory_view = __esm({
|
|
55370
|
+
"packages/execution/dist/tools/legacy-memory-view.js"() {
|
|
55371
|
+
"use strict";
|
|
55372
|
+
init_dist3();
|
|
55373
|
+
}
|
|
55374
|
+
});
|
|
55375
|
+
|
|
55376
|
+
// packages/execution/dist/tools/memory-source-adapter.js
|
|
55377
|
+
var init_memory_source_adapter = __esm({
|
|
55378
|
+
"packages/execution/dist/tools/memory-source-adapter.js"() {
|
|
55379
|
+
"use strict";
|
|
55380
|
+
init_dist3();
|
|
55381
|
+
init_legacy_memory_view();
|
|
55382
|
+
}
|
|
55383
|
+
});
|
|
55384
|
+
|
|
55258
55385
|
// packages/execution/dist/tools/memory-read.js
|
|
55259
55386
|
var init_memory_read = __esm({
|
|
55260
55387
|
"packages/execution/dist/tools/memory-read.js"() {
|
|
55261
55388
|
"use strict";
|
|
55262
55389
|
init_dist3();
|
|
55390
|
+
init_memory_source_adapter();
|
|
55263
55391
|
}
|
|
55264
55392
|
});
|
|
55265
55393
|
|
|
@@ -55271,12 +55399,22 @@ var init_memory_write = __esm({
|
|
|
55271
55399
|
}
|
|
55272
55400
|
});
|
|
55273
55401
|
|
|
55402
|
+
// packages/execution/dist/native-memory-view-provider.js
|
|
55403
|
+
var init_native_memory_view_provider = __esm({
|
|
55404
|
+
"packages/execution/dist/native-memory-view-provider.js"() {
|
|
55405
|
+
"use strict";
|
|
55406
|
+
}
|
|
55407
|
+
});
|
|
55408
|
+
|
|
55274
55409
|
// packages/execution/dist/tools/memory-search.js
|
|
55275
55410
|
var DEFAULT_INLINE_KG_MAX_BYTES, DEFAULT_INLINE_EPISODES_MAX_BYTES;
|
|
55276
55411
|
var init_memory_search = __esm({
|
|
55277
55412
|
"packages/execution/dist/tools/memory-search.js"() {
|
|
55278
55413
|
"use strict";
|
|
55414
|
+
init_native_memory_view_provider();
|
|
55415
|
+
init_memory_source_adapter();
|
|
55279
55416
|
init_dist3();
|
|
55417
|
+
init_legacy_memory_view();
|
|
55280
55418
|
DEFAULT_INLINE_KG_MAX_BYTES = 512 * 1024 * 1024;
|
|
55281
55419
|
DEFAULT_INLINE_EPISODES_MAX_BYTES = 1024 * 1024 * 1024;
|
|
55282
55420
|
}
|
|
@@ -55308,6 +55446,7 @@ var init_explore_tools = __esm({
|
|
|
55308
55446
|
var init_list_directory = __esm({
|
|
55309
55447
|
"packages/execution/dist/tools/list-directory.js"() {
|
|
55310
55448
|
"use strict";
|
|
55449
|
+
init_work_mode_capability();
|
|
55311
55450
|
}
|
|
55312
55451
|
});
|
|
55313
55452
|
|
|
@@ -55364,6 +55503,7 @@ var init_batch_edit = __esm({
|
|
|
55364
55503
|
var init_file_patch = __esm({
|
|
55365
55504
|
"packages/execution/dist/tools/file-patch.js"() {
|
|
55366
55505
|
"use strict";
|
|
55506
|
+
init_work_mode_capability();
|
|
55367
55507
|
init_change_log();
|
|
55368
55508
|
init_edit_metadata();
|
|
55369
55509
|
init_text_encoding();
|
|
@@ -55397,6 +55537,7 @@ var init_git_info = __esm({
|
|
|
55397
55537
|
var init_background_task = __esm({
|
|
55398
55538
|
"packages/execution/dist/tools/background-task.js"() {
|
|
55399
55539
|
"use strict";
|
|
55540
|
+
init_tool_output_spool();
|
|
55400
55541
|
init_shell_runs();
|
|
55401
55542
|
init_shell_run_control();
|
|
55402
55543
|
init_background_process_receipt();
|
|
@@ -55650,7 +55791,6 @@ var init_safe_python = __esm({
|
|
|
55650
55791
|
var init_repl = __esm({
|
|
55651
55792
|
"packages/execution/dist/tools/repl.js"() {
|
|
55652
55793
|
"use strict";
|
|
55653
|
-
init_process_kill();
|
|
55654
55794
|
init_process_lifecycle();
|
|
55655
55795
|
}
|
|
55656
55796
|
});
|
|
@@ -135735,13 +135875,13 @@ ${lanes.join("\n")}
|
|
|
135735
135875
|
if (!headMessage2 && maybeSuppress) {
|
|
135736
135876
|
const savedErrorState = captureErrorCalculationState();
|
|
135737
135877
|
reportRelationError(headMessage2, source2, target2);
|
|
135738
|
-
let
|
|
135878
|
+
let canonical2;
|
|
135739
135879
|
if (errorInfo && errorInfo !== savedErrorState.errorInfo) {
|
|
135740
|
-
|
|
135880
|
+
canonical2 = { code: errorInfo.code, messageText: errorInfo.messageText };
|
|
135741
135881
|
}
|
|
135742
135882
|
resetErrorInfo(savedErrorState);
|
|
135743
|
-
if (
|
|
135744
|
-
errorInfo.canonicalHead =
|
|
135883
|
+
if (canonical2 && errorInfo) {
|
|
135884
|
+
errorInfo.canonicalHead = canonical2;
|
|
135745
135885
|
}
|
|
135746
135886
|
lastSkippedInfo = [source2, target2];
|
|
135747
135887
|
return;
|
|
@@ -303724,6 +303864,8 @@ var init_dist5 = __esm({
|
|
|
303724
303864
|
init_provenance();
|
|
303725
303865
|
init_network_egress_policy();
|
|
303726
303866
|
init_shell();
|
|
303867
|
+
init_native_file_write_observation();
|
|
303868
|
+
init_tool_output_spool();
|
|
303727
303869
|
init_shell_runs();
|
|
303728
303870
|
init_debate();
|
|
303729
303871
|
init_replay_with_intervention();
|
|
@@ -303919,6 +304061,8 @@ var init_dist5 = __esm({
|
|
|
303919
304061
|
init_ocr_pdf();
|
|
303920
304062
|
init_qwen35_head_sites();
|
|
303921
304063
|
init_distributions();
|
|
304064
|
+
init_work_mode_capability();
|
|
304065
|
+
init_native_memory_view_provider();
|
|
303922
304066
|
}
|
|
303923
304067
|
});
|
|
303924
304068
|
|
|
@@ -304035,44 +304179,44 @@ function readRecord(port, now, options) {
|
|
|
304035
304179
|
lastReason: "supervision_state_invalid"
|
|
304036
304180
|
};
|
|
304037
304181
|
}
|
|
304038
|
-
function pruneExpiredAttempts(
|
|
304182
|
+
function pruneExpiredAttempts(record2, now, policy) {
|
|
304039
304183
|
const cutoff = now - policy.windowMs;
|
|
304040
|
-
const attempts =
|
|
304041
|
-
if (attempts.length ===
|
|
304184
|
+
const attempts = record2.attempts.filter((attempt) => attempt.at >= cutoff);
|
|
304185
|
+
if (attempts.length === record2.attempts.length) return record2;
|
|
304042
304186
|
return {
|
|
304043
|
-
...
|
|
304187
|
+
...record2,
|
|
304044
304188
|
attempts,
|
|
304045
|
-
phase: attempts.length === 0 ? "healthy" :
|
|
304046
|
-
nextAttemptAt: attempts.length === 0 ? null :
|
|
304047
|
-
degradedSince: attempts.length === 0 ? null :
|
|
304048
|
-
lastReason: attempts.length === 0 ? "restart_window_elapsed" :
|
|
304189
|
+
phase: attempts.length === 0 ? "healthy" : record2.phase,
|
|
304190
|
+
nextAttemptAt: attempts.length === 0 ? null : record2.nextAttemptAt,
|
|
304191
|
+
degradedSince: attempts.length === 0 ? null : record2.degradedSince,
|
|
304192
|
+
lastReason: attempts.length === 0 ? "restart_window_elapsed" : record2.lastReason,
|
|
304049
304193
|
updatedAt: now
|
|
304050
304194
|
};
|
|
304051
304195
|
}
|
|
304052
|
-
function toHealth(
|
|
304053
|
-
const retryAfterMs =
|
|
304196
|
+
function toHealth(record2, now, policy) {
|
|
304197
|
+
const retryAfterMs = record2.nextAttemptAt === null ? 0 : Math.max(0, record2.nextAttemptAt - now);
|
|
304054
304198
|
return {
|
|
304055
304199
|
schema: DAEMON_SUPERVISION_SCHEMA,
|
|
304056
|
-
phase:
|
|
304057
|
-
degraded:
|
|
304058
|
-
restartCount:
|
|
304200
|
+
phase: record2.phase,
|
|
304201
|
+
degraded: record2.phase === "degraded_backoff" || record2.phase === "degraded_open",
|
|
304202
|
+
restartCount: record2.attempts.length,
|
|
304059
304203
|
windowMs: policy.windowMs,
|
|
304060
304204
|
maxStartsInWindow: policy.maxStartsInWindow,
|
|
304061
|
-
nextAttemptAt:
|
|
304205
|
+
nextAttemptAt: record2.nextAttemptAt,
|
|
304062
304206
|
retryAfterMs,
|
|
304063
|
-
lastStartAt:
|
|
304064
|
-
lastHealthyAt:
|
|
304065
|
-
degradedSince:
|
|
304066
|
-
lastReason:
|
|
304067
|
-
lastResetAt:
|
|
304068
|
-
lastResetBy:
|
|
304207
|
+
lastStartAt: record2.lastStartAt,
|
|
304208
|
+
lastHealthyAt: record2.lastHealthyAt,
|
|
304209
|
+
degradedSince: record2.degradedSince,
|
|
304210
|
+
lastReason: record2.lastReason,
|
|
304211
|
+
lastResetAt: record2.lastResetAt,
|
|
304212
|
+
lastResetBy: record2.lastResetBy
|
|
304069
304213
|
};
|
|
304070
304214
|
}
|
|
304071
304215
|
function readDaemonSupervisionHealth(port, options = {}) {
|
|
304072
304216
|
const now = options.now?.() ?? Date.now();
|
|
304073
304217
|
const policy = options.policy ?? daemonSupervisionPolicy();
|
|
304074
|
-
const
|
|
304075
|
-
return toHealth(
|
|
304218
|
+
const record2 = pruneExpiredAttempts(readRecord(port, now, options), now, policy);
|
|
304219
|
+
return toHealth(record2, now, policy);
|
|
304076
304220
|
}
|
|
304077
304221
|
var DAEMON_SUPERVISION_SCHEMA;
|
|
304078
304222
|
var init_daemon_supervision = __esm({
|
|
@@ -304472,7 +304616,7 @@ function claimDaemonEndpoint(port = getDaemonPort(), inheritedToken) {
|
|
|
304472
304616
|
const lockFile = daemonLockFile(port);
|
|
304473
304617
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
304474
304618
|
const token = inheritedToken ?? newDaemonLockToken();
|
|
304475
|
-
const
|
|
304619
|
+
const record2 = {
|
|
304476
304620
|
endpoint,
|
|
304477
304621
|
pid: process.pid,
|
|
304478
304622
|
token,
|
|
@@ -304481,7 +304625,7 @@ function claimDaemonEndpoint(port = getDaemonPort(), inheritedToken) {
|
|
|
304481
304625
|
let fd = null;
|
|
304482
304626
|
try {
|
|
304483
304627
|
fd = openSync2(lockFile, "wx", 384);
|
|
304484
|
-
writeSync(fd, JSON.stringify(
|
|
304628
|
+
writeSync(fd, JSON.stringify(record2));
|
|
304485
304629
|
closeSync2(fd);
|
|
304486
304630
|
return { endpoint, lockFile, pid: process.pid, port, token };
|
|
304487
304631
|
} catch (error) {
|
|
@@ -304779,15 +304923,15 @@ function removeDaemonLockIfUnchanged(port, expected) {
|
|
|
304779
304923
|
}
|
|
304780
304924
|
}
|
|
304781
304925
|
async function reclaimStaleDaemonEndpointClaim(port, verifiedStoppedPids = /* @__PURE__ */ new Set(), dependencies = DEFAULT_CLAIM_RECLAIM_DEPENDENCIES) {
|
|
304782
|
-
const
|
|
304783
|
-
if (!
|
|
304926
|
+
const record2 = dependencies.readLock(port);
|
|
304927
|
+
if (!record2) return dependencies.portIsFree(port);
|
|
304784
304928
|
if (!await dependencies.portIsFree(port)) return false;
|
|
304785
|
-
const clearExactClaim = async () => dependencies.removeLockIfUnchanged(port,
|
|
304786
|
-
if (verifiedStoppedPids.has(
|
|
304929
|
+
const clearExactClaim = async () => dependencies.removeLockIfUnchanged(port, record2) && dependencies.portIsFree(port);
|
|
304930
|
+
if (verifiedStoppedPids.has(record2.pid) || !dependencies.processIsAlive(record2.pid)) {
|
|
304787
304931
|
return clearExactClaim();
|
|
304788
304932
|
}
|
|
304789
304933
|
const lease = dependencies.leases().find(
|
|
304790
|
-
(item) => item.status === "active" && item.pid ===
|
|
304934
|
+
(item) => item.status === "active" && item.pid === record2.pid && item.ownerKind === "daemon" && item.ownerId === `daemon:${port}`
|
|
304791
304935
|
);
|
|
304792
304936
|
if (!lease) return false;
|
|
304793
304937
|
const stopped = await dependencies.stopLease(lease.leaseId, port);
|
|
@@ -305095,7 +305239,7 @@ import { spawn as spawn5 } from "node:child_process";
|
|
|
305095
305239
|
|
|
305096
305240
|
// packages/cli/src/update-service.ts
|
|
305097
305241
|
import { spawn as spawn3 } from "node:child_process";
|
|
305098
|
-
import { createHash as
|
|
305242
|
+
import { createHash as createHash5, randomUUID as randomUUID5 } from "node:crypto";
|
|
305099
305243
|
import {
|
|
305100
305244
|
constants as constants3,
|
|
305101
305245
|
chmodSync,
|
|
@@ -305224,7 +305368,7 @@ async function pruneStaleUpdateRecoveries(modulesRoot, options = {}) {
|
|
|
305224
305368
|
}
|
|
305225
305369
|
|
|
305226
305370
|
// packages/cli/src/npm-install-recovery.ts
|
|
305227
|
-
import { createHash as
|
|
305371
|
+
import { createHash as createHash4, randomUUID as randomUUID4 } from "node:crypto";
|
|
305228
305372
|
import { closeSync as closeSync3, constants as constants2, fstatSync, fsyncSync, ftruncateSync, lstatSync as lstatSync3, openSync as openSync3, readFileSync as readFileSync7, readdirSync, readSync as readSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
305229
305373
|
import { chmod, cp, lstat as lstat2, mkdir, readdir as readdir2, realpath, rename, rm as rm2 } from "node:fs/promises";
|
|
305230
305374
|
import { basename as basename8, dirname as dirname9, isAbsolute as isAbsolute7, join as join17, resolve as resolve11 } from "node:path";
|
|
@@ -305252,7 +305396,7 @@ function parseNpmRenameCollision(diagnostic) {
|
|
|
305252
305396
|
return { code, syscall: "rename", path: path3, dest };
|
|
305253
305397
|
}
|
|
305254
305398
|
function retiredNpmPackagePath(packagePath) {
|
|
305255
|
-
const suffix =
|
|
305399
|
+
const suffix = createHash4("sha1").update(packagePath).digest("base64").replace(/[^a-zA-Z0-9]/g, "").slice(0, 8);
|
|
305256
305400
|
return join17(dirname9(packagePath), `.${basename8(packagePath)}-${suffix}`);
|
|
305257
305401
|
}
|
|
305258
305402
|
function assertNotCancelled(signal) {
|
|
@@ -305293,7 +305437,7 @@ async function prepareNpmRetirementSlot(modulesRoot, options = {}) {
|
|
|
305293
305437
|
throw error;
|
|
305294
305438
|
}
|
|
305295
305439
|
assertOwnedDirectory(before, "retired package");
|
|
305296
|
-
const backup = join17(root, `.omnius-update-recovery-${
|
|
305440
|
+
const backup = join17(root, `.omnius-update-recovery-${randomUUID4()}`);
|
|
305297
305441
|
const receipt = { modulesRoot: root, retiredPath: retired, backupPath: backup, device: before.dev, inode: before.ino };
|
|
305298
305442
|
current();
|
|
305299
305443
|
await options.onPrepare?.({ ...receipt });
|
|
@@ -305428,7 +305572,7 @@ async function acquireNpmInstallLease(modulesRoot, options = {}) {
|
|
|
305428
305572
|
const root = await realpath(logical), rootMetadata = await lstat2(root);
|
|
305429
305573
|
assertOwnedDirectory(rootMetadata, "global modules root");
|
|
305430
305574
|
if (!sameIdentity(logicalMetadata, rootMetadata)) throw new Error("npm modules root changed before installer admission.");
|
|
305431
|
-
const lockPath = join17(root, ".omnius-install.lock"), guardPath = lockPath + ".guard", nonce =
|
|
305575
|
+
const lockPath = join17(root, ".omnius-install.lock"), guardPath = lockPath + ".guard", nonce = randomUUID4();
|
|
305432
305576
|
const assertRoot = () => {
|
|
305433
305577
|
const current = lstatSync3(root);
|
|
305434
305578
|
assertOwnedDirectory(current, "global modules root");
|
|
@@ -305447,7 +305591,7 @@ async function acquireNpmInstallLease(modulesRoot, options = {}) {
|
|
|
305447
305591
|
const withGuard = (action) => {
|
|
305448
305592
|
assertRoot();
|
|
305449
305593
|
const fd = openGuard();
|
|
305450
|
-
const metadata = fstatSync(fd), guardNonce =
|
|
305594
|
+
const metadata = fstatSync(fd), guardNonce = randomUUID4();
|
|
305451
305595
|
let recorded = false;
|
|
305452
305596
|
try {
|
|
305453
305597
|
writeFileSync5(fd, JSON.stringify({ schema_version: 1, nonce: guardNonce, pid: process.pid, process_identity: processIdentity(process.pid) }));
|
|
@@ -305554,7 +305698,7 @@ function hashOwnedFile(path3) {
|
|
|
305554
305698
|
try {
|
|
305555
305699
|
const metadata = fstatSync(fd);
|
|
305556
305700
|
if (!valid(metadata) || !sameIdentity(before, metadata)) throw new Error("Omnius runtime file changed during verification.");
|
|
305557
|
-
const hash =
|
|
305701
|
+
const hash = createHash4("sha256"), chunk = Buffer.alloc(64 * 1024);
|
|
305558
305702
|
let size = 0;
|
|
305559
305703
|
for (; ; ) {
|
|
305560
305704
|
const count4 = readSync2(fd, chunk, 0, chunk.length, null);
|
|
@@ -305572,29 +305716,29 @@ function hashOwnedFile(path3) {
|
|
|
305572
305716
|
}
|
|
305573
305717
|
}
|
|
305574
305718
|
function inspectNpmRuntimeInstallation(packagePath) {
|
|
305575
|
-
const
|
|
305576
|
-
if (!isAbsolute7(packagePath) || basename8(
|
|
305577
|
-
return inspectRuntimeDirectory(
|
|
305719
|
+
const canonical2 = resolve11(packagePath), root = dirname9(canonical2);
|
|
305720
|
+
if (!isAbsolute7(packagePath) || basename8(canonical2) !== "omnius") throw new Error("Runtime verification requires the canonical Omnius package path.");
|
|
305721
|
+
return inspectRuntimeDirectory(canonical2, root);
|
|
305578
305722
|
}
|
|
305579
|
-
function inspectRuntimeDirectory(
|
|
305580
|
-
const before = lstatSync3(
|
|
305723
|
+
function inspectRuntimeDirectory(canonical2, root) {
|
|
305724
|
+
const before = lstatSync3(canonical2);
|
|
305581
305725
|
assertOwnedDirectory(lstatSync3(root), "global modules root");
|
|
305582
305726
|
assertOwnedDirectory(before, "Omnius package");
|
|
305583
|
-
assertOwnedDirectory(lstatSync3(join17(
|
|
305727
|
+
assertOwnedDirectory(lstatSync3(join17(canonical2, "dist")), "Omnius runtime");
|
|
305584
305728
|
const files = {};
|
|
305585
|
-
for (const file of REQUIRED_OMNIUS_RUNTIME_FILES) files[file] = hashOwnedFile(join17(
|
|
305586
|
-
const manifest = JSON.parse(readFileSync7(join17(
|
|
305729
|
+
for (const file of REQUIRED_OMNIUS_RUNTIME_FILES) files[file] = hashOwnedFile(join17(canonical2, file));
|
|
305730
|
+
const manifest = JSON.parse(readFileSync7(join17(canonical2, "package.json"), "utf8"));
|
|
305587
305731
|
if (manifest.name !== "omnius" || typeof manifest.version !== "string" || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(manifest.version))
|
|
305588
305732
|
throw new Error("Omnius runtime manifest is invalid.");
|
|
305589
305733
|
const binTarget = typeof manifest.bin === "string" ? manifest.bin : manifest.bin?.omnius;
|
|
305590
305734
|
if (typeof binTarget !== "string" || !/^[A-Za-z0-9_./-]+$/.test(binTarget) || isAbsolute7(binTarget) || binTarget.split("/").some((part) => !part || part === ".." || part === "."))
|
|
305591
305735
|
throw new Error("Omnius runtime manifest has no safe declared omnius executable.");
|
|
305592
|
-
for (const directory of binTarget.split("/").slice(0, -1).reduce((paths, part) => [...paths, join17(paths.at(-1) ??
|
|
305736
|
+
for (const directory of binTarget.split("/").slice(0, -1).reduce((paths, part) => [...paths, join17(paths.at(-1) ?? canonical2, part)], []))
|
|
305593
305737
|
assertOwnedDirectory(lstatSync3(directory), "Omnius executable directory");
|
|
305594
|
-
files[binTarget] ??= hashOwnedFile(join17(
|
|
305595
|
-
if (!readFileSync7(join17(
|
|
305738
|
+
files[binTarget] ??= hashOwnedFile(join17(canonical2, binTarget));
|
|
305739
|
+
if (!readFileSync7(join17(canonical2, "dist/update-worker.js"), "utf8").includes("omnius.update-worker-bootstrap.v2"))
|
|
305596
305740
|
throw new Error("Omnius runtime has no compatible update worker bootstrap.");
|
|
305597
|
-
if (hashOwnedFile(join17(
|
|
305741
|
+
if (hashOwnedFile(join17(canonical2, "package.json")) !== files["package.json"] || !sameIdentity(before, lstatSync3(canonical2)))
|
|
305598
305742
|
throw new Error("Omnius package changed during runtime verification.");
|
|
305599
305743
|
return {
|
|
305600
305744
|
modulesRoot: root,
|
|
@@ -305618,7 +305762,7 @@ async function preserveVerifiedNpmInstallation(snapshot, options) {
|
|
|
305618
305762
|
if (root !== options.lease.modulesRoot) throw new Error("Package preservation belongs to a different npm lease.");
|
|
305619
305763
|
const before = inspectNpmRuntimeInstallation(source);
|
|
305620
305764
|
if (before.device !== snapshot.device || before.inode !== snapshot.inode || before.packageHash !== snapshot.packageHash || JSON.stringify(before.files) !== JSON.stringify(snapshot.files)) throw new Error("Prior runtime changed before preservation.");
|
|
305621
|
-
const backupPath = join17(root, `.omnius-update-recovery-${
|
|
305765
|
+
const backupPath = join17(root, `.omnius-update-recovery-${randomUUID4()}`);
|
|
305622
305766
|
await mkdir(backupPath, { mode: 448 });
|
|
305623
305767
|
const metadata = await lstat2(backupPath);
|
|
305624
305768
|
const backup = { modulesRoot: root, retiredPath: retiredNpmPackagePath(source), backupPath, device: metadata.dev, inode: metadata.ino };
|
|
@@ -305655,7 +305799,7 @@ async function preserveVerifiedNpmInstallation(snapshot, options) {
|
|
|
305655
305799
|
return { backup, installation };
|
|
305656
305800
|
}
|
|
305657
305801
|
async function restoreVerifiedNpmInstallation(snapshot, options) {
|
|
305658
|
-
const root = resolve11(snapshot.modulesRoot),
|
|
305802
|
+
const root = resolve11(snapshot.modulesRoot), canonical2 = join17(root, "omnius");
|
|
305659
305803
|
const current = () => {
|
|
305660
305804
|
options.lease.assertOwnedForRecovery();
|
|
305661
305805
|
options.assertOwned();
|
|
@@ -305664,7 +305808,7 @@ async function restoreVerifiedNpmInstallation(snapshot, options) {
|
|
|
305664
305808
|
if (root !== options.lease.modulesRoot || !isAbsolute7(snapshot.modulesRoot)) throw new Error("Package recovery belongs to a different npm lease.");
|
|
305665
305809
|
const rootBefore = await lstat2(root);
|
|
305666
305810
|
assertOwnedDirectory(rootBefore, "global modules root");
|
|
305667
|
-
const validPath = (path3) => path3 ===
|
|
305811
|
+
const validPath = (path3) => path3 === canonical2 || path3 === retiredNpmPackagePath(canonical2) || options.backups?.some((backup) => backup.modulesRoot === root && backup.backupPath === path3 && dirname9(path3) === root && /^\.omnius-update-recovery-[a-f0-9-]{36}$/.test(basename8(path3)));
|
|
305668
305812
|
const matches = (path3) => {
|
|
305669
305813
|
if (!validPath(path3)) return false;
|
|
305670
305814
|
let metadata;
|
|
@@ -305684,29 +305828,29 @@ async function restoreVerifiedNpmInstallation(snapshot, options) {
|
|
|
305684
305828
|
assertOwnedDirectory(lstatSync3(directory), "prior Omnius executable directory");
|
|
305685
305829
|
return true;
|
|
305686
305830
|
};
|
|
305687
|
-
const source = [
|
|
305831
|
+
const source = [canonical2, retiredNpmPackagePath(canonical2), ...(options.backups ?? []).map((backup) => backup.backupPath)].find(matches);
|
|
305688
305832
|
if (!source) return null;
|
|
305689
305833
|
const recovery = {
|
|
305690
|
-
packagePath:
|
|
305834
|
+
packagePath: canonical2,
|
|
305691
305835
|
sourcePath: source,
|
|
305692
305836
|
version: snapshot.version,
|
|
305693
305837
|
packageHash: snapshot.packageHash,
|
|
305694
|
-
status: source ===
|
|
305838
|
+
status: source === canonical2 ? "unchanged" : "restored"
|
|
305695
305839
|
};
|
|
305696
|
-
if (source ===
|
|
305840
|
+
if (source === canonical2) return recovery;
|
|
305697
305841
|
let partial;
|
|
305698
305842
|
try {
|
|
305699
|
-
partial = await lstat2(
|
|
305843
|
+
partial = await lstat2(canonical2);
|
|
305700
305844
|
assertOwnedDirectory(partial, "failed Omnius replacement");
|
|
305701
305845
|
} catch (error) {
|
|
305702
305846
|
if (error.code !== "ENOENT") throw error;
|
|
305703
305847
|
}
|
|
305704
|
-
if (partial) recovery.partialPath = join17(root, `.omnius-update-recovery-${
|
|
305848
|
+
if (partial) recovery.partialPath = join17(root, `.omnius-update-recovery-${randomUUID4()}`);
|
|
305705
305849
|
await options.onPrepare?.({ ...recovery });
|
|
305706
305850
|
current();
|
|
305707
305851
|
if (!sameIdentity(rootBefore, await lstat2(root)) || !matches(source)) throw new Error("npm recovery identity changed before restoration.");
|
|
305708
305852
|
if (partial) {
|
|
305709
|
-
const now = await lstat2(
|
|
305853
|
+
const now = await lstat2(canonical2);
|
|
305710
305854
|
if (!sameIdentity(partial, now)) throw new Error("Failed Omnius replacement changed before preservation.");
|
|
305711
305855
|
try {
|
|
305712
305856
|
await lstat2(recovery.partialPath);
|
|
@@ -305715,18 +305859,18 @@ async function restoreVerifiedNpmInstallation(snapshot, options) {
|
|
|
305715
305859
|
if (error.code !== "ENOENT") throw error;
|
|
305716
305860
|
}
|
|
305717
305861
|
current();
|
|
305718
|
-
await rename(
|
|
305862
|
+
await rename(canonical2, recovery.partialPath);
|
|
305719
305863
|
}
|
|
305720
305864
|
current();
|
|
305721
305865
|
try {
|
|
305722
|
-
await lstat2(
|
|
305866
|
+
await lstat2(canonical2);
|
|
305723
305867
|
throw new Error("Canonical Omnius path changed before restoration.");
|
|
305724
305868
|
} catch (error) {
|
|
305725
305869
|
if (error.code !== "ENOENT") throw error;
|
|
305726
305870
|
}
|
|
305727
305871
|
if (!matches(source)) throw new Error("Prior Omnius runtime changed before restoration.");
|
|
305728
305872
|
current();
|
|
305729
|
-
await rename(source,
|
|
305873
|
+
await rename(source, canonical2);
|
|
305730
305874
|
if (process.platform !== "win32") {
|
|
305731
305875
|
const fd = openSync3(root, constants2.O_RDONLY);
|
|
305732
305876
|
try {
|
|
@@ -305736,8 +305880,8 @@ async function restoreVerifiedNpmInstallation(snapshot, options) {
|
|
|
305736
305880
|
}
|
|
305737
305881
|
}
|
|
305738
305882
|
current();
|
|
305739
|
-
if (!matches(
|
|
305740
|
-
if (process.platform !== "win32") await chmod(
|
|
305883
|
+
if (!matches(canonical2)) throw new Error("Restored Omnius runtime failed identity verification.");
|
|
305884
|
+
if (process.platform !== "win32") await chmod(canonical2, snapshot.mode);
|
|
305741
305885
|
return recovery;
|
|
305742
305886
|
}
|
|
305743
305887
|
async function removeVerifiedNpmRetirementBackup(backup) {
|
|
@@ -305888,7 +306032,7 @@ function guardOwnerIsProvablyDead(owner) {
|
|
|
305888
306032
|
function recoverInterruptedUpdateGuard(path3) {
|
|
305889
306033
|
const initial = interruptedGuardSnapshot(path3);
|
|
305890
306034
|
if (!initial || !guardOwnerIsProvablyDead(initial.owner)) return false;
|
|
305891
|
-
const recoveryPath = path3 + ".recovery", nonce =
|
|
306035
|
+
const recoveryPath = path3 + ".recovery", nonce = randomUUID5();
|
|
305892
306036
|
let fd;
|
|
305893
306037
|
try {
|
|
305894
306038
|
fd = openSync4(recoveryPath, constants3.O_WRONLY | constants3.O_CREAT | constants3.O_EXCL | constants3.O_NOFOLLOW, 384);
|
|
@@ -305921,7 +306065,7 @@ function recoverInterruptedUpdateGuard(path3) {
|
|
|
305921
306065
|
}
|
|
305922
306066
|
function withUpdateOwnership(paths, mutation) {
|
|
305923
306067
|
ensurePrivateDirectories(paths);
|
|
305924
|
-
const path3 = paths.lockFile + ".guard", nonce =
|
|
306068
|
+
const path3 = paths.lockFile + ".guard", nonce = randomUUID5();
|
|
305925
306069
|
let fd;
|
|
305926
306070
|
try {
|
|
305927
306071
|
fd = openSync4(path3, constants3.O_WRONLY | constants3.O_CREAT | constants3.O_EXCL | constants3.O_NOFOLLOW, 384);
|
|
@@ -306002,7 +306146,7 @@ function releaseMatchingUpdateLock(paths, operationId, pid) {
|
|
|
306002
306146
|
if (lock?.operation_id === operationId && (pid === void 0 || lock.pid === pid)) unlinkSync4(paths.lockFile);
|
|
306003
306147
|
}
|
|
306004
306148
|
function atomicPrivateJson(path3, value) {
|
|
306005
|
-
const temp = `${path3}.${process.pid}.${
|
|
306149
|
+
const temp = `${path3}.${process.pid}.${randomUUID5()}.tmp`;
|
|
306006
306150
|
try {
|
|
306007
306151
|
writeFileSync6(temp, `${JSON.stringify(value, null, 2)}
|
|
306008
306152
|
`, {
|
|
@@ -306207,7 +306351,7 @@ async function inspectGlobalOmniusInstall(expectedVersion, options = {}) {
|
|
|
306207
306351
|
throw new Error(`Global package verification failed: expected ${expectedVersion}, found ${installedVersion || "unknown"}`);
|
|
306208
306352
|
}
|
|
306209
306353
|
const runtime = inspectNpmRuntimeInstallation(dirname10(packageJsonPath));
|
|
306210
|
-
if (runtime.packageHash !==
|
|
306354
|
+
if (runtime.packageHash !== createHash5("sha256").update(packageJsonRaw).digest("hex"))
|
|
306211
306355
|
throw new Error("Global Omnius manifest changed during runtime verification");
|
|
306212
306356
|
const executablePath = globalExecutableCandidates(npmPrefix).find(existsSync8);
|
|
306213
306357
|
if (!executablePath) throw new Error(`Global Omnius executable not found under ${npmPrefix}`);
|
|
@@ -306226,7 +306370,7 @@ ${versionResult.stderr}`) ?? "";
|
|
|
306226
306370
|
executablePath,
|
|
306227
306371
|
installedVersion,
|
|
306228
306372
|
executableVersion,
|
|
306229
|
-
packageHash:
|
|
306373
|
+
packageHash: createHash5("sha256").update(packageJsonRaw).digest("hex")
|
|
306230
306374
|
};
|
|
306231
306375
|
}
|
|
306232
306376
|
function transitionOnce(current, patch, paths) {
|