@workit-dev/codex 2.26.1 → 2.26.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "2.26.1",
3
+ "version": "2.26.2",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -11864,11 +11864,6 @@ if (!globalConfig.localeError)
11864
11864
  config(en_default());
11865
11865
  if (!globalConfig.memoizer)
11866
11866
  config({ memoizer: memoizer() });
11867
- var described = (schema, description) => {
11868
- const copy = schema.clone();
11869
- globalRegistry.add(copy, { description });
11870
- return copy;
11871
- };
11872
11867
 
11873
11868
  // packages/workit-core/src/core/scope-glob.ts
11874
11869
  var GLOB = /[*?[\]{}]/u;
@@ -14744,25 +14739,25 @@ var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must
14744
14739
  var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
14745
14740
  var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
14746
14741
  var workspaceBranchPolicySchema = strictObject({
14747
- preset: described(branchPreset, "The branch model: gitflow, github-flow, trunk-based or custom (allowed/protected set by hand)."),
14748
- developBranch: described(optional(nonBlank), "The integration branch gitflow uses (default develop)."),
14749
- prefixes: described(optional(looseObject({
14742
+ preset: branchPreset,
14743
+ developBranch: optional(nonBlank),
14744
+ prefixes: optional(looseObject({
14750
14745
  feature: nonBlank,
14751
14746
  bugfix: nonBlank,
14752
14747
  release: nonBlank,
14753
14748
  hotfix: nonBlank
14754
- })), "The branch prefix per kind (feature/, bugfix/, release/, hotfix/)."),
14755
- allowed: described(optional(array(nonBlank)), "Branch name globs a new branch must match (`feature/*`)."),
14756
- protected: described(optional(array(nonBlank)), "Branches nobody commits or pushes to directly."),
14757
- integration: described(optional(_enum(["pr", "merge"])), "How work reaches its base: `pr` (default) opens a PR, `merge` merges locally.")
14749
+ })),
14750
+ allowed: optional(array(nonBlank)),
14751
+ protected: optional(array(nonBlank)),
14752
+ integration: optional(_enum(["pr", "merge"]))
14758
14753
  });
14759
14754
  var workspaceCommitPolicySchema = strictObject({
14760
- preset: described(commitPreset, "The commit message flavor, e.g. conventional."),
14761
- pattern: described(optional(string2()), "A regular expression every commit subject must match.")
14755
+ preset: commitPreset,
14756
+ pattern: optional(string2())
14762
14757
  });
14763
14758
  var workspaceProfileSchema = strictObject({
14764
- branchPolicy: described(optional(workspaceBranchPolicySchema), "This profile's branch policy."),
14765
- commitPolicy: described(optional(workspaceCommitPolicySchema), "This profile's commit policy.")
14759
+ branchPolicy: optional(workspaceBranchPolicySchema),
14760
+ commitPolicy: optional(workspaceCommitPolicySchema)
14766
14761
  }).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
14767
14762
  var versionSourceSchema = discriminatedUnion("kind", [
14768
14763
  strictObject({
@@ -14774,22 +14769,22 @@ var versionSourceSchema = discriminatedUnion("kind", [
14774
14769
  strictObject({ kind: literal("manual") })
14775
14770
  ]);
14776
14771
  var releaseTrackSchema = looseObject({
14777
- strategy: described(optional(branchPreset), "The branch model this track follows."),
14778
- productionBranch: described(nonBlank, "The branch releases land on (main)."),
14779
- integrationBranch: described(nonBlank, "The branch work integrates into (develop)."),
14780
- naming: described(optional(looseObject({
14772
+ strategy: optional(branchPreset),
14773
+ productionBranch: nonBlank,
14774
+ integrationBranch: nonBlank,
14775
+ naming: optional(looseObject({
14781
14776
  feature: optional(nonBlank),
14782
14777
  release: optional(nonBlank),
14783
14778
  hotfix: optional(nonBlank)
14784
- })), "Branch name templates per kind, e.g. `feature/{name}`."),
14785
- baseBranch: described(optional(nonBlank), "The branch new work starts from."),
14786
- mergeBackBranches: described(optional(array(nonBlank)), "Branches a finished release or hotfix is merged back into."),
14787
- pullRequestTarget: described(optional(nonBlank), "The branch PRs target."),
14788
- tagNamespace: described(optional(string2()), "A prefix for this track's release tags."),
14789
- versionSource: described(optional(versionSourceSchema), "Where the version comes from: package-json, git-tag or manual."),
14790
- requiredChecks: described(optional(array(nonBlank)), "CI checks that must pass before a release."),
14791
- critical: described(optional(array(nonBlank)), "Fields an older Workit must not ignore: when one is unknown or malformed, Workit fails closed."),
14792
- releaseNotes: described(optional(unknown()), "This track's release notes mode, over the workspace's `releaseNotes`.")
14779
+ })),
14780
+ baseBranch: optional(nonBlank),
14781
+ mergeBackBranches: optional(array(nonBlank)),
14782
+ pullRequestTarget: optional(nonBlank),
14783
+ tagNamespace: optional(string2()),
14784
+ versionSource: optional(versionSourceSchema),
14785
+ requiredChecks: optional(array(nonBlank)),
14786
+ critical: optional(array(nonBlank)),
14787
+ releaseNotes: optional(unknown())
14793
14788
  }).check(superRefine((track, context) => {
14794
14789
  for (const [field, values] of [
14795
14790
  ["mergeBackBranches", track.mergeBackBranches ?? []],
@@ -14811,67 +14806,67 @@ var releaseTrackSchema = looseObject({
14811
14806
  });
14812
14807
  }
14813
14808
  }));
14814
- var modelRoles = described(optional(unknown()), "Per role (decider, implementer, verifier, reviewer, explore, babysit, default for a general-purpose spawn): a model name, `{ model, effort }`, or one of those per host (claude_code, opencode, codex, codex_cli, codex_desktop, cursor, pi, default). The implementer takes one per tier (mundane, standard, hard).");
14809
+ var modelRoles = optional(unknown());
14815
14810
  var workspaceConfigSchema = looseObject({
14816
- name: described(nonBlank, "The workspace's unique name."),
14817
- glob: described(nonBlank, "The directories this entry covers, an absolute path glob with * and ** (`/home/you/work/**`); the narrowest match wins."),
14818
- vcs: described(optional(looseObject({
14819
- provider: described(_enum(["gitlab", "github"]), "The forge: github or gitlab."),
14820
- defaultTargetBranch: described(optional(nonBlank), "The branch PRs target by default."),
14821
- tokenFile: described(optional(nonBlank), "A file holding the forge token for this workspace."),
14822
- account: described(optional(nonBlank), "The forge login delivery runs as; grants need it to reach the forge."),
14823
- host: described(optional(unknown()), "A self-hosted forge's host name.")
14824
- })), "The forge this workspace's repositories live on."),
14825
- autoApprove: described(optional(union([boolean2(), array(nonBlank)])), "Legacy (≤4.x) standing approvals, read once as autonomy grants; use `autonomy`."),
14826
- defaultEndpoint: described(optional(unknown()), "Where an unnamed request stops: commit (default), pr, green or merged. Set with `workit grant set`, like grants."),
14827
- verification: described(optional(_enum(["proportional", "self", "independent"])), "How a normal-risk behavior change is verified: proportional (default), self or independent. Set with `workit grant set`, like grants."),
14828
- delegation: described(optional(unknown()), "Who does the work: `inline-first` (default) keeps the lead working itself and refuses a slice without a reason to delegate; `lead-orchestrates` allows slices without one."),
14829
- changelog: described(optional(unknown()), "The Keep a Changelog step before a PR opens: `off` (default), `update` (an existing CHANGELOG.md needs an Unreleased entry from a user-facing PR) or `create` (the entry is required, creating the file). `workit pr create` enforces it."),
14830
- docs: described(optional(unknown()), "The docs refresh the ship skill does before a PR opens: `off` (default) or `when-user-facing`."),
14831
- changelogPath: described(optional(unknown()), "Where the changelog lives, repo-relative: one path or glob, or a list (a monorepo with one changelog per package; any of them satisfies the gate). Default CHANGELOG.md at the repo root."),
14832
- prTemplate: described(optional(unknown()), "Which template a PR description fills: `auto` (default: the repo's GitHub/GitLab template, else Workit's), `repo` (the repo's, refused when it has none), `workit` (Workit's Summary/Evidence/Merge danger) or a repo-relative path to one `.md` file."),
14833
- releaseNotes: described(optional(unknown()), "The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
14834
- trailers: described(optional(boolean2()), "Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
14835
- deleteBranch: described(optional(boolean2()), "Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
14836
- 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`."),
14837
- 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.'),
14838
- liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
14839
- 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."),
14840
- fanout: described(optional(looseObject({
14841
- tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
14842
- 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."),
14843
- installTimeout: described(optional(unknown()), "How long the own install may run before its process tree is killed and the worktree is linked instead: a duration such as `90s` or `10m` (default `5m`). `--install-timeout` overrides it.")
14844
- })), "Fanout settings."),
14845
- models: described(optional(looseObject({ roles: modelRoles })), "Model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
14846
- resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
14847
- 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."),
14848
- 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."),
14849
- 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."),
14850
- autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
14811
+ name: nonBlank,
14812
+ glob: nonBlank,
14813
+ vcs: optional(looseObject({
14814
+ provider: _enum(["gitlab", "github"]),
14815
+ defaultTargetBranch: optional(nonBlank),
14816
+ tokenFile: optional(nonBlank),
14817
+ account: optional(nonBlank),
14818
+ host: optional(unknown())
14819
+ })),
14820
+ autoApprove: optional(union([boolean2(), array(nonBlank)])),
14821
+ defaultEndpoint: optional(unknown()),
14822
+ verification: optional(_enum(["proportional", "self", "independent"])),
14823
+ delegation: optional(unknown()),
14824
+ changelog: optional(unknown()),
14825
+ docs: optional(unknown()),
14826
+ changelogPath: optional(unknown()),
14827
+ prTemplate: optional(unknown()),
14828
+ releaseNotes: optional(unknown()),
14829
+ trailers: optional(boolean2()),
14830
+ deleteBranch: optional(boolean2()),
14831
+ cleanup: optional(unknown()),
14832
+ feedback: optional(unknown()),
14833
+ liveSessionGuard: optional(boolean2()),
14834
+ shared: optional(boolean2()),
14835
+ fanout: optional(looseObject({
14836
+ tierModels: optional(unknown()),
14837
+ deps: optional(unknown()),
14838
+ installTimeout: optional(unknown())
14839
+ })),
14840
+ models: optional(looseObject({ roles: modelRoles })),
14841
+ resources: optional(unknown()),
14842
+ remotes: 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/*)")))),
14843
+ 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")))),
14844
+ additiveRiskPaths: optional(array(nonBlank)),
14845
+ autonomy: optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
14851
14846
  kind,
14852
- described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
14853
- ])))), "Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
14854
- youtrack: described(optional(looseObject({
14855
- baseUrl: described(optional(nonBlank), "This workspace's YouTrack URL."),
14856
- link_issues: described(optional(boolean2()), "Legacy alias of `issues: { provider: youtrack, link: true }`."),
14857
- writes: described(optional(_enum(["ask", "auto"])), "ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1."),
14858
- autoHosts: described(optional(array(nonBlank)), "With writes auto: the only YouTrack hosts (`acme.youtrack.cloud`) a write may reach without asking. A raw ytrack write must name one with --host; a write elsewhere asks. Only the user widens it, in their own terminal (`workit workspace seal`).")
14859
- })), "YouTrack settings for this workspace."),
14860
- issues: described(optional(looseObject({
14861
- provider: described(optional(_enum(["github", "gitlab", "youtrack"])), "The issue tracker PRs link to."),
14862
- link: described(optional(boolean2()), "Derive the issue from the branch name."),
14863
- relation: described(optional(unknown()), "How a PR names its issue: `closes` (default) or `refs`."),
14864
- backlink: described(optional(boolean2()), "Post the PR URL on each linked issue after the PR is opened."),
14865
- link_on_pr: described(optional(boolean2()), "Legacy alias of `link`."),
14866
- repo: described(optional(unknown()), "The GitHub/GitLab repository (owner/name) that holds the issues; default the PR's own."),
14867
- host: described(optional(unknown()), "That repository's host; default the PR's host, or the tracker's public one.")
14868
- })), "The issue tracker PRs link to (any forge with any tracker)."),
14869
- branchPolicy: described(optional(workspaceBranchPolicySchema), "Which branches may be created and which are protected."),
14870
- commitPolicy: described(optional(workspaceCommitPolicySchema), "The commit message rules."),
14871
- defaultProfile: described(optional(nonBlank), "The profile used when none is named; must be a key of `profiles`."),
14872
- profiles: described(optional(record(nonBlank, workspaceProfileSchema)), "Named branch/commit policy variants of this workspace."),
14873
- releaseTracks: described(optional(record(nonBlank, releaseTrackSchema)), "Named release tracks: production and integration branches, naming and versioning."),
14874
- releasePackages: described(optional(unknown()), "Packages released from this repository's own release line under their own tag namespace (`pkg-a@0.1.0`): keyed by package name, each `{ tagNamespace?, changelogPath? }` (default namespace `<name>@`). `workit release package <name> <version>` tags and publishes one.")
14847
+ optional(union([boolean2(), literal("verified")]))
14848
+ ])))),
14849
+ youtrack: optional(looseObject({
14850
+ baseUrl: optional(nonBlank),
14851
+ link_issues: optional(boolean2()),
14852
+ writes: optional(_enum(["ask", "auto"])),
14853
+ autoHosts: optional(array(nonBlank))
14854
+ })),
14855
+ issues: optional(looseObject({
14856
+ provider: optional(_enum(["github", "gitlab", "youtrack"])),
14857
+ link: optional(boolean2()),
14858
+ relation: optional(unknown()),
14859
+ backlink: optional(boolean2()),
14860
+ link_on_pr: optional(boolean2()),
14861
+ repo: optional(unknown()),
14862
+ host: optional(unknown())
14863
+ })),
14864
+ branchPolicy: optional(workspaceBranchPolicySchema),
14865
+ commitPolicy: optional(workspaceCommitPolicySchema),
14866
+ defaultProfile: optional(nonBlank),
14867
+ profiles: optional(record(nonBlank, workspaceProfileSchema)),
14868
+ releaseTracks: optional(record(nonBlank, releaseTrackSchema)),
14869
+ releasePackages: optional(unknown())
14875
14870
  }).check(superRefine((workspace, context) => {
14876
14871
  if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
14877
14872
  context.addIssue({
@@ -14882,11 +14877,11 @@ var workspaceConfigSchema = looseObject({
14882
14877
  }
14883
14878
  }));
14884
14879
  var workspacesFileSchema = looseObject({
14885
- workspaces: described(optional(array(workspaceConfigSchema)), "Workspace entries, each mapping a path glob to its forge, policies and grants."),
14886
- models: described(optional(looseObject({ roles: modelRoles })), "The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false)."),
14887
- feedback: described(optional(looseObject({
14888
- account: described(optional(nonBlank), "The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
14889
- })), "`workit feedback` defaults for every workspace.")
14880
+ workspaces: optional(array(workspaceConfigSchema)),
14881
+ models: optional(looseObject({ roles: modelRoles })),
14882
+ feedback: optional(looseObject({
14883
+ account: optional(nonBlank)
14884
+ }))
14890
14885
  }).check(superRefine((file, context) => {
14891
14886
  const names = new Set;
14892
14887
  for (const [index, workspace] of (file.workspaces ?? []).entries()) {
@@ -32159,7 +32154,6 @@ var READ_CMDLETS = new Set([
32159
32154
  "pop-location",
32160
32155
  "help"
32161
32156
  ]);
32162
- var LOADER_ENV = /^(?:GIT_\w*|PAGER|EDITOR|VISUAL|PATH|LD_\w*|DYLD_\w*|NODE_OPTIONS|PYTHON\w*|BASH_ENV|ENV|PERL5(?:OPT|LIB)|RUBY(?:OPT|LIB))$/i;
32163
32157
 
32164
32158
  // packages/workit-core/src/hooks/write-gate.ts
32165
32159
  var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
@@ -32196,7 +32190,6 @@ var PUSHD2 = new Set(["pushd", "push-location"]);
32196
32190
  var POPD2 = new Set(["popd", "pop-location"]);
32197
32191
  var UNKNOWN_DIR = path35.resolve(path35.parse(process.cwd()).root, ".workit-unknown-dir");
32198
32192
  var DECLARERS = new Set(["export", "declare", "typeset", "local", "readonly"]);
32199
- var POSIX_LOADER = new RegExp(LOADER_ENV.source);
32200
32193
  var REBINDS_ANY = new Set([
32201
32194
  "source",
32202
32195
  ".",
@@ -2554,54 +2554,6 @@ function en_default() {
2554
2554
  };
2555
2555
  }
2556
2556
 
2557
- // node_modules/zod/v4/core/registries.js
2558
- var _a2;
2559
- class $ZodRegistry {
2560
- constructor() {
2561
- this._map = new WeakMap;
2562
- this._idmap = new Map;
2563
- }
2564
- add(schema, ..._meta) {
2565
- const meta = _meta[0];
2566
- this._map.set(schema, meta);
2567
- if (meta && typeof meta === "object" && "id" in meta) {
2568
- this._idmap.set(meta.id, schema);
2569
- }
2570
- return this;
2571
- }
2572
- clear() {
2573
- this._map = new WeakMap;
2574
- this._idmap = new Map;
2575
- return this;
2576
- }
2577
- remove(schema) {
2578
- const meta = this._map.get(schema);
2579
- if (meta && typeof meta === "object" && "id" in meta) {
2580
- this._idmap.delete(meta.id);
2581
- }
2582
- this._map.delete(schema);
2583
- return this;
2584
- }
2585
- get(schema) {
2586
- const p = schema._zod.parent;
2587
- if (p) {
2588
- const pm = { ...this.get(p) ?? {} };
2589
- delete pm.id;
2590
- const f = { ...pm, ...this._map.get(schema) };
2591
- return Object.keys(f).length ? f : undefined;
2592
- }
2593
- return this._map.get(schema);
2594
- }
2595
- has(schema) {
2596
- return this._map.has(schema);
2597
- }
2598
- }
2599
- function registry() {
2600
- return new $ZodRegistry;
2601
- }
2602
- (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
2603
- var globalRegistry = globalThis.__zod_globalRegistry;
2604
-
2605
2557
  // node_modules/zod/v4/core/api.js
2606
2558
  function snapshotChecks(def) {
2607
2559
  if (def.checks)
@@ -2981,11 +2933,6 @@ if (!globalConfig.localeError)
2981
2933
  config(en_default());
2982
2934
  if (!globalConfig.memoizer)
2983
2935
  config({ memoizer: memoizer() });
2984
- var described = (schema, description) => {
2985
- const copy = schema.clone();
2986
- globalRegistry.add(copy, { description });
2987
- return copy;
2988
- };
2989
2936
 
2990
2937
  // packages/workit-core/src/core/remotes.ts
2991
2938
  import { lstatSync, readFileSync as readFileSync3, realpathSync as realpathSync2, statSync } from "node:fs";
@@ -4091,25 +4038,25 @@ var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must
4091
4038
  var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
4092
4039
  var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
4093
4040
  var workspaceBranchPolicySchema = strictObject({
4094
- preset: described(branchPreset, "The branch model: gitflow, github-flow, trunk-based or custom (allowed/protected set by hand)."),
4095
- developBranch: described(optional(nonBlank), "The integration branch gitflow uses (default develop)."),
4096
- prefixes: described(optional(looseObject({
4041
+ preset: branchPreset,
4042
+ developBranch: optional(nonBlank),
4043
+ prefixes: optional(looseObject({
4097
4044
  feature: nonBlank,
4098
4045
  bugfix: nonBlank,
4099
4046
  release: nonBlank,
4100
4047
  hotfix: nonBlank
4101
- })), "The branch prefix per kind (feature/, bugfix/, release/, hotfix/)."),
4102
- allowed: described(optional(array(nonBlank)), "Branch name globs a new branch must match (`feature/*`)."),
4103
- protected: described(optional(array(nonBlank)), "Branches nobody commits or pushes to directly."),
4104
- integration: described(optional(_enum(["pr", "merge"])), "How work reaches its base: `pr` (default) opens a PR, `merge` merges locally.")
4048
+ })),
4049
+ allowed: optional(array(nonBlank)),
4050
+ protected: optional(array(nonBlank)),
4051
+ integration: optional(_enum(["pr", "merge"]))
4105
4052
  });
4106
4053
  var workspaceCommitPolicySchema = strictObject({
4107
- preset: described(commitPreset, "The commit message flavor, e.g. conventional."),
4108
- pattern: described(optional(string2()), "A regular expression every commit subject must match.")
4054
+ preset: commitPreset,
4055
+ pattern: optional(string2())
4109
4056
  });
4110
4057
  var workspaceProfileSchema = strictObject({
4111
- branchPolicy: described(optional(workspaceBranchPolicySchema), "This profile's branch policy."),
4112
- commitPolicy: described(optional(workspaceCommitPolicySchema), "This profile's commit policy.")
4058
+ branchPolicy: optional(workspaceBranchPolicySchema),
4059
+ commitPolicy: optional(workspaceCommitPolicySchema)
4113
4060
  }).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
4114
4061
  var versionSourceSchema = discriminatedUnion("kind", [
4115
4062
  strictObject({
@@ -4121,22 +4068,22 @@ var versionSourceSchema = discriminatedUnion("kind", [
4121
4068
  strictObject({ kind: literal("manual") })
4122
4069
  ]);
4123
4070
  var releaseTrackSchema = looseObject({
4124
- strategy: described(optional(branchPreset), "The branch model this track follows."),
4125
- productionBranch: described(nonBlank, "The branch releases land on (main)."),
4126
- integrationBranch: described(nonBlank, "The branch work integrates into (develop)."),
4127
- naming: described(optional(looseObject({
4071
+ strategy: optional(branchPreset),
4072
+ productionBranch: nonBlank,
4073
+ integrationBranch: nonBlank,
4074
+ naming: optional(looseObject({
4128
4075
  feature: optional(nonBlank),
4129
4076
  release: optional(nonBlank),
4130
4077
  hotfix: optional(nonBlank)
4131
- })), "Branch name templates per kind, e.g. `feature/{name}`."),
4132
- baseBranch: described(optional(nonBlank), "The branch new work starts from."),
4133
- mergeBackBranches: described(optional(array(nonBlank)), "Branches a finished release or hotfix is merged back into."),
4134
- pullRequestTarget: described(optional(nonBlank), "The branch PRs target."),
4135
- tagNamespace: described(optional(string2()), "A prefix for this track's release tags."),
4136
- versionSource: described(optional(versionSourceSchema), "Where the version comes from: package-json, git-tag or manual."),
4137
- requiredChecks: described(optional(array(nonBlank)), "CI checks that must pass before a release."),
4138
- critical: described(optional(array(nonBlank)), "Fields an older Workit must not ignore: when one is unknown or malformed, Workit fails closed."),
4139
- releaseNotes: described(optional(unknown()), "This track's release notes mode, over the workspace's `releaseNotes`.")
4078
+ })),
4079
+ baseBranch: optional(nonBlank),
4080
+ mergeBackBranches: optional(array(nonBlank)),
4081
+ pullRequestTarget: optional(nonBlank),
4082
+ tagNamespace: optional(string2()),
4083
+ versionSource: optional(versionSourceSchema),
4084
+ requiredChecks: optional(array(nonBlank)),
4085
+ critical: optional(array(nonBlank)),
4086
+ releaseNotes: optional(unknown())
4140
4087
  }).check(superRefine((track, context) => {
4141
4088
  for (const [field, values] of [
4142
4089
  ["mergeBackBranches", track.mergeBackBranches ?? []],
@@ -4158,67 +4105,67 @@ var releaseTrackSchema = looseObject({
4158
4105
  });
4159
4106
  }
4160
4107
  }));
4161
- var modelRoles = described(optional(unknown()), "Per role (decider, implementer, verifier, reviewer, explore, babysit, default for a general-purpose spawn): a model name, `{ model, effort }`, or one of those per host (claude_code, opencode, codex, codex_cli, codex_desktop, cursor, pi, default). The implementer takes one per tier (mundane, standard, hard).");
4108
+ var modelRoles = optional(unknown());
4162
4109
  var workspaceConfigSchema = looseObject({
4163
- name: described(nonBlank, "The workspace's unique name."),
4164
- glob: described(nonBlank, "The directories this entry covers, an absolute path glob with * and ** (`/home/you/work/**`); the narrowest match wins."),
4165
- vcs: described(optional(looseObject({
4166
- provider: described(_enum(["gitlab", "github"]), "The forge: github or gitlab."),
4167
- defaultTargetBranch: described(optional(nonBlank), "The branch PRs target by default."),
4168
- tokenFile: described(optional(nonBlank), "A file holding the forge token for this workspace."),
4169
- account: described(optional(nonBlank), "The forge login delivery runs as; grants need it to reach the forge."),
4170
- host: described(optional(unknown()), "A self-hosted forge's host name.")
4171
- })), "The forge this workspace's repositories live on."),
4172
- autoApprove: described(optional(union([boolean2(), array(nonBlank)])), "Legacy (≤4.x) standing approvals, read once as autonomy grants; use `autonomy`."),
4173
- defaultEndpoint: described(optional(unknown()), "Where an unnamed request stops: commit (default), pr, green or merged. Set with `workit grant set`, like grants."),
4174
- verification: described(optional(_enum(["proportional", "self", "independent"])), "How a normal-risk behavior change is verified: proportional (default), self or independent. Set with `workit grant set`, like grants."),
4175
- delegation: described(optional(unknown()), "Who does the work: `inline-first` (default) keeps the lead working itself and refuses a slice without a reason to delegate; `lead-orchestrates` allows slices without one."),
4176
- changelog: described(optional(unknown()), "The Keep a Changelog step before a PR opens: `off` (default), `update` (an existing CHANGELOG.md needs an Unreleased entry from a user-facing PR) or `create` (the entry is required, creating the file). `workit pr create` enforces it."),
4177
- docs: described(optional(unknown()), "The docs refresh the ship skill does before a PR opens: `off` (default) or `when-user-facing`."),
4178
- changelogPath: described(optional(unknown()), "Where the changelog lives, repo-relative: one path or glob, or a list (a monorepo with one changelog per package; any of them satisfies the gate). Default CHANGELOG.md at the repo root."),
4179
- prTemplate: described(optional(unknown()), "Which template a PR description fills: `auto` (default: the repo's GitHub/GitLab template, else Workit's), `repo` (the repo's, refused when it has none), `workit` (Workit's Summary/Evidence/Merge danger) or a repo-relative path to one `.md` file."),
4180
- releaseNotes: described(optional(unknown()), "The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
4181
- trailers: described(optional(boolean2()), "Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
4182
- deleteBranch: described(optional(boolean2()), "Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
4183
- 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`."),
4184
- 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.'),
4185
- liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
4186
- 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."),
4187
- fanout: described(optional(looseObject({
4188
- tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
4189
- 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."),
4190
- installTimeout: described(optional(unknown()), "How long the own install may run before its process tree is killed and the worktree is linked instead: a duration such as `90s` or `10m` (default `5m`). `--install-timeout` overrides it.")
4191
- })), "Fanout settings."),
4192
- models: described(optional(looseObject({ roles: modelRoles })), "Model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
4193
- resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
4194
- 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."),
4195
- 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."),
4196
- 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."),
4197
- autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
4110
+ name: nonBlank,
4111
+ glob: nonBlank,
4112
+ vcs: optional(looseObject({
4113
+ provider: _enum(["gitlab", "github"]),
4114
+ defaultTargetBranch: optional(nonBlank),
4115
+ tokenFile: optional(nonBlank),
4116
+ account: optional(nonBlank),
4117
+ host: optional(unknown())
4118
+ })),
4119
+ autoApprove: optional(union([boolean2(), array(nonBlank)])),
4120
+ defaultEndpoint: optional(unknown()),
4121
+ verification: optional(_enum(["proportional", "self", "independent"])),
4122
+ delegation: optional(unknown()),
4123
+ changelog: optional(unknown()),
4124
+ docs: optional(unknown()),
4125
+ changelogPath: optional(unknown()),
4126
+ prTemplate: optional(unknown()),
4127
+ releaseNotes: optional(unknown()),
4128
+ trailers: optional(boolean2()),
4129
+ deleteBranch: optional(boolean2()),
4130
+ cleanup: optional(unknown()),
4131
+ feedback: optional(unknown()),
4132
+ liveSessionGuard: optional(boolean2()),
4133
+ shared: optional(boolean2()),
4134
+ fanout: optional(looseObject({
4135
+ tierModels: optional(unknown()),
4136
+ deps: optional(unknown()),
4137
+ installTimeout: optional(unknown())
4138
+ })),
4139
+ models: optional(looseObject({ roles: modelRoles })),
4140
+ resources: optional(unknown()),
4141
+ remotes: 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/*)")))),
4142
+ 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")))),
4143
+ additiveRiskPaths: optional(array(nonBlank)),
4144
+ autonomy: optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
4198
4145
  kind,
4199
- described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
4200
- ])))), "Autonomy grants (D15): only ever set here, by the user, with `workit grant set`."),
4201
- youtrack: described(optional(looseObject({
4202
- baseUrl: described(optional(nonBlank), "This workspace's YouTrack URL."),
4203
- link_issues: described(optional(boolean2()), "Legacy alias of `issues: { provider: youtrack, link: true }`."),
4204
- writes: described(optional(_enum(["ask", "auto"])), "ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1."),
4205
- autoHosts: described(optional(array(nonBlank)), "With writes auto: the only YouTrack hosts (`acme.youtrack.cloud`) a write may reach without asking. A raw ytrack write must name one with --host; a write elsewhere asks. Only the user widens it, in their own terminal (`workit workspace seal`).")
4206
- })), "YouTrack settings for this workspace."),
4207
- issues: described(optional(looseObject({
4208
- provider: described(optional(_enum(["github", "gitlab", "youtrack"])), "The issue tracker PRs link to."),
4209
- link: described(optional(boolean2()), "Derive the issue from the branch name."),
4210
- relation: described(optional(unknown()), "How a PR names its issue: `closes` (default) or `refs`."),
4211
- backlink: described(optional(boolean2()), "Post the PR URL on each linked issue after the PR is opened."),
4212
- link_on_pr: described(optional(boolean2()), "Legacy alias of `link`."),
4213
- repo: described(optional(unknown()), "The GitHub/GitLab repository (owner/name) that holds the issues; default the PR's own."),
4214
- host: described(optional(unknown()), "That repository's host; default the PR's host, or the tracker's public one.")
4215
- })), "The issue tracker PRs link to (any forge with any tracker)."),
4216
- branchPolicy: described(optional(workspaceBranchPolicySchema), "Which branches may be created and which are protected."),
4217
- commitPolicy: described(optional(workspaceCommitPolicySchema), "The commit message rules."),
4218
- defaultProfile: described(optional(nonBlank), "The profile used when none is named; must be a key of `profiles`."),
4219
- profiles: described(optional(record(nonBlank, workspaceProfileSchema)), "Named branch/commit policy variants of this workspace."),
4220
- releaseTracks: described(optional(record(nonBlank, releaseTrackSchema)), "Named release tracks: production and integration branches, naming and versioning."),
4221
- releasePackages: described(optional(unknown()), "Packages released from this repository's own release line under their own tag namespace (`pkg-a@0.1.0`): keyed by package name, each `{ tagNamespace?, changelogPath? }` (default namespace `<name>@`). `workit release package <name> <version>` tags and publishes one.")
4146
+ optional(union([boolean2(), literal("verified")]))
4147
+ ])))),
4148
+ youtrack: optional(looseObject({
4149
+ baseUrl: optional(nonBlank),
4150
+ link_issues: optional(boolean2()),
4151
+ writes: optional(_enum(["ask", "auto"])),
4152
+ autoHosts: optional(array(nonBlank))
4153
+ })),
4154
+ issues: optional(looseObject({
4155
+ provider: optional(_enum(["github", "gitlab", "youtrack"])),
4156
+ link: optional(boolean2()),
4157
+ relation: optional(unknown()),
4158
+ backlink: optional(boolean2()),
4159
+ link_on_pr: optional(boolean2()),
4160
+ repo: optional(unknown()),
4161
+ host: optional(unknown())
4162
+ })),
4163
+ branchPolicy: optional(workspaceBranchPolicySchema),
4164
+ commitPolicy: optional(workspaceCommitPolicySchema),
4165
+ defaultProfile: optional(nonBlank),
4166
+ profiles: optional(record(nonBlank, workspaceProfileSchema)),
4167
+ releaseTracks: optional(record(nonBlank, releaseTrackSchema)),
4168
+ releasePackages: optional(unknown())
4222
4169
  }).check(superRefine((workspace, context) => {
4223
4170
  if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
4224
4171
  context.addIssue({
@@ -4229,11 +4176,11 @@ var workspaceConfigSchema = looseObject({
4229
4176
  }
4230
4177
  }));
4231
4178
  var workspacesFileSchema = looseObject({
4232
- workspaces: described(optional(array(workspaceConfigSchema)), "Workspace entries, each mapping a path glob to its forge, policies and grants."),
4233
- models: described(optional(looseObject({ roles: modelRoles })), "The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false)."),
4234
- feedback: described(optional(looseObject({
4235
- account: described(optional(nonBlank), "The GitHub login `workit feedback --post` uses when no workspace names one; never the workspace's work account by default.")
4236
- })), "`workit feedback` defaults for every workspace.")
4179
+ workspaces: optional(array(workspaceConfigSchema)),
4180
+ models: optional(looseObject({ roles: modelRoles })),
4181
+ feedback: optional(looseObject({
4182
+ account: optional(nonBlank)
4183
+ }))
4237
4184
  }).check(superRefine((file, context) => {
4238
4185
  const names = new Set;
4239
4186
  for (const [index, workspace] of (file.workspaces ?? []).entries()) {
@@ -14737,12 +14684,20 @@ var POWERSHELL_PARAMETERS = [
14737
14684
  { name: "workingdirectory", min: 2, aliases: ["wd"], kind: "value" }
14738
14685
  ];
14739
14686
  var powershellRun = (words, stdin) => {
14687
+ const { script, opaque, dir } = powershellParameters(words, stdin);
14688
+ return {
14689
+ script: script !== null && dir !== undefined ? `Set-Location -LiteralPath '${dir.replaceAll("'", "''")}'; ${script}` : script,
14690
+ opaque
14691
+ };
14692
+ };
14693
+ var powershellParameters = (words, stdin) => {
14740
14694
  const host = /powershell/i.test(words[0] ?? "") ? "powershell" : "pwsh";
14741
14695
  let opaque = false;
14696
+ let dir;
14742
14697
  for (let index = 1;index < words.length; index++) {
14743
14698
  const word = words[index];
14744
14699
  if (!/^[-/]/.test(word))
14745
- return host === "powershell" ? { script: words.slice(index).join(" "), opaque } : { script: null, opaque: true };
14700
+ return host === "powershell" ? { script: words.slice(index).join(" "), opaque, dir } : { script: null, opaque: true };
14746
14701
  const [, key = "", glued] = /^(?:--?|\/)([^:=]*)(?:[:=](.*))?$/s.exec(word) ?? [];
14747
14702
  const flag = key.toLowerCase();
14748
14703
  const matches = POWERSHELL_PARAMETERS.filter((parameter) => (parameter.host ?? host) === host && flag !== "" && (parameter.aliases?.includes(flag) || flag.length >= parameter.min && parameter.name.startsWith(flag)));
@@ -14750,13 +14705,19 @@ var powershellRun = (words, stdin) => {
14750
14705
  opaque = true;
14751
14706
  continue;
14752
14707
  }
14753
- const [{ kind }] = matches;
14708
+ const [{ kind, name }] = matches;
14754
14709
  const value = glued ?? words[index + 1];
14710
+ if (name === "workingdirectory")
14711
+ dir = value;
14755
14712
  if (kind === "info")
14756
14713
  return { script: null, opaque: opaque || index < words.length - 1 };
14757
14714
  if (kind === "encoded") {
14758
14715
  try {
14759
- return { script: Buffer.from(value ?? "", "base64").toString("utf16le"), opaque: true };
14716
+ return {
14717
+ script: Buffer.from(value ?? "", "base64").toString("utf16le"),
14718
+ opaque: true,
14719
+ dir
14720
+ };
14760
14721
  } catch {
14761
14722
  return { script: null, opaque: true };
14762
14723
  }
@@ -14764,15 +14725,17 @@ var powershellRun = (words, stdin) => {
14764
14725
  if (kind === "args")
14765
14726
  return {
14766
14727
  script: value ?? null,
14767
- opaque: opaque || glued !== undefined || value === undefined
14728
+ opaque: opaque || glued !== undefined || value === undefined,
14729
+ dir
14768
14730
  };
14769
14731
  if (kind === "script") {
14770
14732
  if (value === "-")
14771
- return { script: stdin ?? null, opaque: true };
14733
+ return { script: stdin ?? null, opaque: true, dir };
14772
14734
  const rest = glued === undefined ? words.slice(index + 1) : [glued, ...words.slice(index + 1)];
14773
14735
  return {
14774
14736
  script: rest.join(" ") || null,
14775
- opaque: opaque || glued !== undefined || !rest.length
14737
+ opaque: opaque || glued !== undefined || !rest.length,
14738
+ dir
14776
14739
  };
14777
14740
  }
14778
14741
  opaque ||= kind === "opaque";
@@ -17910,7 +17873,9 @@ var KEYWORDS2 = /^(?:if|elseif|else|switch|while|do|until|for|foreach|try|catch|
17910
17873
  var WINDOWS_WRITERS = /^(?:xcopy|robocopy|attrib|icacls|cacls|takeown|compact|cipher|expand|extrac32|makecab|fsutil|reg|regedit|setx|schtasks|msiexec|certutil|bitsadmin|replace|subst|mountvol|format|diskpart|wsl|cscript|wscript|mshta|rundll32|regsvr32|call)$/;
17911
17874
  var READ_METHODS = /^(?:trim(?:start|end)?|split|contains(?:key|value)?|startswith|endswith|substring|(?:last)?indexof(?:any)?|to(?:lower|upper)(?:invariant)?|tostring|tochararray|pad(?:left|right)|equals|compareto|gettype|gethashcode|normalize|where)$/i;
17912
17875
  var READ_MEMBERS = /^(?:name|fullname|basename|extension|length|count|directory|directoryname|parent|root|exists|mode|lastwritetime(?:utc)?|creationtime(?:utc)?|lastaccesstime(?:utc)?|attributes|linktype|target|pspath|pschildname|path|line|linenumber|filename|matches|value|key|keys|values|id|processname|source|definition|version)$/i;
17913
- var LOADER_ENV = /^(?:GIT_\w*|PAGER|EDITOR|VISUAL|PATH|LD_\w*|DYLD_\w*|NODE_OPTIONS|PYTHON\w*|BASH_ENV|ENV|PERL5(?:OPT|LIB)|RUBY(?:OPT|LIB))$/i;
17876
+ var LOADER_ENV = /^(?:GIT_\w*|SSH_ASKPASS(?:_REQUIRE)?|PAGER|EDITOR|VISUAL|PATH|PATHEXT|PSModulePath|LD_\w*|DYLD_\w*|NODE_OPTIONS|NODE_PATH|BUN_OPTIONS|npm_config_\w*|PYTHON\w*|BASH_ENV|ENV|PROMPT_COMMAND|PERL5(?:OPT|LIB)|RUBY(?:OPT|LIB)|RUSTC_(?:WORKSPACE_)?WRAPPER|CARGO_\w*|JAVA_TOOL_OPTIONS|_JAVA_OPTIONS|JDK_JAVA_OPTIONS|DOTNET_STARTUP_HOOKS|COMPLUS_\w*|CORECLR_\w*)$/i;
17877
+ var GIT_CONFIG_ENV2 = /^(?:HOME|USERPROFILE|HOMEDRIVE|HOMEPATH|XDG_\w+|LESS\w*)$/i;
17878
+ var EXEMPT_LOADER = /^(?:(?:GIT_)?PAGER=cat|GIT_OPTIONAL_LOCKS=0)$/;
17914
17879
  var CMD_VAR = /%[^%\s]+%|![^!\s]+!/;
17915
17880
  var NULL_SINK = /^(?:\$null|nul|\/dev\/null)$/i;
17916
17881
  var pwshCode = (text) => {
@@ -17963,7 +17928,7 @@ var powershellTextWriter = (text) => {
17963
17928
  if (statics)
17964
17929
  return `${statics[1]}::${statics[2]}`;
17965
17930
  for (const [, name] of code.matchAll(/\$\{?env:(\w+)\}?\s*[-+]?=/gi))
17966
- if (LOADER_ENV.test(name))
17931
+ if (LOADER_ENV.test(name) || GIT_CONFIG_ENV2.test(name))
17967
17932
  return `$env:${name} =`;
17968
17933
  for (const [, name] of code.matchAll(/\.([A-Za-z_]\w*)\(/g))
17969
17934
  if (!READ_METHODS.test(name))
@@ -19037,14 +19002,13 @@ var commandWords = (words) => {
19037
19002
  start++;
19038
19003
  return words.slice(start);
19039
19004
  };
19040
- var POSIX_LOADER = new RegExp(LOADER_ENV.source);
19041
19005
  var loaderAssignment = (words) => {
19042
19006
  for (const word of words) {
19043
19007
  const name = /^(\w+)\+?=/.exec(word)?.[1];
19044
- if (/^(?:(?:GIT_)?PAGER=cat|GIT_OPTIONAL_LOCKS=0)$/.test(word))
19008
+ if (EXEMPT_LOADER.test(word))
19045
19009
  continue;
19046
19010
  if (name !== undefined) {
19047
- if (POSIX_LOADER.test(name))
19011
+ if (LOADER_ENV.test(name))
19048
19012
  return word.split("=")[0];
19049
19013
  } else if (!DECLARERS.has(word) && word !== "env" && !word.startsWith("-"))
19050
19014
  return;
@@ -21744,6 +21708,12 @@ var remoteIn = (dir, name, repo) => {
21744
21708
  const url = configEntries(fs22.readFileSync(path34.join(shared, "config"), "utf8")).find(([key]) => key === `remote.${name}.url`.toLowerCase())?.[1];
21745
21709
  return url !== undefined && literalIn(url, repo, true);
21746
21710
  };
21711
+ var judgeEnvAllowed = (word) => {
21712
+ if (EXEMPT_LOADER.test(word))
21713
+ return true;
21714
+ const [, name = "", value = ""] = /^(\w+)\+?=([\s\S]*)$/.exec(word) ?? [];
21715
+ return !LOADER_ENV.test(name) && !GIT_CONFIG_ENV2.test(name) && !/[$`]/.test(value);
21716
+ };
21747
21717
  var judgeGit = (command, repo, cwd, depth = 0) => {
21748
21718
  const runsGit = /\bgit\b/.test(command);
21749
21719
  for (const segment of segmentsOf(command)) {
@@ -21755,6 +21725,15 @@ var judgeGit = (command, repo, cwd, depth = 0) => {
21755
21725
  const lead = [];
21756
21726
  while (/^\w+\+?=/.test(words[at] ?? ""))
21757
21727
  lead.push(words[at++]);
21728
+ if (words[at] === "env" && !segment.expands?.includes(at)) {
21729
+ let after = at + 1;
21730
+ while (/^\w+\+?=/.test(words[after] ?? ""))
21731
+ after++;
21732
+ if (!words[after]?.startsWith("-")) {
21733
+ lead.push(...words.slice(at + 1, after));
21734
+ at = after;
21735
+ }
21736
+ }
21758
21737
  const name = path34.basename(words[at] ?? "");
21759
21738
  let start = words.findIndex((word) => /(?:^|[\\/])git(?:\.exe)?(?:=|$)/.test(word));
21760
21739
  if (start > at) {
@@ -21775,7 +21754,7 @@ var judgeGit = (command, repo, cwd, depth = 0) => {
21775
21754
  if (/^(?:export|declare|local|readonly|typeset)$/.test(name))
21776
21755
  lead.push(...words.slice(at + 1).filter((word) => /^\w+\+?=/.test(word)));
21777
21756
  for (const word of runsGit ? lead : lead.filter((set) => /^(?:BASH_)?ENV=/.test(set)))
21778
- if (!/^(?:(?:GIT_)?PAGER=cat|GIT_OPTIONAL_LOCKS=0|(?:LC_\w+|LANG|TZ)=[^$`]*)$/.test(word))
21757
+ if (!judgeEnvAllowed(word))
21779
21758
  why ??= `\`${word}\` is not allowed`;
21780
21759
  let index = start < 0 ? words.length : start + 1;
21781
21760
  let dir = "";
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-c77z370x.js");
104
+ const { runCodexHook } = await import("./workit-hook-w8qtakz2.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-2j7nwxvz.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.26.1",
3
+ "version": "2.26.2",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^2.26.1",
45
- "@workit-dev/mcp": "^2.26.1"
44
+ "@workit-dev/core": "^2.26.2",
45
+ "@workit-dev/mcp": "^2.26.2"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"