wayfind 2.0.77 → 2.0.78
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,42 @@ 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
|
+
const required = [
|
|
2912
|
+
`Write(${HOME}/.claude/memory/**)`,
|
|
2913
|
+
`Write(${HOME}/.claude/global-state.md)`,
|
|
2914
|
+
`Write(${HOME}/.claude/state.md)`,
|
|
2915
|
+
`Write(${HOME}/**/.claude/team-state.md)`,
|
|
2916
|
+
`Write(${HOME}/**/.claude/personal-state.md)`,
|
|
2917
|
+
];
|
|
2918
|
+
|
|
2919
|
+
let settings = {};
|
|
2920
|
+
if (fs.existsSync(settingsPath)) {
|
|
2921
|
+
try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch { return []; }
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
if (!settings.permissions) settings.permissions = {};
|
|
2925
|
+
if (!Array.isArray(settings.permissions.allow)) settings.permissions.allow = [];
|
|
2926
|
+
|
|
2927
|
+
const existing = new Set(settings.permissions.allow);
|
|
2928
|
+
const added = required.filter(r => !existing.has(r));
|
|
2929
|
+
if (added.length === 0) return [];
|
|
2930
|
+
|
|
2931
|
+
settings.permissions.allow.push(...added);
|
|
2932
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
2933
|
+
return added;
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2900
2936
|
/**
|
|
2901
2937
|
* Re-sync hooks and commands from the installed Wayfind package to ~/.claude/.
|
|
2902
2938
|
* Copies hook scripts and slash-command files, overwriting stale copies.
|
|
@@ -2972,6 +3008,15 @@ function runUpdate() {
|
|
|
2972
3008
|
} else {
|
|
2973
3009
|
console.log(' Everything up to date.');
|
|
2974
3010
|
}
|
|
3011
|
+
|
|
3012
|
+
// Ensure state-file Write permissions are allowlisted so plan mode doesn't
|
|
3013
|
+
// prompt on every journal/state write.
|
|
3014
|
+
const addedPerms = ensureStateWritePermissions();
|
|
3015
|
+
if (addedPerms.length > 0) {
|
|
3016
|
+
console.log('\n── Write permissions ──');
|
|
3017
|
+
for (const p of addedPerms) console.log(` ✓ Allowlisted: ${p}`);
|
|
3018
|
+
console.log(' (Prevents plan-mode prompts on journal and state-file writes)');
|
|
3019
|
+
}
|
|
2975
3020
|
}
|
|
2976
3021
|
|
|
2977
3022
|
// ── Migrate to plugin ───────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -146,6 +146,26 @@ 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
|
+
```
|
|
156
|
+
Write(<HOME>/.claude/memory/**)
|
|
157
|
+
Write(<HOME>/.claude/global-state.md)
|
|
158
|
+
Write(<HOME>/.claude/state.md)
|
|
159
|
+
Write(<HOME>/**/.claude/team-state.md)
|
|
160
|
+
Write(<HOME>/**/.claude/personal-state.md)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Where `<HOME>` is the user's actual home directory (e.g. `/home/greg` or `/Users/greg`).
|
|
164
|
+
|
|
165
|
+
**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.
|
|
166
|
+
|
|
167
|
+
Report: "Write permissions patched — N entries added" (or "already present" if nothing changed).
|
|
168
|
+
|
|
149
169
|
## Step 5: Register State Files in Global Index
|
|
150
170
|
|
|
151
171
|
Read `~/.claude/global-state.md`. The Active Projects table is auto-generated by `wayfind status --write` — do NOT add rows to it manually.
|