@brainervirus/workit-cli 1.0.4 → 1.0.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 (3) hide show
  1. package/README.md +5 -0
  2. package/dist/index.js +111 -19
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -34,6 +34,11 @@ workit # help
34
34
 
35
35
  `workit init` guides you through: platform selection (OpenCode/Cursor), global config (locale, timezone, branch policy), YouTrack, VCS, workspaces (path globs → provider), and project hygiene files. The wizard is a TTY application — `workit init` requires an interactive terminal and prints guidance (exiting nonzero) when stdin is not a TTY.
36
36
 
37
+ The platforms step also always lists Codex and Pi with their detected/configured
38
+ status and separate setup instructions. Init registers only OpenCode/Cursor;
39
+ Codex uses plugin/hooks setup and Pi uses `pi install @brainervirus/workit-pi`.
40
+ Use `workit cutover` for legacy migration.
41
+
37
42
  `workit doctor` checks the offline installation health and exits nonzero when problems are found; `--json` prints the full report as JSON instead of the human-readable table.
38
43
 
39
44
  The task surface exposes the eight shared operation families (`task`, `policy`,
package/dist/index.js CHANGED
@@ -51968,6 +51968,7 @@ var resolve = (options) => {
51968
51968
  cwd,
51969
51969
  dev,
51970
51970
  opencodeConfig: options.opencodeConfig ?? path11.join(home, ".config", "opencode", "opencode.json"),
51971
+ opencodePackageCacheDir: options.opencodePackageCacheDir ?? path11.join(home, ".cache", "opencode", "packages", "@brainervirus", "workit-opencode@latest"),
51971
51972
  cursorSettings: options.cursorSettings ?? path11.join(home, ".cursor", "settings.json"),
51972
51973
  cursorMcp: options.cursorMcp ?? path11.join(home, ".cursor", "mcp.json"),
51973
51974
  cursorPluginDir: options.cursorPluginDir ?? path11.join(home, ".cursor", "plugins", "local", "workit"),
@@ -52454,7 +52455,11 @@ var pluginMcpSelectors = (res) => {
52454
52455
  return null;
52455
52456
  return args.map(String).filter((a) => a.startsWith("--package="));
52456
52457
  };
52457
- var registryLatestVersion = (res) => {
52458
+ var isFloatingOpenCodeNpmPin = (entry) => {
52459
+ const s = entry.trim();
52460
+ return s === OPENCODE_NPM_PIN || s === `${OPENCODE_NPM_PIN}@latest`;
52461
+ };
52462
+ var registryLatestVersion = (res, pkgName = CURSOR_RUNTIME_PACKAGE) => {
52458
52463
  const seam = res.env.WORKIT_DOCTOR_STALE_REGISTRY_VERSION;
52459
52464
  if (typeof seam === "string" && seam) {
52460
52465
  return /^\d+(?:\.\d+){1,2}$/.test(seam) ? seam : null;
@@ -52463,7 +52468,7 @@ var registryLatestVersion = (res) => {
52463
52468
  if (!cmd)
52464
52469
  return null;
52465
52470
  try {
52466
- const r = spawnSync2(cmd, ["view", CURSOR_RUNTIME_PACKAGE, "version"], {
52471
+ const r = spawnSync2(cmd, ["view", pkgName, "version"], {
52467
52472
  encoding: "utf8",
52468
52473
  timeout: 20000,
52469
52474
  env: res.env
@@ -52478,12 +52483,84 @@ var installedPluginVersion = (res) => {
52478
52483
  const pkg = readJson(path11.join(res.cursorPluginDir, "package.json"));
52479
52484
  return typeof pkg?.version === "string" && pkg.version ? pkg.version : null;
52480
52485
  };
52486
+ var installedOpenCodeCacheVersion = (res) => {
52487
+ const pkg = readJson(path11.join(res.opencodePackageCacheDir, "node_modules", "@brainervirus", "workit-opencode", "package.json"));
52488
+ return typeof pkg?.version === "string" && pkg.version ? pkg.version : null;
52489
+ };
52490
+ var checkOpenCodePackageCache = (res) => {
52491
+ if (!existsSync9(res.opencodeConfig)) {
52492
+ return {
52493
+ id: "stale_install",
52494
+ status: "pass",
52495
+ detail: "no opencode config — package cache not inspected"
52496
+ };
52497
+ }
52498
+ const entries = pluginEntries(readJson(res.opencodeConfig));
52499
+ if (entries.length === 0) {
52500
+ return {
52501
+ id: "stale_install",
52502
+ status: "pass",
52503
+ detail: "no workit opencode pin — package cache not inspected"
52504
+ };
52505
+ }
52506
+ const pin = entries[0];
52507
+ if (pin.startsWith("file:") || pin.startsWith("git+file:")) {
52508
+ return {
52509
+ id: "stale_install",
52510
+ status: "pass",
52511
+ detail: "opencode checkout pin — package cache not used for npm resolution"
52512
+ };
52513
+ }
52514
+ if (!isFloatingOpenCodeNpmPin(pin)) {
52515
+ return {
52516
+ id: "stale_install",
52517
+ status: "pass",
52518
+ detail: `opencode pin ${pin} is an exact version — not compared to registry latest`
52519
+ };
52520
+ }
52521
+ const installed = installedOpenCodeCacheVersion(res);
52522
+ if (installed === null) {
52523
+ return {
52524
+ id: "stale_install",
52525
+ status: "pass",
52526
+ detail: "opencode @latest package cache empty — OpenCode will resolve on next launch"
52527
+ };
52528
+ }
52529
+ const expected = registryLatestVersion(res, OPENCODE_NPM_PIN);
52530
+ if (expected === null) {
52531
+ return {
52532
+ id: "registry_unreachable",
52533
+ status: "warn",
52534
+ registryProbed: true,
52535
+ detail: "registry_unreachable: cannot compare OpenCode @latest cache against published workit-opencode",
52536
+ fix: `Retry when npm is reachable, or remove ${res.opencodePackageCacheDir} and restart OpenCode to re-resolve`
52537
+ };
52538
+ }
52539
+ if (!semverAtLeast(installed, expected)) {
52540
+ return {
52541
+ id: "stale_install",
52542
+ status: "fail",
52543
+ registryProbed: true,
52544
+ detail: `stale_install: OpenCode @latest cache has workit-opencode ${installed} behind published ${expected}`,
52545
+ fix: `Remove ${res.opencodePackageCacheDir} and restart OpenCode — it re-resolves @latest on the next launch`
52546
+ };
52547
+ }
52548
+ return {
52549
+ id: "stale_install",
52550
+ status: "pass",
52551
+ registryProbed: true,
52552
+ detail: `OpenCode @latest cache workit-opencode ${installed} matches published ${expected}`
52553
+ };
52554
+ };
52481
52555
  var checkStaleInstall = (res) => {
52556
+ if (res.host === "opencode") {
52557
+ return checkOpenCodePackageCache(res);
52558
+ }
52482
52559
  if (res.host !== "cursor" && res.host !== "cli") {
52483
52560
  return {
52484
52561
  id: "stale_install",
52485
52562
  status: "pass",
52486
- detail: "cursor plugin not inspected on the opencode host"
52563
+ detail: "cursor plugin not inspected on this host"
52487
52564
  };
52488
52565
  }
52489
52566
  if (existsSync9(res.cursorPluginDir) && lstatSync(res.cursorPluginDir).isSymbolicLink()) {
@@ -52565,18 +52642,30 @@ var checkStaleInstall = (res) => {
52565
52642
  fix: "Re-run install-cursor-plugin.sh — it refreshes the plugin directory with the current build"
52566
52643
  };
52567
52644
  }
52568
- return {
52645
+ const cursorOk = {
52569
52646
  id: "stale_install",
52570
52647
  status: "pass",
52571
52648
  registryProbed: true,
52572
52649
  detail: `installed local-dist workit-cursor ${installed} matches the published runtime ${expected}`
52573
52650
  };
52651
+ if (res.host === "cli") {
52652
+ const oc = checkOpenCodePackageCache(res);
52653
+ if (oc.status !== "pass")
52654
+ return oc;
52655
+ }
52656
+ return cursorOk;
52574
52657
  }
52575
- return {
52658
+ const cursorOk = {
52576
52659
  id: "stale_install",
52577
52660
  status: "pass",
52578
52661
  detail: installed === null ? "installed workit-cursor selectors are canonical" : `installed workit-cursor ${installed} is metadata on the canonical @latest install (fresh at launch)`
52579
52662
  };
52663
+ if (res.host === "cli") {
52664
+ const oc = checkOpenCodePackageCache(res);
52665
+ if (oc.status !== "pass")
52666
+ return oc;
52667
+ }
52668
+ return cursorOk;
52580
52669
  };
52581
52670
  var checkDuplicateRegistration = (res) => {
52582
52671
  const problems = [];
@@ -54909,9 +54998,12 @@ function platformOptions(detection) {
54909
54998
  return { label: `${label}${tag}`, value };
54910
54999
  });
54911
55000
  }
54912
- var EXTERNAL_HOST_LABELS = { codex: "Codex", pi: "Pi" };
54913
- function externalDetectedHosts(detection) {
54914
- return Object.keys(EXTERNAL_HOST_LABELS).filter((host) => detection[host].detected).map((host) => EXTERNAL_HOST_LABELS[host]);
55001
+ function externalHostGuidance(detection) {
55002
+ return ["codex", "pi"].map((host) => {
55003
+ const found = detection[host];
55004
+ const status = found.configured ? "already configured" : found.detected ? "detected" : "not detected";
55005
+ return host === "codex" ? `Codex · ${status} — plugin/hooks setup: https://github.com/BrainerVirus/workit#readme (Codex CLI / desktop)` : `Pi · ${status} — install separately: pi install @brainervirus/workit-pi`;
55006
+ });
54915
55007
  }
54916
55008
  var BRANCH_PRESETS = [
54917
55009
  { label: "GitFlow", value: "gitflow" },
@@ -55287,7 +55379,6 @@ function Screen({
55287
55379
  detection = emptyDetection(),
55288
55380
  onSearchQueryChange
55289
55381
  }) {
55290
- const externalDetected = externalDetectedHosts(detection);
55291
55382
  switch (draft.screen) {
55292
55383
  case "platforms":
55293
55384
  return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
@@ -55298,6 +55389,9 @@ function Screen({
55298
55389
  bold: true,
55299
55390
  children: "Step 1 — Platforms"
55300
55391
  }, undefined, false, undefined, this),
55392
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
55393
+ children: "This wizard configures OpenCode and Cursor only."
55394
+ }, undefined, false, undefined, this),
55301
55395
  /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
55302
55396
  dimColor: true,
55303
55397
  children: "Select the tools to configure (space to toggle):"
@@ -55311,14 +55405,13 @@ function Screen({
55311
55405
  dispatch({ type: "next" });
55312
55406
  }
55313
55407
  }, undefined, false, undefined, this),
55314
- externalDetected.length > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
55408
+ externalHostGuidance(detection).map((guidance) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
55409
+ children: guidance
55410
+ }, guidance, false, undefined, this)),
55411
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
55315
55412
  dimColor: true,
55316
- children: [
55317
- "Detected: ",
55318
- externalDetected.join(", "),
55319
- " — set up via `workit cutover`."
55320
- ]
55321
- }, undefined, true, undefined, this),
55413
+ children: "For legacy installations, use `workit cutover` to preview migration."
55414
+ }, undefined, false, undefined, this),
55322
55415
  draft.errors.platforms && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
55323
55416
  color: "red",
55324
55417
  children: draft.errors.platforms
@@ -58727,10 +58820,9 @@ function evaluateRequirements(task, workspace, capabilities, candidate, checkout
58727
58820
  if (requirement.dimension !== "review")
58728
58821
  return true;
58729
58822
  const reviewSession = sessionFromRef(entry.data.reviewContext);
58730
- const implementationSession = sessionFromRef(task.intent.provenance.session);
58731
- const sameImplementation = sameSession(reviewSession, implementationSession);
58823
+ const sameImplementation = sameSession(reviewSession, task.intent.provenance.session);
58732
58824
  const sameEvidenceSession = task.evidence.some((other) => other.id !== entry.id && sameSession(reviewSession, other.provenance.session));
58733
- return entry.data.kind === "review" && reviewSession !== null && sameSession(reviewSession, entry.provenance.session) && !sameImplementation && !sameEvidenceSession;
58825
+ return entry.data.kind === "review" && reviewSession !== null && sameSession(reviewSession, entry.provenance.session) && (requirement.ruleId === "self-review" || !sameImplementation && !sameEvidenceSession);
58734
58826
  });
58735
58827
  if (passed.length) {
58736
58828
  const withRed = requirement.dimension === "testing" ? passed.filter(({ entry }) => related.some((other) => other.entry.data.kind === "check" && other.evaluation.status === "failed" && other.entry.data.requirementIds.includes(requirement.id) && other.entry.recordedAt <= entry.recordedAt)) : passed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "private": false,
5
5
  "description": "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
6
6
  "keywords": [
@@ -37,9 +37,9 @@
37
37
  "typecheck": "tsc --noEmit"
38
38
  },
39
39
  "dependencies": {
40
- "@brainervirus/workit-core": "^1.0.4",
41
- "@brainervirus/workit-cursor": "^1.0.4",
42
- "@brainervirus/workit-opencode": "^1.0.4",
40
+ "@brainervirus/workit-core": "^1.0.6",
41
+ "@brainervirus/workit-cursor": "^1.0.6",
42
+ "@brainervirus/workit-opencode": "^1.0.6",
43
43
  "@inkjs/ui": "2.0.0",
44
44
  "ink": "7.1.1",
45
45
  "react": "19.2.8"