phewsh 0.15.43 → 0.15.45

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.
@@ -112,9 +112,24 @@ async function main() {
112
112
  if (code === 0) {
113
113
  console.log(` ${green('✓')} Updated to v${latest}. New shells pick it up immediately.`);
114
114
  } else {
115
- console.log(` ${yellow('Update failed')} (npm exited ${code}).`);
116
- console.log(` ${g('If it was a permissions error, fix your npm prefix or run:')}`);
117
- console.log(` ${w(`sudo npm install -g ${pkg.name}@latest`)}`);
115
+ // NEVER suggest `sudo npm i -g` — that root-owns the package dir and
116
+ // poisons every future non-sudo update (the exact trap users hit). The
117
+ // correct fix is to OWN the package, once, then update normally.
118
+ let prefix = '';
119
+ try {
120
+ prefix = require('child_process').execFileSync('npm', ['config', 'get', 'prefix'],
121
+ { encoding: 'utf-8', timeout: 3000 }).trim();
122
+ } catch { /* unknown prefix */ }
123
+ const pkgDir = prefix ? `${prefix}/lib/node_modules/${pkg.name}` : `$(npm prefix -g)/lib/node_modules/${pkg.name}`;
124
+ const binLink = prefix ? `${prefix}/bin/${pkg.name}` : `$(npm prefix -g)/bin/${pkg.name}`;
125
+ console.log(` ${yellow('Update failed')} (npm exited ${code}) — almost certainly a permissions issue.`);
126
+ console.log(` ${g('The phewsh package is probably root-owned from a past `sudo` install.')}`);
127
+ console.log(` ${b('Own it once, then updates never need sudo again:')}`);
128
+ console.log(` ${w(`sudo chown -R $(whoami) "${pkgDir}"`)}`);
129
+ console.log(` ${w(`sudo chown -h $(whoami) "${binLink}"`)}`);
130
+ console.log(` ${w(`phewsh update`)}`);
131
+ console.log(` ${g('Or reinstall with the installer (handles this for you):')} ${w('curl -fsSL phewsh.com/install.sh | sh')}`);
132
+ console.log(` ${g('Do NOT run `sudo npm i -g` — that is what caused this.')}`);
118
133
  }
119
134
  console.log('');
120
135
  process.exit(code ?? 0);
@@ -28,10 +28,14 @@ If there is no \`.intent/\` directory here, say so and tell me I can create one
28
28
 
29
29
  // Tools that support file-based custom slash commands, and how each wants them.
30
30
  // parentDir must already exist (the tool is installed) before we write.
31
+ //
32
+ // Claude Code is deliberately EXCLUDED: it already ships a phewsh `/intent`
33
+ // SKILL (the artifact generator) and gets the SessionStart hook brief, so a
34
+ // global `/intent` command here just collides with the canonical one (two
35
+ // `/intent` entries). We add `/intent` only where it's genuinely absent.
31
36
  const SLASH_TARGETS = [
32
- { id: 'claude-code', parent: '.claude', sub: 'commands', file: 'intent.md', fmt: 'claude' },
33
- { id: 'codex', parent: '.codex', sub: 'prompts', file: 'intent.md', fmt: 'codex' },
34
- { id: 'gemini', parent: '.gemini', sub: 'commands', file: 'intent.toml', fmt: 'gemini' },
37
+ { id: 'codex', parent: '.codex', sub: 'prompts', file: 'intent.md', fmt: 'codex' },
38
+ { id: 'gemini', parent: '.gemini', sub: 'commands', file: 'intent.toml', fmt: 'gemini' },
35
39
  ];
36
40
 
37
41
  function bodyFor(fmt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phewsh",
3
- "version": "0.15.43",
3
+ "version": "0.15.45",
4
4
  "description": "Turn intent into action. Structure your thinking, execute your next step.",
5
5
  "bin": {
6
6
  "phewsh": "bin/phewsh.js"