@workit-dev/pi 2.4.0 → 2.4.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/dist/worker.js +12 -12
- package/dist/workit.js +46 -46
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -6756,11 +6756,11 @@ var COMMIT_PRESETS = [
|
|
|
6756
6756
|
|
|
6757
6757
|
// packages/workit-core/src/core/workspaces.ts
|
|
6758
6758
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
6759
|
-
import { existsSync, lstatSync as lstatSync2, readFileSync as readFileSync3, realpathSync as
|
|
6759
|
+
import { existsSync as existsSync2, lstatSync as lstatSync2, readFileSync as readFileSync3, realpathSync as realpathSync3 } from "node:fs";
|
|
6760
6760
|
import path6 from "node:path";
|
|
6761
6761
|
|
|
6762
6762
|
// packages/workit-core/src/core/remotes.ts
|
|
6763
|
-
import { lstatSync, readFileSync as readFileSync2, realpathSync, statSync } from "node:fs";
|
|
6763
|
+
import { lstatSync, readFileSync as readFileSync2, realpathSync as realpathSync2, statSync } from "node:fs";
|
|
6764
6764
|
import path5 from "node:path";
|
|
6765
6765
|
|
|
6766
6766
|
// packages/workit-core/src/git/rev.ts
|
|
@@ -7098,7 +7098,7 @@ function resolveSshHost(alias, sshConfig) {
|
|
|
7098
7098
|
|
|
7099
7099
|
// packages/workit-core/src/core/account-home.ts
|
|
7100
7100
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
7101
|
-
import { readFileSync } from "node:fs";
|
|
7101
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
7102
7102
|
import os3 from "node:os";
|
|
7103
7103
|
var WINDOWS = "C:\\Windows";
|
|
7104
7104
|
var SYSTEM32 = `${WINDOWS}\\System32\\`;
|
|
@@ -7198,7 +7198,7 @@ var isRepoDir = (dir) => ["HEAD", "objects", "refs"].every((name) => {
|
|
|
7198
7198
|
var gitDirAt = (at, depth = 0) => {
|
|
7199
7199
|
let real;
|
|
7200
7200
|
try {
|
|
7201
|
-
real =
|
|
7201
|
+
real = realpathSync2.native(at);
|
|
7202
7202
|
} catch {
|
|
7203
7203
|
return null;
|
|
7204
7204
|
}
|
|
@@ -7230,7 +7230,7 @@ var gitDirAt = (at, depth = 0) => {
|
|
|
7230
7230
|
} catch {
|
|
7231
7231
|
continue;
|
|
7232
7232
|
}
|
|
7233
|
-
const resolved =
|
|
7233
|
+
const resolved = realpathSync2.native(item);
|
|
7234
7234
|
const rel = path5.relative(real, resolved);
|
|
7235
7235
|
if (rel && !rel.startsWith("..") && !path5.isAbsolute(rel))
|
|
7236
7236
|
continue;
|
|
@@ -7529,8 +7529,8 @@ var probeCheckout = (cwd) => {
|
|
|
7529
7529
|
if (cached !== undefined)
|
|
7530
7530
|
return cached;
|
|
7531
7531
|
let dir = path6.resolve(cwd);
|
|
7532
|
-
while (!
|
|
7533
|
-
if (["HEAD", "objects", "refs"].every((name) =>
|
|
7532
|
+
while (!existsSync2(path6.join(dir, ".git"))) {
|
|
7533
|
+
if (["HEAD", "objects", "refs"].every((name) => existsSync2(path6.join(dir, name)))) {
|
|
7534
7534
|
const real = realpathOf(dir);
|
|
7535
7535
|
const owner = ownInternals(real) === true ? gitDirOwner(real) : null;
|
|
7536
7536
|
if (owner === null)
|
|
@@ -7614,7 +7614,7 @@ var ownInternals = (real) => {
|
|
|
7614
7614
|
}
|
|
7615
7615
|
let resolved;
|
|
7616
7616
|
try {
|
|
7617
|
-
resolved = (
|
|
7617
|
+
resolved = (realpathSync3.native ?? realpathSync3)(at);
|
|
7618
7618
|
} catch {
|
|
7619
7619
|
return false;
|
|
7620
7620
|
}
|
|
@@ -7657,7 +7657,7 @@ var matchingEntries = (cwd, entries) => {
|
|
|
7657
7657
|
return main ? match(main) : direct;
|
|
7658
7658
|
};
|
|
7659
7659
|
var realpathOf = (p) => {
|
|
7660
|
-
const real =
|
|
7660
|
+
const real = realpathSync3.native ?? realpathSync3;
|
|
7661
7661
|
try {
|
|
7662
7662
|
return real(p);
|
|
7663
7663
|
} catch {
|
|
@@ -8031,14 +8031,14 @@ var KNOWN_TYPES = new Set([
|
|
|
8031
8031
|
var SLOT = Symbol.for("workit.migrationReporter");
|
|
8032
8032
|
|
|
8033
8033
|
// packages/workit-core/src/core/package-root.ts
|
|
8034
|
-
import { existsSync as
|
|
8034
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
8035
8035
|
import path8 from "node:path";
|
|
8036
8036
|
import { fileURLToPath } from "node:url";
|
|
8037
8037
|
var packageRoot = () => {
|
|
8038
8038
|
let dir = path8.dirname(fileURLToPath(import.meta.url));
|
|
8039
8039
|
while (true) {
|
|
8040
8040
|
const parent = path8.dirname(dir);
|
|
8041
|
-
if (
|
|
8041
|
+
if (existsSync3(path8.join(dir, "package.json")) || parent === dir)
|
|
8042
8042
|
return dir;
|
|
8043
8043
|
dir = parent;
|
|
8044
8044
|
}
|
|
@@ -8046,7 +8046,7 @@ var packageRoot = () => {
|
|
|
8046
8046
|
var assetRoot = () => {
|
|
8047
8047
|
const root = packageRoot();
|
|
8048
8048
|
const assets = path8.join(root, "assets");
|
|
8049
|
-
return
|
|
8049
|
+
return existsSync3(assets) ? assets : root;
|
|
8050
8050
|
};
|
|
8051
8051
|
|
|
8052
8052
|
// packages/workit-core/src/core/store-lock.ts
|
package/dist/workit.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
4
4
|
|
|
5
5
|
// packages/workit-core/src/core.ts
|
|
6
6
|
import { spawnSync as spawnSync22 } from "node:child_process";
|
|
7
|
-
import { existsSync as
|
|
7
|
+
import { existsSync as existsSync13, realpathSync as realpathSync9 } from "node:fs";
|
|
8
8
|
import path35 from "node:path";
|
|
9
9
|
|
|
10
10
|
// packages/workit-core/src/core/task-contract.ts
|
|
@@ -7885,11 +7885,11 @@ var gitContext = (workspaceRoot, paths = []) => {
|
|
|
7885
7885
|
// packages/workit-core/src/core/workspaces.ts
|
|
7886
7886
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
7887
7887
|
import { createHash as createHash3 } from "node:crypto";
|
|
7888
|
-
import { existsSync as
|
|
7888
|
+
import { existsSync as existsSync3, lstatSync as lstatSync2, readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
|
|
7889
7889
|
import path7 from "node:path";
|
|
7890
7890
|
|
|
7891
7891
|
// packages/workit-core/src/core/remotes.ts
|
|
7892
|
-
import { lstatSync, readFileSync as readFileSync3, realpathSync, statSync } from "node:fs";
|
|
7892
|
+
import { lstatSync, readFileSync as readFileSync3, realpathSync as realpathSync2, statSync } from "node:fs";
|
|
7893
7893
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
7894
7894
|
import path6 from "node:path";
|
|
7895
7895
|
|
|
@@ -8718,7 +8718,7 @@ function resolveSshHost(alias, sshConfig) {
|
|
|
8718
8718
|
|
|
8719
8719
|
// packages/workit-core/src/core/account-home.ts
|
|
8720
8720
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
8721
|
-
import { readFileSync as readFileSync2 } from "node:fs";
|
|
8721
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, realpathSync } from "node:fs";
|
|
8722
8722
|
import os3 from "node:os";
|
|
8723
8723
|
var WINDOWS = "C:\\Windows";
|
|
8724
8724
|
var SYSTEM32 = `${WINDOWS}\\System32\\`;
|
|
@@ -8819,7 +8819,7 @@ var isRepoDir = (dir) => ["HEAD", "objects", "refs"].every((name) => {
|
|
|
8819
8819
|
var gitDirAt = (at, depth = 0) => {
|
|
8820
8820
|
let real;
|
|
8821
8821
|
try {
|
|
8822
|
-
real =
|
|
8822
|
+
real = realpathSync2.native(at);
|
|
8823
8823
|
} catch {
|
|
8824
8824
|
return null;
|
|
8825
8825
|
}
|
|
@@ -8851,7 +8851,7 @@ var gitDirAt = (at, depth = 0) => {
|
|
|
8851
8851
|
} catch {
|
|
8852
8852
|
continue;
|
|
8853
8853
|
}
|
|
8854
|
-
const resolved =
|
|
8854
|
+
const resolved = realpathSync2.native(item);
|
|
8855
8855
|
const rel = path6.relative(real, resolved);
|
|
8856
8856
|
if (rel && !rel.startsWith("..") && !path6.isAbsolute(rel))
|
|
8857
8857
|
continue;
|
|
@@ -8978,7 +8978,7 @@ var TRANSPORT_ENV = ["GIT_SSH", "GIT_SSH_COMMAND", "GIT_PROXY_COMMAND"];
|
|
|
8978
8978
|
var userGitSeam = { home: accountHome };
|
|
8979
8979
|
var realOrSelf = (file) => {
|
|
8980
8980
|
try {
|
|
8981
|
-
return
|
|
8981
|
+
return realpathSync2.native(file);
|
|
8982
8982
|
} catch {
|
|
8983
8983
|
return path6.resolve(file);
|
|
8984
8984
|
}
|
|
@@ -9373,8 +9373,8 @@ var probeCheckout = (cwd) => {
|
|
|
9373
9373
|
if (cached !== undefined)
|
|
9374
9374
|
return cached;
|
|
9375
9375
|
let dir = path7.resolve(cwd);
|
|
9376
|
-
while (!
|
|
9377
|
-
if (["HEAD", "objects", "refs"].every((name) =>
|
|
9376
|
+
while (!existsSync3(path7.join(dir, ".git"))) {
|
|
9377
|
+
if (["HEAD", "objects", "refs"].every((name) => existsSync3(path7.join(dir, name)))) {
|
|
9378
9378
|
const real = realpathOf(dir);
|
|
9379
9379
|
const owner = ownInternals(real) === true ? gitDirOwner(real) : null;
|
|
9380
9380
|
if (owner === null)
|
|
@@ -9458,7 +9458,7 @@ var ownInternals = (real) => {
|
|
|
9458
9458
|
}
|
|
9459
9459
|
let resolved;
|
|
9460
9460
|
try {
|
|
9461
|
-
resolved = (
|
|
9461
|
+
resolved = (realpathSync3.native ?? realpathSync3)(at);
|
|
9462
9462
|
} catch {
|
|
9463
9463
|
return false;
|
|
9464
9464
|
}
|
|
@@ -9516,7 +9516,7 @@ var matchingEntries = (cwd, entries) => {
|
|
|
9516
9516
|
return main ? match(main) : direct;
|
|
9517
9517
|
};
|
|
9518
9518
|
var realpathOf = (p) => {
|
|
9519
|
-
const real =
|
|
9519
|
+
const real = realpathSync3.native ?? realpathSync3;
|
|
9520
9520
|
try {
|
|
9521
9521
|
return real(p);
|
|
9522
9522
|
} catch {
|
|
@@ -12212,14 +12212,14 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
12212
12212
|
}
|
|
12213
12213
|
}
|
|
12214
12214
|
// packages/workit-core/src/core/package-root.ts
|
|
12215
|
-
import { existsSync as
|
|
12215
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
12216
12216
|
import path14 from "node:path";
|
|
12217
12217
|
import { fileURLToPath } from "node:url";
|
|
12218
12218
|
var packageRoot = () => {
|
|
12219
12219
|
let dir = path14.dirname(fileURLToPath(import.meta.url));
|
|
12220
12220
|
while (true) {
|
|
12221
12221
|
const parent = path14.dirname(dir);
|
|
12222
|
-
if (
|
|
12222
|
+
if (existsSync4(path14.join(dir, "package.json")) || parent === dir)
|
|
12223
12223
|
return dir;
|
|
12224
12224
|
dir = parent;
|
|
12225
12225
|
}
|
|
@@ -12227,7 +12227,7 @@ var packageRoot = () => {
|
|
|
12227
12227
|
var assetRoot = () => {
|
|
12228
12228
|
const root = packageRoot();
|
|
12229
12229
|
const assets = path14.join(root, "assets");
|
|
12230
|
-
return
|
|
12230
|
+
return existsSync4(assets) ? assets : root;
|
|
12231
12231
|
};
|
|
12232
12232
|
|
|
12233
12233
|
// packages/workit-core/src/core/store-lock.ts
|
|
@@ -14718,7 +14718,7 @@ function lightCommand(argv, cwd) {
|
|
|
14718
14718
|
}
|
|
14719
14719
|
|
|
14720
14720
|
// packages/workit-core/src/core/policy/derive.ts
|
|
14721
|
-
import { existsSync as
|
|
14721
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
14722
14722
|
import path21 from "node:path";
|
|
14723
14723
|
|
|
14724
14724
|
// packages/workit-core/src/ledger.ts
|
|
@@ -14805,7 +14805,7 @@ function bookkeepingPaths(cwd, input) {
|
|
|
14805
14805
|
}
|
|
14806
14806
|
|
|
14807
14807
|
// packages/workit-core/src/core/policy/lane.ts
|
|
14808
|
-
import { existsSync as
|
|
14808
|
+
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "node:fs";
|
|
14809
14809
|
import path18 from "node:path";
|
|
14810
14810
|
|
|
14811
14811
|
// packages/workit-core/src/git/default-base.ts
|
|
@@ -16939,7 +16939,7 @@ var productDecision = (task, ledger) => {
|
|
|
16939
16939
|
};
|
|
16940
16940
|
};
|
|
16941
16941
|
var planRecorded = (task, root) => {
|
|
16942
|
-
const cited = (latestJudgment(task)?.refs ?? []).find((ref) => ref.kind === "external" || ref.kind === "file" &&
|
|
16942
|
+
const cited = (latestJudgment(task)?.refs ?? []).find((ref) => ref.kind === "external" || ref.kind === "file" && existsSync8(path21.resolve(root, ref.path)));
|
|
16943
16943
|
if (cited)
|
|
16944
16944
|
return {
|
|
16945
16945
|
met: true,
|
|
@@ -18355,7 +18355,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
18355
18355
|
});
|
|
18356
18356
|
// packages/workit-core/src/core/route-intent.ts
|
|
18357
18357
|
import { spawnSync as spawnSync17 } from "node:child_process";
|
|
18358
|
-
import { existsSync as
|
|
18358
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
18359
18359
|
import path30 from "node:path";
|
|
18360
18360
|
|
|
18361
18361
|
// packages/workit-core/src/hooks/raw-git.ts
|
|
@@ -18369,7 +18369,7 @@ import path29 from "node:path";
|
|
|
18369
18369
|
import path27 from "node:path";
|
|
18370
18370
|
|
|
18371
18371
|
// packages/workit-core/src/core/eval-world.ts
|
|
18372
|
-
import { existsSync as
|
|
18372
|
+
import { existsSync as existsSync10, realpathSync as realpathSync6 } from "node:fs";
|
|
18373
18373
|
import os5 from "node:os";
|
|
18374
18374
|
import path24 from "node:path";
|
|
18375
18375
|
var EVAL_WORLD_ENV = "WORKIT_EVAL_WORLD";
|
|
@@ -18383,8 +18383,8 @@ var evalWorld = (cwd) => {
|
|
|
18383
18383
|
if (!raw || !path24.isAbsolute(raw))
|
|
18384
18384
|
return null;
|
|
18385
18385
|
try {
|
|
18386
|
-
const world =
|
|
18387
|
-
return inside2(
|
|
18386
|
+
const world = realpathSync6(raw);
|
|
18387
|
+
return inside2(realpathSync6(os5.tmpdir()), world) && inside2(world, realpathSync6(cwd)) && existsSync10(path24.join(world, EVAL_WORLD_MARKER)) ? world : null;
|
|
18388
18388
|
} catch {
|
|
18389
18389
|
return null;
|
|
18390
18390
|
}
|
|
@@ -21481,7 +21481,7 @@ var judgedDir = (root, dir) => {
|
|
|
21481
21481
|
if (dir === null)
|
|
21482
21482
|
return root;
|
|
21483
21483
|
const resolved = path30.resolve(root, dir);
|
|
21484
|
-
return
|
|
21484
|
+
return existsSync11(resolved) && inWorkitWorkspace(resolved) ? resolved : null;
|
|
21485
21485
|
};
|
|
21486
21486
|
var shellBranchPolicyViolation = (root, command, dialect = "posix") => {
|
|
21487
21487
|
let judged = false;
|
|
@@ -21502,7 +21502,7 @@ var shellBranchPolicyViolation = (root, command, dialect = "posix") => {
|
|
|
21502
21502
|
return judged ? { ok: true } : null;
|
|
21503
21503
|
};
|
|
21504
21504
|
// packages/workit-core/src/core/task-engine.ts
|
|
21505
|
-
import { realpathSync as
|
|
21505
|
+
import { realpathSync as realpathSync8 } from "node:fs";
|
|
21506
21506
|
|
|
21507
21507
|
// packages/workit-core/src/core/policy-resolver.ts
|
|
21508
21508
|
function resolvePolicy(input) {
|
|
@@ -21751,12 +21751,12 @@ var judgeInputSummary = (raw) => {
|
|
|
21751
21751
|
};
|
|
21752
21752
|
|
|
21753
21753
|
// packages/workit-core/src/core/task-view.ts
|
|
21754
|
-
import { realpathSync as
|
|
21754
|
+
import { realpathSync as realpathSync7 } from "node:fs";
|
|
21755
21755
|
var environment = () => [];
|
|
21756
21756
|
var sameSession2 = (value, context) => typeof value === "object" && value !== null && value.kind === "host" && value.host === context.caller.host && value.handle === context.caller.actor;
|
|
21757
21757
|
function contextRootError(store, context) {
|
|
21758
21758
|
try {
|
|
21759
|
-
|
|
21759
|
+
realpathSync7(context.root);
|
|
21760
21760
|
const root = checkoutRootOf(context.root);
|
|
21761
21761
|
if (root !== store.root && !sameDirectoryIdentity(root, store.root))
|
|
21762
21762
|
return failure2("invalid_input", "operation context root does not match the task store root");
|
|
@@ -23226,7 +23226,7 @@ class WorkitCore {
|
|
|
23226
23226
|
if (view.task.workspaceId !== view.workspace.id)
|
|
23227
23227
|
return failure2("invalid_input", "task and workspace bindings are invalid");
|
|
23228
23228
|
try {
|
|
23229
|
-
if (
|
|
23229
|
+
if (realpathSync8(view.workspace.root) !== this.store.root)
|
|
23230
23230
|
return failure2("invalid_input", "task view root does not match the task store");
|
|
23231
23231
|
} catch {
|
|
23232
23232
|
return failure2("invalid_input", "task view root cannot be resolved");
|
|
@@ -23477,7 +23477,7 @@ class WorkitCore {
|
|
|
23477
23477
|
}
|
|
23478
23478
|
// packages/workit-core/src/core/repo-context.ts
|
|
23479
23479
|
import { spawnSync as spawnSync18 } from "node:child_process";
|
|
23480
|
-
import { existsSync as
|
|
23480
|
+
import { existsSync as existsSync12, readFileSync as readFileSync11, readdirSync as readdirSync4 } from "node:fs";
|
|
23481
23481
|
import path31 from "node:path";
|
|
23482
23482
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
23483
23483
|
try {
|
|
@@ -23659,7 +23659,7 @@ var diffStatForRange = (cwd, range) => {
|
|
|
23659
23659
|
};
|
|
23660
23660
|
var packageScripts = (cwd, keys) => {
|
|
23661
23661
|
const pkgPath = path31.join(cwd, "package.json");
|
|
23662
|
-
if (!
|
|
23662
|
+
if (!existsSync12(pkgPath))
|
|
23663
23663
|
return [];
|
|
23664
23664
|
try {
|
|
23665
23665
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
@@ -23694,7 +23694,7 @@ var documentationFiles = (cwd) => {
|
|
|
23694
23694
|
return matches.toSorted().slice(0, 200);
|
|
23695
23695
|
};
|
|
23696
23696
|
var readTrimmed2 = (file, maxLines) => {
|
|
23697
|
-
if (!
|
|
23697
|
+
if (!existsSync12(file))
|
|
23698
23698
|
return "";
|
|
23699
23699
|
const lines = readFileSync11(file, "utf8").split(`
|
|
23700
23700
|
`);
|
|
@@ -23770,7 +23770,7 @@ ${status.stderr}` : "");
|
|
|
23770
23770
|
stdout += `
|
|
23771
23771
|
`;
|
|
23772
23772
|
stdout += printSection("Recent Validation Signals");
|
|
23773
|
-
if (
|
|
23773
|
+
if (existsSync12(path31.join(cwd, "package.json"))) {
|
|
23774
23774
|
stdout += `package.json detected. Common scripts:
|
|
23775
23775
|
`;
|
|
23776
23776
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -23779,7 +23779,7 @@ ${status.stderr}` : "");
|
|
|
23779
23779
|
`) + `
|
|
23780
23780
|
`;
|
|
23781
23781
|
}
|
|
23782
|
-
if (
|
|
23782
|
+
if (existsSync12(path31.join(cwd, "Cargo.toml")) || existsSync12(path31.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
23783
23783
|
stdout += `Rust project detected.
|
|
23784
23784
|
`;
|
|
23785
23785
|
}
|
|
@@ -23831,7 +23831,7 @@ function changelogContext(root, range) {
|
|
|
23831
23831
|
`;
|
|
23832
23832
|
stdout += printSection("Existing CHANGELOG.md");
|
|
23833
23833
|
const changelogPath = path31.join(cwd, "CHANGELOG.md");
|
|
23834
|
-
if (
|
|
23834
|
+
if (existsSync12(changelogPath)) {
|
|
23835
23835
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
23836
23836
|
`;
|
|
23837
23837
|
} else {
|
|
@@ -23873,7 +23873,7 @@ function docsRefreshContext(root, range) {
|
|
|
23873
23873
|
`;
|
|
23874
23874
|
stdout += printSection("README Preview");
|
|
23875
23875
|
const readme = path31.join(cwd, "README.md");
|
|
23876
|
-
if (
|
|
23876
|
+
if (existsSync12(readme)) {
|
|
23877
23877
|
stdout += readTrimmed2(readme, 220) + `
|
|
23878
23878
|
`;
|
|
23879
23879
|
} else {
|
|
@@ -23882,7 +23882,7 @@ function docsRefreshContext(root, range) {
|
|
|
23882
23882
|
}
|
|
23883
23883
|
stdout += printSection("Package Scripts");
|
|
23884
23884
|
const pkgPath = path31.join(cwd, "package.json");
|
|
23885
|
-
if (
|
|
23885
|
+
if (existsSync12(pkgPath)) {
|
|
23886
23886
|
try {
|
|
23887
23887
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
23888
23888
|
stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
|
|
@@ -23938,7 +23938,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
23938
23938
|
`;
|
|
23939
23939
|
stdout += printSection("Existing Release Files");
|
|
23940
23940
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
23941
|
-
if (
|
|
23941
|
+
if (existsSync12(path31.join(cwd, rel)))
|
|
23942
23942
|
stdout += rel + `
|
|
23943
23943
|
`;
|
|
23944
23944
|
}
|
|
@@ -24555,22 +24555,22 @@ function resolveGitRevision(root, value) {
|
|
|
24555
24555
|
}
|
|
24556
24556
|
}
|
|
24557
24557
|
function resolveInside(root, candidate) {
|
|
24558
|
-
const base =
|
|
24558
|
+
const base = realpathSync9(root);
|
|
24559
24559
|
const target = path35.resolve(base, candidate);
|
|
24560
24560
|
if (target !== base && !target.startsWith(base + path35.sep)) {
|
|
24561
24561
|
throw new Error("path must stay inside repository root");
|
|
24562
24562
|
}
|
|
24563
24563
|
let ancestor = target;
|
|
24564
|
-
while (!
|
|
24564
|
+
while (!existsSync13(ancestor))
|
|
24565
24565
|
ancestor = path35.dirname(ancestor);
|
|
24566
|
-
const canonicalAncestor =
|
|
24566
|
+
const canonicalAncestor = realpathSync9(ancestor);
|
|
24567
24567
|
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path35.sep)) {
|
|
24568
24568
|
throw new Error("path must stay inside repository root");
|
|
24569
24569
|
}
|
|
24570
24570
|
return target;
|
|
24571
24571
|
}
|
|
24572
24572
|
function run2(root, executable, args, env = {}) {
|
|
24573
|
-
const cwd =
|
|
24573
|
+
const cwd = realpathSync9(root);
|
|
24574
24574
|
const result = spawnSync22(executable, args, {
|
|
24575
24575
|
cwd,
|
|
24576
24576
|
encoding: "utf8",
|
|
@@ -25765,11 +25765,11 @@ var splitDenial = (plan) => ({
|
|
|
25765
25765
|
});
|
|
25766
25766
|
// packages/workit-core/src/hooks/write-gate.ts
|
|
25767
25767
|
import {
|
|
25768
|
-
existsSync as
|
|
25768
|
+
existsSync as existsSync14,
|
|
25769
25769
|
readdirSync as readdirSync5,
|
|
25770
25770
|
readFileSync as readFileSync12,
|
|
25771
25771
|
readlinkSync as readlinkSync2,
|
|
25772
|
-
realpathSync as
|
|
25772
|
+
realpathSync as realpathSync10,
|
|
25773
25773
|
statSync as statSync4
|
|
25774
25774
|
} from "node:fs";
|
|
25775
25775
|
import os9 from "node:os";
|
|
@@ -25984,7 +25984,7 @@ var linkTarget = (file) => {
|
|
|
25984
25984
|
const to = readlinkSync2(file);
|
|
25985
25985
|
let from = path41.dirname(file);
|
|
25986
25986
|
try {
|
|
25987
|
-
from =
|
|
25987
|
+
from = realpathSync10.native(from);
|
|
25988
25988
|
} catch {}
|
|
25989
25989
|
return path41.resolve(from, to);
|
|
25990
25990
|
} catch {
|
|
@@ -25996,7 +25996,7 @@ var realPath = (file, dangling = true) => {
|
|
|
25996
25996
|
let rest = "";
|
|
25997
25997
|
for (let hops = 0;; ) {
|
|
25998
25998
|
try {
|
|
25999
|
-
return path41.join(
|
|
25999
|
+
return path41.join(realpathSync10.native(dir), rest);
|
|
26000
26000
|
} catch {
|
|
26001
26001
|
const link = dangling ? linkTarget(dir) : null;
|
|
26002
26002
|
if (link !== null) {
|
|
@@ -26451,7 +26451,7 @@ var linkSources = (args, at) => {
|
|
|
26451
26451
|
const sources = names.filter((name, index) => into >= 0 ? name !== dest : index < names.length - 1 || names.length === 1);
|
|
26452
26452
|
const target = dest === undefined ? null : at(dest);
|
|
26453
26453
|
const symbolic = args.some((arg) => /^-[a-zA-Z]*s|^--symbolic$/.test(arg));
|
|
26454
|
-
const base = target === null ? null : into >= 0 || sources.length > 1 ||
|
|
26454
|
+
const base = target === null ? null : into >= 0 || sources.length > 1 || existsSync14(target) || /[\\/]$/.test(dest ?? "") ? target : path41.dirname(target);
|
|
26455
26455
|
return sources.flatMap((source) => {
|
|
26456
26456
|
if (symbolic && base !== null && !path41.isAbsolute(homeExpanded(source)))
|
|
26457
26457
|
return [path41.resolve(base, source)];
|
|
@@ -30960,7 +30960,7 @@ var abandonedLaunches = (root) => {
|
|
|
30960
30960
|
var cancelHint = (workerId) => `cancel it first: workit_worker {"action":"cancel","workerId":"${workerId}","reason":"launch outcome unknown"} (CLI: workit worker cancel --payload '{"workerId":"${workerId}","reason":"launch outcome unknown"}')`;
|
|
30961
30961
|
|
|
30962
30962
|
// packages/workit-core/src/core/cli-locate.ts
|
|
30963
|
-
import { closeSync as closeSync4, existsSync as
|
|
30963
|
+
import { closeSync as closeSync4, existsSync as existsSync15, openSync as openSync4, readSync as readSync2 } from "node:fs";
|
|
30964
30964
|
import path49 from "node:path";
|
|
30965
30965
|
var LAUNCHER_MARKER = "workit-owned-launcher";
|
|
30966
30966
|
var CLI_PACKAGE_PATH = ["node_modules", "@workit-dev", "cli"];
|
|
@@ -30989,7 +30989,7 @@ var head = (file) => {
|
|
|
30989
30989
|
var locateWorkitCli = (options = {}) => {
|
|
30990
30990
|
const env = options.env ?? process.env;
|
|
30991
30991
|
const platform = options.platform ?? process.platform;
|
|
30992
|
-
const exists = options.exists ??
|
|
30992
|
+
const exists = options.exists ?? existsSync15;
|
|
30993
30993
|
const read = options.read ?? head;
|
|
30994
30994
|
const node = options.node ?? process.execPath;
|
|
30995
30995
|
const launcher = ownedLauncherPath(env, platform);
|