@interactive-inc/claude-funnel 0.64.2 → 0.65.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/claude.js CHANGED
@@ -4,7 +4,7 @@ import { a as FunnelMcp, i as FUNNEL_MCP_NAME, n as FUNNEL_MCP_ARGS, o as Funnel
4
4
  import { t as errorMessageOf } from "./error-message-of-ColuYmAk.js";
5
5
  import { t as FunnelDocs } from "./funnel-docs-C-ge0MuB.js";
6
6
  import { t as FunnelProfiles } from "./profiles-ZHLONml4.js";
7
- import { t as discordConnector } from "./discord-connector-DIFkYBbi.js";
7
+ import { t as discordConnector } from "./discord-connector-DXARcO6w.js";
8
8
  import { t as ghConnector } from "./gh-connector-BUGCOEWS.js";
9
9
  import { t as scheduleConnector } from "./schedule-connector-9k3gOIgl.js";
10
10
  import { t as slackConnector } from "./slack-connector-CxpWagbT.js";
@@ -17,6 +17,24 @@ declare class FunnelDiscordAdapter extends FunnelConnectorAdapter {
17
17
  }
18
18
  //#endregion
19
19
  //#region lib/engine/connectors/discord-connector.d.ts
20
+ type DiscordConnectorOptions = {
21
+ /**
22
+ * Discord gateway dispatch types funnel forwards to the broadcaster.
23
+ * Pass an explicit allowlist (`["MESSAGE_CREATE", "MESSAGE_UPDATE"]`) for
24
+ * fine-grained control, or `"all"` to skip the filter entirely and forward
25
+ * every dispatch type the gateway emits. Defaults to MESSAGE_CREATE and
26
+ * MESSAGE_UPDATE so the typical chat-style consumer is not flooded by
27
+ * GUILD_CREATE / PRESENCE_UPDATE / VOICE_STATE_UPDATE snapshots on
28
+ * connect. Reactions, interactivity, and guild-state dispatches require
29
+ * opt-in via this list.
30
+ *
31
+ * Common values:
32
+ * ["MESSAGE_CREATE", "MESSAGE_UPDATE", "MESSAGE_REACTION_ADD"]
33
+ * ["MESSAGE_CREATE", "INTERACTION_CREATE"]
34
+ * "all" — debug / firehose
35
+ */
36
+ eventTypes?: ReadonlyArray<string> | "all";
37
+ };
20
38
  /**
21
39
  * Discord connector descriptor. Pass `discordConnector()` to
22
40
  * `new Funnel({ connectors: [...] })` to enable the type.
@@ -24,7 +42,7 @@ declare class FunnelDiscordAdapter extends FunnelConnectorAdapter {
24
42
  * The listener is backed by `@interactive-inc/flume`'s `FlumeDiscordSource`
25
43
  * (raw Gateway WebSocket).
26
44
  */
27
- declare const discordConnector: () => ConnectorDescriptor;
45
+ declare const discordConnector: (options?: DiscordConnectorOptions) => ConnectorDescriptor;
28
46
  //#endregion
29
47
  //#region lib/engine/connectors/discord-event-processor.d.ts
30
48
  type DiscordInboundMessage = {
@@ -61,7 +79,8 @@ type Deps = {
61
79
  logger?: FunnelLogger;
62
80
  diagnosticLog?: ConnectorDiagnosticLog;
63
81
  flumeDeps?: Partial<FlumeRuntimeDeps>; /** Shutdown signal forwarded to the underlying Flume. */
64
- signal?: AbortSignal;
82
+ signal?: AbortSignal; /** See `DiscordConnectorOptions.eventTypes`. */
83
+ eventTypes?: ReadonlyArray<string> | "all";
65
84
  };
66
85
  /**
67
86
  * Discord listener backed by `@interactive-inc/flume`'s `FlumeDiscordSource`
@@ -77,6 +96,7 @@ declare class FunnelFlumeDiscordListener extends FunnelFlumeSourceListener {
77
96
  private readonly env;
78
97
  private readonly flumeDeps;
79
98
  private readonly signal;
99
+ private readonly eventTypes;
80
100
  private processor;
81
101
  constructor(deps: Deps);
82
102
  start(notify: NotifyFn): Promise<void>;
@@ -86,4 +106,4 @@ declare class FunnelFlumeDiscordListener extends FunnelFlumeSourceListener {
86
106
  private deliver;
87
107
  }
88
108
  //#endregion
89
- export { DiscordConnectorConfig, DiscordInboundMessage, DiscordProcessed, DiscordProcessedEmit, DiscordProcessedSkip, FunnelDiscordAdapter, FunnelDiscordEventProcessor, FunnelFlumeDiscordListener, discordConnector, discordConnectorSchema };
109
+ export { DiscordConnectorConfig, DiscordConnectorOptions, DiscordInboundMessage, DiscordProcessed, DiscordProcessedEmit, DiscordProcessedSkip, FunnelDiscordAdapter, FunnelDiscordEventProcessor, FunnelFlumeDiscordListener, discordConnector, discordConnectorSchema };
@@ -1,3 +1,3 @@
1
1
  import { t as discordConnectorSchema } from "../discord-connector-schema-B4YpWpR3.js";
2
- import { i as FunnelDiscordAdapter, n as FunnelFlumeDiscordListener, r as FunnelDiscordEventProcessor, t as discordConnector } from "../discord-connector-DIFkYBbi.js";
2
+ import { i as FunnelDiscordAdapter, n as FunnelFlumeDiscordListener, r as FunnelDiscordEventProcessor, t as discordConnector } from "../discord-connector-DXARcO6w.js";
3
3
  export { FunnelDiscordAdapter, FunnelDiscordEventProcessor, FunnelFlumeDiscordListener, discordConnector, discordConnectorSchema };
@@ -66,6 +66,13 @@ var FunnelDiscordEventProcessor = class {
66
66
  };
67
67
  //#endregion
68
68
  //#region lib/engine/connectors/discord-flume-listener.ts
69
+ /**
70
+ * Default allowlist of Discord gateway dispatch types funnel forwards. Set
71
+ * to chat-style events so the typical consumer is not flooded by guild
72
+ * snapshot dispatches (GUILD_CREATE / PRESENCE_UPDATE / VOICE_STATE_UPDATE
73
+ * etc.). Override per-instance via `discordConnector({ eventTypes })`.
74
+ */
75
+ const DEFAULT_EVENT_TYPES = ["MESSAGE_CREATE", "MESSAGE_UPDATE"];
69
76
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
70
77
  const readString = (record, key) => {
71
78
  const value = record[key];
@@ -85,6 +92,7 @@ var FunnelFlumeDiscordListener = class extends FunnelFlumeSourceListener {
85
92
  env;
86
93
  flumeDeps;
87
94
  signal;
95
+ eventTypes;
88
96
  processor = null;
89
97
  constructor(deps) {
90
98
  super({
@@ -98,6 +106,7 @@ var FunnelFlumeDiscordListener = class extends FunnelFlumeSourceListener {
98
106
  this.env = deps.env ?? process.env;
99
107
  this.flumeDeps = deps.flumeDeps ?? {};
100
108
  this.signal = deps.signal;
109
+ this.eventTypes = deps.eventTypes === "all" ? "all" : new Set(deps.eventTypes ?? DEFAULT_EVENT_TYPES);
101
110
  }
102
111
  async start(notify) {
103
112
  this.diagnostics.recordConnection("started", "");
@@ -142,6 +151,12 @@ var FunnelFlumeDiscordListener = class extends FunnelFlumeSourceListener {
142
151
  this.diagnostics.recordProcessed(skipId, "skip:pre-ready", "");
143
152
  return;
144
153
  }
154
+ if (this.eventTypes !== "all" && !this.eventTypes.has(event.type)) {
155
+ const skipId = crypto.randomUUID();
156
+ this.diagnostics.recordRaw(skipId, JSON.stringify(event.data));
157
+ this.diagnostics.recordProcessed(skipId, `skip:filtered:${event.type}`, "");
158
+ return;
159
+ }
145
160
  const data = event.data;
146
161
  const author = isRecord(data.author) ? data.author : null;
147
162
  const authorIsBot = author !== null && author.bot === true;
@@ -201,7 +216,7 @@ var FunnelFlumeDiscordListener = class extends FunnelFlumeSourceListener {
201
216
  * The listener is backed by `@interactive-inc/flume`'s `FlumeDiscordSource`
202
217
  * (raw Gateway WebSocket).
203
218
  */
204
- const discordConnector = () => ({
219
+ const discordConnector = (options = {}) => ({
205
220
  type: "discord",
206
221
  toolExposed: true,
207
222
  createListener(config, deps) {
@@ -210,7 +225,8 @@ const discordConnector = () => ({
210
225
  channelId: deps.channelId,
211
226
  logger: deps.logger,
212
227
  diagnosticLog: deps.diagnosticLog,
213
- signal: deps.signal
228
+ signal: deps.signal,
229
+ eventTypes: options.eventTypes
214
230
  });
215
231
  },
216
232
  createAdapter(config, deps) {