Skip to content

Commit fe2330f

Browse files
committed
fix(cli): satisfy lifecycle CI gates
1 parent a5c0a7c commit fe2330f

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎src/cli/daemon-cli/install.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
33
import type { ResolvedGatewayAuth } from "../../gateway/auth.js";
44
import { captureFullEnv } from "../../test-utils/env.js";
55
import { createCliRuntimeCapture } from "../test-runtime-capture.js";
6-
import type { DaemonActionResponse } from "./response.js";
6+
import type { createDaemonInstallActionContext } from "./shared.js";
7+
8+
type DaemonActionResponse = Parameters<
9+
ReturnType<typeof createDaemonInstallActionContext>["emit"]
10+
>[0];
711

812
const resolveNodeStartupTlsEnvironmentMock = vi.hoisted(() => vi.fn());
913
const loadConfigMock = vi.hoisted(() => vi.fn());

‎src/cli/daemon-cli/response.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type DaemonHintItem = {
2929
};
3030

3131
/** Machine-readable response shape for service lifecycle commands. */
32-
export type DaemonActionResponse = {
32+
type DaemonActionResponse = {
3333
ok: boolean;
3434
action: DaemonAction;
3535
result?: string;

‎src/cli/terminal-interactivity.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/** True when CLI input and output both belong to an interactive terminal. */
2+
function isTtyStream(stream: { isTTY?: boolean }): boolean {
3+
return stream.isTTY === true;
4+
}
5+
26
export function isTerminalInteractive(): boolean {
3-
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
7+
return isTtyStream(process.stdin) && isTtyStream(process.stdout);
48
}
59

610
export const NON_INTERACTIVE_GATEWAY_STOP_MESSAGE =

0 commit comments

Comments
 (0)