phewsh 0.15.46 → 0.15.47

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/phewsh.js CHANGED
@@ -228,11 +228,12 @@ if (!command) {
228
228
  exitAfterUpdate(0);
229
229
  } else if (COMMANDS[command]) {
230
230
  COMMANDS[command]();
231
- } else if (require('../lib/harnesses').HARNESSES[command]) {
232
- // `phewsh <harness>` — a doorway shortcut. Launch the session and have it
233
- // auto-run /work for that harness (preflight brief native handoff →
234
- // postflight). This is what the phewsh.com doorways copy as a single command.
235
- process.env.PHEWSH_AUTOWORK = command;
231
+ } else if (require('../lib/harnesses').resolveHarness(command)) {
232
+ // `phewsh <harness>` — a doorway shortcut. Accepts the id OR the tool's real
233
+ // binary (so `phewsh claude` works, since that's the Claude Code binary).
234
+ // Launch the session and auto-run /work for that harness (preflight brief →
235
+ // native handoff → postflight). This is what the phewsh.com doorways copy.
236
+ process.env.PHEWSH_AUTOWORK = require('../lib/harnesses').resolveHarness(command);
236
237
  ambientSelfHeal().finally(() => maybeFirstRunIntro().then(() => COMMANDS.session()));
237
238
  } else {
238
239
  console.error(`\n Unknown command: ${command}\n Run 'phewsh help' for available commands.\n`);
package/lib/harnesses.js CHANGED
@@ -218,9 +218,32 @@ function runViaHarness(id, systemPrompt, userPrompt, opts = {}) {
218
218
  });
219
219
  }
220
220
 
221
+ // Resolve a user-typed token to a harness id. Accepts the canonical id, the
222
+ // tool's actual binary (so `phewsh claude` → claude-code, since `claude` is the
223
+ // Claude Code binary; `phewsh cursor-agent` → cursor), or a friendly alias.
224
+ // Returns the harness id, or null if nothing matches.
225
+ const HARNESS_ALIASES = {
226
+ claude: 'claude-code',
227
+ cc: 'claude-code',
228
+ 'cursor-agent': 'cursor',
229
+ 'kiro-cli': 'kiro',
230
+ copilot: 'copilot',
231
+ };
232
+ function resolveHarness(token) {
233
+ if (!token) return null;
234
+ const t = String(token).toLowerCase();
235
+ if (HARNESSES[t]) return t;
236
+ if (HARNESS_ALIASES[t]) return HARNESS_ALIASES[t];
237
+ for (const [id, h] of Object.entries(HARNESSES)) {
238
+ if (h.bin && h.bin.toLowerCase() === t) return id;
239
+ }
240
+ return null;
241
+ }
242
+
221
243
  module.exports = {
222
244
  HARNESSES,
223
245
  INSTALL,
246
+ resolveHarness,
224
247
  isInstalled,
225
248
  detectInstalled,
226
249
  interactiveLaunchArgs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phewsh",
3
- "version": "0.15.46",
3
+ "version": "0.15.47",
4
4
  "description": "Turn intent into action. Structure your thinking, execute your next step.",
5
5
  "bin": {
6
6
  "phewsh": "bin/phewsh.js"