@workit-dev/codex 2.28.0 → 2.29.1
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/.codex-plugin/plugin.json +1 -1
- package/dist/launch-mcp.js +200 -69
- package/dist/{workit-hook-kdr9kpqg.js → workit-hook-msgjv4q2.js} +1360 -1079
- package/dist/workit-hook.js +1 -1
- package/package.json +3 -3
package/dist/launch-mcp.js
CHANGED
|
@@ -14733,6 +14733,101 @@ var checkoutRemotes = (cwd) => {
|
|
|
14733
14733
|
}
|
|
14734
14734
|
return out;
|
|
14735
14735
|
};
|
|
14736
|
+
var TRANSPORT_ENV = ["GIT_SSH", "GIT_SSH_COMMAND", "GIT_PROXY_COMMAND"];
|
|
14737
|
+
var userGitSeam = { home: accountHome };
|
|
14738
|
+
var realOrSelf = (file) => {
|
|
14739
|
+
try {
|
|
14740
|
+
return realpathSync3.native(file);
|
|
14741
|
+
} catch {
|
|
14742
|
+
return path6.resolve(file);
|
|
14743
|
+
}
|
|
14744
|
+
};
|
|
14745
|
+
var userLevel = (scope, origin) => {
|
|
14746
|
+
if (scope === "system")
|
|
14747
|
+
return process.env.GIT_CONFIG_SYSTEM === undefined;
|
|
14748
|
+
if (scope !== "global" || !origin.startsWith("file:"))
|
|
14749
|
+
return false;
|
|
14750
|
+
const file = realOrSelf(origin.slice("file:".length));
|
|
14751
|
+
const home = userGitSeam.home();
|
|
14752
|
+
if (home === null)
|
|
14753
|
+
return false;
|
|
14754
|
+
return [path6.join(home, ".gitconfig"), path6.join(home, ".config", "git", "config")].map(realOrSelf).includes(file);
|
|
14755
|
+
};
|
|
14756
|
+
var escapeRegex2 = (value) => value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
14757
|
+
var transportOverride = (git, remote, vars) => {
|
|
14758
|
+
const env = TRANSPORT_ENV.find((name) => vars[name]);
|
|
14759
|
+
if (env)
|
|
14760
|
+
return env;
|
|
14761
|
+
const execPath = vars.GIT_EXEC_PATH;
|
|
14762
|
+
if (execPath) {
|
|
14763
|
+
const { GIT_EXEC_PATH: _set, ...rest } = vars;
|
|
14764
|
+
const own = spawnSync5("git", ["--exec-path"], {
|
|
14765
|
+
env: rest,
|
|
14766
|
+
encoding: "utf8"
|
|
14767
|
+
});
|
|
14768
|
+
if (own.status !== 0 || realOrSelf(own.stdout.trim()) !== realOrSelf(execPath))
|
|
14769
|
+
return "GIT_EXEC_PATH";
|
|
14770
|
+
}
|
|
14771
|
+
const name = escapeRegex2(remote);
|
|
14772
|
+
const run = git([
|
|
14773
|
+
"config",
|
|
14774
|
+
"--show-scope",
|
|
14775
|
+
"--show-origin",
|
|
14776
|
+
"--get-regexp",
|
|
14777
|
+
`^(remote\\.${name}\\.(receivepack|vcs)|core\\.(sshcommand|gitproxy))$`
|
|
14778
|
+
]);
|
|
14779
|
+
if (run.status === 1)
|
|
14780
|
+
return null;
|
|
14781
|
+
if (run.status !== 0)
|
|
14782
|
+
return "a git config that cannot be read";
|
|
14783
|
+
for (const line of String(run.stdout).split(/\r?\n/u)) {
|
|
14784
|
+
const match = /^(\S+)\t(.*?)\t(\S+)(?: |$)/u.exec(line);
|
|
14785
|
+
if (!match)
|
|
14786
|
+
continue;
|
|
14787
|
+
const [, scope, origin, key] = match;
|
|
14788
|
+
if (key === "core.sshcommand" && userLevel(scope, origin))
|
|
14789
|
+
continue;
|
|
14790
|
+
return `${key} (${scope} ${origin})`;
|
|
14791
|
+
}
|
|
14792
|
+
return null;
|
|
14793
|
+
};
|
|
14794
|
+
var pushTarget = (cwd, remote, replay = {}) => {
|
|
14795
|
+
const env = { ...process.env, ...replay.env };
|
|
14796
|
+
for (const name of ["GIT_DIR", "GIT_WORK_TREE", "GIT_COMMON_DIR", "GIT_INDEX_FILE"])
|
|
14797
|
+
delete env[name];
|
|
14798
|
+
if (!remote || remote.startsWith("-"))
|
|
14799
|
+
return Error(`push remote ${JSON.stringify(remote)} cannot be resolved`);
|
|
14800
|
+
const git = (args) => spawnSync5("git", [...replay.config ?? [], ...args], {
|
|
14801
|
+
cwd,
|
|
14802
|
+
env,
|
|
14803
|
+
encoding: "utf8",
|
|
14804
|
+
timeout: 5000,
|
|
14805
|
+
windowsHide: true
|
|
14806
|
+
});
|
|
14807
|
+
const override = transportOverride(git, remote, env);
|
|
14808
|
+
if (override)
|
|
14809
|
+
return Error(`${override} decides what the push to ${remote} reaches, not its URL, so its target is unknown`);
|
|
14810
|
+
const run = git(["remote", "get-url", "--push", "--all", remote]);
|
|
14811
|
+
const urls = run.status === 0 ? run.stdout.split(/\r?\n/u).map((url) => url.trim()) : run.status === 2 ? [remote] : [];
|
|
14812
|
+
if (!urls.some(Boolean))
|
|
14813
|
+
return Error(`git could not resolve the push URLs of remote ${remote} in ${cwd}`);
|
|
14814
|
+
let top;
|
|
14815
|
+
const base = () => {
|
|
14816
|
+
if (top === undefined) {
|
|
14817
|
+
const at = git(["rev-parse", "--show-toplevel"]);
|
|
14818
|
+
top = at.status === 0 && at.stdout.trim() ? at.stdout.trim() : cwd;
|
|
14819
|
+
}
|
|
14820
|
+
return top;
|
|
14821
|
+
};
|
|
14822
|
+
const remotes = [];
|
|
14823
|
+
for (const url of urls.filter(Boolean)) {
|
|
14824
|
+
const key = remoteKey(url, base);
|
|
14825
|
+
if (key === null)
|
|
14826
|
+
return Error(`remote ${remote} has a push URL that names no repository workit can read: ${url}`);
|
|
14827
|
+
remotes.push({ name: remote, url, key });
|
|
14828
|
+
}
|
|
14829
|
+
return { remotes };
|
|
14830
|
+
};
|
|
14736
14831
|
|
|
14737
14832
|
// packages/workit-core/src/core/workspaces.ts
|
|
14738
14833
|
var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must not be blank"));
|
|
@@ -14840,7 +14935,7 @@ var workspaceConfigSchema = looseObject({
|
|
|
14840
14935
|
})),
|
|
14841
14936
|
models: optional(looseObject({ roles: modelRoles })),
|
|
14842
14937
|
resources: optional(unknown()),
|
|
14843
|
-
remotes: optional(array(nonBlank.check(refine((pattern) =>
|
|
14938
|
+
remotes: optional(array(nonBlank.check(refine((pattern) => isRemotePattern(pattern), "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))),
|
|
14844
14939
|
externalRepos: 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")))),
|
|
14845
14940
|
additiveRiskPaths: optional(array(nonBlank)),
|
|
14846
14941
|
autonomy: optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
@@ -15209,6 +15304,7 @@ var canonicalGlob = (glob) => {
|
|
|
15209
15304
|
return real + (prefix.endsWith("/") ? "/" : "") + rest;
|
|
15210
15305
|
};
|
|
15211
15306
|
var globSpecificity = (glob) => glob.replaceAll("\\", "/").split("/").filter((segment) => segment.length > 0 && !/[*?[\]{]/.test(segment)).length;
|
|
15307
|
+
var workspaceMatches = (cwd, entries) => matchingEntries(cwd, entries);
|
|
15212
15308
|
var selectWorkspaceMatch = (matches, cwd, workspaceName) => {
|
|
15213
15309
|
if (workspaceName !== undefined) {
|
|
15214
15310
|
const named = matches.filter((entry) => entry.name === workspaceName);
|
|
@@ -15230,15 +15326,32 @@ var selectWorkspaceMatch = (matches, cwd, workspaceName) => {
|
|
|
15230
15326
|
}
|
|
15231
15327
|
return mostSpecific[0];
|
|
15232
15328
|
};
|
|
15233
|
-
var
|
|
15234
|
-
|
|
15235
|
-
|
|
15329
|
+
var HOSTLESS_REMOTE = /^[\w-]+\/\*$/u;
|
|
15330
|
+
var expandRemotePattern = (entry, pattern) => {
|
|
15331
|
+
if (!HOSTLESS_REMOTE.test(pattern.trim()))
|
|
15332
|
+
return pattern;
|
|
15333
|
+
const vcs = entry.vcs ?? {};
|
|
15334
|
+
const host = typeof vcs.host === "string" && vcs.host.trim().replace(/^https?:\/\/|\/.*$/giu, "") || `${vcs.provider === "gitlab" ? "gitlab" : "github"}.com`;
|
|
15335
|
+
return `https://${host}/${pattern.trim()}`;
|
|
15336
|
+
};
|
|
15337
|
+
var isRemotePattern = (pattern) => !!remotePattern(expandRemotePattern({}, pattern));
|
|
15338
|
+
var remoteClaimOf = (entry, key, exact = false) => (Array.isArray(entry.remotes) ? entry.remotes : []).find((pattern) => typeof pattern === "string" && !(exact && pattern.trim().endsWith("/*")) && remoteMatches(expandRemotePattern(entry, pattern), key));
|
|
15339
|
+
var resolveWorkspaceFromEntries = (cwd, entries, workspaceName, remotes) => {
|
|
15340
|
+
const globbed = matchingEntries(cwd, entries);
|
|
15341
|
+
const listed = !remotes || globbed.length || !entries.some((entry) => entry.remotes) ? [] : checkoutRemotes(cwd);
|
|
15342
|
+
const origin = listed instanceof Error ? [] : listed.filter((item) => item.name === "origin");
|
|
15343
|
+
const hits = entries.filter((entry) => origin.length && origin.every((item) => remoteClaimOf(entry, item.key)));
|
|
15344
|
+
const exact = hits.filter((entry) => origin.every((item) => remoteClaimOf(entry, item.key, true)));
|
|
15345
|
+
const ranked = exact.length ? exact : hits;
|
|
15346
|
+
if (workspaceName === undefined && ranked.length > 1)
|
|
15347
|
+
return null;
|
|
15348
|
+
return selectWorkspaceMatch(hits.length ? workspaceName ? hits : ranked : globbed, cwd, workspaceName) ?? null;
|
|
15236
15349
|
};
|
|
15237
|
-
var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
15350
|
+
var resolveWorkspaceFrom = (cwd, dir, workspaceName, remotes) => {
|
|
15238
15351
|
const result = readWorkspacesResult(dir);
|
|
15239
15352
|
if (result.status === "malformed" || result.status === "invalid")
|
|
15240
15353
|
throw new WorkspaceConfigError(result.error);
|
|
15241
|
-
return resolveWorkspaceFromEntries(cwd, result.entries, workspaceName);
|
|
15354
|
+
return resolveWorkspaceFromEntries(cwd, result.entries, workspaceName, remotes);
|
|
15242
15355
|
};
|
|
15243
15356
|
var runtimeWorkspacePolicySchema = (kind) => {
|
|
15244
15357
|
const key = kind === "branch" ? "branchPolicy" : kind === "commit" ? "commitPolicy" : "vcs";
|
|
@@ -15288,10 +15401,12 @@ var matchRuntimeWorkspace = (cwd, dir = configDir2()) => {
|
|
|
15288
15401
|
if (!glob.ok)
|
|
15289
15402
|
throw new WorkspaceConfigError(`${file} workspace ${entry.name}: ${glob.error}`);
|
|
15290
15403
|
}
|
|
15291
|
-
const matches = matchingEntries(cwd, entries ?? []);
|
|
15292
15404
|
const workspaceName = process.env.WORKIT_WORKSPACE_NAME?.trim() || undefined;
|
|
15293
|
-
const selected =
|
|
15294
|
-
|
|
15405
|
+
const selected = resolveWorkspaceFromEntries(cwd, entries ?? [], workspaceName, true);
|
|
15406
|
+
if (!selected)
|
|
15407
|
+
return null;
|
|
15408
|
+
const matches = matchingEntries(cwd, entries ?? []);
|
|
15409
|
+
return { file, selected, matches: matches.length ? matches : [selected] };
|
|
15295
15410
|
};
|
|
15296
15411
|
var resolveRuntimeReleaseTracks = (cwd) => {
|
|
15297
15412
|
const matched = matchRuntimeWorkspace(cwd);
|
|
@@ -24643,6 +24758,7 @@ var ytrackDetail = (out) => out.stderr.trim().split(`
|
|
|
24643
24758
|
var YTRACK_MISSING = "ytrack is not on PATH: Workit reaches YouTrack only through ytrack";
|
|
24644
24759
|
|
|
24645
24760
|
// packages/workit-core/src/autonomy.ts
|
|
24761
|
+
var resolveWorkspaceFrom2 = (cwd, dir, name) => resolveWorkspaceFrom(cwd, dir, name, true);
|
|
24646
24762
|
var accountHomeDir = () => {
|
|
24647
24763
|
const home = grantsHome.resolve();
|
|
24648
24764
|
return home === null ? null : configDir({ HOME: home });
|
|
@@ -24675,11 +24791,11 @@ var accountUnread = () => {
|
|
|
24675
24791
|
};
|
|
24676
24792
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
24677
24793
|
var fileSource = (dir = accountDir()) => ({
|
|
24678
|
-
resolve: (cwd, name) => dir === null ? null :
|
|
24794
|
+
resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom2(cwd, dir, name),
|
|
24679
24795
|
entries: () => entriesIn(dir)
|
|
24680
24796
|
});
|
|
24681
24797
|
var sealedSource = (entries) => ({
|
|
24682
|
-
resolve: (cwd, name) => resolveWorkspaceFromEntries(cwd, entries, name),
|
|
24798
|
+
resolve: (cwd, name) => resolveWorkspaceFromEntries(cwd, entries, name, true),
|
|
24683
24799
|
entries: () => entries
|
|
24684
24800
|
});
|
|
24685
24801
|
var sealOf = () => {
|
|
@@ -24930,7 +25046,8 @@ function resolveWith(source, cwd, world, target) {
|
|
|
24930
25046
|
const above = checkoutsAbove(cwd);
|
|
24931
25047
|
for (const where of above instanceof Error ? [above] : above)
|
|
24932
25048
|
autonomy = capAt(source, autonomy, where, where instanceof Error ? "git" : `checkout ${where}`, "a worktree or submodule never exceeds it", true);
|
|
24933
|
-
|
|
25049
|
+
const own = real && workspaceMatches(cwd, source.entries()).length === 0 ? real : undefined;
|
|
25050
|
+
return capAtRemotes(source, autonomy, cwd, target, own);
|
|
24934
25051
|
}
|
|
24935
25052
|
var needsAccount = (autonomy) => autonomy.configured.length > 0 && !autonomy.accountConfigured;
|
|
24936
25053
|
function stricter(current, sealed, note, unblock) {
|
|
@@ -24969,17 +25086,31 @@ function stricter(current, sealed, note, unblock) {
|
|
|
24969
25086
|
note: current.note ? `${current.note}; ${note}` : note
|
|
24970
25087
|
};
|
|
24971
25088
|
}
|
|
24972
|
-
function capAtRemotes(source, autonomy, cwd, target) {
|
|
25089
|
+
function capAtRemotes(source, autonomy, cwd, target, own) {
|
|
24973
25090
|
const claiming = source.entries().filter((entry) => entry.remotes?.length);
|
|
24974
25091
|
if (claiming.length === 0)
|
|
24975
25092
|
return autonomy;
|
|
24976
25093
|
const remotes = target === undefined ? checkoutRemotes(cwd) : typeof target === "function" ? target() : target;
|
|
24977
25094
|
if (remotes instanceof Error)
|
|
24978
25095
|
return capAt(source, autonomy, remotes, target === undefined ? "git" : "target", "a target that cannot be resolved never raises grants");
|
|
25096
|
+
const listed = Array.isArray(remotes) ? remotes : remotes.remotes;
|
|
25097
|
+
const capped = own ? capAtOwnClaim(source, autonomy, cwd, own, target && listed) : autonomy;
|
|
25098
|
+
return capAtClaims(source, capped, listed, claiming);
|
|
25099
|
+
}
|
|
25100
|
+
function capAtOwnClaim(source, autonomy, cwd, own, judged) {
|
|
25101
|
+
const push = judged ? { remotes: judged } : pushTarget(cwd, pushRemoteName(cwd) ?? "");
|
|
25102
|
+
if (push instanceof Error)
|
|
25103
|
+
return capAt(source, autonomy, push, "push target", "a target that cannot be resolved never raises grants");
|
|
25104
|
+
const unclaimed = push.remotes.filter((remote) => !remoteClaimOf(own, remote.key));
|
|
25105
|
+
if (unclaimed.length === 0 && push.remotes.length > 0)
|
|
25106
|
+
return autonomy;
|
|
25107
|
+
return stricter(autonomy, autonomyOf(null), `${unclaimed.map((remote) => `remote ${remote.name} ${remote.url}`).join(", ") || "no target"}: not in workspace ${own.name}'s remotes, which matched this checkout by its origin; grants capped at the defaults`, `ask the user to add that repository to workspace ${own.name}'s remotes, in their own terminal: workit workspace set ${own.name} remotes=<patterns>`);
|
|
25108
|
+
}
|
|
25109
|
+
function capAtClaims(source, autonomy, listed, claiming) {
|
|
24979
25110
|
let capped = autonomy;
|
|
24980
|
-
for (const remote of
|
|
25111
|
+
for (const remote of listed)
|
|
24981
25112
|
for (const entry of claiming) {
|
|
24982
|
-
const pattern = entry
|
|
25113
|
+
const pattern = remoteClaimOf(entry, remote.key);
|
|
24983
25114
|
if (pattern)
|
|
24984
25115
|
capped = capAt(source, capped, { entry }, `remote ${remote.name} ${remote.url} (workspace ${entry.name} claims ${pattern})`, "a checkout never exceeds the workspace that owns its remote");
|
|
24985
25116
|
}
|
|
@@ -32400,6 +32531,14 @@ var GRANT_TTL_MS = 15 * 60000;
|
|
|
32400
32531
|
var ASKING_HOSTS = new Set(["claude_code", "pi"]);
|
|
32401
32532
|
var INLINE_ASK_TTL_MS = 2 * 60000;
|
|
32402
32533
|
|
|
32534
|
+
// packages/workit-core/src/hooks/cwd-normalize.ts
|
|
32535
|
+
var DIR = String.raw`(?:[A-Za-z0-9_./@%+:,=-]|(?<=[A-Za-z0-9])~)+|'[^'$${"`"}\n]*'|"(?:[^"$${"`"}\\!\n]|\\(?=[^"$${"`"}\\!\n]))*"`;
|
|
32536
|
+
var COMPOUND2 = new RegExp(String.raw`^\s*cd\s+(${DIR})\s*&&\s*(workit(?:\s[\s\S]*)?)$`, "u");
|
|
32537
|
+
var GLOBALS_FIRST = new RegExp(String.raw`^(\s*workit)((?:\s+(?:--json|--cwd(?:=|\s+)(?:${DIR})))+)\s+([a-z][a-z-]*)(?=\s|$)`, "u");
|
|
32538
|
+
var VERBS = new Set(WORKIT_ALLOWED_VERBS);
|
|
32539
|
+
var FILTERS = new Set(["tail", "head", "grep"]);
|
|
32540
|
+
var NPX = new RegExp(String.raw`^(\s*(?:cd\s+(?:${DIR})\s*&&\s*)?)npx(?:\s+(?:-y|--yes))*\s+@workit-dev\/cli(?:@[\w.-]+)?(?=\s|$)`, "u");
|
|
32541
|
+
|
|
32403
32542
|
// packages/workit-core/src/approvals/youtrack-ask.ts
|
|
32404
32543
|
var TIME = "markdown file minutes text date";
|
|
32405
32544
|
var FLAGS = {
|
|
@@ -32411,8 +32550,8 @@ var FLAGS = {
|
|
|
32411
32550
|
};
|
|
32412
32551
|
|
|
32413
32552
|
// packages/workit-core/src/approvals/inline.ts
|
|
32414
|
-
var
|
|
32415
|
-
var OPAQUE_RELEASE_FIX = `workit release --cwd ${
|
|
32553
|
+
var DIR2 = "<dir>";
|
|
32554
|
+
var OPAQUE_RELEASE_FIX = `workit release --cwd ${DIR2} notes approve <version>`;
|
|
32416
32555
|
|
|
32417
32556
|
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
32418
32557
|
var CLAUDE_CODE_DESCRIPTOR = {
|
|
@@ -33046,6 +33185,50 @@ var PI_DESCRIPTOR = {
|
|
|
33046
33185
|
]
|
|
33047
33186
|
};
|
|
33048
33187
|
|
|
33188
|
+
// packages/workit-core/src/hooks/identity-env.ts
|
|
33189
|
+
var NAMES = "WORKIT_(?:AGENT_ID|HOST|SESSION_ID|SESSION_TOKEN)";
|
|
33190
|
+
var IDENTITY = new RegExp(`^${NAMES}$`, "u");
|
|
33191
|
+
var HOST_NAMES = "(?:OPENCODE_SESSION_ID|PI_SESSION_ID|CODEX_THREAD_ID|CLAUDECODE|CLAUDE_CODE_ENTRYPOINT)";
|
|
33192
|
+
var HOST_VARIABLE = new RegExp(`^${HOST_NAMES}$`, "u");
|
|
33193
|
+
var IDENTITY_ANY = new RegExp(NAMES, "iu");
|
|
33194
|
+
var STATE_NAMES = "(?:WORKIT_(?:STATE_DIR|CONFIG(?:_DIR)?)|XDG_(?:STATE|CONFIG|DATA)_HOME|HOME|USERPROFILE|(?:LOCAL)?APPDATA)";
|
|
33195
|
+
var STATE2 = new RegExp(`^${STATE_NAMES}$`, "u");
|
|
33196
|
+
var STATE_ANY = new RegExp(STATE_NAMES, "iu");
|
|
33197
|
+
var powershell = (names) => new RegExp([
|
|
33198
|
+
`\\$\\{?env:${names}\\}?\\s*(?:[-+*/]|\\?\\?)?=(?!=)`,
|
|
33199
|
+
`${PS_ITEM}[^;|\\n]*?(?<![$\\w{])env:[\\\\/]?${names}\\b`,
|
|
33200
|
+
`SetEnvironmentVariable\\(\\s*['"]${names}\\b`
|
|
33201
|
+
].join("|"), "iu");
|
|
33202
|
+
var PS_ITEM = "\\b(?:(?:Set|New|Remove|Clear|Rename|Move|Copy)-Item(?:Property)?|(?:Set|Add|Clear)-Content|si|ni|ri|rm|del|erase|rd|rmdir|cli|sc|ac|clc|rni|mi|move|mv|cpi|copy|cp|ren)\\b";
|
|
33203
|
+
var POWERSHELL = powershell(NAMES);
|
|
33204
|
+
var POWERSHELL_STATE = powershell(STATE_NAMES);
|
|
33205
|
+
var POWERSHELL_HOST = powershell(HOST_NAMES);
|
|
33206
|
+
var POWERSHELL_OPAQUE = new RegExp([
|
|
33207
|
+
`SetEnvironmentVariable\\(\\s*(?:[^'"\\s]|"[^"]*\\$)`,
|
|
33208
|
+
`${PS_ITEM}[^;|\\n]*?(?<![$\\w{])env:[\\\\/]?["']?[$(]`,
|
|
33209
|
+
`(?:^|[;&|{(\\n])\\s*\\.\\s+[^\\s.]`,
|
|
33210
|
+
`\\b(?:iex|Invoke-Expression)\\b`
|
|
33211
|
+
].join("|"), "iu");
|
|
33212
|
+
var cmdSet = (names) => new RegExp(`(?:^|[&|(\\s"])set\\s+(?:/[ap]\\s+)?"?(${names})\\s*\\+?=`, "iu");
|
|
33213
|
+
var CMD_IDENTITY = cmdSet(NAMES);
|
|
33214
|
+
var CMD_STATE = cmdSet(STATE_NAMES);
|
|
33215
|
+
var CMD_HOST = cmdSet(HOST_NAMES);
|
|
33216
|
+
var DECLARES = new Set(["export", "unset", "declare", "typeset", "local", "readonly"]);
|
|
33217
|
+
var OPAQUE = new Set([
|
|
33218
|
+
"watch",
|
|
33219
|
+
"strace",
|
|
33220
|
+
"chroot",
|
|
33221
|
+
"flock",
|
|
33222
|
+
"ssh",
|
|
33223
|
+
"su",
|
|
33224
|
+
"runuser",
|
|
33225
|
+
"script",
|
|
33226
|
+
"parallel"
|
|
33227
|
+
]);
|
|
33228
|
+
var ENV_VALUED = new Set(["u", "C", "S", "a", "P"]);
|
|
33229
|
+
var ENV_FLAGS = new Set(["i", "0", "v"]);
|
|
33230
|
+
var ENV_LONG_VALUED = new Set(["--unset", "--chdir", "--split-string", "--argv0"]);
|
|
33231
|
+
|
|
33049
33232
|
// packages/workit-core/src/hooks/worktree-confine.ts
|
|
33050
33233
|
var CASE_INSENSITIVE2 = process.platform === "darwin" || process.platform === "win32";
|
|
33051
33234
|
var MUTATING_REMOTE = new Set([
|
|
@@ -33069,14 +33252,6 @@ var DESCRIPTORS = {
|
|
|
33069
33252
|
pi: PI_DESCRIPTOR
|
|
33070
33253
|
};
|
|
33071
33254
|
var sinceStart = new Map;
|
|
33072
|
-
// packages/workit-core/src/hooks/cwd-normalize.ts
|
|
33073
|
-
var DIR2 = String.raw`(?:[A-Za-z0-9_./@%+:,=-]|(?<=[A-Za-z0-9])~)+|'[^'$${"`"}\n]*'|"(?:[^"$${"`"}\\!\n]|\\(?=[^"$${"`"}\\!\n]))*"`;
|
|
33074
|
-
var COMPOUND2 = new RegExp(String.raw`^\s*cd\s+(${DIR2})\s*&&\s*(workit(?:\s[\s\S]*)?)$`, "u");
|
|
33075
|
-
var GLOBALS_FIRST = new RegExp(String.raw`^(\s*workit)((?:\s+(?:--json|--cwd(?:=|\s+)(?:${DIR2})))+)\s+([a-z][a-z-]*)(?=\s|$)`, "u");
|
|
33076
|
-
var VERBS = new Set(WORKIT_ALLOWED_VERBS);
|
|
33077
|
-
var FILTERS = new Set(["tail", "head", "grep"]);
|
|
33078
|
-
var NPX = new RegExp(String.raw`^(\s*(?:cd\s+(?:${DIR2})\s*&&\s*)?)npx(?:\s+(?:-y|--yes))*\s+@workit-dev\/cli(?:@[\w.-]+)?(?=\s|$)`, "u");
|
|
33079
|
-
|
|
33080
33255
|
// packages/workit-core/src/hooks/model-limit.ts
|
|
33081
33256
|
var MONTHS = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
|
|
33082
33257
|
var WEEKDAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
@@ -33165,50 +33340,6 @@ var KEYWORDS2 = new Set([
|
|
|
33165
33340
|
]);
|
|
33166
33341
|
var READERS2 = new Set(("cat less more head tail ls dir stat file wc grep egrep fgrep rg ag diff cmp sha256sum md5sum " + "shasum du bat echo printf cp mv rm chmod touch mkdir realpath readlink dirname basename tee " + "oxfmt oxlint prettier eslint tsc gh jq sort uniq cut tr nl od xxd hexdump strings code vim " + "nano sed get-content gc type select-string get-childitem test-path").split(" "));
|
|
33167
33342
|
|
|
33168
|
-
// packages/workit-core/src/hooks/identity-env.ts
|
|
33169
|
-
var NAMES = "WORKIT_(?:AGENT_ID|HOST|SESSION_ID|SESSION_TOKEN)";
|
|
33170
|
-
var IDENTITY = new RegExp(`^${NAMES}$`, "u");
|
|
33171
|
-
var HOST_NAMES = "(?:OPENCODE_SESSION_ID|PI_SESSION_ID|CODEX_THREAD_ID|CLAUDECODE|CLAUDE_CODE_ENTRYPOINT)";
|
|
33172
|
-
var HOST_VARIABLE = new RegExp(`^${HOST_NAMES}$`, "u");
|
|
33173
|
-
var IDENTITY_ANY = new RegExp(NAMES, "iu");
|
|
33174
|
-
var STATE_NAMES = "(?:WORKIT_(?:STATE_DIR|CONFIG(?:_DIR)?)|XDG_(?:STATE|CONFIG|DATA)_HOME|HOME|USERPROFILE|(?:LOCAL)?APPDATA)";
|
|
33175
|
-
var STATE2 = new RegExp(`^${STATE_NAMES}$`, "u");
|
|
33176
|
-
var STATE_ANY = new RegExp(STATE_NAMES, "iu");
|
|
33177
|
-
var powershell = (names) => new RegExp([
|
|
33178
|
-
`\\$\\{?env:${names}\\}?\\s*(?:[-+*/]|\\?\\?)?=(?!=)`,
|
|
33179
|
-
`${PS_ITEM}[^;|\\n]*?(?<![$\\w{])env:[\\\\/]?${names}\\b`,
|
|
33180
|
-
`SetEnvironmentVariable\\(\\s*['"]${names}\\b`
|
|
33181
|
-
].join("|"), "iu");
|
|
33182
|
-
var PS_ITEM = "\\b(?:(?:Set|New|Remove|Clear|Rename|Move|Copy)-Item(?:Property)?|(?:Set|Add|Clear)-Content|si|ni|ri|rm|del|erase|rd|rmdir|cli|sc|ac|clc|rni|mi|move|mv|cpi|copy|cp|ren)\\b";
|
|
33183
|
-
var POWERSHELL = powershell(NAMES);
|
|
33184
|
-
var POWERSHELL_STATE = powershell(STATE_NAMES);
|
|
33185
|
-
var POWERSHELL_HOST = powershell(HOST_NAMES);
|
|
33186
|
-
var POWERSHELL_OPAQUE = new RegExp([
|
|
33187
|
-
`SetEnvironmentVariable\\(\\s*(?:[^'"\\s]|"[^"]*\\$)`,
|
|
33188
|
-
`${PS_ITEM}[^;|\\n]*?(?<![$\\w{])env:[\\\\/]?["']?[$(]`,
|
|
33189
|
-
`(?:^|[;&|{(\\n])\\s*\\.\\s+[^\\s.]`,
|
|
33190
|
-
`\\b(?:iex|Invoke-Expression)\\b`
|
|
33191
|
-
].join("|"), "iu");
|
|
33192
|
-
var cmdSet = (names) => new RegExp(`(?:^|[&|(\\s"])set\\s+(?:/[ap]\\s+)?"?(${names})\\s*\\+?=`, "iu");
|
|
33193
|
-
var CMD_IDENTITY = cmdSet(NAMES);
|
|
33194
|
-
var CMD_STATE = cmdSet(STATE_NAMES);
|
|
33195
|
-
var CMD_HOST = cmdSet(HOST_NAMES);
|
|
33196
|
-
var DECLARES = new Set(["export", "unset", "declare", "typeset", "local", "readonly"]);
|
|
33197
|
-
var OPAQUE = new Set([
|
|
33198
|
-
"watch",
|
|
33199
|
-
"strace",
|
|
33200
|
-
"chroot",
|
|
33201
|
-
"flock",
|
|
33202
|
-
"ssh",
|
|
33203
|
-
"su",
|
|
33204
|
-
"runuser",
|
|
33205
|
-
"script",
|
|
33206
|
-
"parallel"
|
|
33207
|
-
]);
|
|
33208
|
-
var ENV_VALUED = new Set(["u", "C", "S", "a", "P"]);
|
|
33209
|
-
var ENV_FLAGS = new Set(["i", "0", "v"]);
|
|
33210
|
-
var ENV_LONG_VALUED = new Set(["--unset", "--chdir", "--split-string", "--argv0"]);
|
|
33211
|
-
|
|
33212
33343
|
// packages/workit-core/src/hooks/handle.ts
|
|
33213
33344
|
var offered = new Set;
|
|
33214
33345
|
var PRE_TOOL = new Set(["shell.pre", "write.pre", "tool.pre"]);
|