pi-vault-mind 0.14.2 → 0.16.3

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 (164) hide show
  1. package/CHANGELOG.md +293 -0
  2. package/README.md +5 -5
  3. package/agents/broadcaster.agent.md +2 -2
  4. package/agents/heavy-lifter.agent.md +1 -1
  5. package/agents/main.agent.md +29 -0
  6. package/agents/manager.agent.md +1 -1
  7. package/agents/miner.agent.md +1 -1
  8. package/dist/packages/obsidian/src/client.js +331 -0
  9. package/dist/packages/obsidian/src/types.js +1 -0
  10. package/dist/src/activity.d.ts +49 -0
  11. package/dist/src/activity.js +175 -0
  12. package/dist/src/agent-bus/Agent.d.ts +9 -1
  13. package/dist/src/agent-bus/Agent.js +18 -2
  14. package/dist/src/agent-bus/index.d.ts +5 -5
  15. package/dist/src/agent-bus/index.js +1 -1
  16. package/dist/src/agent-queue.js +12 -3
  17. package/dist/src/agents/BroadcasterAgent.d.ts +1 -1
  18. package/dist/src/agents/BroadcasterAgent.js +2 -2
  19. package/dist/src/agents/HeavyLifterAgent.d.ts +1 -1
  20. package/dist/src/agents/HeavyLifterAgent.js +2 -2
  21. package/dist/src/agents/ManagerAgent.js +1 -1
  22. package/dist/src/agents/MinerAgent.d.ts +1 -1
  23. package/dist/src/agents/MinerAgent.js +2 -2
  24. package/dist/src/agents/index.d.ts +2 -2
  25. package/dist/src/agents/index.js +2 -2
  26. package/dist/src/auth.d.ts +17 -15
  27. package/dist/src/auth.js +26 -37
  28. package/dist/src/autosync.js +2 -2
  29. package/dist/src/commands.d.ts +2 -19
  30. package/dist/src/commands.js +301 -231
  31. package/dist/src/config-keys.d.ts +16 -0
  32. package/dist/src/config-keys.js +45 -0
  33. package/dist/src/discover-schema.js +4 -4
  34. package/dist/src/edits.d.ts +21 -0
  35. package/dist/src/edits.js +75 -0
  36. package/dist/src/embedding-probe.d.ts +34 -0
  37. package/dist/src/embedding-probe.js +142 -0
  38. package/dist/src/embedding-providers.d.ts +133 -0
  39. package/dist/src/embedding-providers.js +173 -0
  40. package/dist/src/embedding-secrets.d.ts +38 -0
  41. package/dist/src/embedding-secrets.js +291 -0
  42. package/dist/src/engine.d.ts +6 -0
  43. package/dist/src/engine.js +78 -6
  44. package/dist/src/events.js +7 -10
  45. package/dist/src/extension-packages.d.ts +9 -0
  46. package/dist/src/extension-packages.js +14 -0
  47. package/dist/src/git.d.ts +19 -0
  48. package/dist/src/git.js +78 -0
  49. package/dist/src/graph.d.ts +2 -1
  50. package/dist/src/graph.js +47 -13
  51. package/dist/src/identities-config.d.ts +6 -0
  52. package/dist/src/identities-config.js +39 -0
  53. package/dist/src/identity-injector.js +1 -1
  54. package/dist/src/index.js +9 -26
  55. package/dist/src/lance.d.ts +9 -0
  56. package/dist/src/lance.js +143 -203
  57. package/dist/src/modal-client.d.ts +16 -0
  58. package/dist/src/modal-client.js +16 -0
  59. package/dist/src/modal-config.d.ts +37 -14
  60. package/dist/src/modal-config.js +59 -32
  61. package/dist/src/model-router.d.ts +27 -0
  62. package/dist/src/model-router.js +67 -0
  63. package/dist/src/models.d.ts +42 -0
  64. package/dist/src/models.js +78 -0
  65. package/dist/src/personalize.js +17 -3
  66. package/dist/src/scaffold.d.ts +48 -0
  67. package/dist/src/scaffold.js +246 -0
  68. package/dist/src/server.d.ts +47 -4
  69. package/dist/src/server.js +988 -221
  70. package/dist/src/session-search.d.ts +63 -0
  71. package/dist/src/session-search.js +379 -0
  72. package/dist/src/settings-ui.d.ts +2 -2
  73. package/dist/src/settings-ui.js +76 -135
  74. package/dist/src/sync.d.ts +3 -3
  75. package/dist/src/sync.js +19 -15
  76. package/dist/src/tool-catalog.d.ts +18 -0
  77. package/dist/src/tool-catalog.js +232 -0
  78. package/dist/src/tools/marksman.js +1 -1
  79. package/dist/src/tools.js +111 -65
  80. package/dist/src/types.d.ts +127 -71
  81. package/dist/src/utils.d.ts +57 -6
  82. package/dist/src/utils.js +114 -28
  83. package/dist/src/vault-tools.d.ts +34 -0
  84. package/dist/src/vault-tools.js +99 -0
  85. package/dist/src/vault-writer.js +4 -1
  86. package/dist/src/vm-handlers.js +140 -43
  87. package/dist/src/watcher.js +9 -9
  88. package/dist/test/activity-tool.test.js +54 -0
  89. package/dist/test/agent-bus/Agent.test.js +174 -0
  90. package/dist/test/agent-bus/AgentLoader.test.js +180 -0
  91. package/dist/test/agent-bus/AgentRegistry.test.js +86 -0
  92. package/dist/test/agent-bus/LLMProvider.test.js +162 -0
  93. package/dist/test/agent-bus/TaskQueue.test.js +256 -0
  94. package/dist/test/agent-dispatch-context.test.js +73 -0
  95. package/dist/test/agent-queue.test.js +1 -1
  96. package/dist/test/agents/Agents.test.js +282 -0
  97. package/dist/test/auth.test.js +57 -56
  98. package/dist/test/bridge-identity.test.js +34 -3
  99. package/dist/test/classify-search-mode.test.js +51 -0
  100. package/dist/test/commands.test.js +410 -0
  101. package/dist/test/config-merge.test.js +98 -0
  102. package/dist/test/context-capture.test.js +56 -0
  103. package/dist/test/discover-schema.test.js +8 -5
  104. package/dist/test/dispatch.test.js +45 -91
  105. package/dist/test/edits.test.js +144 -0
  106. package/dist/test/embedding-probe.test.js +424 -0
  107. package/dist/test/embedding-providers.test.js +157 -0
  108. package/dist/test/embedding-secrets.test.js +210 -0
  109. package/dist/test/engine-identity.test.js +1 -1
  110. package/dist/test/events.test.js +675 -0
  111. package/dist/test/git-bridge.test.js +160 -0
  112. package/dist/test/graph.test.js +464 -0
  113. package/dist/test/helpers/server.js +81 -0
  114. package/dist/test/identity-injector.test.js +197 -0
  115. package/dist/test/index.test.js +5 -7
  116. package/dist/test/lance-modal.test.js +67 -2
  117. package/dist/test/lance.test.js +429 -0
  118. package/dist/test/modal-client.test.js +1 -1
  119. package/dist/test/modal-config.test.js +92 -79
  120. package/dist/test/model-readiness.test.js +122 -0
  121. package/dist/test/model-router.test.js +99 -0
  122. package/dist/test/obsidian-client.test.js +42 -0
  123. package/dist/test/personalize.test.js +1 -1
  124. package/dist/test/rest-models.test.js +153 -0
  125. package/dist/test/rest-queue.test.js +135 -87
  126. package/dist/test/rest-setup.test.js +625 -115
  127. package/dist/test/rest-vm.test.js +355 -94
  128. package/dist/test/server-cors.test.js +48 -0
  129. package/dist/test/server-ws.test.js +61 -34
  130. package/dist/test/session-crud.test.js +323 -0
  131. package/dist/test/session-search.test.js +139 -0
  132. package/dist/test/settings-ui.test.js +113 -4
  133. package/dist/test/sync.test.js +12 -12
  134. package/dist/test/tombstone.test.js +8 -10
  135. package/dist/test/tool-catalog.test.js +86 -0
  136. package/dist/test/utils.test.js +588 -0
  137. package/dist/test/vault-tools.test.js +103 -12
  138. package/dist/test/vault-writer.test.js +371 -0
  139. package/dist/test/vm-handlers.test.js +620 -0
  140. package/extension-packages.json +9 -0
  141. package/package.json +107 -90
  142. package/pi-vault-mind.config.example.json +24 -2
  143. package/scripts/check-deps.sh +35 -32
  144. package/scripts/cli-e2e.mjs +215 -0
  145. package/scripts/configuration-e2e.mjs +783 -0
  146. package/scripts/e2e-commands.mjs +391 -0
  147. package/scripts/e2e-ws.mjs +3 -2
  148. package/scripts/fetch-modal-token.sh +4 -3
  149. package/scripts/generate-config-keys-json.mjs +45 -0
  150. package/scripts/generate-extension-packages-json.mjs +55 -0
  151. package/scripts/pi-session-query +0 -0
  152. package/scripts/publish-obsidian-plugin.sh +0 -0
  153. package/scripts/reset-test-vault.sh +2 -2
  154. package/scripts/setup-test-config.sh +0 -0
  155. package/scripts/setup-vault-pi.sh +48 -9
  156. package/scripts/test-slash-commands.mjs +2 -2
  157. package/scripts/vault-pi.sh +12 -3
  158. package/skills/github-release-notes-file/SKILL.md +42 -0
  159. package/skills/obsidian-guided-test-session/SKILL.md +110 -0
  160. package/skills/obsidian-interactive-test/SKILL.md +88 -0
  161. package/skills/obsidian-plugin-publish/SKILL.md +58 -0
  162. package/skills/pi-vault-mind-release/SKILL.md +141 -0
  163. package/skills/pre-test-release/SKILL.md +116 -0
  164. package/dist/test/auto-indexer.test.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,298 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.3 / 0.6.5 — 2026-07-16
4
+
5
+ ### Added
6
+
7
+ - **`GET /vault-mind/models` endpoint.** Auth-gated route returns pi's
8
+ provider/model catalog (`{ providers: ProviderInfo[] }`, plus an
9
+ `error` field when a `models.json` exists but fails to parse), merged
10
+ from the agent-dir and project-level `models.json` (project overrides
11
+ agent-dir for same-named providers). `src/models.ts`
12
+ `readModelProviders()` mirrors the plugin's `pi-config-reader.ts`
13
+ flattened shape (`$`-stripped `envVarName`, model `name` falls back to
14
+ `id`, providers sorted by name). New `VaultMindClient.getModels()`
15
+ (typed `VmModelsResponse`) is the client bridge so the plugin can
16
+ replace synchronous `models.json` disk reads with a live call. Covered
17
+ by `test/rest-models.test.ts` (auth, empty, parse, override, malformed).
18
+
19
+ - **Extension-owned setup and configuration surfaces.** Added masked
20
+ provider-credential status and atomic extension-owned secret storage,
21
+ Local/Remote live embedding probes, complete typed setup/configuration
22
+ client methods, default-vault sibling preservation, and a deterministic
23
+ configuration E2E smoke. Added the portable seven-step Arrow setup
24
+ wizard and twelve-category section-save Settings UI, then ported it into
25
+ the Obsidian plugin behind a thin `RestConfigurationAdapter`. The plugin
26
+ now uses typed runtime model discovery instead of synchronous
27
+ `models.json` reads or writes, routes model selection through Pi RPC,
28
+ mounts Settings through one adapter boundary, renders retryable offline
29
+ recovery rather than a blank pane, and keeps plugin/extension bridge
30
+ credentials separate from embedding-provider credentials. Added
31
+ port-parity canonicalization for type re-exports, CSS/import guards,
32
+ intrinsic SVG icon bounds, and focused regression coverage across the
33
+ extension, sandbox, and plugin.
34
+
35
+ ### Fixed
36
+
37
+ - **Un-imported `modalUrl` in `src/server.ts`** — the
38
+ `handleVaultMindConfig` function destructured `modalUrl` from
39
+ `../modal-config.js` without ever importing it. Would have crashed
40
+ with `TypeError: Cannot read properties of undefined (reading 'space')`
41
+ if the modal config branch was hit. Caught by
42
+ `/tmp/pvm-e2e-http-setup-test.mjs`. Import is now in place.
43
+
44
+ ### Documentation
45
+
46
+ - **`vault-mind-config-index.md` §12 — Modal extraction question.** New
47
+ section documenting the open architectural question: should
48
+ `pi-vault-mind`'s Modal-specific code (HTTP client, sync engine,
49
+ `ModalProvider`, `/vm remote *` slash commands, `embedding.sync`
50
+ config block, Python `modal/` app) move into a separate package
51
+ (`pi-vault-mind-remote-modal/`) so the extension is truly
52
+ provider-agnostic? Three options documented (A: namespace in-tree /
53
+ B: extract to a package / C: server+client out, CLI stays). Smaller
54
+ win called out regardless of option: drop `/vm remote *` in favor of
55
+ `--remoteUrl` / `--remoteApiKey` flags on `/vm setup`. Awaiting
56
+ user decision; no work committed.
57
+ - **§7.1 scope column.** Every `/vm *` slash command is now tagged
58
+ `🟢 agnostic` / `🟡 Modal-specific` / `🔵 token` so the reader can
59
+ see exactly which commands depend on Modal.
60
+
61
+ ## 0.16.2 — 2026-07-07
62
+
63
+ ### Changed
64
+
65
+ - **`ModalEmbeddingConfig` flattened into `EmbeddingConfig`.** Modal
66
+ is just an OpenAI-compatible endpoint, so the `embedding.modal: {
67
+ baseUrl, workspace, apiToken, readToken, writeToken, model, dim,
68
+ fallback, sync }` wrapper is gone. All fields are now top-level on
69
+ `EmbeddingConfig` itself: `workspace`, `remoteApiKey`,
70
+ `remoteReadApiKey`, `remoteWriteApiKey`, `model`, `dim`, `fallback`
71
+ (now a simplified `{ enabled?: boolean }` — the `provider`
72
+ discriminator was already removed in 0.16.1+), and `sync`. **`apiKey`
73
+ is now explicitly the local-Ollama bearer** (defaults to `"ollama"`
74
+ in `OpenAICompatibleProvider`); the remote-endpoint token is
75
+ `remoteApiKey` so a single config can carry distinct local-vs-remote
76
+ credentials. The Modal-only blocks that remain as their own
77
+ inline objects are `sync` (pull-down watermark behavior) and
78
+ `fallback` (offline degrade policy). The `MODAL_APP_NAME` URL
79
+ helper stays in `src/modal-config.ts` (`modalUrl(workspace)`); the
80
+ Obsidian plugin keeps a small local mirror because it can't import
81
+ from the extension at runtime. `isModal()` is now simply
82
+ `!!cfg.embedding.remoteUrl`. The Obsidian plugin's
83
+ `provider: "ollama" | "modal" | "skip"` UI discriminator was renamed
84
+ to `"local" | "remote" | "skip"` (display labels stay user-friendly).
85
+ On save, the Modal wizard removes the old `embedding.modal` block
86
+ so existing configs upgrade cleanly on next `/vm setup`. The index
87
+ doc `vault-mind-config-index.md` §2.4 is updated; the per-setting
88
+ plan `vault-mind-config-plugin-surface.md` is reconciled.
89
+
90
+ ### Removed
91
+
92
+ - **`ModalEmbeddingConfig` and `ModalFallbackConfig` types removed
93
+ from `src/types.ts`.** Fields are inlined on `EmbeddingConfig` (see
94
+ above). `FallbackConfig` (`{ enabled?: boolean }`) is the new
95
+ simplified fallback shape; `ModalSyncConfig` is unchanged.
96
+
97
+ ### Tests
98
+
99
+ - 268 tests pass (no change in count — the migration was mechanical).
100
+ Three test files migrated from `modal: { ... }` fixtures to the
101
+ flat shape: `test/auth.test.ts`, `test/lance-modal.test.ts`,
102
+ `test/modal-config.test.ts`. The `ModalFallbackConfig["provider"]`
103
+ type-level regression test was removed (the type no longer exists).
104
+ One collateral fixture in `test/sync.test.ts`. One collateral
105
+ fixture in `test/vault-tools.test.ts` (the `writeConfig` helper
106
+ needed `model: "testmodel"` added so `resolveModel` returns the
107
+ right value for the test's `searchFts` assertion). The provider-cache
108
+ leak in `src/lance.ts`'s `resetConnection()` was fixed (the cache
109
+ was module-level and survived across tests).
110
+
111
+
112
+ ## 0.16.1 — 2026-07-07
113
+
114
+ ### Added
115
+
116
+ - **`src/embedding-providers.ts`** — new store-agnostic `EmbeddingProvider`
117
+ interface (`embed` / `dim` / `init`) and the three concrete providers
118
+ (`OpenAICompatibleProvider`, `TransformersProvider`, `ModalProvider`)
119
+ plus a `createProvider(cfg)` factory. The vector-store layer
120
+ (`src/lance.ts`) now consumes providers through a 35-line
121
+ `LanceEmbeddingAdapter` that wraps them into LanceDB's
122
+ `TextEmbeddingFunction`. **Adding a new vector store (Qdrant, Pinecone,
123
+ pgvector, …) means writing a new adapter; adding a new embedding
124
+ provider means implementing the interface.** No downstream code (lance,
125
+ coalescer, plugin) needs to change for either.
126
+ - **`/vm remote config fallback`** accepts `"ollama"` as a friendlier
127
+ alias for `"openai-compatible"` (rewritten to the enum value before
128
+ write). Help text and error messages updated.
129
+
130
+ ### Removed
131
+
132
+ - **`ModalFallbackConfig.provider` enum reduced to `"openai-compatible"`.**
133
+ The legacy `"transformers"` value was dead code (no runtime path
134
+ selected it). The offline transformers path lives separately under
135
+ `EmbeddingConfig.useTransformers`. `/vm remote config fallback` parser
136
+ no longer accepts `"transformers"`. Type-level regression test
137
+ prevents the dead value from being added back.
138
+
139
+ ### Fixed
140
+
141
+ - **`LanceEmbeddingFunction` now defaults `apiKey` to `"ollama"`** for
142
+ local endpoints, matching `AgentModelProvider`'s behavior and the
143
+ JSDoc contract. The previous `string | undefined` field would have
144
+ sent `Authorization: Bearer undefined` for any vault without an
145
+ explicit `apiKey`; Ollama happened to ignore the malformed header,
146
+ but stricter `/v1/embeddings`-compatible servers would have rejected
147
+ it. Pass `apiKey: null` to opt out (some local servers reject
148
+ `Bearer ollama` as invalid auth).
149
+ - **`IdentityConfig.role` made optional.** It was required at the type
150
+ level but `mergeIdentityProfiles` always pulls `role` (and `id`) from
151
+ the base — config cannot rename an agent. Required type was dead.
152
+ - **Index doc §2.6 `vaultMind.identities` reframed as "wired but
153
+ unenforced"** — the block is read at engine start
154
+ (`engine.ts:124-137` calls `mergeIdentityProfiles` and
155
+ `bridge.ts:100` registers the merged identity), but the registered
156
+ identity is never read back (`getAgentIdentity` in `bridge.ts:117`
157
+ has no callers). The block stays typed; future runtime enforcement
158
+ reuses it. New regression test in `test/bridge-identity.test.ts`
159
+ pins the merge contract (layer values override, empty array is
160
+ explicit deny, role/id always from base, undefined layer is a no-op).
161
+ - **Config example drift closed.** `pi-vault-mind.config.example.json`
162
+ now shows the scaffolded `draft-context` injector instead of an
163
+ empty array — matches the live `src/scaffold.ts` output so a user
164
+ hand-rolling a config from the example doesn't silently miss a
165
+ built-in.
166
+
167
+ ## 0.16.0 — 2026-07-06
168
+
169
+ ### Added
170
+
171
+ - **New `src/scaffold.ts`** — the single, UI-agnostic implementation of vault
172
+ config scaffolding (default collections/injectors, `.gitignore`), shared
173
+ by the CLI `/vm setup` command, the HTTP `POST /vm/setup` route, and any
174
+ future consumer. Robust to caller order: seeds default collections/
175
+ injectors whenever they're empty, not only when the config file is brand
176
+ new, so no future caller can silently end up with `"collections": {}`
177
+ again by writing embedding/vault fields before calling it.
178
+
179
+ ### Removed
180
+
181
+ - **Legacy config/token migration dropped entirely.** `migrateLegacyState()`
182
+ and the `CONFIG_FILES` legacy-filename list are gone; pi-vault-mind no
183
+ longer rescues config/token from a vault-root `pi-vault-mind.config.json`,
184
+ `.pi/vault-mind.config.json`, or the global `~/.pi/agent/`. `.vault-mind/`
185
+ is now the only place pi-vault-mind ever reads its own config/token from —
186
+ no backward-compat fallback path.
187
+ - **`/vm init` removed as a standalone command.** It only ever duplicated
188
+ part of `/vm setup`'s work with a deprecation notice; fully consolidated
189
+ onto `/vm setup`, which now also accepts `--collection <name>` (previously
190
+ only available via `/vm init --collection`). Every "Run /vm init first"
191
+ message across `commands.ts`, `settings-ui.ts`, `tools.ts`,
192
+ `vm-handlers.ts`, and `tools/marksman.ts` now says `/vm setup`.
193
+ - **`POST /vm/init` removed from the HTTP API.** It duplicated a third copy
194
+ of the collections/injectors scaffold template (alongside the CLI's and
195
+ the Obsidian plugin's own copies). `POST /vm/setup` now calls the same
196
+ shared `scaffoldVaultConfig()` after writing embedding/vault fields, so it
197
+ does everything `/vm/init` did plus its own job, and its response now
198
+ includes `created`/`updated`/`skipped`/`collectionName`. The Obsidian
199
+ plugin's `VaultMindClient.init()` (only caller: the chat composer's
200
+ `/reindex` command) is removed too — it now calls `client.setup({})`
201
+ directly, since the reindex flow never used `init()`'s return value.
202
+
203
+ ### Fixed
204
+
205
+ - **`/vm setup` never actually scaffolded default collections.** `handleInit`
206
+ (the scaffold logic) only populates the default `main`/`pending`/
207
+ `context_events` collections and the `draft-context` injector when the
208
+ config file doesn't exist yet — but `setupWizard` always wrote the config
209
+ file *first*, so `handleInit` permanently saw an existing file and took its
210
+ merge-safe (no-op-for-collections) branch instead. Every `/vm setup` run,
211
+ CLI or interactive, ended with `"collections": {}`. Reordered so
212
+ `handleInit` runs before `setupWizard`; verified end-to-end (fresh vault →
213
+ `/vm setup` → all three default collections + injector scaffolded with the
214
+ vault-derived file name, confirmed via direct JSONL read-back).
215
+ - **`loadConfig` returned duplicate injector entries, causing them to fire
216
+ twice.** `mergeConfigLayer` concatenated `DEFAULT_CONFIG.injectors` with
217
+ the vault's own config-file injectors with zero deduplication. Since every
218
+ vault's config now always has its own `draft-context` injector (scaffolded
219
+ by `/vm setup`), `loadConfig()` returned it twice — and `events.ts`
220
+ processes every injector's regex match independently, so a matching note
221
+ would trigger the injector's capture/artifact-sync logic twice per prompt.
222
+ Fixed by deduplicating by `name` in the merge (layer's entry wins on a
223
+ collision), mirroring the existing dedupe pattern in `auditConfig`.
224
+ Verified via `loadConfig` on a freshly-scaffolded vault: exactly one
225
+ `draft-context` injector, not two.
226
+
227
+ ## 0.15.0 / 0.6.4 — 2026-07-06
228
+
229
+ ### Added
230
+
231
+ - **`/vm setup` now scaffolds `.vault-mind/.pi/model-router.json`** with tuned
232
+ primary/fallback model defaults, extracted verbatim from the Obsidian
233
+ plugin's `scaffoldModelRouterConfig`/`defaultModelRouterChoices` into a new
234
+ `src/model-router.ts` — previously only the plugin's init flow produced
235
+ this file, so a CLI-only setup got no model-router config at all.
236
+ - **`scripts/setup-vault-pi.sh` now installs `pi-model-discovery` and
237
+ `pi-model-router`** alongside `pi-vault-mind`/`pi-context`, matching the
238
+ plugin's install list (previously missing both, so a CLI-only setup never
239
+ got model discovery or routing installed).
240
+
241
+ ### Changed
242
+
243
+ - **Vault isolation** — all pi-vault-mind config, token, and written artifacts now live under `<vault>/.vault-mind/`. The global `~/.pi/agent/vault-mind.config.json` layer is dropped; config is single-layer, vault-local. Legacy config/token is auto-migrated on first session_start (idempotent).
244
+ - **Config consolidation** — `loadConfig` reads only `<vault>/.vault-mind/vault-mind.config.json`; `findConfig` returns a single project path. `getGlobalConfigPath`/`getGlobalConfigDir` removed.
245
+ - **Token env** — `PVM_API_TOKEN` dotenv file moved from `~/.pi/agent/vault-mind.env` to `<vault>/.vault-mind/vault-mind.env`. `auth.ts`, `modal-config.ts`, `commands.ts`, and `settings-ui.ts` all resolve via `getTokenEnvPath(cwd)`.
246
+ - **Framework agent dir** — launch scripts now use `<vault>/.vault-mind/.pi/agent` (relocated from `<vault>/.pi/agent`). `resolveAgentDir(cwd)` honors `PI_CODING_AGENT_DIR` via the SDK.
247
+ - **ACM gate** — auto-ACM now fires only when `isVaultMindReady` is true (config exists + embedding configured), not on any vault with a global config.
248
+ - **Configurable file paths** — `graph.canvasPath`, `files.queue`, `files.serverState`, `files.manualDispatch` in config; `resolveVaultFile` resolves them with defaults under `.vault-mind/`.
249
+ - **Per-vault Modal collection prefix** — `vaults.default.collectionPrefix` (auto-derived from vault slug) isolates server-side Modal tables across vaults sharing a deployment. Local LanceDB tables stay unprefixed.
250
+ - **`/vm setup` consolidation** — now runs `migrateLegacyState` → `setupWizard` → merge-safe scaffold → optional `runPersonalize`. `/vm init` is deprecated (still works, shows notice).
251
+ - **`/vm doctor`** — new command reporting resolved paths, readiness, token source, model-router status, and PASS/WARN for vault isolation.
252
+ - **`GET /vault-mind/paths`** — new auth-gated HTTP endpoint returning absolute + vault-relative paths with `exists` flags.
253
+ - **gitignore** — `.vault-mind/*` + `!.vault-mind/vault-mind.config.json` keeps the hand-tuned config tracked while ignoring local state.
254
+
255
+ ### Fixed
256
+
257
+ - **Config write-target bugs** — `vm_configure`, `discover_schema`, and the
258
+ `POST /vm/init` HTTP handler's scaffold-if-missing path all still wrote to
259
+ the vault-root `pi-vault-mind.config.json` (a path `loadConfig` no longer
260
+ reads) instead of `.vault-mind/vault-mind.config.json`. Fixed to use
261
+ `getConfigPath(cwd)` uniformly.
262
+ - **Stale user/dev-facing config paths** — the "no vaults configured" notify
263
+ string (`commands.ts`), the `discover_schema` tool's prompt guidelines, and
264
+ a `server.ts` doc-comment all still told the reader to edit the retired
265
+ `pi-vault-mind.config.json` instead of `.vault-mind/vault-mind.config.json`.
266
+ - **`/vm setup` CLI-mode arg parsing** — when `--vault` was the first flag
267
+ (exactly the form documented in `CLI_ONLY_WALKTHROUGH.md`), its leading
268
+ `--` was never stripped by the tokenizer, so `cliArgs.vault` was silently
269
+ never set and `vaults.default.path` was left empty. Fixed the split to
270
+ normalize the leading `--` before tokenizing.
271
+
272
+ ### Removed
273
+
274
+ - Dead `events.ts` hidden `/acm` sendMessage path (never enabled compaction).
275
+ - `handleVaultMindConfig` HTTP response no longer splits `.global`/`.project` (single `config` key).
276
+
277
+ ### Plugin (`packages/obsidian/`)
278
+
279
+ - **Isolation parity with the extension** — `resolvePluginAgentDir(vaultPath)`
280
+ now resolves `<vault>/.vault-mind/.pi/agent`, threaded through `main.ts`
281
+ (init flow, config paths, hasExtensions checks, token/1Password flow),
282
+ `model-router-config.ts` (models.json + model-router.json paths),
283
+ `pi-config-reader.ts`, `chat-tab.ts`, `status-tab.ts`, and `panel.ts`.
284
+ - **`.vault-mind/vault-mind.config.json`** — `config.ts`'s `readExtensionConfig`
285
+ now reads the single vault-scoped config (previously read the removed
286
+ global `~/.pi/agent/vault-mind.config.json` + vault-root
287
+ `pi-vault-mind.config.json`).
288
+ - **`.env.1pass` relocated to `.vault-mind/.env.1pass`**, with `--op-env`
289
+ wired into every pi launch site (`PiConnection` in `chat-tab.ts`, the TUI
290
+ launcher in `status-tab.ts`, and `scripts/vault-pi.sh`/`setup-vault-pi.sh`) —
291
+ gated on the file existing AND `pi-1password` being installed, since
292
+ `--op-env` is a flag `pi-1password` registers; passing it unconditionally
293
+ would make `pi` reject the whole invocation with "Unknown option" when the
294
+ extension isn't installed.
295
+
3
296
  ## 0.5.1 — 2026-06-28
4
297
 
5
298
  ### Fixed
package/README.md CHANGED
@@ -260,9 +260,9 @@ Edit `pi-vault-mind.config.json` to match your domain:
260
260
  "vaultMind": {
261
261
  "dataDir": ".lancedb",
262
262
  "embedding": {
263
- "provider": "transformers",
264
- "ollamaModel": "embeddinggemma",
265
- "ollamaHost": "http://127.0.0.1:11434"
263
+ "remoteUrl": "http://127.0.0.1:11434",
264
+ "model": "embeddinggemma",
265
+ "dim": 768
266
266
  },
267
267
  "ftsEnabled": true,
268
268
  "graph": { "enabled": true, "canvasSync": false }
@@ -347,7 +347,6 @@ Edit `pi-vault-mind.config.json` to match your domain:
347
347
  | ------------------------------ | -------------------------------------------------------- |
348
348
  | `/vm help` | Show usage help |
349
349
  | `/vm setup` | **Interactive global config wizard** (vault, embedding) |
350
- | `/vm init` | Scaffold project config + collections |
351
350
  | `/vm validate` | Health check LanceDB, config, and all collection paths |
352
351
  | `/vm approve [collection]` | Batch-review pending entries |
353
352
  | `/vm settings` | Open interactive settings dashboard |
@@ -358,7 +357,7 @@ Edit `pi-vault-mind.config.json` to match your domain:
358
357
  | `/vm injector create` | Interactive wizard to create a new injector |
359
358
  | `/vm context enable \| disable \| status` | Manage pi-context integration |
360
359
  | `/vm embedding status \| use \| model \| models \| pull` | Manage embedding provider |
361
- | `/vm modal status \| config \| sync \| jobs \| migrate` | Manage Modal embedding + vector sync |
360
+ | `/vm remote status \| config \| sync \| jobs \| migrate` | Manage remote embedding + vector sync |
362
361
  | `/vm watcher start \| stop \| status` | Manage the passive file watcher |
363
362
  | `/vm server status` | Show HTTP server status, port, and uptime |
364
363
 
@@ -375,6 +374,7 @@ Edit `pi-vault-mind.config.json` to match your domain:
375
374
  | [docs/getting-started/NEW_VAULT_WALKTHROUGH.md](docs/getting-started/NEW_VAULT_WALKTHROUGH.md) | **Fresh Mac → new vault → Modal → sync → verified**, one linear path (incl. multi-vault storage isolation) |
376
375
  | [docs/getting-started/INSTALL.md](docs/getting-started/INSTALL.md) | **Canonical install playbook** — all 5 layers (pi ext, skills, Obsidian, config, external CLIs) |
377
376
  | [docs/getting-started/GETTING_STARTED.md](docs/getting-started/GETTING_STARTED.md) | End-to-end workflow + daily "drop & forget" usage |
377
+ | [docs/getting-started/CLI_ONLY_WALKTHROUGH.md](docs/getting-started/CLI_ONLY_WALKTHROUGH.md) | Same setup + daily commands, entirely CLI — no Obsidian plugin required |
378
378
  | [docs/getting-started/WALKTHROUGH_PROMPT.md](docs/getting-started/WALKTHROUGH_PROMPT.md) | Paste-into-pi guided setup with checkpoints between phases |
379
379
 
380
380
  ### Architecture & design
@@ -2,7 +2,7 @@
2
2
  type: BroadcasterAgent
3
3
  role: broadcaster
4
4
  capabilities: [read, write, edit]
5
- allowed_tools: [read, write, edit, vm_search, vm_fts_search]
5
+ allowed_tools: [read, write, edit, vm_search]
6
6
  write_collections: []
7
7
  can_publish: false
8
8
  llm_provider: ollama
@@ -16,7 +16,7 @@ and external-facing content from vault knowledge.
16
16
  ## Capability Boundary
17
17
 
18
18
  - **MAY**: read files, write files, edit files
19
- - **MAY**: search collections via vm_search, vm_fts_search
19
+ - **MAY**: search collections via vm_search
20
20
  - **MUST NOT**: run bash commands, grep, or find
21
21
  - **MUST NOT**: write to the durable knowledge store
22
22
  - **MUST NOT**: publish or spawn sub-agents
@@ -2,7 +2,7 @@
2
2
  type: HeavyLifterAgent
3
3
  role: heavy-lifter
4
4
  capabilities: [read, write, edit, grep, find, ls, bash]
5
- allowed_tools: [read, write, edit, grep, find, ls, bash, vm_search, vm_fts_search]
5
+ allowed_tools: [read, write, edit, grep, find, ls, bash, vm_search]
6
6
  write_collections: []
7
7
  can_publish: false
8
8
  llm_provider: ollama
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: ManagerAgent
3
+ role: main
4
+ capabilities: [read, write, edit, bash, grep, find, ls]
5
+ allowed_tools: [read, write, edit, bash, grep, find, ls, vm_search, vm_query, vm_append, vm_stats, vm_status, vm_describe, vm_configure]
6
+ write_collections: []
7
+ can_publish: false
8
+ llm_provider: ollama
9
+ ---
10
+
11
+ # Main Agent
12
+
13
+ Primary interactive agent for pi-vault-mind. The default role used by the
14
+ Obsidian plugin's chat interface and the CLI `/vm chat` command.
15
+
16
+ ## Capability Boundary
17
+
18
+ - **MAY**: all 7 built-in tools (read, write, edit, bash, grep, find, ls)
19
+ - **MAY**: vm_search, vm_query (read paths)
20
+ - **MAY**: vm_append, vm_stats, vm_status, vm_describe, vm_configure (write/config paths)
21
+ - **MAY**: read from the "main" collection
22
+ - **MUST NOT**: write to collections, publish, or access arbitrary vault paths
23
+
24
+ ## Tool Calling Convention
25
+
26
+ When calling pi-vault-mind tools, always include your role:
27
+ ```
28
+ vm_search({ query: "...", role: "main" })
29
+ ```
@@ -2,7 +2,7 @@
2
2
  type: ManagerAgent
3
3
  role: manager
4
4
  capabilities: [read, write, edit, grep, find, ls]
5
- allowed_tools: [read, write, edit, grep, find, ls, vm_search, vm_fts_search, vm_append, vm_sync, vm_promote, vm_query, vm_configure, vm_describe, vm_stats, vm_export, vm_ingest, vm_status, vm_graph_query]
5
+ allowed_tools: [read, write, edit, grep, find, ls, vm_search, vm_append, vm_sync, vm_promote, vm_query, vm_configure, vm_describe, vm_stats, vm_export, vm_ingest, vm_status]
6
6
  write_collections: [main, research, presentations]
7
7
  can_publish: true
8
8
  llm_provider: ollama
@@ -2,7 +2,7 @@
2
2
  type: MinerAgent
3
3
  role: miner
4
4
  capabilities: [read, write, edit, grep, find, ls]
5
- allowed_tools: [read, write, edit, grep, find, ls, vm_search, vm_fts_search, vm_append]
5
+ allowed_tools: [read, write, edit, grep, find, ls, vm_search, vm_append]
6
6
  write_collections: [main, research]
7
7
  can_publish: false
8
8
  llm_provider: ollama