wayfind 2.0.77 → 2.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/team-context.js
CHANGED
|
@@ -2897,6 +2897,51 @@ function extractStandupSection(lines, headers) {
|
|
|
2897
2897
|
|
|
2898
2898
|
// ── Update command ─────────────────────────────────────────────────────────
|
|
2899
2899
|
|
|
2900
|
+
/**
|
|
2901
|
+
* Ensure ~/.claude/settings.json contains Write allowlist entries for Wayfind
|
|
2902
|
+
* state files (journals, team-state, personal-state). Without these, plan mode
|
|
2903
|
+
* prompts for every state write, which is disruptive and confusing.
|
|
2904
|
+
* Idempotent — skips entries already present.
|
|
2905
|
+
* @returns {string[]} entries that were added (empty if nothing changed)
|
|
2906
|
+
*/
|
|
2907
|
+
function ensureStateWritePermissions() {
|
|
2908
|
+
if (!HOME) return [];
|
|
2909
|
+
const settingsPath = path.join(HOME, '.claude', 'settings.json');
|
|
2910
|
+
|
|
2911
|
+
// Each path is listed twice: once as absolute (for tools that resolve paths)
|
|
2912
|
+
// and once as the literal form Claude Code may pass (tilde or relative).
|
|
2913
|
+
// Permission matching is against the literal file_path argument, not the
|
|
2914
|
+
// resolved path, so both forms are needed.
|
|
2915
|
+
const required = [
|
|
2916
|
+
`Write(${HOME}/.claude/memory/**)`,
|
|
2917
|
+
`Write(~/.claude/memory/**)`,
|
|
2918
|
+
`Write(${HOME}/.claude/global-state.md)`,
|
|
2919
|
+
`Write(~/.claude/global-state.md)`,
|
|
2920
|
+
`Write(${HOME}/.claude/state.md)`,
|
|
2921
|
+
`Write(~/.claude/state.md)`,
|
|
2922
|
+
`Write(${HOME}/**/.claude/team-state.md)`,
|
|
2923
|
+
`Write(.claude/team-state.md)`,
|
|
2924
|
+
`Write(${HOME}/**/.claude/personal-state.md)`,
|
|
2925
|
+
`Write(.claude/personal-state.md)`,
|
|
2926
|
+
];
|
|
2927
|
+
|
|
2928
|
+
let settings = {};
|
|
2929
|
+
if (fs.existsSync(settingsPath)) {
|
|
2930
|
+
try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch { return []; }
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
if (!settings.permissions) settings.permissions = {};
|
|
2934
|
+
if (!Array.isArray(settings.permissions.allow)) settings.permissions.allow = [];
|
|
2935
|
+
|
|
2936
|
+
const existing = new Set(settings.permissions.allow);
|
|
2937
|
+
const added = required.filter(r => !existing.has(r));
|
|
2938
|
+
if (added.length === 0) return [];
|
|
2939
|
+
|
|
2940
|
+
settings.permissions.allow.push(...added);
|
|
2941
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
2942
|
+
return added;
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2900
2945
|
/**
|
|
2901
2946
|
* Re-sync hooks and commands from the installed Wayfind package to ~/.claude/.
|
|
2902
2947
|
* Copies hook scripts and slash-command files, overwriting stale copies.
|
|
@@ -2972,6 +3017,15 @@ function runUpdate() {
|
|
|
2972
3017
|
} else {
|
|
2973
3018
|
console.log(' Everything up to date.');
|
|
2974
3019
|
}
|
|
3020
|
+
|
|
3021
|
+
// Ensure state-file Write permissions are allowlisted so plan mode doesn't
|
|
3022
|
+
// prompt on every journal/state write.
|
|
3023
|
+
const addedPerms = ensureStateWritePermissions();
|
|
3024
|
+
if (addedPerms.length > 0) {
|
|
3025
|
+
console.log('\n── Write permissions ──');
|
|
3026
|
+
for (const p of addedPerms) console.log(` ✓ Allowlisted: ${p}`);
|
|
3027
|
+
console.log(' (Prevents plan-mode prompts on journal and state-file writes)');
|
|
3028
|
+
}
|
|
2975
3029
|
}
|
|
2976
3030
|
|
|
2977
3031
|
// ── Migrate to plugin ───────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -146,6 +146,33 @@ Read the repo's `CLAUDE.md`. If it does NOT already contain "Session State Proto
|
|
|
146
146
|
|
|
147
147
|
If `CLAUDE.md` doesn't exist, create a minimal one with the repo name as a heading and the block above.
|
|
148
148
|
|
|
149
|
+
## Step 4.5: Patch Write Permissions in ~/.claude/settings.json
|
|
150
|
+
|
|
151
|
+
Read `~/.claude/settings.json` (create it as `{}` if missing).
|
|
152
|
+
|
|
153
|
+
Ensure the following entries are present in `permissions.allow`. Add any that are missing — do NOT remove existing entries.
|
|
154
|
+
|
|
155
|
+
Each path needs two forms: absolute (for tools that resolve paths before the permission check) and literal (tilde or relative, for tools that pass the path as-is). Both are required — Claude Code matches against the literal `file_path` argument, not the resolved path.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
Write(<HOME>/.claude/memory/**)
|
|
159
|
+
Write(~/.claude/memory/**)
|
|
160
|
+
Write(<HOME>/.claude/global-state.md)
|
|
161
|
+
Write(~/.claude/global-state.md)
|
|
162
|
+
Write(<HOME>/.claude/state.md)
|
|
163
|
+
Write(~/.claude/state.md)
|
|
164
|
+
Write(<HOME>/**/.claude/team-state.md)
|
|
165
|
+
Write(.claude/team-state.md)
|
|
166
|
+
Write(<HOME>/**/.claude/personal-state.md)
|
|
167
|
+
Write(.claude/personal-state.md)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Where `<HOME>` is the user's actual home directory (e.g. `/home/greg` or `/Users/greg`).
|
|
171
|
+
|
|
172
|
+
**Why:** Without these, Claude Code's plan mode prompts for approval on every journal and state-file write — even when the user is in bypass/dangerously-skip-permissions mode. These files are internal Wayfind state and are never dangerous to write.
|
|
173
|
+
|
|
174
|
+
Report: "Write permissions patched — N entries added" (or "already present" if nothing changed).
|
|
175
|
+
|
|
149
176
|
## Step 5: Register State Files in Global Index
|
|
150
177
|
|
|
151
178
|
Read `~/.claude/global-state.md`. The Active Projects table is auto-generated by `wayfind status --write` — do NOT add rows to it manually.
|