@cortexkit/aft-opencode 0.22.1 → 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 +25 -11
- package/dist/tui.js +7 -7
- package/dist/workflow-hints.d.ts.map +1 -1
- package/package.json +7 -7
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
|
|
9308
|
+
function readBinaryVersion(binaryPath) {
|
|
9309
9309
|
try {
|
|
9310
|
-
const result = spawnSync(
|
|
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
|
-
|
|
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
|
|
9374
|
-
|
|
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 {
|
|
@@ -30357,21 +30371,21 @@ function arg2(schema) {
|
|
|
30357
30371
|
function semanticTools(ctx) {
|
|
30358
30372
|
const searchTool = {
|
|
30359
30373
|
description: [
|
|
30360
|
-
"Find symbols by concept
|
|
30374
|
+
"Find symbols by concept using hybrid semantic + lexical search. Returns ranked code matches with similarity scores and provenance tags.",
|
|
30361
30375
|
"",
|
|
30362
30376
|
"When to reach for it:",
|
|
30363
30377
|
"- Exploring an unfamiliar area: 'where is rate limiting handled', 'how does auth flow work'",
|
|
30364
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'",
|
|
30365
30380
|
"- After 2+ grep attempts that came back empty or noisy",
|
|
30366
30381
|
"- You know roughly what the function does but not what it's named",
|
|
30367
30382
|
"",
|
|
30368
30383
|
"When NOT to use:",
|
|
30369
|
-
"- You have a specific symbol name \u2192 use grep",
|
|
30370
30384
|
"- You have an error message or stack trace \u2192 use grep",
|
|
30371
30385
|
"- You want the file/module structure \u2192 use aft_outline",
|
|
30372
30386
|
"- You're following a call chain \u2192 use aft_navigate",
|
|
30373
30387
|
"",
|
|
30374
|
-
"
|
|
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)."
|
|
30375
30389
|
].join(`
|
|
30376
30390
|
`),
|
|
30377
30391
|
args: {
|
|
@@ -30535,8 +30549,8 @@ function buildWorkflowHints(opts) {
|
|
|
30535
30549
|
sections.push(`**Web/URL access**: \`aft_outline({ url })\` first for structure, then \`aft_zoom({ url, symbol: "<heading>" })\` for the specific section.`);
|
|
30536
30550
|
}
|
|
30537
30551
|
if (hasOutline && hasZoom && (hasGrep || hasSearch)) {
|
|
30538
|
-
const locator = hasGrep
|
|
30539
|
-
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).`);
|
|
30540
30554
|
}
|
|
30541
30555
|
if (hasNavigate) {
|
|
30542
30556
|
sections.push([
|
|
@@ -30657,7 +30671,7 @@ var ANNOUNCEMENT_FEATURES = [
|
|
|
30657
30671
|
];
|
|
30658
30672
|
var plugin = async (input) => initializePluginForDirectory(input);
|
|
30659
30673
|
async function initializePluginForDirectory(input) {
|
|
30660
|
-
const binaryPath = await findBinary();
|
|
30674
|
+
const binaryPath = await findBinary(PLUGIN_VERSION);
|
|
30661
30675
|
const aftConfig = loadAftConfig(input.directory);
|
|
30662
30676
|
const autoUpdateAbort = new AbortController;
|
|
30663
30677
|
const configOverrides = {};
|
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.
|
|
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.
|
|
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.
|
|
42
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
43
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
44
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
45
|
-
"@cortexkit/aft-win32-x64": "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,
|
|
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.
|
|
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.
|
|
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.
|
|
40
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
41
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
42
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
43
|
-
"@cortexkit/aft-win32-x64": "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",
|