zyndo 0.1.4 → 0.1.5

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/dist/index.js CHANGED
@@ -47,7 +47,7 @@ async function main() {
47
47
  break;
48
48
  }
49
49
  case 'version':
50
- process.stdout.write('zyndo 0.1.4\n');
50
+ process.stdout.write('zyndo 0.1.5\n');
51
51
  break;
52
52
  case 'help':
53
53
  case undefined:
package/dist/init.js CHANGED
@@ -335,13 +335,30 @@ function runNonInteractive(flags) {
335
335
  binary = lookup;
336
336
  }
337
337
  else {
338
- // Auto-detect
339
- const detected = detectInstalledHarness();
340
- if (detected === undefined) {
338
+ // Auto-detect. Refuse to guess if BOTH harnesses are present — the AI
339
+ // agent calling this must tell us which one IT is, otherwise we'll
340
+ // happily write a config that points at the wrong binary and crash at
341
+ // load time with the harness/binary mismatch error.
342
+ const claudeBin = findClaudeBinary();
343
+ const codexBin = findCodexBinary();
344
+ if (claudeBin !== undefined && codexBin !== undefined) {
345
+ throw new Error('Both Claude Code and Codex CLI are installed on this machine.\n' +
346
+ 'Pass --harness explicitly so we know which one YOU are:\n' +
347
+ ' --harness claude (if you are Claude Code)\n' +
348
+ ' --harness codex (if you are Codex CLI)\n' +
349
+ 'The harness MUST match the AI agent that will run `zyndo serve`.');
350
+ }
351
+ if (claudeBin !== undefined) {
352
+ harness = 'claude';
353
+ binary = claudeBin;
354
+ }
355
+ else if (codexBin !== undefined) {
356
+ harness = 'codex';
357
+ binary = codexBin;
358
+ }
359
+ else {
341
360
  throw new Error('No AI harness found. Install Claude Code or Codex CLI, or pass --harness and --binary explicitly.');
342
361
  }
343
- harness = detected.harness;
344
- binary = detected.binary;
345
362
  }
346
363
  // Pick model: explicit > harness default
347
364
  if (flags.model !== undefined) {
@@ -394,7 +411,21 @@ async function runInteractive() {
394
411
  // Auto-detect available harnesses up front so the menu shows what is found.
395
412
  const detectedClaude = findClaudeBinary();
396
413
  const detectedCodex = findCodexBinary();
397
- const autoPick = detectedClaude !== undefined ? 0 : detectedCodex !== undefined ? 1 : -1;
414
+ const bothDetected = detectedClaude !== undefined && detectedCodex !== undefined;
415
+ // If BOTH are installed we refuse to default — the human must pick which
416
+ // AI agent will actually run `zyndo serve`. Picking the wrong one writes
417
+ // a config that crashes at load time with a harness/binary mismatch.
418
+ const autoPick = bothDetected
419
+ ? -1
420
+ : detectedClaude !== undefined
421
+ ? 0
422
+ : detectedCodex !== undefined
423
+ ? 1
424
+ : -1;
425
+ if (bothDetected) {
426
+ process.stdout.write(' \x1b[33mBoth Claude Code and Codex CLI are installed.\x1b[0m\n');
427
+ process.stdout.write(' Pick the one that matches the AI agent that will run `zyndo serve`.\n\n');
428
+ }
398
429
  process.stdout.write(' \x1b[1mSelect your AI harness:\x1b[0m\n');
399
430
  for (let i = 0; i < HARNESS_OPTIONS.length; i++) {
400
431
  const opt = HARNESS_OPTIONS[i];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zyndo",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "The agent-to-agent CLI tool for sellers in the Zyndo Marketplace",
5
5
  "type": "module",
6
6
  "license": "MIT",