diff --git a/apps/macos/Sources/ClawdbotProtocol/GatewayModels.swift b/apps/macos/Sources/ClawdbotProtocol/GatewayModels.swift index 114091b1f..ec6637e22 100644 --- a/apps/macos/Sources/ClawdbotProtocol/GatewayModels.swift +++ b/apps/macos/Sources/ClawdbotProtocol/GatewayModels.swift @@ -1632,6 +1632,51 @@ public struct LogsTailResult: Codable, Sendable { } } +public struct ExecApprovalsGetParams: Codable, Sendable { +} + +public struct ExecApprovalsSetParams: Codable, Sendable { + public let file: [String: AnyCodable] + public let basehash: String? + + public init( + file: [String: AnyCodable], + basehash: String? + ) { + self.file = file + self.basehash = basehash + } + private enum CodingKeys: String, CodingKey { + case file + case basehash = "baseHash" + } +} + +public struct ExecApprovalsSnapshot: Codable, Sendable { + public let path: String + public let exists: Bool + public let hash: String + public let file: [String: AnyCodable] + + public init( + path: String, + exists: Bool, + hash: String, + file: [String: AnyCodable] + ) { + self.path = path + self.exists = exists + self.hash = hash + self.file = file + } + private enum CodingKeys: String, CodingKey { + case path + case exists + case hash + case file + } +} + public struct ChatHistoryParams: Codable, Sendable { public let sessionkey: String public let limit: Int? diff --git a/src/agents/pi-embedded-runner.run-embedded-pi-agent.writes-models-json-into-provided-agentdir.test.ts b/src/agents/pi-embedded-runner.run-embedded-pi-agent.writes-models-json-into-provided-agentdir.test.ts index b0ffadbdb..8cfabe90c 100644 --- a/src/agents/pi-embedded-runner.run-embedded-pi-agent.writes-models-json-into-provided-agentdir.test.ts +++ b/src/agents/pi-embedded-runner.run-embedded-pi-agent.writes-models-json-into-provided-agentdir.test.ts @@ -56,9 +56,8 @@ const buildAssistantErrorMessage = (model: { api: string; provider: string; id: const mockPiAi = () => { vi.doMock("@mariozechner/pi-ai", async () => { - const actual = await vi.importActual( - "@mariozechner/pi-ai", - ); + const actual = + await vi.importActual("@mariozechner/pi-ai"); return { ...actual, complete: async (model: { api: string; provider: string; id: string }) => { diff --git a/src/auto-reply/reply/route-reply.test.ts b/src/auto-reply/reply/route-reply.test.ts index 66b3727fb..ac5b7a623 100644 --- a/src/auto-reply/reply/route-reply.test.ts +++ b/src/auto-reply/reply/route-reply.test.ts @@ -352,7 +352,11 @@ const emptyRegistry = createRegistry([]); const defaultRegistry = createTestRegistry([ { pluginId: "discord", - plugin: createOutboundTestPlugin({ id: "discord", outbound: discordOutbound, label: "Discord" }), + plugin: createOutboundTestPlugin({ + id: "discord", + outbound: discordOutbound, + label: "Discord", + }), source: "test", }, { diff --git a/src/gateway/server-methods/exec-approvals.ts b/src/gateway/server-methods/exec-approvals.ts index ef061793b..2127752fd 100644 --- a/src/gateway/server-methods/exec-approvals.ts +++ b/src/gateway/server-methods/exec-approvals.ts @@ -130,9 +130,7 @@ export const execApprovalsHandlers: GatewayRequestHandlers = { const currentSocketPath = snapshot.file.socket?.path?.trim(); const currentToken = snapshot.file.socket?.token?.trim(); const socketPath = - normalized.socket?.path?.trim() ?? - currentSocketPath ?? - resolveExecApprovalsSocketPath(); + normalized.socket?.path?.trim() ?? currentSocketPath ?? resolveExecApprovalsSocketPath(); const token = normalized.socket?.token?.trim() ?? currentToken ?? ""; const next: ExecApprovalsFile = { ...normalized, diff --git a/src/gateway/server-methods/send.test.ts b/src/gateway/server-methods/send.test.ts index ae3c6daed..0f437160c 100644 --- a/src/gateway/server-methods/send.test.ts +++ b/src/gateway/server-methods/send.test.ts @@ -9,9 +9,8 @@ const mocks = vi.hoisted(() => ({ })); vi.mock("../../config/config.js", async () => { - const actual = await vi.importActual( - "../../config/config.js", - ); + const actual = + await vi.importActual("../../config/config.js"); return { ...actual, loadConfig: () => ({}), diff --git a/src/plugin-sdk/index.ts b/src/plugin-sdk/index.ts index 402e1a758..18fdeedb5 100644 --- a/src/plugin-sdk/index.ts +++ b/src/plugin-sdk/index.ts @@ -212,11 +212,11 @@ export { resolveDiscordAccount, type ResolvedDiscordAccount, } from "../discord/accounts.js"; +export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds } from "../discord/audit.js"; export { - auditDiscordChannelPermissions, - collectDiscordAuditChannelIds, -} from "../discord/audit.js"; -export { listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive } from "../discord/directory-live.js"; + listDiscordDirectoryGroupsLive, + listDiscordDirectoryPeersLive, +} from "../discord/directory-live.js"; export { probeDiscord } from "../discord/probe.js"; export { resolveDiscordChannelAllowlist } from "../discord/resolve-channels.js"; export { resolveDiscordUserAllowlist } from "../discord/resolve-users.js"; @@ -238,7 +238,10 @@ export { resolveSlackAccount, type ResolvedSlackAccount, } from "../slack/accounts.js"; -export { listSlackDirectoryGroupsLive, listSlackDirectoryPeersLive } from "../slack/directory-live.js"; +export { + listSlackDirectoryGroupsLive, + listSlackDirectoryPeersLive, +} from "../slack/directory-live.js"; export { probeSlack } from "../slack/probe.js"; export { resolveSlackChannelAllowlist } from "../slack/resolve-channels.js"; export { resolveSlackUserAllowlist } from "../slack/resolve-users.js"; diff --git a/src/plugins/loader.ts b/src/plugins/loader.ts index 0e0e2ae83..5d03bd50a 100644 --- a/src/plugins/loader.ts +++ b/src/plugins/loader.ts @@ -46,13 +46,7 @@ const registryCache = new Map(); const defaultLogger = () => createSubsystemLogger("plugins"); -const BUNDLED_ENABLED_BY_DEFAULT = new Set([ - "telegram", - "whatsapp", - "discord", - "slack", - "signal", -]); +const BUNDLED_ENABLED_BY_DEFAULT = new Set(["telegram", "whatsapp", "discord", "slack", "signal"]); const normalizeList = (value: unknown): string[] => { if (!Array.isArray(value)) return []; diff --git a/src/test-utils/channel-plugins.ts b/src/test-utils/channel-plugins.ts index 9dfde438e..66ff0be87 100644 --- a/src/test-utils/channel-plugins.ts +++ b/src/test-utils/channel-plugins.ts @@ -8,9 +8,7 @@ import type { import type { PluginRegistry } from "../plugins/registry.js"; import { normalizeIMessageHandle } from "../imessage/targets.js"; -export const createTestRegistry = ( - channels: PluginRegistry["channels"] = [], -): PluginRegistry => ({ +export const createTestRegistry = (channels: PluginRegistry["channels"] = []): PluginRegistry => ({ plugins: [], tools: [], hooks: [], diff --git a/test/setup.ts b/test/setup.ts index 2b4c01ce1..6c532b0c2 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,6 +1,10 @@ import { afterEach, beforeEach, vi } from "vitest"; -import type { ChannelId, ChannelOutboundAdapter, ChannelPlugin } from "../src/channels/plugins/types.js"; +import type { + ChannelId, + ChannelOutboundAdapter, + ChannelPlugin, +} from "../src/channels/plugins/types.js"; import type { ClawdbotConfig } from "../src/config/config.js"; import type { OutboundSendDeps } from "../src/infra/outbound/deliver.js"; import { setActivePluginRegistry } from "../src/plugins/runtime.js"; @@ -97,8 +101,16 @@ const createStubPlugin = (params: { const createDefaultRegistry = () => createTestRegistry([ - { pluginId: "discord", plugin: createStubPlugin({ id: "discord", label: "Discord" }), source: "test" }, - { pluginId: "slack", plugin: createStubPlugin({ id: "slack", label: "Slack" }), source: "test" }, + { + pluginId: "discord", + plugin: createStubPlugin({ id: "discord", label: "Discord" }), + source: "test", + }, + { + pluginId: "slack", + plugin: createStubPlugin({ id: "slack", label: "Slack" }), + source: "test", + }, { pluginId: "telegram", plugin: { @@ -122,7 +134,11 @@ const createDefaultRegistry = () => }), source: "test", }, - { pluginId: "signal", plugin: createStubPlugin({ id: "signal", label: "Signal" }), source: "test" }, + { + pluginId: "signal", + plugin: createStubPlugin({ id: "signal", label: "Signal" }), + source: "test", + }, { pluginId: "imessage", plugin: createStubPlugin({ id: "imessage", label: "iMessage", aliases: ["imsg"] }),