fix: unbreak TypeScript build
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
- Auto-reply: strip stray leading/trailing `HEARTBEAT_OK` from normal replies; drop short (≤ 30 chars) heartbeat acks.
|
- 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.
|
- 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.
|
- 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: switch imsg installer to brew tap formula.
|
||||||
- Skills: gate macOS-only skills by OS and surface block reasons in the Skills UI.
|
- 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.
|
- Onboarding: show skill descriptions in the macOS setup flow and surface clearer Gateway/skills error messages.
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
|||||||
const allowFrom =
|
const allowFrom =
|
||||||
opts.allowFrom ?? dmConfig?.allowFrom ?? cfg.discord?.allowFrom;
|
opts.allowFrom ?? dmConfig?.allowFrom ?? cfg.discord?.allowFrom;
|
||||||
const guildAllowFrom =
|
const guildAllowFrom =
|
||||||
opts.guildAllowFrom ?? guildConfig?.allowFrom ?? cfg.discord?.guildAllowFrom;
|
opts.guildAllowFrom ??
|
||||||
|
guildConfig?.allowFrom ??
|
||||||
|
cfg.discord?.guildAllowFrom;
|
||||||
const guildChannels = guildConfig?.channels;
|
const guildChannels = guildConfig?.channels;
|
||||||
const requireMention =
|
const requireMention =
|
||||||
opts.requireMention ??
|
opts.requireMention ??
|
||||||
@@ -126,10 +128,8 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
|||||||
if (!message.author) return;
|
if (!message.author) return;
|
||||||
|
|
||||||
const channelType = message.channel.type;
|
const channelType = message.channel.type;
|
||||||
const isGroupDm = channelType === ChannelType.GroupDM;
|
|
||||||
const isDirectMessage = channelType === ChannelType.DM;
|
const isDirectMessage = channelType === ChannelType.DM;
|
||||||
const isGuildMessage = Boolean(message.guild);
|
const isGuildMessage = Boolean(message.guild);
|
||||||
if (isGroupDm) return;
|
|
||||||
if (isDirectMessage && !dmEnabled) return;
|
if (isDirectMessage && !dmEnabled) return;
|
||||||
const botId = client.user?.id;
|
const botId = client.user?.id;
|
||||||
const wasMentioned =
|
const wasMentioned =
|
||||||
@@ -249,8 +249,6 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
|||||||
|
|
||||||
const fromLabel = isDirectMessage
|
const fromLabel = isDirectMessage
|
||||||
? buildDirectLabel(message)
|
? buildDirectLabel(message)
|
||||||
: isGroupDm
|
|
||||||
? buildGroupDmLabel(message)
|
|
||||||
: buildGuildLabel(message);
|
: buildGuildLabel(message);
|
||||||
const groupSubject = (() => {
|
const groupSubject = (() => {
|
||||||
if (isDirectMessage) return undefined;
|
if (isDirectMessage) return undefined;
|
||||||
@@ -416,13 +414,6 @@ function buildDirectLabel(message: import("discord.js").Message) {
|
|||||||
return `${username} id:${message.author.id}`;
|
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) {
|
function buildGuildLabel(message: import("discord.js").Message) {
|
||||||
const channelName =
|
const channelName =
|
||||||
"name" in message.channel ? message.channel.name : message.channelId;
|
"name" in message.channel ? message.channel.name : message.channelId;
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ export type HookMappingResolved = {
|
|||||||
messageTemplate?: string;
|
messageTemplate?: string;
|
||||||
textTemplate?: string;
|
textTemplate?: string;
|
||||||
deliver?: boolean;
|
deliver?: boolean;
|
||||||
channel?: "last" | "whatsapp" | "telegram" | "discord";
|
channel?:
|
||||||
|
| "last"
|
||||||
|
| "whatsapp"
|
||||||
|
| "telegram"
|
||||||
|
| "discord"
|
||||||
|
| "signal"
|
||||||
|
| "imessage";
|
||||||
to?: string;
|
to?: string;
|
||||||
thinking?: string;
|
thinking?: string;
|
||||||
timeoutSeconds?: number;
|
timeoutSeconds?: number;
|
||||||
@@ -50,7 +56,13 @@ export type HookAction =
|
|||||||
wakeMode: "now" | "next-heartbeat";
|
wakeMode: "now" | "next-heartbeat";
|
||||||
sessionKey?: string;
|
sessionKey?: string;
|
||||||
deliver?: boolean;
|
deliver?: boolean;
|
||||||
channel?: "last" | "whatsapp" | "telegram" | "discord";
|
channel?:
|
||||||
|
| "last"
|
||||||
|
| "whatsapp"
|
||||||
|
| "telegram"
|
||||||
|
| "discord"
|
||||||
|
| "signal"
|
||||||
|
| "imessage";
|
||||||
to?: string;
|
to?: string;
|
||||||
thinking?: string;
|
thinking?: string;
|
||||||
timeoutSeconds?: number;
|
timeoutSeconds?: number;
|
||||||
@@ -86,7 +98,7 @@ type HookTransformResult = Partial<{
|
|||||||
name: string;
|
name: string;
|
||||||
sessionKey: string;
|
sessionKey: string;
|
||||||
deliver: boolean;
|
deliver: boolean;
|
||||||
channel: "last" | "whatsapp" | "telegram" | "discord";
|
channel: "last" | "whatsapp" | "telegram" | "discord" | "signal" | "imessage";
|
||||||
to: string;
|
to: string;
|
||||||
thinking: string;
|
thinking: string;
|
||||||
timeoutSeconds: number;
|
timeoutSeconds: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user