Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .changeset/add-fallback-kibi-cli.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/kibi-cli-resolve-kb-pl-path.md

This file was deleted.

26 changes: 13 additions & 13 deletions documentation/symbols.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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'
11 changes: 11 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
74 changes: 74 additions & 0 deletions packages/cli/tests/extractors/symbols-ts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Loading