fix(desktop): restore packaged terminal hooks

The desktop daemon resolved the CLI through a packaged module entrypoint that is not an executable outside the archive. Publish the existing bundled shim as the daemon's authoritative CLI path so terminal hooks use a callable command.
This commit is contained in:
Mohamed Boudra
2026-07-21 17:55:13 +02:00
parent 0707092131
commit ee431bb340
9 changed files with 39 additions and 17 deletions
@@ -128,6 +128,14 @@ function shellQuoteCliArg(value) {
return shellQuote(String(value));
}
function getTerminalHookSmokeCommand(marker) {
if (process.platform === "win32") {
return `"%PASEO_HOOK_CLI%" hooks codex Stop && echo ${marker}`;
}
return `"$PASEO_HOOK_CLI" hooks codex Stop && echo ${marker}`;
}
function getShellCommand(script) {
if (process.platform === "win32") {
return {
@@ -740,8 +748,8 @@ async function smokeCliTerminal({ appPath, env }) {
await runCliShimJsonCommand({
appPath,
env,
args: ["terminal", "send-keys", terminalId, "echo", "Space", marker, "Enter"],
label: "Bundled CLI shim terminal send-keys",
args: ["terminal", "send-keys", terminalId, getTerminalHookSmokeCommand(marker), "Enter"],
label: "Bundled CLI shim terminal hook command",
});
for (let attempt = 1; attempt <= TERMINAL_CAPTURE_ATTEMPTS; attempt += 1) {
@@ -753,7 +761,7 @@ async function smokeCliTerminal({ appPath, env }) {
});
const lines = Array.isArray(capture?.lines) ? capture.lines : [];
if (lines.join("\n").includes(marker)) {
console.log("Packaged desktop smoke: terminal command output captured");
console.log("Packaged desktop smoke: terminal hook command completed");
return;
}