diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a43e1b0c..efaced221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Auto-reply: strip stray leading/trailing `HEARTBEAT_OK` from normal replies; drop short (≤ 30 chars) heartbeat acks. - Logging: trim provider prefix duplication in Discord/Signal/Telegram runtime log lines. - Discord: include recent guild context when replying to mentions and add `discord.historyLimit` to tune how many messages are captured. +- Gateway: fix TypeScript build by aligning hook mapping `channel` types and removing a dead Group DM branch in Discord monitor. - Skills: switch imsg installer to brew tap formula. - Skills: gate macOS-only skills by OS and surface block reasons in the Skills UI. - Onboarding: show skill descriptions in the macOS setup flow and surface clearer Gateway/skills error messages. diff --git a/src/discord/monitor.ts b/src/discord/monitor.ts index e6159c8d9..a7ea34e56 100644 --- a/src/discord/monitor.ts +++ b/src/discord/monitor.ts @@ -81,7 +81,9 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) { const allowFrom = opts.allowFrom ?? dmConfig?.allowFrom ?? cfg.discord?.allowFrom; const guildAllowFrom = - opts.guildAllowFrom ?? guildConfig?.allowFrom ?? cfg.discord?.guildAllowFrom; + opts.guildAllowFrom ?? + guildConfig?.allowFrom ?? + cfg.discord?.guildAllowFrom; const guildChannels = guildConfig?.channels; const requireMention = opts.requireMention ?? @@ -126,10 +128,8 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) { if (!message.author) return; const channelType = message.channel.type; - const isGroupDm = channelType === ChannelType.GroupDM; const isDirectMessage = channelType === ChannelType.DM; const isGuildMessage = Boolean(message.guild); - if (isGroupDm) return; if (isDirectMessage && !dmEnabled) return; const botId = client.user?.id; const wasMentioned = @@ -249,9 +249,7 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) { const fromLabel = isDirectMessage ? buildDirectLabel(message) - : isGroupDm - ? buildGroupDmLabel(message) - : buildGuildLabel(message); + : buildGuildLabel(message); const groupSubject = (() => { if (isDirectMessage) return undefined; const channelName = @@ -416,13 +414,6 @@ function buildDirectLabel(message: import("discord.js").Message) { return `${username} id:${message.author.id}`; } -function buildGroupDmLabel(message: import("discord.js").Message) { - const channelName = - "name" in message.channel ? message.channel.name : undefined; - const name = channelName ? ` ${channelName}` : ""; - return `Group DM${name} id:${message.channelId}`; -} - function buildGuildLabel(message: import("discord.js").Message) { const channelName = "name" in message.channel ? message.channel.name : message.channelId; diff --git a/src/gateway/hooks-mapping.ts b/src/gateway/hooks-mapping.ts index 1d29d786b..0b2ee8132 100644 --- a/src/gateway/hooks-mapping.ts +++ b/src/gateway/hooks-mapping.ts @@ -18,7 +18,13 @@ export type HookMappingResolved = { messageTemplate?: string; textTemplate?: string; deliver?: boolean; - channel?: "last" | "whatsapp" | "telegram" | "discord"; + channel?: + | "last" + | "whatsapp" + | "telegram" + | "discord" + | "signal" + | "imessage"; to?: string; thinking?: string; timeoutSeconds?: number; @@ -50,7 +56,13 @@ export type HookAction = wakeMode: "now" | "next-heartbeat"; sessionKey?: string; deliver?: boolean; - channel?: "last" | "whatsapp" | "telegram" | "discord"; + channel?: + | "last" + | "whatsapp" + | "telegram" + | "discord" + | "signal" + | "imessage"; to?: string; thinking?: string; timeoutSeconds?: number; @@ -86,7 +98,7 @@ type HookTransformResult = Partial<{ name: string; sessionKey: string; deliver: boolean; - channel: "last" | "whatsapp" | "telegram" | "discord"; + channel: "last" | "whatsapp" | "telegram" | "discord" | "signal" | "imessage"; to: string; thinking: string; timeoutSeconds: number;