pi-knowledge 0.8.0 → 0.8.1
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/CHANGELOG.md +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,12 @@ type ToolResult = {
|
|
|
7
7
|
isError?: boolean;
|
|
8
8
|
};
|
|
9
9
|
type ToolUpdate = (result: ToolResult) => void;
|
|
10
|
+
type ToolApproval = "read" | "write" | "exec";
|
|
10
11
|
type ToolDefinition = {
|
|
11
12
|
name: string;
|
|
12
13
|
label: string;
|
|
13
14
|
description: string;
|
|
15
|
+
approval?: ToolApproval;
|
|
14
16
|
promptSnippet?: string;
|
|
15
17
|
promptGuidelines?: string[];
|
|
16
18
|
parameters: Schema;
|
package/dist/index.js
CHANGED
|
@@ -201,6 +201,7 @@ export default function (pi) {
|
|
|
201
201
|
name: "knowledge_plan",
|
|
202
202
|
label: "Knowledge Plan",
|
|
203
203
|
description: "Inspect an indexing source without writing a KB, showing scannable counts, suggested exclusions, and technical skips",
|
|
204
|
+
approval: "read",
|
|
204
205
|
promptSnippet: "Plan a knowledge-base indexing scope before calling knowledge_add",
|
|
205
206
|
promptGuidelines: [
|
|
206
207
|
"Use knowledge_plan before knowledge_add for broad directories, large repositories, or sources that may contain private or low-signal text",
|
|
@@ -252,6 +253,7 @@ export default function (pi) {
|
|
|
252
253
|
name: "knowledge_configure",
|
|
253
254
|
label: "Knowledge Configure",
|
|
254
255
|
description: "Configure pi-knowledge runtime settings such as the local model worker Node executable",
|
|
256
|
+
approval: "write",
|
|
255
257
|
promptSnippet: "Configure local pi-knowledge runtime prerequisites before indexing",
|
|
256
258
|
promptGuidelines: [
|
|
257
259
|
"Use knowledge_configure when knowledge_doctor or knowledge_add reports that local embeddings cannot find a usable Node executable",
|
|
@@ -287,6 +289,7 @@ export default function (pi) {
|
|
|
287
289
|
name: "knowledge_add",
|
|
288
290
|
label: "Knowledge Add",
|
|
289
291
|
description: "Index files, directories, URLs, PDFs, DOCX, or text into a named knowledge base for semantic search",
|
|
292
|
+
approval: "write",
|
|
290
293
|
promptSnippet: "Index files/dirs/URLs/PDFs/DOCX/text into a searchable knowledge base",
|
|
291
294
|
promptGuidelines: [
|
|
292
295
|
"Use knowledge_plan first for broad directories, large repositories, or sources that may contain private or low-signal text",
|
|
@@ -355,6 +358,7 @@ export default function (pi) {
|
|
|
355
358
|
name: "knowledge_search",
|
|
356
359
|
label: "Knowledge Search",
|
|
357
360
|
description: "Search indexed knowledge bases using lexical BM25, semantic vectors, reranking, and filters",
|
|
361
|
+
approval: "read",
|
|
358
362
|
promptSnippet: "Search knowledge bases (hybrid is lexical-anchored BM25 + semantic fusion)",
|
|
359
363
|
promptGuidelines: [
|
|
360
364
|
"Use knowledge_search to find relevant context before answering domain questions",
|
|
@@ -453,6 +457,7 @@ export default function (pi) {
|
|
|
453
457
|
name: "knowledge_symbol_search",
|
|
454
458
|
label: "Knowledge Symbol Search",
|
|
455
459
|
description: "Search indexed code symbols, Markdown headings, config keys, and environment variables exactly or by substring",
|
|
460
|
+
approval: "read",
|
|
456
461
|
promptSnippet: "Find exact symbols/config keys/headings before broad semantic search",
|
|
457
462
|
promptGuidelines: [
|
|
458
463
|
"Use knowledge_symbol_search before knowledge_search when looking for a function, class, env var, config key, route, or Markdown heading",
|
|
@@ -522,6 +527,7 @@ export default function (pi) {
|
|
|
522
527
|
name: "knowledge_update",
|
|
523
528
|
label: "Knowledge Update",
|
|
524
529
|
description: "Incrementally re-index a source-backed knowledge base with a retained file, directory, or URL source",
|
|
530
|
+
approval: "write",
|
|
525
531
|
promptSnippet: "Refresh an existing source-backed KB",
|
|
526
532
|
parameters: Type.Object({
|
|
527
533
|
target: Type.String({ description: "KB name or ID to update" }),
|
|
@@ -540,6 +546,7 @@ export default function (pi) {
|
|
|
540
546
|
name: "knowledge_status",
|
|
541
547
|
label: "Knowledge Status",
|
|
542
548
|
description: "Show knowledge engine status with health diagnostics: staleness, orphans, and coverage",
|
|
549
|
+
approval: "read",
|
|
543
550
|
parameters: Type.Object({}),
|
|
544
551
|
async execute(_id, _params, _signal) {
|
|
545
552
|
if (_signal?.aborted)
|
|
@@ -607,6 +614,7 @@ export default function (pi) {
|
|
|
607
614
|
name: "knowledge_doctor",
|
|
608
615
|
label: "Knowledge Doctor",
|
|
609
616
|
description: "Diagnose knowledge base health, skipped files, stale indexes, stuck jobs, and recommended fixes",
|
|
617
|
+
approval: "read",
|
|
610
618
|
promptSnippet: "Diagnose knowledge base health and recommended actions",
|
|
611
619
|
parameters: Type.Object({}),
|
|
612
620
|
async execute(_id, _params, _signal) {
|
|
@@ -632,6 +640,7 @@ export default function (pi) {
|
|
|
632
640
|
name: "knowledge_show",
|
|
633
641
|
label: "Knowledge Show",
|
|
634
642
|
description: "List all indexed knowledge bases",
|
|
643
|
+
approval: "read",
|
|
635
644
|
parameters: Type.Object({}),
|
|
636
645
|
async execute(_id, _params, _signal) {
|
|
637
646
|
if (_signal?.aborted)
|
|
@@ -650,6 +659,7 @@ export default function (pi) {
|
|
|
650
659
|
name: "knowledge_remove",
|
|
651
660
|
label: "Knowledge Remove",
|
|
652
661
|
description: "Remove a knowledge base by name or ID after explicit confirmation",
|
|
662
|
+
approval: "write",
|
|
653
663
|
promptGuidelines: [
|
|
654
664
|
"Destructive: only call after the user explicitly asks to remove knowledge data or confirms a proposed removal",
|
|
655
665
|
"Prefer knowledge_status or knowledge_doctor before removing data for troubleshooting",
|
|
@@ -676,6 +686,7 @@ export default function (pi) {
|
|
|
676
686
|
name: "knowledge_export",
|
|
677
687
|
label: "Knowledge Export",
|
|
678
688
|
description: "Export a knowledge base to a JSONL file (shareable, git-friendly)",
|
|
689
|
+
approval: "write",
|
|
679
690
|
parameters: Type.Object({
|
|
680
691
|
target: Type.String({ description: "KB name or ID to export" }),
|
|
681
692
|
output: Type.String({ description: "Output file path (.jsonl)" }),
|
|
@@ -693,6 +704,7 @@ export default function (pi) {
|
|
|
693
704
|
name: "knowledge_import",
|
|
694
705
|
label: "Knowledge Import",
|
|
695
706
|
description: "Import a knowledge base from a JSONL file (re-embeds content)",
|
|
707
|
+
approval: "write",
|
|
696
708
|
parameters: Type.Object({
|
|
697
709
|
input: Type.String({ description: "Input JSONL file path" }),
|
|
698
710
|
}),
|
|
@@ -708,6 +720,7 @@ export default function (pi) {
|
|
|
708
720
|
name: "knowledge_clear",
|
|
709
721
|
label: "Knowledge Clear",
|
|
710
722
|
description: "Remove all knowledge bases after explicit confirmation",
|
|
723
|
+
approval: "write",
|
|
711
724
|
promptGuidelines: [
|
|
712
725
|
"Destructive: only call after the user explicitly asks to clear all knowledge data or confirms a proposed clear",
|
|
713
726
|
"Never use knowledge_clear as troubleshooting unless the user explicitly approves",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-knowledge",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
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",
|