@brainervirus/workit-claude-code 8.40.1 → 8.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/workit.js CHANGED
@@ -9317,7 +9317,7 @@ var package_default;
9317
9317
  var init_package = __esm(() => {
9318
9318
  package_default = {
9319
9319
  name: "@brainervirus/workit-cli",
9320
- version: "8.40.1",
9320
+ version: "8.40.2",
9321
9321
  private: false,
9322
9322
  description: "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
9323
9323
  keywords: [
@@ -9355,13 +9355,13 @@ var init_package = __esm(() => {
9355
9355
  },
9356
9356
  dependencies: {
9357
9357
  "@babel/parser": "7.29.9",
9358
- "@brainervirus/workit-cursor": "^8.40.1",
9358
+ "@brainervirus/workit-cursor": "^8.40.2",
9359
9359
  "@inkjs/ui": "2.0.0",
9360
9360
  ink: "7.1.1",
9361
9361
  react: "19.2.8"
9362
9362
  },
9363
9363
  devDependencies: {
9364
- "@brainervirus/workit-core": "^8.40.1"
9364
+ "@brainervirus/workit-core": "^8.40.2"
9365
9365
  },
9366
9366
  engines: {
9367
9367
  node: ">=24"
@@ -9779,34 +9779,20 @@ function configuredGrants(entry) {
9779
9779
  const legacy = fromAutoApprove(record.autoApprove);
9780
9780
  return legacy ? { grants: legacy, source: "autoApprove" } : { grants: {}, source: "default" };
9781
9781
  }
9782
- function resolveAutonomy(cwd) {
9783
- const override = grantsOverride();
9784
- if (override)
9785
- return {
9786
- workspace: null,
9787
- grants: { ...DEFAULT_GRANTS },
9788
- configured: [],
9789
- source: "default",
9790
- accountConfigured: false,
9791
- defaultEndpoint: DEFAULT_ENDPOINT,
9792
- configuredEndpoint: null,
9793
- effectiveEndpoint: DEFAULT_ENDPOINT,
9794
- verification: DEFAULT_VERIFICATION,
9795
- note: override
9796
- };
9797
- const workspace = resolveWorkspaceFrom(cwd, grantsDir(), process.env.WORKFLOW_WORKSPACE_NAME?.trim() || undefined);
9782
+ function autonomyOf(workspace) {
9798
9783
  const { grants, source } = configuredGrants(workspace);
9799
9784
  const full = { ...DEFAULT_GRANTS, ...grants };
9800
9785
  const configured = GRANT_KINDS.filter((kind) => grants[kind] !== undefined);
9801
9786
  const accountConfigured = Boolean(workspace?.vcs?.account);
9787
+ const name = workspace?.name ?? null;
9802
9788
  return {
9803
- workspace: workspace?.name ?? null,
9789
+ workspace: name,
9804
9790
  grants: full,
9805
9791
  configured,
9806
9792
  source,
9807
9793
  accountConfigured,
9808
9794
  ...endpointView(workspace, {
9809
- workspace: workspace?.name ?? null,
9795
+ workspace: name,
9810
9796
  grants: full,
9811
9797
  configured,
9812
9798
  accountConfigured
@@ -9814,6 +9800,64 @@ function resolveAutonomy(cwd) {
9814
9800
  verification: verificationOf(workspace)
9815
9801
  };
9816
9802
  }
9803
+ function capByFolder(named, folder, name) {
9804
+ if (folder?.workspace === named.workspace)
9805
+ return named;
9806
+ const nothing = !folder || folder.configured.length > 0 && !folder.accountConfigured;
9807
+ const grants = { ...named.grants };
9808
+ const lowered = [];
9809
+ for (const kind of GRANT_KINDS) {
9810
+ const floor = !nothing && folder.grants[kind];
9811
+ if (!raises(kind, floor, grants[kind]))
9812
+ continue;
9813
+ grants[kind] = floor;
9814
+ lowered.push(kind);
9815
+ }
9816
+ const ceiling = !nothing && folder.effectiveEndpoint || DEFAULT_ENDPOINT;
9817
+ const endpoint = raisesEndpoint(ceiling, named.effectiveEndpoint);
9818
+ if (endpoint)
9819
+ lowered.push("defaultEndpoint");
9820
+ const strict = folder?.verification ?? "independent";
9821
+ const looser = VERIFICATION_MODES.indexOf(named.verification) < VERIFICATION_MODES.indexOf(strict);
9822
+ if (looser)
9823
+ lowered.push("verification");
9824
+ if (lowered.length === 0)
9825
+ return named;
9826
+ return {
9827
+ ...named,
9828
+ grants,
9829
+ ...endpoint ? { effectiveEndpoint: ceiling, endpointReason: undefined } : {},
9830
+ verification: looser ? strict : named.verification,
9831
+ note: `WORKFLOW_WORKSPACE_NAME=${name}: ${lowered.join(", ")} capped at ${folder ? `workspace ${folder.workspace}` : "nothing (tied workspaces)"}; a name never raises grants`
9832
+ };
9833
+ }
9834
+ function resolveAutonomy(cwd) {
9835
+ const override = grantsOverride();
9836
+ if (override)
9837
+ return {
9838
+ workspace: null,
9839
+ grants: { ...DEFAULT_GRANTS },
9840
+ configured: [],
9841
+ source: "default",
9842
+ accountConfigured: false,
9843
+ defaultEndpoint: DEFAULT_ENDPOINT,
9844
+ configuredEndpoint: null,
9845
+ effectiveEndpoint: DEFAULT_ENDPOINT,
9846
+ verification: DEFAULT_VERIFICATION,
9847
+ note: override
9848
+ };
9849
+ const name = process.env.WORKFLOW_WORKSPACE_NAME?.trim() || undefined;
9850
+ const named = autonomyOf(resolveWorkspaceFrom(cwd, grantsDir(), name));
9851
+ if (name === undefined)
9852
+ return named;
9853
+ let folder;
9854
+ try {
9855
+ folder = autonomyOf(resolveWorkspaceFrom(cwd, grantsDir()));
9856
+ } catch {
9857
+ folder = null;
9858
+ }
9859
+ return capByFolder(named, folder, name);
9860
+ }
9817
9861
  function requireGrant(cwd, kind, options = {}) {
9818
9862
  let autonomy;
9819
9863
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-claude-code",
3
- "version": "8.40.1",
3
+ "version": "8.40.2",
4
4
  "private": false,
5
5
  "description": "Workit Claude Code plugin — session and per-turn task context, branch policy on git shell commands, workit method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -39,8 +39,8 @@
39
39
  "build": "bun scripts/build.ts"
40
40
  },
41
41
  "devDependencies": {
42
- "@brainervirus/workit-cli": "^8.40.1",
43
- "@brainervirus/workit-core": "^8.40.1"
42
+ "@brainervirus/workit-cli": "^8.40.2",
43
+ "@brainervirus/workit-core": "^8.40.2"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=24"