diff --git a/.changeset/add-fallback-kibi-cli.md b/.changeset/add-fallback-kibi-cli.md deleted file mode 100644 index ccf775df..00000000 --- a/.changeset/add-fallback-kibi-cli.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"kibi-cli": patch - ---- - -Add fallback support for unique non-exported top-level functions and class methods during symbol coordinate refresh. Resolves symbols that were previously reported as failed. diff --git a/.changeset/kibi-cli-resolve-kb-pl-path.md b/.changeset/kibi-cli-resolve-kb-pl-path.md deleted file mode 100644 index adb2619f..00000000 --- a/.changeset/kibi-cli-resolve-kb-pl-path.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"kibi-cli": patch ---- - -Export resolveKbPlPath from kibi-cli public prolog surface - -Add `resolveKbPlPath` to the public `kibi-cli/prolog` export so that `kibi-mcp` -can import it without breaking against older `kibi-cli` versions that do not -expose this symbol. diff --git a/documentation/symbols.yaml b/documentation/symbols.yaml index 94ebf9cc..1f2b43d4 100644 --- a/documentation/symbols.yaml +++ b/documentation/symbols.yaml @@ -20,7 +20,7 @@ symbols: sourceColumn: 13 sourceEndLine: 576 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:29.391Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.173Z' - id: SYM-002 title: handleKbUpsert sourceFile: packages/mcp/src/tools/upsert.ts @@ -36,7 +36,7 @@ symbols: sourceColumn: 22 sourceEndLine: 244 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:29.664Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.274Z' - id: SYM-003 title: handleKbQuery sourceFile: packages/mcp/src/tools/query.ts @@ -49,7 +49,7 @@ symbols: sourceColumn: 22 sourceEndLine: 91 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:29.666Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.275Z' - id: SYM-004 title: handleKbCheck sourceFile: packages/mcp/src/tools/check.ts @@ -65,7 +65,7 @@ symbols: sourceColumn: 22 sourceEndLine: 219 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:29.797Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.353Z' - id: SYM-005 title: KibiTreeDataProvider sourceFile: packages/vscode/src/treeProvider.ts @@ -81,7 +81,7 @@ symbols: sourceColumn: 13 sourceEndLine: 1002 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.021Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.481Z' - id: SYM-007 title: extractFromManifest sourceFile: packages/cli/src/extractors/manifest.ts @@ -94,7 +94,7 @@ symbols: sourceColumn: 16 sourceEndLine: 176 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.131Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.536Z' - id: SYM-010 title: startServer sourceFile: packages/mcp/src/server.ts @@ -107,7 +107,7 @@ symbols: sourceColumn: 22 sourceEndLine: 57 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.473Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.707Z' - id: SYM-KibiTreeDataProvider title: KibiTreeDataProvider sourceFile: packages/vscode/src/treeProvider.ts @@ -123,7 +123,7 @@ symbols: sourceColumn: 13 sourceEndLine: 1002 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.473Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.707Z' - id: SYM-KibiCodeActionProvider title: KibiCodeActionProvider sourceFile: packages/vscode/src/codeActionProvider.ts @@ -138,7 +138,7 @@ symbols: sourceColumn: 13 sourceEndLine: 106 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.476Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.708Z' - id: SYM-handleKbQueryRelationships title: handleKbQueryRelationships sourceFile: packages/mcp/src/tools/query-relationships.ts @@ -170,7 +170,7 @@ symbols: sourceColumn: 16 sourceEndLine: 91 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.477Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.710Z' - id: SYM-KibiCodeLensProvider title: KibiCodeLensProvider sourceFile: packages/vscode/src/codeLensProvider.ts @@ -185,7 +185,7 @@ symbols: sourceColumn: 13 sourceEndLine: 334 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.596Z' + coordinatesGeneratedAt: '2026-03-28T18:53:57.821Z' - id: SYM-mergeStaticLinks title: mergeStaticLinks sourceFile: packages/vscode/src/codeLensProvider.ts @@ -200,7 +200,7 @@ symbols: sourceColumn: 10 sourceEndLine: 210 sourceEndColumn: 3 - coordinatesGeneratedAt: '2026-03-27T21:12:30.598Z' + coordinatesGeneratedAt: '2026-03-28T11:20:40.126Z' - id: SYM-parseSymbolsManifest title: parseSymbolsManifest sourceFile: packages/vscode/src/symbolIndex.ts @@ -215,4 +215,4 @@ symbols: sourceColumn: 9 sourceEndLine: 185 sourceEndColumn: 1 - coordinatesGeneratedAt: '2026-03-27T21:12:30.599Z' + coordinatesGeneratedAt: '2026-03-28T11:20:40.127Z' diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 0f11ed6d..c8e9d71a 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,16 @@ # kibi-cli +## 0.4.1 + +### Patch Changes + +- c8761a9: Add fallback support for unique non-exported top-level functions and class methods during symbol coordinate refresh. Resolves symbols that were previously reported as failed. +- 46baebc: Export resolveKbPlPath from kibi-cli public prolog surface + + Add `resolveKbPlPath` to the public `kibi-cli/prolog` export so that `kibi-mcp` + can import it without breaking against older `kibi-cli` versions that do not + expose this symbol. + ## 0.4.0 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index dc8ca476..b6a912e1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "kibi-cli", - "version": "0.4.0", + "version": "0.4.1", "type": "module", "description": "Kibi CLI for knowledge base management", "engines": { diff --git a/packages/cli/tests/extractors/symbols-ts.test.ts b/packages/cli/tests/extractors/symbols-ts.test.ts index e0ed21d9..1f61d90b 100644 --- a/packages/cli/tests/extractors/symbols-ts.test.ts +++ b/packages/cli/tests/extractors/symbols-ts.test.ts @@ -161,4 +161,78 @@ describe("symbols-ts matcher guardrails", () => { expect(result.coordinatesGeneratedAt).toBeUndefined(); expect(result.sourceLine).toBeUndefined(); }); + + test("uniqueNonExportedHelperGetsCoordinates: unique non-exported helper receives coordinates", async () => { + const source = [ + "// file with only non-exported helper", + "", + "function uniqueHelper() { return 'helper'; }", + ].join("\n"); + + sourceFilePath = path.join(tmpDir, "unique-helper.ts"); + fs.writeFileSync(sourceFilePath, source, "utf8"); + + const entry: ManifestSymbolEntry = { + id: "SYM-uniqueHelper", + title: "uniqueHelper", + sourceFile: sourceFilePath, + }; + + const [result] = await enrichSymbolCoordinatesWithTsMorph([entry], tmpDir); + + // Coordinates must be generated + expect(result.coordinatesGeneratedAt).toBeDefined(); + // The function is on line 3 (1-based) + expect(result.sourceLine).toBe(3); + }); + + test("uniqueClassMethodGetsCoordinates: unique class method receives coordinates", async () => { + const source = [ + "// file with a single class and unique method", + "class MyClass {", + " uniqueMethod() { return 'method'; }", + "}", + ].join("\n"); + + sourceFilePath = path.join(tmpDir, "class-method.ts"); + fs.writeFileSync(sourceFilePath, source, "utf8"); + + const entry: ManifestSymbolEntry = { + id: "SYM-uniqueMethod", + title: "uniqueMethod", + sourceFile: sourceFilePath, + }; + + const [result] = await enrichSymbolCoordinatesWithTsMorph([entry], tmpDir); + + // Coordinates must be generated for the class method + expect(result.coordinatesGeneratedAt).toBeDefined(); + // method is on line 3 (1-based) + expect(result.sourceLine).toBe(3); + }); + + test("privateClassMethodGetsCoordinates: private class method receives coordinates", async () => { + const source = [ + "// file with a class that has a private method", + "class Provider {", + " private mergeStaticLinks() { return true; }", + "}", + ].join("\n"); + + sourceFilePath = path.join(tmpDir, "private-class-method.ts"); + fs.writeFileSync(sourceFilePath, source, "utf8"); + + const entry: ManifestSymbolEntry = { + id: "SYM-mergeStaticLinks", + title: "mergeStaticLinks", + sourceFile: sourceFilePath, + }; + + const [result] = await enrichSymbolCoordinatesWithTsMorph([entry], tmpDir); + + // Coordinates must be generated for the private class method + expect(result.coordinatesGeneratedAt).toBeDefined(); + // private method is on line 3 (1-based) + expect(result.sourceLine).toBe(3); + }); });