@interactive-inc/claude-funnel 0.66.0 → 0.67.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.
Files changed (88) hide show
  1. package/README.md +8 -4
  2. package/dist/bin.js +275 -372
  3. package/dist/channel.d.ts +76 -52
  4. package/dist/channel.js +82 -47
  5. package/dist/{channels-DR90RmUP.d.ts → channels-BBA3GTAa.d.ts} +5 -6
  6. package/dist/claude.d.ts +11 -8
  7. package/dist/claude.js +31 -15
  8. package/dist/{connector-descriptor-CmyHlEiT.d.ts → connector-descriptor-F75ZI8Fh.d.ts} +26 -15
  9. package/dist/{connector-diagnostics-recorder-COtNEmUp.js → connector-diagnostics-recorder-BmOijU1p.js} +1 -0
  10. package/dist/connectors/discord.d.ts +10 -8
  11. package/dist/connectors/discord.js +2 -2
  12. package/dist/connectors/gh.d.ts +6 -6
  13. package/dist/connectors/gh.js +2 -2
  14. package/dist/connectors/schedule.d.ts +10 -8
  15. package/dist/connectors/schedule.js +2 -2
  16. package/dist/connectors/slack.d.ts +14 -10
  17. package/dist/connectors/slack.js +3 -3
  18. package/dist/diagnostics.d.ts +1 -1
  19. package/dist/diagnostics.js +1 -1
  20. package/dist/{discord-connector-DXARcO6w.js → discord-connector-CdjwPoty.js} +6 -6
  21. package/dist/{discord-connector-schema-D1dyxhXk.d.ts → discord-connector-schema-BaBZYHxK.d.ts} +0 -1
  22. package/dist/docs.d.ts +1 -1
  23. package/dist/docs.js +1 -1
  24. package/dist/doctor.d.ts +1 -1
  25. package/dist/doctor.js +1 -1
  26. package/dist/{file-process-guard-CiBwXjzm.d.ts → file-process-guard-DAYe9Ndt.d.ts} +22 -18
  27. package/dist/{file-system-DHgbuTFb.d.ts → file-system-BNtl997T.d.ts} +2 -1
  28. package/dist/{flume-source-listener-FzR5lGpL.d.ts → flume-source-listener-CLtsdcT2.d.ts} +8 -6
  29. package/dist/{funnel-diagnostics-Cvk6Sk4x.js → funnel-diagnostics-B-PCuv_E.js} +4 -3
  30. package/dist/{funnel-diagnostics-kbd27d7I.d.ts → funnel-diagnostics-CnKus3Jg.d.ts} +8 -5
  31. package/dist/{funnel-docs-C-ge0MuB.js → funnel-docs-BFcqITFA.js} +4 -0
  32. package/dist/{funnel-doctor-XrI2GBH8.js → funnel-doctor-Csw5qjcH.js} +1 -0
  33. package/dist/{funnel-doctor-CVTNUtDn.d.ts → funnel-doctor-CviUTINw.d.ts} +20 -9
  34. package/dist/{funnel-error-0t1MK1R6.js → funnel-error-DoSBCogD.js} +13 -0
  35. package/dist/{funnel-log-sqlite-sink-DLYkY0pZ.js → funnel-log-sqlite-sink-CXbs3qQp.js} +1 -1
  36. package/dist/{funnel-recovery-D8MkiTpk.d.ts → funnel-recovery-BwcSNNSN.d.ts} +1 -2
  37. package/dist/{funnel-recovery-DKnEutUS.js → funnel-recovery-DYbSYGWC.js} +1 -0
  38. package/dist/gateway/daemon.js +66 -125
  39. package/dist/gateway.d.ts +2 -3
  40. package/dist/gateway.js +2 -2
  41. package/dist/{gh-connector-BUGCOEWS.js → gh-connector-D-iyjl-d.js} +5 -5
  42. package/dist/{gh-connector-schema-BCHEqpUg.d.ts → gh-connector-schema-BrNsCl1T.d.ts} +0 -1
  43. package/dist/{index-BU1TtuFy.d.ts → index-B4RvEaW-.d.ts} +205 -40
  44. package/dist/index.d.ts +115 -109
  45. package/dist/index.js +123 -32
  46. package/dist/{local-config-json-schema-DexV8vX3.js → local-config-json-schema-_-YVHX4c.js} +4 -4
  47. package/dist/local-config.d.ts +2 -3
  48. package/dist/local-config.js +1 -1
  49. package/dist/logger.d.ts +29 -13
  50. package/dist/logger.js +1 -1
  51. package/dist/{memory-token-prompter-D0kIdhar.d.ts → memory-token-prompter-D3R_kgM_.d.ts} +2 -3
  52. package/dist/{node-file-system-BOXIHW_Q.js → node-file-system-xJx7dymE.js} +11 -3
  53. package/dist/{profiles-M24JrcOh.d.ts → profiles-CePRnv3F.d.ts} +3 -4
  54. package/dist/{profiles-ZHLONml4.js → profiles-KpN7_gBw.js} +19 -5
  55. package/dist/profiles.d.ts +1 -1
  56. package/dist/profiles.js +1 -1
  57. package/dist/recovery.d.ts +1 -1
  58. package/dist/recovery.js +1 -1
  59. package/dist/{schedule-connector-schema-D7ZEKvit.d.ts → schedule-connector-schema-DBko_Bf7.d.ts} +0 -1
  60. package/dist/{schedule-connector-9k3gOIgl.js → schedule-connector-teeDMHUe.js} +5 -5
  61. package/dist/{settings-reader-BnKIbmsD.d.ts → settings-reader-CyTpbAre.d.ts} +1 -2
  62. package/dist/{settings-schema-IShSMm5G.d.ts → settings-schema-B-CKLuST.d.ts} +0 -1
  63. package/dist/{settings-store-ccv291GV.js → settings-store-ZFWBhOnp.js} +12 -3
  64. package/dist/{slack-connector-CxpWagbT.js → slack-connector-BE0KAjCs.js} +10 -9
  65. package/dist/{slack-event-processor-xFDG3US0.js → slack-event-processor-Cs_YuI3w.js} +2 -2
  66. package/dist/{slack-event-processor-BDTr62cN.d.ts → slack-event-processor-DmAlq4cV.d.ts} +0 -1
  67. package/dist/{slot-fields-D-pvMgTK.js → slot-fields-5ERhytIA.js} +3 -3
  68. package/dist/{sqlite-diagnostic-log-CwhXE9Qh.js → sqlite-diagnostic-log-BDxfXGZy.js} +42 -19
  69. package/dist/{yaml-render-DVEtYuF1.js → yaml-render-DxxRQT-V.js} +3 -3
  70. package/package.json +10 -10
  71. package/dist/broadcaster-DVNcw00K.d.ts +0 -138
  72. package/dist/file-system-Wvzc2ePY.js +0 -9
  73. package/dist/logger-B6iyNbxM.js +0 -9
  74. package/dist/settings-reader-9FcX3qS1.js +0 -11
  75. /package/dist/{connector-adapter-Dvs8N7ew.js → connector-adapter-BL2ehMej.js} +0 -0
  76. /package/dist/{connector-listener-mPGZYa8e.js → connector-listener-BcQMzY6Q.js} +0 -0
  77. /package/dist/{diagnostic-sql-reader-oXZnWFf_.js → diagnostic-sql-reader-CoBk_EFF.js} +0 -0
  78. /package/dist/{discord-connector-schema-B4YpWpR3.js → discord-connector-schema-saAGuPmJ.js} +0 -0
  79. /package/dist/{error-message-of-ColuYmAk.js → error-message-of-BG4ezZ_s.js} +0 -0
  80. /package/dist/{funnel-docs-Cd66sKyV.d.ts → funnel-docs-BJWawfWI.d.ts} +0 -0
  81. /package/dist/{gh-connector-schema-CAqIhzGr.js → gh-connector-schema-DmZTrzUu.js} +0 -0
  82. /package/dist/{logger-Bc_Ooypb.d.ts → logger-mMZvblTx.d.ts} +0 -0
  83. /package/dist/{loopback-fetch-CVNuN3YZ.js → loopback-fetch-HP-bo9Kv.js} +0 -0
  84. /package/dist/{node-http-client-u00atiKx.js → node-http-client-SX3xFh4h.js} +0 -0
  85. /package/dist/{node-process-runner-DxTvycoK.js → node-process-runner-D4rzPl8Q.js} +0 -0
  86. /package/dist/{resolve-connector-token-DxDG9mhf.js → resolve-connector-token-BwiJCu82.js} +0 -0
  87. /package/dist/{schedule-connector-schema-DKEPZnVv.js → schedule-connector-schema-C2AChpwX.js} +0 -0
  88. /package/dist/{slack-connector-schema-Dem8to4P.js → slack-connector-schema-EGVuuqSX.js} +0 -0
package/dist/index.js CHANGED
@@ -1,28 +1,25 @@
1
- import { n as gatewayLoopbackUrl, t as loopbackFetch } from "./loopback-fetch-CVNuN3YZ.js";
2
- import { t as FunnelFileSystem } from "./file-system-Wvzc2ePY.js";
3
- import { t as NodeFunnelFileSystem } from "./node-file-system-BOXIHW_Q.js";
4
- import { t as FunnelLogger } from "./logger-B6iyNbxM.js";
5
- import { n as FunnelProcessRunner, t as NodeFunnelProcessRunner } from "./node-process-runner-DxTvycoK.js";
6
- import { n as FunnelHttpClient, t as NodeFunnelHttpClient } from "./node-http-client-u00atiKx.js";
7
- import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-9FcX3qS1.js";
8
- import { a as expandHomeDir, c as SETTINGS_VERSION, d as profileConfigSchema, f as settingsSchema, i as SETTINGS_PATH, l as channelConfigSchema, m as NodeFunnelIdGenerator, n as FUNNEL_DIR, o as resolveFunnelDir, p as baseConnectorConfigSchema, r as FunnelSettingsStore, s as resolveFunnelPort, t as DEFAULT_GATEWAY_PORT, u as channelDeliveryModeSchema } from "./settings-store-ccv291GV.js";
9
- import { a as FunnelConnectorTypeMismatchError, c as FunnelTokenCollisionError, i as FunnelConnectorNotFoundError, n as FunnelChannelAlreadyExistsError, o as FunnelError, r as FunnelChannelNotFoundError, s as FunnelGatewayBindError, t as FunnelAuthFailedError } from "./funnel-error-0t1MK1R6.js";
10
- import { a as FunnelMcp, o as FunnelFileProcessGuard, s as FunnelClaude, t as renderYaml } from "./yaml-render-DVEtYuF1.js";
11
- import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-Cvk6Sk4x.js";
12
- import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-oXZnWFf_.js";
13
- import { t as FunnelDoctor } from "./funnel-doctor-XrI2GBH8.js";
14
- import { t as FunnelDocs } from "./funnel-docs-C-ge0MuB.js";
15
- import { a as FunnelTokenPrompter, i as FunnelLocalConfigSync, n as MemoryFunnelTokenPrompter, o as FunnelLocalConfig, r as NodeFunnelTokenPrompter, t as funnelJsonSchema } from "./local-config-json-schema-DexV8vX3.js";
16
- import { t as discordConnectorSchema } from "./discord-connector-schema-B4YpWpR3.js";
17
- import { t as ghConnectorSchema } from "./gh-connector-schema-CAqIhzGr.js";
18
- import { t as slackConnectorSchema } from "./slack-connector-schema-Dem8to4P.js";
19
- import { t as FunnelProfiles } from "./profiles-ZHLONml4.js";
20
- import { t as FunnelRecovery } from "./funnel-recovery-DKnEutUS.js";
21
- import { C as funnelTmpDir, S as connectorRawEventSchema, _ as MemoryConnectorDiagnosticLog, a as DEFAULT_GATEWAY_TOKEN_PATH, b as connectorConnectionEventSchema, c as FunnelListenerRegistry, d as funnelEventSchema, f as FunnelBroadcaster, g as publishResponseSchema, h as publishRequestSchema, i as channelWsUrl, l as SqliteFunnelEventLog, m as FunnelChannelPublisher, n as MemoryFunnelEventLog, o as FunnelGatewayToken, p as requireBearerToken, r as channelWsProtocols, s as FunnelGatewayServer, t as SqliteConnectorDiagnosticLog, u as FunnelEventLog, v as CONNECTOR_CONNECTION_STATUSES, x as connectorProcessedEventSchema, y as ConnectorDiagnosticLog } from "./sqlite-diagnostic-log-CwhXE9Qh.js";
22
- import { t as FunnelConnectorAdapter } from "./connector-adapter-Dvs8N7ew.js";
23
- import { t as FunnelConnectorListener } from "./connector-listener-mPGZYa8e.js";
24
- import { t as FunnelSlackEventProcessor } from "./slack-event-processor-xFDG3US0.js";
25
- import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "./schedule-connector-schema-DKEPZnVv.js";
1
+ import { n as gatewayLoopbackUrl, t as loopbackFetch } from "./loopback-fetch-HP-bo9Kv.js";
2
+ import { n as FunnelFileSystem, t as NodeFunnelFileSystem } from "./node-file-system-xJx7dymE.js";
3
+ import { n as FunnelProcessRunner, t as NodeFunnelProcessRunner } from "./node-process-runner-D4rzPl8Q.js";
4
+ import { n as FunnelHttpClient, t as NodeFunnelHttpClient } from "./node-http-client-SX3xFh4h.js";
5
+ import { a as expandHomeDir, c as SETTINGS_VERSION, d as profileConfigSchema, f as settingsSchema, g as FunnelIdGenerator, h as NodeFunnelIdGenerator, i as SETTINGS_PATH, l as channelConfigSchema, m as FunnelSettingsReader, n as FUNNEL_DIR, o as resolveFunnelDir, p as baseConnectorConfigSchema, r as FunnelSettingsStore, s as resolveFunnelPort, t as DEFAULT_GATEWAY_PORT, u as channelDeliveryModeSchema } from "./settings-store-ZFWBhOnp.js";
6
+ import { a as FunnelConnectorTypeMismatchError, c as FunnelTokenCollisionError, i as FunnelConnectorNotFoundError, n as FunnelChannelAlreadyExistsError, o as FunnelError, r as FunnelChannelNotFoundError, s as FunnelGatewayBindError, t as FunnelAuthFailedError } from "./funnel-error-DoSBCogD.js";
7
+ import { a as FunnelMcp, o as FunnelFileProcessGuard, s as FunnelClaude, t as renderYaml } from "./yaml-render-DxxRQT-V.js";
8
+ import { n as sessionFileExists, t as FunnelProfiles } from "./profiles-KpN7_gBw.js";
9
+ import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-B-PCuv_E.js";
10
+ import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-CoBk_EFF.js";
11
+ import { t as FunnelDoctor } from "./funnel-doctor-Csw5qjcH.js";
12
+ import { t as FunnelDocs } from "./funnel-docs-BFcqITFA.js";
13
+ import { a as FunnelTokenPrompter, i as FunnelLocalConfigSync, n as MemoryFunnelTokenPrompter, o as FunnelLocalConfig, r as NodeFunnelTokenPrompter, t as funnelJsonSchema } from "./local-config-json-schema-_-YVHX4c.js";
14
+ import { t as discordConnectorSchema } from "./discord-connector-schema-saAGuPmJ.js";
15
+ import { t as ghConnectorSchema } from "./gh-connector-schema-DmZTrzUu.js";
16
+ import { t as slackConnectorSchema } from "./slack-connector-schema-EGVuuqSX.js";
17
+ import { t as FunnelRecovery } from "./funnel-recovery-DYbSYGWC.js";
18
+ import { C as funnelTmpDir, S as connectorRawEventSchema, _ as MemoryConnectorDiagnosticLog, a as DEFAULT_GATEWAY_TOKEN_PATH, b as connectorConnectionEventSchema, c as FunnelListenerRegistry, d as funnelEventSchema, f as FunnelBroadcaster, g as publishResponseSchema, h as publishRequestSchema, i as channelWsUrl, l as SqliteFunnelEventLog, m as FunnelChannelPublisher, n as MemoryFunnelEventLog, o as FunnelGatewayToken, p as requireBearerToken, r as channelWsProtocols, s as FunnelGatewayServer, t as SqliteConnectorDiagnosticLog, u as FunnelEventLog, v as CONNECTOR_CONNECTION_STATUSES, x as connectorProcessedEventSchema, y as ConnectorDiagnosticLog } from "./sqlite-diagnostic-log-BDxfXGZy.js";
19
+ import { t as FunnelConnectorAdapter } from "./connector-adapter-BL2ehMej.js";
20
+ import { t as FunnelConnectorListener } from "./connector-listener-BcQMzY6Q.js";
21
+ import { t as FunnelSlackEventProcessor } from "./slack-event-processor-Cs_YuI3w.js";
22
+ import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "./schedule-connector-schema-C2AChpwX.js";
26
23
  import { dirname, join, resolve } from "node:path";
27
24
  import { hc } from "hono/client";
28
25
  import { appendFileSync, existsSync, mkdirSync } from "node:fs";
@@ -32,6 +29,14 @@ import { createFactory } from "hono/factory";
32
29
  import { HTTPException } from "hono/http-exception";
33
30
  import { zValidator } from "@hono/zod-validator";
34
31
  import { Hono } from "hono";
32
+ //#region lib/engine/logger/logger.ts
33
+ /**
34
+ * Structured logger with three levels and an optional log-file path.
35
+ * Defaults to NodeFunnelLogger (appends to `<os.tmpdir()>/funnel/funnel.log`);
36
+ * MemoryFunnelLogger captures entries in memory and NoopFunnelLogger silences output.
37
+ */
38
+ var FunnelLogger = class {};
39
+ //#endregion
35
40
  //#region lib/engine/time/clock.ts
36
41
  /**
37
42
  * Time boundary. Default NodeFunnelClock returns `new Date()`; MemoryFunnelClock
@@ -371,6 +376,76 @@ var FunnelChannels = class {
371
376
  }
372
377
  };
373
378
  //#endregion
379
+ //#region lib/engine/claude/file-session-store.ts
380
+ const sessionIdsSchema = z.record(z.string(), z.string());
381
+ /**
382
+ * Session-id store for repo-local funnel.json profiles, isolated from the
383
+ * global profile list while remaining stable across launches.
384
+ */
385
+ var FunnelFileSessionStore = class {
386
+ fs;
387
+ path;
388
+ constructor(deps) {
389
+ this.fs = deps.fs;
390
+ this.path = join(deps.dir, "claude", "local-sessions.json");
391
+ Object.freeze(this);
392
+ }
393
+ getSessionId(profileId) {
394
+ this.fs.mkdirSync(dirname(this.path), { recursive: true });
395
+ return this.fs.withFileLock(`${this.path}.lock`, () => this.read()[profileId] ?? null);
396
+ }
397
+ setSessionId(profileId, sessionId) {
398
+ this.fs.mkdirSync(dirname(this.path), { recursive: true });
399
+ this.fs.withFileLock(`${this.path}.lock`, () => {
400
+ const sessionIds = this.read();
401
+ sessionIds[profileId] = sessionId;
402
+ this.fs.writeFileSync(this.path, `${JSON.stringify(sessionIds, null, 2)}\n`);
403
+ });
404
+ }
405
+ sessionFileExists(cwd, sessionId, env) {
406
+ return sessionFileExists({
407
+ fs: this.fs,
408
+ cwd,
409
+ sessionId,
410
+ env
411
+ });
412
+ }
413
+ read() {
414
+ if (!this.fs.existsSync(this.path)) return {};
415
+ const parsed = JSON.parse(this.fs.readFileSync(this.path));
416
+ const sessionIds = sessionIdsSchema.safeParse(parsed);
417
+ if (!sessionIds.success) throw new Error(`invalid local profile session store (${this.path})`);
418
+ return sessionIds.data;
419
+ }
420
+ };
421
+ //#endregion
422
+ //#region lib/engine/claude/routed-session-store.ts
423
+ /**
424
+ * Keeps repo-local profile execution state out of the global profile store.
425
+ * Local ids carry a reserved prefix generated by localProfileId().
426
+ */
427
+ var FunnelRoutedSessionStore = class {
428
+ global;
429
+ local;
430
+ constructor(deps) {
431
+ this.global = deps.global;
432
+ this.local = deps.local;
433
+ Object.freeze(this);
434
+ }
435
+ getSessionId(profileId) {
436
+ return this.storeFor(profileId).getSessionId(profileId);
437
+ }
438
+ setSessionId(profileId, sessionId) {
439
+ this.storeFor(profileId).setSessionId(profileId, sessionId);
440
+ }
441
+ sessionFileExists(cwd, sessionId, env) {
442
+ return this.global.sessionFileExists(cwd, sessionId, env);
443
+ }
444
+ storeFor(profileId) {
445
+ return profileId.startsWith("local-") ? this.local : this.global;
446
+ }
447
+ };
448
+ //#endregion
374
449
  //#region lib/engine/fs/memory-file-system.ts
375
450
  const SECRET_MODE = 384;
376
451
  var MemoryFunnelFileSystem = class extends FunnelFileSystem {
@@ -752,7 +827,11 @@ var FunnelGateway = class {
752
827
  const gatewayScript = resolveDaemonScript();
753
828
  const command = this.buildStartCommand(gatewayScript, options);
754
829
  this.process.detach(command, {
755
- env: { FUNNEL_DIR: this.dir },
830
+ env: {
831
+ FUNNEL_DIR: this.dir,
832
+ FUNNEL_PORT: String(this.port),
833
+ FUNNEL_TMP_DIR: this.tmpDir
834
+ },
756
835
  stdoutFile: this.gatewayLog,
757
836
  stderrFile: this.gatewayLog
758
837
  });
@@ -1073,11 +1152,18 @@ var Funnel = class Funnel {
1073
1152
  channels: this.channels,
1074
1153
  prompter: props.tokenPrompter ?? new NodeFunnelTokenPrompter()
1075
1154
  });
1155
+ const sessions = new FunnelRoutedSessionStore({
1156
+ global: this.profiles,
1157
+ local: new FunnelFileSessionStore({
1158
+ fs,
1159
+ dir
1160
+ })
1161
+ });
1076
1162
  this.claude = new FunnelClaude({
1077
1163
  channels: this.channels,
1078
1164
  mcp,
1079
1165
  gateway: this.gateway,
1080
- sessions: this.profiles,
1166
+ sessions,
1081
1167
  guard: new FunnelFileProcessGuard({
1082
1168
  fs,
1083
1169
  process,
@@ -1154,6 +1240,7 @@ var Funnel = class Funnel {
1154
1240
  logger: this.logger,
1155
1241
  onError: this.onError,
1156
1242
  dir: this.paths.dir,
1243
+ tmpDir: this.paths.tmpDir,
1157
1244
  killCompetingSlack: options.killCompetingSlack,
1158
1245
  token: options.token ?? this.gatewayToken.ensure(),
1159
1246
  allowInsecureHost: options.allowInsecureHost,
@@ -1184,7 +1271,11 @@ var Funnel = class Funnel {
1184
1271
  "bun",
1185
1272
  gatewayScript
1186
1273
  ] : ["bun", gatewayScript];
1187
- return this.process.attach(command);
1274
+ return this.process.attach(command, { env: {
1275
+ FUNNEL_DIR: this.paths.dir,
1276
+ FUNNEL_PORT: String(this.gateway.getPort()),
1277
+ FUNNEL_TMP_DIR: this.paths.tmpDir
1278
+ } });
1188
1279
  }
1189
1280
  gatewayClient() {
1190
1281
  const { port } = this.gateway.getStatus();
@@ -1374,7 +1465,7 @@ const SHORT_FLAGS = {
1374
1465
  n: "name",
1375
1466
  p: "profile"
1376
1467
  };
1377
- const METHOD_KEYWORDS = new Set([
1468
+ const METHOD_KEYWORDS = /* @__PURE__ */ new Set([
1378
1469
  "add",
1379
1470
  "set",
1380
1471
  "remove",
@@ -1383,7 +1474,7 @@ const METHOD_KEYWORDS = new Set([
1383
1474
  "request",
1384
1475
  "publish"
1385
1476
  ]);
1386
- const API_CALL_METHODS = new Set([
1477
+ const API_CALL_METHODS = /* @__PURE__ */ new Set([
1387
1478
  "get",
1388
1479
  "post",
1389
1480
  "put",
@@ -1474,9 +1565,9 @@ const toRequest = (args) => {
1474
1565
  };
1475
1566
  //#endregion
1476
1567
  //#region lib/cli/router/query-to-cli-args.ts
1477
- const BUILTIN_SKIP = new Set(["help"]);
1568
+ const BUILTIN_SKIP = /* @__PURE__ */ new Set(["help"]);
1478
1569
  const queryToCliArgs = (url, reservedKeys = []) => {
1479
- const skipped = new Set([...BUILTIN_SKIP, ...reservedKeys]);
1570
+ const skipped = /* @__PURE__ */ new Set([...BUILTIN_SKIP, ...reservedKeys]);
1480
1571
  const args = [];
1481
1572
  const searchParams = new URL(url).searchParams;
1482
1573
  for (const entry of searchParams.entries()) {
@@ -1,6 +1,6 @@
1
- import { t as discordConnectorSchema } from "./discord-connector-schema-B4YpWpR3.js";
2
- import { t as ghConnectorSchema } from "./gh-connector-schema-CAqIhzGr.js";
3
- import { t as slackConnectorSchema } from "./slack-connector-schema-Dem8to4P.js";
1
+ import { t as discordConnectorSchema } from "./discord-connector-schema-saAGuPmJ.js";
2
+ import { t as ghConnectorSchema } from "./gh-connector-schema-DmZTrzUu.js";
3
+ import { t as slackConnectorSchema } from "./slack-connector-schema-EGVuuqSX.js";
4
4
  import { join } from "node:path";
5
5
  import { z } from "zod";
6
6
  import { stderr, stdin } from "node:process";
@@ -60,7 +60,7 @@ const profileSpecSchema = z.object({
60
60
  /** Env vars layered under the launched claude process. process.env wins on collision. */
61
61
  env: z.record(z.string(), z.string()).optional(),
62
62
  /**
63
- * When true (the default), funnel injects `--session-id <uuid>` so that
63
+ * When true, funnel injects `--session-id <uuid>` so that
64
64
  * relaunching from the same cwd resumes the previous claude session
65
65
  * without bleeding into other channels or workspaces. Set to false for
66
66
  * profiles that should always start a fresh session.
@@ -1,6 +1,5 @@
1
- import { n as FunnelFileSystem } from "./file-system-DHgbuTFb.js";
2
- import { a as LocalConfigSyncResult, c as ChannelSpec, d as LocalConfig, f as ProfileSpec, g as profileSpecSchema, h as localConfigSchema, i as FunnelLocalConfigSync, l as ConnectorSpec, m as connectorSpecSchema, n as NodeFunnelTokenPrompter, o as FunnelTokenPrompter, p as channelSpecSchema, r as ConnectorSyncOutcome, s as FunnelLocalConfig, t as MemoryFunnelTokenPrompter, u as LOCAL_CONFIG_FILENAME } from "./memory-token-prompter-D0kIdhar.js";
3
-
1
+ import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
2
+ import { a as LocalConfigSyncResult, c as ChannelSpec, d as LocalConfig, f as ProfileSpec, g as profileSpecSchema, h as localConfigSchema, i as FunnelLocalConfigSync, l as ConnectorSpec, m as connectorSpecSchema, n as NodeFunnelTokenPrompter, o as FunnelTokenPrompter, p as channelSpecSchema, r as ConnectorSyncOutcome, s as FunnelLocalConfig, t as MemoryFunnelTokenPrompter, u as LOCAL_CONFIG_FILENAME } from "./memory-token-prompter-D3R_kgM_.js";
4
3
  //#region lib/services/local-config/local-config-json-schema.d.ts
5
4
  /**
6
5
  * Generates the JSON Schema (draft 2020-12) for `funnel.json`. Useful for
@@ -1,4 +1,4 @@
1
- import { a as FunnelTokenPrompter, c as channelSpecSchema, d as profileSpecSchema, i as FunnelLocalConfigSync, l as connectorSpecSchema, n as MemoryFunnelTokenPrompter, o as FunnelLocalConfig, r as NodeFunnelTokenPrompter, s as LOCAL_CONFIG_FILENAME, t as funnelJsonSchema, u as localConfigSchema } from "./local-config-json-schema-DexV8vX3.js";
1
+ import { a as FunnelTokenPrompter, c as channelSpecSchema, d as profileSpecSchema, i as FunnelLocalConfigSync, l as connectorSpecSchema, n as MemoryFunnelTokenPrompter, o as FunnelLocalConfig, r as NodeFunnelTokenPrompter, s as LOCAL_CONFIG_FILENAME, t as funnelJsonSchema, u as localConfigSchema } from "./local-config-json-schema-_-YVHX4c.js";
2
2
  import { join } from "node:path";
3
3
  //#region lib/services/local-config/local-config-writer.ts
4
4
  const isRecord = (value) => {
package/dist/logger.d.ts CHANGED
@@ -59,10 +59,15 @@ type FunnelLogValidator<E> = (event: unknown) => {
59
59
  error: Error;
60
60
  };
61
61
  type Props$5<E> = {
62
- /** Validates each event before emission. Use `schema.safeParse` from any validation library, or a plain function. */validate: FunnelLogValidator<E>; /** Owns seq assignment + durability. Use `FunnelLogSqliteSink` for multi-process safety. */
63
- primary: FunnelLogPrimarySink<E>; /** Optional fanout for already-sequenced records (memory ring, stdout, network mirror). */
64
- relays?: ReadonlyArray<FunnelLogSink<E>>; /** Override for tests. Defaults to `Date.now`. */
65
- now?: () => number; /** Observer for relay failures. Default: silently swallow. */
62
+ /** Validates each event before emission. Use `schema.safeParse` from any validation library, or a plain function. */
63
+ validate: FunnelLogValidator<E>;
64
+ /** Owns seq assignment + durability. Use `FunnelLogSqliteSink` for multi-process safety. */
65
+ primary: FunnelLogPrimarySink<E>;
66
+ /** Optional fanout for already-sequenced records (memory ring, stdout, network mirror). */
67
+ relays?: ReadonlyArray<FunnelLogSink<E>>;
68
+ /** Override for tests. Defaults to `Date.now`. */
69
+ now?: () => number;
70
+ /** Observer for relay failures. Default: silently swallow. */
66
71
  onSinkError?: SinkErrorHandler<E>;
67
72
  };
68
73
  /**
@@ -132,9 +137,13 @@ type Props$4<E, I extends ReadonlyArray<string>> = I extends readonly [] ? {
132
137
  extractIndexes: (event: E) => IndexValues<I>;
133
138
  };
134
139
  type QueryFilter<I extends ReadonlyArray<string>> = {
135
- /** Return only records with seq strictly greater than this. */sinceSeq?: number; /** Filter by the top-level `event.type` discriminator. */
136
- type?: string; /** Filter by indexed columns. Keys are constrained to the declared `indexes`. */
137
- where?: Partial<IndexValues<I>>; /** Maximum rows returned. Default 1000. */
140
+ /** Return only records with seq strictly greater than this. */
141
+ sinceSeq?: number;
142
+ /** Filter by the top-level `event.type` discriminator. */
143
+ type?: string;
144
+ /** Filter by indexed columns. Keys are constrained to the declared `indexes`. */
145
+ where?: Partial<IndexValues<I>>;
146
+ /** Maximum rows returned. Default 1000. */
138
147
  limit?: number;
139
148
  /**
140
149
  * Which end of the seq range to take when `limit` clips the result.
@@ -231,7 +240,8 @@ declare class FunnelLogSqliteSink<E, const I extends ReadonlyArray<string> = rea
231
240
  //#endregion
232
241
  //#region lib/logger/funnel-log-memory-sink.d.ts
233
242
  type Props$3 = {
234
- /** Hard cap on retained records. The oldest is evicted on overflow. 0 disables retention. */capacity?: number;
243
+ /** Hard cap on retained records. The oldest is evicted on overflow. 0 disables retention. */
244
+ capacity?: number;
235
245
  };
236
246
  /**
237
247
  * In-memory ring buffer that doubles as primary or relay. As primary it
@@ -294,9 +304,13 @@ type FunnelTextWriter = {
294
304
  //#region lib/logger/funnel-text-log.d.ts
295
305
  type WriteErrorHandler = (error: Error, record: FunnelTextEntry) => void;
296
306
  type Props$2 = {
297
- /** Where records go. Use `FunnelTextStdoutWriter`, `FunnelTextFileWriter`, or your own. */writer: FunnelTextWriter; /** Minimum level to emit. Lower-rank records are dropped. Default: "info". */
298
- level?: FunnelTextLevel; /** Override for tests. Defaults to `Date.now`. */
299
- now?: () => number; /** Observer for writer failures. Default: silently swallow. */
307
+ /** Where records go. Use `FunnelTextStdoutWriter`, `FunnelTextFileWriter`, or your own. */
308
+ writer: FunnelTextWriter;
309
+ /** Minimum level to emit. Lower-rank records are dropped. Default: "info". */
310
+ level?: FunnelTextLevel;
311
+ /** Override for tests. Defaults to `Date.now`. */
312
+ now?: () => number;
313
+ /** Observer for writer failures. Default: silently swallow. */
300
314
  onWriteError?: WriteErrorHandler;
301
315
  };
302
316
  /**
@@ -334,7 +348,8 @@ declare class FunnelTextLog {
334
348
  //#endregion
335
349
  //#region lib/logger/funnel-text-file-writer.d.ts
336
350
  type Props$1 = {
337
- /** Filesystem path. Parent directory is created on construct. */path: string;
351
+ /** Filesystem path. Parent directory is created on construct. */
352
+ path: string;
338
353
  /**
339
354
  * Optional size cap in bytes. When the next write would push the file
340
355
  * over the cap, the existing file becomes `<path>.1` (replacing any
@@ -368,7 +383,8 @@ type Stream = {
368
383
  write(s: string): void;
369
384
  };
370
385
  type Props = {
371
- /** Override for tests. Defaults to `process.stdout`. */out?: Stream;
386
+ /** Override for tests. Defaults to `process.stdout`. */
387
+ out?: Stream;
372
388
  };
373
389
  /**
374
390
  * Writes one JSON line per record to stdout. Useful as the default writer
package/dist/logger.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as FunnelLogSqliteSink } from "./funnel-log-sqlite-sink-DLYkY0pZ.js";
1
+ import { t as FunnelLogSqliteSink } from "./funnel-log-sqlite-sink-CXbs3qQp.js";
2
2
  import { dirname } from "node:path";
3
3
  import { appendFileSync, existsSync, mkdirSync, renameSync, statSync, unlinkSync } from "node:fs";
4
4
  //#region lib/logger/funnel-log.ts
@@ -1,7 +1,6 @@
1
- import { n as FunnelFileSystem } from "./file-system-DHgbuTFb.js";
2
- import { r as FunnelChannels } from "./channels-DR90RmUP.js";
1
+ import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
2
+ import { r as FunnelChannels } from "./channels-BBA3GTAa.js";
3
3
  import { z } from "zod";
4
-
5
4
  //#region lib/services/local-config/local-config-schema.d.ts
6
5
  declare const connectorSpecSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
6
  type: z.ZodLiteral<"slack">;
@@ -1,6 +1,13 @@
1
- import { t as FunnelFileSystem } from "./file-system-Wvzc2ePY.js";
2
1
  import { basename, dirname } from "node:path";
3
2
  import { appendFileSync, chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
3
+ //#region lib/engine/fs/file-system.ts
4
+ /**
5
+ * Filesystem boundary used everywhere funnel reads or writes.
6
+ * Default is NodeFunnelFileSystem (real `node:fs`); MemoryFunnelFileSystem
7
+ * provides a sandbox for tests and embedded use.
8
+ */
9
+ var FunnelFileSystem = class {};
10
+ //#endregion
4
11
  //#region lib/engine/fs/node-file-system.ts
5
12
  const SECRET_MODE = 384;
6
13
  /**
@@ -91,7 +98,8 @@ const acquireLock = (lockPath) => {
91
98
  if (!isErrnoCode(error, "EEXIST")) throw error;
92
99
  if (performance.now() >= deadline) throw new Error(`failed to acquire file lock ${lockPath} within ${LOCK_TIMEOUT_MS}ms`);
93
100
  breakIfStale(lockPath);
94
- sleepSyncMs(Math.min(LOCK_RETRY_MAX_MS, LOCK_RETRY_BASE_MS * 2 ** Math.min(attempt, 4)));
101
+ const wait = Math.min(LOCK_RETRY_MAX_MS, LOCK_RETRY_BASE_MS * 2 ** Math.min(attempt, 4));
102
+ sleepSyncMs(wait);
95
103
  attempt = attempt + 1;
96
104
  }
97
105
  };
@@ -171,4 +179,4 @@ const atomicWrite = (path, data, mode) => {
171
179
  }
172
180
  };
173
181
  //#endregion
174
- export { NodeFunnelFileSystem as t };
182
+ export { FunnelFileSystem as n, NodeFunnelFileSystem as t };
@@ -1,7 +1,6 @@
1
- import { n as FunnelFileSystem } from "./file-system-DHgbuTFb.js";
2
- import { r as ProfileConfig } from "./settings-schema-IShSMm5G.js";
3
- import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-BnKIbmsD.js";
4
-
1
+ import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
2
+ import { r as ProfileConfig } from "./settings-schema-B-CKLuST.js";
3
+ import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-CyTpbAre.js";
5
4
  //#region lib/engine/profiles/profiles.d.ts
6
5
  type Deps = {
7
6
  store: FunnelSettingsReader;
@@ -1,6 +1,17 @@
1
- import { t as NodeFunnelFileSystem } from "./node-file-system-BOXIHW_Q.js";
1
+ import { t as NodeFunnelFileSystem } from "./node-file-system-xJx7dymE.js";
2
2
  import { join } from "node:path";
3
3
  import { homedir } from "node:os";
4
+ //#region lib/engine/claude/session-file-exists.ts
5
+ /**
6
+ * Checks the Claude session path selected by the launch environment and rejects
7
+ * empty jsonl files that Claude itself cannot resume.
8
+ */
9
+ function sessionFileExists(props) {
10
+ const path = join(props.env.CLAUDE_CONFIG_DIR ?? globalThis.process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude"), "projects", props.cwd.replace(/\//g, "-"), `${props.sessionId}.jsonl`);
11
+ if (!props.fs.existsSync(path)) return false;
12
+ return props.fs.readFileSync(path).trim().length > 0;
13
+ }
14
+ //#endregion
4
15
  //#region lib/engine/profiles/profiles.ts
5
16
  const defaultFs = new NodeFunnelFileSystem();
6
17
  /**
@@ -106,9 +117,12 @@ var FunnelProfiles = class {
106
117
  * bad resume.
107
118
  */
108
119
  sessionFileExists(cwd, sessionId, env) {
109
- const path = join(env.CLAUDE_CONFIG_DIR ?? globalThis.process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude"), "projects", cwd.replace(/\//g, "-"), `${sessionId}.jsonl`);
110
- if (!this.fs.existsSync(path)) return false;
111
- return this.fs.readFileSync(path).trim().length > 0;
120
+ return sessionFileExists({
121
+ fs: this.fs,
122
+ cwd,
123
+ sessionId,
124
+ env
125
+ });
112
126
  }
113
127
  update(name, fields) {
114
128
  this.store.update((settings) => {
@@ -126,4 +140,4 @@ var FunnelProfiles = class {
126
140
  }
127
141
  };
128
142
  //#endregion
129
- export { FunnelProfiles as t };
143
+ export { sessionFileExists as n, FunnelProfiles as t };
@@ -1,2 +1,2 @@
1
- import { t as FunnelProfiles } from "./profiles-M24JrcOh.js";
1
+ import { t as FunnelProfiles } from "./profiles-CePRnv3F.js";
2
2
  export { FunnelProfiles };
package/dist/profiles.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as FunnelProfiles } from "./profiles-ZHLONml4.js";
1
+ import { t as FunnelProfiles } from "./profiles-KpN7_gBw.js";
2
2
  export { FunnelProfiles };
@@ -1,2 +1,2 @@
1
- import { a as RecoveryListenerControl, i as RecoveryGatewayControl, n as RecoveryAction, o as RecoveryResult, r as RecoveryChannelSource, t as FunnelRecovery } from "./funnel-recovery-D8MkiTpk.js";
1
+ import { a as RecoveryListenerControl, i as RecoveryGatewayControl, n as RecoveryAction, o as RecoveryResult, r as RecoveryChannelSource, t as FunnelRecovery } from "./funnel-recovery-BwcSNNSN.js";
2
2
  export { FunnelRecovery, RecoveryAction, RecoveryChannelSource, RecoveryGatewayControl, RecoveryListenerControl, RecoveryResult };
package/dist/recovery.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as FunnelRecovery } from "./funnel-recovery-DKnEutUS.js";
1
+ import { t as FunnelRecovery } from "./funnel-recovery-DYbSYGWC.js";
2
2
  export { FunnelRecovery };
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
-
3
2
  //#region lib/engine/connectors/schedule-connector-schema.d.ts
4
3
  /**
5
4
  * Catch-up behavior when the daemon was down past one or more matching minutes.
@@ -1,8 +1,8 @@
1
- import { t as NodeFunnelFileSystem } from "./node-file-system-BOXIHW_Q.js";
2
- import { t as errorMessageOf } from "./error-message-of-ColuYmAk.js";
3
- import { t as FunnelConnectorListener } from "./connector-listener-mPGZYa8e.js";
4
- import { n as scheduleConnectorSchema, r as scheduleEntrySchema } from "./schedule-connector-schema-DKEPZnVv.js";
5
- import { t as FunnelConnectorDiagnosticsRecorder } from "./connector-diagnostics-recorder-COtNEmUp.js";
1
+ import { t as NodeFunnelFileSystem } from "./node-file-system-xJx7dymE.js";
2
+ import { t as errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
3
+ import { t as FunnelConnectorListener } from "./connector-listener-BcQMzY6Q.js";
4
+ import { n as scheduleConnectorSchema, r as scheduleEntrySchema } from "./schedule-connector-schema-C2AChpwX.js";
5
+ import { t as FunnelConnectorDiagnosticsRecorder } from "./connector-diagnostics-recorder-BmOijU1p.js";
6
6
  import { dirname, join } from "node:path";
7
7
  import { z } from "zod";
8
8
  //#region lib/engine/connectors/match-cron.ts
@@ -1,5 +1,4 @@
1
- import { a as Settings } from "./settings-schema-IShSMm5G.js";
2
-
1
+ import { a as Settings } from "./settings-schema-B-CKLuST.js";
3
2
  //#region lib/engine/id/id-generator.d.ts
4
3
  /**
5
4
  * ID generator boundary. Default NodeFunnelIdGenerator wraps `crypto.randomUUID()`;
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
-
3
2
  //#region lib/engine/settings/settings-schema.d.ts
4
3
  /**
5
4
  * Routing mode when multiple WS clients are subscribed to the same channel.
@@ -1,8 +1,14 @@
1
- import { t as NodeFunnelFileSystem } from "./node-file-system-BOXIHW_Q.js";
2
- import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-9FcX3qS1.js";
1
+ import { t as NodeFunnelFileSystem } from "./node-file-system-xJx7dymE.js";
3
2
  import { dirname, join } from "node:path";
4
3
  import { homedir } from "node:os";
5
4
  import { z } from "zod";
5
+ //#region lib/engine/id/id-generator.ts
6
+ /**
7
+ * ID generator boundary. Default NodeFunnelIdGenerator wraps `crypto.randomUUID()`;
8
+ * MemoryFunnelIdGenerator emits `<prefix>-1, <prefix>-2, ...` for deterministic tests.
9
+ */
10
+ var FunnelIdGenerator = class {};
11
+ //#endregion
6
12
  //#region lib/engine/id/node-id-generator.ts
7
13
  var NodeFunnelIdGenerator = class extends FunnelIdGenerator {
8
14
  generate() {
@@ -10,6 +16,9 @@ var NodeFunnelIdGenerator = class extends FunnelIdGenerator {
10
16
  }
11
17
  };
12
18
  //#endregion
19
+ //#region lib/engine/settings/settings-reader.ts
20
+ var FunnelSettingsReader = class {};
21
+ //#endregion
13
22
  //#region lib/engine/connectors/base-connector-config.ts
14
23
  /**
15
24
  * Fields every connector config carries, regardless of type. The discriminated
@@ -240,4 +249,4 @@ var FunnelSettingsStore = class extends FunnelSettingsReader {
240
249
  }
241
250
  };
242
251
  //#endregion
243
- export { expandHomeDir as a, SETTINGS_VERSION as c, profileConfigSchema as d, settingsSchema as f, SETTINGS_PATH as i, channelConfigSchema as l, NodeFunnelIdGenerator as m, FUNNEL_DIR as n, resolveFunnelDir as o, baseConnectorConfigSchema as p, FunnelSettingsStore as r, resolveFunnelPort as s, DEFAULT_GATEWAY_PORT as t, channelDeliveryModeSchema as u };
252
+ export { expandHomeDir as a, SETTINGS_VERSION as c, profileConfigSchema as d, settingsSchema as f, FunnelIdGenerator as g, NodeFunnelIdGenerator as h, SETTINGS_PATH as i, channelConfigSchema as l, FunnelSettingsReader as m, FUNNEL_DIR as n, resolveFunnelDir as o, baseConnectorConfigSchema as p, FunnelSettingsStore as r, resolveFunnelPort as s, DEFAULT_GATEWAY_PORT as t, channelDeliveryModeSchema as u };
@@ -1,11 +1,11 @@
1
- import { t as NodeFunnelHttpClient } from "./node-http-client-u00atiKx.js";
2
- import { t as FunnelAuthFailedError } from "./funnel-error-0t1MK1R6.js";
3
- import { t as errorMessageOf } from "./error-message-of-ColuYmAk.js";
4
- import { t as slackConnectorSchema } from "./slack-connector-schema-Dem8to4P.js";
5
- import { t as FunnelConnectorAdapter } from "./connector-adapter-Dvs8N7ew.js";
6
- import { t as FunnelSlackEventProcessor } from "./slack-event-processor-xFDG3US0.js";
7
- import { t as resolveConnectorToken } from "./resolve-connector-token-DxDG9mhf.js";
8
- import { i as resolveFlumeDeps, n as FunnelFlumeSourceListener, r as flumeLogHandler, t as slotFields } from "./slot-fields-D-pvMgTK.js";
1
+ import { t as NodeFunnelHttpClient } from "./node-http-client-SX3xFh4h.js";
2
+ import { t as FunnelAuthFailedError } from "./funnel-error-DoSBCogD.js";
3
+ import { t as errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
4
+ import { t as slackConnectorSchema } from "./slack-connector-schema-EGVuuqSX.js";
5
+ import { t as FunnelConnectorAdapter } from "./connector-adapter-BL2ehMej.js";
6
+ import { t as FunnelSlackEventProcessor } from "./slack-event-processor-Cs_YuI3w.js";
7
+ import { t as resolveConnectorToken } from "./resolve-connector-token-BwiJCu82.js";
8
+ import { i as resolveFlumeDeps, n as FunnelFlumeSourceListener, r as flumeLogHandler, t as slotFields } from "./slot-fields-5ERhytIA.js";
9
9
  import { z } from "zod";
10
10
  import { FlumeSlackSource } from "@interactive-inc/flume/slack";
11
11
  //#region lib/engine/connectors/slack-adapter.ts
@@ -289,7 +289,8 @@ var FunnelFlumeSlackListener = class extends FunnelFlumeSourceListener {
289
289
  name: "eyes"
290
290
  }).toString()
291
291
  });
292
- const parsed = parseSlackResponse(await res.text());
292
+ const text = await res.text();
293
+ const parsed = parseSlackResponse(text);
293
294
  if (!parsed.ok) throw new Error(`slack reactions.add: ${parsed.error ?? `status=${res.status}`}`);
294
295
  }
295
296
  };
@@ -83,8 +83,8 @@ const minifySlackEvent = (event) => {
83
83
  };
84
84
  //#endregion
85
85
  //#region lib/engine/connectors/slack-event-processor.ts
86
- const ALLOWED_EVENTS = new Set(["message", "app_mention"]);
87
- const ALLOWED_SUBTYPES = new Set([
86
+ const ALLOWED_EVENTS = /* @__PURE__ */ new Set(["message", "app_mention"]);
87
+ const ALLOWED_SUBTYPES = /* @__PURE__ */ new Set([
88
88
  void 0,
89
89
  "thread_broadcast",
90
90
  "bot_message",
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
-
3
2
  //#region lib/engine/connectors/slack-connector-schema.d.ts
4
3
  /**
5
4
  * A slack connector resolves its tokens one of two ways, set at sync time:
@@ -1,6 +1,6 @@
1
- import { t as errorMessageOf } from "./error-message-of-ColuYmAk.js";
2
- import { t as FunnelConnectorListener } from "./connector-listener-mPGZYa8e.js";
3
- import { t as FunnelConnectorDiagnosticsRecorder } from "./connector-diagnostics-recorder-COtNEmUp.js";
1
+ import { t as errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
2
+ import { t as FunnelConnectorListener } from "./connector-listener-BcQMzY6Q.js";
3
+ import { t as FunnelConnectorDiagnosticsRecorder } from "./connector-diagnostics-recorder-BmOijU1p.js";
4
4
  import { Flume, createFlumeDefaultDeps } from "@interactive-inc/flume";
5
5
  //#region lib/engine/connectors/flume-deps.ts
6
6
  /**