pi-para 0.5.2 → 0.6.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.
Files changed (195) hide show
  1. package/ARCHITECTURE.md +160 -0
  2. package/CHANGELOG.md +51 -0
  3. package/CONFIGURATION.md +243 -0
  4. package/README.md +140 -237
  5. package/SETUP.md +196 -112
  6. package/STRUCTURE.md +140 -0
  7. package/package.json +86 -18
  8. package/scripts/build-assets.mjs +29 -0
  9. package/scripts/install.ps1 +55 -0
  10. package/scripts/install.sh +63 -0
  11. package/scripts/smoke-install.mjs +63 -0
  12. package/skills/para/SKILL.md +1 -1
  13. package/skills/setup/SKILL.md +1 -1
  14. package/src/atomic-write.ts +17 -0
  15. package/src/capture.ts +4 -4
  16. package/src/cli-legacy.ts +43 -0
  17. package/src/cli.ts +133 -28
  18. package/src/commands.ts +203 -243
  19. package/src/config.ts +355 -0
  20. package/src/context.ts +29 -14
  21. package/src/credentials.ts +100 -0
  22. package/src/daemon.ts +1 -1
  23. package/src/doctor.ts +209 -0
  24. package/src/gepa/index.ts +1 -1
  25. package/src/index.ts +119 -40
  26. package/src/maintainer.ts +4 -4
  27. package/src/model-resolver.ts +96 -0
  28. package/src/paths.ts +48 -0
  29. package/src/processor.ts +4 -4
  30. package/src/qmd-providers.ts +63 -0
  31. package/src/query.ts +15 -1
  32. package/src/repair.ts +49 -0
  33. package/src/scheduler/controls.ts +125 -0
  34. package/src/scheduler/index.ts +210 -0
  35. package/src/scheduler/leases.ts +98 -0
  36. package/src/scheduler/session-capture.ts +146 -0
  37. package/src/scheduler/state.ts +304 -0
  38. package/src/session-tools.ts +1 -1
  39. package/src/settings.ts +126 -0
  40. package/src/setup.ts +116 -0
  41. package/src/status.ts +115 -0
  42. package/src/store.ts +116 -31
  43. package/src/summarize.ts +72 -16
  44. package/src/templates/prompts.ts +1 -1
  45. package/src/tools.ts +280 -90
  46. package/src/wiki-tool-guidance.ts +84 -0
  47. package/src/wiki.ts +98 -26
  48. package/dist/capture.d.ts +0 -34
  49. package/dist/capture.d.ts.map +0 -1
  50. package/dist/capture.js +0 -461
  51. package/dist/capture.js.map +0 -1
  52. package/dist/cli.d.ts +0 -15
  53. package/dist/cli.d.ts.map +0 -1
  54. package/dist/cli.js +0 -405
  55. package/dist/cli.js.map +0 -1
  56. package/dist/commands.d.ts +0 -15
  57. package/dist/commands.d.ts.map +0 -1
  58. package/dist/commands.js +0 -786
  59. package/dist/commands.js.map +0 -1
  60. package/dist/context.d.ts +0 -61
  61. package/dist/context.d.ts.map +0 -1
  62. package/dist/context.js +0 -289
  63. package/dist/context.js.map +0 -1
  64. package/dist/daemon.d.ts +0 -49
  65. package/dist/daemon.d.ts.map +0 -1
  66. package/dist/daemon.js +0 -226
  67. package/dist/daemon.js.map +0 -1
  68. package/dist/frontmatter.d.ts +0 -59
  69. package/dist/frontmatter.d.ts.map +0 -1
  70. package/dist/frontmatter.js +0 -170
  71. package/dist/frontmatter.js.map +0 -1
  72. package/dist/gepa/dataset.d.ts +0 -36
  73. package/dist/gepa/dataset.d.ts.map +0 -1
  74. package/dist/gepa/dataset.js +0 -148
  75. package/dist/gepa/dataset.js.map +0 -1
  76. package/dist/gepa/evaluator.d.ts +0 -51
  77. package/dist/gepa/evaluator.d.ts.map +0 -1
  78. package/dist/gepa/evaluator.js +0 -317
  79. package/dist/gepa/evaluator.js.map +0 -1
  80. package/dist/gepa/index.d.ts +0 -66
  81. package/dist/gepa/index.d.ts.map +0 -1
  82. package/dist/gepa/index.js +0 -240
  83. package/dist/gepa/index.js.map +0 -1
  84. package/dist/gepa/llm.d.ts +0 -35
  85. package/dist/gepa/llm.d.ts.map +0 -1
  86. package/dist/gepa/llm.js +0 -268
  87. package/dist/gepa/llm.js.map +0 -1
  88. package/dist/gepa/optimized/capture-prompt.txt +0 -65
  89. package/dist/gepa/optimizer.d.ts +0 -29
  90. package/dist/gepa/optimizer.d.ts.map +0 -1
  91. package/dist/gepa/optimizer.js +0 -249
  92. package/dist/gepa/optimizer.js.map +0 -1
  93. package/dist/gepa/targets.d.ts +0 -39
  94. package/dist/gepa/targets.d.ts.map +0 -1
  95. package/dist/gepa/targets.js +0 -326
  96. package/dist/gepa/targets.js.map +0 -1
  97. package/dist/gepa/types.d.ts +0 -168
  98. package/dist/gepa/types.d.ts.map +0 -1
  99. package/dist/gepa/types.js +0 -124
  100. package/dist/gepa/types.js.map +0 -1
  101. package/dist/index.d.ts +0 -21
  102. package/dist/index.d.ts.map +0 -1
  103. package/dist/index.js +0 -294
  104. package/dist/index.js.map +0 -1
  105. package/dist/ingest.d.ts +0 -88
  106. package/dist/ingest.d.ts.map +0 -1
  107. package/dist/ingest.js +0 -105
  108. package/dist/ingest.js.map +0 -1
  109. package/dist/link-discovery.d.ts +0 -40
  110. package/dist/link-discovery.d.ts.map +0 -1
  111. package/dist/link-discovery.js +0 -122
  112. package/dist/link-discovery.js.map +0 -1
  113. package/dist/link-utils.d.ts +0 -30
  114. package/dist/link-utils.d.ts.map +0 -1
  115. package/dist/link-utils.js +0 -145
  116. package/dist/link-utils.js.map +0 -1
  117. package/dist/lint.d.ts +0 -39
  118. package/dist/lint.d.ts.map +0 -1
  119. package/dist/lint.js +0 -827
  120. package/dist/lint.js.map +0 -1
  121. package/dist/maintainer.d.ts +0 -24
  122. package/dist/maintainer.d.ts.map +0 -1
  123. package/dist/maintainer.js +0 -358
  124. package/dist/maintainer.js.map +0 -1
  125. package/dist/processor.d.ts +0 -14
  126. package/dist/processor.d.ts.map +0 -1
  127. package/dist/processor.js +0 -361
  128. package/dist/processor.js.map +0 -1
  129. package/dist/query.d.ts +0 -69
  130. package/dist/query.d.ts.map +0 -1
  131. package/dist/query.js +0 -107
  132. package/dist/query.js.map +0 -1
  133. package/dist/raw.d.ts +0 -57
  134. package/dist/raw.d.ts.map +0 -1
  135. package/dist/raw.js +0 -219
  136. package/dist/raw.js.map +0 -1
  137. package/dist/redact.d.ts +0 -21
  138. package/dist/redact.d.ts.map +0 -1
  139. package/dist/redact.js +0 -143
  140. package/dist/redact.js.map +0 -1
  141. package/dist/scope.d.ts +0 -54
  142. package/dist/scope.d.ts.map +0 -1
  143. package/dist/scope.js +0 -161
  144. package/dist/scope.js.map +0 -1
  145. package/dist/scripts/bulk-link-fix.d.ts +0 -9
  146. package/dist/scripts/bulk-link-fix.d.ts.map +0 -1
  147. package/dist/scripts/bulk-link-fix.js +0 -106
  148. package/dist/scripts/bulk-link-fix.js.map +0 -1
  149. package/dist/session-tools.d.ts +0 -33
  150. package/dist/session-tools.d.ts.map +0 -1
  151. package/dist/session-tools.js +0 -211
  152. package/dist/session-tools.js.map +0 -1
  153. package/dist/state.d.ts +0 -54
  154. package/dist/state.d.ts.map +0 -1
  155. package/dist/state.js +0 -176
  156. package/dist/state.js.map +0 -1
  157. package/dist/store.d.ts +0 -56
  158. package/dist/store.d.ts.map +0 -1
  159. package/dist/store.js +0 -227
  160. package/dist/store.js.map +0 -1
  161. package/dist/summarize.d.ts +0 -56
  162. package/dist/summarize.d.ts.map +0 -1
  163. package/dist/summarize.js +0 -231
  164. package/dist/summarize.js.map +0 -1
  165. package/dist/tag-registry.d.ts +0 -56
  166. package/dist/tag-registry.d.ts.map +0 -1
  167. package/dist/tag-registry.js +0 -146
  168. package/dist/tag-registry.js.map +0 -1
  169. package/dist/templates/prompts.d.ts +0 -63
  170. package/dist/templates/prompts.d.ts.map +0 -1
  171. package/dist/templates/prompts.js +0 -260
  172. package/dist/templates/prompts.js.map +0 -1
  173. package/dist/tools.d.ts +0 -26
  174. package/dist/tools.d.ts.map +0 -1
  175. package/dist/tools.js +0 -1033
  176. package/dist/tools.js.map +0 -1
  177. package/dist/watcher.d.ts +0 -25
  178. package/dist/watcher.d.ts.map +0 -1
  179. package/dist/watcher.js +0 -84
  180. package/dist/watcher.js.map +0 -1
  181. package/dist/webui/client/dist/index.html +0 -1885
  182. package/dist/webui/server.d.ts +0 -31
  183. package/dist/webui/server.d.ts.map +0 -1
  184. package/dist/webui/server.js +0 -566
  185. package/dist/webui/server.js.map +0 -1
  186. package/dist/wiki.d.ts +0 -103
  187. package/dist/wiki.d.ts.map +0 -1
  188. package/dist/wiki.js +0 -428
  189. package/dist/wiki.js.map +0 -1
  190. package/scripts/gepa/__pycache__/dataset.cpython-313.pyc +0 -0
  191. package/scripts/gepa/__pycache__/lm_providers.cpython-313.pyc +0 -0
  192. package/scripts/gepa/__pycache__/metric.cpython-313.pyc +0 -0
  193. package/scripts/gepa/__pycache__/program.cpython-313.pyc +0 -0
  194. package/scripts/gepa/__pycache__/wiki_reader.cpython-313.pyc +0 -0
  195. package/scripts/gepa/uv.lock +0 -2241
@@ -1,146 +0,0 @@
1
- /**
2
- * Canonical tag registry — normalizes and deduplicates wiki page tags.
3
- *
4
- * Rules:
5
- * 1. Spaces → hyphens ("session files" → "session-files")
6
- * 2. Lowercase everything
7
- * 3. Map aliases → canonical tags
8
- * 4. Remove tags that duplicate scope values on the same page
9
- * 5. Deduplicate
10
- */
11
- // -- Scope normalization -----------------------------------------------------
12
- /**
13
- * Normalize a scope value.
14
- *
15
- * Scope should be a project name (kebab-case, single token), not a topic
16
- * description. The daemon LLM sometimes writes freeform multi-word
17
- * descriptions like "session exploration" or "mono project" as scope.
18
- *
19
- * Rules:
20
- * 1. Trim + lowercase
21
- * 2. If the value contains a known project name as a prefix, extract it
22
- * (e.g. "pi-para daemon" → "pi-para", "pi-mono project" → "pi-mono")
23
- * 3. If still multi-word after extraction, drop it — it's a topic
24
- * description, not a project name
25
- * 4. Return the clean kebab-case scope
26
- *
27
- * This is project-agnostic — works for any project, not just pi-para.
28
- */
29
- export function normalizeScope(scope) {
30
- const s = scope.trim().toLowerCase();
31
- if (!s)
32
- return null;
33
- // Already clean (no spaces) — pass through
34
- if (!s.includes(" "))
35
- return s;
36
- // Try to extract a kebab-case project name prefix.
37
- // Multi-word scopes from the LLM follow the pattern:
38
- // "<project-name> <topic words>" e.g. "pi-mono project", "pi-para daemon"
39
- // Extract the first kebab-case token if it looks like a project name.
40
- const firstToken = s.split(" ")[0];
41
- if (firstToken && firstToken.includes("-")) {
42
- // Looks like a kebab-case project name (e.g. "pi-mono", "pi-para")
43
- return firstToken;
44
- }
45
- // Multi-word without a kebab prefix → topic description, drop it
46
- return null;
47
- }
48
- /**
49
- * Normalize a full scope list:
50
- * 1. Normalize each value
51
- * 2. Deduplicate
52
- * 3. Ensure at least one scope remains (fallback to "global")
53
- */
54
- export function normalizeScopes(scopes) {
55
- const result = new Set();
56
- for (const s of scopes) {
57
- const normalized = normalizeScope(s);
58
- if (normalized)
59
- result.add(normalized);
60
- }
61
- if (result.size === 0)
62
- result.add("global");
63
- return [...result].sort();
64
- }
65
- // -- Tag normalization -------------------------------------------------------
66
- /** Canonical tag → list of aliases that map to it. */
67
- const TAG_ALIASES = {
68
- // session/capture family
69
- "session-capture": ["capture", "background-capture", "session"],
70
- "session-files": ["session files"],
71
- // project identity
72
- "pi-para": ["para"],
73
- "pi-mono": ["mono"],
74
- "coding-agent": ["agent"],
75
- // tech
76
- "node-llama-cpp": [],
77
- "qmd-search": ["bm25"],
78
- "lazy-loading": [],
79
- // kebab-case normalization
80
- "scope-detection": ["scope detection"],
81
- "project-structure": ["project structure", "structure"],
82
- "model-registry": ["model registry"],
83
- "thinking-level": ["thinking level"],
84
- "interactive-mode": ["interactive mode"],
85
- "exploration-incomplete": ["exploration incomplete"],
86
- "ui-component": ["UI component"],
87
- "scoped-models": ["scopedModels"],
88
- "github-packages": [],
89
- "architecture-pattern": [],
90
- "knowledge-management": ["knowledge-base"],
91
- // UI
92
- "webui": ["ui", "frontend", "react"],
93
- };
94
- /** Build reverse lookup: alias → canonical. */
95
- function buildAliasMap() {
96
- const map = new Map();
97
- for (const [canonical, aliases] of Object.entries(TAG_ALIASES)) {
98
- for (const alias of aliases) {
99
- map.set(alias.toLowerCase(), canonical);
100
- }
101
- }
102
- return map;
103
- }
104
- const ALIAS_MAP = buildAliasMap();
105
- /**
106
- * Normalize a single tag:
107
- * 1. Trim + lowercase
108
- * 2. Spaces → hyphens
109
- * 3. Resolve alias → canonical
110
- */
111
- export function normalizeTag(tag) {
112
- let t = tag.trim().toLowerCase().replace(/\s+/g, "-");
113
- const canonical = ALIAS_MAP.get(t);
114
- if (canonical)
115
- t = canonical;
116
- return t;
117
- }
118
- /**
119
- * Normalize a full tag list for a page, given its scope.
120
- *
121
- * 1. Normalize each tag
122
- * 2. Remove tags that exactly match a scope value
123
- * 3. Deduplicate
124
- * 4. Sort alphabetically
125
- */
126
- export function normalizeTags(tags, scope) {
127
- const scopeSet = new Set(scope.map(s => s.toLowerCase()));
128
- const normalized = new Set();
129
- for (const tag of tags) {
130
- const t = normalizeTag(tag);
131
- if (!t)
132
- continue;
133
- // Don't add tags that duplicate scope
134
- if (scopeSet.has(t))
135
- continue;
136
- normalized.add(t);
137
- }
138
- return [...normalized].sort();
139
- }
140
- /**
141
- * Get the full alias map for external inspection (e.g., lint reporting).
142
- */
143
- export function getAliasMap() {
144
- return ALIAS_MAP;
145
- }
146
- //# sourceMappingURL=tag-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag-registry.js","sourceRoot":"","sources":["../src/tag-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAE/E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpB,2CAA2C;IAC3C,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IAE/B,mDAAmD;IACnD,qDAAqD;IACrD,6EAA6E;IAC7E,sEAAsE;IACtE,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,UAAU,IAAI,UAAU,CAAC,Q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G,EAAU,CAAC;IAErC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,sCAAsC;QACtC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,SAAS;QAC9B,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,63 +0,0 @@
1
- /**
2
- * LLM prompt templates for ingest, query, lint, capture, and summarize operations.
3
- *
4
- * Use getPrompt(name) to load the GEPA-optimized version (if deployed) or the original.
5
- */
6
- /**
7
- * Load a prompt by name — returns the GEPA-optimized version if
8
- * config.gepa.useOptimized is true, otherwise returns the original.
9
- *
10
- * Resolution order:
11
- * 1. User-generated optimized prompt at ~/.pi/wiki/gepa/optimized/{name}.txt
12
- * 2. Bundled optimized prompt shipped with the package (src/gepa/optimized/{name}.txt)
13
- * 3. Original constant from this file
14
- */
15
- export declare function getPrompt(name: string): string;
16
- /**
17
- * System prompt for the standalone wiki agent used in capture, lint, and
18
- * summarize operations. This agent runs outside the session's agent loop.
19
- */
20
- export declare const WIKI_SYSTEM_PROMPT = "You are a wiki knowledge management agent. You maintain a PARA-structured knowledge base.\n\nYour job is to read content, extract knowledge, and write structured wiki pages. You operate autonomously \u2014 no user confirmation needed.\n\nPARA category rules:\n- **resources/**: Use for almost everything \u2014 architecture docs, how-tos, debugging solutions, configs, patterns, implementation notes. This is the default.\n- **areas/**: Only for ongoing responsibilities with no end date (e.g. server config, deployment procedures).\n- **projects/**: ONLY for actual goals with a defined end date and completion criteria. Do NOT use for documentation about a project's internals.\n- **archives/**: Never create pages here \u2014 pages get moved here when completed.\n\nWhen the user defines a specific goal with a completion condition, create a projects/ page. When identifying a repeating responsibility (monitoring, maintenance, quality), create an areas/ page.\n\nScope and tag rules:\n- scope must be a kebab-case project name (e.g. \"pi-para\", \"qmd\"). NOT topic descriptions like \"session exploration\".\n- tags must be kebab-case (no spaces). Don't duplicate scope values as tags.\n\nContent rules:\n- Use [[wikilinks]] to connect related pages. Always add a ## Connections section.\n- Use the wiki summary format: Topic, Key Facts, Insights, Connections, Open Questions, Sources\n- Keep pages focused on one concept each\n- Be concise and factual \u2014 no fluff\n- Check for existing similar pages before creating new ones to avoid duplicates\n- NEVER include API keys, tokens, passwords, or secrets. Document WHERE they are stored, not the values.\n- Index is auto-rebuilt after every write \u2014 do not manage index.md manually. Do NOT pass indexContent to wiki_write.";
21
- /**
22
- * Prompt included in the tool result when the LLM processes an ingested source.
23
- * The LLM reads this along with the source content, schema, and current index.
24
- */
25
- export declare const INGEST_PROMPT = "Analyze the source content below and integrate it into the wiki.\n\nInstructions:\n1. Identify key entities, concepts, facts, and relationships in the source\n2. Review the current index to find existing pages that should be updated\n3. Decide which existing wiki pages need updates and what new pages to create\n4. For each page, use the wiki summary format:\n - Topic: what this page covers\n - Key Facts: established knowledge points\n - Insights: non-obvious findings, patterns, implications\n - Connections: [[wikilinks]] to related pages with descriptions\n - Open Questions: gaps in knowledge, unresolved contradictions\n - Sources: source URLs, file paths, session references\n5. Assign PARA category correctly:\n - resources/ for reference material (DEFAULT \u2014 use this for most pages)\n - areas/ for ongoing responsibilities\n - projects/ ONLY for actual goals with end dates\n6. scope must be a kebab-case project name (NOT topic descriptions). tags must be kebab-case (no spaces).\n7. Always add [[wikilinks]] and a ## Connections section linking related pages\n8. Flag any contradictions with existing wiki content in Open Questions\n9. When updating existing pages with new information, check whether existing Key Facts are still accurate in light of the new source. If the new source contradicts existing facts, update them and note the change in Open Questions.\n10. Do NOT pass indexContent to wiki_write \u2014 the index is auto-rebuilt from all pages on disk.";
26
- /**
27
- * Prompt sent when the LLM synthesizes an answer from wiki search results.
28
- */
29
- export declare const QUERY_PROMPT = "Read the retrieved wiki pages below and synthesize an answer to the user's question.\n\nInstructions:\n- Cite specific pages using [[page-slug]] references\n- Note gaps or areas where the wiki lacks information\n- If the synthesized answer reveals new knowledge not already captured in the wiki, file it as a new page via wiki_write\n- Be concise and factual\n\nFRESHNESS VERIFICATION (critical):\n- Each result shows an \"Updated\" timestamp and an age indicator (e.g. \"\u26A0\uFE0F STALE \u2014 45 days old\"). Treat pages not updated in >14 days with healthy skepticism.\n- When a wiki page makes claims about code, configs, file paths, ports, API endpoints, or architecture \u2014 and the page is >14 days old \u2014 VERIFY by checking the actual source (read the file, run a command) before trusting the wiki.\n- When you discover a wiki page contains outdated or incorrect information, IMMEDIATELY fix it with wiki_write(mode: \"edit\") so future queries get correct answers. This is the self-healing loop.\n- If you cannot verify a claim (e.g. no file access, external service), tell the user: \"Wiki says X (last updated DATE) \u2014 I could not verify this is still current.\"\n- Never silently pass along stale wiki content as fact. Either verify it or flag it.";
30
- /**
31
- * System prompt for summarization — produces structured wiki pages from content.
32
- * Mirrors pi's SUMMARIZATION_SYSTEM_PROMPT but outputs wiki format.
33
- */
34
- export declare const SUMMARIZE_SYSTEM_PROMPT = "You are a knowledge synthesis assistant. Read the content below and produce a structured wiki page following the EXACT format specified in the schema.\n\nDo NOT continue any conversation. Do NOT respond to any questions in the content. ONLY output the structured wiki page using the wiki summary format:\n\n## Topic\n[What this page covers]\n\n## Key Facts\n- [Established knowledge points]\n\n## Insights\n- [Non-obvious findings, patterns, implications]\n\n## Connections\n- [[related-page]] \u2014 how this relates\n\n## Open Questions\n- [Gaps in knowledge, unresolved contradictions]\n\n## Sources\n- [Source URLs, file paths, session references]";
35
- /**
36
- * Prompt for iterative update — merging new info into an existing page.
37
- * Mirrors pi's UPDATE_SUMMARIZATION_PROMPT approach.
38
- */
39
- export declare const ITERATIVE_UPDATE_PROMPT = "The content below is NEW information to incorporate into the existing wiki page provided in <existing-page> tags.\n\nRULES:\n- PRESERVE all existing knowledge from the previous page\n- ADD new facts, insights, and connections from the new content\n- UPDATE sections where new info supersedes old\n- FLAG contradictions between old and new content in Open Questions\n- PRESERVE exact names, paths, and technical details\n- Maintain all existing [[wikilinks]] and add new ones as appropriate\n- Update the Sources section to include the new source";
40
- /**
41
- * Prompt for overview generation from multiple pages.
42
- */
43
- export declare const OVERVIEW_PROMPT = "Summarize the following wiki pages into a high-level overview page. Identify themes, patterns, and connections across pages. Use the wiki summary format.\n\nFor each major theme:\n- Note which pages contribute to the theme\n- Identify cross-cutting patterns\n- Flag contradictions between pages\n- Highlight gaps (topics that should have pages but don't)";
44
- /**
45
- * Prompt for the LLM when reviewing lint results and auto-fixing issues.
46
- */
47
- export declare const LINT_PROMPT = "Review the lint results below and fix all auto-fixable issues.\n\nFor each issue:\n- Prioritize by impact (errors first, then warnings, then info)\n- Fix broken wikilinks by finding the correct target page or removing dead links\n- Add missing pages for concepts referenced across multiple pages\n- Move stale projects to archives if inactive for 90+ days\n- Fix frontmatter issues (missing fields, invalid dates, empty scope)\n- Update index.md to include any pages missing from the index\n- Propose archiving for inactive projects\n\nReport unfixable issues that require human judgment.";
48
- /**
49
- * System prompt for the standalone capture agent.
50
- * Used as WIKI_SYSTEM_PROMPT for the capture agent instance.
51
- */
52
- export declare const CAPTURE_SYSTEM_PROMPT = "You are a knowledge capture assistant. Your job is to extract persistent knowledge from coding sessions and write it to a PARA-structured wiki.\n\nCapture ANY of the following \u2014 even from short sessions:\n- Architecture decisions and rationale (\"we chose X because Y\")\n- Debugging solutions (root cause + fix)\n- Server/infrastructure details (IPs, paths, credentials locations, configs)\n- Build and deployment procedures (commands, steps, gotchas)\n- API keys, service endpoints, and where they are stored\n- Project conventions and coding patterns\n- Tool configurations and setup steps\n- Dependencies and version constraints\n- Environment-specific knowledge (dev vs prod differences)\n- Operational runbooks (how to restart, deploy, rollback)\n\nIndex is auto-rebuilt after every write \u2014 do not manage index.md manually. Do NOT pass indexContent to wiki_write.\n\nRules:\n- If the session was ONLY greetings or completely off-topic chitchat with zero project knowledge, respond with \"nothing to capture\"\n- Otherwise, always capture \u2014 even small facts are valuable (\"the deploy key is at /path/to/key\")\n- Classify each piece of knowledge by PARA category autonomously\n- When the user defines a specific goal with a completion condition, create a projects/ page. When identifying a repeating responsibility (monitoring, maintenance, quality), create an areas/ page.\n- Produce wiki pages in the standard wiki summary format (Topic, Key Facts, Insights, Connections, Open Questions, Sources)\n- Include the full session file path in the Sources section for traceability\n- ALWAYS search wiki_query BEFORE creating any page \u2014 update existing pages instead of creating duplicates\n- If wiki_query finds a page on the same topic (even with a different title/slug), update THAT page using its existing slug\n- The conversation may include compaction summaries from earlier in the session \u2014 treat these as authoritative records of prior work\n- Write directly via wiki_write \u2014 no user confirmation needed\n- NEVER include API keys, tokens, passwords, or secrets in wiki pages. Document WHERE they are stored, not the actual values.";
53
- /**
54
- * Prompt template for auto-capture at session_shutdown.
55
- * The serialized conversation is appended after this prompt.
56
- */
57
- export declare const CAPTURE_PROMPT = "Analyze the session conversation below and capture ALL project-relevant knowledge into the wiki.\n\nCapture bias: when in doubt, capture it. Small operational facts (paths, configs, server details, commands) are often the most valuable because they are hard to rediscover.\n\nOnly respond with \"nothing to capture\" if the session was purely greetings or off-topic chitchat with zero project knowledge.\n\nFor everything else:\n1. Use wiki_query to search for EXISTING pages on each topic FIRST\n2. If a matching page exists, use wiki_read to get its content, then wiki_write with its EXACT slug to update it\n3. Only create a NEW page if wiki_query returned no relevant results\n4. Each page must include the session file path in its Sources section\n5. Do NOT pass indexContent to wiki_write - the index is auto-rebuilt from all pages on disk\n\nCRITICAL: prefer updating over creating. The wiki likely already has pages on most topics.\n\n<session-conversation>\n";
58
- /**
59
- * Prompt template for explicit capture via /wiki-capture.
60
- * A topic hint (if provided) and the serialized conversation are appended.
61
- */
62
- export declare const EXPLICIT_CAPTURE_PROMPT = "Capture knowledge from the current session into the wiki.";
63
- //# sourceMappingURL=prompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/templates/prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAwB9C;AAmBD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,4vDAuBsF,CAAC;AAItH;;;GAGG;AACH,eAAO,MAAM,aAAa,i+CAqBqE,CAAC;AAIhG;;GAEG;AACH,eAAO,MAAM,YAAY,6vCAa4D,CAAC;AAItF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gpBAoBY,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,siBASmB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,uWAM+B,CAAC;AAI5D;;GAEG;AACH,eAAO,MAAM,WAAW,ilBAW6B,CAAC;AAItD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,8nEA2B4F,CAAC;AAE/H;;;GAGG;AACH,eAAO,MAAM,cAAc,48BAgB1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,8DAA8D,CAAC"}
@@ -1,260 +0,0 @@
1
- /**
2
- * LLM prompt templates for ingest, query, lint, capture, and summarize operations.
3
- *
4
- * Use getPrompt(name) to load the GEPA-optimized version (if deployed) or the original.
5
- */
6
- import { readFileSync, existsSync } from "node:fs";
7
- import { join, dirname } from "node:path";
8
- import { homedir } from "node:os";
9
- /**
10
- * Load a prompt by name — returns the GEPA-optimized version if
11
- * config.gepa.useOptimized is true, otherwise returns the original.
12
- *
13
- * Resolution order:
14
- * 1. User-generated optimized prompt at ~/.pi/wiki/gepa/optimized/{name}.txt
15
- * 2. Bundled optimized prompt shipped with the package (src/gepa/optimized/{name}.txt)
16
- * 3. Original constant from this file
17
- */
18
- export function getPrompt(name) {
19
- const original = _originals()[name];
20
- if (!original)
21
- return "";
22
- try {
23
- const cfgPath = join(homedir(), ".pi", "wiki", "config.json");
24
- if (!existsSync(cfgPath))
25
- return original;
26
- const cfg = JSON.parse(readFileSync(cfgPath, "utf-8"));
27
- if (!cfg.gepa?.useOptimized)
28
- return original;
29
- // 1. Check user-generated optimized prompt
30
- const userPath = join(homedir(), ".pi", "wiki", "gepa", "optimized", `${name}.txt`);
31
- if (existsSync(userPath)) {
32
- const content = readFileSync(userPath, "utf-8").trim();
33
- if (content.length > 50)
34
- return content;
35
- }
36
- // 2. Check bundled optimized prompt (shipped with package)
37
- const bundledPath = join(dirname(new URL(import.meta.url).pathname), "..", "gepa", "optimized", `${name}.txt`);
38
- if (existsSync(bundledPath)) {
39
- const content = readFileSync(bundledPath, "utf-8").trim();
40
- if (content.length > 50)
41
- return content;
42
- }
43
- }
44
- catch { /* fall through to original */ }
45
- return original;
46
- }
47
- function _originals() {
48
- return {
49
- "wiki-system-prompt": WIKI_SYSTEM_PROMPT,
50
- "ingest-prompt": INGEST_PROMPT,
51
- "query-prompt": QUERY_PROMPT,
52
- "capture-system-prompt": CAPTURE_SYSTEM_PROMPT,
53
- "capture-prompt": CAPTURE_PROMPT,
54
- "explicit-capture-prompt": EXPLICIT_CAPTURE_PROMPT,
55
- "summarize-system-prompt": SUMMARIZE_SYSTEM_PROMPT,
56
- "iterative-update-prompt": ITERATIVE_UPDATE_PROMPT,
57
- "overview-prompt": OVERVIEW_PROMPT,
58
- "lint-prompt": LINT_PROMPT,
59
- };
60
- }
61
- // -- Wiki System Prompt (standalone agent) ------------------------------------
62
- /**
63
- * System prompt for the standalone wiki agent used in capture, lint, and
64
- * summarize operations. This agent runs outside the session's agent loop.
65
- */
66
- export const WIKI_SYSTEM_PROMPT = `You are a wiki knowledge management agent. You maintain a PARA-structured knowledge base.
67
-
68
- Your job is to read content, extract knowledge, and write structured wiki pages. You operate autonomously — no user confirmation needed.
69
-
70
- PARA category rules:
71
- - **resources/**: Use for almost everything — architecture docs, how-tos, debugging solutions, configs, patterns, implementation notes. This is the default.
72
- - **areas/**: Only for ongoing responsibilities with no end date (e.g. server config, deployment procedures).
73
- - **projects/**: ONLY for actual goals with a defined end date and completion criteria. Do NOT use for documentation about a project's internals.
74
- - **archives/**: Never create pages here — pages get moved here when completed.
75
-
76
- When the user defines a specific goal with a completion condition, create a projects/ page. When identifying a repeating responsibility (monitoring, maintenance, quality), create an areas/ page.
77
-
78
- Scope and tag rules:
79
- - scope must be a kebab-case project name (e.g. "pi-para", "qmd"). NOT topic descriptions like "session exploration".
80
- - tags must be kebab-case (no spaces). Don't duplicate scope values as tags.
81
-
82
- Content rules:
83
- - Use [[wikilinks]] to connect related pages. Always add a ## Connections section.
84
- - Use the wiki summary format: Topic, Key Facts, Insights, Connections, Open Questions, Sources
85
- - Keep pages focused on one concept each
86
- - Be concise and factual — no fluff
87
- - Check for existing similar pages before creating new ones to avoid duplicates
88
- - NEVER include API keys, tokens, passwords, or secrets. Document WHERE they are stored, not the values.
89
- - Index is auto-rebuilt after every write — do not manage index.md manually. Do NOT pass indexContent to wiki_write.`;
90
- // -- Ingest Prompts ----------------------------------------------------------
91
- /**
92
- * Prompt included in the tool result when the LLM processes an ingested source.
93
- * The LLM reads this along with the source content, schema, and current index.
94
- */
95
- export const INGEST_PROMPT = `Analyze the source content below and integrate it into the wiki.
96
-
97
- Instructions:
98
- 1. Identify key entities, concepts, facts, and relationships in the source
99
- 2. Review the current index to find existing pages that should be updated
100
- 3. Decide which existing wiki pages need updates and what new pages to create
101
- 4. For each page, use the wiki summary format:
102
- - Topic: what this page covers
103
- - Key Facts: established knowledge points
104
- - Insights: non-obvious findings, patterns, implications
105
- - Connections: [[wikilinks]] to related pages with descriptions
106
- - Open Questions: gaps in knowledge, unresolved contradictions
107
- - Sources: source URLs, file paths, session references
108
- 5. Assign PARA category correctly:
109
- - resources/ for reference material (DEFAULT — use this for most pages)
110
- - areas/ for ongoing responsibilities
111
- - projects/ ONLY for actual goals with end dates
112
- 6. scope must be a kebab-case project name (NOT topic descriptions). tags must be kebab-case (no spaces).
113
- 7. Always add [[wikilinks]] and a ## Connections section linking related pages
114
- 8. Flag any contradictions with existing wiki content in Open Questions
115
- 9. When updating existing pages with new information, check whether existing Key Facts are still accurate in light of the new source. If the new source contradicts existing facts, update them and note the change in Open Questions.
116
- 10. Do NOT pass indexContent to wiki_write — the index is auto-rebuilt from all pages on disk.`;
117
- // -- Query Prompts -----------------------------------------------------------
118
- /**
119
- * Prompt sent when the LLM synthesizes an answer from wiki search results.
120
- */
121
- export const QUERY_PROMPT = `Read the retrieved wiki pages below and synthesize an answer to the user's question.
122
-
123
- Instructions:
124
- - Cite specific pages using [[page-slug]] references
125
- - Note gaps or areas where the wiki lacks information
126
- - If the synthesized answer reveals new knowledge not already captured in the wiki, file it as a new page via wiki_write
127
- - Be concise and factual
128
-
129
- FRESHNESS VERIFICATION (critical):
130
- - Each result shows an "Updated" timestamp and an age indicator (e.g. "⚠️ STALE — 45 days old"). Treat pages not updated in >14 days with healthy skepticism.
131
- - When a wiki page makes claims about code, configs, file paths, ports, API endpoints, or architecture — and the page is >14 days old — VERIFY by checking the actual source (read the file, run a command) before trusting the wiki.
132
- - When you discover a wiki page contains outdated or incorrect information, IMMEDIATELY fix it with wiki_write(mode: "edit") so future queries get correct answers. This is the self-healing loop.
133
- - If you cannot verify a claim (e.g. no file access, external service), tell the user: "Wiki says X (last updated DATE) — I could not verify this is still current."
134
- - Never silently pass along stale wiki content as fact. Either verify it or flag it.`;
135
- // -- Summarize Prompts -------------------------------------------------------
136
- /**
137
- * System prompt for summarization — produces structured wiki pages from content.
138
- * Mirrors pi's SUMMARIZATION_SYSTEM_PROMPT but outputs wiki format.
139
- */
140
- export const SUMMARIZE_SYSTEM_PROMPT = `You are a knowledge synthesis assistant. Read the content below and produce a structured wiki page following the EXACT format specified in the schema.
141
-
142
- Do NOT continue any conversation. Do NOT respond to any questions in the content. ONLY output the structured wiki page using the wiki summary format:
143
-
144
- ## Topic
145
- [What this page covers]
146
-
147
- ## Key Facts
148
- - [Established knowledge points]
149
-
150
- ## Insights
151
- - [Non-obvious findings, patterns, implications]
152
-
153
- ## Connections
154
- - [[related-page]] — how this relates
155
-
156
- ## Open Questions
157
- - [Gaps in knowledge, unresolved contradictions]
158
-
159
- ## Sources
160
- - [Source URLs, file paths, session references]`;
161
- /**
162
- * Prompt for iterative update — merging new info into an existing page.
163
- * Mirrors pi's UPDATE_SUMMARIZATION_PROMPT approach.
164
- */
165
- export const ITERATIVE_UPDATE_PROMPT = `The content below is NEW information to incorporate into the existing wiki page provided in <existing-page> tags.
166
-
167
- RULES:
168
- - PRESERVE all existing knowledge from the previous page
169
- - ADD new facts, insights, and connections from the new content
170
- - UPDATE sections where new info supersedes old
171
- - FLAG contradictions between old and new content in Open Questions
172
- - PRESERVE exact names, paths, and technical details
173
- - Maintain all existing [[wikilinks]] and add new ones as appropriate
174
- - Update the Sources section to include the new source`;
175
- /**
176
- * Prompt for overview generation from multiple pages.
177
- */
178
- export const OVERVIEW_PROMPT = `Summarize the following wiki pages into a high-level overview page. Identify themes, patterns, and connections across pages. Use the wiki summary format.
179
-
180
- For each major theme:
181
- - Note which pages contribute to the theme
182
- - Identify cross-cutting patterns
183
- - Flag contradictions between pages
184
- - Highlight gaps (topics that should have pages but don't)`;
185
- // -- Lint Prompts ------------------------------------------------------------
186
- /**
187
- * Prompt for the LLM when reviewing lint results and auto-fixing issues.
188
- */
189
- export const LINT_PROMPT = `Review the lint results below and fix all auto-fixable issues.
190
-
191
- For each issue:
192
- - Prioritize by impact (errors first, then warnings, then info)
193
- - Fix broken wikilinks by finding the correct target page or removing dead links
194
- - Add missing pages for concepts referenced across multiple pages
195
- - Move stale projects to archives if inactive for 90+ days
196
- - Fix frontmatter issues (missing fields, invalid dates, empty scope)
197
- - Update index.md to include any pages missing from the index
198
- - Propose archiving for inactive projects
199
-
200
- Report unfixable issues that require human judgment.`;
201
- // -- Capture Prompts ---------------------------------------------------------
202
- /**
203
- * System prompt for the standalone capture agent.
204
- * Used as WIKI_SYSTEM_PROMPT for the capture agent instance.
205
- */
206
- export const CAPTURE_SYSTEM_PROMPT = `You are a knowledge capture assistant. Your job is to extract persistent knowledge from coding sessions and write it to a PARA-structured wiki.
207
-
208
- Capture ANY of the following — even from short sessions:
209
- - Architecture decisions and rationale ("we chose X because Y")
210
- - Debugging solutions (root cause + fix)
211
- - Server/infrastructure details (IPs, paths, credentials locations, configs)
212
- - Build and deployment procedures (commands, steps, gotchas)
213
- - API keys, service endpoints, and where they are stored
214
- - Project conventions and coding patterns
215
- - Tool configurations and setup steps
216
- - Dependencies and version constraints
217
- - Environment-specific knowledge (dev vs prod differences)
218
- - Operational runbooks (how to restart, deploy, rollback)
219
-
220
- Index is auto-rebuilt after every write — do not manage index.md manually. Do NOT pass indexContent to wiki_write.
221
-
222
- Rules:
223
- - If the session was ONLY greetings or completely off-topic chitchat with zero project knowledge, respond with "nothing to capture"
224
- - Otherwise, always capture — even small facts are valuable ("the deploy key is at /path/to/key")
225
- - Classify each piece of knowledge by PARA category autonomously
226
- - When the user defines a specific goal with a completion condition, create a projects/ page. When identifying a repeating responsibility (monitoring, maintenance, quality), create an areas/ page.
227
- - Produce wiki pages in the standard wiki summary format (Topic, Key Facts, Insights, Connections, Open Questions, Sources)
228
- - Include the full session file path in the Sources section for traceability
229
- - ALWAYS search wiki_query BEFORE creating any page — update existing pages instead of creating duplicates
230
- - If wiki_query finds a page on the same topic (even with a different title/slug), update THAT page using its existing slug
231
- - The conversation may include compaction summaries from earlier in the session — treat these as authoritative records of prior work
232
- - Write directly via wiki_write — no user confirmation needed
233
- - NEVER include API keys, tokens, passwords, or secrets in wiki pages. Document WHERE they are stored, not the actual values.`;
234
- /**
235
- * Prompt template for auto-capture at session_shutdown.
236
- * The serialized conversation is appended after this prompt.
237
- */
238
- export const CAPTURE_PROMPT = `Analyze the session conversation below and capture ALL project-relevant knowledge into the wiki.
239
-
240
- Capture bias: when in doubt, capture it. Small operational facts (paths, configs, server details, commands) are often the most valuable because they are hard to rediscover.
241
-
242
- Only respond with "nothing to capture" if the session was purely greetings or off-topic chitchat with zero project knowledge.
243
-
244
- For everything else:
245
- 1. Use wiki_query to search for EXISTING pages on each topic FIRST
246
- 2. If a matching page exists, use wiki_read to get its content, then wiki_write with its EXACT slug to update it
247
- 3. Only create a NEW page if wiki_query returned no relevant results
248
- 4. Each page must include the session file path in its Sources section
249
- 5. Do NOT pass indexContent to wiki_write - the index is auto-rebuilt from all pages on disk
250
-
251
- CRITICAL: prefer updating over creating. The wiki likely already has pages on most topics.
252
-
253
- <session-conversation>
254
- `;
255
- /**
256
- * Prompt template for explicit capture via /wiki-capture.
257
- * A topic hint (if provided) and the serialized conversation are appended.
258
- */
259
- export const EXPLICIT_CAPTURE_PROMPT = `Capture knowledge from the current session into the wiki.`;
260
- //# sourceMappingURL=prompts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/templates/prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,QAAQ,GAAG,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;QAC9D,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAAE,OAAO,QAAQ,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY;YAAE,O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,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;qHAuBmF,CAAC;AAEtH,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;+FAqBkE,CAAC;AAEhG,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;qFAayD,CAAC;AAEtF,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;gDAoBS,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;uDASgB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;2DAM4B,CAAC;AAE5D,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;qDAW0B,CAAC;AAEtD,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;8HA2ByF,CAAC;AAE/H;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;CAgB7B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,2DAA2D,CAAC"}
package/dist/tools.d.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * Tool registrations — wiki tools for both pi's session agent and standalone mini-agent.
3
- *
4
- * Tool implementations are shared between both consumers. Only the registration
5
- * wrapper differs (pi.registerTool vs AgentTool).
6
- *
7
- * Factory functions (createXxxExecute) close over wikiDir and store — no ctx dependency.
8
- */
9
- import type { AgentTool } from "@mariozechner/pi-agent-core";
10
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
11
- import type { QMDStore } from "@picassio/qmd";
12
- import type { ProjectScope } from "./scope.js";
13
- /**
14
- * Register all wiki tools with the pi extension API.
15
- *
16
- * Tools: wiki_ingest, wiki_query, wiki_write, wiki_read,
17
- * wiki_move, wiki_lint, wiki_summarize
18
- */
19
- export declare function registerTools(pi: ExtensionAPI, wikiDir: string, store: QMDStore, getScope: () => ProjectScope, markDirty: () => void, getGraphBoost?: () => boolean): void;
20
- /**
21
- * Create standalone AgentTool instances for the mini-agent (capture/lint/summarize).
22
- * Returns only the tools needed for autonomous wiki operations:
23
- * wiki_write, wiki_read, wiki_query, wiki_move.
24
- */
25
- export declare function createStandaloneTools(wikiDir: string, store: QMDStore, getScope: () => ProjectScope, markDirty?: () => void): AgentTool[];
26
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAi1B/C;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,YAAY,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,MAAM,YAAY,EAC5B,SAAS,EAAE,MAAM,IAAI,EACrB,aAAa,CAAC,EAAE,MAAM,OAAO,GAC5B,IAAI,CA4VN;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,MAAM,YAAY,EAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,GACrB,SAAS,EAAE,CA4Cb"}