@cydm/pie 1.0.9 → 1.0.10

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.
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  createCliHostCapabilities
4
- } from "../../../chunks/chunk-XHZP5EK4.js";
4
+ } from "../../../chunks/chunk-R2HMYSEK.js";
5
5
  import {
6
6
  createSharedFileSystemTools,
7
7
  createSubagentCapability
@@ -320,7 +320,7 @@ function buildBashRecoveryHint(command, output) {
320
320
  if (/\bnpm ERR!|\bnpm error\b/i.test(output) && /\b(?:ECONNRESET|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|fetch failed|socket hang up|registry|proxy)\b/i.test(output)) {
321
321
  return "npm could not reach the registry. Treat this as an environment/network/proxy issue, not a source-code failure; retry npm install/npm ci when network is available or check npm proxy/registry settings.";
322
322
  }
323
- if (/\bnpm\s+run\b/.test(command) && /(?:^|\n)\s*(?:sh|bash|zsh):\s+[\w@./-]+:\s+command not found\b/i.test(output)) {
323
+ if (/\bnpm\s+run\b/.test(command) && (/(?:^|\n)\s*(?:sh|bash|zsh):\s+[\w@./-]+:\s+command not found\b/i.test(output) || /(?:^|\r?\n)\s*'[^']+'\s+is not recognized as an internal or external command\b/i.test(output))) {
324
324
  return "This npm script could not find a local executable. Check whether dependencies were installed successfully in cwd, whether node_modules exists, and whether a prior npm install/npm ci failed before treating this as a code failure.";
325
325
  }
326
326
  return void 0;
@@ -406,8 +406,7 @@ function createBashTool(defaultCwd, options) {
406
406
  shell: spawnCommand.shell,
407
407
  cwd: workingDir,
408
408
  env: process.env,
409
- detached: true
410
- // Allows killing entire process tree
409
+ detached: process.platform !== "win32"
411
410
  });
412
411
  const timeoutId = setTimeout(() => {
413
412
  timedOut = true;
@@ -515,6 +514,9 @@ function createBashTool(defaultCwd, options) {
515
514
  };
516
515
  const semantic = interpretShellExit(effectiveCommand, code);
517
516
  details.semanticExitMeaning = semantic.semanticExitMeaning;
517
+ if (resolvedShell === "powershell" && code === 0 && /^\s*(?:diff|Compare-Object)\b/i.test(effectiveCommand) && /\bSideIndicator\b/.test(fullOutput)) {
518
+ details.semanticExitMeaning = "files differ";
519
+ }
518
520
  if (truncation.truncated) {
519
521
  details.truncation = {
520
522
  truncated: true,
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  getSettingsPath,
15
15
  getThemesDir,
16
16
  migrateConfigFromAgentDir
17
- } from "./chunks/chunk-XHZP5EK4.js";
17
+ } from "./chunks/chunk-R2HMYSEK.js";
18
18
  import {
19
19
  AGENTS_CONTEXT_FILE_NAME,
20
20
  AgentSessionController,
@@ -63658,16 +63658,27 @@ function selectToolsForRuntimeMode(tools, mode) {
63658
63658
  }
63659
63659
 
63660
63660
  // src/input/direct-bash.ts
63661
+ function buildDirectShellCommand(command) {
63662
+ if (process.platform === "win32") {
63663
+ return {
63664
+ file: "powershell.exe",
63665
+ args: ["-NoProfile", "-NonInteractive", "-Command", command],
63666
+ prompt: "PS>"
63667
+ };
63668
+ }
63669
+ return { file: "bash", args: ["-lc", command], prompt: "$" };
63670
+ }
63661
63671
  async function handleDirectBash(host, command) {
63662
63672
  host.chatContainer.addChild(new Spacer(1));
63663
- host.chatContainer.addChild(new Text(theme.fg("accent", `$ ${command}`), 1, 0));
63673
+ const shellCommand = buildDirectShellCommand(command);
63674
+ host.chatContainer.addChild(new Text(theme.fg("accent", `${shellCommand.prompt} ${command}`), 1, 0));
63664
63675
  host.editor.setText("");
63665
63676
  const outputContainer = new Container();
63666
63677
  outputContainer.addChild(new Spacer(1));
63667
63678
  host.chatContainer.addChild(outputContainer);
63668
63679
  host.ui.requestRender();
63669
63680
  const { spawn: spawn2 } = await import("child_process");
63670
- const child = spawn2("bash", ["-c", command], {
63681
+ const child = spawn2(shellCommand.file, shellCommand.args, {
63671
63682
  cwd: process.cwd(),
63672
63683
  env: process.env
63673
63684
  });
@@ -63692,14 +63703,24 @@ async function handleDirectBash(host, command) {
63692
63703
  host.ui.requestRender();
63693
63704
  });
63694
63705
  return new Promise((resolve4) => {
63695
- child.on("close", (code) => {
63706
+ let settled = false;
63707
+ const finish = (code) => {
63708
+ if (settled) return;
63709
+ settled = true;
63696
63710
  if (code !== 0) {
63697
63711
  outputContainer.addChild(new Spacer(1));
63698
- outputContainer.addChild(new Text(theme.fg("error", `[exit ${code}]`), 1, 0));
63712
+ outputContainer.addChild(new Text(theme.fg("error", `[exit ${code ?? "spawn error"}]`), 1, 0));
63699
63713
  }
63700
63714
  host.chatContainer.addChild(new Spacer(1));
63701
63715
  host.ui.requestRender();
63702
63716
  resolve4();
63717
+ };
63718
+ child.on("error", (error) => {
63719
+ outputContainer.addChild(new Text(theme.fg("error", error.message), 1, 0));
63720
+ finish(null);
63721
+ });
63722
+ child.on("close", (code) => {
63723
+ finish(code);
63703
63724
  });
63704
63725
  });
63705
63726
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {