@brainervirus/workit-opencode 8.28.1 → 8.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.
Files changed (2) hide show
  1. package/dist/plugin.js +25 -7
  2. package/package.json +2 -2
package/dist/plugin.js CHANGED
@@ -13146,9 +13146,22 @@ function detectedChecks(root) {
13146
13146
  return checks;
13147
13147
  }
13148
13148
  var GATES = ["testing", "verification"];
13149
+ function configFileFor(root) {
13150
+ const own = checksConfigFile(root);
13151
+ if (fs11.existsSync(own))
13152
+ return own;
13153
+ const common = git3(root, ["rev-parse", "--path-format=absolute", "--git-common-dir"]);
13154
+ if (!common || path13.basename(common) !== ".git")
13155
+ return own;
13156
+ const main = path13.dirname(common);
13157
+ if (path13.resolve(main) === path13.resolve(root))
13158
+ return own;
13159
+ const shared = checksConfigFile(main);
13160
+ return fs11.existsSync(shared) ? shared : own;
13161
+ }
13149
13162
  function loadCheckConfig(cwd) {
13150
13163
  const root = checkRoot(cwd);
13151
- const file = checksConfigFile(root);
13164
+ const file = configFileFor(root);
13152
13165
  const legacy = path13.basename(file) === LEGACY_CHECKS_FILE;
13153
13166
  const label = legacy ? LEGACY_CHECKS_FILE : CHECKS_FILE;
13154
13167
  const note = legacy ? {
@@ -17258,17 +17271,22 @@ function workitCheckTail(words) {
17258
17271
  return null;
17259
17272
  return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
17260
17273
  }
17261
- function simpleCommand(command, dialect = "posix", depth = 0) {
17274
+ var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
17275
+ function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
17262
17276
  let segments;
17263
17277
  try {
17264
17278
  segments = segmentsOf(command, dialect);
17265
17279
  } catch {
17266
17280
  return null;
17267
17281
  }
17268
- if (segments.length !== 1)
17282
+ const filter = shaped && segments.length === 2 ? segments[1] : null;
17283
+ if (filter) {
17284
+ if (!segments[0].pipe || !OUTPUT_FILTERS.has(commandName(filter.words[0])) || filter.group || filter.pipe || filter.unanalyzable || filter.subs?.length || filter.stdin?.length)
17285
+ return null;
17286
+ } else if (segments.length !== 1)
17269
17287
  return null;
17270
17288
  const [segment] = segments;
17271
- if (segment.group || segment.pipe || segment.unanalyzable || segment.redirects.length || segment.subs?.length || segment.stdin?.length)
17289
+ if (segment.group || segment.pipe && !filter || segment.unanalyzable || segment.redirects.length && !shaped || segment.subs?.length || segment.stdin?.length)
17272
17290
  return null;
17273
17291
  const { words } = stripPrefixes(segment.words);
17274
17292
  const name = commandName(words[0]);
@@ -22379,7 +22397,7 @@ function heavyPlan(command, options) {
22379
22397
  const heavy = heavyLines(lines, options);
22380
22398
  if (!heavy.length)
22381
22399
  return { kind: "none" };
22382
- const simple = simpleCommand(command, dialect);
22400
+ const simple = simpleCommand(command, dialect, 0, true);
22383
22401
  const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
22384
22402
  const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
22385
22403
  words: match.line,
@@ -22391,7 +22409,7 @@ function heavyPlan(command, options) {
22391
22409
  if (!verdict.ok)
22392
22410
  return {
22393
22411
  kind: "passthrough",
22394
- note: `workit: \`${command.trim()}\` is heavy but runs outside the heavy-check lease because a host permission rule names it (or \`workit\` is allowlisted); the host decides.`
22412
+ note: ""
22395
22413
  };
22396
22414
  }
22397
22415
  if (single) {
@@ -22401,7 +22419,7 @@ function heavyPlan(command, options) {
22401
22419
  const parts = heavy.map((match) => leaseCommand(match.line));
22402
22420
  return {
22403
22421
  kind: "split",
22404
- reason: `heavy_command: \`${command.trim()}\` chains heavy work (${heavy.map((match) => match.reason).join("; ")}) with other commands, and a chain cannot run under the machine-wide heavy-check lease. Run each heavy part alone as \`workit check --heavy -- <segment>\` (here: ${parts.map((part) => `\`${part}\``).join("; ")}); run the other parts as their own commands.`,
22422
+ reason: `heavy_command: \`${command.trim()}\` chains heavy work (${heavy.map((match) => match.reason).join("; ")}) with other commands, and a chain cannot run under the machine-wide heavy-check lease. Run the heavy part alone, now: \`${parts[0]}\`; then run the other parts as their own commands${parts.length > 1 ? ", each heavy one the same way" : ""}.`,
22405
22423
  unblock: parts[0] ?? null
22406
22424
  };
22407
22425
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-opencode",
3
- "version": "8.28.1",
3
+ "version": "8.29.1",
4
4
  "private": false,
5
5
  "description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
6
6
  "keywords": [
@@ -39,7 +39,7 @@
39
39
  "typecheck": "tsc --noEmit"
40
40
  },
41
41
  "devDependencies": {
42
- "@brainervirus/workit-core": "^8.28.1",
42
+ "@brainervirus/workit-core": "^8.29.1",
43
43
  "@opencode/plugin": "2.0.18"
44
44
  },
45
45
  "engines": {