@interactive-inc/flume 0.9.2 → 0.9.4

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/README.md CHANGED
@@ -326,7 +326,8 @@ onEvent: (item) => {
326
326
  `reconnect` on `Flume` is an options object — omit it to disable reconnects entirely.
327
327
 
328
328
  ```ts
329
- new Flume(sources, {
329
+ new Flume({
330
+ sources,
330
331
  onEvent: (item) => { ... },
331
332
  reconnect: {
332
333
  maxAttempts: 10,
@@ -183,6 +183,12 @@ type FlumeSlackSourceOptions = {
183
183
  * `auth.test` での self 検出) が必ず使うため型で保持を強制する
184
184
  */
185
185
  botToken: string;
186
+ /**
187
+ * Optional frame-silence watchdog. When set, the Slack WebSocket is closed
188
+ * and handed to the reconnect path after this many milliseconds without any
189
+ * inbound frame.
190
+ */
191
+ idleTimeoutMs?: number | null;
186
192
  };
187
193
  type FlumeGitHubSourceOptions = {
188
194
  token: string;
package/dist/slack.js CHANGED
@@ -177,7 +177,6 @@ const FlumeSlackEnvelopeSchema = z.object({
177
177
  });
178
178
  //#endregion
179
179
  //#region lib/slack/slack-socket-mode.ts
180
- const DEFAULT_IDLE_TIMEOUT_MS = 9e4;
181
180
  const IDLE_CHECK_INTERVAL_MS = 15e3;
182
181
  const WS_OPEN = 1;
183
182
  /**
@@ -259,7 +258,8 @@ var FlumeSlackSocketMode = class {
259
258
  }
260
259
  armIdleWatchdog() {
261
260
  this.disarmIdleWatchdog();
262
- const idleLimit = this.props.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
261
+ const idleLimit = this.props.idleTimeoutMs;
262
+ if (idleLimit === null || idleLimit === void 0 || idleLimit <= 0) return;
263
263
  const handle = attempt(() => this.props.deps.setInterval(() => this.checkIdle(idleLimit), IDLE_CHECK_INTERVAL_MS));
264
264
  if (handle instanceof Error) {
265
265
  this.log.error({
@@ -589,6 +589,7 @@ var FlumeSlackSource = class extends FlumeSource {
589
589
  this.setStatus("connecting");
590
590
  this.socket = new FlumeSlackSocketMode({
591
591
  appToken: this.options.appToken,
592
+ idleTimeoutMs: this.options.idleTimeoutMs,
592
593
  onLog: ctx.log.handler,
593
594
  deps: ctx.deps,
594
595
  onMessage: (envelope) => this.handleMessage(ctx, envelope),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interactive-inc/flume",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "Unified notification listener for Discord, Slack, and GitHub. Raw WebSocket + fetch + Zod. No SDK dependencies.",
5
5
  "keywords": [
6
6
  "discord",