@selesai/code 0.1.7 → 0.1.9
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.
|
@@ -100,16 +100,18 @@ export function resolveWindowsPiCliScript(deps: PiSpawnDeps = {}): string | unde
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export function getPiSpawnCommand(args: string[], deps: PiSpawnDeps = {}): PiSpawnCommand {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
103
|
+
// On all platforms, prefer the running CLI script (process.argv[1]) so a
|
|
104
|
+
// renamed fork like "selesai" spawns its own binary instead of the upstream
|
|
105
|
+
// "pi" from PATH (which has a different agent dir / providers / auth).
|
|
106
|
+
const piCliPath = resolveWindowsPiCliScript(deps);
|
|
107
|
+
if (piCliPath) {
|
|
108
|
+
return {
|
|
109
|
+
command: deps.execPath ?? process.execPath,
|
|
110
|
+
args: [piCliPath, ...args],
|
|
111
|
+
};
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
// Fall back to the upstream binary name only if the CLI script could not be
|
|
115
|
+
// resolved. "pi" remains the historical default for stock pi installs.
|
|
114
116
|
return { command: "pi", args };
|
|
115
117
|
}
|