@workit-dev/pi 2.23.2 → 2.25.0
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 +2 -0
- package/dist/workit.js +30 -10
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -6516,6 +6516,7 @@ var workspaceConfigSchema = looseObject({
|
|
|
6516
6516
|
cleanup: described(optional(unknown()), "What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
6517
6517
|
feedback: described(optional(unknown()), '`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
|
|
6518
6518
|
liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
6519
|
+
shared: described(optional(boolean2()), "Whether this workspace's repos are shared with a team that must not see Workit named (default false): `workit pr create` and `workit pr edit` then warn, never block, when the PR title, body or a new doc names it."),
|
|
6519
6520
|
fanout: described(optional(looseObject({
|
|
6520
6521
|
tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
|
|
6521
6522
|
deps: described(optional(unknown()), "How `workit fanout worktree create` gives a slice worktree node_modules: `install` (default: its own frozen install of its lockfile) or `link` (links into the main checkout's installed packages, for a repo too slow to install per slice). `--deps` overrides it."),
|
|
@@ -6525,6 +6526,7 @@ var workspaceConfigSchema = looseObject({
|
|
|
6525
6526
|
resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
|
|
6526
6527
|
remotes: described(optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))), "Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
|
|
6527
6528
|
externalRepos: described(optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))), "Repositories outside this workspace's own forge owners that `workit issue create|comment|close --repo` may write to: `owner/name`, or `owner/*` for a whole owner. Only the user changes it, in their own terminal."),
|
|
6529
|
+
additiveRiskPaths: described(optional(array(nonBlank)), "Risk-path globs whose purely additive edits follow the review lane of the rest of the diff. Only the user sets it; it counts only while sealed."),
|
|
6528
6530
|
autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
6529
6531
|
kind,
|
|
6530
6532
|
described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
|
package/dist/workit.js
CHANGED
|
@@ -8470,6 +8470,7 @@ var workspaceConfigSchema = looseObject({
|
|
|
8470
8470
|
cleanup: described(optional(unknown()), "What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
8471
8471
|
feedback: described(optional(unknown()), '`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
|
|
8472
8472
|
liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
8473
|
+
shared: described(optional(boolean2()), "Whether this workspace's repos are shared with a team that must not see Workit named (default false): `workit pr create` and `workit pr edit` then warn, never block, when the PR title, body or a new doc names it."),
|
|
8473
8474
|
fanout: described(optional(looseObject({
|
|
8474
8475
|
tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
|
|
8475
8476
|
deps: described(optional(unknown()), "How `workit fanout worktree create` gives a slice worktree node_modules: `install` (default: its own frozen install of its lockfile) or `link` (links into the main checkout's installed packages, for a repo too slow to install per slice). `--deps` overrides it."),
|
|
@@ -8479,6 +8480,7 @@ var workspaceConfigSchema = looseObject({
|
|
|
8479
8480
|
resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
|
|
8480
8481
|
remotes: described(optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))), "Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
|
|
8481
8482
|
externalRepos: described(optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))), "Repositories outside this workspace's own forge owners that `workit issue create|comment|close --repo` may write to: `owner/name`, or `owner/*` for a whole owner. Only the user changes it, in their own terminal."),
|
|
8483
|
+
additiveRiskPaths: described(optional(array(nonBlank)), "Risk-path globs whose purely additive edits follow the review lane of the rest of the diff. Only the user sets it; it counts only while sealed."),
|
|
8482
8484
|
autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
8483
8485
|
kind,
|
|
8484
8486
|
described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
|
|
@@ -15464,6 +15466,7 @@ var WORD2 = /[\w./:@=+,-]+/uy;
|
|
|
15464
15466
|
var QUOTED = /"[^"$`\\]*"/uy;
|
|
15465
15467
|
var COMMAND = /^[\w.+][\w./+-]*$/u;
|
|
15466
15468
|
var SHELL_STATE = new Set(". alias bg bind break builtin call caller case cd command compgen complete compopt continue coproc declare dirs disown do done elif else enable esac eval exec exit export fc fg fi for function getopts goto hash help history if in jobs kill let local logout mapfile popd pushd read readarray readonly return select set shift shopt source suspend then time times trap type typeset ulimit umask unalias unset until wait while".split(" "));
|
|
15469
|
+
var EFFECTFUL = /^(?:curl|wget|npx|bunx|gh|dlx|push|publish|deploy)$/iu;
|
|
15467
15470
|
var FALLBACK = new Set(["echo", "true"]);
|
|
15468
15471
|
var FORM = 'more than && <command> or && (<command> || echo "<text>")';
|
|
15469
15472
|
var OUTSIDE = '(outside plain words and "double-quoted text")';
|
|
@@ -15524,9 +15527,11 @@ function masking(before, appended) {
|
|
|
15524
15527
|
return FORM;
|
|
15525
15528
|
if (names ? !names.has(name.word) : SHELL_STATE.has(name.word.toLowerCase()))
|
|
15526
15529
|
return names ? FORM : `the shell command ${name.word}`;
|
|
15527
|
-
index
|
|
15528
|
-
|
|
15530
|
+
for (let token = list[index];token && !("op" in token); token = list[index]) {
|
|
15531
|
+
if ("word" in token && EFFECTFUL.test(token.word))
|
|
15532
|
+
return `the effectful command ${token.word}`;
|
|
15529
15533
|
index += 1;
|
|
15534
|
+
}
|
|
15530
15535
|
return null;
|
|
15531
15536
|
};
|
|
15532
15537
|
while (index < list.length) {
|
|
@@ -18879,6 +18884,7 @@ var ENTRY_KEYS = [
|
|
|
18879
18884
|
"glob",
|
|
18880
18885
|
"remotes",
|
|
18881
18886
|
"externalRepos",
|
|
18887
|
+
"additiveRiskPaths",
|
|
18882
18888
|
"vcs",
|
|
18883
18889
|
"autonomy",
|
|
18884
18890
|
"autoApprove",
|
|
@@ -27671,7 +27677,7 @@ var WRAPPERS3 = {
|
|
|
27671
27677
|
};
|
|
27672
27678
|
var INTERPRETERS = /^(?:python[\d.]*|node|bun|deno|ruby|perl|php|tsx|ts-node)$/;
|
|
27673
27679
|
var isConfigDir = (file) => configDirs().some((dir) => canonical5(dir) === canonical5(file));
|
|
27674
|
-
var isRoot = (file) => isConfigDir(file) || /^(?:issued[^\\/]*|approvals)$/.test(path42.relative(canonical5(resolveStateDir()), canonical5(file)));
|
|
27680
|
+
var isRoot = (file) => isConfigDir(file) || /^(?:issued[^\\/]*|approvals|verdicts)$/.test(path42.relative(canonical5(resolveStateDir()), canonical5(file)));
|
|
27675
27681
|
var READ_CALLS = /^(?:print|log|info|warn|error|debug|puts|readdir(?:Sync)?|listdir|scandir|iterdir|glob|l?stat(?:Sync)?|exists(?:Sync)?|isdir|isfile|is_dir|is_file|access(?:Sync)?|realpath(?:Sync)?|dirname|basename|relative|str|repr|len)$/;
|
|
27676
27682
|
var MUTATING_CALLS = /^(?:renames?(?:Sync)?|move|copy(?:2|file|tree|File)?(?:Sync)?|cp(?:Sync)?|rm(?:tree|dir|Sync|dirSync)?|unlink(?:Sync)?|remove(?:dirs)?|mkdirs?(?:Sync)?|makedirs|mkdtemp(?:Sync)?|(?:sym|hard)?link(?:Sync|_to)?|write\w*|append\w*|truncate(?:Sync)?|ch(?:mod|own)(?:Sync)?|touch|open(?:Sync)?|dump|save|extractall|unpack_archive|put_contents|mv|FileUtils)$/;
|
|
27677
27683
|
var SPAWNS = /subprocess|child_process|WriteStream|tempfile|sqlite|inplace|getattr|spawn|\bvm\b|Function\s*\(|FileIO|ZipFile|tarfile|shelve|FileHandler|filename\s*=|savefig|utime|ch(?:mod|own)|mkfifo|mknod|\.(?:delete|to_\w+)\s*\(|Path\b.*\.replace\(|Bun\.\$|O_(?:WR|RDW|CR|AP|TR)|(?:PYTHON|NODE_)\w*=|-r\b|--(?:require|import|[\w-]*loader)|\bos\.replace|\b(?:system|popen|exec\w*|fork|eval|shutil|(?:unlink|rename|remove)\w*)\b|\]\s*\(|\brequire\s*\(\s*(?!(['"])(?:(?![a-zA-Z]:)[\w@][^'"]*|[^'"]*\.json)\1)/;
|
|
@@ -28758,7 +28764,7 @@ var globbed = (cwd, target, state, configs) => {
|
|
|
28758
28764
|
};
|
|
28759
28765
|
let roots = [];
|
|
28760
28766
|
try {
|
|
28761
|
-
roots = readdirSync5(state).filter((name) => /^(?:issued|approvals$)/.test(name));
|
|
28767
|
+
roots = readdirSync5(state).filter((name) => /^(?:issued|approvals$|verdicts$)/.test(name));
|
|
28762
28768
|
} catch {}
|
|
28763
28769
|
return [
|
|
28764
28770
|
...roots.map((name) => path42.join(state, name)).filter((root) => hit(root, true)),
|
|
@@ -28783,8 +28789,10 @@ var guardedInodes = (state, configs) => {
|
|
|
28783
28789
|
for (const name of CONFIG_FILES)
|
|
28784
28790
|
add(path42.join(dir, name), "grants");
|
|
28785
28791
|
for (const name of readdirSync5(state))
|
|
28786
|
-
if (/^(?:issued|approvals$)/.test(name))
|
|
28787
|
-
add(path42.join(state, name), name === "approvals" ? "approvals" : "issued");
|
|
28792
|
+
if (/^(?:issued|approvals$|verdicts$)/.test(name))
|
|
28793
|
+
add(path42.join(state, name), name === "approvals" ? "approvals" : name === "verdicts" ? "ledger" : "issued");
|
|
28794
|
+
for (const slug of readdirSync5(path42.join(state, "folders")))
|
|
28795
|
+
add(path42.join(state, "folders", slug, "ledger"), "ledger");
|
|
28788
28796
|
} catch {}
|
|
28789
28797
|
return seen;
|
|
28790
28798
|
};
|
|
@@ -28811,7 +28819,7 @@ var registryTarget = (cwd, targets) => {
|
|
|
28811
28819
|
const viaGlob = glob === undefined ? null : registryTarget(cwd, [glob]);
|
|
28812
28820
|
if (viaGlob)
|
|
28813
28821
|
return { file: target, registry: viaGlob.registry };
|
|
28814
|
-
const registry = hardLinked(path42.resolve(cwd, file), state, configs, inodes) ?? underRegistry(state, cwd, file, process.platform, canonical5) ?? (configs.some((dir) => underConfig(dir, cwd, file, process.platform, canonical5)) ? "grants" : null);
|
|
28822
|
+
const registry = hardLinked(path42.resolve(cwd, file), state, configs, inodes) ?? underRegistry(state, cwd, file, process.platform, canonical5) ?? (/[\\/]\.git[\\/]workit[\\/]ledger(?:[\\/]|$)/.test(canonical5(path42.resolve(cwd, file))) ? "ledger" : null) ?? (configs.some((dir) => underConfig(dir, cwd, file, process.platform, canonical5)) ? "grants" : null);
|
|
28815
28823
|
if (registry)
|
|
28816
28824
|
return { file: target, registry };
|
|
28817
28825
|
}
|
|
@@ -28826,9 +28834,12 @@ var partsUnder = (dir, cwd, target, platform, real) => {
|
|
|
28826
28834
|
return relative.startsWith("..") || p.isAbsolute(relative) ? null : relative.split(p.sep);
|
|
28827
28835
|
};
|
|
28828
28836
|
var underRegistry = (state, cwd, target, platform = process.platform, real = (file) => file) => {
|
|
28829
|
-
const
|
|
28837
|
+
const parts = partsUnder(state, cwd, target, platform, real) ?? [];
|
|
28838
|
+
const first = parts[0];
|
|
28830
28839
|
if (first?.startsWith("issued"))
|
|
28831
28840
|
return "issued";
|
|
28841
|
+
if (first === "verdicts" || first === "folders" && parts[2] === "ledger")
|
|
28842
|
+
return "ledger";
|
|
28832
28843
|
return first === "approvals" ? "approvals" : null;
|
|
28833
28844
|
};
|
|
28834
28845
|
var underConfig = (dir, cwd, target, platform = process.platform, real = (file) => file) => {
|
|
@@ -28842,7 +28853,9 @@ var unquotedWindowsRegistry = (command, platform = process.platform) => {
|
|
|
28842
28853
|
const text = flat(command);
|
|
28843
28854
|
const state = flat(resolveStateDir());
|
|
28844
28855
|
const configs = configDirs().map(flat);
|
|
28845
|
-
const
|
|
28856
|
+
const folders = `${state}/folders/`;
|
|
28857
|
+
const ledger = (at) => at.includes(`${state}/verdicts`) || /\/\.git\/workit\/ledger(?:[/\s'"]|$)/.test(at) || at.split(folders).slice(1).some((rest) => /^[^/\s]+\/ledger(?:[/\s'"]|$)/.test(rest));
|
|
28858
|
+
const registry = text.includes(`${state}/issued`) ? "issued" : text.includes(`${state}/approvals`) ? "approvals" : ledger(text) ? "ledger" : configs.some((dir) => text.includes(dir)) ? "grants" : null;
|
|
28846
28859
|
if (!registry)
|
|
28847
28860
|
return null;
|
|
28848
28861
|
const spans = command.replace(/[^\s'"|;&<>()]*\\[^\s'"|;&<>()]*/g, (word) => word.replaceAll("\\", "/"));
|
|
@@ -28853,7 +28866,7 @@ var unquotedWindowsRegistry = (command, platform = process.platform) => {
|
|
|
28853
28866
|
];
|
|
28854
28867
|
const named = (target) => moved.some((dir) => {
|
|
28855
28868
|
const at = flat(/^(?:[a-z]:)?\//i.test(target) ? target : dir + target).replace(/\/\.?\//g, "/");
|
|
28856
|
-
return registry === "grants" ? configs.some((cfg) => [cfg, `${cfg}/`, ...CONFIG_FILES.map((name) => `${cfg}/${name}`)].includes(at)) : at.includes(`${state}/${registry}`);
|
|
28869
|
+
return registry === "grants" ? configs.some((cfg) => [cfg, `${cfg}/`, ...CONFIG_FILES.map((name) => `${cfg}/${name}`)].includes(at)) : registry === "ledger" ? ledger(at) : at.includes(`${state}/${registry}`);
|
|
28857
28870
|
});
|
|
28858
28871
|
return writes.writes && (writes.targets === null || writes.targets.some(named)) ? registry : null;
|
|
28859
28872
|
};
|
|
@@ -28873,6 +28886,11 @@ var REGISTRY_DENY = {
|
|
|
28873
28886
|
what: "Workit's host-approval state",
|
|
28874
28887
|
unblock: "Approval requests and the user's yes are written only by Workit: run `workit approve <id>` as its own call so the host asks the user, or ask the user to run it in their own terminal; never edit the approvals registry by hand."
|
|
28875
28888
|
},
|
|
28889
|
+
ledger: {
|
|
28890
|
+
label: "ledger guard",
|
|
28891
|
+
what: "a Workit ledger",
|
|
28892
|
+
unblock: "Only the workit CLI writes it (`workit ledger …`); never edit it by hand."
|
|
28893
|
+
},
|
|
28876
28894
|
grants: {
|
|
28877
28895
|
label: "config guard",
|
|
28878
28896
|
what: "the user's Workit config (grants, roles, youtrack.writes)",
|
|
@@ -29164,6 +29182,8 @@ var unverified = (cwd, branch, all, descriptor, verification, head) => {
|
|
|
29164
29182
|
const check = checkVerdicts(cwd, branch, all);
|
|
29165
29183
|
if (check.accepted.accepted || check.accepted.reasons.includes("failing_verdict"))
|
|
29166
29184
|
return null;
|
|
29185
|
+
if (all.some((row) => row.type === "pr.gate" && row.branch === branch && row.head === check.head))
|
|
29186
|
+
return null;
|
|
29167
29187
|
const judgment = currentJudgment(cwd);
|
|
29168
29188
|
const high = judgment?.riskTier === "high";
|
|
29169
29189
|
let independent;
|