@brainervirus/workit-cli 8.37.0 → 8.37.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.
Files changed (2) hide show
  1. package/dist/index.js +36 -21
  2. package/package.json +3 -3
package/dist/index.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.37.0",
9320
+ version: "8.37.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.37.0",
9358
+ "@brainervirus/workit-cursor": "^8.37.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.37.0"
9364
+ "@brainervirus/workit-core": "^8.37.2"
9365
9365
  },
9366
9366
  engines: {
9367
9367
  node: ">=24"
@@ -65412,18 +65412,29 @@ function isWorkitPlugin(value) {
65412
65412
  const pkgPath = /\/(?:packages\/workit-(?:opencode|cursor)|node_modules\/@brainervirus\/workit-(?:opencode|cursor))(?:\/|$)/.test(s);
65413
65413
  return named(s, "workflow-toolkit") || named(s, "workflow-toolkit-opencode") || named(s, "local/workflow-toolkit") || named(s, "workit") || named(s, "local/workit") || named(s, "@brainervirus/workit-opencode") || named(s, "@brainervirus/workit-cursor") || url && pkgPath || s.startsWith("git+file://") && s.includes("workflow-toolkit");
65414
65414
  }
65415
- function mergeOpenCodePlugins(plugin, pin) {
65416
- const existing = Array.isArray(plugin) ? plugin : typeof plugin === "string" ? [plugin] : [];
65415
+ function mergeOpenCodePlugins(plugins, pin) {
65416
+ const existing = Array.isArray(plugins) ? plugins : typeof plugins === "string" ? [plugins] : [];
65417
65417
  const config = [pin, ...existing.filter((p) => !isWorkitPlugin(p))];
65418
- const changed = JSON.stringify(config) !== JSON.stringify(existing) ? ["plugin"] : [];
65418
+ const changed = JSON.stringify(config) !== JSON.stringify(existing) ? ["plugins"] : [];
65419
65419
  return { config, changed };
65420
65420
  }
65421
65421
  function mergeOpenCodeConfig(config, pin) {
65422
65422
  const base = isRecord4(config) ? { ...config } : {};
65423
65423
  const changed = [];
65424
- const plugins = mergeOpenCodePlugins(base.plugin, pin);
65425
- if (plugins.changed.length > 0) {
65426
- base.plugin = plugins.config;
65424
+ const plugins = mergeOpenCodePlugins(base.plugins, pin);
65425
+ const hadLegacy = base.plugin !== undefined;
65426
+ const legacy = Array.isArray(base.plugin) ? base.plugin : typeof base.plugin === "string" ? [base.plugin] : [];
65427
+ const legacyRest = legacy.filter((p) => !isWorkitPlugin(p));
65428
+ const legacyMoved = legacyRest.length !== legacy.length;
65429
+ if (plugins.changed.length > 0 || legacyMoved) {
65430
+ base.plugins = plugins.config;
65431
+ changed.push("plugins");
65432
+ }
65433
+ if (legacyMoved) {
65434
+ if (legacyRest.length > 0)
65435
+ base.plugin = legacyRest;
65436
+ else if (hadLegacy)
65437
+ delete base.plugin;
65427
65438
  changed.push("plugin");
65428
65439
  }
65429
65440
  return { config: base, changed };
@@ -68425,6 +68436,14 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
68425
68436
  fix: "Run `workit init` (or restore the checkout and re-run install-opencode-plugin.sh)"
68426
68437
  };
68427
68438
  }
68439
+ if (pluginEntries({ plugins: cfg?.plugins }).length === 0) {
68440
+ return {
68441
+ id: "stale_pin",
68442
+ status: "warn",
68443
+ detail: `workit is registered under the deprecated "plugin" key; move it to "plugins" (${entries[0]})`,
68444
+ fix: "workit setup --hosts=opencode"
68445
+ };
68446
+ }
68428
68447
  return { id: "stale_pin", status: "pass", detail: "opencode pin resolves" };
68429
68448
  }, pluginMcpSelectors = (res) => {
68430
68449
  const p = path39.join(res.cursorPluginDir, "mcp.json");
@@ -68522,7 +68541,7 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
68522
68541
  status: "warn",
68523
68542
  registryProbed: true,
68524
68543
  detail: "registry_unreachable: cannot compare OpenCode @latest cache against published workit-opencode",
68525
- fix: `Retry when npm is reachable, or remove ${cache.dir} and restart OpenCode to re-resolve`
68544
+ fix: `Retry when npm is reachable; to update, opencode plugin update ${OPENCODE_NPM_PIN}`
68526
68545
  };
68527
68546
  }
68528
68547
  if (!semverAtLeast(installed, expected)) {
@@ -68531,7 +68550,7 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
68531
68550
  status: "fail",
68532
68551
  registryProbed: true,
68533
68552
  detail: `stale_install: OpenCode @latest cache has workit-opencode ${installed} behind published ${expected}`,
68534
- fix: `Remove ${cache.dir} and restart OpenCode — it re-resolves @latest on the next launch`
68553
+ fix: `opencode plugin update ${OPENCODE_NPM_PIN} (OpenCode 2.x loads it live, no restart); without that verb, remove ${cache.dir} and relaunch OpenCode`
68535
68554
  };
68536
68555
  }
68537
68556
  return {
@@ -69685,7 +69704,7 @@ var init_doctor = __esm(() => {
69685
69704
  init_session_hook();
69686
69705
  init_hook_runs();
69687
69706
  init_host_permissions();
69688
- OPENCODE_V1_FIX = `OpenCode < ${SUPPORT_MATRIX.opencode.minimum} cannot load Workit 3 (V2 plugin API only): upgrade OpenCode to ${SUPPORT_MATRIX.opencode.minimum}+, or stay on Workit 2.x by pinning "@brainervirus/workit-opencode@2" in the opencode.json "plugin" array`;
69707
+ OPENCODE_V1_FIX = `OpenCode < ${SUPPORT_MATRIX.opencode.minimum} cannot load Workit (V2 plugin API only): upgrade OpenCode to ${SUPPORT_MATRIX.opencode.minimum}+`;
69689
69708
  AGENT_MARKER_VERSION = /^# Generated by Workit (\d+\.\d+\.\d+)\b/;
69690
69709
  canonicalCursorHook = cursorHooksEntry().command;
69691
69710
  SILENT_HOOK_GRACE_MS = 2 * 60000;
@@ -70170,17 +70189,13 @@ function applyOpenCode(root, res) {
70170
70189
  detail: `cannot merge into malformed config: ${existing.error} — repair or remove the file`
70171
70190
  };
70172
70191
  }
70173
- const configuredPlugins = existing.kind === "record" ? Array.isArray(existing.value.plugins) ? existing.value.plugins : typeof existing.value.plugins === "string" ? [existing.value.plugins] : typeof existing.value.plugin === "string" ? [existing.value.plugin] : Array.isArray(existing.value.plugin) ? existing.value.plugin : [] : [];
70192
+ const listOf = (value) => Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
70193
+ const configuredPlugins = existing.kind === "record" ? [...listOf(existing.value.plugins), ...listOf(existing.value.plugin)] : [];
70174
70194
  const configuredPin = configuredPlugins.find((entry) => typeof entry === "string" && isWorkitPlugin(entry));
70175
70195
  const pin = configuredPin ?? resolvedPin;
70176
70196
  const base = existing.kind === "record" ? existing.value : {};
70177
- const merged = existing.kind === "record" && Object.hasOwn(existing.value, "plugins") ? (() => {
70178
- const plugins = mergeOpenCodePlugins(existing.value.plugins, pin);
70179
- return {
70180
- config: { ...existing.value, plugins: plugins.config },
70181
- changed: plugins.changed.length > 0 ? ["plugins"] : []
70182
- };
70183
- })() : mergeOpenCodeConfig(base, pin);
70197
+ const merged = mergeOpenCodeConfig(base, pin);
70198
+ const moved = merged.changed.includes("plugin");
70184
70199
  if (merged.changed.length === 0) {
70185
70200
  return {
70186
70201
  platform: "opencode",
@@ -70195,7 +70210,7 @@ function applyOpenCode(root, res) {
70195
70210
  platform: "opencode",
70196
70211
  file: res.opencodeConfig,
70197
70212
  status: "Configured",
70198
- detail: `pinned ${pin}`
70213
+ detail: moved ? `pinned ${pin}; moved the Workit entry from the deprecated "plugin" key to "plugins"` : `pinned ${pin}`
70199
70214
  } : {
70200
70215
  platform: "opencode",
70201
70216
  file: res.opencodeConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cli",
3
- "version": "8.37.0",
3
+ "version": "8.37.2",
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.37.0",
41
+ "@brainervirus/workit-cursor": "^8.37.2",
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.37.0"
47
+ "@brainervirus/workit-core": "^8.37.2"
48
48
  },
49
49
  "engines": {
50
50
  "node": ">=24"