pi-para 0.6.0 → 0.6.2

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 (213) hide show
  1. package/ARCHITECTURE.md +0 -9
  2. package/CHANGELOG.md +22 -0
  3. package/CONFIGURATION.md +5 -23
  4. package/README.md +7 -31
  5. package/SETUP.md +5 -3
  6. package/STRUCTURE.md +0 -9
  7. package/dist/atomic-write.d.ts +2 -0
  8. package/dist/atomic-write.d.ts.map +1 -0
  9. package/dist/atomic-write.js +18 -0
  10. package/dist/atomic-write.js.map +1 -0
  11. package/dist/capture.d.ts +34 -0
  12. package/dist/capture.d.ts.map +1 -0
  13. package/dist/capture.js +461 -0
  14. package/dist/capture.js.map +1 -0
  15. package/dist/cli-legacy.d.ts +4 -0
  16. package/dist/cli-legacy.d.ts.map +1 -0
  17. package/dist/cli-legacy.js +41 -0
  18. package/dist/cli-legacy.js.map +1 -0
  19. package/dist/cli.d.ts +8 -0
  20. package/dist/cli.d.ts.map +1 -0
  21. package/dist/cli.js +427 -0
  22. package/dist/cli.js.map +1 -0
  23. package/dist/commands.d.ts +15 -0
  24. package/dist/commands.d.ts.map +1 -0
  25. package/dist/commands.js +791 -0
  26. package/dist/commands.js.map +1 -0
  27. package/dist/config.d.ts +94 -0
  28. package/dist/config.d.ts.map +1 -0
  29. package/dist/config.js +228 -0
  30. package/dist/config.js.map +1 -0
  31. package/dist/context.d.ts +63 -0
  32. package/dist/context.d.ts.map +1 -0
  33. package/dist/context.js +311 -0
  34. package/dist/context.js.map +1 -0
  35. package/dist/credentials.d.ts +27 -0
  36. package/dist/credentials.d.ts.map +1 -0
  37. package/dist/credentials.js +85 -0
  38. package/dist/credentials.js.map +1 -0
  39. package/dist/daemon.d.ts +49 -0
  40. package/dist/daemon.d.ts.map +1 -0
  41. package/dist/daemon.js +226 -0
  42. package/dist/daemon.js.map +1 -0
  43. package/dist/doctor.d.ts +20 -0
  44. package/dist/doctor.d.ts.map +1 -0
  45. package/dist/doctor.js +197 -0
  46. package/dist/doctor.js.map +1 -0
  47. package/dist/frontmatter.d.ts +59 -0
  48. package/dist/frontmatter.d.ts.map +1 -0
  49. package/dist/frontmatter.js +170 -0
  50. package/dist/frontmatter.js.map +1 -0
  51. package/dist/index.d.ts +21 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +357 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/ingest.d.ts +88 -0
  56. package/dist/ingest.d.ts.map +1 -0
  57. package/dist/ingest.js +105 -0
  58. package/dist/ingest.js.map +1 -0
  59. package/dist/link-discovery.d.ts +40 -0
  60. package/dist/link-discovery.d.ts.map +1 -0
  61. package/dist/link-discovery.js +122 -0
  62. package/dist/link-discovery.js.map +1 -0
  63. package/dist/link-utils.d.ts +30 -0
  64. package/dist/link-utils.d.ts.map +1 -0
  65. package/dist/link-utils.js +145 -0
  66. package/dist/link-utils.js.map +1 -0
  67. package/dist/lint.d.ts +39 -0
  68. package/dist/lint.d.ts.map +1 -0
  69. package/dist/lint.js +827 -0
  70. package/dist/lint.js.map +1 -0
  71. package/dist/maintainer.d.ts +24 -0
  72. package/dist/maintainer.d.ts.map +1 -0
  73. package/dist/maintainer.js +358 -0
  74. package/dist/maintainer.js.map +1 -0
  75. package/dist/model-resolver.d.ts +30 -0
  76. package/dist/model-resolver.d.ts.map +1 -0
  77. package/dist/model-resolver.js +71 -0
  78. package/dist/model-resolver.js.map +1 -0
  79. package/dist/paths.d.ts +20 -0
  80. package/dist/paths.d.ts.map +1 -0
  81. package/dist/paths.js +33 -0
  82. package/dist/paths.js.map +1 -0
  83. package/dist/processor.d.ts +14 -0
  84. package/dist/processor.d.ts.map +1 -0
  85. package/dist/processor.js +361 -0
  86. package/dist/processor.js.map +1 -0
  87. package/dist/qmd-providers.d.ts +12 -0
  88. package/dist/qmd-providers.d.ts.map +1 -0
  89. package/dist/qmd-providers.js +45 -0
  90. package/dist/qmd-providers.js.map +1 -0
  91. package/dist/query.d.ts +69 -0
  92. package/dist/query.d.ts.map +1 -0
  93. package/dist/query.js +120 -0
  94. package/dist/query.js.map +1 -0
  95. package/dist/raw.d.ts +57 -0
  96. package/dist/raw.d.ts.map +1 -0
  97. package/dist/raw.js +219 -0
  98. package/dist/raw.js.map +1 -0
  99. package/dist/redact.d.ts +21 -0
  100. package/dist/redact.d.ts.map +1 -0
  101. package/dist/redact.js +143 -0
  102. package/dist/redact.js.map +1 -0
  103. package/dist/repair.d.ts +11 -0
  104. package/dist/repair.d.ts.map +1 -0
  105. package/dist/repair.js +41 -0
  106. package/dist/repair.js.map +1 -0
  107. package/dist/scheduler/controls.d.ts +35 -0
  108. package/dist/scheduler/controls.d.ts.map +1 -0
  109. package/dist/scheduler/controls.js +98 -0
  110. package/dist/scheduler/controls.js.map +1 -0
  111. package/dist/scheduler/index.d.ts +70 -0
  112. package/dist/scheduler/index.d.ts.map +1 -0
  113. package/dist/scheduler/index.js +245 -0
  114. package/dist/scheduler/index.js.map +1 -0
  115. package/dist/scheduler/leases.d.ts +22 -0
  116. package/dist/scheduler/leases.d.ts.map +1 -0
  117. package/dist/scheduler/leases.js +74 -0
  118. package/dist/scheduler/leases.js.map +1 -0
  119. package/dist/scheduler/session-capture.d.ts +33 -0
  120. package/dist/scheduler/session-capture.d.ts.map +1 -0
  121. package/dist/scheduler/session-capture.js +108 -0
  122. package/dist/scheduler/session-capture.js.map +1 -0
  123. package/dist/scheduler/state.d.ts +56 -0
  124. package/dist/scheduler/state.d.ts.map +1 -0
  125. package/dist/scheduler/state.js +210 -0
  126. package/dist/scheduler/state.js.map +1 -0
  127. package/dist/scope.d.ts +54 -0
  128. package/dist/scope.d.ts.map +1 -0
  129. package/dist/scope.js +161 -0
  130. package/dist/scope.js.map +1 -0
  131. package/dist/scripts/bulk-link-fix.d.ts +9 -0
  132. package/dist/scripts/bulk-link-fix.d.ts.map +1 -0
  133. package/dist/scripts/bulk-link-fix.js +106 -0
  134. package/dist/scripts/bulk-link-fix.js.map +1 -0
  135. package/dist/session-tools.d.ts +33 -0
  136. package/dist/session-tools.d.ts.map +1 -0
  137. package/dist/session-tools.js +211 -0
  138. package/dist/session-tools.js.map +1 -0
  139. package/dist/settings.d.ts +37 -0
  140. package/dist/settings.d.ts.map +1 -0
  141. package/dist/settings.js +176 -0
  142. package/dist/settings.js.map +1 -0
  143. package/dist/setup.d.ts +29 -0
  144. package/dist/setup.d.ts.map +1 -0
  145. package/dist/setup.js +90 -0
  146. package/dist/setup.js.map +1 -0
  147. package/dist/state.d.ts +54 -0
  148. package/dist/state.d.ts.map +1 -0
  149. package/dist/state.js +176 -0
  150. package/dist/state.js.map +1 -0
  151. package/dist/status.d.ts +22 -0
  152. package/dist/status.d.ts.map +1 -0
  153. package/dist/status.js +93 -0
  154. package/dist/status.js.map +1 -0
  155. package/dist/store.d.ts +71 -0
  156. package/dist/store.d.ts.map +1 -0
  157. package/dist/store.js +282 -0
  158. package/dist/store.js.map +1 -0
  159. package/dist/summarize.d.ts +60 -0
  160. package/dist/summarize.d.ts.map +1 -0
  161. package/dist/summarize.js +266 -0
  162. package/dist/summarize.js.map +1 -0
  163. package/dist/tag-registry.d.ts +56 -0
  164. package/dist/tag-registry.d.ts.map +1 -0
  165. package/dist/tag-registry.js +146 -0
  166. package/dist/tag-registry.js.map +1 -0
  167. package/dist/templates/prompts.d.ts +51 -0
  168. package/dist/templates/prompts.d.ts.map +1 -0
  169. package/dist/templates/prompts.js +203 -0
  170. package/dist/templates/prompts.js.map +1 -0
  171. package/dist/tools.d.ts +26 -0
  172. package/dist/tools.d.ts.map +1 -0
  173. package/dist/tools.js +1198 -0
  174. package/dist/tools.js.map +1 -0
  175. package/dist/watcher.d.ts +25 -0
  176. package/dist/watcher.d.ts.map +1 -0
  177. package/dist/watcher.js +84 -0
  178. package/dist/watcher.js.map +1 -0
  179. package/dist/webui/client/dist/index.html +1885 -0
  180. package/dist/webui/server.d.ts +31 -0
  181. package/dist/webui/server.d.ts.map +1 -0
  182. package/dist/webui/server.js +566 -0
  183. package/dist/webui/server.js.map +1 -0
  184. package/dist/wiki-tool-guidance.d.ts +6 -0
  185. package/dist/wiki-tool-guidance.d.ts.map +1 -0
  186. package/dist/wiki-tool-guidance.js +70 -0
  187. package/dist/wiki-tool-guidance.js.map +1 -0
  188. package/dist/wiki.d.ts +108 -0
  189. package/dist/wiki.d.ts.map +1 -0
  190. package/dist/wiki.js +497 -0
  191. package/dist/wiki.js.map +1 -0
  192. package/package.json +2 -1
  193. package/scripts/build-assets.mjs +1 -13
  194. package/skills/setup/SKILL.md +1 -1
  195. package/src/cli.ts +0 -70
  196. package/src/commands.ts +78 -3
  197. package/src/config.ts +0 -25
  198. package/src/doctor.ts +21 -1
  199. package/src/index.ts +16 -38
  200. package/src/scheduler/index.ts +64 -0
  201. package/src/settings.ts +88 -0
  202. package/src/setup.ts +1 -1
  203. package/src/templates/prompts.ts +0 -56
  204. package/scripts/gepa/dataset.py +0 -192
  205. package/scripts/gepa/lm_providers.py +0 -472
  206. package/scripts/gepa/metric.py +0 -279
  207. package/scripts/gepa/optimize.py +0 -367
  208. package/scripts/gepa/program.py +0 -99
  209. package/scripts/gepa/pyproject.toml +0 -19
  210. package/scripts/gepa/run-all.sh +0 -53
  211. package/scripts/gepa/wiki_reader.py +0 -113
  212. package/src/gepa/index.ts +0 -287
  213. package/src/gepa/optimized/capture-prompt.txt +0 -65
package/ARCHITECTURE.md CHANGED
@@ -138,15 +138,6 @@ Tool API contracts and behavioral guidance are separated:
138
138
  - `src/tools.ts`: host registration, schemas, rendering, and execution only.
139
139
  - `src/context.ts`: injects the shared guidance once with wiki context so agents learn when to search, verify stale pages, and self-heal with `wiki_edit`.
140
140
 
141
- ## GEPA optimizer
142
-
143
- GEPA lives in two layers:
144
-
145
- - `src/gepa/index.ts`: TypeScript target extraction/orchestration and CLI.
146
- - `scripts/gepa/`: Python/uv DSPy program, metric, dataset, custom LMs.
147
-
148
- It uses DSPy GEPA, not a custom TypeScript optimizer, and uses custom `dspy.BaseLM` providers for Anthropic OAuth/MiniMax/OpenRouter.
149
-
150
141
  ## Compatibility surfaces
151
142
 
152
143
  Kept temporarily:
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.6.2] — 2026-07-14
6
+
7
+ ### Added
8
+ - `/wiki-settings` gained a `[Secrets]` menu (creates `~/.pi/para/secrets.json` with 0600 permissions on first save; add/update/remove API keys with redacted listing) and preset-based provider selection for embedding/rerank profiles (OpenAI, OpenRouter, Gemini, Mistral, Voyage, Jina, Ollama — base URL/API format/default model prefilled, with inline API key entry), plus `custom` manual entry.
9
+
10
+ ### Fixed
11
+ - **Embeddings were never generated automatically.** Pi startup opens the QMD store with `backgroundEmbed: false` (for fast print-mode exits) and nothing called `embedIfNeeded()` afterwards, so searches silently stayed BM25-only even with a correct remote embedding provider. A new deduplicated `qmd-embed` scheduler task (cross-process lease, gated by `qmd.embedEnabled`) now drains the `needsEmbedding` backlog at interactive session startup and is chained after every `wiki-maintenance` reindex. Provider failures are recorded and retried with backoff; BM25 keeps working regardless. Print mode is unaffected.
12
+ - `pi-para doctor` now reports vector-index availability, pending embedding count, and the active embedding provider/model/endpoint host (never credentials).
13
+
14
+ ## [0.6.1] — 2026-07-14
15
+
16
+ ### Removed
17
+ - **GEPA prompt optimizer removed entirely** (`pi-para gepa` CLI, `src/gepa/`, the Python/uv DSPy pipeline under `scripts/gepa/`, bundled optimized prompts, and the `gepa` config section). It added Python/uv overhead to the package for a rarely used offline workflow. Existing `gepa` keys in user config files are ignored harmlessly.
18
+
19
+ ### Fixed
20
+ - **npm 0.6.0 tarball shipped without `dist/`** (the tag-triggered publish workflow ran `npm publish` on a fresh checkout without building), which broke `npx pi-para setup`, the PowerShell installer, and the `pi-para` bin on all platforms. The publish workflow now runs `npm ci` + typecheck + tests + build, packs a tarball, asserts `dist/cli.js`/`dist/index.js` exist inside it, smoke-runs `setup --yes --dry-run` from the packed tarball, and publishes that exact tarball.
21
+ - Added a `prepack` script (`npm run build`) as a second safeguard so `npm pack`/`npm publish` can never produce a dist-less artifact again.
22
+ - Documentation now uses the correct Pi command `pi install npm:pi-para` (bare `pi install pi-para` is interpreted as a local path by Pi 0.80+).
23
+
24
+ ### Security
25
+ - npm publishing now runs in the `npm-publish` GitHub environment (required reviewer approval + `v*` tag deployment policy), and a repository ruleset restricts `v*` tag creation/update/deletion to repo admins.
26
+
5
27
  ## [0.6.0] — 2026-07-14
6
28
 
7
29
  ### Breaking
package/CONFIGURATION.md CHANGED
@@ -66,15 +66,6 @@ Planned/project-level overrides may use `<project>/.pi/para.jsonc` in a later sl
66
66
  "host": "127.0.0.1",
67
67
  "port": 10973,
68
68
  "launch": "manual"
69
- },
70
- "gepa": {
71
- "useOptimized": false,
72
- "studentModel": "anthropic/claude-sonnet-4-20250514",
73
- "teacherModel": "anthropic/claude-opus-4-6",
74
- "judgeModel": "anthropic/claude-sonnet-4-20250514",
75
- "auto": "light",
76
- "threads": 2,
77
- "seed": 42
78
69
  }
79
70
  }
80
71
  ```
@@ -129,6 +120,11 @@ pi-para providers set-secret embedding <key>
129
120
  pi-para providers set-secret rerank <key>
130
121
  ```
131
122
 
123
+ Or interactively inside Pi via `/wiki-settings`:
124
+
125
+ - `[Secrets]` — lists stored keys (redacted), adds/updates/removes API keys. `~/.pi/para/secrets.json` is created automatically (0600) on first save.
126
+ - `[Embedding]` / `[Rerank]` → `Provider` — pick from presets (OpenAI, OpenRouter, Gemini, Mistral, Voyage, Jina, Ollama) to prefill base URL/API format/default model, then optionally paste the API key in the same flow; or choose `custom` for a manual provider id + base URL.
127
+
132
128
  Inspect without leaking values:
133
129
 
134
130
  ```bash
@@ -218,20 +214,6 @@ Optional browser UI.
218
214
  | `port` | Port |
219
215
  | `launch` | `manual` or `disabled` |
220
216
 
221
- ### `gepa`
222
-
223
- DSPy GEPA optimizer defaults.
224
-
225
- | Field | Meaning |
226
- |---|---|
227
- | `useOptimized` | Load optimized prompt overrides |
228
- | `studentModel` | Proxy/evaluation model |
229
- | `teacherModel` | Reflection/mutation model |
230
- | `judgeModel` | LLM-as-judge model |
231
- | `auto` | Budget preset: `light`, `medium`, `heavy` |
232
- | `threads` | Parallel eval threads |
233
- | `seed` | Reproducibility seed |
234
-
235
217
  ## Diagnostics
236
218
 
237
219
  ```bash
package/README.md CHANGED
@@ -7,7 +7,7 @@ pi-para runs as a normal Pi extension: no required daemon, no `systemd`, and no
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- pi install pi-para
10
+ pi install npm:pi-para
11
11
  # or, for npm/npx setup flows:
12
12
  npx pi-para@latest setup
13
13
  ```
@@ -26,12 +26,14 @@ irm https://raw.githubusercontent.com/picassio/pi-para/main/scripts/install.ps1
26
26
 
27
27
  Restart Pi after installing or changing extension registration.
28
28
 
29
- Then run:
29
+ Then run diagnostics:
30
30
 
31
31
  ```bash
32
- pi-para doctor
32
+ npx -y pi-para@latest doctor
33
33
  ```
34
34
 
35
+ > The `pi-para` command is only on your `PATH` after a global install (`npm install -g pi-para`). After `pi install npm:pi-para` or an `npx` setup, invoke the CLI with `npx -y pi-para@latest <command>` instead.
36
+
35
37
  ## What pi-para creates
36
38
 
37
39
  Default user files:
@@ -67,6 +69,8 @@ Legacy files such as `~/.pi/wiki/config.json`, `~/.pi/wiki/.daemon.sqlite`, and
67
69
 
68
70
  ### CLI
69
71
 
72
+ Run these as `pi-para <command>` (global install) or `npx -y pi-para@latest <command>`:
73
+
70
74
  ```bash
71
75
  pi-para setup [--yes] [--dry-run] [--local PATH]
72
76
  pi-para doctor [--fix] [--json] [--test-capture-model]
@@ -79,7 +83,6 @@ pi-para capture-recent --hours 24
79
83
  pi-para providers
80
84
  pi-para providers set-secret <name> <value>
81
85
  pi-para providers remove-secret <name>
82
- pi-para gepa optimize --target capture-prompt
83
86
  ```
84
87
 
85
88
  `pi-para-daemon` remains as a temporary compatibility binary, but the primary runtime is the in-process scheduler. Legacy daemon status is available as `pi-para legacy-status` for troubleshooting old installs.
@@ -149,33 +152,6 @@ The optional web wiki can be enabled from `/wiki-settings`:
149
152
 
150
153
  It serves the wiki viewer/editor/graph on the configured host/port.
151
154
 
152
- ## GEPA Prompt Optimizer
153
-
154
- pi-para can optimize prompts/tools/skills using DSPy GEPA via `uv` and custom DSPy `BaseLM` providers.
155
-
156
- Recommended roles:
157
-
158
- | Role | Default |
159
- |---|---|
160
- | Student | `anthropic/claude-sonnet-4-20250514` |
161
- | Teacher/reflection | `anthropic/claude-opus-4-6` |
162
- | Judge | `anthropic/claude-sonnet-4-20250514` |
163
-
164
- Examples:
165
-
166
- ```bash
167
- pi-para gepa targets
168
- pi-para gepa optimize --target capture-prompt
169
- pi-para gepa optimize --target skill-para \
170
- --student-model anthropic/claude-sonnet-4-20250514 \
171
- --teacher-model anthropic/claude-opus-4-6 \
172
- --judge-model anthropic/claude-sonnet-4-20250514
173
- pi-para gepa list
174
- pi-para gepa compare --target capture-prompt
175
- ```
176
-
177
- GEPA uses `~/.pi/agent/auth.json`/custom providers; it does not use LiteLLM.
178
-
179
155
  ## Obsidian compatibility
180
156
 
181
157
  The wiki is plain markdown with YAML frontmatter and `[[wikilinks]]`. You can open `~/.pi/wiki/` as an Obsidian vault.
package/SETUP.md CHANGED
@@ -11,7 +11,7 @@ This is the current setup flow for pi-para. It is cross-platform and does not re
11
11
  ## Standard install
12
12
 
13
13
  ```bash
14
- pi install pi-para
14
+ pi install npm:pi-para
15
15
  ```
16
16
 
17
17
  Then restart Pi.
@@ -19,15 +19,17 @@ Then restart Pi.
19
19
  Run diagnostics:
20
20
 
21
21
  ```bash
22
- pi-para doctor
22
+ npx -y pi-para@latest doctor
23
23
  ```
24
24
 
25
25
  If needed, apply safe repairs:
26
26
 
27
27
  ```bash
28
- pi-para doctor --fix
28
+ npx -y pi-para@latest doctor --fix
29
29
  ```
30
30
 
31
+ > `pi install npm:pi-para` and the `npx` setup flow do not put a global `pi-para` command on your `PATH`. Use `npx -y pi-para@latest <command>`, or `npm install -g pi-para` if you prefer the bare `pi-para` form used in the examples below.
32
+
31
33
  ## npx setup flow
32
34
 
33
35
  For a fresh machine or scripted install:
package/STRUCTURE.md CHANGED
@@ -13,7 +13,6 @@ SETUP_SETTINGS_FLOW_PLAN.md
13
13
  package.json
14
14
  src/
15
15
  test/
16
- scripts/gepa/
17
16
  skills/
18
17
  ```
19
18
 
@@ -77,14 +76,6 @@ src/scheduler/
77
76
  └── session-capture.ts # completed-session registry and capture task handler
78
77
  ```
79
78
 
80
- ### GEPA
81
-
82
- ```text
83
- src/gepa/index.ts # TS orchestration/CLI integration
84
- src/templates/prompts.ts
85
- scripts/gepa/ # uv/DSPy Python optimizer
86
- ```
87
-
88
79
  ### Legacy/compatibility
89
80
 
90
81
  | Path | Purpose |
@@ -0,0 +1,2 @@
1
+ export declare function atomicWriteFile(path: string, content: string, mode?: number): Promise<void>;
2
+ //# sourceMappingURL=atomic-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../src/atomic-write.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWjG"}
@@ -0,0 +1,18 @@
1
+ import { closeSync, fsyncSync, openSync, renameSync, writeFileSync } from "node:fs";
2
+ import { mkdir } from "node:fs/promises";
3
+ import { dirname, join } from "node:path";
4
+ import { randomUUID } from "node:crypto";
5
+ export async function atomicWriteFile(path, content, mode) {
6
+ await mkdir(dirname(path), { recursive: true });
7
+ const tempPath = join(dirname(path), `.${randomUUID()}.tmp`);
8
+ const fd = openSync(tempPath, "w", mode);
9
+ try {
10
+ writeFileSync(fd, content, "utf-8");
11
+ fsyncSync(fd);
12
+ }
13
+ finally {
14
+ closeSync(fd);
15
+ }
16
+ renameSync(tempPath, path);
17
+ }
18
+ //# sourceMappingURL=atomic-write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomic-write.js","sourceRoot":"","sources":["../src/atomic-write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY,EAAE,OAAe,EAAE,IAAa;IAChF,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7D,MAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACpC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IACD,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Session knowledge capture — extracts insights from sessions into the wiki.
3
+ *
4
+ * Two modes:
5
+ * - Auto-capture on session_shutdown (standalone Agent with wiki tools)
6
+ * - Explicit capture via /wiki-capture command (standalone Agent)
7
+ *
8
+ * Both are fully automatic — no user confirmation prompts.
9
+ */
10
+ import type { Model } from "@earendil-works/pi-ai";
11
+ import type { AgentMessage } from "@earendil-works/pi-agent-core";
12
+ import type { ModelRegistry } from "@earendil-works/pi-coding-agent";
13
+ import type { QMDStore } from "qmd-engine";
14
+ import type { ProjectScope } from "./scope.js";
15
+ import type { PageRef } from "./wiki.js";
16
+ import type { SessionDigest } from "./raw.js";
17
+ export interface CaptureResult {
18
+ pagesCreated: PageRef[];
19
+ pagesUpdated: PageRef[];
20
+ skipped: boolean;
21
+ reason?: string;
22
+ digestEntry?: SessionDigest;
23
+ }
24
+ /**
25
+ * Called automatically on session_shutdown.
26
+ * Spins up a standalone Agent with wiki tools, aborts after timeoutMs.
27
+ */
28
+ export declare function autoCapture(wikiDir: string, store: QMDStore, messages: AgentMessage[], scope: ProjectScope, sessionFile: string, model: Model<any>, modelRegistry: ModelRegistry, timeoutMs?: number, alreadyCaptured?: string[]): Promise<CaptureResult>;
29
+ /**
30
+ * Called when user explicitly requests capture mid-session via /wiki-capture.
31
+ * Spins up a standalone Agent with wiki tools.
32
+ */
33
+ export declare function explicitCapture(wikiDir: string, store: QMDStore, topic: string | undefined, messages: AgentMessage[], scope: ProjectScope, sessionFile: string, model: Model<any>, modelRegistry: ModelRegistry, alreadyCaptured?: string[]): Promise<CaptureResult>;
34
+ //# sourceMappingURL=capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAO9C,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAqMD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,YAAY,EAAE,EACxB,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,aAAa,CAAC,CAkJxB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,YAAY,EAAE,EACxB,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,aAAa,EAAE,aAAa,EAC5B,eAAe,CAAC,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,aAAa,CAAC,CAqHxB"}