@earendil-works/pi-coding-agent 0.75.1 → 0.75.3

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 (38) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +3 -3
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +35 -27
  7. package/dist/config.js.map +1 -1
  8. package/dist/core/package-manager.d.ts.map +1 -1
  9. package/dist/core/package-manager.js +4 -8
  10. package/dist/core/package-manager.js.map +1 -1
  11. package/dist/main.d.ts.map +1 -1
  12. package/dist/main.js +5 -1
  13. package/dist/main.js.map +1 -1
  14. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  15. package/dist/modes/interactive/components/extension-editor.js +14 -6
  16. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  17. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  18. package/dist/modes/interactive/interactive-mode.js +13 -6
  19. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  20. package/dist/package-manager-cli.d.ts.map +1 -1
  21. package/dist/package-manager-cli.js +22 -5
  22. package/dist/package-manager-cli.js.map +1 -1
  23. package/dist/utils/child-process.d.ts +5 -8
  24. package/dist/utils/child-process.d.ts.map +1 -1
  25. package/dist/utils/child-process.js +8 -59
  26. package/dist/utils/child-process.js.map +1 -1
  27. package/dist/utils/windows-self-update.d.ts +3 -0
  28. package/dist/utils/windows-self-update.d.ts.map +1 -0
  29. package/dist/utils/windows-self-update.js +77 -0
  30. package/dist/utils/windows-self-update.js.map +1 -0
  31. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  32. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  33. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  34. package/examples/extensions/sandbox/package-lock.json +2 -2
  35. package/examples/extensions/sandbox/package.json +1 -1
  36. package/examples/extensions/with-deps/package-lock.json +2 -2
  37. package/examples/extensions/with-deps/package.json +1 -1
  38. package/package.json +6 -4
@@ -2878,7 +2878,7 @@ export class InteractiveMode {
2878
2878
  }
2879
2879
  this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
2880
2880
  }
2881
- openExternalEditor() {
2881
+ async openExternalEditor() {
2882
2882
  // Determine editor (respect $VISUAL, then $EDITOR)
2883
2883
  const editorCmd = process.env.VISUAL || process.env.EDITOR;
2884
2884
  if (!editorCmd) {
@@ -2894,13 +2894,20 @@ export class InteractiveMode {
2894
2894
  this.ui.stop();
2895
2895
  // Split by space to support editor arguments (e.g., "code --wait")
2896
2896
  const [editor, ...editorArgs] = editorCmd.split(" ");
2897
- // Spawn editor synchronously with inherited stdio for interactive editing
2898
- const result = spawnSync(editor, [...editorArgs, tmpFile], {
2899
- stdio: "inherit",
2900
- shell: process.platform === "win32",
2897
+ process.stdout.write(`Launching external editor: ${editorCmd}\nPi will resume when the editor exits.\n`);
2898
+ // Do not use spawnSync here. On Windows, synchronous child_process calls can keep
2899
+ // Node/libuv's console input read active after ui.stop() pauses stdin, racing
2900
+ // vim/nvim for the console input buffer until Ctrl+C cancels the pending read.
2901
+ const status = await new Promise((resolve) => {
2902
+ const child = spawn(editor, [...editorArgs, tmpFile], {
2903
+ stdio: "inherit",
2904
+ shell: process.platform === "win32",
2905
+ });
2906
+ child.on("error", () => resolve(null));
2907
+ child.on("close", (code) => resolve(code));
2901
2908
  });
2902
2909
  // On successful exit (status 0), replace editor content
2903
- if (result.status === 0) {
2910
+ if (status === 0) {
2904
2911
  const newContent = fs.readFileSync(tmpFile, "utf-8").replace(/\n$/, "");
2905
2912
  this.editor.setText(newContent);
2906
2913
  }