@spinabot/brigade 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agent-loop.d.ts.map +1 -1
- package/dist/agents/agent-loop.js +51 -1
- package/dist/agents/agent-loop.js.map +1 -1
- package/dist/agents/channels/bundled-channel-metas.d.ts +2 -0
- package/dist/agents/channels/bundled-channel-metas.d.ts.map +1 -1
- package/dist/agents/channels/bundled-channel-metas.js +11 -0
- package/dist/agents/channels/bundled-channel-metas.js.map +1 -1
- package/dist/agents/channels/discord/account-config.d.ts +177 -0
- package/dist/agents/channels/discord/account-config.d.ts.map +1 -0
- package/dist/agents/channels/discord/account-config.js +349 -0
- package/dist/agents/channels/discord/account-config.js.map +1 -0
- package/dist/agents/channels/discord/adapter.d.ts +79 -0
- package/dist/agents/channels/discord/adapter.d.ts.map +1 -0
- package/dist/agents/channels/discord/adapter.js +693 -0
- package/dist/agents/channels/discord/adapter.js.map +1 -0
- package/dist/agents/channels/discord/approval-authorize.d.ts +43 -0
- package/dist/agents/channels/discord/approval-authorize.d.ts.map +1 -0
- package/dist/agents/channels/discord/approval-authorize.js +71 -0
- package/dist/agents/channels/discord/approval-authorize.js.map +1 -0
- package/dist/agents/channels/discord/approval-native.d.ts +68 -0
- package/dist/agents/channels/discord/approval-native.d.ts.map +1 -0
- package/dist/agents/channels/discord/approval-native.js +81 -0
- package/dist/agents/channels/discord/approval-native.js.map +1 -0
- package/dist/agents/channels/discord/command-menu.d.ts +49 -0
- package/dist/agents/channels/discord/command-menu.d.ts.map +1 -0
- package/dist/agents/channels/discord/command-menu.js +73 -0
- package/dist/agents/channels/discord/command-menu.js.map +1 -0
- package/dist/agents/channels/discord/component-blocks.d.ts +108 -0
- package/dist/agents/channels/discord/component-blocks.d.ts.map +1 -0
- package/dist/agents/channels/discord/component-blocks.js +113 -0
- package/dist/agents/channels/discord/component-blocks.js.map +1 -0
- package/dist/agents/channels/discord/components.d.ts +175 -0
- package/dist/agents/channels/discord/components.d.ts.map +1 -0
- package/dist/agents/channels/discord/components.js +220 -0
- package/dist/agents/channels/discord/components.js.map +1 -0
- package/dist/agents/channels/discord/connection.d.ts +570 -0
- package/dist/agents/channels/discord/connection.d.ts.map +1 -0
- package/dist/agents/channels/discord/connection.js +1600 -0
- package/dist/agents/channels/discord/connection.js.map +1 -0
- package/dist/agents/channels/discord/directory-cache.d.ts +47 -0
- package/dist/agents/channels/discord/directory-cache.d.ts.map +1 -0
- package/dist/agents/channels/discord/directory-cache.js +131 -0
- package/dist/agents/channels/discord/directory-cache.js.map +1 -0
- package/dist/agents/channels/discord/directory-live.d.ts +61 -0
- package/dist/agents/channels/discord/directory-live.d.ts.map +1 -0
- package/dist/agents/channels/discord/directory-live.js +140 -0
- package/dist/agents/channels/discord/directory-live.js.map +1 -0
- package/dist/agents/channels/discord/draft-stream.d.ts +92 -0
- package/dist/agents/channels/discord/draft-stream.d.ts.map +1 -0
- package/dist/agents/channels/discord/draft-stream.js +213 -0
- package/dist/agents/channels/discord/draft-stream.js.map +1 -0
- package/dist/agents/channels/discord/format.d.ts +70 -0
- package/dist/agents/channels/discord/format.d.ts.map +1 -0
- package/dist/agents/channels/discord/format.js +303 -0
- package/dist/agents/channels/discord/format.js.map +1 -0
- package/dist/agents/channels/discord/guilds.d.ts +25 -0
- package/dist/agents/channels/discord/guilds.d.ts.map +1 -0
- package/dist/agents/channels/discord/guilds.js +46 -0
- package/dist/agents/channels/discord/guilds.js.map +1 -0
- package/dist/agents/channels/discord/inbound-extras.d.ts +377 -0
- package/dist/agents/channels/discord/inbound-extras.d.ts.map +1 -0
- package/dist/agents/channels/discord/inbound-extras.js +589 -0
- package/dist/agents/channels/discord/inbound-extras.js.map +1 -0
- package/dist/agents/channels/discord/index.d.ts +21 -0
- package/dist/agents/channels/discord/index.d.ts.map +1 -0
- package/dist/agents/channels/discord/index.js +21 -0
- package/dist/agents/channels/discord/index.js.map +1 -0
- package/dist/agents/channels/discord/media.d.ts +85 -0
- package/dist/agents/channels/discord/media.d.ts.map +1 -0
- package/dist/agents/channels/discord/media.js +242 -0
- package/dist/agents/channels/discord/media.js.map +1 -0
- package/dist/agents/channels/discord/modal-registry.d.ts +89 -0
- package/dist/agents/channels/discord/modal-registry.d.ts.map +1 -0
- package/dist/agents/channels/discord/modal-registry.js +104 -0
- package/dist/agents/channels/discord/modal-registry.js.map +1 -0
- package/dist/agents/channels/discord/modals.d.ts +100 -0
- package/dist/agents/channels/discord/modals.d.ts.map +1 -0
- package/dist/agents/channels/discord/modals.js +124 -0
- package/dist/agents/channels/discord/modals.js.map +1 -0
- package/dist/agents/channels/discord/module.d.ts +15 -0
- package/dist/agents/channels/discord/module.d.ts.map +1 -0
- package/dist/agents/channels/discord/module.js +22 -0
- package/dist/agents/channels/discord/module.js.map +1 -0
- package/dist/agents/channels/discord/permission-audit.d.ts +43 -0
- package/dist/agents/channels/discord/permission-audit.d.ts.map +1 -0
- package/dist/agents/channels/discord/permission-audit.js +192 -0
- package/dist/agents/channels/discord/permission-audit.js.map +1 -0
- package/dist/agents/channels/discord/plugin.d.ts +89 -0
- package/dist/agents/channels/discord/plugin.d.ts.map +1 -0
- package/dist/agents/channels/discord/plugin.js +372 -0
- package/dist/agents/channels/discord/plugin.js.map +1 -0
- package/dist/agents/channels/discord/probe.d.ts +115 -0
- package/dist/agents/channels/discord/probe.d.ts.map +1 -0
- package/dist/agents/channels/discord/probe.js +193 -0
- package/dist/agents/channels/discord/probe.js.map +1 -0
- package/dist/agents/channels/discord/reasoning-lane.d.ts +42 -0
- package/dist/agents/channels/discord/reasoning-lane.d.ts.map +1 -0
- package/dist/agents/channels/discord/reasoning-lane.js +68 -0
- package/dist/agents/channels/discord/reasoning-lane.js.map +1 -0
- package/dist/agents/channels/discord/rest-actions.d.ts +346 -0
- package/dist/agents/channels/discord/rest-actions.d.ts.map +1 -0
- package/dist/agents/channels/discord/rest-actions.js +559 -0
- package/dist/agents/channels/discord/rest-actions.js.map +1 -0
- package/dist/agents/channels/discord/rest-components.d.ts +122 -0
- package/dist/agents/channels/discord/rest-components.d.ts.map +1 -0
- package/dist/agents/channels/discord/rest-components.js +243 -0
- package/dist/agents/channels/discord/rest-components.js.map +1 -0
- package/dist/agents/channels/discord/security-audit.d.ts +29 -0
- package/dist/agents/channels/discord/security-audit.d.ts.map +1 -0
- package/dist/agents/channels/discord/security-audit.js +94 -0
- package/dist/agents/channels/discord/security-audit.js.map +1 -0
- package/dist/agents/channels/discord/security-doctor.d.ts +43 -0
- package/dist/agents/channels/discord/security-doctor.d.ts.map +1 -0
- package/dist/agents/channels/discord/security-doctor.js +83 -0
- package/dist/agents/channels/discord/security-doctor.js.map +1 -0
- package/dist/agents/channels/discord/status-issues.d.ts +37 -0
- package/dist/agents/channels/discord/status-issues.d.ts.map +1 -0
- package/dist/agents/channels/discord/status-issues.js +66 -0
- package/dist/agents/channels/discord/status-issues.js.map +1 -0
- package/dist/agents/channels/discord/subagent-thread-binding-store.d.ts +57 -0
- package/dist/agents/channels/discord/subagent-thread-binding-store.d.ts.map +1 -0
- package/dist/agents/channels/discord/subagent-thread-binding-store.js +98 -0
- package/dist/agents/channels/discord/subagent-thread-binding-store.js.map +1 -0
- package/dist/agents/channels/discord/subagent-thread-binding.d.ts +95 -0
- package/dist/agents/channels/discord/subagent-thread-binding.d.ts.map +1 -0
- package/dist/agents/channels/discord/subagent-thread-binding.js +208 -0
- package/dist/agents/channels/discord/subagent-thread-binding.js.map +1 -0
- package/dist/agents/channels/discord/system-events.d.ts +31 -0
- package/dist/agents/channels/discord/system-events.d.ts.map +1 -0
- package/dist/agents/channels/discord/system-events.js +74 -0
- package/dist/agents/channels/discord/system-events.js.map +1 -0
- package/dist/agents/channels/general-callback.d.ts +12 -0
- package/dist/agents/channels/general-callback.d.ts.map +1 -1
- package/dist/agents/channels/general-callback.js +18 -0
- package/dist/agents/channels/general-callback.js.map +1 -1
- package/dist/agents/channels/inbound-pipeline.d.ts.map +1 -1
- package/dist/agents/channels/inbound-pipeline.js +70 -10
- package/dist/agents/channels/inbound-pipeline.js.map +1 -1
- package/dist/agents/channels/sdk.d.ts +2 -0
- package/dist/agents/channels/sdk.d.ts.map +1 -1
- package/dist/agents/channels/sdk.js +2 -0
- package/dist/agents/channels/sdk.js.map +1 -1
- package/dist/agents/extensions/modules/index.d.ts.map +1 -1
- package/dist/agents/extensions/modules/index.js +5 -0
- package/dist/agents/extensions/modules/index.js.map +1 -1
- package/dist/agents/extensions/types.d.ts +7 -0
- package/dist/agents/extensions/types.d.ts.map +1 -1
- package/dist/agents/extensions/types.js.map +1 -1
- package/dist/agents/subagent-announce-delivery.d.ts +10 -0
- package/dist/agents/subagent-announce-delivery.d.ts.map +1 -1
- package/dist/agents/subagent-announce-delivery.js +1 -0
- package/dist/agents/subagent-announce-delivery.js.map +1 -1
- package/dist/agents/subagent-completion-bridge.d.ts.map +1 -1
- package/dist/agents/subagent-completion-bridge.js +81 -0
- package/dist/agents/subagent-completion-bridge.js.map +1 -1
- package/dist/agents/subagent-spawn.d.ts.map +1 -1
- package/dist/agents/subagent-spawn.js +57 -4
- package/dist/agents/subagent-spawn.js.map +1 -1
- package/dist/agents/tools/cron-tool.d.ts.map +1 -1
- package/dist/agents/tools/cron-tool.js +4 -1
- package/dist/agents/tools/cron-tool.js.map +1 -1
- package/dist/agents/tools/discord-action-tool.d.ts +224 -0
- package/dist/agents/tools/discord-action-tool.d.ts.map +1 -0
- package/dist/agents/tools/discord-action-tool.js +848 -0
- package/dist/agents/tools/discord-action-tool.js.map +1 -0
- package/dist/agents/tools/registry.d.ts.map +1 -1
- package/dist/agents/tools/registry.js +21 -0
- package/dist/agents/tools/registry.js.map +1 -1
- package/dist/agents/tools/sessions/index.d.ts +8 -0
- package/dist/agents/tools/sessions/index.d.ts.map +1 -1
- package/dist/agents/tools/sessions/index.js +15 -3
- package/dist/agents/tools/sessions/index.js.map +1 -1
- package/dist/buildstamp.json +1 -1
- package/dist/cli/commands/channels.d.ts +2 -0
- package/dist/cli/commands/channels.d.ts.map +1 -1
- package/dist/cli/commands/channels.js +58 -1
- package/dist/cli/commands/channels.js.map +1 -1
- package/dist/core/auth-bridge.d.ts +1 -0
- package/dist/core/auth-bridge.d.ts.map +1 -1
- package/dist/core/auth-bridge.js +46 -1
- package/dist/core/auth-bridge.js.map +1 -1
- package/dist/core/server.d.ts.map +1 -1
- package/dist/core/server.js +18 -2
- package/dist/core/server.js.map +1 -1
- package/dist/cron/isolated-agent/run-executor.d.ts +11 -0
- package/dist/cron/isolated-agent/run-executor.d.ts.map +1 -1
- package/dist/cron/isolated-agent/run-executor.js +20 -4
- package/dist/cron/isolated-agent/run-executor.js.map +1 -1
- package/dist/cron/types.d.ts +8 -0
- package/dist/cron/types.d.ts.map +1 -1
- package/dist/system-prompt/assembler.d.ts.map +1 -1
- package/dist/system-prompt/assembler.js +4 -2
- package/dist/system-prompt/assembler.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discord guild listing — the cheap `GET /users/@me/guilds` call the directory
|
|
3
|
+
* + diagnostics build on.
|
|
4
|
+
*
|
|
5
|
+
* Like `probe.ts` this is a SELF-CONTAINED REST call (no `discord.js`, no
|
|
6
|
+
* Gateway socket): a single authenticated GET that returns the bot's joined
|
|
7
|
+
* guilds. The directory walks these to enumerate members + channels; the
|
|
8
|
+
* permission audit doesn't need them but other diagnostics might. Injectable
|
|
9
|
+
* fetch (tests stub it); never throws — a failed call returns `[]`.
|
|
10
|
+
*/
|
|
11
|
+
const DISCORD_API_BASE = "https://discord.com/api/v10";
|
|
12
|
+
/**
|
|
13
|
+
* List the guilds the bot is a member of via `GET /users/@me/guilds`. Returns
|
|
14
|
+
* `{ id, name }` rows, skipping malformed entries. Best-effort: a network error
|
|
15
|
+
* / non-ok / unparseable body returns `[]` (the caller degrades gracefully).
|
|
16
|
+
* The token rides in the `Authorization: Bot <token>` header; never logged.
|
|
17
|
+
*/
|
|
18
|
+
export async function listDiscordGuilds(token, fetchImpl = fetch) {
|
|
19
|
+
const clean = (token ?? "").trim();
|
|
20
|
+
if (!clean)
|
|
21
|
+
return [];
|
|
22
|
+
try {
|
|
23
|
+
const res = await fetchImpl(`${DISCORD_API_BASE}/users/@me/guilds`, {
|
|
24
|
+
method: "GET",
|
|
25
|
+
headers: { Authorization: `Bot ${clean}`, "content-type": "application/json" },
|
|
26
|
+
});
|
|
27
|
+
if (!res.ok)
|
|
28
|
+
return [];
|
|
29
|
+
const body = (await res.json());
|
|
30
|
+
if (!Array.isArray(body))
|
|
31
|
+
return [];
|
|
32
|
+
const out = [];
|
|
33
|
+
for (const g of body) {
|
|
34
|
+
const id = typeof g?.id === "string" ? g.id.trim() : "";
|
|
35
|
+
const name = typeof g?.name === "string" ? g.name.trim() : "";
|
|
36
|
+
if (!id || !name)
|
|
37
|
+
continue;
|
|
38
|
+
out.push({ id, name });
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=guilds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guilds.js","sourceRoot":"","sources":["../../../../src/agents/channels/discord/guilds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAUvD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,KAAa,EACb,YAA0B,KAAK;IAE/B,MAAM,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,gBAAgB,mBAAmB,EAAE;YACnE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;SAC9E,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA4C,CAAC;QAC3E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QACpC,MAAM,GAAG,GAA0B,EAAE,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACtB,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9D,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI;gBAAE,SAAS;YAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure extractors that turn a discord.js message / reaction / interaction into
|
|
3
|
+
* the normalized fields Brigade's `InboundMessage` carries. No network, no side
|
|
4
|
+
* effects — every function here is deterministic over its argument so they're
|
|
5
|
+
* trivial to unit-test without a live gateway.
|
|
6
|
+
*
|
|
7
|
+
* Discord's wire shape (rich discord.js objects, not raw JSON like Slack's
|
|
8
|
+
* Events API) differs from Slack/Telegram in load-bearing ways, so the logic is
|
|
9
|
+
* a Brigade-native re-implementation that models the SHAPE of
|
|
10
|
+
* `slack/inbound-extras.ts` (raw payload → normalized signals) while speaking
|
|
11
|
+
* Discord semantics:
|
|
12
|
+
*
|
|
13
|
+
* - Text arrives as `message.content` peppered with Discord TOKENS: `<@123>`
|
|
14
|
+
* / `<@!123>` (user/member), `<@&456>` (role), `<#789>` (channel),
|
|
15
|
+
* `<:name:111>` / `<a:name:111>` (custom emoji). {@link extractDiscordText}
|
|
16
|
+
* expands user/channel/role mentions into readable plain text the agent can
|
|
17
|
+
* parse (`@alex`, `#general`), resolving names via an injected cache when one
|
|
18
|
+
* is supplied (the cached guild/client primes them in the background).
|
|
19
|
+
* - The bot is "addressed" when its own user id appears as a `<@123>` mention.
|
|
20
|
+
* {@link extractDiscordMentions} surfaces the bot's id when addressed so the
|
|
21
|
+
* central group ACL admits the message — exactly as Slack surfaces the bot's
|
|
22
|
+
* id. Every OTHER user mention is surfaced too.
|
|
23
|
+
* - Channel kind: a DM channel → `direct`; a guild text channel / thread →
|
|
24
|
+
* `group` (see {@link discordChannelType}).
|
|
25
|
+
* - Threads ride on the channel being a thread (`threadId` = the thread
|
|
26
|
+
* channel id); the parent text channel is the conversation root.
|
|
27
|
+
* - Reply context rides on `message.reference.messageId`.
|
|
28
|
+
* - Attachments arrive as `message.attachments` (each a CDN `url` + metadata);
|
|
29
|
+
* the connection layer DEFERS the byte download until the access gate admits
|
|
30
|
+
* the sender (mirrors Slack/Telegram's deferred-media discipline).
|
|
31
|
+
*
|
|
32
|
+
* Brigade's CENTRAL inbound pipeline owns the actual ACL / mention / routing
|
|
33
|
+
* decision — these helpers only surface the raw signals it reads.
|
|
34
|
+
*/
|
|
35
|
+
import type { InboundReplyContext } from "../sdk.js";
|
|
36
|
+
/** One attachment discord.js exposes on a message (the subset we read). */
|
|
37
|
+
export interface DiscordAttachmentLike {
|
|
38
|
+
id?: string;
|
|
39
|
+
name?: string | null;
|
|
40
|
+
/** CDN download URL (cdn.discordapp.com / media.discordapp.net). */
|
|
41
|
+
url?: string;
|
|
42
|
+
proxyURL?: string;
|
|
43
|
+
contentType?: string | null;
|
|
44
|
+
size?: number;
|
|
45
|
+
/** Discord marks voice messages with this flag-bit set; we treat them as voice. */
|
|
46
|
+
flags?: {
|
|
47
|
+
has?: (bit: unknown) => boolean;
|
|
48
|
+
} | number;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* One sticker item on a message (`message.stickers` collection, or raw
|
|
53
|
+
* `sticker_items`). Discord stickers carry an `id`, a `name`, and a
|
|
54
|
+
* `format` / `format_type` enum (1=PNG, 2=APNG, 3=Lottie, 4=GIF) that selects
|
|
55
|
+
* the CDN extension. We download them from `media.discordapp.net/stickers/<id>`.
|
|
56
|
+
*/
|
|
57
|
+
export interface DiscordStickerLike {
|
|
58
|
+
id?: string;
|
|
59
|
+
name?: string | null;
|
|
60
|
+
/** discord.js exposes the enum as `format`; the raw gateway payload as `format_type`. */
|
|
61
|
+
format?: number;
|
|
62
|
+
format_type?: number;
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
/** One embed on a message (the subset Brigade folds into the assembled text). */
|
|
66
|
+
export interface DiscordEmbedLike {
|
|
67
|
+
title?: string | null;
|
|
68
|
+
description?: string | null;
|
|
69
|
+
url?: string | null;
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A forwarded-message snapshot. Discord delivers a forward as a
|
|
74
|
+
* `message_snapshots` array (raw) / `messageSnapshots` (discord.js Collection),
|
|
75
|
+
* each wrapping a frozen copy of the original under `.message`. The snapshot
|
|
76
|
+
* carries the original's content, embeds, attachments, stickers, and author.
|
|
77
|
+
*/
|
|
78
|
+
export interface DiscordSnapshotMessageLike {
|
|
79
|
+
content?: string | null;
|
|
80
|
+
embeds?: DiscordEmbedLike[] | null;
|
|
81
|
+
attachments?: Iterable<DiscordAttachmentLike> | Map<string, DiscordAttachmentLike> | DiscordAttachmentLike[] | null;
|
|
82
|
+
stickers?: Iterable<DiscordStickerLike> | Map<string, DiscordStickerLike> | DiscordStickerLike[] | null;
|
|
83
|
+
sticker_items?: DiscordStickerLike[] | null;
|
|
84
|
+
author?: {
|
|
85
|
+
id?: string | null;
|
|
86
|
+
username?: string | null;
|
|
87
|
+
globalName?: string | null;
|
|
88
|
+
global_name?: string | null;
|
|
89
|
+
} | null;
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
}
|
|
92
|
+
export interface DiscordSnapshotLike {
|
|
93
|
+
message?: DiscordSnapshotMessageLike | null;
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
}
|
|
96
|
+
/** A discord.js channel (the subset Brigade reads). `isThread()`/`isDMBased()` may be absent on a fake. */
|
|
97
|
+
export interface DiscordChannelLike {
|
|
98
|
+
id?: string;
|
|
99
|
+
/** Discord channel type enum value (0 = guild text, 1 = DM, 11/12 = thread, …). */
|
|
100
|
+
type?: number;
|
|
101
|
+
isThread?: () => boolean;
|
|
102
|
+
isDMBased?: () => boolean;
|
|
103
|
+
/** Parent text-channel id when this channel is a thread. */
|
|
104
|
+
parentId?: string | null;
|
|
105
|
+
/** Fetch a message in this channel by id (reply-parent fallback when `fetchReference` is absent). */
|
|
106
|
+
messages?: {
|
|
107
|
+
fetch?: (id: string) => Promise<DiscordMessageLike | null>;
|
|
108
|
+
};
|
|
109
|
+
[key: string]: unknown;
|
|
110
|
+
}
|
|
111
|
+
/** A discord.js guild (the subset Brigade reads). */
|
|
112
|
+
export interface DiscordGuildLike {
|
|
113
|
+
id?: string;
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The member's roles as Brigade reads them. On a live message discord.js hands
|
|
118
|
+
* a `GuildMemberRoleManager` whose `.cache` is a Collection (a Map subclass)
|
|
119
|
+
* keyed by role id; a fake / partial may pass a plain array of role ids. Both
|
|
120
|
+
* shapes (and an absent value) are honoured by {@link extractDiscordMemberRoleIds}.
|
|
121
|
+
*/
|
|
122
|
+
export type DiscordMemberRolesLike = {
|
|
123
|
+
cache?: Map<string, unknown> | Iterable<[string, unknown]> | Iterable<{
|
|
124
|
+
id?: string;
|
|
125
|
+
}>;
|
|
126
|
+
} | Iterable<string> | string[] | null | undefined;
|
|
127
|
+
/** A discord.js user / author (the subset Brigade reads). */
|
|
128
|
+
export interface DiscordUserLike {
|
|
129
|
+
id?: string;
|
|
130
|
+
bot?: boolean;
|
|
131
|
+
username?: string;
|
|
132
|
+
globalName?: string | null;
|
|
133
|
+
/** Cached member display name (guild nickname), when discord.js resolved one. */
|
|
134
|
+
displayName?: string;
|
|
135
|
+
[key: string]: unknown;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A discord.js Message (the subset Brigade consumes). Only the fields used are
|
|
139
|
+
* typed; the live object carries far more.
|
|
140
|
+
*/
|
|
141
|
+
export interface DiscordMessageLike {
|
|
142
|
+
id?: string;
|
|
143
|
+
content?: string;
|
|
144
|
+
author?: DiscordUserLike;
|
|
145
|
+
/**
|
|
146
|
+
* The member who sent it (guild nickname lives here). `roles` is discord.js's
|
|
147
|
+
* `GuildMemberRoleManager` (a `.cache` Collection keyed by role id) on a live
|
|
148
|
+
* message; a fake / partial may instead carry a plain array of role ids.
|
|
149
|
+
*/
|
|
150
|
+
member?: {
|
|
151
|
+
nickname?: string | null;
|
|
152
|
+
displayName?: string;
|
|
153
|
+
roles?: DiscordMemberRolesLike;
|
|
154
|
+
} | null;
|
|
155
|
+
channelId?: string;
|
|
156
|
+
channel?: DiscordChannelLike;
|
|
157
|
+
guildId?: string | null;
|
|
158
|
+
guild?: DiscordGuildLike | null;
|
|
159
|
+
/** Epoch ms the message was created. */
|
|
160
|
+
createdTimestamp?: number;
|
|
161
|
+
/** Set when the message was edited (epoch ms), else null. */
|
|
162
|
+
editedTimestamp?: number | null;
|
|
163
|
+
/**
|
|
164
|
+
* Reply / forward pointer. `messageId` is the referenced message; `type` is the
|
|
165
|
+
* reference KIND — `0` (default / absent) is a reply, `1` is a forward. discord.js
|
|
166
|
+
* also exposes the raw shape as `messageReference` with `type`.
|
|
167
|
+
*/
|
|
168
|
+
reference?: {
|
|
169
|
+
messageId?: string | null;
|
|
170
|
+
channelId?: string | null;
|
|
171
|
+
guildId?: string | null;
|
|
172
|
+
type?: number | null;
|
|
173
|
+
} | null;
|
|
174
|
+
messageReference?: {
|
|
175
|
+
messageId?: string | null;
|
|
176
|
+
type?: number | null;
|
|
177
|
+
} | null;
|
|
178
|
+
/**
|
|
179
|
+
* The resolved reply-parent message, when discord.js already cached it (it sends
|
|
180
|
+
* the referenced message inline with a Gateway MESSAGE_CREATE for a reply). Lets
|
|
181
|
+
* the reply-context resolve the parent's author SYNCHRONOUSLY — so a guild
|
|
182
|
+
* reply-to-bot is admitted even if the async body-backfill fetch later fails.
|
|
183
|
+
*/
|
|
184
|
+
referencedMessage?: DiscordMessageLike | null;
|
|
185
|
+
/** First embed's title/description fold into the assembled text when content is empty. */
|
|
186
|
+
embeds?: DiscordEmbedLike[] | null;
|
|
187
|
+
/** Stickers on the message — a `<sticker: name>` placeholder + a downloaded asset. */
|
|
188
|
+
stickers?: Iterable<DiscordStickerLike> | Map<string, DiscordStickerLike> | DiscordStickerLike[] | null;
|
|
189
|
+
/** Raw gateway shape of the sticker list (fallback when `.stickers` is absent). */
|
|
190
|
+
sticker_items?: DiscordStickerLike[] | null;
|
|
191
|
+
/** Forwarded-message snapshots (discord.js Collection / raw array). */
|
|
192
|
+
messageSnapshots?: Iterable<DiscordSnapshotLike> | Map<string, DiscordSnapshotLike> | DiscordSnapshotLike[] | null;
|
|
193
|
+
message_snapshots?: DiscordSnapshotLike[] | null;
|
|
194
|
+
attachments?: Iterable<DiscordAttachmentLike> | Map<string, DiscordAttachmentLike> | DiscordAttachmentLike[];
|
|
195
|
+
/**
|
|
196
|
+
* discord.js `MessageType` enum value. `0` = Default, `19` = Reply; anything
|
|
197
|
+
* else is a SYSTEM message (a join / pin / boost / thread-created / …). Absent
|
|
198
|
+
* on a fake → treated as Default.
|
|
199
|
+
*/
|
|
200
|
+
type?: number;
|
|
201
|
+
/** A resolved Collection of mentioned users, or a plain array on a fake. */
|
|
202
|
+
mentions?: {
|
|
203
|
+
users?: Iterable<DiscordUserLike> | Map<string, DiscordUserLike> | DiscordUserLike[];
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Re-pull this message from the REST API (used to hydrate a late / proxied
|
|
207
|
+
* empty-content payload). discord.js returns the refreshed Message.
|
|
208
|
+
*/
|
|
209
|
+
fetch?: () => Promise<DiscordMessageLike>;
|
|
210
|
+
/** Resolve the message this one replies to (discord.js `Message#fetchReference`). */
|
|
211
|
+
fetchReference?: () => Promise<DiscordMessageLike | null>;
|
|
212
|
+
[key: string]: unknown;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Expand the Discord message TOKENS in a run of text into readable plain text:
|
|
216
|
+
* - `<@123>` / `<@!123>` → `@alex` (resolved name) or `@123`
|
|
217
|
+
* - `<@&456>` → `@role` (resolved) or `@&456`
|
|
218
|
+
* - `<#789>` → `#general` (resolved) or `#789`
|
|
219
|
+
* - `<:name:111>` / `<a:name:111>` → `:name:` (the readable emoji shortcode)
|
|
220
|
+
*
|
|
221
|
+
* Names resolve via the injected lookups (the connection primes them from the
|
|
222
|
+
* cached guild/client); without a resolver the bare id is surfaced. Pure +
|
|
223
|
+
* deterministic.
|
|
224
|
+
*/
|
|
225
|
+
export declare function expandDiscordTokens(text: string, resolve?: {
|
|
226
|
+
user?: (id: string) => string | undefined;
|
|
227
|
+
role?: (id: string) => string | undefined;
|
|
228
|
+
channel?: (id: string) => string | undefined;
|
|
229
|
+
}): string;
|
|
230
|
+
/**
|
|
231
|
+
* The agent-facing plain text of a Discord message. Token-expanded (mentions /
|
|
232
|
+
* channels / roles / emoji → readable text). Binary blobs are dropped to "".
|
|
233
|
+
*/
|
|
234
|
+
export declare function extractDiscordText(message: Pick<DiscordMessageLike, "content">, resolve?: Parameters<typeof expandDiscordTokens>[1]): string;
|
|
235
|
+
/**
|
|
236
|
+
* True when the message is a FORWARD (reference kind `1`) rather than a reply
|
|
237
|
+
* (kind `0` / absent). discord.js exposes the kind on `reference.type`; the raw
|
|
238
|
+
* gateway shape carries it on `messageReference.type`. Used so a forward isn't
|
|
239
|
+
* mistaken for a reply by the reply-context resolver.
|
|
240
|
+
*/
|
|
241
|
+
export declare function isDiscordForward(message: Pick<DiscordMessageLike, "reference" | "messageReference">): boolean;
|
|
242
|
+
/**
|
|
243
|
+
* The first embed's text folded into a readable run: `title` + `description` +
|
|
244
|
+
* (a bare `url` when neither carries it). Returns "" when the message has no
|
|
245
|
+
* embed text. Pure + deterministic.
|
|
246
|
+
*/
|
|
247
|
+
export declare function extractDiscordEmbedText(message: Pick<DiscordMessageLike, "embeds">): string;
|
|
248
|
+
/** The sticker items on a message (the `.stickers` collection, then raw `sticker_items`). */
|
|
249
|
+
export declare function resolveInboundStickers(message: Pick<DiscordMessageLike, "stickers" | "sticker_items">): DiscordStickerLike[];
|
|
250
|
+
/** A `<sticker: name>` placeholder line per sticker, joined by newlines. Returns "" when none. */
|
|
251
|
+
export declare function extractDiscordStickerText(message: Pick<DiscordMessageLike, "stickers" | "sticker_items">): string;
|
|
252
|
+
/** The forwarded-message snapshots on a message (discord.js Collection or raw array). */
|
|
253
|
+
export declare function resolveDiscordSnapshots(message: Pick<DiscordMessageLike, "messageSnapshots" | "message_snapshots">): DiscordSnapshotLike[];
|
|
254
|
+
/**
|
|
255
|
+
* The `[Forwarded from <author>]` block(s) for any forwarded snapshots on the
|
|
256
|
+
* message. Each snapshot becomes a heading + its inner text. A forward whose
|
|
257
|
+
* snapshot has no text still surfaces the heading so the agent learns a forward
|
|
258
|
+
* happened. Returns "" when the message carries no forward snapshots.
|
|
259
|
+
*/
|
|
260
|
+
export declare function extractDiscordForwardedText(message: Pick<DiscordMessageLike, "messageSnapshots" | "message_snapshots">, resolve?: Parameters<typeof expandDiscordTokens>[1]): string;
|
|
261
|
+
/**
|
|
262
|
+
* The full agent-facing text Brigade routes for a Discord message. The message
|
|
263
|
+
* `content` leads (token-expanded); when content is empty we FALL BACK to the
|
|
264
|
+
* first embed's title/description so an embed-only message isn't dropped. A
|
|
265
|
+
* `<sticker: name>` placeholder is APPENDED for any stickers, and a
|
|
266
|
+
* `[Forwarded from …]` block is APPENDED for any forwarded snapshots — so a
|
|
267
|
+
* sticker-only or forward-only message carries real text instead of "".
|
|
268
|
+
*
|
|
269
|
+
* Pure + deterministic; the connection passes a `resolve` lookup so mention
|
|
270
|
+
* tokens expand to readable names.
|
|
271
|
+
*/
|
|
272
|
+
export declare function assembleDiscordText(message: Pick<DiscordMessageLike, "content" | "embeds" | "stickers" | "sticker_items" | "messageSnapshots" | "message_snapshots">, resolve?: Parameters<typeof expandDiscordTokens>[1]): string;
|
|
273
|
+
/** True when a discord.js channel is a thread (uses `isThread()` when present, else the type enum). */
|
|
274
|
+
export declare function isThreadChannel(channel: DiscordChannelLike | undefined | null): boolean;
|
|
275
|
+
/** True when a discord.js channel is a DM (uses `isDMBased()` when present, else the type enum). */
|
|
276
|
+
export declare function isDmChannel(channel: DiscordChannelLike | undefined | null): boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Discord channel → Brigade chat type. A 1:1 DM → `direct`; a guild text channel
|
|
279
|
+
* or a thread → `group`. A group DM (rare for bots) → `group`. When no channel
|
|
280
|
+
* object is available, a missing `guildId` implies a DM.
|
|
281
|
+
*/
|
|
282
|
+
export declare function discordChannelType(message: Pick<DiscordMessageLike, "channel" | "guildId">): "direct" | "group";
|
|
283
|
+
/**
|
|
284
|
+
* The thread channel id when the message landed in a thread, else undefined. The
|
|
285
|
+
* thread's own channel id is the thread id (Discord threads ARE channels).
|
|
286
|
+
*/
|
|
287
|
+
export declare function discordThreadId(message: Pick<DiscordMessageLike, "channel" | "channelId">): string | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* Reply-context (what message this inbound quotes), when it's a reply. Discord
|
|
290
|
+
* carries `message.reference.messageId` (the replied-to message id) but does NOT
|
|
291
|
+
* inline that message's text — so the context surfaces the parent message id and
|
|
292
|
+
* leaves `body` undefined (the connection can fetch the parent if it needs the
|
|
293
|
+
* excerpt). Returns undefined for a non-reply.
|
|
294
|
+
*
|
|
295
|
+
* When discord.js already resolved the reply parent (`message.referencedMessage`,
|
|
296
|
+
* which rides inline on a Gateway reply MESSAGE_CREATE), the parent's author id is
|
|
297
|
+
* captured SYNCHRONOUSLY into `from`. This matters because the central pipeline's
|
|
298
|
+
* group-addressing `isReplyToBot` depends on `replyTo.from === selfId` — if `from`
|
|
299
|
+
* were populated ONLY by the async body-backfill (connection.ts), a guild
|
|
300
|
+
* reply-to-bot whose backfill fetch failed would lose its implicit-mention
|
|
301
|
+
* admission and be dropped. The async backfill still fills `body` (the excerpt).
|
|
302
|
+
*/
|
|
303
|
+
export declare function extractDiscordReplyContext(message: Pick<DiscordMessageLike, "reference" | "messageReference" | "referencedMessage">): InboundReplyContext | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* Channel-native ids of users addressed in this message. Brigade's central group
|
|
306
|
+
* ACL treats a group message as "addressed to the bot" when the bot's own id
|
|
307
|
+
* appears in `mentions`; without this a group message never reaches the agent.
|
|
308
|
+
* So when the bot's own `<@id>` mention appears in the text we surface the bot's
|
|
309
|
+
* id (passed in). Every OTHER user mention is surfaced too so the pipeline sees
|
|
310
|
+
* who else was tagged.
|
|
311
|
+
*
|
|
312
|
+
* We scan BOTH the resolved `message.mentions.users` collection (when present)
|
|
313
|
+
* AND the raw `<@id>` / `<@!id>` tokens in the content, unioned + deduped — the
|
|
314
|
+
* collection is authoritative on a live message, the token scan is the fallback
|
|
315
|
+
* for a fake / a partial.
|
|
316
|
+
*
|
|
317
|
+
* @param botUserId the bot's own user id, surfaced when the bot is mentioned so
|
|
318
|
+
* the ACL admits the group message.
|
|
319
|
+
*/
|
|
320
|
+
export declare function extractDiscordMentions(message: DiscordMessageLike, botUserId?: string): string[];
|
|
321
|
+
/**
|
|
322
|
+
* The guild-role ids the sending member holds, surfaced so the 8-tier route
|
|
323
|
+
* resolver's `binding.guild+roles` tier can match. Role NAMES are never used —
|
|
324
|
+
* only ids. Returns `[]` for a DM (no member) or when no roles resolve.
|
|
325
|
+
*
|
|
326
|
+
* Handles the three shapes the `member.roles` value can take:
|
|
327
|
+
* - discord.js `GuildMemberRoleManager` — a `.cache` Collection (Map subclass)
|
|
328
|
+
* keyed by role id; we read the keys (the role ids).
|
|
329
|
+
* - a plain array / iterable of role-id strings (a fake / partial).
|
|
330
|
+
* - absent / null (a DM, or a message with no resolved member) → `[]`.
|
|
331
|
+
*
|
|
332
|
+
* Pure + deterministic; deduped, with the `@everyone` role (whose id equals the
|
|
333
|
+
* guild id and is implicit for everyone) left in as-is — the resolver only
|
|
334
|
+
* matches ids a binding explicitly lists, so a stray everyone id is harmless.
|
|
335
|
+
*/
|
|
336
|
+
export declare function extractDiscordMemberRoleIds(message: Pick<DiscordMessageLike, "member">): string[];
|
|
337
|
+
/**
|
|
338
|
+
* A short display name for the sender. A guild nickname wins (most specific),
|
|
339
|
+
* then the member/global display name, then the username, then the raw id.
|
|
340
|
+
*/
|
|
341
|
+
export declare function buildDiscordSenderName(message: DiscordMessageLike): string | undefined;
|
|
342
|
+
/**
|
|
343
|
+
* The downloadable CDN URL + content-type for ONE sticker, derived from its
|
|
344
|
+
* `format` enum. PNG/APNG → `.png`, GIF → `.gif`, Lottie (vector) → `.json`
|
|
345
|
+
* (the raw Lottie animation; we don't rasterize). The host is `media.discordapp.net`,
|
|
346
|
+
* already covered by the inbound SSRF allowlist. Returns null when the sticker
|
|
347
|
+
* has no id.
|
|
348
|
+
*/
|
|
349
|
+
export declare function stickerToAttachment(sticker: DiscordStickerLike): DiscordAttachmentLike | null;
|
|
350
|
+
/** Sticker assets on a message, mapped to downloadable attachment descriptors. */
|
|
351
|
+
export declare function resolveInboundStickerAttachments(message: Pick<DiscordMessageLike, "stickers" | "sticker_items">): DiscordAttachmentLike[];
|
|
352
|
+
/**
|
|
353
|
+
* Downloadable attachments carried INSIDE forwarded snapshots (attachments +
|
|
354
|
+
* stickers of each forwarded message). A forward arrives as a frozen snapshot,
|
|
355
|
+
* so its media never appears on `message.attachments` — it has to be pulled out
|
|
356
|
+
* of the snapshot.
|
|
357
|
+
*/
|
|
358
|
+
export declare function resolveForwardedAttachments(message: Pick<DiscordMessageLike, "messageSnapshots" | "message_snapshots">): DiscordAttachmentLike[];
|
|
359
|
+
/** The fields {@link hasInboundMedia} / {@link resolveInboundAttachments} read across the full media surface. */
|
|
360
|
+
type DiscordMediaSurface = Pick<DiscordMessageLike, "attachments" | "stickers" | "sticker_items" | "messageSnapshots" | "message_snapshots">;
|
|
361
|
+
/**
|
|
362
|
+
* Cheap presence probe — does this message carry ANY downloadable media? Walks
|
|
363
|
+
* direct attachments, stickers, AND forwarded-snapshot media but never touches
|
|
364
|
+
* the network, so the connection layer can DEFER the actual download until AFTER
|
|
365
|
+
* the central access gate admits the sender (mirrors Slack/Telegram).
|
|
366
|
+
*/
|
|
367
|
+
export declare function hasInboundMedia(message: DiscordMediaSurface): boolean;
|
|
368
|
+
/**
|
|
369
|
+
* The full list of downloadable attachments to fetch for a message: direct
|
|
370
|
+
* attachments, sticker assets (downloaded from the Discord sticker CDN), and any
|
|
371
|
+
* media carried inside forwarded snapshots.
|
|
372
|
+
*/
|
|
373
|
+
export declare function resolveInboundAttachments(message: DiscordMediaSurface): DiscordAttachmentLike[];
|
|
374
|
+
/** The Brigade media-kind of a Discord attachment, from its contentType / filename / voice flag. */
|
|
375
|
+
export declare function resolveDiscordAttachmentKind(a: DiscordAttachmentLike): "image" | "video" | "audio" | "voice" | "document";
|
|
376
|
+
export {};
|
|
377
|
+
//# sourceMappingURL=inbound-extras.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbound-extras.d.ts","sourceRoot":"","sources":["../../../../src/agents/channels/discord/inbound-extras.ts"],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