@brainervirus/workit-cli 8.40.4 → 8.40.6

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.
Files changed (2) hide show
  1. package/dist/index.js +34 -12
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -9352,7 +9352,7 @@ var package_default;
9352
9352
  var init_package = __esm(() => {
9353
9353
  package_default = {
9354
9354
  name: "@brainervirus/workit-cli",
9355
- version: "8.40.4",
9355
+ version: "8.40.6",
9356
9356
  private: false,
9357
9357
  description: "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
9358
9358
  keywords: [
@@ -9390,13 +9390,13 @@ var init_package = __esm(() => {
9390
9390
  },
9391
9391
  dependencies: {
9392
9392
  "@babel/parser": "7.29.9",
9393
- "@brainervirus/workit-cursor": "^8.40.4",
9393
+ "@brainervirus/workit-cursor": "^8.40.6",
9394
9394
  "@inkjs/ui": "2.0.0",
9395
9395
  ink: "7.1.1",
9396
9396
  react: "19.2.8"
9397
9397
  },
9398
9398
  devDependencies: {
9399
- "@brainervirus/workit-core": "^8.40.4"
9399
+ "@brainervirus/workit-core": "^8.40.6"
9400
9400
  },
9401
9401
  engines: {
9402
9402
  node: ">=24"
@@ -9864,7 +9864,7 @@ function capAt(named, where, by, why, main = false) {
9864
9864
  if (endpoint)
9865
9865
  lowered.push("defaultEndpoint");
9866
9866
  const strict = folder?.verification ?? "independent";
9867
- const looser = VERIFICATION_MODES.indexOf(named.verification) < VERIFICATION_MODES.indexOf(strict);
9867
+ const looser = VERIFICATION_STRICTNESS.indexOf(named.verification) > VERIFICATION_STRICTNESS.indexOf(strict);
9868
9868
  if (looser)
9869
9869
  lowered.push("verification");
9870
9870
  if (lowered.length === 0)
@@ -10047,7 +10047,7 @@ var accountHome = () => {
10047
10047
  }, grantsHome, grantsDir = () => path11.join(grantsHome.resolve(), ".config", "workit"), grantsOverride = () => {
10048
10048
  const configured = path11.resolve(resolveConfigDir());
10049
10049
  return configured === path11.resolve(grantsDir()) ? null : `the config directory is redirected to ${configured} (WORKFLOW_TOOLKIT_CONFIG, WORKFLOW_TOOLKIT_CONFIG_DIR or XDG_CONFIG_HOME); grants are read only from ${path11.join(grantsDir(), "workspaces.json")}, so the D4 defaults apply`;
10050
- }, GRANT_KINDS, DEFAULT_GRANTS, DEFAULT_ENDPOINTS, DEFAULT_ENDPOINT = "commit", isDefaultEndpoint = (value) => typeof value === "string" && DEFAULT_ENDPOINTS.includes(value), raisesEndpoint = (current, next) => DEFAULT_ENDPOINTS.indexOf(next) > DEFAULT_ENDPOINTS.indexOf(current), STOPS, VERIFICATION_MODES, DEFAULT_VERIFICATION = "proportional", verificationOf = (entry) => {
10050
+ }, GRANT_KINDS, DEFAULT_GRANTS, DEFAULT_ENDPOINTS, DEFAULT_ENDPOINT = "commit", isDefaultEndpoint = (value) => typeof value === "string" && DEFAULT_ENDPOINTS.includes(value), raisesEndpoint = (current, next) => DEFAULT_ENDPOINTS.indexOf(next) > DEFAULT_ENDPOINTS.indexOf(current), STOPS, VERIFICATION_MODES, VERIFICATION_STRICTNESS, DEFAULT_VERIFICATION = "proportional", verificationOf = (entry) => {
10051
10051
  const value = entry?.verification;
10052
10052
  return VERIFICATION_MODES.includes(value) ? value : DEFAULT_VERIFICATION;
10053
10053
  }, isGrantKind = (value) => typeof value === "string" && GRANT_KINDS.includes(value), isGrantValue = (value) => value === true || value === false || value === "verified", normalized = (kind, value) => value === "verified" && kind !== "merge" ? true : value, fromAutoApprove = (value) => {
@@ -10091,6 +10091,11 @@ var init_autonomy = __esm(() => {
10091
10091
  "self",
10092
10092
  "independent"
10093
10093
  ];
10094
+ VERIFICATION_STRICTNESS = [
10095
+ "independent",
10096
+ "proportional",
10097
+ "self"
10098
+ ];
10094
10099
  });
10095
10100
 
10096
10101
  // node_modules/@openclaw/fs-safe/dist/errors.js
@@ -77310,7 +77315,7 @@ async function runGrant(argv, io, deps = defaultDeps) {
77310
77315
  return change(sub, rest, io, deps);
77311
77316
  return usage2(io, `unknown subcommand "${sub}"`);
77312
77317
  }
77313
- var USAGE4 = "workit grant show [<workspace>] [--all] | grant set <workspace> <kind>=<true|false|verified>… [defaultEndpoint=commit|pr|green|merged] [verification=proportional|self|independent] | grant unset <workspace> <kind>… (kinds: push, pr, merge, release, rerun, defaultEndpoint, verification)", AGENT_ENV, agentMarker = (env) => AGENT_ENV.find((name) => env[name]) ?? Object.keys(env).find((name) => name.startsWith("CODEX_") && env[name]), defaultDeps, parseValue = (raw) => raw === "true" || raw === "yes" || raw === "on" ? true : raw === "false" || raw === "no" || raw === "off" ? false : raw === "verified" ? "verified" : null, STOPS_AT, endpointLabel = (view) => view.effectiveEndpoint === view.defaultEndpoint ? view.defaultEndpoint : `${view.defaultEndpoint} (effective: ${view.effectiveEndpoint}${view.endpointReason ? `, ${view.endpointReason}` : ""})`, VERIFICATION_STRICTNESS, VERIFICATION_TEXT, describe3 = (grants, configured, endpoint, verification) => [
77318
+ var USAGE4 = "workit grant show [<workspace>] [--all] | grant set <workspace> <kind>=<true|false|verified>… [defaultEndpoint=commit|pr|green|merged] [verification=proportional|self|independent] | grant unset <workspace> <kind>… (kinds: push, pr, merge, release, rerun, defaultEndpoint, verification)", AGENT_ENV, agentMarker = (env) => AGENT_ENV.find((name) => env[name]) ?? Object.keys(env).find((name) => name.startsWith("CODEX_") && env[name]), defaultDeps, parseValue = (raw) => raw === "true" || raw === "yes" || raw === "on" ? true : raw === "false" || raw === "no" || raw === "off" ? false : raw === "verified" ? "verified" : null, STOPS_AT, endpointLabel = (view) => view.effectiveEndpoint === view.defaultEndpoint ? view.defaultEndpoint : `${view.defaultEndpoint} (effective: ${view.effectiveEndpoint}${view.endpointReason ? `, ${view.endpointReason}` : ""})`, VERIFICATION_TEXT, describe3 = (grants, configured, endpoint, verification) => [
77314
77319
  ...GRANT_KINDS.map((kind) => ` ${kind.padEnd(8)}${String(grants[kind]).padEnd(10)}${configured.includes(kind) ? "configured" : "default"}${kind === "release" ? " (workit git push --release: git-flow main and develop, landed release tags)" : ""}`),
77315
77320
  ` default endpoint: ${endpointLabel(endpoint)} (an unnamed request stops at ${STOPS_AT[endpoint.effectiveEndpoint]})`,
77316
77321
  ...endpoint.endpointIssue ? [` note: ${endpoint.endpointIssue}`] : [],
@@ -77342,11 +77347,6 @@ var init_grant = __esm(() => {
77342
77347
  green: "a merge-ready PR: CI green, threads resolved, verified; never merged",
77343
77348
  merged: "a merged PR (workit pr merge)"
77344
77349
  };
77345
- VERIFICATION_STRICTNESS = [
77346
- "independent",
77347
- "self",
77348
- "proportional"
77349
- ];
77350
77350
  VERIFICATION_TEXT = {
77351
77351
  proportional: "the review lane from the diff decides: none needs no verdict, self the author's --self verdict, focused and full a non-author verdict, also to merge",
77352
77352
  self: "a normal-risk behavior change needs a passing check and the author's --self verdict, shown as self-reviewed; merge needs a non-author verdict",
@@ -77735,7 +77735,7 @@ var init_workspace = __esm(() => {
77735
77735
  ]);
77736
77736
  SEGMENT = /^[A-Za-z0-9_-]+$/u;
77737
77737
  UNSAFE_SEGMENTS = new Set(["__proto__", "constructor", "prototype"]);
77738
- STRICTNESS = ["independent", "self", "proportional"];
77738
+ STRICTNESS = VERIFICATION_STRICTNESS;
77739
77739
  defaultDeps2 = {
77740
77740
  interactive: () => process.stdin.isTTY === true && process.stdout.isTTY === true,
77741
77741
  ask: (question) => askLine(question)
@@ -85679,6 +85679,20 @@ function forgeBreaker(resolved) {
85679
85679
  forge.prStatus = guard(inner.prStatus.bind(inner));
85680
85680
  return { forge: { ...resolved, forge }, down: () => tripped };
85681
85681
  }
85682
+ function trunkRefresher(cwd, trunk) {
85683
+ const match = /^refs\/remotes\/([^/]+)\/(.+)$/u.exec(trunk);
85684
+ if (!match)
85685
+ return;
85686
+ const [, remote, name] = match;
85687
+ let result;
85688
+ return () => {
85689
+ if (result !== undefined)
85690
+ return result;
85691
+ const fetched = fetchRefs(cwd, remote, [`+refs/heads/${name}:${trunk}`]);
85692
+ result = fetched.ok ? null : `${remote}/${name} could not be refreshed, so a revert check may be stale: run git fetch ${remote} ${name}`;
85693
+ return result;
85694
+ };
85695
+ }
85682
85696
  function branchCreatedAt(cwd, branch) {
85683
85697
  if (!branch || branch.startsWith("-"))
85684
85698
  return null;
@@ -85796,6 +85810,14 @@ function detectLanding(ctx, slice, input) {
85796
85810
  const landed = (how, landedHead) => {
85797
85811
  if (!hasCommit(ctx.cwd, landedHead) || !reverted(ctx.cwd, ctx.trunk, landedHead, input.createdFrom))
85798
85812
  return { ...out, landed: true, how, landedHead };
85813
+ if (how === "pr_merged" && ctx.forge) {
85814
+ ctx.refreshTrunk ??= trunkRefresher(ctx.cwd, ctx.trunk) ?? (() => null);
85815
+ const failed = ctx.refreshTrunk();
85816
+ if (failed)
85817
+ return { ...out, landed: true, how, landedHead, note: failed };
85818
+ if (!reverted(ctx.cwd, ctx.trunk, landedHead, input.createdFrom))
85819
+ return { ...out, landed: true, how, landedHead };
85820
+ }
85799
85821
  return {
85800
85822
  ...out,
85801
85823
  note: `landed (${how}${out.pr ? ` #${out.pr.number}` : ""}), then reverted on the trunk: its paths read as before it`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cli",
3
- "version": "8.40.4",
3
+ "version": "8.40.6",
4
4
  "private": false,
5
5
  "description": "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
6
6
  "keywords": [
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@babel/parser": "7.29.9",
41
- "@brainervirus/workit-cursor": "^8.40.4",
41
+ "@brainervirus/workit-cursor": "^8.40.6",
42
42
  "@inkjs/ui": "2.0.0",
43
43
  "ink": "7.1.1",
44
44
  "react": "19.2.8"
45
45
  },
46
46
  "devDependencies": {
47
- "@brainervirus/workit-core": "^8.40.4"
47
+ "@brainervirus/workit-core": "^8.40.6"
48
48
  },
49
49
  "engines": {
50
50
  "node": ">=24"