chore(format): apply biome fixes
This commit is contained in:
@@ -15,8 +15,9 @@ import { resolveGatewayProgramArguments } from "../daemon/program-args.js";
|
||||
import { resolvePreferredNodePath } from "../daemon/runtime-paths.js";
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
import { buildServiceEnvironment } from "../daemon/service-env.js";
|
||||
import { buildGatewayConnectionDetails } from "../gateway/call.js";
|
||||
import { buildGatewayConnectionDetails, callGateway } from "../gateway/call.js";
|
||||
import { formatPortDiagnostics, inspectPortUsage } from "../infra/ports.js";
|
||||
import { collectProvidersStatusIssues } from "../infra/providers-status-issues.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { resolveUserPath, sleep } from "../utils.js";
|
||||
@@ -66,8 +67,6 @@ import {
|
||||
printWizardHeader,
|
||||
} from "./onboard-helpers.js";
|
||||
import { ensureSystemdUserLingerInteractive } from "./systemd-linger.js";
|
||||
import { callGateway } from "../gateway/call.js";
|
||||
import { collectProvidersStatusIssues } from "../infra/providers-status-issues.js";
|
||||
|
||||
function resolveMode(cfg: ClawdbotConfig): "local" | "remote" {
|
||||
return cfg.gateway?.mode === "remote" ? "remote" : "local";
|
||||
|
||||
@@ -357,7 +357,9 @@ describe("providers command", () => {
|
||||
|
||||
it("surfaces WhatsApp auth/runtime hints when unlinked or disconnected", () => {
|
||||
const unlinked = formatGatewayProvidersStatusLines({
|
||||
whatsappAccounts: [{ accountId: "default", enabled: true, linked: false }],
|
||||
whatsappAccounts: [
|
||||
{ accountId: "default", enabled: true, linked: false },
|
||||
],
|
||||
});
|
||||
expect(unlinked.join("\n")).toMatch(/WhatsApp/i);
|
||||
expect(unlinked.join("\n")).toMatch(/Not linked/i);
|
||||
|
||||
@@ -39,4 +39,3 @@ describe("resolveDiscordPrivilegedIntentsFromFlags", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -150,8 +150,11 @@ export async function probeDiscord(
|
||||
};
|
||||
if (includeApplication) {
|
||||
result.application =
|
||||
(await fetchDiscordApplicationSummary(normalized, timeoutMs, fetcher)) ??
|
||||
undefined;
|
||||
(await fetchDiscordApplicationSummary(
|
||||
normalized,
|
||||
timeoutMs,
|
||||
fetcher,
|
||||
)) ?? undefined;
|
||||
}
|
||||
return { ...result, elapsedMs: Date.now() - started };
|
||||
} catch (err) {
|
||||
|
||||
@@ -98,9 +98,14 @@ export const providersHandlers: GatewayRequestHandlers = {
|
||||
lastProbeAt = Date.now();
|
||||
}
|
||||
const groups =
|
||||
cfg.telegram?.accounts?.[account.accountId]?.groups ?? cfg.telegram?.groups;
|
||||
cfg.telegram?.accounts?.[account.accountId]?.groups ??
|
||||
cfg.telegram?.groups;
|
||||
const allowUnmentionedGroups =
|
||||
Boolean(groups?.["*"] && (groups["*"] as { requireMention?: boolean }).requireMention === false) ||
|
||||
Boolean(
|
||||
groups?.["*"] &&
|
||||
(groups["*"] as { requireMention?: boolean }).requireMention ===
|
||||
false,
|
||||
) ||
|
||||
Object.entries(groups ?? {}).some(
|
||||
([key, value]) =>
|
||||
key !== "*" &&
|
||||
|
||||
@@ -5,7 +5,10 @@ import {
|
||||
resolveDiscordAccount,
|
||||
} from "../discord/accounts.js";
|
||||
import { monitorDiscordProvider } from "../discord/index.js";
|
||||
import type { DiscordApplicationSummary, DiscordProbe } from "../discord/probe.js";
|
||||
import type {
|
||||
DiscordApplicationSummary,
|
||||
DiscordProbe,
|
||||
} from "../discord/probe.js";
|
||||
import { probeDiscord } from "../discord/probe.js";
|
||||
import { shouldLogVerbose } from "../globals.js";
|
||||
import {
|
||||
|
||||
@@ -58,7 +58,9 @@ function readDiscordAccountStatus(value: unknown): DiscordAccountStatus | null {
|
||||
};
|
||||
}
|
||||
|
||||
function readDiscordApplicationSummary(value: unknown): DiscordApplicationSummary {
|
||||
function readDiscordApplicationSummary(
|
||||
value: unknown,
|
||||
): DiscordApplicationSummary {
|
||||
if (!isRecord(value)) return {};
|
||||
const intentsRaw = value.intents;
|
||||
if (!isRecord(intentsRaw)) return {};
|
||||
@@ -74,7 +76,9 @@ function readDiscordApplicationSummary(value: unknown): DiscordApplicationSummar
|
||||
};
|
||||
}
|
||||
|
||||
function readTelegramAccountStatus(value: unknown): TelegramAccountStatus | null {
|
||||
function readTelegramAccountStatus(
|
||||
value: unknown,
|
||||
): TelegramAccountStatus | null {
|
||||
if (!isRecord(value)) return null;
|
||||
return {
|
||||
accountId: value.accountId,
|
||||
@@ -84,7 +88,9 @@ function readTelegramAccountStatus(value: unknown): TelegramAccountStatus | null
|
||||
};
|
||||
}
|
||||
|
||||
function readWhatsAppAccountStatus(value: unknown): WhatsAppAccountStatus | null {
|
||||
function readWhatsAppAccountStatus(
|
||||
value: unknown,
|
||||
): WhatsAppAccountStatus | null {
|
||||
if (!isRecord(value)) return null;
|
||||
return {
|
||||
accountId: value.accountId,
|
||||
@@ -159,7 +165,9 @@ export function collectProvidersStatusIssues(
|
||||
const running = account.running === true;
|
||||
const connected = account.connected === true;
|
||||
const reconnectAttempts =
|
||||
typeof account.reconnectAttempts === "number" ? account.reconnectAttempts : null;
|
||||
typeof account.reconnectAttempts === "number"
|
||||
? account.reconnectAttempts
|
||||
: null;
|
||||
const lastError = asString(account.lastError);
|
||||
|
||||
if (!linked) {
|
||||
|
||||
@@ -1151,7 +1151,10 @@ describe("web auto-reply", () => {
|
||||
bindings: [
|
||||
{
|
||||
agentId: "work",
|
||||
match: { provider: "whatsapp", peer: { kind: "group", id: "123@g.us" } },
|
||||
match: {
|
||||
provider: "whatsapp",
|
||||
peer: { kind: "group", id: "123@g.us" },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user