style: fix lint formatting
This commit is contained in:
@@ -983,15 +983,8 @@ export function shouldEmitDiscordReactionNotification(params: {
|
|||||||
userTag?: string | null;
|
userTag?: string | null;
|
||||||
allowlist?: Array<string | number> | null;
|
allowlist?: Array<string | number> | null;
|
||||||
}) {
|
}) {
|
||||||
const {
|
const { mode, botId, messageAuthorId, userId, userName, userTag, allowlist } =
|
||||||
mode,
|
params;
|
||||||
botId,
|
|
||||||
messageAuthorId,
|
|
||||||
userId,
|
|
||||||
userName,
|
|
||||||
userTag,
|
|
||||||
allowlist,
|
|
||||||
} = params;
|
|
||||||
const effectiveMode = mode ?? "own";
|
const effectiveMode = mode ?? "own";
|
||||||
if (effectiveMode === "off") return false;
|
if (effectiveMode === "off") return false;
|
||||||
if (effectiveMode === "own") {
|
if (effectiveMode === "own") {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import fs from "node:fs";
|
|
||||||
import { randomUUID } from "node:crypto";
|
import { randomUUID } from "node:crypto";
|
||||||
|
import fs from "node:fs";
|
||||||
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
|
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
|
||||||
|
import type { ModelCatalogEntry } from "../agents/model-catalog.js";
|
||||||
import {
|
import {
|
||||||
buildAllowedModelSet,
|
buildAllowedModelSet,
|
||||||
buildModelAliasIndex,
|
buildModelAliasIndex,
|
||||||
@@ -14,7 +15,9 @@ import {
|
|||||||
normalizeThinkLevel,
|
normalizeThinkLevel,
|
||||||
normalizeVerboseLevel,
|
normalizeVerboseLevel,
|
||||||
} from "../auto-reply/thinking.js";
|
} from "../auto-reply/thinking.js";
|
||||||
import { buildConfigSchema } from "../config/schema.js";
|
import type { CliDeps } from "../cli/deps.js";
|
||||||
|
import { agentCommand } from "../commands/agent.js";
|
||||||
|
import type { HealthSummary } from "../commands/health.js";
|
||||||
import {
|
import {
|
||||||
CONFIG_PATH_CLAWDIS,
|
CONFIG_PATH_CLAWDIS,
|
||||||
loadConfig,
|
loadConfig,
|
||||||
@@ -23,29 +26,19 @@ import {
|
|||||||
validateConfigObject,
|
validateConfigObject,
|
||||||
writeConfigFile,
|
writeConfigFile,
|
||||||
} from "../config/config.js";
|
} from "../config/config.js";
|
||||||
|
import { buildConfigSchema } from "../config/schema.js";
|
||||||
import {
|
import {
|
||||||
loadSessionStore,
|
loadSessionStore,
|
||||||
resolveStorePath,
|
resolveStorePath,
|
||||||
type SessionEntry,
|
type SessionEntry,
|
||||||
saveSessionStore,
|
saveSessionStore,
|
||||||
} from "../config/sessions.js";
|
} from "../config/sessions.js";
|
||||||
import type { CliDeps } from "../cli/deps.js";
|
|
||||||
import { agentCommand } from "../commands/agent.js";
|
|
||||||
import { type HealthSummary } from "../commands/health.js";
|
|
||||||
import { defaultRuntime } from "../runtime.js";
|
|
||||||
import { loadVoiceWakeConfig, setVoiceWakeTriggers } from "../infra/voicewake.js";
|
|
||||||
import {
|
import {
|
||||||
archiveFileOnDisk,
|
loadVoiceWakeConfig,
|
||||||
capArrayByJsonBytes,
|
setVoiceWakeTriggers,
|
||||||
listSessionsFromStore,
|
} from "../infra/voicewake.js";
|
||||||
loadSessionEntry,
|
import { defaultRuntime } from "../runtime.js";
|
||||||
readSessionMessages,
|
|
||||||
resolveSessionModelRef,
|
|
||||||
resolveSessionTranscriptCandidates,
|
|
||||||
type SessionsPatchResult,
|
|
||||||
} from "./session-utils.js";
|
|
||||||
import { buildMessageWithAttachments } from "./chat-attachments.js";
|
import { buildMessageWithAttachments } from "./chat-attachments.js";
|
||||||
import { normalizeVoiceWakeTriggers } from "./server-utils.js";
|
|
||||||
import {
|
import {
|
||||||
ErrorCodes,
|
ErrorCodes,
|
||||||
errorShape,
|
errorShape,
|
||||||
@@ -69,18 +62,32 @@ import {
|
|||||||
validateSessionsResetParams,
|
validateSessionsResetParams,
|
||||||
validateTalkModeParams,
|
validateTalkModeParams,
|
||||||
} from "./protocol/index.js";
|
} from "./protocol/index.js";
|
||||||
|
import type { ChatRunEntry } from "./server-chat.js";
|
||||||
import {
|
import {
|
||||||
HEALTH_REFRESH_INTERVAL_MS,
|
HEALTH_REFRESH_INTERVAL_MS,
|
||||||
MAX_CHAT_HISTORY_MESSAGES_BYTES,
|
MAX_CHAT_HISTORY_MESSAGES_BYTES,
|
||||||
} from "./server-constants.js";
|
} from "./server-constants.js";
|
||||||
import { formatForLog } from "./ws-log.js";
|
|
||||||
import type { ChatRunEntry } from "./server-chat.js";
|
|
||||||
import type { DedupeEntry } from "./server-shared.js";
|
import type { DedupeEntry } from "./server-shared.js";
|
||||||
import type { ModelCatalogEntry } from "../agents/model-catalog.js";
|
import { normalizeVoiceWakeTriggers } from "./server-utils.js";
|
||||||
|
import {
|
||||||
|
archiveFileOnDisk,
|
||||||
|
capArrayByJsonBytes,
|
||||||
|
listSessionsFromStore,
|
||||||
|
loadSessionEntry,
|
||||||
|
readSessionMessages,
|
||||||
|
resolveSessionModelRef,
|
||||||
|
resolveSessionTranscriptCandidates,
|
||||||
|
type SessionsPatchResult,
|
||||||
|
} from "./session-utils.js";
|
||||||
|
import { formatForLog } from "./ws-log.js";
|
||||||
|
|
||||||
export type BridgeHandlersContext = {
|
export type BridgeHandlersContext = {
|
||||||
deps: CliDeps;
|
deps: CliDeps;
|
||||||
broadcast: (event: string, payload: unknown, opts?: { dropIfSlow?: boolean }) => void;
|
broadcast: (
|
||||||
|
event: string,
|
||||||
|
payload: unknown,
|
||||||
|
opts?: { dropIfSlow?: boolean },
|
||||||
|
) => void;
|
||||||
bridgeSendToSession: (
|
bridgeSendToSession: (
|
||||||
sessionKey: string,
|
sessionKey: string,
|
||||||
event: string,
|
event: string,
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ export type BrowserControlServer = {
|
|||||||
stop: () => Promise<void>;
|
stop: () => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function startBrowserControlServerIfEnabled(): Promise<
|
export async function startBrowserControlServerIfEnabled(): Promise<BrowserControlServer | null> {
|
||||||
BrowserControlServer | null
|
|
||||||
> {
|
|
||||||
if (process.env.CLAWDIS_SKIP_BROWSER_CONTROL_SERVER === "1") return null;
|
if (process.env.CLAWDIS_SKIP_BROWSER_CONTROL_SERVER === "1") return null;
|
||||||
// Lazy import: keeps startup fast, but still bundles for the embedded
|
// Lazy import: keeps startup fast, but still bundles for the embedded
|
||||||
// gateway (bun --compile) via the static specifier path.
|
// gateway (bun --compile) via the static specifier path.
|
||||||
|
|||||||
@@ -28,10 +28,7 @@ import {
|
|||||||
STATE_DIR_CLAWDIS,
|
STATE_DIR_CLAWDIS,
|
||||||
writeConfigFile,
|
writeConfigFile,
|
||||||
} from "../config/config.js";
|
} from "../config/config.js";
|
||||||
import {
|
import { loadSessionStore, resolveStorePath } from "../config/sessions.js";
|
||||||
loadSessionStore,
|
|
||||||
resolveStorePath,
|
|
||||||
} from "../config/sessions.js";
|
|
||||||
import { runCronIsolatedAgentTurn } from "../cron/isolated-agent.js";
|
import { runCronIsolatedAgentTurn } from "../cron/isolated-agent.js";
|
||||||
import { appendCronRunLog, resolveCronRunLogPath } from "../cron/run-log.js";
|
import { appendCronRunLog, resolveCronRunLogPath } from "../cron/run-log.js";
|
||||||
import { CronService } from "../cron/service.js";
|
import { CronService } from "../cron/service.js";
|
||||||
@@ -69,9 +66,7 @@ import {
|
|||||||
enableTailscaleServe,
|
enableTailscaleServe,
|
||||||
getTailnetHostname,
|
getTailnetHostname,
|
||||||
} from "../infra/tailscale.js";
|
} from "../infra/tailscale.js";
|
||||||
import {
|
import { loadVoiceWakeConfig } from "../infra/voicewake.js";
|
||||||
loadVoiceWakeConfig,
|
|
||||||
} from "../infra/voicewake.js";
|
|
||||||
import {
|
import {
|
||||||
WIDE_AREA_DISCOVERY_DOMAIN,
|
WIDE_AREA_DISCOVERY_DOMAIN,
|
||||||
writeWideAreaBridgeZone,
|
writeWideAreaBridgeZone,
|
||||||
@@ -98,6 +93,10 @@ import {
|
|||||||
isLoopbackHost,
|
isLoopbackHost,
|
||||||
resolveGatewayBindHost,
|
resolveGatewayBindHost,
|
||||||
} from "./net.js";
|
} from "./net.js";
|
||||||
|
import { createBridgeHandlers } from "./server-bridge.js";
|
||||||
|
import { createBridgeSubscriptionManager } from "./server-bridge-subscriptions.js";
|
||||||
|
import { startBrowserControlServerIfEnabled } from "./server-browser.js";
|
||||||
|
import { createAgentEventHandler, createChatRunState } from "./server-chat.js";
|
||||||
import {
|
import {
|
||||||
DEDUPE_MAX,
|
DEDUPE_MAX,
|
||||||
DEDUPE_TTL_MS,
|
DEDUPE_TTL_MS,
|
||||||
@@ -107,13 +106,6 @@ import {
|
|||||||
MAX_PAYLOAD_BYTES,
|
MAX_PAYLOAD_BYTES,
|
||||||
TICK_INTERVAL_MS,
|
TICK_INTERVAL_MS,
|
||||||
} from "./server-constants.js";
|
} from "./server-constants.js";
|
||||||
import { startBrowserControlServerIfEnabled } from "./server-browser.js";
|
|
||||||
import { createBridgeHandlers } from "./server-bridge.js";
|
|
||||||
import { createBridgeSubscriptionManager } from "./server-bridge-subscriptions.js";
|
|
||||||
import {
|
|
||||||
createAgentEventHandler,
|
|
||||||
createChatRunState,
|
|
||||||
} from "./server-chat.js";
|
|
||||||
import {
|
import {
|
||||||
formatBonjourInstanceName,
|
formatBonjourInstanceName,
|
||||||
resolveBonjourCliPath,
|
resolveBonjourCliPath,
|
||||||
@@ -126,8 +118,8 @@ import {
|
|||||||
} from "./server-http.js";
|
} from "./server-http.js";
|
||||||
import { handleGatewayRequest } from "./server-methods.js";
|
import { handleGatewayRequest } from "./server-methods.js";
|
||||||
import { createProviderManager } from "./server-providers.js";
|
import { createProviderManager } from "./server-providers.js";
|
||||||
import { formatError } from "./server-utils.js";
|
|
||||||
import type { DedupeEntry } from "./server-shared.js";
|
import type { DedupeEntry } from "./server-shared.js";
|
||||||
|
import { formatError } from "./server-utils.js";
|
||||||
import { formatForLog, logWs, summarizeAgentEventForWsLog } from "./ws-log.js";
|
import { formatForLog, logWs, summarizeAgentEventForWsLog } from "./ws-log.js";
|
||||||
|
|
||||||
ensureClawdisCliOnPath();
|
ensureClawdisCliOnPath();
|
||||||
|
|||||||
Reference in New Issue
Block a user