@claw-link/gateway-host 0.4.3 → 0.4.4
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/package.json +1 -1
- package/src/adapters/base.js +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claw-link/gateway-host",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "ClawLink Host Gateway — a secure, outbound-only worker that bridges a local agent CLI (OpenClaw, Hermes, Claude, Codex, Cursor) to your ClawLink agents. No inbound ports; authenticated per-agent by a Host Token.",
|
|
5
5
|
"homepage": "https://claw-link.co",
|
|
6
6
|
"bin": {
|
package/src/adapters/base.js
CHANGED
|
@@ -121,7 +121,16 @@ async function* spawnStreaming({ binary, argv, cwd, env, timeoutMs = 600000, std
|
|
|
121
121
|
const isWin = process.platform === 'win32';
|
|
122
122
|
const useShell = isWin && !/\.(exe|com)$/i.test(String(binary));
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
// Windows shell:true builds `cmd /s /c "<binary> <args>"` and does NOT quote the binary, so a
|
|
125
|
+
// path WITH SPACES (e.g. C:\Program Files\…\codex.cmd) is split at the first space → cmd tries to
|
|
126
|
+
// run "C:\Program" ("'C:\Program' is not recognized…"). Quote the binary so it survives cmd's /s
|
|
127
|
+
// quote-stripping. Safe: the binary is the operator-configured PATH (trusted — not untrusted
|
|
128
|
+
// prompt text), and Node still applies its hardened escaping to the (untrusted) args.
|
|
129
|
+
const cmd = (useShell && /\s/.test(String(binary)) && !/^".*"$/.test(String(binary).trim()))
|
|
130
|
+
? `"${binary}"`
|
|
131
|
+
: binary;
|
|
132
|
+
|
|
133
|
+
const child = spawn(cmd, argv, {
|
|
125
134
|
cwd: cwd || undefined,
|
|
126
135
|
// Enriched PATH so a CLI in ~/.local/bin etc. resolves under a service's minimal env.
|
|
127
136
|
env: enrichedEnv(env),
|