@cortexkit/aft-opencode 0.22.0 → 0.23.0

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.
package/dist/index.js CHANGED
@@ -9305,9 +9305,9 @@ import { chmodSync as chmodSync3, copyFileSync as copyFileSync2, existsSync as e
9305
9305
  import { createRequire } from "module";
9306
9306
  import { homedir as homedir4 } from "os";
9307
9307
  import { join as join4 } from "path";
9308
- function copyToVersionedCache(npmBinaryPath) {
9308
+ function readBinaryVersion(binaryPath) {
9309
9309
  try {
9310
- const result = spawnSync(npmBinaryPath, ["--version"], {
9310
+ const result = spawnSync(binaryPath, ["--version"], {
9311
9311
  encoding: "utf-8",
9312
9312
  stdio: ["pipe", "pipe", "pipe"],
9313
9313
  timeout: 5000
@@ -9315,7 +9315,16 @@ function copyToVersionedCache(npmBinaryPath) {
9315
9315
  const rawVersion = result.stdout?.trim();
9316
9316
  if (!rawVersion)
9317
9317
  return null;
9318
- const version = rawVersion.replace(/^aft\s+/, "");
9318
+ return rawVersion.replace(/^aft\s+/, "");
9319
+ } catch {
9320
+ return null;
9321
+ }
9322
+ }
9323
+ function copyToVersionedCache(npmBinaryPath, knownVersion) {
9324
+ try {
9325
+ const version = knownVersion ?? readBinaryVersion(npmBinaryPath);
9326
+ if (!version)
9327
+ return null;
9319
9328
  const tag = version.startsWith("v") ? version : `v${version}`;
9320
9329
  const cacheDir = getCacheDir();
9321
9330
  const versionedDir = join4(cacheDir, tag);
@@ -9370,8 +9379,13 @@ function findBinarySync(expectedVersion) {
9370
9379
  const req = createRequire(import.meta.url);
9371
9380
  const resolved = req.resolve(packageBin);
9372
9381
  if (existsSync3(resolved)) {
9373
- const copied = copyToVersionedCache(resolved);
9374
- return copied ?? resolved;
9382
+ const npmVersion = readBinaryVersion(resolved);
9383
+ if (pluginVersion && npmVersion && npmVersion !== pluginVersion) {
9384
+ warn(`npm platform package binary v${npmVersion} does not match plugin v${pluginVersion}; skipping (continuing to PATH lookup)`);
9385
+ } else {
9386
+ const copied = copyToVersionedCache(resolved, npmVersion ?? undefined);
9387
+ return copied ?? resolved;
9388
+ }
9375
9389
  }
9376
9390
  } catch {}
9377
9391
  try {
@@ -28121,7 +28135,6 @@ async function resolveIsSubagent(client, sessionId, _fallbackDirectory) {
28121
28135
  if (cached2) {
28122
28136
  cache2.delete(sessionId);
28123
28137
  cache2.set(sessionId, cached2);
28124
- sessionLog2(sessionId, `[subagent-detect] cache hit: isSubagent=${cached2.isSubagent}`);
28125
28138
  return cached2.isSubagent;
28126
28139
  }
28127
28140
  const c = client;
@@ -28210,7 +28223,6 @@ function createBashTool(ctx) {
28210
28223
  const isSubagent = await resolveIsSubagent(ctx.client, context.sessionID, context.directory);
28211
28224
  const requestedBackground = args.background === true;
28212
28225
  const effectiveBackground = isSubagent ? false : requestedBackground;
28213
- sessionLog2(context.sessionID, `[bash] subagent gate: isSubagent=${isSubagent}, requestedBackground=${requestedBackground}, effectiveBackground=${effectiveBackground}, hasTimeout=${typeof args.timeout === "number"}`);
28214
28226
  if (isSubagent && requestedBackground) {
28215
28227
  sessionLog2(context.sessionID, "[bash] subagent + background:true \u2192 converting to foreground (subagent would lose task_id)");
28216
28228
  }
@@ -30359,21 +30371,21 @@ function arg2(schema) {
30359
30371
  function semanticTools(ctx) {
30360
30372
  const searchTool = {
30361
30373
  description: [
30362
- "Find symbols by concept when grep keywords fall short. Returns ranked code matches with similarity scores.",
30374
+ "Find symbols by concept using hybrid semantic + lexical search. Returns ranked code matches with similarity scores and provenance tags.",
30363
30375
  "",
30364
30376
  "When to reach for it:",
30365
30377
  "- Exploring an unfamiliar area: 'where is rate limiting handled', 'how does auth flow work'",
30366
30378
  "- Concept doesn't appear as a literal string: 'retry logic', 'cache invalidation', 'graceful shutdown'",
30379
+ "- Filename-shaped concepts: 'the bridge spawn helper', 'the session detection module'",
30367
30380
  "- After 2+ grep attempts that came back empty or noisy",
30368
30381
  "- You know roughly what the function does but not what it's named",
30369
30382
  "",
30370
30383
  "When NOT to use:",
30371
- "- You have a specific symbol name \u2192 use grep",
30372
30384
  "- You have an error message or stack trace \u2192 use grep",
30373
30385
  "- You want the file/module structure \u2192 use aft_outline",
30374
30386
  "- You're following a call chain \u2192 use aft_navigate",
30375
30387
  "",
30376
- "Scores below ~0.4 are usually weak matches; treat them as 'maybe relevant' and verify with read."
30388
+ "Each result tags `source` as one of: 'semantic' (embedding match only), 'lexical' (trigram exact-token match the embedding lane missed), or 'hybrid' (both lanes agreed \u2014 strongest signal)."
30377
30389
  ].join(`
30378
30390
  `),
30379
30391
  args: {
@@ -30537,8 +30549,8 @@ function buildWorkflowHints(opts) {
30537
30549
  sections.push(`**Web/URL access**: \`aft_outline({ url })\` first for structure, then \`aft_zoom({ url, symbol: "<heading>" })\` for the specific section.`);
30538
30550
  }
30539
30551
  if (hasOutline && hasZoom && (hasGrep || hasSearch)) {
30540
- const locator = hasGrep && hasSearch ? `\`${grepName}\` or \`aft_search\`` : hasGrep ? `\`${grepName}\`` : "`aft_search`";
30541
- sections.push(`**Code exploration**: ${locator} to locate \u2192 \`aft_outline\` for structure \u2192 \`aft_zoom\` for symbol(s).`);
30552
+ const locator = hasGrep ? `\`${grepName}\`` : "`aft_search`";
30553
+ sections.push(hasGrep && hasSearch ? `**Code exploration**: For exact identifiers (\`useState\`, function names, env vars), error messages, or path-shaped queries \u2192 \`${grepName}\` first. For broad concepts ('where is X handled', 'how does Y work') \u2192 \`aft_search\`. Then use \`aft_outline\` for structure \u2192 \`aft_zoom\` for symbol(s).` : `**Code exploration**: ${locator} to locate \u2192 \`aft_outline\` for structure \u2192 \`aft_zoom\` for symbol(s).`);
30542
30554
  }
30543
30555
  if (hasNavigate) {
30544
30556
  sections.push([
@@ -30659,7 +30671,7 @@ var ANNOUNCEMENT_FEATURES = [
30659
30671
  ];
30660
30672
  var plugin = async (input) => initializePluginForDirectory(input);
30661
30673
  async function initializePluginForDirectory(input) {
30662
- const binaryPath = await findBinary();
30674
+ const binaryPath = await findBinary(PLUGIN_VERSION);
30663
30675
  const aftConfig = loadAftConfig(input.directory);
30664
30676
  const autoUpdateAbort = new AbortController;
30665
30677
  const configOverrides = {};
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0EjD,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwOjE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAqCvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAmBrE"}
1
+ {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0EjD,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAuOjE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAqCvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAmBrE"}
package/dist/tui.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@cortexkit/aft-opencode",
5
- version: "0.22.0",
5
+ version: "0.23.0",
6
6
  type: "module",
7
7
  description: "OpenCode plugin for Agent File Tools (AFT) \u2014 tree-sitter and lsp powered code analysis",
8
8
  main: "dist/index.js",
@@ -30,7 +30,7 @@ var package_default = {
30
30
  },
31
31
  dependencies: {
32
32
  "@clack/prompts": "^1.2.0",
33
- "@cortexkit/aft-bridge": "0.22.0",
33
+ "@cortexkit/aft-bridge": "0.23.0",
34
34
  "@opencode-ai/plugin": "^1.14.39",
35
35
  "@opencode-ai/sdk": "^1.14.39",
36
36
  "comment-json": "^4.6.2",
@@ -38,11 +38,11 @@ var package_default = {
38
38
  zod: "^4.1.8"
39
39
  },
40
40
  optionalDependencies: {
41
- "@cortexkit/aft-darwin-arm64": "0.22.0",
42
- "@cortexkit/aft-darwin-x64": "0.22.0",
43
- "@cortexkit/aft-linux-arm64": "0.22.0",
44
- "@cortexkit/aft-linux-x64": "0.22.0",
45
- "@cortexkit/aft-win32-x64": "0.22.0"
41
+ "@cortexkit/aft-darwin-arm64": "0.23.0",
42
+ "@cortexkit/aft-darwin-x64": "0.23.0",
43
+ "@cortexkit/aft-linux-arm64": "0.23.0",
44
+ "@cortexkit/aft-linux-x64": "0.23.0",
45
+ "@cortexkit/aft-win32-x64": "0.23.0"
46
46
  },
47
47
  devDependencies: {
48
48
  "@types/node": "^22.0.0",
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,wEAAwE;IACxE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAsEzE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAQjG"}
1
+ {"version":3,"file":"workflow-hints.d.ts","sourceRoot":"","sources":["../src/workflow-hints.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,WAAW,EAAE,SAAS,GAAG,aAAa,GAAG,KAAK,CAAC;IAC/C,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;IACzB,wEAAwE;IACxE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAmEzE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAQjG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-opencode",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@clack/prompts": "^1.2.0",
31
- "@cortexkit/aft-bridge": "0.22.0",
31
+ "@cortexkit/aft-bridge": "0.23.0",
32
32
  "@opencode-ai/plugin": "^1.14.39",
33
33
  "@opencode-ai/sdk": "^1.14.39",
34
34
  "comment-json": "^4.6.2",
@@ -36,11 +36,11 @@
36
36
  "zod": "^4.1.8"
37
37
  },
38
38
  "optionalDependencies": {
39
- "@cortexkit/aft-darwin-arm64": "0.22.0",
40
- "@cortexkit/aft-darwin-x64": "0.22.0",
41
- "@cortexkit/aft-linux-arm64": "0.22.0",
42
- "@cortexkit/aft-linux-x64": "0.22.0",
43
- "@cortexkit/aft-win32-x64": "0.22.0"
39
+ "@cortexkit/aft-darwin-arm64": "0.23.0",
40
+ "@cortexkit/aft-darwin-x64": "0.23.0",
41
+ "@cortexkit/aft-linux-arm64": "0.23.0",
42
+ "@cortexkit/aft-linux-x64": "0.23.0",
43
+ "@cortexkit/aft-win32-x64": "0.23.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^22.0.0",
@@ -72,10 +72,10 @@ export async function resolveIsSubagent(
72
72
 
73
73
  const cached = cache.get(sessionId);
74
74
  if (cached) {
75
- // Refresh LRU position
75
+ // Refresh LRU position. Don't log the hit — it's pure noise; the
76
+ // downstream call sites already log their effective gate decisions.
76
77
  cache.delete(sessionId);
77
78
  cache.set(sessionId, cached);
78
- sessionLog(sessionId, `[subagent-detect] cache hit: isSubagent=${cached.isSubagent}`);
79
79
  return cached.isSubagent;
80
80
  }
81
81