context-mode 2.0.0-next.18 → 2.0.0-next.21

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.
@@ -9,7 +9,7 @@
9
9
  "name": "context-mode",
10
10
  "skills": "./claude-code/skills",
11
11
  "source": "./",
12
- "version": "2.0.0-next.18"
12
+ "version": "2.0.0-next.21"
13
13
  }
14
14
  ]
15
15
  }
@@ -13,5 +13,5 @@
13
13
  },
14
14
  "name": "context-mode",
15
15
  "skills": "./claude-code/skills",
16
- "version": "2.0.0-next.18"
16
+ "version": "2.0.0-next.21"
17
17
  }
@@ -8,5 +8,5 @@
8
8
  "mcpServers": "./.codex-plugin/mcp.json",
9
9
  "name": "context-mode",
10
10
  "skills": "./codex/skills/",
11
- "version": "2.0.0-next.18"
11
+ "version": "2.0.0-next.21"
12
12
  }
package/SHA256SUMS CHANGED
@@ -1,19 +1,19 @@
1
- fa9376d5f77c34e0b6a12280a826333a96768bb8a17e576958aef0f6502e466f .claude-plugin/marketplace.json
2
- c8b8c128e95ddff655078c9b3d9e296ee50b6bfa14f3b982c32769d10c3404f5 .claude-plugin/plugin.json
1
+ 170d72bc88b1f2568f8fd4c7d67908029522f7ff8bbb190433307cdbd83a2b4a .claude-plugin/marketplace.json
2
+ 0139fba3ed537d7a809009224217d3f92069643a524dd37b753e38c32d21ef25 .claude-plugin/plugin.json
3
3
  187503e1455560d4ab5a72e3b8cd2f274abd4ccc5faa60dd66c37e44bb5f10c2 .codex-plugin/hooks.json
4
4
  4edea851775bc3f0418f8d9cf6ead74f2767c3a9e3b8c05749eacb78ebb3b896 .codex-plugin/mcp.json
5
- 49e4e0561b7bb072c50eb225a16f0884cbb29f8d5a003d3acbad8e87eb61212d .codex-plugin/plugin.json
5
+ 75afc997fab549f8449953ae6fccb5499a6d0c0242ceec505d54968e507fecb6 .codex-plugin/plugin.json
6
6
  1773e40a89384dd1af9023ba533da1908f3e2435dbaaa7cc941edf0514148313 claude-code/skills/ctx-doctor/SKILL.md
7
7
  34fffb9c76d69c551f07036230bec0fbaca7a69177a5a47f89ddb9a9990a1fa2 claude-code/skills/ctx-stats/SKILL.md
8
8
  d8f835d2f2b3eb70c5902f8707e7c5857977cec9e20ace76c499378a04e178e0 claude-code/skills/ctx-upgrade/SKILL.md
9
- a05eca0e2ef3846dece2be2da496fd4594e8d01017003af866020008f03595ae cli.mjs
9
+ a69c0fac9c978267f9e8676a6fe9c754a72a3e898975be5e78d90698c7142961 cli.mjs
10
10
  83c297020ed0c592fc68c9c482546a6999d41df5d06d8a329498f10edb1bd38e codex/skills/ctx-doctor/SKILL.md
11
11
  adc2c374f699d3698110920bb48411965de09fc6e7232ce59c913f6d58c0d738 codex/skills/ctx-stats/SKILL.md
12
12
  5c12cdd19a5e3ed7d9ba3a47b24d03864a28d36cf7006876284ee07cd4221ec4 codex/skills/ctx-upgrade/SKILL.md
13
- 0580b0661427021abb16f74f219775db2adc63d0fa0c10141ab80a847636e273 copilot/plugin.json
13
+ 55b1e5099b525366b8869a400eca087bc61d10fc5444f7f9404e818b44dbc49c copilot/plugin.json
14
14
  e3bc6cae0bd51b806d81631879711bbc48c679fc929b2642ed4634438364167d fixtures/hook-roundtrip.json
15
- ef70a0db91076959e51a28ab48ab0072b97b35b6604d4c72152a6a0212826b21 gemini-extension.json
16
- 77ad72252ee33c80977f820ba5572c0cd898e141ae698a631379706edcada51d hook.mjs
15
+ 53c5491ef8519eb1527a410009d0db0bed868a4c832f2f5b900a3f85a6aebd56 gemini-extension.json
16
+ b58303ab9c463e36c85ad20ecf375080c049d82f7dd1e2dd5fbcff4b8830a72c hook.mjs
17
17
  1f8d8650d2b38737522cab6b875878e8baf84a74acf98cd924c7af22852d873f hooks/claude-code.json
18
18
  2524a0eb52683b65c65943c5097db513e9845ba14e84324b39e9a8ea2bb43193 hooks/codex.json
19
19
  b656fed2b754ebcfd4c156bee81d5879c21a8083fc0d6b8e3241462b63a214b6 hooks/copilot-cli.json
@@ -22,16 +22,16 @@ f336d1db67de49e641687bbd41ba1a9424e31dfe2377b2284bf44358288ebd8b hooks/kiro.jso
22
22
  017c9cc3997dd53231b8548b1a1609fddc51177af53501565a4f334602039860 hooks/qwen.json
23
23
  33f69267645338d0dc392ce551dcd7c69a0b508113469d6ea637d3f34239ef1d hooks/vscode.json
24
24
  085630bccf2073ac9a62be24ef91dfc47d106092dc82c822db70890b7d3ae1c0 hooks/zcode.json
25
- 63c2293f34fe8c778b558255cbbd2cd15b11b5c930b6900e1f936494b734a12c opencode/plugin.js
26
- 2d9442994723137eb6bc983c2476c3fdc3d46042155c20d61c3ed5b4c447419f package.json
27
- 5ff9e02c6ea5700ce790f26e13934e4887595802a56c670cefc435d2e5347281 pi/index.js
25
+ 67c46292af5625a4da9ce3b357d26564bcafeac2575238defa55d4f4547e223f opencode/plugin.js
26
+ f70d5caf68c1120422c88db6d94bd988bedc2fb192c2cecaf71c91528efe4d7a package.json
27
+ 0ec19c55e2aaea9d42117fffe9044f0a5e388ccc3b49a04da678cc1d84945fd8 pi/index.js
28
28
  8712881622c9905aa4836af50d903042d34a91506264e459bc7839331f6f0192 pi/skills/ctx-doctor/SKILL.md
29
29
  8d6e8e2a82eb079bddc60727f52d9f9a6e0bf9e15391357fed82ee76ab5fe76c pi/skills/ctx-stats/SKILL.md
30
30
  db6f9c006bc864a7271f1eeffb1e316ebb537a3414f1c22f8b9de0a896e8e3c5 pi/skills/ctx-upgrade/SKILL.md
31
- 3c4cf805a7b49196cd647a4731b87ec8e88cb4314a0b9e4533f65d39ca10cb34 qwen-extension.json
32
- 2100fc1015fc5346a57da56c7c43f8cba6a0e57d4ce32a45b70ae0baa4987b00 run.mjs
33
- 2100fc1015fc5346a57da56c7c43f8cba6a0e57d4ce32a45b70ae0baa4987b00 search.mjs
34
- b67d546eed2e9d862c7c287496d9f47f1351be06fe7c1b8502e038ba9c36422c server.mjs
31
+ b5d6f8633de23fab124c0b6bce74656adb25b1b966d32d513fe5543250ed4b0b qwen-extension.json
32
+ 28a957921c1dd24aef587fc0f8c6835de1cbbe49eff18104c5d1dd70c0297aad run.mjs
33
+ 28a957921c1dd24aef587fc0f8c6835de1cbbe49eff18104c5d1dd70c0297aad search.mjs
34
+ 0a71c81e65e586c7336baa0705848bb98528957064fbf1cbabb429ed10d2c52d server.mjs
35
35
  e5503a22a6238901484d123efc11d2d933aa9a54c6ac2018812cfa65ec4e53e3 skills/ctx-doctor/SKILL.md
36
36
  1044587a1906c69f2467c089a25e19819a290ea5728389bd1f086c6dfc0d0c51 skills/ctx-stats/SKILL.md
37
37
  c1cac75b7506ee0d06089ce611ac6dc9314cf12435da318ce88ad50e2c5debbf skills/ctx-upgrade/SKILL.md
package/cli.mjs CHANGED
@@ -1139,7 +1139,8 @@ var OPENCODE_EVENTS = {
1139
1139
  "step-finish": "Usage"
1140
1140
  };
1141
1141
  var SHELL_TOOL_NAME = "bash";
1142
- var NATIVE_TO_CANONICAL7 = { webfetch: "WebFetch", [SHELL_TOOL_NAME]: "Bash" };
1142
+ var SHELL_TOOL_NAMES4 = Object.freeze([SHELL_TOOL_NAME, "shell"]);
1143
+ var NATIVE_TO_CANONICAL7 = { webfetch: "WebFetch", ...Object.fromEntries(SHELL_TOOL_NAMES4.map((n3) => [n3, "Bash"])) };
1143
1144
  function toCanonicalTool(name) {
1144
1145
  if (name.startsWith(OWN_WIRE_PREFIX)) return name.slice(OWN_WIRE_PREFIX.length);
1145
1146
  return Object.prototype.hasOwnProperty.call(NATIVE_TO_CANONICAL7, name) ? NATIVE_TO_CANONICAL7[name] : name;
@@ -7608,7 +7609,7 @@ function hookInstallFor(ctx, row, command) {
7608
7609
  kind: "plugin-list",
7609
7610
  file: path3.join(opencodeDirOf(ctx.env, ctx.home), OPENCODE_BASE_CONFIG_FILE),
7610
7611
  key: ["plugin"],
7611
- entry: path3.join(ctx.pkgDir, ...OPENCODE_PLUGIN_PATH)
7612
+ entry: ctx.pkgDir
7612
7613
  };
7613
7614
  }
7614
7615
  return { kind: "package", via: ch.path };
@@ -8643,16 +8644,24 @@ function isNativeSpec(e) {
8643
8644
  return typeof e === "string" && e.startsWith(NATIVE_PLUGIN_PREFIX);
8644
8645
  }
8645
8646
  function isStaleOwnPlugin(e, entry2) {
8646
- if (typeof e !== "string" || e === entry2 || !path12.isAbsolute(e) || existsSync12(e)) return false;
8647
+ if (typeof e !== "string" || e === entry2 || !path12.isAbsolute(e)) return false;
8648
+ if (e === path12.join(entry2, ...OPENCODE_PLUGIN_PATH)) return true;
8649
+ if (existsSync12(e)) return false;
8647
8650
  const seg = e.split("\\").join("/").split("/");
8648
8651
  const n3 = seg.length;
8649
- return n3 >= 3 && seg[n3 - 1] === "plugin.js" && seg[n3 - 2] === "opencode" && seg[n3 - 3] === "context-mode";
8652
+ if (n3 >= 3 && seg[n3 - 1] === "plugin.js" && seg[n3 - 2] === "opencode" && seg[n3 - 3] === "context-mode") return true;
8653
+ return n3 >= 2 && seg[n3 - 1] === "context-mode" && seg[n3 - 2] === "node_modules";
8650
8654
  }
8651
- function wantedPluginList(list2, entry2) {
8652
- const native = list2.some(isNativeSpec);
8655
+ function wantedPluginList(list2, entry2, nativeElsewhere = false) {
8656
+ const native = nativeElsewhere || list2.some(isNativeSpec);
8653
8657
  const kept = list2.filter((e) => !(native && e === entry2) && !isStaleOwnPlugin(e, entry2));
8654
8658
  return native || kept.includes(entry2) ? kept : [...kept, entry2];
8655
8659
  }
8660
+ var OC2_NATIVE_KEY = "plugins";
8661
+ function nativePluginsKey(doc) {
8662
+ const v = isObj5(doc) ? doc[OC2_NATIVE_KEY] : void 0;
8663
+ return Array.isArray(v) && v.some(isNativeSpec);
8664
+ }
8656
8665
  function pluginListIssue(h2) {
8657
8666
  const text2 = readOr(h2.file);
8658
8667
  if (text2 === void 0) return void 0;
@@ -8664,7 +8673,7 @@ function pluginListIssue(h2) {
8664
8673
  }
8665
8674
  const cur = isObj5(doc) ? doc[h2.key[0]] : void 0;
8666
8675
  const list2 = Array.isArray(cur) ? cur : [];
8667
- if (list2.some(isNativeSpec) && list2.includes(h2.entry)) return `${h2.file}: context-mode loads twice (native entry and ${h2.entry}), every hook fires twice; run: context-mode setup`;
8676
+ if ((list2.some(isNativeSpec) || nativePluginsKey(doc)) && list2.includes(h2.entry)) return `${h2.file}: context-mode loads twice (native entry and ${h2.entry}), every hook fires twice; run: context-mode setup`;
8668
8677
  const stale = list2.find((e) => isStaleOwnPlugin(e, h2.entry));
8669
8678
  if (stale !== void 0) return `${h2.file}: plugin file missing, so OpenCode never loads the hooks (${String(stale)}); run: context-mode setup`;
8670
8679
  return void 0;
@@ -8691,7 +8700,8 @@ function planHookInstall(row, edits, env) {
8691
8700
  planJsonKeys(row, edits, h2.file, fileFormat(row, h2.file), (doc) => {
8692
8701
  const cur = doc[h2.key[0]];
8693
8702
  const list2 = Array.isArray(cur) ? cur : [];
8694
- const want = wantedPluginList(list2, h2.entry);
8703
+ const want = wantedPluginList(list2, h2.entry, nativePluginsKey(doc));
8704
+ if (cur === void 0 && want.length === 0) return [];
8695
8705
  return [[h2.key, want.length === list2.length && want.every((e, i2) => e === list2[i2]) ? list2 : want]];
8696
8706
  });
8697
8707
  }
@@ -8754,9 +8764,19 @@ function statusOf(row, text2) {
8754
8764
  }
8755
8765
  return void 0;
8756
8766
  }
8767
+ function opencodeMajor(bin, env) {
8768
+ const r2 = runBin(bin, ["--version"], env);
8769
+ const text2 = `${r2.stdout}${r2.stderr}`;
8770
+ const digits = text2.split("").filter((c3) => c3 >= "0" && c3 <= "9" || c3 === ".").join("");
8771
+ return Number(digits.split(".")[0]);
8772
+ }
8773
+ function opencodeListArgs(bin, env) {
8774
+ return opencodeMajor(bin, env) >= 2 ? ["mcp", "list", "--standalone"] : ["mcp", "list", "--pure"];
8775
+ }
8757
8776
  function listState(row, env) {
8758
- const l2 = row.listCommand;
8759
- if (!l2 || !hostBin(l2.bin, env).file) return { status: void 0 };
8777
+ const l0 = row.listCommand;
8778
+ if (!l0 || !hostBin(l0.bin, env).file) return { status: void 0 };
8779
+ const l2 = row.id === "opencode" ? { bin: l0.bin, args: opencodeListArgs(l0.bin, env) } : l0;
8760
8780
  const r2 = runBin(l2.bin, l2.args, env);
8761
8781
  const ok = r2.status === 0 && `${r2.stdout}${r2.stderr}`.includes("context-mode");
8762
8782
  const check = { name: "list", ok, detail: ok ? void 0 : `${l2.bin} ${l2.args.join(" ")} does not list context-mode` };
@@ -8938,7 +8958,8 @@ function hookRegisteredCheck(row, env, list2) {
8938
8958
  const trust = h2.kind === "file" ? h2.trust : void 0;
8939
8959
  if (trust && edits.every((e) => e.file === trust && e.changes.every((c3) => isTrust(row, c3)))) return { name: "hook-registered", ok: false, detail: `${h2.file}: the context-mode hooks are not trusted in ${trust}; re-run setup` };
8940
8960
  const issue = h2.kind === "plugin-list" ? pluginListIssue(h2) : h2.kind === "file" && row.id === "kiro" ? kiroDisabledIssue(h2) : void 0;
8941
- return { name: "hook-registered", ok: false, detail: issue ?? `${h2.file} lacks the context-mode hook entry` };
8961
+ const oc2 = issue === void 0 && row.id === "opencode" && h2.kind === "plugin-list" && hostBin("opencode", env).file !== void 0 && opencodeMajor("opencode", env) >= 2;
8962
+ return { name: "hook-registered", ok: false, detail: issue ?? `${h2.file} lacks the context-mode hook entry${oc2 ? "; run: opencode plugin add context-mode@next" : ""}` };
8942
8963
  }
8943
8964
  function hookRunsCheck(row, env) {
8944
8965
  const root = mkdtempSync(path12.join(tmpdir2(), "cm-doctor-runs-"));
@@ -9399,7 +9420,7 @@ async function runDoctor(opts) {
9399
9420
  res.reason = V1_FORM_REASON;
9400
9421
  } else if (res.changes.length && !onlyTrust(row, res.changes) && !hasPluginIssue(row)) {
9401
9422
  res.status = "FAIL";
9402
- res.reason = NOT_SET_UP_REASON;
9423
+ res.reason = notSetUpReason(row, res, ctx.env);
9403
9424
  } else {
9404
9425
  res.checks = await verifyRow(row, ctx);
9405
9426
  const bad = res.checks.filter((c3) => !c3.ok);
@@ -9414,6 +9435,12 @@ async function runDoctor(opts) {
9414
9435
  }
9415
9436
  return { exitCode: agents.some((a2) => a2.status === "FAIL") ? 1 : 0, agents };
9416
9437
  }
9438
+ function notSetUpReason(row, res, env) {
9439
+ const h2 = row.hookInstall;
9440
+ const missing = row.id === "opencode" && h2.kind === "plugin-list" && res.changes.some((c3) => c3.path === h2.key[0]);
9441
+ const oc2 = missing && hostBin("opencode", env).file !== void 0 && opencodeMajor("opencode", env) >= 2;
9442
+ return oc2 ? `${NOT_SET_UP_REASON}, or run: opencode plugin add context-mode@next` : NOT_SET_UP_REASON;
9443
+ }
9417
9444
  function hasPluginIssue(row) {
9418
9445
  const h2 = row.hookInstall;
9419
9446
  if (h2.kind === "file") return row.id === "kiro" && kiroDisabledIssue(h2) !== void 0;
@@ -11,5 +11,5 @@
11
11
  }
12
12
  },
13
13
  "name": "context-mode",
14
- "version": "2.0.0-next.18"
14
+ "version": "2.0.0-next.21"
15
15
  }
@@ -11,5 +11,5 @@
11
11
  }
12
12
  },
13
13
  "name": "context-mode",
14
- "version": "2.0.0-next.18"
14
+ "version": "2.0.0-next.21"
15
15
  }