@gakr-gakr/discord 0.1.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/account-inspect-api.ts +6 -0
- package/action-runtime-api.ts +1 -0
- package/api.ts +130 -0
- package/autobot.plugin.json +15 -0
- package/channel-config-api.ts +1 -0
- package/channel-plugin-api.ts +3 -0
- package/config-api.ts +4 -0
- package/configured-state.ts +6 -0
- package/contract-api.ts +21 -0
- package/directory-contract-api.ts +4 -0
- package/doctor-contract-api.ts +1 -0
- package/index.ts +24 -0
- package/package.json +79 -0
- package/runtime-api.actions.ts +15 -0
- package/runtime-api.lookup.ts +22 -0
- package/runtime-api.monitor.ts +50 -0
- package/runtime-api.send.ts +79 -0
- package/runtime-api.threads.ts +31 -0
- package/runtime-api.ts +181 -0
- package/runtime-setter-api.ts +3 -0
- package/secret-contract-api.ts +4 -0
- package/security-audit-contract-api.ts +1 -0
- package/security-contract-api.ts +4 -0
- package/session-key-api.ts +1 -0
- package/setup-entry.ts +9 -0
- package/setup-plugin-api.ts +3 -0
- package/src/account-inspect.ts +131 -0
- package/src/accounts.ts +205 -0
- package/src/actions/handle-action.guild-admin.ts +421 -0
- package/src/actions/handle-action.ts +402 -0
- package/src/actions/runtime.guild.ts +446 -0
- package/src/actions/runtime.messaging.messages.ts +226 -0
- package/src/actions/runtime.messaging.reactions.ts +67 -0
- package/src/actions/runtime.messaging.runtime.ts +73 -0
- package/src/actions/runtime.messaging.send.ts +336 -0
- package/src/actions/runtime.messaging.shared.ts +97 -0
- package/src/actions/runtime.messaging.ts +37 -0
- package/src/actions/runtime.moderation-shared.ts +48 -0
- package/src/actions/runtime.moderation.ts +116 -0
- package/src/actions/runtime.presence.ts +117 -0
- package/src/actions/runtime.shared.ts +86 -0
- package/src/actions/runtime.ts +87 -0
- package/src/api.ts +219 -0
- package/src/approval-handler.runtime.ts +636 -0
- package/src/approval-native.ts +219 -0
- package/src/approval-runtime.ts +14 -0
- package/src/approval-shared.ts +56 -0
- package/src/audit-core.ts +178 -0
- package/src/audit.ts +32 -0
- package/src/channel-actions.runtime.ts +1 -0
- package/src/channel-actions.ts +254 -0
- package/src/channel-api.ts +29 -0
- package/src/channel.conversation.ts +159 -0
- package/src/channel.loaders.ts +50 -0
- package/src/channel.runtime.ts +1 -0
- package/src/channel.setup.ts +12 -0
- package/src/channel.ts +728 -0
- package/src/chunk.ts +321 -0
- package/src/client.ts +143 -0
- package/src/component-custom-id.ts +72 -0
- package/src/components-registry.ts +356 -0
- package/src/components.builders.ts +410 -0
- package/src/components.modal.ts +124 -0
- package/src/components.parse.ts +407 -0
- package/src/components.ts +54 -0
- package/src/components.types.ts +187 -0
- package/src/config-schema.ts +6 -0
- package/src/config-ui-hints.ts +354 -0
- package/src/conversation-identity.ts +58 -0
- package/src/delivery-retry.ts +56 -0
- package/src/directory-cache.ts +116 -0
- package/src/directory-config.ts +58 -0
- package/src/directory-live.ts +135 -0
- package/src/doctor-contract.ts +477 -0
- package/src/doctor-shared.ts +5 -0
- package/src/doctor.ts +340 -0
- package/src/draft-chunking.ts +43 -0
- package/src/draft-stream.ts +162 -0
- package/src/error-body.ts +38 -0
- package/src/exec-approvals.ts +110 -0
- package/src/gateway-logging.ts +67 -0
- package/src/group-policy.ts +113 -0
- package/src/guilds.ts +29 -0
- package/src/inbound-event-delivery.ts +135 -0
- package/src/interactive-dispatch.ts +104 -0
- package/src/internal/api.commands.ts +51 -0
- package/src/internal/api.guild.ts +164 -0
- package/src/internal/api.interactions.ts +53 -0
- package/src/internal/api.messages.ts +113 -0
- package/src/internal/api.reactions.ts +38 -0
- package/src/internal/api.ts +61 -0
- package/src/internal/api.users.ts +19 -0
- package/src/internal/api.webhooks.ts +13 -0
- package/src/internal/client.ts +310 -0
- package/src/internal/command-deploy.ts +352 -0
- package/src/internal/commands.ts +188 -0
- package/src/internal/components.base.ts +65 -0
- package/src/internal/components.message.ts +279 -0
- package/src/internal/components.modal.ts +95 -0
- package/src/internal/components.ts +31 -0
- package/src/internal/discord.ts +11 -0
- package/src/internal/embeds.ts +35 -0
- package/src/internal/entity-cache.ts +98 -0
- package/src/internal/event-queue.ts +185 -0
- package/src/internal/gateway-close-codes.ts +25 -0
- package/src/internal/gateway-dispatch.ts +96 -0
- package/src/internal/gateway-identify-limiter.ts +26 -0
- package/src/internal/gateway-lifecycle.ts +75 -0
- package/src/internal/gateway-rate-limit.ts +104 -0
- package/src/internal/gateway.ts +479 -0
- package/src/internal/interaction-dispatch.ts +162 -0
- package/src/internal/interaction-options.ts +98 -0
- package/src/internal/interaction-response.ts +53 -0
- package/src/internal/interactions.ts +378 -0
- package/src/internal/listeners.ts +91 -0
- package/src/internal/modal-fields.ts +95 -0
- package/src/internal/payload.ts +69 -0
- package/src/internal/rest-body.ts +115 -0
- package/src/internal/rest-errors.ts +88 -0
- package/src/internal/rest-routes.ts +50 -0
- package/src/internal/rest-scheduler.ts +557 -0
- package/src/internal/rest.ts +322 -0
- package/src/internal/schemas.ts +36 -0
- package/src/internal/structures.ts +280 -0
- package/src/internal/test-builders.test-support.ts +167 -0
- package/src/internal/voice.ts +49 -0
- package/src/media-detection.ts +28 -0
- package/src/mentions.ts +147 -0
- package/src/monitor/ack-reactions.ts +70 -0
- package/src/monitor/agent-components-auth.ts +7 -0
- package/src/monitor/agent-components-context.ts +154 -0
- package/src/monitor/agent-components-data.ts +224 -0
- package/src/monitor/agent-components-dm-auth.ts +177 -0
- package/src/monitor/agent-components-guild-auth.ts +322 -0
- package/src/monitor/agent-components-helpers.runtime.ts +3 -0
- package/src/monitor/agent-components-helpers.ts +34 -0
- package/src/monitor/agent-components-reply.ts +10 -0
- package/src/monitor/agent-components.deps.runtime.ts +2 -0
- package/src/monitor/agent-components.dispatch.ts +359 -0
- package/src/monitor/agent-components.handlers.ts +303 -0
- package/src/monitor/agent-components.modal.ts +160 -0
- package/src/monitor/agent-components.plugin-interactive.ts +187 -0
- package/src/monitor/agent-components.runtime.ts +14 -0
- package/src/monitor/agent-components.system-controls.ts +215 -0
- package/src/monitor/agent-components.ts +70 -0
- package/src/monitor/agent-components.types.ts +58 -0
- package/src/monitor/agent-components.wildcard-controls.ts +171 -0
- package/src/monitor/allow-list.ts +631 -0
- package/src/monitor/auto-presence.ts +356 -0
- package/src/monitor/channel-access.ts +102 -0
- package/src/monitor/commands.ts +9 -0
- package/src/monitor/dm-command-auth.ts +259 -0
- package/src/monitor/dm-command-decision.ts +49 -0
- package/src/monitor/exec-approvals.ts +161 -0
- package/src/monitor/format.ts +45 -0
- package/src/monitor/gateway-handle.ts +34 -0
- package/src/monitor/gateway-metadata.ts +298 -0
- package/src/monitor/gateway-plugin.ts +302 -0
- package/src/monitor/gateway-registry.ts +37 -0
- package/src/monitor/gateway-supervisor.ts +206 -0
- package/src/monitor/inbound-context.ts +95 -0
- package/src/monitor/inbound-dedupe.ts +79 -0
- package/src/monitor/inbound-job.ts +118 -0
- package/src/monitor/listeners.queue.ts +91 -0
- package/src/monitor/listeners.reactions.ts +594 -0
- package/src/monitor/listeners.ts +150 -0
- package/src/monitor/message-channel-info.ts +96 -0
- package/src/monitor/message-forwarded.ts +114 -0
- package/src/monitor/message-handler.batch-gate.ts +19 -0
- package/src/monitor/message-handler.context.ts +492 -0
- package/src/monitor/message-handler.dm-preflight.ts +119 -0
- package/src/monitor/message-handler.draft-preview.ts +436 -0
- package/src/monitor/message-handler.hydration.ts +198 -0
- package/src/monitor/message-handler.module-test-helpers.ts +31 -0
- package/src/monitor/message-handler.preflight-channel-access.ts +86 -0
- package/src/monitor/message-handler.preflight-channel-context.ts +58 -0
- package/src/monitor/message-handler.preflight-context.ts +54 -0
- package/src/monitor/message-handler.preflight-helpers.ts +164 -0
- package/src/monitor/message-handler.preflight-history.ts +23 -0
- package/src/monitor/message-handler.preflight-logging.ts +36 -0
- package/src/monitor/message-handler.preflight-pluralkit.ts +28 -0
- package/src/monitor/message-handler.preflight-runtime.ts +28 -0
- package/src/monitor/message-handler.preflight-thread.ts +49 -0
- package/src/monitor/message-handler.preflight.ts +822 -0
- package/src/monitor/message-handler.preflight.types.ts +115 -0
- package/src/monitor/message-handler.process.ts +1033 -0
- package/src/monitor/message-handler.routing-preflight.ts +112 -0
- package/src/monitor/message-handler.ts +309 -0
- package/src/monitor/message-media.ts +536 -0
- package/src/monitor/message-run-queue.ts +101 -0
- package/src/monitor/message-text.ts +171 -0
- package/src/monitor/message-utils.ts +34 -0
- package/src/monitor/model-picker-preferences.ts +184 -0
- package/src/monitor/model-picker.state.ts +364 -0
- package/src/monitor/model-picker.test-utils.ts +26 -0
- package/src/monitor/model-picker.ts +38 -0
- package/src/monitor/model-picker.view.ts +722 -0
- package/src/monitor/native-command-agent-reply.ts +125 -0
- package/src/monitor/native-command-arg-ui.ts +233 -0
- package/src/monitor/native-command-auth.ts +309 -0
- package/src/monitor/native-command-bypass.ts +13 -0
- package/src/monitor/native-command-context.ts +109 -0
- package/src/monitor/native-command-dispatch.ts +35 -0
- package/src/monitor/native-command-model-picker-apply.ts +209 -0
- package/src/monitor/native-command-model-picker-interaction.ts +516 -0
- package/src/monitor/native-command-model-picker-ui.ts +357 -0
- package/src/monitor/native-command-reply.ts +185 -0
- package/src/monitor/native-command-route.ts +91 -0
- package/src/monitor/native-command-status.ts +76 -0
- package/src/monitor/native-command-ui.ts +26 -0
- package/src/monitor/native-command-ui.types.ts +20 -0
- package/src/monitor/native-command.args.ts +45 -0
- package/src/monitor/native-command.options.ts +153 -0
- package/src/monitor/native-command.runtime.ts +51 -0
- package/src/monitor/native-command.ts +747 -0
- package/src/monitor/native-command.types.ts +9 -0
- package/src/monitor/native-interaction-channel-context.ts +50 -0
- package/src/monitor/preflight-audio.runtime.ts +9 -0
- package/src/monitor/preflight-audio.ts +130 -0
- package/src/monitor/presence-cache.ts +61 -0
- package/src/monitor/presence.ts +50 -0
- package/src/monitor/provider-session.runtime.ts +12 -0
- package/src/monitor/provider.acp.ts +89 -0
- package/src/monitor/provider.allowlist.ts +398 -0
- package/src/monitor/provider.cleanup.ts +41 -0
- package/src/monitor/provider.commands.ts +129 -0
- package/src/monitor/provider.config-log.ts +45 -0
- package/src/monitor/provider.deploy-errors.ts +362 -0
- package/src/monitor/provider.deploy.ts +221 -0
- package/src/monitor/provider.interactions.ts +160 -0
- package/src/monitor/provider.lifecycle.ts +562 -0
- package/src/monitor/provider.runtime.ts +1 -0
- package/src/monitor/provider.startup-log.ts +32 -0
- package/src/monitor/provider.startup.ts +323 -0
- package/src/monitor/provider.ts +688 -0
- package/src/monitor/reply-context.ts +64 -0
- package/src/monitor/reply-delivery.ts +216 -0
- package/src/monitor/reply-safety.ts +96 -0
- package/src/monitor/rest-fetch.ts +97 -0
- package/src/monitor/route-resolution.ts +140 -0
- package/src/monitor/sender-identity.ts +81 -0
- package/src/monitor/startup-status.ts +10 -0
- package/src/monitor/status.ts +22 -0
- package/src/monitor/system-events.ts +55 -0
- package/src/monitor/thread-bindings.config.ts +35 -0
- package/src/monitor/thread-bindings.discord-api.ts +310 -0
- package/src/monitor/thread-bindings.lifecycle.ts +354 -0
- package/src/monitor/thread-bindings.manager.ts +554 -0
- package/src/monitor/thread-bindings.messages.ts +6 -0
- package/src/monitor/thread-bindings.persona.ts +25 -0
- package/src/monitor/thread-bindings.session-adapter.ts +229 -0
- package/src/monitor/thread-bindings.session-shared.ts +59 -0
- package/src/monitor/thread-bindings.session-updates.ts +35 -0
- package/src/monitor/thread-bindings.state.ts +540 -0
- package/src/monitor/thread-bindings.ts +48 -0
- package/src/monitor/thread-bindings.types.ts +83 -0
- package/src/monitor/thread-channel-context.ts +112 -0
- package/src/monitor/thread-session-close.ts +63 -0
- package/src/monitor/thread-title.ts +181 -0
- package/src/monitor/threading.auto-thread.ts +287 -0
- package/src/monitor/threading.cache.ts +45 -0
- package/src/monitor/threading.starter.ts +288 -0
- package/src/monitor/threading.ts +20 -0
- package/src/monitor/threading.types.ts +102 -0
- package/src/monitor/timeouts.ts +84 -0
- package/src/monitor/typing.ts +17 -0
- package/src/monitor.gateway.ts +75 -0
- package/src/monitor.ts +28 -0
- package/src/network-config.ts +79 -0
- package/src/normalize.ts +86 -0
- package/src/outbound-adapter.ts +327 -0
- package/src/outbound-approval.ts +29 -0
- package/src/outbound-components.ts +86 -0
- package/src/outbound-payload.ts +208 -0
- package/src/outbound-send-context.ts +92 -0
- package/src/outbound-session-route.ts +72 -0
- package/src/pluralkit.ts +58 -0
- package/src/preview-streaming.ts +18 -0
- package/src/probe.runtime.ts +1 -0
- package/src/probe.ts +237 -0
- package/src/proxy-fetch.ts +92 -0
- package/src/proxy-request-client.ts +21 -0
- package/src/recipient-resolution.ts +39 -0
- package/src/resolve-allowlist-common.ts +39 -0
- package/src/resolve-channels.ts +369 -0
- package/src/resolve-users.ts +184 -0
- package/src/retry.ts +98 -0
- package/src/runtime-api.ts +64 -0
- package/src/runtime-config.ts +16 -0
- package/src/runtime.ts +23 -0
- package/src/secret-config-contract.ts +140 -0
- package/src/security-audit.runtime.ts +1 -0
- package/src/security-audit.ts +208 -0
- package/src/security-contract.ts +47 -0
- package/src/security-doctor.ts +20 -0
- package/src/security.ts +60 -0
- package/src/send-target-parsing.ts +14 -0
- package/src/send.channels.ts +139 -0
- package/src/send.components.ts +391 -0
- package/src/send.emojis-stickers.ts +57 -0
- package/src/send.guild.ts +170 -0
- package/src/send.message-request.ts +112 -0
- package/src/send.messages.ts +229 -0
- package/src/send.outbound.ts +459 -0
- package/src/send.permissions.ts +283 -0
- package/src/send.reactions.ts +155 -0
- package/src/send.receipt.ts +69 -0
- package/src/send.shared.ts +469 -0
- package/src/send.ts +82 -0
- package/src/send.types.ts +191 -0
- package/src/send.typing.ts +9 -0
- package/src/send.voice.ts +140 -0
- package/src/send.webhook.ts +137 -0
- package/src/session-contract.ts +3 -0
- package/src/session-key-normalization.ts +47 -0
- package/src/setup-account-state.ts +144 -0
- package/src/setup-adapter.ts +14 -0
- package/src/setup-core.ts +215 -0
- package/src/setup-runtime-helpers.ts +10 -0
- package/src/setup-surface.ts +132 -0
- package/src/shared-interactive.ts +167 -0
- package/src/shared.ts +197 -0
- package/src/status-issues.ts +201 -0
- package/src/subagent-hooks.ts +232 -0
- package/src/target-parsing.ts +70 -0
- package/src/target-resolver.ts +129 -0
- package/src/targets.ts +12 -0
- package/src/token.ts +107 -0
- package/src/ui-colors.ts +27 -0
- package/src/ui.ts +20 -0
- package/src/voice/access.ts +126 -0
- package/src/voice/audio.ts +249 -0
- package/src/voice/capture-state.ts +120 -0
- package/src/voice/command.ts +284 -0
- package/src/voice/config.ts +8 -0
- package/src/voice/ingress.ts +164 -0
- package/src/voice/manager.runtime.ts +14 -0
- package/src/voice/manager.ts +1155 -0
- package/src/voice/prompt.ts +22 -0
- package/src/voice/realtime.ts +1370 -0
- package/src/voice/receive-recovery.ts +159 -0
- package/src/voice/sanitize.ts +29 -0
- package/src/voice/sdk-runtime.ts +14 -0
- package/src/voice/segment.ts +160 -0
- package/src/voice/session.ts +81 -0
- package/src/voice/speaker-context.ts +127 -0
- package/src/voice/tts.ts +151 -0
- package/src/voice-message.ts +474 -0
- package/subagent-hooks-api.ts +27 -0
- package/test-api.ts +4 -0
- package/thread-binding-api.ts +1 -0
- package/timeouts.ts +6 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AutoBotConfig } from "autobot/plugin-sdk/config-contracts";
|
|
2
|
+
import { inspectDiscordAccount } from "./src/account-inspect.js";
|
|
3
|
+
|
|
4
|
+
export function inspectDiscordReadOnlyAccount(cfg: AutoBotConfig, accountId?: string | null) {
|
|
5
|
+
return inspectDiscordAccount({ cfg, accountId });
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { handleDiscordAction } from "./src/actions/runtime.js";
|
package/api.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export { discordPlugin } from "./src/channel.js";
|
|
2
|
+
export { discordSetupPlugin } from "./src/channel.setup.js";
|
|
3
|
+
export {
|
|
4
|
+
handleDiscordSubagentDeliveryTarget,
|
|
5
|
+
handleDiscordSubagentEnded,
|
|
6
|
+
handleDiscordSubagentSpawning,
|
|
7
|
+
} from "./src/subagent-hooks.js";
|
|
8
|
+
export { inspectDiscordAccount, type InspectedDiscordAccount } from "./src/account-inspect.js";
|
|
9
|
+
export { type DiscordCredentialStatus } from "./src/token.js";
|
|
10
|
+
export {
|
|
11
|
+
createDiscordActionGate,
|
|
12
|
+
listDiscordAccountIds,
|
|
13
|
+
listEnabledDiscordAccounts,
|
|
14
|
+
mergeDiscordAccountConfig,
|
|
15
|
+
type ResolvedDiscordAccount,
|
|
16
|
+
resolveDefaultDiscordAccountId,
|
|
17
|
+
resolveDiscordAccount,
|
|
18
|
+
resolveDiscordAccountConfig,
|
|
19
|
+
resolveDiscordMaxLinesPerMessage,
|
|
20
|
+
} from "./src/accounts.js";
|
|
21
|
+
export { tryHandleDiscordMessageActionGuildAdmin } from "./src/actions/handle-action.guild-admin.js";
|
|
22
|
+
export { DiscordApiError, fetchDiscord, requestDiscord } from "./src/api.js";
|
|
23
|
+
export { buildDiscordComponentMessage } from "./src/components.js";
|
|
24
|
+
type DiscordMessageActionHandler =
|
|
25
|
+
typeof import("./src/channel-actions.runtime.js").handleDiscordMessageAction;
|
|
26
|
+
|
|
27
|
+
// Deprecated compatibility surface for existing @gakr-gakr/discord/api.js consumers.
|
|
28
|
+
export const handleDiscordMessageAction: DiscordMessageActionHandler = async (...args) =>
|
|
29
|
+
(await import("./src/channel-actions.runtime.js")).handleDiscordMessageAction(...args);
|
|
30
|
+
export {
|
|
31
|
+
listDiscordDirectoryGroupsFromConfig,
|
|
32
|
+
listDiscordDirectoryPeersFromConfig,
|
|
33
|
+
} from "./src/directory-config.js";
|
|
34
|
+
export {
|
|
35
|
+
resolveDiscordGroupRequireMention,
|
|
36
|
+
resolveDiscordGroupToolPolicy,
|
|
37
|
+
} from "./src/group-policy.js";
|
|
38
|
+
export {
|
|
39
|
+
looksLikeDiscordTargetId,
|
|
40
|
+
normalizeDiscordMessagingTarget,
|
|
41
|
+
normalizeDiscordOutboundTarget,
|
|
42
|
+
} from "./src/normalize.js";
|
|
43
|
+
export { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "autobot/plugin-sdk/runtime-group-policy";
|
|
44
|
+
export { collectDiscordStatusIssues } from "./src/status-issues.js";
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
buildDiscordComponentCustomId,
|
|
48
|
+
buildDiscordComponentMessageFlags,
|
|
49
|
+
buildDiscordInteractiveComponents,
|
|
50
|
+
buildDiscordModalCustomId,
|
|
51
|
+
createDiscordFormModal,
|
|
52
|
+
DISCORD_COMPONENT_ATTACHMENT_PREFIX,
|
|
53
|
+
DISCORD_COMPONENT_CUSTOM_ID_KEY,
|
|
54
|
+
DISCORD_MODAL_CUSTOM_ID_KEY,
|
|
55
|
+
DiscordFormModal,
|
|
56
|
+
formatDiscordComponentEventText,
|
|
57
|
+
parseDiscordComponentCustomId,
|
|
58
|
+
parseDiscordComponentCustomIdForInteraction,
|
|
59
|
+
parseDiscordComponentCustomIdForInteraction as parseDiscordComponentCustomIdForCarbon,
|
|
60
|
+
parseDiscordModalCustomId,
|
|
61
|
+
parseDiscordModalCustomIdForInteraction,
|
|
62
|
+
parseDiscordModalCustomIdForInteraction as parseDiscordModalCustomIdForCarbon,
|
|
63
|
+
readDiscordComponentSpec,
|
|
64
|
+
resolveDiscordComponentAttachmentName,
|
|
65
|
+
type ComponentData,
|
|
66
|
+
type DiscordComponentBlock,
|
|
67
|
+
type DiscordComponentBuildResult,
|
|
68
|
+
type DiscordComponentButtonSpec,
|
|
69
|
+
type DiscordComponentButtonStyle,
|
|
70
|
+
type DiscordComponentEntry,
|
|
71
|
+
type DiscordComponentMessageSpec,
|
|
72
|
+
type DiscordComponentModalFieldType,
|
|
73
|
+
type DiscordComponentSectionAccessory,
|
|
74
|
+
type DiscordComponentSelectOption,
|
|
75
|
+
type DiscordComponentSelectSpec,
|
|
76
|
+
type DiscordComponentSelectType,
|
|
77
|
+
type DiscordModalEntry,
|
|
78
|
+
type DiscordModalFieldDefinition,
|
|
79
|
+
type DiscordModalFieldSpec,
|
|
80
|
+
type DiscordModalSpec,
|
|
81
|
+
} from "./src/components.js";
|
|
82
|
+
export {
|
|
83
|
+
getDiscordExecApprovalApprovers,
|
|
84
|
+
isDiscordExecApprovalApprover,
|
|
85
|
+
isDiscordExecApprovalClientEnabled,
|
|
86
|
+
shouldSuppressLocalDiscordExecApprovalPrompt,
|
|
87
|
+
} from "./src/exec-approvals.js";
|
|
88
|
+
export type {
|
|
89
|
+
DiscordInteractiveHandlerContext,
|
|
90
|
+
DiscordInteractiveHandlerRegistration,
|
|
91
|
+
} from "./src/interactive-dispatch.js";
|
|
92
|
+
export {
|
|
93
|
+
type DiscordPluralKitConfig,
|
|
94
|
+
fetchPluralKitMessageInfo,
|
|
95
|
+
type PluralKitMemberInfo,
|
|
96
|
+
type PluralKitMessageInfo,
|
|
97
|
+
type PluralKitSystemInfo,
|
|
98
|
+
} from "./src/pluralkit.js";
|
|
99
|
+
export {
|
|
100
|
+
fetchDiscordApplicationId,
|
|
101
|
+
fetchDiscordApplicationSummary,
|
|
102
|
+
parseApplicationIdFromToken,
|
|
103
|
+
probeDiscord,
|
|
104
|
+
resolveDiscordPrivilegedIntentsFromFlags,
|
|
105
|
+
type DiscordApplicationSummary,
|
|
106
|
+
type DiscordPrivilegedIntentsSummary,
|
|
107
|
+
type DiscordPrivilegedIntentStatus,
|
|
108
|
+
type DiscordProbe,
|
|
109
|
+
} from "./src/probe.js";
|
|
110
|
+
export { normalizeExplicitDiscordSessionKey } from "./src/session-key-normalization.js";
|
|
111
|
+
export { parseDiscordSendTarget, type SendDiscordTarget } from "./src/send-target-parsing.js";
|
|
112
|
+
export {
|
|
113
|
+
parseDiscordTarget,
|
|
114
|
+
resolveDiscordChannelId,
|
|
115
|
+
resolveDiscordTarget,
|
|
116
|
+
type DiscordTarget,
|
|
117
|
+
type DiscordTargetKind,
|
|
118
|
+
type DiscordTargetParseOptions,
|
|
119
|
+
} from "./src/targets.js";
|
|
120
|
+
export { collectDiscordSecurityAuditFindings } from "./src/security-audit.js";
|
|
121
|
+
export {
|
|
122
|
+
DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS,
|
|
123
|
+
DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS,
|
|
124
|
+
DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS,
|
|
125
|
+
DISCORD_DEFAULT_LISTENER_TIMEOUT_MS,
|
|
126
|
+
mergeAbortSignals,
|
|
127
|
+
} from "./src/monitor/timeouts.js";
|
|
128
|
+
export type { DiscordSendComponents, DiscordSendEmbeds } from "./src/send.shared.js";
|
|
129
|
+
export type { DiscordSendResult } from "./src/send.types.js";
|
|
130
|
+
export type { DiscordTokenResolution } from "./src/token.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "discord",
|
|
3
|
+
"activation": {
|
|
4
|
+
"onStartup": false
|
|
5
|
+
},
|
|
6
|
+
"channels": ["discord"],
|
|
7
|
+
"channelEnvVars": {
|
|
8
|
+
"discord": ["DISCORD_BOT_TOKEN"]
|
|
9
|
+
},
|
|
10
|
+
"configSchema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DiscordChannelConfigSchema } from "./src/config-schema.js";
|
package/config-api.ts
ADDED
package/contract-api.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { createThreadBindingManager } from "./src/monitor/thread-bindings.manager.js";
|
|
2
|
+
export { testing as discordThreadBindingTesting } from "./src/monitor/thread-bindings.manager.js";
|
|
3
|
+
export {
|
|
4
|
+
listDiscordDirectoryGroupsFromConfig,
|
|
5
|
+
listDiscordDirectoryPeersFromConfig,
|
|
6
|
+
} from "./src/directory-config.js";
|
|
7
|
+
export { normalizeCompatibilityConfig, legacyConfigRules } from "./src/doctor-contract.js";
|
|
8
|
+
export {
|
|
9
|
+
collectRuntimeConfigAssignments,
|
|
10
|
+
secretTargetRegistryEntries,
|
|
11
|
+
} from "./src/secret-config-contract.js";
|
|
12
|
+
export {
|
|
13
|
+
unsupportedSecretRefSurfacePatterns,
|
|
14
|
+
collectUnsupportedSecretRefConfigCandidates,
|
|
15
|
+
} from "./src/security-contract.js";
|
|
16
|
+
export { deriveLegacySessionChatType } from "./src/session-contract.js";
|
|
17
|
+
export type {
|
|
18
|
+
DiscordInteractiveHandlerContext,
|
|
19
|
+
DiscordInteractiveHandlerRegistration,
|
|
20
|
+
} from "./src/interactive-dispatch.js";
|
|
21
|
+
export { collectDiscordSecurityAuditFindings } from "./src/security-audit.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { normalizeCompatibilityConfig, legacyConfigRules } from "./src/doctor-contract.js";
|
package/index.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineBundledChannelEntry } from "autobot/plugin-sdk/channel-entry-contract";
|
|
2
|
+
import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
|
|
3
|
+
|
|
4
|
+
export default defineBundledChannelEntry({
|
|
5
|
+
id: "discord",
|
|
6
|
+
name: "Discord",
|
|
7
|
+
description: "Discord channel plugin",
|
|
8
|
+
importMetaUrl: import.meta.url,
|
|
9
|
+
plugin: {
|
|
10
|
+
specifier: "./channel-plugin-api.js",
|
|
11
|
+
exportName: "discordPlugin",
|
|
12
|
+
},
|
|
13
|
+
runtime: {
|
|
14
|
+
specifier: "./runtime-setter-api.js",
|
|
15
|
+
exportName: "setDiscordRuntime",
|
|
16
|
+
},
|
|
17
|
+
accountInspect: {
|
|
18
|
+
specifier: "./account-inspect-api.js",
|
|
19
|
+
exportName: "inspectDiscordReadOnlyAccount",
|
|
20
|
+
},
|
|
21
|
+
registerFull(api) {
|
|
22
|
+
registerDiscordSubagentHooks(api);
|
|
23
|
+
},
|
|
24
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gakr-gakr/discord",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AutoBot Discord channel plugin",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/autobot/autobot"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@discordjs/voice": "0.19.2",
|
|
12
|
+
"discord-api-types": "0.38.47",
|
|
13
|
+
"https-proxy-agent": "9.0.0",
|
|
14
|
+
"opusscript": "0.1.1",
|
|
15
|
+
"typebox": "1.1.38",
|
|
16
|
+
"undici": "8.3.0",
|
|
17
|
+
"ws": "8.20.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@gakr-gakr/plugin-sdk": "workspace:*",
|
|
21
|
+
"@gakr-gakr/autobot": "workspace:*",
|
|
22
|
+
"autobot": "workspace:@gakr-gakr/autobot@*"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@gakr-gakr/autobot": ">=0.1.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"@gakr-gakr/autobot": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"autobot": {
|
|
33
|
+
"extensions": [
|
|
34
|
+
"./index.ts"
|
|
35
|
+
],
|
|
36
|
+
"setupEntry": "./setup-entry.ts",
|
|
37
|
+
"channel": {
|
|
38
|
+
"id": "discord",
|
|
39
|
+
"label": "Discord",
|
|
40
|
+
"selectionLabel": "Discord (Bot API)",
|
|
41
|
+
"detailLabel": "Discord Bot",
|
|
42
|
+
"docsPath": "/channels/discord",
|
|
43
|
+
"docsLabel": "discord",
|
|
44
|
+
"blurb": "very well supported right now.",
|
|
45
|
+
"systemImage": "bubble.left.and.bubble.right",
|
|
46
|
+
"markdownCapable": true,
|
|
47
|
+
"preferSessionLookupForAnnounceTarget": true,
|
|
48
|
+
"commands": {
|
|
49
|
+
"nativeCommandsAutoEnabled": true,
|
|
50
|
+
"nativeSkillsAutoEnabled": true
|
|
51
|
+
},
|
|
52
|
+
"configuredState": {
|
|
53
|
+
"env": {
|
|
54
|
+
"allOf": [
|
|
55
|
+
"DISCORD_BOT_TOKEN"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"specifier": "./configured-state",
|
|
59
|
+
"exportName": "hasDiscordConfiguredState"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"install": {
|
|
63
|
+
"npmSpec": "@gakr-gakr/discord",
|
|
64
|
+
"defaultChoice": "npm",
|
|
65
|
+
"minHostVersion": ">=2026.4.10",
|
|
66
|
+
"allowInvalidConfigRecovery": true
|
|
67
|
+
},
|
|
68
|
+
"compat": {
|
|
69
|
+
"pluginApi": ">=2026.5.19"
|
|
70
|
+
},
|
|
71
|
+
"build": {
|
|
72
|
+
"autobotVersion": "2026.5.19"
|
|
73
|
+
},
|
|
74
|
+
"release": {
|
|
75
|
+
"publishToClawHub": true,
|
|
76
|
+
"publishToNpm": true
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { handleDiscordAction } from "./src/actions/runtime.js";
|
|
2
|
+
export {
|
|
3
|
+
isDiscordModerationAction,
|
|
4
|
+
readDiscordModerationCommand,
|
|
5
|
+
requiredGuildPermissionForModerationAction,
|
|
6
|
+
type DiscordModerationAction,
|
|
7
|
+
type DiscordModerationCommand,
|
|
8
|
+
} from "./src/actions/runtime.moderation-shared.js";
|
|
9
|
+
export {
|
|
10
|
+
readDiscordChannelCreateParams,
|
|
11
|
+
readDiscordChannelEditParams,
|
|
12
|
+
readDiscordChannelMoveParams,
|
|
13
|
+
readDiscordParentIdParam,
|
|
14
|
+
} from "./src/actions/runtime.shared.js";
|
|
15
|
+
export { discordMessageActions } from "./src/channel-actions.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds } from "./src/audit.js";
|
|
2
|
+
export {
|
|
3
|
+
listDiscordDirectoryGroupsLive,
|
|
4
|
+
listDiscordDirectoryPeersLive,
|
|
5
|
+
} from "./src/directory-live.js";
|
|
6
|
+
export {
|
|
7
|
+
fetchDiscordApplicationId,
|
|
8
|
+
fetchDiscordApplicationSummary,
|
|
9
|
+
parseApplicationIdFromToken,
|
|
10
|
+
probeDiscord,
|
|
11
|
+
resolveDiscordPrivilegedIntentsFromFlags,
|
|
12
|
+
type DiscordApplicationSummary,
|
|
13
|
+
type DiscordPrivilegedIntentsSummary,
|
|
14
|
+
type DiscordPrivilegedIntentStatus,
|
|
15
|
+
type DiscordProbe,
|
|
16
|
+
} from "./src/probe.js";
|
|
17
|
+
export {
|
|
18
|
+
resolveDiscordChannelAllowlist,
|
|
19
|
+
type DiscordChannelResolution,
|
|
20
|
+
} from "./src/resolve-channels.js";
|
|
21
|
+
export { resolveDiscordUserAllowlist, type DiscordUserResolution } from "./src/resolve-users.js";
|
|
22
|
+
export { setDiscordRuntime } from "./src/runtime.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export {
|
|
2
|
+
allowListMatches,
|
|
3
|
+
buildDiscordMediaPayload,
|
|
4
|
+
createDiscordMessageHandler,
|
|
5
|
+
createDiscordNativeCommand,
|
|
6
|
+
isDiscordGroupAllowedByPolicy,
|
|
7
|
+
monitorDiscordProvider,
|
|
8
|
+
normalizeDiscordAllowList,
|
|
9
|
+
normalizeDiscordSlug,
|
|
10
|
+
registerDiscordListener,
|
|
11
|
+
resolveDiscordChannelConfig,
|
|
12
|
+
resolveDiscordChannelConfigWithFallback,
|
|
13
|
+
resolveDiscordCommandAuthorized,
|
|
14
|
+
resolveDiscordGuildEntry,
|
|
15
|
+
resolveDiscordReplyTarget,
|
|
16
|
+
resolveDiscordShouldRequireMention,
|
|
17
|
+
resolveGroupDmAllow,
|
|
18
|
+
sanitizeDiscordThreadName,
|
|
19
|
+
shouldEmitDiscordReactionNotification,
|
|
20
|
+
type DiscordAllowList,
|
|
21
|
+
type DiscordChannelConfigResolved,
|
|
22
|
+
type DiscordGuildEntryResolved,
|
|
23
|
+
type DiscordMessageEvent,
|
|
24
|
+
type DiscordMessageHandler,
|
|
25
|
+
type MonitorDiscordOpts,
|
|
26
|
+
} from "./src/monitor.js";
|
|
27
|
+
export {
|
|
28
|
+
createDiscordGatewayPlugin,
|
|
29
|
+
resolveDiscordGatewayIntents,
|
|
30
|
+
waitForDiscordGatewayPluginRegistration,
|
|
31
|
+
} from "./src/monitor/gateway-plugin.js";
|
|
32
|
+
export {
|
|
33
|
+
clearGateways,
|
|
34
|
+
getGateway,
|
|
35
|
+
registerGateway,
|
|
36
|
+
unregisterGateway,
|
|
37
|
+
} from "./src/monitor/gateway-registry.js";
|
|
38
|
+
export {
|
|
39
|
+
clearPresences,
|
|
40
|
+
getPresence,
|
|
41
|
+
presenceCacheSize,
|
|
42
|
+
setPresence,
|
|
43
|
+
} from "./src/monitor/presence-cache.js";
|
|
44
|
+
export {
|
|
45
|
+
DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS,
|
|
46
|
+
DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS,
|
|
47
|
+
DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS,
|
|
48
|
+
DISCORD_DEFAULT_LISTENER_TIMEOUT_MS,
|
|
49
|
+
mergeAbortSignals,
|
|
50
|
+
} from "./src/monitor/timeouts.js";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export {
|
|
2
|
+
resolveDiscordOutboundSessionRoute,
|
|
3
|
+
type ResolveDiscordOutboundSessionRouteParams,
|
|
4
|
+
} from "./src/outbound-session-route.js";
|
|
5
|
+
export {
|
|
6
|
+
addRoleDiscord,
|
|
7
|
+
banMemberDiscord,
|
|
8
|
+
createChannelDiscord,
|
|
9
|
+
createScheduledEventDiscord,
|
|
10
|
+
createThreadDiscord,
|
|
11
|
+
deleteChannelDiscord,
|
|
12
|
+
deleteMessageDiscord,
|
|
13
|
+
DiscordSendError,
|
|
14
|
+
editChannelDiscord,
|
|
15
|
+
editMessageDiscord,
|
|
16
|
+
fetchChannelInfoDiscord,
|
|
17
|
+
fetchChannelPermissionsDiscord,
|
|
18
|
+
fetchMemberGuildPermissionsDiscord,
|
|
19
|
+
fetchMemberInfoDiscord,
|
|
20
|
+
fetchMessageDiscord,
|
|
21
|
+
fetchReactionsDiscord,
|
|
22
|
+
fetchRoleInfoDiscord,
|
|
23
|
+
fetchVoiceStatusDiscord,
|
|
24
|
+
hasAllGuildPermissionsDiscord,
|
|
25
|
+
hasAnyGuildPermissionDiscord,
|
|
26
|
+
kickMemberDiscord,
|
|
27
|
+
listGuildChannelsDiscord,
|
|
28
|
+
listGuildEmojisDiscord,
|
|
29
|
+
listPinsDiscord,
|
|
30
|
+
listScheduledEventsDiscord,
|
|
31
|
+
listThreadsDiscord,
|
|
32
|
+
moveChannelDiscord,
|
|
33
|
+
pinMessageDiscord,
|
|
34
|
+
reactMessageDiscord,
|
|
35
|
+
readMessagesDiscord,
|
|
36
|
+
removeChannelPermissionDiscord,
|
|
37
|
+
removeOwnReactionsDiscord,
|
|
38
|
+
removeReactionDiscord,
|
|
39
|
+
removeRoleDiscord,
|
|
40
|
+
resolveEventCoverImage,
|
|
41
|
+
searchMessagesDiscord,
|
|
42
|
+
sendMessageDiscord,
|
|
43
|
+
sendPollDiscord,
|
|
44
|
+
sendStickerDiscord,
|
|
45
|
+
sendTypingDiscord,
|
|
46
|
+
sendVoiceMessageDiscord,
|
|
47
|
+
sendWebhookMessageDiscord,
|
|
48
|
+
setChannelPermissionDiscord,
|
|
49
|
+
timeoutMemberDiscord,
|
|
50
|
+
unpinMessageDiscord,
|
|
51
|
+
uploadEmojiDiscord,
|
|
52
|
+
uploadStickerDiscord,
|
|
53
|
+
type DiscordChannelCreate,
|
|
54
|
+
type DiscordChannelEdit,
|
|
55
|
+
type DiscordChannelMove,
|
|
56
|
+
type DiscordChannelPermissionSet,
|
|
57
|
+
type DiscordEmojiUpload,
|
|
58
|
+
type DiscordMessageEdit,
|
|
59
|
+
type DiscordMessageQuery,
|
|
60
|
+
type DiscordModerationTarget,
|
|
61
|
+
type DiscordPermissionsSummary,
|
|
62
|
+
type DiscordReactionRuntimeContext,
|
|
63
|
+
type DiscordReactionSummary,
|
|
64
|
+
type DiscordReactionUser,
|
|
65
|
+
type DiscordReactOpts,
|
|
66
|
+
type DiscordRoleChange,
|
|
67
|
+
type DiscordRuntimeAccountContext,
|
|
68
|
+
type DiscordSearchQuery,
|
|
69
|
+
type DiscordSendResult,
|
|
70
|
+
type DiscordStickerUpload,
|
|
71
|
+
type DiscordThreadCreate,
|
|
72
|
+
type DiscordThreadList,
|
|
73
|
+
type DiscordTimeoutTarget,
|
|
74
|
+
} from "./src/send.js";
|
|
75
|
+
export {
|
|
76
|
+
editDiscordComponentMessage,
|
|
77
|
+
registerBuiltDiscordComponentMessage,
|
|
78
|
+
sendDiscordComponentMessage,
|
|
79
|
+
} from "./src/send.components.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export {
|
|
2
|
+
testing as __testing,
|
|
3
|
+
testing,
|
|
4
|
+
autoBindSpawnedDiscordSubagent,
|
|
5
|
+
createNoopThreadBindingManager,
|
|
6
|
+
createThreadBindingManager,
|
|
7
|
+
formatThreadBindingDurationLabel,
|
|
8
|
+
getThreadBindingManager,
|
|
9
|
+
isRecentlyUnboundThreadWebhookMessage,
|
|
10
|
+
listThreadBindingsBySessionKey,
|
|
11
|
+
listThreadBindingsForAccount,
|
|
12
|
+
reconcileAcpThreadBindingsOnStartup,
|
|
13
|
+
resolveDiscordThreadBindingIdleTimeoutMs,
|
|
14
|
+
resolveDiscordThreadBindingMaxAgeMs,
|
|
15
|
+
resolveThreadBindingIdleTimeoutMs,
|
|
16
|
+
resolveThreadBindingInactivityExpiresAt,
|
|
17
|
+
resolveThreadBindingIntroText,
|
|
18
|
+
resolveThreadBindingMaxAgeExpiresAt,
|
|
19
|
+
resolveThreadBindingMaxAgeMs,
|
|
20
|
+
resolveThreadBindingPersona,
|
|
21
|
+
resolveThreadBindingPersonaFromRecord,
|
|
22
|
+
resolveThreadBindingsEnabled,
|
|
23
|
+
resolveThreadBindingThreadName,
|
|
24
|
+
setThreadBindingIdleTimeoutBySessionKey,
|
|
25
|
+
setThreadBindingMaxAgeBySessionKey,
|
|
26
|
+
unbindThreadBindingsBySessionKey,
|
|
27
|
+
type AcpThreadBindingReconciliationResult,
|
|
28
|
+
type ThreadBindingManager,
|
|
29
|
+
type ThreadBindingRecord,
|
|
30
|
+
type ThreadBindingTargetKind,
|
|
31
|
+
} from "./src/monitor/thread-bindings.js";
|