chore(lint): apply biome fixes
This commit is contained in:
@@ -51,13 +51,13 @@ describe("cli program", () => {
|
|||||||
expect(statusCommand).toHaveBeenCalled();
|
expect(statusCommand).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("runs config alias as configure", async () => {
|
it("runs config alias as configure", async () => {
|
||||||
const program = buildProgram();
|
const program = buildProgram();
|
||||||
await program.parseAsync(["config"], { from: "user" });
|
await program.parseAsync(["config"], { from: "user" });
|
||||||
expect(configureCommand).toHaveBeenCalled();
|
expect(configureCommand).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("runs nodes list and calls node.pair.list", async () => {
|
it("runs nodes list and calls node.pair.list", async () => {
|
||||||
callGateway.mockResolvedValue({ pending: [], paired: [] });
|
callGateway.mockResolvedValue({ pending: [], paired: [] });
|
||||||
const program = buildProgram();
|
const program = buildProgram();
|
||||||
runtime.log.mockClear();
|
runtime.log.mockClear();
|
||||||
|
|||||||
@@ -455,7 +455,8 @@ export async function runConfigureWizard(
|
|||||||
const localUrl = "ws://127.0.0.1:18789";
|
const localUrl = "ws://127.0.0.1:18789";
|
||||||
const localProbe = await probeGatewayReachable({
|
const localProbe = await probeGatewayReachable({
|
||||||
url: localUrl,
|
url: localUrl,
|
||||||
token: baseConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN,
|
token:
|
||||||
|
baseConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN,
|
||||||
password:
|
password:
|
||||||
baseConfig.gateway?.auth?.password ??
|
baseConfig.gateway?.auth?.password ??
|
||||||
process.env.CLAWDBOT_GATEWAY_PASSWORD,
|
process.env.CLAWDBOT_GATEWAY_PASSWORD,
|
||||||
|
|||||||
@@ -97,7 +97,11 @@ async function isWSL(): Promise<boolean> {
|
|||||||
wslCached = false;
|
wslCached = false;
|
||||||
return wslCached;
|
return wslCached;
|
||||||
}
|
}
|
||||||
if (process.env.WSL_INTEROP || process.env.WSL_DISTRO_NAME || process.env.WSLENV) {
|
if (
|
||||||
|
process.env.WSL_INTEROP ||
|
||||||
|
process.env.WSL_DISTRO_NAME ||
|
||||||
|
process.env.WSLENV
|
||||||
|
) {
|
||||||
wslCached = true;
|
wslCached = true;
|
||||||
return wslCached;
|
return wslCached;
|
||||||
}
|
}
|
||||||
@@ -118,7 +122,9 @@ type BrowserOpenCommand = {
|
|||||||
|
|
||||||
async function resolveBrowserOpenCommand(): Promise<BrowserOpenCommand> {
|
async function resolveBrowserOpenCommand(): Promise<BrowserOpenCommand> {
|
||||||
const platform = process.platform;
|
const platform = process.platform;
|
||||||
const hasDisplay = Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
|
const hasDisplay = Boolean(
|
||||||
|
process.env.DISPLAY || process.env.WAYLAND_DISPLAY,
|
||||||
|
);
|
||||||
const isSsh =
|
const isSsh =
|
||||||
Boolean(process.env.SSH_CLIENT) ||
|
Boolean(process.env.SSH_CLIENT) ||
|
||||||
Boolean(process.env.SSH_TTY) ||
|
Boolean(process.env.SSH_TTY) ||
|
||||||
@@ -172,7 +178,9 @@ export function formatControlUiSshHint(params: {
|
|||||||
const basePath = normalizeControlUiBasePath(params.basePath);
|
const basePath = normalizeControlUiBasePath(params.basePath);
|
||||||
const uiPath = basePath ? `${basePath}/` : "/";
|
const uiPath = basePath ? `${basePath}/` : "/";
|
||||||
const localUrl = `http://localhost:${params.port}${uiPath}`;
|
const localUrl = `http://localhost:${params.port}${uiPath}`;
|
||||||
const tokenParam = params.token ? `?token=${encodeURIComponent(params.token)}` : "";
|
const tokenParam = params.token
|
||||||
|
? `?token=${encodeURIComponent(params.token)}`
|
||||||
|
: "";
|
||||||
const authedUrl = params.token ? `${localUrl}${tokenParam}` : undefined;
|
const authedUrl = params.token ? `${localUrl}${tokenParam}` : undefined;
|
||||||
const sshTarget = resolveSshTargetHint();
|
const sshTarget = resolveSshTargetHint();
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ export async function callGateway<T = unknown>(
|
|||||||
client.stop();
|
client.stop();
|
||||||
stop(err as Error);
|
stop(err as Error);
|
||||||
}
|
}
|
||||||
}, onClose: (code, reason) => {
|
},
|
||||||
|
onClose: (code, reason) => {
|
||||||
if (settled || ignoreClose) return;
|
if (settled || ignoreClose) return;
|
||||||
ignoreClose = true;
|
ignoreClose = true;
|
||||||
client.stop();
|
client.stop();
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ export const chatHandlers: GatewayRequestHandlers = {
|
|||||||
params,
|
params,
|
||||||
respond,
|
respond,
|
||||||
context,
|
context,
|
||||||
client,
|
client: _client,
|
||||||
isWebchatConnect,
|
isWebchatConnect: _isWebchatConnect,
|
||||||
}) => {
|
}) => {
|
||||||
if (!validateChatSendParams(params)) {
|
if (!validateChatSendParams(params)) {
|
||||||
respond(
|
respond(
|
||||||
|
|||||||
Reference in New Issue
Block a user