@workit-dev/opencode 1.0.3 → 1.0.4

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 +6 -3
  2. package/package.json +2 -2
package/dist/plugin.js CHANGED
@@ -15407,6 +15407,7 @@ var DOC_EXT = /\.(?:md|mdx|markdown|rst|adoc)$/iu;
15407
15407
  var DOC_NAMES = /^(?:license|licence|notice|authors|changelog|changes|contributors)$/iu;
15408
15408
  var INSTRUCTIONS = /(?:^|\/)(?:AGENTS|CLAUDE|GEMINI|SKILL)\.md$|(?:^|\/)(?:skills|agents|commands|rules|prompts)\/[^/]+/iu;
15409
15409
  var TEST_PATH = /(?:^|\/)(?:test|tests|__tests__)\/|\.(?:test|spec)\.[^/]+$|_test\.[^/]+$/iu;
15410
+ var plural = (count, noun) => `${count} ${noun}${count === 1 ? "" : "s"}`;
15410
15411
  var basename = (file) => file.slice(file.lastIndexOf("/") + 1);
15411
15412
  var isDoc = (file) => !INSTRUCTIONS.test(file) && (DOC_EXT.test(file) || DOC_NAMES.test(basename(file)));
15412
15413
  function kindOf(file) {
@@ -15465,6 +15466,8 @@ function computeLane(input) {
15465
15466
  const behavior = kinds.filter((entry) => entry.kind === "behavior" || entry.kind === "test" || entry.kind === "lockfile");
15466
15467
  const lines = behavior.filter((entry) => entry.kind !== "lockfile").reduce((sum, entry) => sum + entry.file.added + entry.file.deleted, 0);
15467
15468
  const opaque = behavior.filter((entry) => entry.kind === "lockfile" || entry.file.binary);
15469
+ const diffLines = input.files.reduce((sum, file) => sum + file.added + file.deleted, 0);
15470
+ const counted = diffLines === lines && input.files.length === behavior.length ? "" : ` counted (the whole diff is ${plural(diffLines, "line")} in ${plural(input.files.length, "file")}; docs, comments, formatting, generated copies and lockfile lines are not counted)`;
15468
15471
  const result = (lane, reasons) => ({
15469
15472
  lane,
15470
15473
  reasons,
@@ -15484,9 +15487,9 @@ function computeLane(input) {
15484
15487
  input.files.length ? "only docs, comments, formatting or generated copies changed" : "no changes"
15485
15488
  ]);
15486
15489
  if (lines >= fullMinLines)
15487
- return result("full", [`large diff: ${lines} lines (≥ ${fullMinLines})`]);
15490
+ return result("full", [`large diff: ${lines} lines (≥ ${fullMinLines})${counted}`]);
15488
15491
  if (lines > selfMaxLines)
15489
- return result("focused", [`${lines} lines changed (> ${selfMaxLines})`]);
15492
+ return result("focused", [`${lines} lines changed (> ${selfMaxLines})${counted}`]);
15490
15493
  if (behavior.length > selfMaxFiles)
15491
15494
  return result("focused", [`${behavior.length} behavior files changed (> ${selfMaxFiles})`]);
15492
15495
  if (opaque.length)
@@ -15494,7 +15497,7 @@ function computeLane(input) {
15494
15497
  `a lockfile or binary changed: ${opaque.slice(0, 3).map((entry) => entry.file.path).join(", ")}${opaque.length > 3 ? ", …" : ""}`
15495
15498
  ]);
15496
15499
  return result("self", [
15497
- `small change: ${lines} line${lines === 1 ? "" : "s"} in ${behavior.length} file${behavior.length === 1 ? "" : "s"}, no risk path`
15500
+ `small change: ${plural(lines, "line")} in ${plural(behavior.length, "file")}${counted}, no risk path`
15498
15501
  ]);
15499
15502
  }
15500
15503
  function untrackedStat(cwd, file) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/opencode",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@opencode/plugin": "2.0.18",
44
- "@workit-dev/core": "^1.0.3"
44
+ "@workit-dev/core": "^1.0.4"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24"