@agimon-ai/po-workflow 0.0.0-alpha.105 → 0.0.0-alpha.106

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.
@@ -4501,7 +4501,6 @@ const INTERRUPT_SIGNAL$2 = "SIGINT";
4501
4501
  const HANGUP_SIGNAL$1 = "SIGHUP";
4502
4502
  const TERMINATE_SIGNAL$1 = "SIGTERM";
4503
4503
  const DEFAULT_STEP_NAME = "unnamed";
4504
- const DEFAULT_SHELL = "/bin/zsh";
4505
4504
  const FORCE_COLOR_KEY = "FORCE_COLOR";
4506
4505
  const FORCE_COLOR_VALUE = "1";
4507
4506
  const PROJECT_PATH_ENV_KEY = "PROJECT_PATH";
@@ -4670,7 +4669,7 @@ function secretRedactor(values) {
4670
4669
  *
4671
4670
  * Runtime configuration:
4672
4671
  * - Environment precedence is `runtime.baseEnvironment` -> workflow/job env -> step env.
4673
- * - Child commands run through `/bin/zsh` to match local workflow execution.
4672
+ * - Child commands use the host-selected shell, matching workflow panes and services.
4674
4673
  * - `FORCE_COLOR=1` is injected so tool output keeps ANSI formatting.
4675
4674
  */
4676
4675
  var StepRunnerService = class StepRunnerService {
@@ -5320,7 +5319,7 @@ var StepRunnerService = class StepRunnerService {
5320
5319
  ...stepEnv,
5321
5320
  [FORCE_COLOR_KEY]: FORCE_COLOR_VALUE
5322
5321
  },
5323
- shell: DEFAULT_SHELL
5322
+ shell: this.runtime.workflowHost.shellPath
5324
5323
  }) : this.runtime.workflowHost.spawn(command, [], {
5325
5324
  stdio: [
5326
5325
  this.ownsTerminal ? STDIO_INHERIT : STDIO_IGNORE,
@@ -5334,7 +5333,7 @@ var StepRunnerService = class StepRunnerService {
5334
5333
  ...secretEnv,
5335
5334
  [FORCE_COLOR_KEY]: FORCE_COLOR_VALUE
5336
5335
  },
5337
- shell: DEFAULT_SHELL
5336
+ shell: this.runtime.workflowHost.shellPath
5338
5337
  });
5339
5338
  this.activeStep = {
5340
5339
  command,
@@ -7245,7 +7244,11 @@ async function runWorkflowScript(runtime, request) {
7245
7244
  }
7246
7245
  }, PROCESS_GROUP_GRACE_MS);
7247
7246
  });
7248
- child.stdin?.on("error", () => stop("Workflow script could not receive its input."));
7247
+ const inputError = (error) => {
7248
+ if (typeof error === "object" && error !== null && "code" in error && error.code === "EPIPE") return;
7249
+ stop("Workflow script could not receive its input.");
7250
+ };
7251
+ child.stdin?.on("error", inputError);
7249
7252
  child.stdout?.on("error", () => stop("Workflow script output stream failed."));
7250
7253
  child.stderr?.on("error", () => stop("Workflow script diagnostic stream failed."));
7251
7254
  child.stdout?.on("data", (chunk) => {
@@ -7288,8 +7291,8 @@ async function runWorkflowScript(runtime, request) {
7288
7291
  else if (!child.stdin || !child.stdout || !child.stderr) stop("Workflow script requires piped input and output.");
7289
7292
  else try {
7290
7293
  child.stdin.end(input);
7291
- } catch {
7292
- stop("Workflow script could not receive its input.");
7294
+ } catch (error) {
7295
+ inputError(error);
7293
7296
  }
7294
7297
  });
7295
7298
  }
@@ -7474,7 +7477,7 @@ function createStepExecutor(dependencies) {
7474
7477
  return {
7475
7478
  completionGuarded: true,
7476
7479
  completion: runWorkflowScript(runtime, {
7477
- command: "/bin/zsh",
7480
+ command: runtime.workflowHost.shellPath,
7478
7481
  args: ["-c", request.command],
7479
7482
  cwd: request.cwd,
7480
7483
  environment: {
@@ -7882,8 +7885,6 @@ function createStepExecutor(dependencies) {
7882
7885
  }
7883
7886
  };
7884
7887
  }
7885
- /** The shell a command step runs in, the same one the engine spawns it with. */
7886
- const STEP_SHELL = "/bin/zsh";
7887
7888
  /** Namespace for step pane sockets, apart from whole-run terminal sockets. */
7888
7889
  const STEP_PANE_SOCKET_SCOPE = "po-workflow-steps";
7889
7890
  const PANE_LOG_SUFFIX = ".log";
@@ -7919,7 +7920,7 @@ function createNativeStepPaneLauncher(runtime, service = new NativeTerminalServi
7919
7920
  if (runtime.temporaryDirectory === void 0) throw new Error("Workflow step panes require an admitted temporary directory.");
7920
7921
  if (!await service.available()) return void 0;
7921
7922
  await service.spawn({
7922
- command: STEP_SHELL,
7923
+ command: runtime.workflowHost.shellPath,
7923
7924
  args: ["-c", request.command],
7924
7925
  cwd: request.cwd,
7925
7926
  env: { ...request.env },
@@ -10446,10 +10447,16 @@ function createWorkflowHost(options) {
10446
10447
  ...options,
10447
10448
  environment: Object.freeze({ ...options.environment })
10448
10449
  };
10450
+ let shellPath = "/bin/sh";
10451
+ try {
10452
+ (0, node_fs.accessSync)("/bin/zsh", node_fs.constants.X_OK);
10453
+ shellPath = "/bin/zsh";
10454
+ } catch {}
10449
10455
  return Object.freeze({
10450
10456
  processId: process.pid,
10451
10457
  executablePath: process.execPath,
10452
10458
  platform: process.platform,
10459
+ shellPath,
10453
10460
  isElectron: Boolean(process.versions.electron),
10454
10461
  writeStdout: (text) => {
10455
10462
  process.stdout.write(text);
@@ -10830,7 +10837,7 @@ var BackgroundServiceManager = class {
10830
10837
  ...serviceEnv,
10831
10838
  FORCE_COLOR: "1"
10832
10839
  },
10833
- shell: "/bin/zsh",
10840
+ shell: this.runtime.workflowHost.shellPath,
10834
10841
  detached: true
10835
10842
  });
10836
10843
  } catch (error) {
@@ -10972,7 +10979,7 @@ var BackgroundServiceManager = class {
10972
10979
  while (Date.now() - start < timeout) {
10973
10980
  if (shouldAbort?.()) return false;
10974
10981
  try {
10975
- await workflowShellOutput(this.runtime, `/bin/zsh -c ${require_workflowCommandTemplate.escapeShellArg(checkCmd)}`, {
10982
+ await workflowShellOutput(this.runtime, `${require_workflowCommandTemplate.escapeShellArg(this.runtime.workflowHost.shellPath)} -c ${require_workflowCommandTemplate.escapeShellArg(checkCmd)}`, {
10976
10983
  cwd: workDir,
10977
10984
  environment: readyEnv,
10978
10985
  timeoutMs: 5e3
@@ -13569,4 +13576,4 @@ Object.defineProperty(exports, "workflowShellOutput", {
13569
13576
  }
13570
13577
  });
13571
13578
 
13572
- //# sourceMappingURL=RecoverWorkflowService-CFiF9ZBU.cjs.map
13579
+ //# sourceMappingURL=RecoverWorkflowService-D3FAo5TS.cjs.map