voidmachine 7.0.1 → 7.0.2
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/core-assets/.claude-plugin/plugin.json +2 -2
- package/core-assets/codex/hooks.json +1 -1
- package/core-assets/data/catalog.v3.json +6 -6
- package/core-assets/data/certification.json +1 -1
- package/core-assets/data/model.json +5 -5
- package/core-assets/hooks/_void-hook.mjs +366 -107
- package/core-assets/skills/void-autopilot/SKILL.md +4 -1
- package/core-assets/skills/void-merge/SKILL.md +22 -15
- package/core-assets/skills/void-verify/references/ci-feedback.md +45 -6
- package/dist/main.js +735 -599
- package/package.json +2 -2
|
@@ -7429,16 +7429,16 @@ init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
|
7429
7429
|
import {
|
|
7430
7430
|
existsSync as existsSync3,
|
|
7431
7431
|
readFileSync as readFileSync5,
|
|
7432
|
-
realpathSync,
|
|
7433
|
-
statSync as
|
|
7432
|
+
realpathSync as realpathSync2,
|
|
7433
|
+
statSync as statSync3
|
|
7434
7434
|
} from "node:fs";
|
|
7435
7435
|
import {
|
|
7436
|
-
basename as
|
|
7436
|
+
basename as basename4,
|
|
7437
7437
|
dirname as dirname2,
|
|
7438
7438
|
isAbsolute as isAbsolute2,
|
|
7439
7439
|
join as join3,
|
|
7440
7440
|
relative as relative2,
|
|
7441
|
-
resolve as
|
|
7441
|
+
resolve as resolve6
|
|
7442
7442
|
} from "node:path";
|
|
7443
7443
|
|
|
7444
7444
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
@@ -7894,6 +7894,10 @@ function isCoOwned(path2) {
|
|
|
7894
7894
|
return CO_OWNED.has(path2);
|
|
7895
7895
|
}
|
|
7896
7896
|
|
|
7897
|
+
function isSecretEnvironment(path2) {
|
|
7898
|
+
const base = basename(path2.replaceAll("\\", "/").toLowerCase());
|
|
7899
|
+
return /^\.env(?:\..+)?$/.test(base) && !/\.(?:example|sample|template|dist)$/.test(base);
|
|
7900
|
+
}
|
|
7897
7901
|
function manifestOwnedPaths(root) {
|
|
7898
7902
|
try {
|
|
7899
7903
|
const parsed = JSON.parse(readFileSync3(resolve2(root, ".void/install-manifest.json"), "utf8"));
|
|
@@ -7923,7 +7927,7 @@ function protectedReason(path2, root, shellWrite) {
|
|
|
7923
7927
|
}
|
|
7924
7928
|
const normalized = path2.replaceAll("\\", "/").toLowerCase();
|
|
7925
7929
|
const base = basename(normalized);
|
|
7926
|
-
if (
|
|
7930
|
+
if (isSecretEnvironment(path2)) {
|
|
7927
7931
|
return "environment file with secrets";
|
|
7928
7932
|
}
|
|
7929
7933
|
if (/\.(?:pem|key|p12|pfx|keystore|jks|asc)$/.test(base) || /^id_(?:rsa|ed25519|ecdsa|dsa)$/.test(base)) {
|
|
@@ -8177,6 +8181,183 @@ function shellWriteTargets(command) {
|
|
|
8177
8181
|
return [...targets].sort();
|
|
8178
8182
|
}
|
|
8179
8183
|
|
|
8184
|
+
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
8185
|
+
import { basename as basename2 } from "node:path";
|
|
8186
|
+
function isShellTool(tool) {
|
|
8187
|
+
return ["Bash", "shell", "shell_command", "exec_command"].includes(tool);
|
|
8188
|
+
}
|
|
8189
|
+
function words(command) {
|
|
8190
|
+
return (command.match(/(?:"(?:\\.|[^"\\])*"|'[^']*'|\\.|[^\s;|&<>"'\\])+|[;|&<>]+|\n/g) ?? []).map((word) => ({
|
|
8191
|
+
control: /^[;|&<>]+$|^\n$/.test(word),
|
|
8192
|
+
value: word.replace(
|
|
8193
|
+
/"((?:\\.|[^"\\])*)"|'([^']*)'|\\(.)/g,
|
|
8194
|
+
(_match, double, single, escaped) => double ?? single ?? escaped ?? ""
|
|
8195
|
+
)
|
|
8196
|
+
}));
|
|
8197
|
+
}
|
|
8198
|
+
var READERS = /* @__PURE__ */ new Set(["cat", "head", "tail", "sed", "grep", "rg"]);
|
|
8199
|
+
var VALUE_OPTIONS = {
|
|
8200
|
+
head: ["-n", "-c", "--lines", "--bytes"],
|
|
8201
|
+
tail: ["-n", "-c", "--lines", "--bytes"],
|
|
8202
|
+
grep: [
|
|
8203
|
+
"-A",
|
|
8204
|
+
"-B",
|
|
8205
|
+
"-C",
|
|
8206
|
+
"--after-context",
|
|
8207
|
+
"--before-context",
|
|
8208
|
+
"--context",
|
|
8209
|
+
"-m",
|
|
8210
|
+
"--max-count",
|
|
8211
|
+
"--exclude-dir",
|
|
8212
|
+
"-d",
|
|
8213
|
+
"--directories"
|
|
8214
|
+
],
|
|
8215
|
+
rg: [
|
|
8216
|
+
"-A",
|
|
8217
|
+
"-B",
|
|
8218
|
+
"-C",
|
|
8219
|
+
"--after-context",
|
|
8220
|
+
"--before-context",
|
|
8221
|
+
"--context",
|
|
8222
|
+
"-m",
|
|
8223
|
+
"--max-count",
|
|
8224
|
+
"--encoding",
|
|
8225
|
+
"--max-depth",
|
|
8226
|
+
"--maxdepth",
|
|
8227
|
+
"-t",
|
|
8228
|
+
"--type",
|
|
8229
|
+
"-T",
|
|
8230
|
+
"--type-not",
|
|
8231
|
+
"--color",
|
|
8232
|
+
"--colors"
|
|
8233
|
+
]
|
|
8234
|
+
};
|
|
8235
|
+
function readArguments(command, args) {
|
|
8236
|
+
if (command === "rg" && args.includes("--files")) {
|
|
8237
|
+
return { paths: [], unsafeSearch: false, searchPaths: [] };
|
|
8238
|
+
}
|
|
8239
|
+
const paths = [];
|
|
8240
|
+
const searchPaths = [];
|
|
8241
|
+
const patternReader = ["grep", "rg", "sed"].includes(command);
|
|
8242
|
+
let pattern2 = !patternReader;
|
|
8243
|
+
let options = true;
|
|
8244
|
+
let hidden = false;
|
|
8245
|
+
let excluded = false;
|
|
8246
|
+
let followsLinks = false;
|
|
8247
|
+
let unrestricted = 0;
|
|
8248
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
8249
|
+
const arg = args[i] ?? "";
|
|
8250
|
+
if (options && arg === "--") {
|
|
8251
|
+
options = false;
|
|
8252
|
+
continue;
|
|
8253
|
+
}
|
|
8254
|
+
if (options && arg.startsWith("-")) {
|
|
8255
|
+
const [flag = "", attached] = arg.split(/=(.*)/s);
|
|
8256
|
+
const value = attached ?? args[i + 1] ?? "";
|
|
8257
|
+
if (command === "rg" && (flag === "--follow" || /^-[^-]*L/.test(flag))) followsLinks = true;
|
|
8258
|
+
if (command === "grep" && (flag === "--dereference-recursive" || /^-[^-]*R/.test(flag))) {
|
|
8259
|
+
followsLinks = true;
|
|
8260
|
+
}
|
|
8261
|
+
if (patternReader && ["-e", "--regexp", "--expression"].includes(flag)) {
|
|
8262
|
+
pattern2 = true;
|
|
8263
|
+
if (attached === void 0) i += 1;
|
|
8264
|
+
} else if (patternReader && ["-f", "--file"].includes(flag)) {
|
|
8265
|
+
paths.push(value);
|
|
8266
|
+
pattern2 = true;
|
|
8267
|
+
if (attached === void 0) i += 1;
|
|
8268
|
+
} else if (["-g", "--glob", "--iglob", "--exclude", "--include"].includes(flag)) {
|
|
8269
|
+
if (flag === "--exclude") excluded ||= value === ".env*";
|
|
8270
|
+
else {
|
|
8271
|
+
if (!value.startsWith("!")) {
|
|
8272
|
+
paths.push(value);
|
|
8273
|
+
hidden = true;
|
|
8274
|
+
excluded = false;
|
|
8275
|
+
}
|
|
8276
|
+
if (value === "!.env*") excluded = true;
|
|
8277
|
+
}
|
|
8278
|
+
if (attached === void 0) i += 1;
|
|
8279
|
+
} else if (command === "rg" && (flag === "--hidden" || /^-[^-]*u/.test(flag))) {
|
|
8280
|
+
unrestricted += [...flag].filter((letter) => letter === "u").length;
|
|
8281
|
+
hidden ||= flag === "--hidden" || unrestricted >= 2;
|
|
8282
|
+
} else if (command === "grep" && (flag === "--recursive" || /^-[^-]*[rR]/.test(flag) || ["-d", "--directories"].includes(flag) && value === "recurse")) {
|
|
8283
|
+
hidden = true;
|
|
8284
|
+
if (flag === "-d" || flag === "--directories" && attached === void 0) i += 1;
|
|
8285
|
+
} else if (VALUE_OPTIONS[command]?.includes(flag)) {
|
|
8286
|
+
if (attached === void 0) i += 1;
|
|
8287
|
+
} else if (patternReader && /^-(?:e|f|g).+/.test(flag)) {
|
|
8288
|
+
const value2 = flag.slice(2);
|
|
8289
|
+
if (flag[1] === "f") {
|
|
8290
|
+
paths.push(value2);
|
|
8291
|
+
pattern2 = true;
|
|
8292
|
+
}
|
|
8293
|
+
if (flag[1] === "e") pattern2 = true;
|
|
8294
|
+
if (flag[1] === "g") {
|
|
8295
|
+
if (!value2.startsWith("!")) {
|
|
8296
|
+
paths.push(value2);
|
|
8297
|
+
hidden = true;
|
|
8298
|
+
excluded = false;
|
|
8299
|
+
}
|
|
8300
|
+
if (value2 === "!.env*") excluded = true;
|
|
8301
|
+
}
|
|
8302
|
+
}
|
|
8303
|
+
continue;
|
|
8304
|
+
}
|
|
8305
|
+
if (!pattern2) {
|
|
8306
|
+
pattern2 = true;
|
|
8307
|
+
continue;
|
|
8308
|
+
}
|
|
8309
|
+
if (arg !== "-") {
|
|
8310
|
+
paths.push(arg);
|
|
8311
|
+
searchPaths.push(arg);
|
|
8312
|
+
}
|
|
8313
|
+
}
|
|
8314
|
+
const unsafeSearch = hidden && !excluded || followsLinks;
|
|
8315
|
+
return { paths, unsafeSearch, searchPaths: unsafeSearch ? searchPaths.length ? searchPaths : ["."] : [] };
|
|
8316
|
+
}
|
|
8317
|
+
function shellReadTargets(command) {
|
|
8318
|
+
const paths = [];
|
|
8319
|
+
const searchPaths = [];
|
|
8320
|
+
let unsafeSearch = false;
|
|
8321
|
+
let segment2 = [];
|
|
8322
|
+
const inspect = () => {
|
|
8323
|
+
const name = basename2(segment2[0] ?? "");
|
|
8324
|
+
if (READERS.has(name)) {
|
|
8325
|
+
const read = readArguments(name, segment2.slice(1));
|
|
8326
|
+
paths.push(...read.paths);
|
|
8327
|
+
searchPaths.push(...read.searchPaths);
|
|
8328
|
+
unsafeSearch ||= read.unsafeSearch;
|
|
8329
|
+
}
|
|
8330
|
+
segment2 = [];
|
|
8331
|
+
};
|
|
8332
|
+
const tokens = words(command);
|
|
8333
|
+
for (let i = 0; i < tokens.length; i += 1) {
|
|
8334
|
+
const word = tokens[i];
|
|
8335
|
+
if (word === void 0) continue;
|
|
8336
|
+
const token = word.value;
|
|
8337
|
+
if (!word.control) {
|
|
8338
|
+
segment2.push(token);
|
|
8339
|
+
continue;
|
|
8340
|
+
}
|
|
8341
|
+
if (/^[;|&]+$|^\n$/.test(token)) {
|
|
8342
|
+
inspect();
|
|
8343
|
+
continue;
|
|
8344
|
+
}
|
|
8345
|
+
if (token === "<") {
|
|
8346
|
+
paths.push(tokens[i + 1]?.value ?? "");
|
|
8347
|
+
i += 1;
|
|
8348
|
+
continue;
|
|
8349
|
+
}
|
|
8350
|
+
if (/^[<>]+$/.test(token)) {
|
|
8351
|
+
i += 1;
|
|
8352
|
+
continue;
|
|
8353
|
+
}
|
|
8354
|
+
segment2.push(token);
|
|
8355
|
+
}
|
|
8356
|
+
inspect();
|
|
8357
|
+
return { paths, unsafeSearch, searchPaths };
|
|
8358
|
+
}
|
|
8359
|
+
|
|
8360
|
+
import { resolve as resolve3 } from "node:path";
|
|
8180
8361
|
var MAX_FIELD_BYTES = 1024 * 1024;
|
|
8181
8362
|
function record(value) {
|
|
8182
8363
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
@@ -8235,7 +8416,7 @@ function normalizeToolCall(value, contentLimit = MAX_FIELD_BYTES) {
|
|
|
8235
8416
|
if (raw === void 0) throw new Error("invalid hook input: expected object");
|
|
8236
8417
|
const input = record(raw["tool_input"]) ?? {};
|
|
8237
8418
|
const tool = safeString(raw["tool_name"], "tool_name");
|
|
8238
|
-
const command = commandText(input["command"]);
|
|
8419
|
+
const command = commandText(input["command"] ?? input["cmd"]);
|
|
8239
8420
|
const file = safeString(input["file_path"] ?? input["path"], "file_path");
|
|
8240
8421
|
let edits;
|
|
8241
8422
|
if (file !== "") {
|
|
@@ -8249,12 +8430,77 @@ function normalizeToolCall(value, contentLimit = MAX_FIELD_BYTES) {
|
|
|
8249
8430
|
const shellTargets = shellWriteTargets(command).filter((path2) => !edits.some((edit) => edit.path === path2)).map((path2) => ({ path: path2, addedContent: "" }));
|
|
8250
8431
|
return { tool, command, edits: [...edits, ...shellTargets] };
|
|
8251
8432
|
}
|
|
8433
|
+
function normalizeReadCall(value, root) {
|
|
8434
|
+
const raw = record(value) ?? {};
|
|
8435
|
+
const input = record(raw["tool_input"]) ?? {};
|
|
8436
|
+
const tool = safeString(raw["tool_name"], "tool_name");
|
|
8437
|
+
const cwd = resolve3(
|
|
8438
|
+
root,
|
|
8439
|
+
safeString(raw["cwd"], "cwd") || root,
|
|
8440
|
+
safeString(input["workdir"] ?? input["cwd"], "workdir") || "."
|
|
8441
|
+
);
|
|
8442
|
+
if (isShellTool(tool)) {
|
|
8443
|
+
return { ...shellReadTargets(commandText(input["command"] ?? input["cmd"])), cwd };
|
|
8444
|
+
}
|
|
8445
|
+
const paths = [];
|
|
8446
|
+
let unsafeSearch = false;
|
|
8447
|
+
if (["Read", "read_file", "Grep"].includes(tool)) {
|
|
8448
|
+
const path2 = safeString(input["file_path"] ?? input["path"], "read path");
|
|
8449
|
+
if (path2 !== "") paths.push(path2);
|
|
8450
|
+
if (tool === "Grep") {
|
|
8451
|
+
const glob = safeString(input["glob"], "read glob");
|
|
8452
|
+
if (glob !== "" && !glob.startsWith("!")) {
|
|
8453
|
+
paths.push(glob);
|
|
8454
|
+
unsafeSearch = true;
|
|
8455
|
+
}
|
|
8456
|
+
}
|
|
8457
|
+
}
|
|
8458
|
+
return { paths, unsafeSearch, searchPaths: unsafeSearch ? [paths[0] ?? "."] : [], cwd };
|
|
8459
|
+
}
|
|
8460
|
+
|
|
8461
|
+
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
8462
|
+
import { realpathSync, statSync } from "node:fs";
|
|
8463
|
+
import { basename as basename3, resolve as resolve4 } from "node:path";
|
|
8464
|
+
function secretTarget(path2) {
|
|
8465
|
+
return isSecretEnvironment(path2) || /^\.env[^/]*[*?{[]/i.test(basename3(path2.replaceAll("\\", "/")));
|
|
8466
|
+
}
|
|
8467
|
+
function regularFile(path2, cwd) {
|
|
8468
|
+
try {
|
|
8469
|
+
return statSync(resolve4(cwd, path2)).isFile();
|
|
8470
|
+
} catch {
|
|
8471
|
+
return false;
|
|
8472
|
+
}
|
|
8473
|
+
}
|
|
8474
|
+
function secretRead(reads, cwd) {
|
|
8475
|
+
if (reads.paths.length + reads.searchPaths.length > 128) {
|
|
8476
|
+
return block("SECRET_READ_SCOPE", "too many read targets to check; split the operation", []);
|
|
8477
|
+
}
|
|
8478
|
+
for (const path2 of reads.paths) {
|
|
8479
|
+
let physical = path2;
|
|
8480
|
+
try {
|
|
8481
|
+
physical = realpathSync(resolve4(cwd, path2));
|
|
8482
|
+
} catch {
|
|
8483
|
+
}
|
|
8484
|
+
if (secretTarget(path2) || secretTarget(physical)) {
|
|
8485
|
+
return block(
|
|
8486
|
+
"SECRET_FILE_READ",
|
|
8487
|
+
"refusing to read a secret environment file; use a safe example or non-sensitive metadata",
|
|
8488
|
+
[]
|
|
8489
|
+
);
|
|
8490
|
+
}
|
|
8491
|
+
}
|
|
8492
|
+
return reads.unsafeSearch && !reads.searchPaths.every((path2) => regularFile(path2, cwd)) ? block(
|
|
8493
|
+
"SECRET_READ_SCOPE",
|
|
8494
|
+
"search can include secret environment files; use explicit files or exclude .env* from traversal",
|
|
8495
|
+
[]
|
|
8496
|
+
) : allow();
|
|
8497
|
+
}
|
|
8252
8498
|
|
|
8253
8499
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
8254
8500
|
import { closeSync, constants, fstatSync, openSync, readSync } from "node:fs";
|
|
8255
8501
|
|
|
8256
8502
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
8257
|
-
import { resolve as
|
|
8503
|
+
import { resolve as resolve5 } from "node:path";
|
|
8258
8504
|
var MAX_SOURCE_BYTES = 65536;
|
|
8259
8505
|
var unresolved = (reason) => ({ kind: "unresolved", reason });
|
|
8260
8506
|
function object(value) {
|
|
@@ -8329,7 +8575,7 @@ function fromPatch(patch, root, target, existing) {
|
|
|
8329
8575
|
for (const line of lines) {
|
|
8330
8576
|
const header = /^\*\*\* (Add|Update|Delete) File: (.+)$/.exec(line);
|
|
8331
8577
|
if (header !== null) {
|
|
8332
|
-
active =
|
|
8578
|
+
active = resolve5(root, header[2] ?? "") === target ? { kind: header[1] ?? "", lines: [] } : void 0;
|
|
8333
8579
|
if (active !== void 0) sections.push(active);
|
|
8334
8580
|
} else if (line === "*** End Patch") {
|
|
8335
8581
|
active = void 0;
|
|
@@ -8355,7 +8601,7 @@ function proposedSource(raw, root, path2, existing) {
|
|
|
8355
8601
|
for (const key of ["patch", "input", "content", "command"]) {
|
|
8356
8602
|
const value = input[key];
|
|
8357
8603
|
if (typeof value === "string" && value.includes("*** Begin Patch")) {
|
|
8358
|
-
return fromPatch(value, root,
|
|
8604
|
+
return fromPatch(value, root, resolve5(root, path2), existing);
|
|
8359
8605
|
}
|
|
8360
8606
|
}
|
|
8361
8607
|
return unresolved("tool input does not describe a reconstructable file");
|
|
@@ -8402,7 +8648,7 @@ init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
|
8402
8648
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
8403
8649
|
import { spawnSync } from "node:child_process";
|
|
8404
8650
|
import { createHash } from "node:crypto";
|
|
8405
|
-
import { readFileSync as readFileSync4, statSync } from "node:fs";
|
|
8651
|
+
import { readFileSync as readFileSync4, statSync as statSync2 } from "node:fs";
|
|
8406
8652
|
import { fileURLToPath } from "node:url";
|
|
8407
8653
|
|
|
8408
8654
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
@@ -8413,7 +8659,7 @@ function runSyntaxWorker(root, input, remainingMs) {
|
|
|
8413
8659
|
const worker = fileURLToPath(new URL(true ? "./_syntax-worker.cjs" : "../../../core/hooks/_syntax-worker.cjs", import.meta.url));
|
|
8414
8660
|
const identity2 = typeof define_VOID_SYNTAX_WORKER_IDENTITY_default === "object" ? define_VOID_SYNTAX_WORKER_IDENTITY_default : SYNTAX_WORKER_IDENTITY;
|
|
8415
8661
|
try {
|
|
8416
|
-
if (identity2.bytes > 8 * 1024 * 1024 ||
|
|
8662
|
+
if (identity2.bytes > 8 * 1024 * 1024 || statSync2(worker).size !== identity2.bytes || createHash("sha256").update(readFileSync4(worker)).digest("hex") !== identity2.sha256) {
|
|
8417
8663
|
return { version: 1, kind: "unavailable" };
|
|
8418
8664
|
}
|
|
8419
8665
|
const timeout = Math.min(SYNTAX_OPERATION_BUDGET_MS, remainingMs) - (performance.now() - started);
|
|
@@ -8655,16 +8901,16 @@ function parseHookPayload(input) {
|
|
|
8655
8901
|
return parsed;
|
|
8656
8902
|
}
|
|
8657
8903
|
function physicalPath(path2) {
|
|
8658
|
-
const absolute =
|
|
8904
|
+
const absolute = resolve6(path2);
|
|
8659
8905
|
let existing = absolute;
|
|
8660
8906
|
const suffix = [];
|
|
8661
8907
|
while (true) {
|
|
8662
8908
|
try {
|
|
8663
|
-
return join3(
|
|
8909
|
+
return join3(realpathSync2(existing), ...suffix);
|
|
8664
8910
|
} catch {
|
|
8665
8911
|
const parent = dirname2(existing);
|
|
8666
8912
|
if (parent === existing) return absolute;
|
|
8667
|
-
suffix.unshift(
|
|
8913
|
+
suffix.unshift(basename4(existing));
|
|
8668
8914
|
existing = parent;
|
|
8669
8915
|
}
|
|
8670
8916
|
}
|
|
@@ -8682,7 +8928,7 @@ function discoverProjectRoot(start) {
|
|
|
8682
8928
|
}
|
|
8683
8929
|
function projectRelativePath(root, path2) {
|
|
8684
8930
|
const physicalRoot = physicalPath(root);
|
|
8685
|
-
const absolute = physicalPath(isAbsolute2(path2) ? path2 :
|
|
8931
|
+
const absolute = physicalPath(isAbsolute2(path2) ? path2 : resolve6(physicalRoot, path2));
|
|
8686
8932
|
const projectPath2 = relative2(physicalRoot, absolute).replaceAll("\\", "/");
|
|
8687
8933
|
return projectPath2 === ".." || projectPath2.startsWith("../") || isAbsolute2(projectPath2) ? void 0 : projectPath2;
|
|
8688
8934
|
}
|
|
@@ -8706,8 +8952,16 @@ function configuredStrings(parent, key, fallback) {
|
|
|
8706
8952
|
const kept = value.filter((entry) => typeof entry === "string");
|
|
8707
8953
|
if (kept.length > 0) return kept;
|
|
8708
8954
|
}
|
|
8709
|
-
return [fallback];
|
|
8955
|
+
return typeof fallback === "string" ? [fallback] : [...fallback];
|
|
8710
8956
|
}
|
|
8957
|
+
var DEFAULT_PROJECT_PATHS = {
|
|
8958
|
+
business: ["src/**", "apps/*/src/**"],
|
|
8959
|
+
tests: ["src/**/*.test.{ts,tsx}", "apps/*/src/**/*.test.{ts,tsx}"],
|
|
8960
|
+
spikes: ["scripts/spike-*", "apps/*/scripts/spike-*"],
|
|
8961
|
+
serverActions: ["src/app/(api|actions)/**", "apps/*/src/app/(api|actions)/**"],
|
|
8962
|
+
contracts: ["src/lib/contracts/**", "apps/*/src/lib/contracts/**"],
|
|
8963
|
+
e2e: ["tests/e2e/**", "apps/*/tests/e2e/**"]
|
|
8964
|
+
};
|
|
8711
8965
|
function readTddConfig(root) {
|
|
8712
8966
|
let config2 = {};
|
|
8713
8967
|
try {
|
|
@@ -8720,8 +8974,8 @@ function readTddConfig(root) {
|
|
|
8720
8974
|
const mode = configuredMode === "strict" || configuredMode === "souple" || configuredMode === "exploratory" ? configuredMode : "auto";
|
|
8721
8975
|
return {
|
|
8722
8976
|
mode,
|
|
8723
|
-
businessGlobs: configuredStrings(paths, "business",
|
|
8724
|
-
|
|
8977
|
+
businessGlobs: configuredStrings(paths, "business", DEFAULT_PROJECT_PATHS.business),
|
|
8978
|
+
spikeGlobs: configuredStrings(paths, "spikes", DEFAULT_PROJECT_PATHS.spikes)
|
|
8725
8979
|
};
|
|
8726
8980
|
}
|
|
8727
8981
|
function focusedVerdict(root, edits, raw, syntaxInspector) {
|
|
@@ -8762,9 +9016,9 @@ function declaredTest(root, content) {
|
|
|
8762
9016
|
const match = /^\/\/ tdd-cover: e2e (.+)$/.exec(lines[0] ?? "");
|
|
8763
9017
|
const path2 = match?.[1];
|
|
8764
9018
|
if (path2 === void 0 || path2 !== path2.trim() || isAbsolute2(path2) || /^[A-Za-z]:|\\/.test(path2) || path2.split("/").some((part) => part === ".." || part === ".") || !isTestPath(path2)) throw new Error("declare exactly one project-relative E2E spec on the first line");
|
|
8765
|
-
const target =
|
|
9019
|
+
const target = realpathSync2(join3(root, path2));
|
|
8766
9020
|
const location = relative2(root, target);
|
|
8767
|
-
if (location.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || location === ".." || isAbsolute2(location) || !
|
|
9021
|
+
if (location.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || location === ".." || isAbsolute2(location) || !statSync3(target).isFile()) {
|
|
8768
9022
|
throw new Error("E2E spec must be a regular file inside the physical project root");
|
|
8769
9023
|
}
|
|
8770
9024
|
return path2;
|
|
@@ -8787,7 +9041,7 @@ function tddVerdict(root, edits, raw, checkedOut, syntaxInspector) {
|
|
|
8787
9041
|
const declaredTests = {};
|
|
8788
9042
|
const proposedSources = {};
|
|
8789
9043
|
const deadline = performance.now() + SYNTAX_OPERATION_BUDGET_MS;
|
|
8790
|
-
const governed = projectChanges.filter((edit) => !(edit.operation === "delete" && edit.addedContent === "") && tddApplies(edit.path, config2.businessGlobs,
|
|
9044
|
+
const governed = projectChanges.filter((edit) => !(edit.operation === "delete" && edit.addedContent === "") && tddApplies(edit.path, config2.businessGlobs, config2.spikeGlobs));
|
|
8791
9045
|
if (governed.length > 32) return tddOperationLimit("operation exceeds 32 governed production files");
|
|
8792
9046
|
if (new Set(governed.map((edit) => edit.path)).size !== governed.length) {
|
|
8793
9047
|
return tddOperationLimit("patch must name each physical file exactly once");
|
|
@@ -8860,7 +9114,7 @@ function tddVerdict(root, edits, raw, checkedOut, syntaxInspector) {
|
|
|
8860
9114
|
edits: projectChanges,
|
|
8861
9115
|
mode: config2.mode,
|
|
8862
9116
|
businessGlobs: config2.businessGlobs,
|
|
8863
|
-
spikeGlobs:
|
|
9117
|
+
spikeGlobs: config2.spikeGlobs,
|
|
8864
9118
|
existingHeaders,
|
|
8865
9119
|
originalSources,
|
|
8866
9120
|
siblingTests,
|
|
@@ -8875,6 +9129,11 @@ function evaluateRule(rule, rawInput, options) {
|
|
|
8875
9129
|
options.source === "checked-out" ? MAX_CI_CONTENT_BYTES : MAX_HOOK_INPUT_BYTES
|
|
8876
9130
|
);
|
|
8877
9131
|
const env = options.env ?? process.env;
|
|
9132
|
+
if (rule === "protected-file" && options.source !== "checked-out") {
|
|
9133
|
+
const reads = normalizeReadCall(rawInput, options.root);
|
|
9134
|
+
const verdict = secretRead(reads, reads.cwd);
|
|
9135
|
+
if (!verdict.allow) return verdict;
|
|
9136
|
+
}
|
|
8878
9137
|
if (rule === "dangerous-command") {
|
|
8879
9138
|
if (call.tool !== "Bash" && call.tool !== "shell") return allow();
|
|
8880
9139
|
if (productSetting(env, "ALLOW_DANGEROUS") === "1") return allow("OVERRIDE", "one-shot override");
|
|
@@ -9102,12 +9361,12 @@ async function fetchLatestVersion(options = {}) {
|
|
|
9102
9361
|
}
|
|
9103
9362
|
|
|
9104
9363
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
9105
|
-
import { readFileSync as readFileSync7, statSync as
|
|
9364
|
+
import { readFileSync as readFileSync7, statSync as statSync4 } from "node:fs";
|
|
9106
9365
|
import { join as join5 } from "node:path";
|
|
9107
9366
|
var MAX_NPMRC_BYTES = 64 * 1024;
|
|
9108
9367
|
function readIfSmall(path2) {
|
|
9109
9368
|
try {
|
|
9110
|
-
if (
|
|
9369
|
+
if (statSync4(path2).size > MAX_NPMRC_BYTES) return void 0;
|
|
9111
9370
|
return readFileSync7(path2, "utf8");
|
|
9112
9371
|
} catch {
|
|
9113
9372
|
return void 0;
|
|
@@ -9150,7 +9409,7 @@ import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as rea
|
|
|
9150
9409
|
import { dirname as dirname4, join as join8 } from "node:path";
|
|
9151
9410
|
|
|
9152
9411
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
9153
|
-
import { lstatSync, readFileSync as readFileSync8, readdirSync, statSync as
|
|
9412
|
+
import { lstatSync, readFileSync as readFileSync8, readdirSync, statSync as statSync5 } from "node:fs";
|
|
9154
9413
|
import { join as join7 } from "node:path";
|
|
9155
9414
|
|
|
9156
9415
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
@@ -9295,7 +9554,7 @@ function voidReadPath(root, ...segments2) {
|
|
|
9295
9554
|
var MISSION_DIRECTORY = /^mis_[A-Za-z0-9_-]{8,100}$/;
|
|
9296
9555
|
var MAX_MISSION_LOGS = 1e4;
|
|
9297
9556
|
var MAX_JOURNAL_BYTES = 64 * 1024 * 1024;
|
|
9298
|
-
function
|
|
9557
|
+
function regularFile2(path2) {
|
|
9299
9558
|
try {
|
|
9300
9559
|
const info = lstatSync(path2);
|
|
9301
9560
|
return info.isFile() && !info.isSymbolicLink();
|
|
@@ -9318,9 +9577,9 @@ function journalFiles(root) {
|
|
|
9318
9577
|
for (const runs of locations) {
|
|
9319
9578
|
for (const entry of missionEntries(runs)) {
|
|
9320
9579
|
const path2 = join7(runs, entry.name, "events.jsonl");
|
|
9321
|
-
if (!
|
|
9580
|
+
if (!regularFile2(path2)) continue;
|
|
9322
9581
|
try {
|
|
9323
|
-
const info =
|
|
9582
|
+
const info = statSync5(path2);
|
|
9324
9583
|
files.push({ path: path2, modifiedMs: info.mtimeMs, bytes: info.size });
|
|
9325
9584
|
} catch {
|
|
9326
9585
|
}
|
|
@@ -9685,14 +9944,14 @@ import {
|
|
|
9685
9944
|
mkdirSync as mkdirSync3,
|
|
9686
9945
|
openSync as openSync2,
|
|
9687
9946
|
readSync as readSync2,
|
|
9688
|
-
realpathSync as
|
|
9947
|
+
realpathSync as realpathSync4,
|
|
9689
9948
|
renameSync as renameSync3,
|
|
9690
|
-
statSync as
|
|
9949
|
+
statSync as statSync6,
|
|
9691
9950
|
unlinkSync,
|
|
9692
9951
|
writeSync
|
|
9693
9952
|
} from "node:fs";
|
|
9694
9953
|
import { homedir } from "node:os";
|
|
9695
|
-
import { basename as
|
|
9954
|
+
import { basename as basename5, isAbsolute as isAbsolute4, join as join10, relative as relative4, resolve as resolve7 } from "node:path";
|
|
9696
9955
|
|
|
9697
9956
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
9698
9957
|
|
|
@@ -10327,7 +10586,7 @@ import {
|
|
|
10327
10586
|
constants as constants2,
|
|
10328
10587
|
lstatSync as lstatSync2,
|
|
10329
10588
|
readFileSync as readFileSync10,
|
|
10330
|
-
realpathSync as
|
|
10589
|
+
realpathSync as realpathSync3
|
|
10331
10590
|
} from "node:fs";
|
|
10332
10591
|
import { delimiter, isAbsolute as isAbsolute3, join as join9, relative as relative3 } from "node:path";
|
|
10333
10592
|
function record3(value) {
|
|
@@ -10368,12 +10627,12 @@ function findExecutable(name, root, env) {
|
|
|
10368
10627
|
return void 0;
|
|
10369
10628
|
}
|
|
10370
10629
|
function safeExistingFiles(paths, root) {
|
|
10371
|
-
const canonicalRoot =
|
|
10630
|
+
const canonicalRoot = realpathSync3(root);
|
|
10372
10631
|
return paths.filter((path2) => {
|
|
10373
10632
|
try {
|
|
10374
10633
|
const info = lstatSync2(path2);
|
|
10375
10634
|
if (!info.isFile() || info.isSymbolicLink()) return false;
|
|
10376
|
-
return within(canonicalRoot,
|
|
10635
|
+
return within(canonicalRoot, realpathSync3(path2));
|
|
10377
10636
|
} catch {
|
|
10378
10637
|
return false;
|
|
10379
10638
|
}
|
|
@@ -10570,7 +10829,7 @@ function claimStaleLock(path2, observed, now) {
|
|
|
10570
10829
|
}
|
|
10571
10830
|
function safeMachineDirectory(root) {
|
|
10572
10831
|
try {
|
|
10573
|
-
const canonicalRoot =
|
|
10832
|
+
const canonicalRoot = realpathSync4(resolve7(root));
|
|
10574
10833
|
let cursor = canonicalRoot;
|
|
10575
10834
|
for (const segment2 of [".void", "machine"]) {
|
|
10576
10835
|
cursor = join10(cursor, segment2);
|
|
@@ -10587,7 +10846,7 @@ function safeMachineDirectory(root) {
|
|
|
10587
10846
|
const created = lstatSync3(cursor);
|
|
10588
10847
|
if (!created.isDirectory() || created.isSymbolicLink()) return void 0;
|
|
10589
10848
|
}
|
|
10590
|
-
const canonical4 =
|
|
10849
|
+
const canonical4 = realpathSync4(cursor);
|
|
10591
10850
|
if (!within(canonicalRoot, canonical4) || canonical4 !== cursor) return void 0;
|
|
10592
10851
|
}
|
|
10593
10852
|
return cursor;
|
|
@@ -10611,8 +10870,8 @@ function anchorMachineDirectory(root) {
|
|
|
10611
10870
|
if (!opened.isDirectory()) return void 0;
|
|
10612
10871
|
process.chdir(directory2);
|
|
10613
10872
|
changedDirectory = true;
|
|
10614
|
-
const current =
|
|
10615
|
-
if (current.dev !== opened.dev || current.ino !== opened.ino ||
|
|
10873
|
+
const current = statSync6(".");
|
|
10874
|
+
if (current.dev !== opened.dev || current.ino !== opened.ino || realpathSync4(".") !== directory2) return void 0;
|
|
10616
10875
|
anchorEstablished = true;
|
|
10617
10876
|
return { descriptor, previousCwd };
|
|
10618
10877
|
} catch {
|
|
@@ -10704,8 +10963,8 @@ function canonicalDirectory(path2) {
|
|
|
10704
10963
|
try {
|
|
10705
10964
|
const info = lstatSync3(path2);
|
|
10706
10965
|
if (!info.isDirectory() || info.isSymbolicLink()) return void 0;
|
|
10707
|
-
const canonical4 =
|
|
10708
|
-
return canonical4 ===
|
|
10966
|
+
const canonical4 = realpathSync4(path2);
|
|
10967
|
+
return canonical4 === resolve7(path2) ? canonical4 : void 0;
|
|
10709
10968
|
} catch {
|
|
10710
10969
|
return void 0;
|
|
10711
10970
|
}
|
|
@@ -10714,7 +10973,7 @@ function encodedClaudeProject(root) {
|
|
|
10714
10973
|
return root.replace(/[^a-zA-Z0-9]/g, "-");
|
|
10715
10974
|
}
|
|
10716
10975
|
function transcriptRoots(root, runtime3) {
|
|
10717
|
-
const canonicalRoot =
|
|
10976
|
+
const canonicalRoot = realpathSync4(resolve7(root));
|
|
10718
10977
|
const candidates = [canonicalRoot];
|
|
10719
10978
|
if (runtime3 === "claude") {
|
|
10720
10979
|
candidates.push(
|
|
@@ -10728,22 +10987,22 @@ function runtimeSessionId(input) {
|
|
|
10728
10987
|
return typeof value === "string" && /^[A-Za-z0-9_-]{8,200}$/.test(value) ? value : void 0;
|
|
10729
10988
|
}
|
|
10730
10989
|
function isExternalTranscriptBound(path2, runtime3, sessionId) {
|
|
10731
|
-
return runtime3 === "claude" && /^[A-Za-z0-9_-]{8,200}$/.test(sessionId) &&
|
|
10990
|
+
return runtime3 === "claude" && /^[A-Za-z0-9_-]{8,200}$/.test(sessionId) && basename5(path2) === `${sessionId}.jsonl`;
|
|
10732
10991
|
}
|
|
10733
10992
|
function openBoundedRegularFile(path2, maxBytes, allowedRoots) {
|
|
10734
10993
|
let descriptor;
|
|
10735
10994
|
try {
|
|
10736
10995
|
const before = lstatSync3(path2);
|
|
10737
10996
|
if (!before.isFile() || before.isSymbolicLink() || before.size > maxBytes) return void 0;
|
|
10738
|
-
const canonicalPath =
|
|
10997
|
+
const canonicalPath = realpathSync4(path2);
|
|
10739
10998
|
if (!allowedRoots.some((root) => within(root, canonicalPath))) return void 0;
|
|
10740
10999
|
descriptor = openSync2(
|
|
10741
11000
|
path2,
|
|
10742
11001
|
constants3.O_RDONLY | constants3.O_NONBLOCK | (constants3.O_NOFOLLOW ?? 0)
|
|
10743
11002
|
);
|
|
10744
11003
|
const opened = fstatSync2(descriptor);
|
|
10745
|
-
const currentPath =
|
|
10746
|
-
const current =
|
|
11004
|
+
const currentPath = realpathSync4(path2);
|
|
11005
|
+
const current = statSync6(currentPath);
|
|
10747
11006
|
if (!opened.isFile() || opened.size > maxBytes || currentPath !== canonicalPath || opened.dev !== current.dev || opened.ino !== current.ino || !allowedRoots.some((root) => within(root, currentPath))) {
|
|
10748
11007
|
closeSync2(descriptor);
|
|
10749
11008
|
return void 0;
|
|
@@ -10792,7 +11051,7 @@ function observeTranscript(path2, state, input, root, runtime3) {
|
|
|
10792
11051
|
const opened = openBoundedRegularFile(path2, Number.MAX_SAFE_INTEGER, roots);
|
|
10793
11052
|
if (opened === void 0) return void 0;
|
|
10794
11053
|
descriptor = opened.descriptor;
|
|
10795
|
-
const canonicalRoot =
|
|
11054
|
+
const canonicalRoot = realpathSync4(resolve7(root));
|
|
10796
11055
|
if (!within(canonicalRoot, opened.canonicalPath)) {
|
|
10797
11056
|
const sessionId = runtimeSessionId(input);
|
|
10798
11057
|
if (sessionId === void 0 || !isExternalTranscriptBound(opened.canonicalPath, runtime3, sessionId)) {
|
|
@@ -10861,7 +11120,7 @@ function observeTranscript(path2, state, input, root, runtime3) {
|
|
|
10861
11120
|
function contextConfig(root) {
|
|
10862
11121
|
let descriptor;
|
|
10863
11122
|
try {
|
|
10864
|
-
const canonicalRoot =
|
|
11123
|
+
const canonicalRoot = realpathSync4(resolve7(root));
|
|
10865
11124
|
const opened = openBoundedRegularFile(
|
|
10866
11125
|
join10(canonicalRoot, ".void", "config.json"),
|
|
10867
11126
|
MAX_CONFIG_BYTES,
|
|
@@ -10989,8 +11248,8 @@ function successfulToolUse(input) {
|
|
|
10989
11248
|
}
|
|
10990
11249
|
function boundedProjectPath(root, candidate) {
|
|
10991
11250
|
if (candidate === "" || candidate.length > 500 || mentionsCheckpointMarker(candidate) || [...candidate].some((character) => character.charCodeAt(0) < 32)) return void 0;
|
|
10992
|
-
const target = isAbsolute4(candidate) ?
|
|
10993
|
-
const local = relative4(
|
|
11251
|
+
const target = isAbsolute4(candidate) ? resolve7(candidate) : resolve7(root, candidate);
|
|
11252
|
+
const local = relative4(resolve7(root), target);
|
|
10994
11253
|
if (local === "" || local.startsWith("..") || isAbsolute4(local)) return void 0;
|
|
10995
11254
|
return local.split("\\").join("/");
|
|
10996
11255
|
}
|
|
@@ -11071,7 +11330,7 @@ function measureHerdrContext(input, root, runtime3, now) {
|
|
|
11071
11330
|
return measureContext(initialState(""), input, root, "UserPromptSubmit", runtime3, now).usagePercent;
|
|
11072
11331
|
}
|
|
11073
11332
|
function executeContextContinuity(rawInput, root, runtime3, now) {
|
|
11074
|
-
const projectRoot2 =
|
|
11333
|
+
const projectRoot2 = resolve7(root);
|
|
11075
11334
|
const input = record3(rawInput);
|
|
11076
11335
|
if (input === void 0) {
|
|
11077
11336
|
return { status: "degraded", details: { reason: "invalid-hook-input" } };
|
|
@@ -11120,12 +11379,12 @@ function resolveInstall(root, env) {
|
|
|
11120
11379
|
|
|
11121
11380
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
11122
11381
|
import { randomUUID } from "node:crypto";
|
|
11123
|
-
import { lstatSync as lstatSync4, mkdirSync as mkdirSync4, readFileSync as readFileSync11, readdirSync as readdirSync3, realpathSync as
|
|
11124
|
-
import { basename as
|
|
11382
|
+
import { lstatSync as lstatSync4, mkdirSync as mkdirSync4, readFileSync as readFileSync11, readdirSync as readdirSync3, realpathSync as realpathSync5, renameSync as renameSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
11383
|
+
import { basename as basename7, dirname as dirname6, isAbsolute as isAbsolute5, join as join13 } from "node:path";
|
|
11125
11384
|
|
|
11126
11385
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
11127
11386
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
11128
|
-
import { basename as
|
|
11387
|
+
import { basename as basename6, dirname as dirname5, join as join12 } from "node:path";
|
|
11129
11388
|
function machineRootOf(cwd) {
|
|
11130
11389
|
const result = spawnSync2(
|
|
11131
11390
|
"git",
|
|
@@ -11133,7 +11392,7 @@ function machineRootOf(cwd) {
|
|
|
11133
11392
|
{ cwd, shell: false, encoding: "utf8", timeout: 5e3 }
|
|
11134
11393
|
);
|
|
11135
11394
|
const common = result.status === 0 ? result.stdout.replace(/\r?\n$/, "") : "";
|
|
11136
|
-
return common !== "" &&
|
|
11395
|
+
return common !== "" && basename6(common) === ".git" ? join12(dirname5(common), ".void", "machine") : void 0;
|
|
11137
11396
|
}
|
|
11138
11397
|
|
|
11139
11398
|
var SESSION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
@@ -11146,25 +11405,25 @@ function claimedPath(root, sessionId) {
|
|
|
11146
11405
|
const claim2 = record3(JSON.parse(readFileSync11(join13(root, "agents", "sessions", `${sessionId}.json`), "utf8")));
|
|
11147
11406
|
const path2 = claim2?.["resultPath"];
|
|
11148
11407
|
if (claim2?.["schemaVersion"] !== 1 || typeof path2 !== "string" || !isAbsolute5(path2)) return void 0;
|
|
11149
|
-
if (path2.length > MAX_CLAIM_BYTES ||
|
|
11408
|
+
if (path2.length > MAX_CLAIM_BYTES || basename7(path2) !== "result.json") return void 0;
|
|
11150
11409
|
const runs = join13(root, "runs");
|
|
11151
11410
|
if (!within(runs, path2) || lstatSync4(dirname6(path2), { throwIfNoEntry: false })?.isDirectory() !== true) {
|
|
11152
11411
|
return void 0;
|
|
11153
11412
|
}
|
|
11154
|
-
return within(
|
|
11413
|
+
return within(realpathSync5(runs), realpathSync5(dirname6(path2))) ? path2 : void 0;
|
|
11155
11414
|
} catch {
|
|
11156
11415
|
return void 0;
|
|
11157
11416
|
}
|
|
11158
11417
|
}
|
|
11159
11418
|
function waitingRun(root, cwd, now) {
|
|
11160
11419
|
try {
|
|
11161
|
-
const here =
|
|
11420
|
+
const here = realpathSync5(cwd);
|
|
11162
11421
|
const directory2 = join13(root, "agents", "pending");
|
|
11163
11422
|
return readdirSync3(directory2).filter((name) => !name.startsWith(".")).slice(0, 64).some((name) => {
|
|
11164
11423
|
const marker = record3(JSON.parse(readFileSync11(join13(directory2, name), "utf8")));
|
|
11165
11424
|
const createdAt = marker?.["createdAt"];
|
|
11166
11425
|
const runCwd = marker?.["cwd"];
|
|
11167
|
-
return typeof createdAt === "number" && now - createdAt < PARKING_WINDOW_MS && typeof runCwd === "string" &&
|
|
11426
|
+
return typeof createdAt === "number" && now - createdAt < PARKING_WINDOW_MS && typeof runCwd === "string" && realpathSync5(runCwd) === here;
|
|
11168
11427
|
});
|
|
11169
11428
|
} catch {
|
|
11170
11429
|
return false;
|
|
@@ -11217,7 +11476,7 @@ init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
|
11217
11476
|
import {
|
|
11218
11477
|
isAbsolute as isAbsolute6,
|
|
11219
11478
|
relative as relative5,
|
|
11220
|
-
resolve as
|
|
11479
|
+
resolve as resolve8
|
|
11221
11480
|
} from "node:path";
|
|
11222
11481
|
var FORMATTABLE = /\.(?:ts|tsx|js|jsx|mjs|cjs|json|jsonc|css)$/;
|
|
11223
11482
|
function within2(root, target) {
|
|
@@ -11225,10 +11484,10 @@ function within2(root, target) {
|
|
|
11225
11484
|
return rel === "" || !rel.startsWith("..") && !isAbsolute6(rel);
|
|
11226
11485
|
}
|
|
11227
11486
|
function formatCandidates(touchedPaths, projectRoot2) {
|
|
11228
|
-
const root =
|
|
11487
|
+
const root = resolve8(projectRoot2);
|
|
11229
11488
|
const found = /* @__PURE__ */ new Set();
|
|
11230
11489
|
for (const touchedPath of touchedPaths) {
|
|
11231
|
-
const target =
|
|
11490
|
+
const target = resolve8(root, touchedPath);
|
|
11232
11491
|
if (touchedPath.trim() !== "" && FORMATTABLE.test(touchedPath.replaceAll("\\", "/")) && within2(root, target)) {
|
|
11233
11492
|
found.add(target);
|
|
11234
11493
|
}
|
|
@@ -11285,7 +11544,7 @@ function executeFormat(rawInput, root, env) {
|
|
|
11285
11544
|
|
|
11286
11545
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
11287
11546
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
11288
|
-
import { realpathSync as
|
|
11547
|
+
import { realpathSync as realpathSync7 } from "node:fs";
|
|
11289
11548
|
import { homedir as homedir2 } from "node:os";
|
|
11290
11549
|
import { join as join15 } from "node:path";
|
|
11291
11550
|
|
|
@@ -13239,8 +13498,8 @@ function proveOwnership(pids, call) {
|
|
|
13239
13498
|
|
|
13240
13499
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
13241
13500
|
import { createHash as createHash4 } from "node:crypto";
|
|
13242
|
-
import { closeSync as closeSync3, constants as constants4, fstatSync as fstatSync3, lstatSync as lstatSync5, opendirSync, openSync as openSync3, readSync as readSync3, realpathSync as
|
|
13243
|
-
import { isAbsolute as isAbsolute8, join as join14, parse as parse2, relative as relative6, resolve as
|
|
13501
|
+
import { closeSync as closeSync3, constants as constants4, fstatSync as fstatSync3, lstatSync as lstatSync5, opendirSync, openSync as openSync3, readSync as readSync3, realpathSync as realpathSync6 } from "node:fs";
|
|
13502
|
+
import { isAbsolute as isAbsolute8, join as join14, parse as parse2, relative as relative6, resolve as resolve9, sep } from "node:path";
|
|
13244
13503
|
|
|
13245
13504
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
13246
13505
|
var import_yaml = __toESM(require_dist(), 1);
|
|
@@ -13348,7 +13607,7 @@ function absent(error) {
|
|
|
13348
13607
|
}
|
|
13349
13608
|
function canonical(path2) {
|
|
13350
13609
|
try {
|
|
13351
|
-
return
|
|
13610
|
+
return realpathSync6(path2);
|
|
13352
13611
|
} catch (error) {
|
|
13353
13612
|
if (absent(error)) return void 0;
|
|
13354
13613
|
throw error;
|
|
@@ -13378,10 +13637,10 @@ function safePath(path2) {
|
|
|
13378
13637
|
}
|
|
13379
13638
|
function readDocument(root, relativePath, limit) {
|
|
13380
13639
|
if (isAbsolute8(relativePath) || relativePath.split(/[\\/]/).includes("..")) throw Error("orchestra traversal refused");
|
|
13381
|
-
const target =
|
|
13640
|
+
const target = resolve9(root, relativePath);
|
|
13382
13641
|
safePath(target);
|
|
13383
|
-
const canonicalRoot =
|
|
13384
|
-
const rel = relative6(canonicalRoot,
|
|
13642
|
+
const canonicalRoot = realpathSync6(root);
|
|
13643
|
+
const rel = relative6(canonicalRoot, realpathSync6(target));
|
|
13385
13644
|
if (rel.startsWith("..") || isAbsolute8(rel)) throw Error("orchestra path escapes mission");
|
|
13386
13645
|
const descriptor = openSync3(target, constants4.O_RDONLY | constants4.O_NONBLOCK | constants4.O_NOFOLLOW);
|
|
13387
13646
|
try {
|
|
@@ -13450,9 +13709,9 @@ function selectCandidates(candidates, binding, cwd, panes) {
|
|
|
13450
13709
|
return active.length ? active : candidates.filter(({ mission }) => [mission.coordinator, ...mission.workers].some((person) => canonical(person.worktree) === cwd && panes.some((pane) => pane.label === person.label && canonical(pane.cwd) === cwd && pane.tokens?.["mission"] === mission.mission)));
|
|
13451
13710
|
}
|
|
13452
13711
|
function readOrchestra(state, common, cwd, inventory) {
|
|
13453
|
-
const repository =
|
|
13712
|
+
const repository = realpathSync6(common);
|
|
13454
13713
|
const project = projectIdentity(repository);
|
|
13455
|
-
const canonicalCwd =
|
|
13714
|
+
const canonicalCwd = realpathSync6(cwd);
|
|
13456
13715
|
const binding = readSelection(canonicalCwd, project);
|
|
13457
13716
|
const root = join14(state, project);
|
|
13458
13717
|
let entries;
|
|
@@ -13564,10 +13823,10 @@ function executeHerdrMetadata(raw, root, env, runtime3, run = runCommand) {
|
|
|
13564
13823
|
const panes = inventory();
|
|
13565
13824
|
const matches2 = panes.filter((pane2) => pane2.pane_id === paneId);
|
|
13566
13825
|
const pane = matches2[0];
|
|
13567
|
-
if (matches2.length !== 1 || !pane || !pane.cwd ||
|
|
13826
|
+
if (matches2.length !== 1 || !pane || !pane.cwd || realpathSync7(pane.cwd) !== realpathSync7(root)) {
|
|
13568
13827
|
throw Error("Herdr caller pane missing or foreign worktree");
|
|
13569
13828
|
}
|
|
13570
|
-
if (pane.label && panes.filter((other) => other.label === pane.label && typeof other.cwd === "string" &&
|
|
13829
|
+
if (pane.label && panes.filter((other) => other.label === pane.label && typeof other.cwd === "string" && realpathSync7(other.cwd) === realpathSync7(root)).length !== 1) {
|
|
13571
13830
|
throw Error("ambiguous Herdr coordinator identity");
|
|
13572
13831
|
}
|
|
13573
13832
|
const pids = foreground(Buffer.from(call("herdr", ["pane", "process-info", "--pane", paneId])), paneId);
|
|
@@ -13632,7 +13891,7 @@ Do not act on this host until resolved. Native delegation independent of that ac
|
|
|
13632
13891
|
|
|
13633
13892
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
13634
13893
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
13635
|
-
import { statSync as
|
|
13894
|
+
import { statSync as statSync7 } from "node:fs";
|
|
13636
13895
|
import { homedir as homedir3 } from "node:os";
|
|
13637
13896
|
import { join as join16 } from "node:path";
|
|
13638
13897
|
var runCommand2 = (command, args, options) => {
|
|
@@ -13650,7 +13909,7 @@ function nativeHook(env) {
|
|
|
13650
13909
|
"herdr-agent-state.sh"
|
|
13651
13910
|
);
|
|
13652
13911
|
try {
|
|
13653
|
-
return
|
|
13912
|
+
return statSync7(path2).isFile() ? path2 : void 0;
|
|
13654
13913
|
} catch {
|
|
13655
13914
|
return void 0;
|
|
13656
13915
|
}
|
|
@@ -13840,9 +14099,9 @@ import {
|
|
|
13840
14099
|
mkdirSync as mkdirSync5,
|
|
13841
14100
|
openSync as openSync4,
|
|
13842
14101
|
readSync as readSync4,
|
|
13843
|
-
realpathSync as
|
|
14102
|
+
realpathSync as realpathSync8,
|
|
13844
14103
|
renameSync as renameSync5,
|
|
13845
|
-
statSync as
|
|
14104
|
+
statSync as statSync8,
|
|
13846
14105
|
unlinkSync as unlinkSync2,
|
|
13847
14106
|
writeFileSync as writeFileSync4
|
|
13848
14107
|
} from "node:fs";
|
|
@@ -13927,7 +14186,7 @@ function recordCode(error) {
|
|
|
13927
14186
|
return typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
13928
14187
|
}
|
|
13929
14188
|
function directory(root) {
|
|
13930
|
-
let path2 =
|
|
14189
|
+
let path2 = realpathSync8(root);
|
|
13931
14190
|
for (const segment2 of [".void", "machine", "read-loop"]) {
|
|
13932
14191
|
path2 = join17(path2, segment2);
|
|
13933
14192
|
try {
|
|
@@ -13936,7 +14195,7 @@ function directory(root) {
|
|
|
13936
14195
|
if (recordCode(error) !== "EEXIST") throw error;
|
|
13937
14196
|
}
|
|
13938
14197
|
const info = lstatSync6(path2);
|
|
13939
|
-
if (!info.isDirectory() || info.isSymbolicLink() ||
|
|
14198
|
+
if (!info.isDirectory() || info.isSymbolicLink() || realpathSync8(path2) !== path2) throw new Error("unsafe-directory");
|
|
13940
14199
|
if (segment2 === "read-loop" && process.platform !== "win32" && (info.mode & 63) !== 0) throw new Error("public-cache");
|
|
13941
14200
|
}
|
|
13942
14201
|
return path2;
|
|
@@ -13972,8 +14231,8 @@ function executeReadLoop(raw, root, runtime3) {
|
|
|
13972
14231
|
anchor2 = openSync4(path2, constants5.O_RDONLY | (constants5.O_DIRECTORY ?? 0) | (constants5.O_NOFOLLOW ?? 0));
|
|
13973
14232
|
const expected = fstatSync4(anchor2);
|
|
13974
14233
|
process.chdir(path2);
|
|
13975
|
-
const actual =
|
|
13976
|
-
if (!expected.isDirectory() || actual.dev !== expected.dev || actual.ino !== expected.ino ||
|
|
14234
|
+
const actual = statSync8(".");
|
|
14235
|
+
if (!expected.isDirectory() || actual.dev !== expected.dev || actual.ino !== expected.ino || realpathSync8(".") !== path2) throw new Error("directory-changed");
|
|
13977
14236
|
lock = openSync4("state.lock", constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | (constants5.O_NOFOLLOW ?? 0), 384);
|
|
13978
14237
|
const next = advanceReadLoop(readState(), observation, Date.now());
|
|
13979
14238
|
const serialized = JSON.stringify(next.state);
|
|
@@ -14015,9 +14274,9 @@ import {
|
|
|
14015
14274
|
existsSync as existsSync6,
|
|
14016
14275
|
lstatSync as lstatSync7,
|
|
14017
14276
|
readFileSync as readFileSync12,
|
|
14018
|
-
statSync as
|
|
14277
|
+
statSync as statSync9
|
|
14019
14278
|
} from "node:fs";
|
|
14020
|
-
import { basename as
|
|
14279
|
+
import { basename as basename8, join as join18 } from "node:path";
|
|
14021
14280
|
var PROGRAM_PATHS = [
|
|
14022
14281
|
join18(".void", "program.md"),
|
|
14023
14282
|
join18(".void", "active.md"),
|
|
@@ -14127,7 +14386,7 @@ function checkpointObservation(root) {
|
|
|
14127
14386
|
const raw = readBounded(path2);
|
|
14128
14387
|
if (raw === void 0) continue;
|
|
14129
14388
|
try {
|
|
14130
|
-
return { checkpoint: parseCheckpoint2(raw), checkpointWrittenAt:
|
|
14389
|
+
return { checkpoint: parseCheckpoint2(raw), checkpointWrittenAt: statSync9(path2).mtimeMs };
|
|
14131
14390
|
} catch {
|
|
14132
14391
|
return { checkpoint: parseCheckpoint2(raw) };
|
|
14133
14392
|
}
|
|
@@ -14137,7 +14396,7 @@ function checkpointObservation(root) {
|
|
|
14137
14396
|
function observeResume(root, now, options = {}) {
|
|
14138
14397
|
const checkpoint = checkpointObservation(root);
|
|
14139
14398
|
const bundle = composeResumeBundle({
|
|
14140
|
-
project: { name:
|
|
14399
|
+
project: { name: basename8(root), path: root },
|
|
14141
14400
|
now,
|
|
14142
14401
|
git: gitObservation(root),
|
|
14143
14402
|
...observeProgram(root),
|
|
@@ -14192,7 +14451,7 @@ import { createHash as createHash6 } from "node:crypto";
|
|
|
14192
14451
|
import {
|
|
14193
14452
|
lstatSync as lstatSync8,
|
|
14194
14453
|
mkdirSync as mkdirSync6,
|
|
14195
|
-
realpathSync as
|
|
14454
|
+
realpathSync as realpathSync9,
|
|
14196
14455
|
writeFileSync as writeFileSync5
|
|
14197
14456
|
} from "node:fs";
|
|
14198
14457
|
import { join as join19, relative as relative7 } from "node:path";
|
|
@@ -14263,11 +14522,11 @@ ${errors}
|
|
|
14263
14522
|
|
|
14264
14523
|
function safeOutputDirectory(root) {
|
|
14265
14524
|
try {
|
|
14266
|
-
const canonicalRoot =
|
|
14525
|
+
const canonicalRoot = realpathSync9(root);
|
|
14267
14526
|
const directory2 = voidMachinePath(root, "outputs");
|
|
14268
14527
|
mkdirSync6(directory2, { recursive: true, mode: 448 });
|
|
14269
14528
|
const info = lstatSync8(directory2);
|
|
14270
|
-
const canonicalDirectory2 =
|
|
14529
|
+
const canonicalDirectory2 = realpathSync9(directory2);
|
|
14271
14530
|
if (!info.isDirectory() || info.isSymbolicLink() || !within(canonicalRoot, canonicalDirectory2)) {
|
|
14272
14531
|
return void 0;
|
|
14273
14532
|
}
|
|
@@ -14303,7 +14562,7 @@ function executeTrim(rawInput, root, env) {
|
|
|
14303
14562
|
const hash2 = createHash6("sha256").update(extracted.text).digest("hex").slice(0, 12);
|
|
14304
14563
|
const tool = extracted.tool.replaceAll(/[^A-Za-z0-9_]/g, "_").slice(0, 80);
|
|
14305
14564
|
const file = join19(directory2, `${tool}-${process.pid}-${Date.now()}-${hash2}.log`);
|
|
14306
|
-
const spillPath = relative7(
|
|
14565
|
+
const spillPath = relative7(realpathSync9(root), file).replaceAll("\\", "/");
|
|
14307
14566
|
const plan = planOutputTrim(extracted.text, {
|
|
14308
14567
|
tool: extracted.tool,
|
|
14309
14568
|
thresholdBytes,
|
|
@@ -14348,7 +14607,7 @@ import {
|
|
|
14348
14607
|
isAbsolute as isAbsolute9,
|
|
14349
14608
|
join as join20,
|
|
14350
14609
|
relative as relative8,
|
|
14351
|
-
resolve as
|
|
14610
|
+
resolve as resolve10
|
|
14352
14611
|
} from "node:path";
|
|
14353
14612
|
function record6(value) {
|
|
14354
14613
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
@@ -14440,11 +14699,11 @@ function within3(root, target) {
|
|
|
14440
14699
|
return rel === "" || !rel.startsWith("..") && !isAbsolute9(rel);
|
|
14441
14700
|
}
|
|
14442
14701
|
function nearestTsconfigs(changedPaths, projectRoot2, hasFile) {
|
|
14443
|
-
const root =
|
|
14702
|
+
const root = resolve10(projectRoot2);
|
|
14444
14703
|
const found = /* @__PURE__ */ new Set();
|
|
14445
14704
|
for (const changedPath of changedPaths) {
|
|
14446
14705
|
if (!/\.(?:ts|tsx)$/.test(changedPath) || changedPath.endsWith(".d.ts")) continue;
|
|
14447
|
-
const target =
|
|
14706
|
+
const target = resolve10(root, changedPath);
|
|
14448
14707
|
if (!within3(root, target)) continue;
|
|
14449
14708
|
let current = dirname7(target);
|
|
14450
14709
|
while (within3(root, current)) {
|
|
@@ -14590,15 +14849,15 @@ Resolve before claiming done. This never blocks.
|
|
|
14590
14849
|
|
|
14591
14850
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
14592
14851
|
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
14593
|
-
import { closeSync as closeSync5, existsSync as existsSync8, lstatSync as lstatSync9, openSync as openSync5, readSync as readSync5, realpathSync as
|
|
14594
|
-
import { dirname as dirname8, isAbsolute as isAbsolute10, join as join22, resolve as
|
|
14852
|
+
import { closeSync as closeSync5, existsSync as existsSync8, lstatSync as lstatSync9, openSync as openSync5, readSync as readSync5, realpathSync as realpathSync10 } from "node:fs";
|
|
14853
|
+
import { dirname as dirname8, isAbsolute as isAbsolute10, join as join22, resolve as resolve11 } from "node:path";
|
|
14595
14854
|
var GIT_TIMEOUT_MS2 = 5e3;
|
|
14596
14855
|
var GIT_MAX_OUTPUT_BYTES = 1e6;
|
|
14597
14856
|
function canonical3(path2) {
|
|
14598
14857
|
try {
|
|
14599
|
-
return
|
|
14858
|
+
return realpathSync10(resolve11(path2));
|
|
14600
14859
|
} catch {
|
|
14601
|
-
return
|
|
14860
|
+
return resolve11(path2);
|
|
14602
14861
|
}
|
|
14603
14862
|
}
|
|
14604
14863
|
function git2(cwd, args, deadline) {
|
|
@@ -14629,7 +14888,7 @@ function mainWorkingTree(cwd, deadline, expectedCommon, query = git2) {
|
|
|
14629
14888
|
const args = ["rev-parse", "--show-toplevel", ...expectedCommon === void 0 ? [] : ["--git-common-dir"]];
|
|
14630
14889
|
const [toplevel, common] = query(listed, args, deadline)?.trim().split(/\r?\n/) ?? [];
|
|
14631
14890
|
if (toplevel === void 0 || toplevel === "") return void 0;
|
|
14632
|
-
if (expectedCommon !== void 0 && (common === void 0 || canonical3(
|
|
14891
|
+
if (expectedCommon !== void 0 && (common === void 0 || canonical3(resolve11(listed, common)) !== expectedCommon)) return void 0;
|
|
14633
14892
|
return canonical3(toplevel);
|
|
14634
14893
|
}
|
|
14635
14894
|
function holdsInstallReceipt(root) {
|
|
@@ -14656,9 +14915,9 @@ function ordinaryLinkedMain(tree) {
|
|
|
14656
14915
|
const marker = join22(tree, ".git");
|
|
14657
14916
|
const pointer = gitPointer(marker);
|
|
14658
14917
|
if (!pointer.startsWith("gitdir: ")) throw new Error("INVALID_GIT_POINTER");
|
|
14659
|
-
const directory2 = canonical3(
|
|
14918
|
+
const directory2 = canonical3(resolve11(tree, pointer.slice(8)));
|
|
14660
14919
|
if (!existsSync8(join22(directory2, "commondir"))) return void 0;
|
|
14661
|
-
const common = canonical3(
|
|
14920
|
+
const common = canonical3(resolve11(directory2, gitPointer(join22(directory2, "commondir"))));
|
|
14662
14921
|
const backlink = gitPointer(join22(directory2, "gitdir"));
|
|
14663
14922
|
if (!isAbsolute10(backlink) || canonical3(backlink) !== canonical3(marker) || canonical3(dirname8(directory2)) !== canonical3(join22(common, "worktrees"))) {
|
|
14664
14923
|
throw new Error("INVALID_GIT_POINTER");
|
|
@@ -14696,7 +14955,7 @@ function resolveTelemetryRoot(cwd, query = git2) {
|
|
|
14696
14955
|
], deadline)?.trim().split(/\r?\n/) ?? [];
|
|
14697
14956
|
if (toplevel === void 0 || canonical3(toplevel) !== tree) return refused2;
|
|
14698
14957
|
if (directory2 === void 0 || common === void 0) return refused2;
|
|
14699
|
-
const commonDirectory = canonical3(
|
|
14958
|
+
const commonDirectory = canonical3(resolve11(tree, common));
|
|
14700
14959
|
if (canonical3(directory2) === commonDirectory) return { kind: "resolved", root: tree };
|
|
14701
14960
|
const main2 = mainWorkingTree(tree, deadline, commonDirectory, query);
|
|
14702
14961
|
if (main2 === void 0) return refused2;
|
|
@@ -14711,11 +14970,11 @@ init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
|
14711
14970
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
14712
14971
|
import { createHash as createHash7 } from "node:crypto";
|
|
14713
14972
|
import {
|
|
14714
|
-
basename as
|
|
14973
|
+
basename as basename9,
|
|
14715
14974
|
extname,
|
|
14716
14975
|
isAbsolute as isAbsolute11,
|
|
14717
14976
|
relative as relative9,
|
|
14718
|
-
resolve as
|
|
14977
|
+
resolve as resolve12
|
|
14719
14978
|
} from "node:path";
|
|
14720
14979
|
var MISSION_ID = /^mis_[A-Za-z0-9_-]{8,100}$/;
|
|
14721
14980
|
function record7(value) {
|
|
@@ -14756,12 +15015,12 @@ function nameFor(tool, category, input) {
|
|
|
14756
15015
|
const explicit = text2(input["name"]);
|
|
14757
15016
|
if (explicit !== "") return explicit;
|
|
14758
15017
|
const script = text2(input["scriptPath"]);
|
|
14759
|
-
return script === "" || script.endsWith("/") ? "inline" :
|
|
15018
|
+
return script === "" || script.endsWith("/") ? "inline" : basename9(script).replace(/(?:\.workflow)?\.js$/, "") || "inline";
|
|
14760
15019
|
}
|
|
14761
15020
|
return tool || "unknown";
|
|
14762
15021
|
}
|
|
14763
15022
|
function safePaths(input, root) {
|
|
14764
|
-
const absoluteRoot =
|
|
15023
|
+
const absoluteRoot = resolve12(root);
|
|
14765
15024
|
const candidates = [
|
|
14766
15025
|
input["file_path"],
|
|
14767
15026
|
input["path"],
|
|
@@ -14774,7 +15033,7 @@ function safePaths(input, root) {
|
|
|
14774
15033
|
if (!candidate.startsWith("..")) paths.push(candidate.slice(0, 500));
|
|
14775
15034
|
continue;
|
|
14776
15035
|
}
|
|
14777
|
-
const rel = relative9(absoluteRoot,
|
|
15036
|
+
const rel = relative9(absoluteRoot, resolve12(candidate));
|
|
14778
15037
|
if (rel !== "" && !rel.startsWith("..") && !isAbsolute11(rel)) {
|
|
14779
15038
|
paths.push(rel.slice(0, 500));
|
|
14780
15039
|
}
|
|
@@ -14829,7 +15088,7 @@ function deriveMissionId(explicit, runtime3, runtimeSessionId2, root) {
|
|
|
14829
15088
|
}
|
|
14830
15089
|
return explicit;
|
|
14831
15090
|
}
|
|
14832
|
-
const opaque = createHash7("sha256").update(`${runtime3}\0${runtimeSessionId2 || "unknown"}\0${
|
|
15091
|
+
const opaque = createHash7("sha256").update(`${runtime3}\0${runtimeSessionId2 || "unknown"}\0${resolve12(root)}`).digest("hex").slice(0, 32);
|
|
14833
15092
|
return `mis_${opaque}`;
|
|
14834
15093
|
}
|
|
14835
15094
|
|
|
@@ -14853,7 +15112,7 @@ import {
|
|
|
14853
15112
|
isAbsolute as isAbsolute12,
|
|
14854
15113
|
join as join23,
|
|
14855
15114
|
relative as relative10,
|
|
14856
|
-
resolve as
|
|
15115
|
+
resolve as resolve13
|
|
14857
15116
|
} from "node:path";
|
|
14858
15117
|
|
|
14859
15118
|
init_define_VOID_SYNTAX_WORKER_IDENTITY();
|
|
@@ -15127,7 +15386,7 @@ async function safeRunDirectory(root, missionId) {
|
|
|
15127
15386
|
if (!MISSION_ID3.test(missionId)) {
|
|
15128
15387
|
throw new Error("HOOK_INVALID_MISSION_ID: expected mis_<opaque-id>");
|
|
15129
15388
|
}
|
|
15130
|
-
const absoluteRoot =
|
|
15389
|
+
const absoluteRoot = resolve13(root);
|
|
15131
15390
|
const canonicalRoot = await realpath(absoluteRoot);
|
|
15132
15391
|
const run = voidReadPath(absoluteRoot, "runs", missionId);
|
|
15133
15392
|
let ancestor = run;
|