Conversation
Remove vault-resolve.ts and use napkin-ai's findVault() directly, which now supports $XDG_CONFIG_HOME/napkin/config.json as a global vault config fallback. This eliminates duplicated vault resolution logic and ensures consistent behavior between the napkin CLI and pi-napkin extensions. - Delete extensions/vault-resolve.ts - napkin-context: use new Napkin(cwd) directly - distill: use new Napkin(cwd).vault.configPath for config access Requires napkin-ai >= 0.9.0 (with global config support).
- Update vault resolution section to reflect napkin-ai's native support - Add migration guide from ~/.pi/agent/napkin.json to ~/.config/napkin/config.json
cad0p
force-pushed
the
feat/use-napkin-global-config
branch
from
May 3, 2026 23:10
b48a8f8 to
3bcd701
Compare
cad0p
marked this pull request as ready for review
May 4, 2026 00:19
There was a problem hiding this comment.
Pull request overview
This PR removes pi-napkin’s custom vault resolution logic and switches both extensions to rely on napkin-ai’s built-in vault discovery (including global config fallback), updating documentation accordingly.
Changes:
- Deleted the custom
extensions/vault-resolve.tswalk-up +~/.pi/agent/napkin.jsonfallback logic. - Updated
napkin-contextanddistillto constructNapkindirectly fromcwdand reference vault config vian.vault.configPath. - Updated README vault resolution docs and added a migration guide to
$XDG_CONFIG_HOME/napkin/config.json.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
extensions/vault-resolve.ts |
Removed duplicated vault resolution logic in favor of napkin-ai’s native behavior. |
extensions/napkin-context/index.ts |
Switched to new Napkin(cwd) and attempted to use n.vault.configPath for config/status behavior. |
extensions/distill/index.ts |
Switched to Napkin-derived vault config path rather than local resolver. |
README.md |
Updated vault resolution order and added migration steps for the new global config path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| const { showStatus, distill: config } = loadVaultConfig(vaultPath); | ||
| const { showStatus, distill: config } = loadVaultConfig(vaultConfigPath); |
| } | ||
|
|
||
| if (ctx.hasUI && loadShowStatus(vaultPath)) { | ||
| if (ctx.hasUI && loadShowStatus(n.vault.configPath)) { |
| } | ||
|
|
||
| const { showStatus, distill: config } = loadVaultConfig(vaultPath); | ||
| const { showStatus, distill: config } = loadVaultConfig(vaultConfigPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove
vault-resolve.tsand use napkin-ai built-in vault resolution directly, which now supports$XDG_CONFIG_HOME/napkin/config.jsonas a global vault config fallback.Motivation
pi-napkin currently has its own vault-resolve.ts that duplicates napkin walk-up logic and adds a
~/.pi/agent/napkin.jsonfallback. With napkin#15, napkin-ai natively supports global config, so this duplication can be eliminated.Changes
extensions/vault-resolve.ts— no longer neededfindVaultPathimport, simplifygetNapkin()toreturn new Napkin(cwd), usen.vault.configPathfor config accessfindVaultPathimport, usenew Napkin(ctx.cwd).vault.configPathfor config access~/.pi/agent/napkin.jsonMigration
If you previously configured your vault in
~/.pi/agent/napkin.json, move it to:Companion PRs
Behavioral note
The old code returned null and bailed when no vault was found. The new code uses napkin
findVault()which creates a bare vault as a last resort. This is consistent with napkin behavior — distill defaults toenabled: false, so no unwanted distillation will run. The bare vault only contains an empty NAPKIN.md.