@crouton-kit/humanloop 0.3.23 → 0.3.24

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.
Files changed (2) hide show
  1. package/dist/tui/app.js +8 -1
  2. package/package.json +1 -1
package/dist/tui/app.js CHANGED
@@ -402,13 +402,20 @@ export async function resolveInteractionDir(dir, deck, opts = {}) {
402
402
  try {
403
403
  restoreTerminal();
404
404
  writeFileSync(tmpFile, buffer);
405
- const result = spawnSync(editor, [tmpFile], { stdio: 'inherit' });
405
+ // $EDITOR is conventionally a shell fragment, not a bare binary —
406
+ // "code --wait", "emacsclient -t" — so run it through the shell (as
407
+ // git does) with the filename passed safely as a positional arg.
408
+ const result = spawnSync('/bin/sh', ['-c', `${editor} "$1"`, 'sh', tmpFile], { stdio: 'inherit' });
406
409
  if (result.error) {
407
410
  errorMessage = `$EDITOR ("${editor}") failed to launch: ${result.error.message}`;
408
411
  }
409
412
  else if (result.signal !== null) {
410
413
  errorMessage = `$EDITOR ("${editor}") was killed by signal ${result.signal}`;
411
414
  }
415
+ else if (result.status === 127 || result.status === 126) {
416
+ // Shell couldn't exec the editor: 127 = not found, 126 = not executable.
417
+ errorMessage = `$EDITOR ("${editor}") failed to launch (shell exit ${result.status})`;
418
+ }
412
419
  else if (result.status !== 0) {
413
420
  errorMessage = `$EDITOR ("${editor}") exited with status ${result.status}`;
414
421
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crouton-kit/humanloop",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "description": "Human-in-the-loop decision TUI — agents write questions, humans answer them",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",