@workit-dev/pi 2.29.1 → 2.29.3
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 +64 -13
- package/dist/workit.js +1032 -499
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -6460,6 +6460,9 @@ var checkoutRemotes = (cwd) => {
|
|
|
6460
6460
|
return out;
|
|
6461
6461
|
};
|
|
6462
6462
|
|
|
6463
|
+
// packages/workit-core/src/core/grant-seal.ts
|
|
6464
|
+
var SEAL_COMMAND = "workit workspace seal";
|
|
6465
|
+
|
|
6463
6466
|
// packages/workit-core/src/core/workspaces.ts
|
|
6464
6467
|
var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must not be blank"));
|
|
6465
6468
|
var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
|
|
@@ -6882,7 +6885,7 @@ var resolveWorkspaceFromEntries = (cwd, entries, workspaceName, remotes) => {
|
|
|
6882
6885
|
var runtimeWorkspaceIndexSchema = looseObject({
|
|
6883
6886
|
workspaces: optional(array(looseObject({ name: nonBlank, glob: nonBlank })))
|
|
6884
6887
|
});
|
|
6885
|
-
var matchRuntimeWorkspace = (cwd, dir = configDir2()) => {
|
|
6888
|
+
var matchRuntimeWorkspace = (cwd, dir = configDir2(), workspaceName = namedWorkspace()) => {
|
|
6886
6889
|
const file = path6.join(dir, "workspaces.json");
|
|
6887
6890
|
let raw;
|
|
6888
6891
|
try {
|
|
@@ -6909,12 +6912,16 @@ var matchRuntimeWorkspace = (cwd, dir = configDir2()) => {
|
|
|
6909
6912
|
if (!glob.ok)
|
|
6910
6913
|
throw new WorkspaceConfigError(`${file} workspace ${entry.name}: ${glob.error}`);
|
|
6911
6914
|
}
|
|
6912
|
-
const
|
|
6913
|
-
|
|
6915
|
+
const matched = matchAmong(cwd, entries ?? [], workspaceName);
|
|
6916
|
+
return matched ? { file, ...matched } : null;
|
|
6917
|
+
};
|
|
6918
|
+
var namedWorkspace = () => process.env.WORKIT_WORKSPACE_NAME?.trim() || null;
|
|
6919
|
+
var matchAmong = (cwd, entries, workspaceName = namedWorkspace()) => {
|
|
6920
|
+
const selected = resolveWorkspaceFromEntries(cwd, entries, workspaceName ?? undefined, true);
|
|
6914
6921
|
if (!selected)
|
|
6915
6922
|
return null;
|
|
6916
|
-
const matches = matchingEntries(cwd, entries
|
|
6917
|
-
return {
|
|
6923
|
+
const matches = matchingEntries(cwd, entries);
|
|
6924
|
+
return { selected, matches: matches.length ? matches : [selected] };
|
|
6918
6925
|
};
|
|
6919
6926
|
var modelSources = (cwd, dir) => {
|
|
6920
6927
|
const out = [];
|
|
@@ -7224,7 +7231,7 @@ var takeMoveLock = (target) => {
|
|
|
7224
7231
|
pause(25);
|
|
7225
7232
|
}
|
|
7226
7233
|
};
|
|
7227
|
-
var
|
|
7234
|
+
var canonical4 = (dir) => {
|
|
7228
7235
|
try {
|
|
7229
7236
|
return fs4.realpathSync.native(dir);
|
|
7230
7237
|
} catch {
|
|
@@ -7235,13 +7242,13 @@ var below = (parent, child) => {
|
|
|
7235
7242
|
const rel = path7.relative(parent, child);
|
|
7236
7243
|
return rel !== "" && !rel.startsWith("..") && !path7.isAbsolute(rel);
|
|
7237
7244
|
};
|
|
7238
|
-
var insideTempDir = (dir, tempDir = os5.tmpdir()) => below(
|
|
7245
|
+
var insideTempDir = (dir, tempDir = os5.tmpdir()) => below(canonical4(tempDir), canonical4(dir));
|
|
7239
7246
|
var TEST_RUN_REFUSALS = "folder-store-refusals.log";
|
|
7240
7247
|
var testRunFolderRefusal = (folder, hasStray, env = process.env, tempDir = os5.tmpdir()) => {
|
|
7241
7248
|
if (env.WORKIT_TEST_RUN === undefined || !hasStray)
|
|
7242
7249
|
return null;
|
|
7243
|
-
const real =
|
|
7244
|
-
const tmp =
|
|
7250
|
+
const real = canonical4(folder);
|
|
7251
|
+
const tmp = canonical4(tempDir);
|
|
7245
7252
|
if (insideTempDir(folder, tempDir))
|
|
7246
7253
|
return null;
|
|
7247
7254
|
return `workit test run (WORKIT_TEST_RUN): refusing to move ${path7.join(real, ".workit")} into the run's throwaway state dir; a test must work in a fresh dir inside ${tmp}, never the temp dir itself, a parent of it or a folder outside it (#892)`;
|
|
@@ -8426,9 +8433,6 @@ Skills: load the skill, never act from memory.
|
|
|
8426
8433
|
- retro (user-invoked; offer it): workit-retro
|
|
8427
8434
|
- architecture, deepen modules (user-invoked; offer it): workit-architecture
|
|
8428
8435
|
`.trim();
|
|
8429
|
-
// packages/workit-core/src/core/grant-seal.ts
|
|
8430
|
-
var SEAL_COMMAND = "workit workspace seal";
|
|
8431
|
-
|
|
8432
8436
|
// packages/workit-core/src/forge/redact.ts
|
|
8433
8437
|
var NAME = "[A-Za-z0-9_.-]";
|
|
8434
8438
|
var KEY = String.raw`(?<!${NAME})(?=${NAME}*?(?:token|secret|password|passwd|pwd|api[_-]?key|access[_-]?key|account[_-]?key|private[_-]?key|client[_-]?secret|credentials?|authorization|cookie|signature))${NAME}+`;
|
|
@@ -8456,7 +8460,14 @@ var SCOPE_FIELDS = new Set([
|
|
|
8456
8460
|
"autoApprove",
|
|
8457
8461
|
"defaultEndpoint",
|
|
8458
8462
|
"verification",
|
|
8459
|
-
"youtrack"
|
|
8463
|
+
"youtrack",
|
|
8464
|
+
"releaseNotes",
|
|
8465
|
+
"releaseTagPrefix",
|
|
8466
|
+
"branchPolicy",
|
|
8467
|
+
"profiles",
|
|
8468
|
+
"defaultProfile",
|
|
8469
|
+
"releaseTracks",
|
|
8470
|
+
"releasePackages"
|
|
8460
8471
|
]);
|
|
8461
8472
|
|
|
8462
8473
|
// packages/workit-core/src/core/release-packages.ts
|
|
@@ -8567,6 +8578,46 @@ var API_VALUES = new Set(["--method", "--header", "--raw-field", "--field", "--j
|
|
|
8567
8578
|
"--output"
|
|
8568
8579
|
]));
|
|
8569
8580
|
var API_FIELDS = new Set(["-f", "-F", "--raw-field", "--field"]);
|
|
8581
|
+
var GH_REPO_PATH = String.raw`(?:^|\/)(?:repos\/[^/]+\/[^/]+|repositories\/[^/]+)`;
|
|
8582
|
+
var ghPath = (rest) => new RegExp(`${GH_REPO_PATH}\\/${rest}(?:\\/|$)`, "i");
|
|
8583
|
+
var called = (names) => new RegExp(String.raw`\b(?:${names})(?:[\s,\uFEFF]|#[^\n\r]*[\n\r])*\(`);
|
|
8584
|
+
var GRAPHQL_REF = [
|
|
8585
|
+
[called("createRef|updateRefs?|deleteRef"), "ref"],
|
|
8586
|
+
[
|
|
8587
|
+
called("createCommitOnBranch|createLinkedBranch|createBranch|branchDelete|commitCreate"),
|
|
8588
|
+
"branch"
|
|
8589
|
+
],
|
|
8590
|
+
[called("tagCreate|tagDelete"), "tag"]
|
|
8591
|
+
];
|
|
8592
|
+
var GRAPHQL_SETTING = called("(?:create|update|delete)(?:BranchProtectionRule|RepositoryRuleset)|branchRule(?:Create|Update|Delete)");
|
|
8593
|
+
var API_REF = {
|
|
8594
|
+
gh: [
|
|
8595
|
+
[ghPath(String.raw`git\/refs?`), "ref"],
|
|
8596
|
+
[ghPath(String.raw`(?:branches\/.+\/rename|merge-upstream|contents)`), "branch"]
|
|
8597
|
+
],
|
|
8598
|
+
glab: [
|
|
8599
|
+
[/(?:^|\/)repository\/tags(?:\/|$)/i, "tag"],
|
|
8600
|
+
[/(?:^|\/)repository\/(?:branches|merged_branches|files|submodules)(?:\/|$)/i, "branch"],
|
|
8601
|
+
[/(?:^|\/)repository\/commits(?:\/[^/]+\/(?:cherry_pick|revert))?\/?$/i, "branch"]
|
|
8602
|
+
]
|
|
8603
|
+
};
|
|
8604
|
+
var API_SETTING = {
|
|
8605
|
+
gh: [
|
|
8606
|
+
ghPath(String.raw`(?:branches\/.+|tags)\/protection`),
|
|
8607
|
+
ghPath("rulesets"),
|
|
8608
|
+
ghPath(String.raw`environments\/[^/]+\/deployment-branch-policies`),
|
|
8609
|
+
/(?:^|\/)orgs\/[^/]+\/rulesets(?:\/|$)/i
|
|
8610
|
+
],
|
|
8611
|
+
glab: [
|
|
8612
|
+
/(?:^|\/)(?:projects|groups)\/[^/]+\/protected_(?:branches|tags)(?:\/|$)/i,
|
|
8613
|
+
/(?:^|\/)projects\/[^/]+\/push_rule(?:\/|$)/i
|
|
8614
|
+
]
|
|
8615
|
+
};
|
|
8616
|
+
var API_REPOSITORY = {
|
|
8617
|
+
gh: new RegExp(`${GH_REPO_PATH}\\/?$`, "i"),
|
|
8618
|
+
glab: /(?:^|\/)projects\/[^/]+\/?$/i
|
|
8619
|
+
};
|
|
8620
|
+
var BY_ID = called("updateRefs?|deleteRef");
|
|
8570
8621
|
var GIT_COMMANDS = new Set(("add am annotate apply archive bisect blame branch bugreport bundle cat-file check-attr " + "check-ignore check-mailmap check-ref-format checkout checkout-index cherry cherry-pick " + "citool clean clone column commit commit-graph commit-tree config count-objects credential " + "daemon describe diagnose diff diff-files diff-index diff-tree difftool fast-export " + "fast-import fetch fetch-pack filter-branch fmt-merge-msg for-each-ref for-each-repo " + "format-patch fsck gc get-tar-commit-id grep gui hash-object help hook index-pack init " + "instaweb interpret-trailers lfs log ls-files ls-remote ls-tree mailinfo mailsplit " + "maintenance merge merge-base merge-file merge-index merge-tree mergetool mktag mktree " + "multi-pack-index mv name-rev notes pack-objects pack-refs patch-id prune pull push " + "range-diff read-tree rebase reflog remote repack replace request-pull rerere reset " + "restore rev-list rev-parse revert rm send-email shortlog show show-branch show-ref " + "sparse-checkout stage stash status stripspace submodule subtree switch symbolic-ref tag " + "update-index update-ref var verify-commit verify-pack verify-tag version whatchanged " + "worktree write-tree").split(" "));
|
|
8571
8622
|
|
|
8572
8623
|
// packages/workit-core/src/core/route-intent.ts
|