pi-knowledge 0.8.1 → 0.10.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.
@@ -4,21 +4,28 @@ export const MIN_HYBRID_SCORE = 0.18;
4
4
  export const FILE_TYPE_ALIASES = {
5
5
  csharp: "csharp",
6
6
  cs: "csharp",
7
+ c: "c",
8
+ cc: "cpp",
9
+ cxx: "cpp",
7
10
  cpp: "cpp",
8
11
  hpp: "cpp",
12
+ hh: "cpp",
13
+ hxx: "cpp",
9
14
  js: "javascript",
10
15
  jsx: "javascript",
11
16
  md: "markdown",
12
17
  mdx: "markdown",
13
18
  php: "php",
14
19
  py: "python",
20
+ qml: "qml",
15
21
  rb: "ruby",
16
- sh: "shell",
22
+ sh: "bash",
17
23
  ts: "typescript",
18
24
  tsx: "typescript",
19
25
  yml: "yaml",
20
26
  };
21
27
  const SOURCE_FILE_TYPES = new Set([
28
+ "bash",
22
29
  "c",
23
30
  "cpp",
24
31
  "csharp",
@@ -27,6 +34,7 @@ const SOURCE_FILE_TYPES = new Set([
27
34
  "javascript",
28
35
  "php",
29
36
  "python",
37
+ "qml",
30
38
  "ruby",
31
39
  "rust",
32
40
  "typescript",
@@ -82,13 +82,13 @@ API embedding failures intentionally surface by default. Silent fallback can hid
82
82
 
83
83
  Search diagnostics include result provenance and applied search tuning in both text output and structured `details`: selected profile, effective limit, snippet length, hybrid threshold, candidate pool size, chunk id, chunk hash, match reason, indexed timestamp, stale flag, and source mtime when the original source file is available. This provenance is stored in SQLite and derived from indexed source metadata; it does not create or modify files in the indexed project.
84
84
 
85
- `knowledge_search` supports `file_type`, `path_pattern`, `profile`, and explicit `limit` filters. Search profiles tune result count, snippets, hybrid strictness, candidate breadth, adaptive context, and deep rerank breadth at runtime. `auto` chooses from query shape, mode, and KB source type; explicit tool parameters win over env overrides, env overrides win over profile defaults, and profile defaults win over built-in compatibility values. `hybrid` mode remains lexical-anchored to prevent low-evidence semantic false positives; use `semantic` when the query is conceptual and exact terms may differ from indexed wording.
85
+ `knowledge_search` supports `file_type`, `path_pattern`, `profile`, and explicit `limit` filters. Search profiles tune result count, snippets, hybrid strictness, candidate breadth, adaptive context, and deep rerank breadth at runtime. `auto` chooses from query shape, mode, and KB source type; explicit tool parameters win over env overrides, env overrides win over profile defaults, and profile defaults win over built-in compatibility values. `hybrid` mode remains lexical-anchored to prevent low-evidence semantic false positives; use `semantic` when the query is conceptual and exact terms may differ from indexed wording. `adaptive` uses bounded same-file context expansion; when AST metadata is present it can prefer same-parent/sibling chunks, but it remains metadata-driven retrieval rather than LSP, caller/callee, or code graph analysis.
86
86
 
87
87
  `knowledge_doctor` emits both human-readable issues and machine-readable actions in structured `details`. Action codes include `run_update`, `rebuild_kb`, `wait_for_indexing`, `review_skipped_scope`, `rebuild_vectors`, `check_source`, and `none`. Agents should prefer these action codes over parsing the English action text.
88
88
 
89
89
  `knowledge_configure` writes runtime configuration to the knowledge directory's `config.json`. It validates Node 22+ before persisting `node_path`, so agents can configure a Codex- or user-installed `node.exe` once without relying on environment variables being injected into an already-running OMP process.
90
90
 
91
- `knowledge_symbol_search` uses a lightweight declaration-pattern index stored in `knowledge.db`. It is rebuilt during `knowledge_add`, `knowledge_update`, and `knowledge_import`, and can find common code symbols, route-like handlers, Markdown headings, config keys, and environment variables. It is not a full LSP or code graph; for methods, uncommon syntax, or empty important lookups, use `knowledge_search` mode `fast`/`adaptive` and check `knowledge_doctor` for stale or missing symbol metadata. Older file/directory/URL KBs without symbol metadata should be updated before relying on symbol lookup. Imported portable KBs and inline text KBs do not retain an active source path; rebuild their symbols by re-importing or re-adding the content.
91
+ `knowledge_symbol_search` uses a lightweight symbol index stored in `knowledge.db`. It is rebuilt during `knowledge_add`, `knowledge_update`, and `knowledge_import`, and can find AST-backed methods/functions/classes/interfaces/types/variables for supported code files, route-like handlers, Markdown headings, config keys, and environment variables. It is not a full LSP or code graph; it does not answer caller/callee or rename-safety questions. For empty important lookups, use `knowledge_search` mode `fast`/`adaptive` and check `knowledge_doctor` for stale or missing symbol metadata. Older file/directory/URL KBs without symbol metadata should be updated before relying on symbol lookup. Imported portable KBs and inline text KBs do not retain an active source path; rebuild their symbols by re-importing or re-adding the content.
92
92
 
93
93
  ## Test and Release Fixtures
94
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-knowledge",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "description": "Local-first RAG knowledge base for Pi and OMP coding agents with hybrid code/doc search, reranking, diagnostics, and large-project indexing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -54,14 +54,22 @@
54
54
  "better-sqlite3": "12.11.1",
55
55
  "ignore": "7.0.5",
56
56
  "mammoth": "1.12.0",
57
- "tree-sitter": "0.22.4",
58
- "tree-sitter-go": "0.23.4",
57
+ "tree-sitter": "0.25.1",
58
+ "tree-sitter-bash": "0.25.1",
59
+ "tree-sitter-c": "0.24.1",
60
+ "tree-sitter-cpp": "0.23.4",
61
+ "tree-sitter-go": "0.25.0",
59
62
  "tree-sitter-java": "0.23.5",
60
- "tree-sitter-python": "0.23.6",
61
- "tree-sitter-rust": "0.23.2",
63
+ "tree-sitter-javascript": "0.25.0",
64
+ "tree-sitter-python": "0.25.0",
65
+ "tree-sitter-qmljs": "0.3.1",
66
+ "tree-sitter-rust": "0.24.0",
62
67
  "tree-sitter-typescript": "0.23.2",
63
68
  "unpdf": "1.6.2"
64
69
  },
70
+ "overrides": {
71
+ "tree-sitter": "0.25.1"
72
+ },
65
73
  "devDependencies": {
66
74
  "@biomejs/biome": "2.3.5",
67
75
  "@types/better-sqlite3": "7.6.13",