@span-io/agent-link 0.1.0 → 0.1.1
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/process-runner.js +9 -4
- package/package.json +1 -1
package/dist/process-runner.js
CHANGED
|
@@ -94,10 +94,15 @@ export function spawnAgentProcess(config) {
|
|
|
94
94
|
const workingDir = process.env.CODEX_CWD ?? defaultCwd;
|
|
95
95
|
// For logging/display
|
|
96
96
|
const commandString = [command, ...args].map(shellQuote).join(" ");
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
97
|
+
const platform = process.platform;
|
|
98
|
+
const canUseScript = useScriptWrapper && platform !== "win32";
|
|
99
|
+
const finalCommand = canUseScript ? "script" : command;
|
|
100
|
+
const finalArgs = canUseScript
|
|
101
|
+
? platform === "darwin"
|
|
102
|
+
// BSD script: no -c, use "script -q /dev/null sh -c <command>"
|
|
103
|
+
? ["-q", "/dev/null", "sh", "-c", commandString]
|
|
104
|
+
// GNU script: "script -q -c <command> /dev/null"
|
|
105
|
+
: ["-q", "-c", commandString, "/dev/null"]
|
|
101
106
|
: args;
|
|
102
107
|
const child = spawn(finalCommand, finalArgs, {
|
|
103
108
|
stdio: [promptMode === "stdin" ? "pipe" : "ignore", "pipe", "pipe"],
|