@slock-ai/daemon 0.53.0 → 0.53.1-alpha.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.
|
@@ -2094,7 +2094,13 @@ import path3 from "path";
|
|
|
2094
2094
|
function normalizeExecOutput(raw) {
|
|
2095
2095
|
return Buffer.isBuffer(raw) ? raw.toString("utf8") : String(raw ?? "");
|
|
2096
2096
|
}
|
|
2097
|
-
function
|
|
2097
|
+
function preferWindowsCmdShim(resolved, existsSyncFn) {
|
|
2098
|
+
const parsed = path3.win32.parse(resolved);
|
|
2099
|
+
if (parsed.ext.toLowerCase() !== ".ps1") return resolved;
|
|
2100
|
+
const cmdShim = path3.win32.join(parsed.dir, `${parsed.name}.cmd`);
|
|
2101
|
+
return existsSyncFn(cmdShim) ? cmdShim : resolved;
|
|
2102
|
+
}
|
|
2103
|
+
function resolveCommandOnWindows(command, env, execFileSyncFn, existsSyncFn) {
|
|
2098
2104
|
const script = "& {$cmd = Get-Command -Name $args[0] -ErrorAction Stop | Select-Object -First 1; if ($cmd.Path) { $cmd.Path } elseif ($cmd.Source) { $cmd.Source } elseif ($cmd.Definition) { $cmd.Definition } }";
|
|
2099
2105
|
try {
|
|
2100
2106
|
const output = normalizeExecOutput(execFileSyncFn("powershell.exe", [
|
|
@@ -2108,7 +2114,7 @@ function resolveCommandOnWindows(command, env, execFileSyncFn) {
|
|
|
2108
2114
|
env
|
|
2109
2115
|
}));
|
|
2110
2116
|
const resolved = output.trim().split(/\r?\n/)[0];
|
|
2111
|
-
return resolved
|
|
2117
|
+
return resolved ? preferWindowsCmdShim(resolved, existsSyncFn) : command;
|
|
2112
2118
|
} catch {
|
|
2113
2119
|
return null;
|
|
2114
2120
|
}
|
|
@@ -2117,8 +2123,9 @@ function resolveCommandOnPath(command, deps = {}) {
|
|
|
2117
2123
|
const platform = deps.platform ?? process.platform;
|
|
2118
2124
|
const env = deps.env ?? process.env;
|
|
2119
2125
|
const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
|
|
2126
|
+
const existsSyncFn = deps.existsSyncFn ?? existsSync2;
|
|
2120
2127
|
if (platform === "win32") {
|
|
2121
|
-
return resolveCommandOnWindows(command, env, execFileSyncFn);
|
|
2128
|
+
return resolveCommandOnWindows(command, env, execFileSyncFn, existsSyncFn);
|
|
2122
2129
|
}
|
|
2123
2130
|
const locator = "which";
|
|
2124
2131
|
try {
|
|
@@ -3451,6 +3458,9 @@ function buildGeminiSpawnEnv(ctx, platform = process.platform) {
|
|
|
3451
3458
|
if (!Object.prototype.hasOwnProperty.call(ctx.config.envVars ?? {}, "GEMINI_CLI_TRUST_WORKSPACE")) {
|
|
3452
3459
|
spawnEnv.GEMINI_CLI_TRUST_WORKSPACE = "true";
|
|
3453
3460
|
}
|
|
3461
|
+
if (platform === "win32" && !Object.prototype.hasOwnProperty.call(ctx.config.envVars ?? {}, "GEMINI_PTY_INFO")) {
|
|
3462
|
+
spawnEnv.GEMINI_PTY_INFO = "child_process";
|
|
3463
|
+
}
|
|
3454
3464
|
return spawnEnv;
|
|
3455
3465
|
}
|
|
3456
3466
|
function normalizeExecOutput2(raw) {
|
package/dist/core.js
CHANGED
package/dist/index.js
CHANGED