@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
@@ -1,7 +1,6 @@
1
- import { n as FunnelClock, t as FunnelLogger } from "./logger-Bc_Ooypb.js";
2
- import { n as FunnelFileSystem } from "./file-system-DHgbuTFb.js";
1
+ import { n as FunnelClock, t as FunnelLogger } from "./logger-mMZvblTx.js";
2
+ import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
3
3
  import { z } from "zod";
4
-
5
4
  //#region lib/engine/process/process-runner.d.ts
6
5
  type RunOptions = {
7
6
  cwd?: string;
@@ -21,8 +20,10 @@ type AttachOptions = {
21
20
  onSpawned?: (pid: number) => void;
22
21
  };
23
22
  type DetachOptions = {
24
- env?: Record<string, string>; /** Append stdout to this file. Parent dir is the caller's responsibility. */
25
- stdoutFile?: string; /** Append stderr to this file. Parent dir is the caller's responsibility. */
23
+ env?: Record<string, string>;
24
+ /** Append stdout to this file. Parent dir is the caller's responsibility. */
25
+ stdoutFile?: string;
26
+ /** Append stderr to this file. Parent dir is the caller's responsibility. */
26
27
  stderrFile?: string;
27
28
  };
28
29
  type ProcessSnapshot = {
@@ -82,7 +83,8 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
82
83
  };
83
84
  type CallInput = {
84
85
  method: string;
85
- path: string; /** JSON request body. Omit for GET-like calls. */
86
+ path: string;
87
+ /** JSON request body. Omit for GET-like calls. */
86
88
  body?: JsonValue;
87
89
  };
88
90
  declare abstract class FunnelConnectorAdapter {
@@ -190,11 +192,13 @@ type ConnectorRef = {
190
192
  };
191
193
  /** A row tied to one inbound event, joinable to its twin by `eventId`. */
192
194
  type ConnectorEventKeys = ConnectorRef & {
193
- /** Correlation id shared by the raw and processed rows of the same inbound event. */eventId: string;
195
+ /** Correlation id shared by the raw and processed rows of the same inbound event. */
196
+ eventId: string;
194
197
  };
195
198
  /** One untouched inbound event to persist, before any processing. */
196
199
  type ConnectorRawRecord = ConnectorEventKeys & {
197
- /** The listener's untouched payload, already JSON-stringified by the caller. */payload: string;
200
+ /** The listener's untouched payload, already JSON-stringified by the caller. */
201
+ payload: string;
198
202
  };
199
203
  /** The processor's verdict for one inbound event. */
200
204
  type ConnectorProcessedRecord = ConnectorEventKeys & {
@@ -211,7 +215,8 @@ type ConnectorProcessedRecord = ConnectorEventKeys & {
211
215
  payload: string;
212
216
  };
213
217
  type ConnectorConnectionRecord = ConnectorRef & {
214
- status: ConnectorConnectionStatus; /** Free-form context (an error message, a reason) or "" when none. */
218
+ status: ConnectorConnectionStatus;
219
+ /** Free-form context (an error message, a reason) or "" when none. */
215
220
  detail: string;
216
221
  };
217
222
  /**
@@ -223,7 +228,8 @@ type ConnectorConnectionRecord = ConnectorRef & {
223
228
  type ConnectorQuery = {
224
229
  type?: string;
225
230
  connectorId?: string | null;
226
- channelId?: string | null; /** Cap on returned rows. The most recent matching rows are returned, oldest first. */
231
+ channelId?: string | null;
232
+ /** Cap on returned rows. The most recent matching rows are returned, oldest first. */
227
233
  limit?: number;
228
234
  };
229
235
  type ConnectorRawQuery = ConnectorQuery;
@@ -308,8 +314,10 @@ declare abstract class FunnelHttpClient {
308
314
  type ConnectorListenerDeps = {
309
315
  channelId: string;
310
316
  fs: FunnelFileSystem;
311
- process: FunnelProcessRunner; /** HTTP client for self-detection (Slack auth.test), reactions, and other listener-side REST calls. */
312
- http: FunnelHttpClient; /** Wall clock listeners that own a timer (schedule) read it from here so tests can inject a fake. */
317
+ process: FunnelProcessRunner;
318
+ /** HTTP client for self-detection (Slack auth.test), reactions, and other listener-side REST calls. */
319
+ http: FunnelHttpClient;
320
+ /** Wall clock — listeners that own a timer (schedule) read it from here so tests can inject a fake. */
313
321
  clock: FunnelClock;
314
322
  logger?: FunnelLogger;
315
323
  diagnosticLog?: ConnectorDiagnosticLog;
@@ -320,13 +328,15 @@ type ConnectorListenerDeps = {
320
328
  * a clean SIGTERM story wire `controller.signal` here and call
321
329
  * `controller.abort()` in their shutdown handler.
322
330
  */
323
- signal?: AbortSignal; /** Resolves the per-connector state directory (`<dir>/channels/<id>/connectors/<id>`). */
331
+ signal?: AbortSignal;
332
+ /** Resolves the per-connector state directory (`<dir>/channels/<id>/connectors/<id>`). */
324
333
  connectorDir: (channelId: string, connectorId: string) => string;
325
334
  };
326
335
  /** Boundaries an adapter needs. Adapters are channel-agnostic. */
327
336
  type ConnectorAdapterDeps = {
328
337
  fs: FunnelFileSystem;
329
- process: FunnelProcessRunner; /** HTTP client for outbound calls. Used by the Slack adapter, future REST adapters. */
338
+ process: FunnelProcessRunner;
339
+ /** HTTP client for outbound calls. Used by the Slack adapter, future REST adapters. */
330
340
  http: FunnelHttpClient;
331
341
  logger?: FunnelLogger;
332
342
  };
@@ -369,7 +379,8 @@ type ConnectorOperation = (props: {
369
379
  type ConnectorDescriptor = {
370
380
  type: string;
371
381
  createListener: (config: BaseConnectorConfig, deps: ConnectorListenerDeps) => FunnelConnectorListener;
372
- createAdapter: ((config: BaseConnectorConfig, deps: ConnectorAdapterDeps) => FunnelConnectorAdapter) | null; /** Whether the MCP channel server exposes this type as a callable tool. */
382
+ createAdapter: ((config: BaseConnectorConfig, deps: ConnectorAdapterDeps) => FunnelConnectorAdapter) | null;
383
+ /** Whether the MCP channel server exposes this type as a callable tool. */
373
384
  toolExposed: boolean;
374
385
  secretTokens: (config: BaseConnectorConfig) => string[];
375
386
  buildConfig: (input: Record<string, unknown>, context: ConnectorBuildContext) => BaseConnectorConfig;
@@ -5,6 +5,7 @@
5
5
  * fields. When no log is wired every call is a silent no-op.
6
6
  */
7
7
  var FunnelConnectorDiagnosticsRecorder = class {
8
+ props;
8
9
  constructor(props) {
9
10
  this.props = props;
10
11
  Object.freeze(this);
@@ -1,12 +1,12 @@
1
- import { t as FunnelLogger } from "../logger-Bc_Ooypb.js";
2
- import { M as CallInput, N as FunnelConnectorAdapter, c as FunnelHttpClient, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-CmyHlEiT.js";
3
- import { n as discordConnectorSchema, t as DiscordConnectorConfig } from "../discord-connector-schema-D1dyxhXk.js";
4
- import { t as FunnelFlumeSourceListener } from "../flume-source-listener-FzR5lGpL.js";
1
+ import { t as FunnelLogger } from "../logger-mMZvblTx.js";
2
+ import { M as CallInput, N as FunnelConnectorAdapter, c as FunnelHttpClient, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-F75ZI8Fh.js";
3
+ import { n as discordConnectorSchema, t as DiscordConnectorConfig } from "../discord-connector-schema-BaBZYHxK.js";
4
+ import { t as FunnelFlumeSourceListener } from "../flume-source-listener-CLtsdcT2.js";
5
5
  import { FlumeRuntimeDeps } from "@interactive-inc/flume";
6
-
7
6
  //#region lib/engine/connectors/discord-adapter.d.ts
8
7
  type Deps$1 = {
9
- config: DiscordConnectorConfig; /** Environment used to resolve a `botTokenEnv` reference. Defaults to process.env. */
8
+ config: DiscordConnectorConfig;
9
+ /** Environment used to resolve a `botTokenEnv` reference. Defaults to process.env. */
10
10
  env?: NodeJS.ProcessEnv;
11
11
  http?: FunnelHttpClient;
12
12
  };
@@ -79,8 +79,10 @@ type Deps = {
79
79
  env?: NodeJS.ProcessEnv;
80
80
  logger?: FunnelLogger;
81
81
  diagnosticLog?: ConnectorDiagnosticLog;
82
- flumeDeps?: Partial<FlumeRuntimeDeps>; /** Shutdown signal forwarded to the underlying Flume. */
83
- signal?: AbortSignal; /** See `DiscordConnectorOptions.eventTypes`. */
82
+ flumeDeps?: Partial<FlumeRuntimeDeps>;
83
+ /** Shutdown signal forwarded to the underlying Flume. */
84
+ signal?: AbortSignal;
85
+ /** See `DiscordConnectorOptions.eventTypes`. */
84
86
  eventTypes?: ReadonlyArray<string> | "all";
85
87
  };
86
88
  /**
@@ -1,3 +1,3 @@
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-DXARcO6w.js";
1
+ import { t as discordConnectorSchema } from "../discord-connector-schema-saAGuPmJ.js";
2
+ import { i as FunnelDiscordAdapter, n as FunnelFlumeDiscordListener, r as FunnelDiscordEventProcessor, t as discordConnector } from "../discord-connector-CdjwPoty.js";
3
3
  export { FunnelDiscordAdapter, FunnelDiscordEventProcessor, FunnelFlumeDiscordListener, discordConnector, discordConnectorSchema };
@@ -1,9 +1,8 @@
1
- import { t as FunnelLogger } from "../logger-Bc_Ooypb.js";
2
- import { M as CallInput, N as FunnelConnectorAdapter, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor, z as FunnelProcessRunner } from "../connector-descriptor-CmyHlEiT.js";
3
- import { t as FunnelFlumeSourceListener } from "../flume-source-listener-FzR5lGpL.js";
4
- import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-BCHEqpUg.js";
1
+ import { t as FunnelLogger } from "../logger-mMZvblTx.js";
2
+ import { M as CallInput, N as FunnelConnectorAdapter, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor, z as FunnelProcessRunner } from "../connector-descriptor-F75ZI8Fh.js";
3
+ import { t as FunnelFlumeSourceListener } from "../flume-source-listener-CLtsdcT2.js";
4
+ import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-BrNsCl1T.js";
5
5
  import { FlumeRuntimeDeps } from "@interactive-inc/flume";
6
-
7
6
  //#region lib/engine/connectors/gh-adapter.d.ts
8
7
  type Deps$1 = {
9
8
  process?: FunnelProcessRunner;
@@ -34,7 +33,8 @@ type Deps = {
34
33
  process?: FunnelProcessRunner;
35
34
  logger?: FunnelLogger;
36
35
  diagnosticLog?: ConnectorDiagnosticLog;
37
- flumeDeps?: Partial<FlumeRuntimeDeps>; /** Shutdown signal forwarded to the underlying Flume. */
36
+ flumeDeps?: Partial<FlumeRuntimeDeps>;
37
+ /** Shutdown signal forwarded to the underlying Flume. */
38
38
  signal?: AbortSignal;
39
39
  };
40
40
  /**
@@ -1,3 +1,3 @@
1
- import { t as ghConnectorSchema } from "../gh-connector-schema-CAqIhzGr.js";
2
- import { n as FunnelFlumeGhListener, r as FunnelGhAdapter, t as ghConnector } from "../gh-connector-BUGCOEWS.js";
1
+ import { t as ghConnectorSchema } from "../gh-connector-schema-DmZTrzUu.js";
2
+ import { n as FunnelFlumeGhListener, r as FunnelGhAdapter, t as ghConnector } from "../gh-connector-D-iyjl-d.js";
3
3
  export { FunnelFlumeGhListener, FunnelGhAdapter, ghConnector, ghConnectorSchema };
@@ -1,8 +1,7 @@
1
- import { t as FunnelLogger } from "../logger-Bc_Ooypb.js";
2
- import { n as FunnelFileSystem } from "../file-system-DHgbuTFb.js";
3
- import { A as FunnelConnectorListener, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-CmyHlEiT.js";
4
- import { a as scheduleConnectorSchema, i as scheduleCatchupPolicySchema, n as ScheduleConnectorConfig, o as scheduleEntrySchema, r as ScheduleEntry, t as ScheduleCatchupPolicy } from "../schedule-connector-schema-D7ZEKvit.js";
5
-
1
+ import { t as FunnelLogger } from "../logger-mMZvblTx.js";
2
+ import { n as FunnelFileSystem } from "../file-system-BNtl997T.js";
3
+ import { A as FunnelConnectorListener, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-F75ZI8Fh.js";
4
+ import { a as scheduleConnectorSchema, i as scheduleCatchupPolicySchema, n as ScheduleConnectorConfig, o as scheduleEntrySchema, r as ScheduleEntry, t as ScheduleCatchupPolicy } from "../schedule-connector-schema-DBko_Bf7.js";
6
5
  //#region lib/engine/connectors/match-cron.d.ts
7
6
  /**
8
7
  * Returns true when `date` (local time) satisfies a 5-field cron expression.
@@ -39,9 +38,11 @@ declare class FunnelScheduleStateStore {
39
38
  type ScheduleOnFired = (entry: ScheduleEntry, firedAt: Date) => void | Promise<void>;
40
39
  type Deps = {
41
40
  config: ScheduleConnectorConfig;
42
- lastFiredStore: FunnelScheduleStateStore; /** Funnel channel uuid this connector lives under; stamped onto diagnostic-log rows. */
41
+ lastFiredStore: FunnelScheduleStateStore;
42
+ /** Funnel channel uuid this connector lives under; stamped onto diagnostic-log rows. */
43
43
  channelId?: string;
44
- logger?: FunnelLogger; /** Diagnostic log of fired entries and lifecycle. No-op when absent. */
44
+ logger?: FunnelLogger;
45
+ /** Diagnostic log of fired entries and lifecycle. No-op when absent. */
45
46
  diagnosticLog?: ConnectorDiagnosticLog;
46
47
  now?: () => Date;
47
48
  /**
@@ -77,7 +78,8 @@ declare class FunnelScheduleListener extends FunnelConnectorListener {
77
78
  //#endregion
78
79
  //#region lib/engine/connectors/schedule-connector.d.ts
79
80
  type ScheduleConnectorOptions = {
80
- /** Invoked after a schedule entry fires successfully — e.g. to drop one-shot entries. */onFired?: ScheduleOnFired;
81
+ /** Invoked after a schedule entry fires successfully — e.g. to drop one-shot entries. */
82
+ onFired?: ScheduleOnFired;
81
83
  };
82
84
  /**
83
85
  * Schedule connector descriptor. Pass `scheduleConnector()` to
@@ -1,3 +1,3 @@
1
- import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "../schedule-connector-schema-DKEPZnVv.js";
2
- import { i as matchCron, n as FunnelScheduleListener, r as FunnelScheduleStateStore, t as scheduleConnector } from "../schedule-connector-9k3gOIgl.js";
1
+ import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "../schedule-connector-schema-C2AChpwX.js";
2
+ import { i as matchCron, n as FunnelScheduleListener, r as FunnelScheduleStateStore, t as scheduleConnector } from "../schedule-connector-teeDMHUe.js";
3
3
  export { FunnelScheduleListener, FunnelScheduleStateStore, matchCron, scheduleCatchupPolicySchema, scheduleConnector, scheduleConnectorSchema, scheduleEntrySchema };
@@ -1,13 +1,13 @@
1
- import { t as FunnelLogger } from "../logger-Bc_Ooypb.js";
2
- import { M as CallInput, N as FunnelConnectorAdapter, c as FunnelHttpClient, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-CmyHlEiT.js";
3
- import { t as FunnelFlumeSourceListener } from "../flume-source-listener-FzR5lGpL.js";
4
- import { a as SlackRawEvent, c as SlackMessageEvent, d as slackConnectorSchema, i as SlackProcessedSkip, l as SlackReactionEvent, n as SlackProcessed, o as SlackSkipReason, r as SlackProcessedEmit, s as SlackEvent, t as FunnelSlackEventProcessor, u as SlackConnectorConfig } from "../slack-event-processor-BDTr62cN.js";
1
+ import { t as FunnelLogger } from "../logger-mMZvblTx.js";
2
+ import { M as CallInput, N as FunnelConnectorAdapter, c as FunnelHttpClient, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-F75ZI8Fh.js";
3
+ import { t as FunnelFlumeSourceListener } from "../flume-source-listener-CLtsdcT2.js";
4
+ import { a as SlackRawEvent, c as SlackMessageEvent, d as slackConnectorSchema, i as SlackProcessedSkip, l as SlackReactionEvent, n as SlackProcessed, o as SlackSkipReason, r as SlackProcessedEmit, s as SlackEvent, t as FunnelSlackEventProcessor, u as SlackConnectorConfig } from "../slack-event-processor-DmAlq4cV.js";
5
5
  import { FlumeRuntimeDeps } from "@interactive-inc/flume";
6
-
7
6
  //#region lib/engine/connectors/slack-adapter.d.ts
8
7
  type Deps$1 = {
9
8
  config: SlackConnectorConfig;
10
- env?: NodeJS.ProcessEnv; /** HTTP client injection — defaults to `NodeFunnelHttpClient`. Tests inject `MemoryFunnelHttpClient`. */
9
+ env?: NodeJS.ProcessEnv;
10
+ /** HTTP client injection — defaults to `NodeFunnelHttpClient`. Tests inject `MemoryFunnelHttpClient`. */
11
11
  http?: FunnelHttpClient;
12
12
  };
13
13
  /**
@@ -73,10 +73,14 @@ type Deps = {
73
73
  env?: NodeJS.ProcessEnv;
74
74
  logger?: FunnelLogger;
75
75
  diagnosticLog?: ConnectorDiagnosticLog;
76
- flumeDeps?: Partial<FlumeRuntimeDeps>; /** HTTP client for `auth.test` and `reactions.add`. Defaults to NodeFunnelHttpClient. */
77
- http?: FunnelHttpClient; /** Shutdown signal forwarded to the underlying Flume. */
78
- signal?: AbortSignal; /** See `SlackPreprocessEvent`. Default: identity (no preprocessing). */
79
- preprocessEvent?: SlackPreprocessEvent; /** See `SlackInteractiveHandler`. Default: drop interactive envelopes silently. */
76
+ flumeDeps?: Partial<FlumeRuntimeDeps>;
77
+ /** HTTP client for `auth.test` and `reactions.add`. Defaults to NodeFunnelHttpClient. */
78
+ http?: FunnelHttpClient;
79
+ /** Shutdown signal forwarded to the underlying Flume. */
80
+ signal?: AbortSignal;
81
+ /** See `SlackPreprocessEvent`. Default: identity (no preprocessing). */
82
+ preprocessEvent?: SlackPreprocessEvent;
83
+ /** See `SlackInteractiveHandler`. Default: drop interactive envelopes silently. */
80
84
  onInteractive?: SlackInteractiveHandler;
81
85
  };
82
86
  /**
@@ -1,4 +1,4 @@
1
- import { t as slackConnectorSchema } from "../slack-connector-schema-Dem8to4P.js";
2
- import { t as FunnelSlackEventProcessor } from "../slack-event-processor-xFDG3US0.js";
3
- import { n as FunnelFlumeSlackListener, r as FunnelSlackAdapter, t as slackConnector } from "../slack-connector-CxpWagbT.js";
1
+ import { t as slackConnectorSchema } from "../slack-connector-schema-EGVuuqSX.js";
2
+ import { t as FunnelSlackEventProcessor } from "../slack-event-processor-Cs_YuI3w.js";
3
+ import { n as FunnelFlumeSlackListener, r as FunnelSlackAdapter, t as slackConnector } from "../slack-connector-BE0KAjCs.js";
4
4
  export { FunnelFlumeSlackListener, FunnelSlackAdapter, FunnelSlackEventProcessor, slackConnector, slackConnectorSchema };
@@ -1,2 +1,2 @@
1
- import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, h as toDiagnosticEvent, i as DiagnosticsChannelSource, l as ReplayResult, m as toDiagnosticConnectionError, n as DiagnoseAllReport, o as DiagnosticsPublisher, p as queryRows, r as DiagnosisStatus, s as DiagnosticsTokenReader, t as ChannelDiagnosis, u as DiagnosticConnectionError } from "./funnel-diagnostics-kbd27d7I.js";
1
+ import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, h as toDiagnosticEvent, i as DiagnosticsChannelSource, l as ReplayResult, m as toDiagnosticConnectionError, n as DiagnoseAllReport, o as DiagnosticsPublisher, p as queryRows, r as DiagnosisStatus, s as DiagnosticsTokenReader, t as ChannelDiagnosis, u as DiagnosticConnectionError } from "./funnel-diagnostics-CnKus3Jg.js";
2
2
  export { ChannelDiagnosis, DiagnoseAllReport, DiagnosisStatus, DiagnosticConnectionError, DiagnosticEvent, DiagnosticsChannelSource, DiagnosticsGatewayProbe, DiagnosticsPublisher, DiagnosticsTokenReader, FunnelDiagnostics, ReplayResult, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
@@ -1,2 +1,2 @@
1
- import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-Cvk6Sk4x.js";
1
+ import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-B-PCuv_E.js";
2
2
  export { FunnelDiagnostics, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
@@ -1,9 +1,9 @@
1
- import { t as NodeFunnelHttpClient } from "./node-http-client-u00atiKx.js";
2
- import { t as errorMessageOf } from "./error-message-of-ColuYmAk.js";
3
- import { t as discordConnectorSchema } from "./discord-connector-schema-B4YpWpR3.js";
4
- import { t as FunnelConnectorAdapter } from "./connector-adapter-Dvs8N7ew.js";
5
- import { t as resolveConnectorToken } from "./resolve-connector-token-DxDG9mhf.js";
6
- 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 errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
3
+ import { t as discordConnectorSchema } from "./discord-connector-schema-saAGuPmJ.js";
4
+ import { t as FunnelConnectorAdapter } from "./connector-adapter-BL2ehMej.js";
5
+ import { t as resolveConnectorToken } from "./resolve-connector-token-BwiJCu82.js";
6
+ import { i as resolveFlumeDeps, n as FunnelFlumeSourceListener, r as flumeLogHandler, t as slotFields } from "./slot-fields-5ERhytIA.js";
7
7
  import { FlumeDiscordGatewayIntents, FlumeDiscordSource } from "@interactive-inc/flume/discord";
8
8
  //#region lib/engine/connectors/discord-adapter.ts
9
9
  const DISCORD_API_BASE = "https://discord.com/api/v10";
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
-
3
2
  //#region lib/engine/connectors/discord-connector-schema.d.ts
4
3
  /**
5
4
  * Like slack, a discord connector holds either a literal `botToken` or a
package/dist/docs.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-Cd66sKyV.js";
1
+ import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-BJWawfWI.js";
2
2
  export { DocsTopicListing, FunnelDocs };
package/dist/docs.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as FunnelDocs } from "./funnel-docs-C-ge0MuB.js";
1
+ import { t as FunnelDocs } from "./funnel-docs-BFcqITFA.js";
2
2
  export { FunnelDocs };
package/dist/doctor.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-CVTNUtDn.js";
1
+ import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-CviUTINw.js";
2
2
  export { DoctorFixMode, DoctorReport, FunnelDoctor };
package/dist/doctor.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as FunnelDoctor } from "./funnel-doctor-XrI2GBH8.js";
1
+ import { t as FunnelDoctor } from "./funnel-doctor-Csw5qjcH.js";
2
2
  export { FunnelDoctor };
@@ -1,9 +1,8 @@
1
- import { t as FunnelLogger } from "./logger-Bc_Ooypb.js";
2
- import { n as FunnelFileSystem } from "./file-system-DHgbuTFb.js";
3
- import { t as ChannelConfig } from "./settings-schema-IShSMm5G.js";
4
- import { n as FunnelIdGenerator } from "./settings-reader-BnKIbmsD.js";
5
- import { z as FunnelProcessRunner } from "./connector-descriptor-CmyHlEiT.js";
6
-
1
+ import { t as FunnelLogger } from "./logger-mMZvblTx.js";
2
+ import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
3
+ import { t as ChannelConfig } from "./settings-schema-B-CKLuST.js";
4
+ import { n as FunnelIdGenerator } from "./settings-reader-CyTpbAre.js";
5
+ import { z as FunnelProcessRunner } from "./connector-descriptor-F75ZI8Fh.js";
7
6
  //#region lib/engine/claude/channel-resolver.d.ts
8
7
  type ChannelResolver = {
9
8
  get(name: string): ChannelConfig | null;
@@ -26,15 +25,19 @@ type McpInstaller = {
26
25
  //#endregion
27
26
  //#region lib/engine/claude/process-guard.d.ts
28
27
  type ProcessGuard = {
29
- /** Returns true if a live process is already registered for this profile. */isRunning(profileId: string): boolean; /** Writes the PID file and registers an exit hook to clean it up. */
30
- acquire(profileId: string): void; /** Removes the PID file. */
28
+ /** Returns true if a live process is already registered for this profile. */
29
+ isRunning(profileId: string): boolean;
30
+ /** Writes the PID file and registers an exit hook to clean it up. */
31
+ acquire(profileId: string): void;
32
+ /** Removes the PID file. */
31
33
  release(profileId: string): void;
32
34
  };
33
35
  //#endregion
34
36
  //#region lib/engine/claude/session-store.d.ts
35
37
  type SessionStore = {
36
38
  getSessionId(profileId: string): string | null;
37
- setSessionId(profileId: string, sessionId: string): void; /** Returns true when the session jsonl exists on disk and is non-empty. */
39
+ setSessionId(profileId: string, sessionId: string): void;
40
+ /** Returns true when the session jsonl exists on disk and is non-empty. */
38
41
  sessionFileExists(cwd: string, sessionId: string, env: Record<string, string>): boolean;
39
42
  };
40
43
  //#endregion
@@ -42,8 +45,10 @@ type SessionStore = {
42
45
  type LaunchCommon = {
43
46
  channel: string;
44
47
  cwd?: string;
45
- userArgs?: string[]; /** Args prepended to the claude argv (typically a profile's recipe). Defaults to none. */
46
- options?: string[]; /** Env vars layered under the launched claude process. process.env wins on collision. */
48
+ userArgs?: string[];
49
+ /** Args prepended to the claude argv (typically a profile's recipe). Defaults to none. */
50
+ options?: string[];
51
+ /** Env vars layered under the launched claude process. process.env wins on collision. */
47
52
  env?: Record<string, string>;
48
53
  /** Invoked synchronously after the child claude process has been spawned, with its PID.
49
54
  * Useful for hosts that need to register the spawned process before it exits
@@ -57,18 +62,17 @@ type LaunchCommon = {
57
62
  /**
58
63
  * A launch carries one of two targets, distinguished by `profileId`.
59
64
  *
60
- * - **profile launch** — has a stable `profileId` (uuid). Enforces singleton-ness
61
- * via the PID file and may opt into `resume` to reuse the profile's session.
65
+ * - **profile launch** — has a stable `profileId` (a global uuid or a
66
+ * deterministic repo-local id). Enforces singleton-ness via the PID file and
67
+ * may opt into `resume` to reuse the profile's session.
62
68
  * - **profile-less launch** — raw `--channel`. Never enforces singleton-ness and
63
69
  * always starts a fresh session, so `resume` is meaningless and disallowed.
64
70
  *
65
- * Modeling these as a union (rather than two independent optional fields) makes
66
- * `resume` without a `profileId` a compile error — previously it was silently
67
- * ignored, which masked real bugs (a profile resume that never took effect).
71
+ * Modeling these as a union makes `resume` without a profile id a compile error.
68
72
  */
69
73
  type LaunchTarget = {
70
- /** Stable id of the launching profile (uuid). Keys the singleton PID file
71
- * and the resumable session. */
74
+ /** Stable id of the launching profile. Keys the singleton PID file and
75
+ * the resumable session. */
72
76
  profileId: string;
73
77
  /** Inject `--session-id`/`--resume` for this profile (opt-in, default false).
74
78
  * The persisted session is owned by the profile (by id). */
@@ -1,6 +1,7 @@
1
1
  //#region lib/engine/fs/file-system.d.ts
2
2
  type FileStat = {
3
- mtimeMs: number; /** POSIX mode bits (e.g. 0o600). `null` when the underlying FS does not expose mode. */
3
+ mtimeMs: number;
4
+ /** POSIX mode bits (e.g. 0o600). `null` when the underlying FS does not expose mode. */
4
5
  mode: number | null;
5
6
  };
6
7
  /**
@@ -1,7 +1,6 @@
1
- import { t as FunnelLogger } from "./logger-Bc_Ooypb.js";
2
- import { A as FunnelConnectorListener, g as ConnectorDiagnosticLog, h as ConnectorConnectionStatus } from "./connector-descriptor-CmyHlEiT.js";
1
+ import { t as FunnelLogger } from "./logger-mMZvblTx.js";
2
+ import { A as FunnelConnectorListener, g as ConnectorDiagnosticLog, h as ConnectorConnectionStatus } from "./connector-descriptor-F75ZI8Fh.js";
3
3
  import { FlumeEventHandler, FlumeLogHandler, FlumeReconnectOptions, FlumeRunning, FlumeRuntimeDeps, FlumeSource, FlumeStatus } from "@interactive-inc/flume";
4
-
5
4
  //#region lib/engine/connectors/connector-diagnostics-recorder.d.ts
6
5
  type Props$1 = {
7
6
  type: string;
@@ -24,15 +23,18 @@ declare class FunnelConnectorDiagnosticsRecorder {
24
23
  //#endregion
25
24
  //#region lib/engine/connectors/flume-source-listener.d.ts
26
25
  type Props = {
27
- /** Funnel connector type ("slack" / "discord" / "gh") — stamped onto diagnostic rows. */type: string;
26
+ /** Funnel connector type ("slack" / "discord" / "gh") — stamped onto diagnostic rows. */
27
+ type: string;
28
28
  connectorId: string;
29
29
  channelId: string | null;
30
30
  logger?: FunnelLogger;
31
31
  diagnosticLog?: ConnectorDiagnosticLog;
32
32
  };
33
33
  type RunStartOptions = {
34
- source: FlumeSource; /** Typed event handler — receives the source's events only (logs are routed separately). */
35
- onEvent: FlumeEventHandler; /** Optional log handler for everything the firehose emits (including status transitions). */
34
+ source: FlumeSource;
35
+ /** Typed event handler receives the source's events only (logs are routed separately). */
36
+ onEvent: FlumeEventHandler;
37
+ /** Optional log handler for everything the firehose emits (including status transitions). */
36
38
  onLog?: FlumeLogHandler;
37
39
  deps?: FlumeRuntimeDeps;
38
40
  /**
@@ -1,6 +1,6 @@
1
- import { n as gatewayLoopbackUrl, t as loopbackFetch } from "./loopback-fetch-CVNuN3YZ.js";
2
- import { t as errorMessageOf } from "./error-message-of-ColuYmAk.js";
3
- import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-oXZnWFf_.js";
1
+ import { n as gatewayLoopbackUrl, t as loopbackFetch } from "./loopback-fetch-HP-bo9Kv.js";
2
+ import { t as errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
3
+ import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-CoBk_EFF.js";
4
4
  import { join } from "node:path";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  //#region lib/services/diagnostics/diagnostic-event.ts
@@ -164,6 +164,7 @@ const diagnoseSlackEventSubscriptionGap = (report) => {
164
164
  * mutation; pair with FunnelRecovery for self-healing actions.
165
165
  */
166
166
  var FunnelDiagnostics = class {
167
+ props;
167
168
  constructor(props) {
168
169
  this.props = props;
169
170
  Object.freeze(this);
@@ -1,9 +1,11 @@
1
- import { t as ChannelConfig } from "./settings-schema-IShSMm5G.js";
2
-
1
+ import { t as ChannelConfig } from "./settings-schema-B-CKLuST.js";
3
2
  //#region lib/engine/diagnostic-log/diagnostic-sql-reader.d.ts
4
3
  type Props$1 = {
5
- /** SQLite file holding the raw (pre-filter) table. */rawPath: string; /** SQLite file holding the processed (verdict) table. */
6
- processedPath: string; /** SQLite file holding the connection (lifecycle) table. */
4
+ /** SQLite file holding the raw (pre-filter) table. */
5
+ rawPath: string;
6
+ /** SQLite file holding the processed (verdict) table. */
7
+ processedPath: string;
8
+ /** SQLite file holding the connection (lifecycle) table. */
7
9
  connectionPath: string;
8
10
  };
9
11
  type Row = Record<string, unknown>;
@@ -111,7 +113,8 @@ type ChannelDiagnosis = {
111
113
  * but the probe failed (auth refused, fetch error, non-OK response).
112
114
  */
113
115
  statusError: string | null;
114
- }; /** Connectors declared in settings for this channel. */
116
+ };
117
+ /** Connectors declared in settings for this channel. */
115
118
  configuredConnectors: number;
116
119
  listeners: Array<{
117
120
  name: string;
@@ -378,6 +378,10 @@ what funnel never writes to funnel.json:
378
378
 
379
379
  ~/.funnel/projects/<id>/settings.json per-repo, set via CLI or TTY prompt
380
380
 
381
+ When a profile declares resume: true, its generated Claude session id lives
382
+ in ~/.funnel/projects/<id>/claude/local-sessions.json. The id is runtime
383
+ state and is never written to the committed funnel.json.
384
+
381
385
  how it is read:
382
386
 
383
387
  All CLI commands check for funnel.json in cwd. If found, FUNNEL_DIR is
@@ -6,6 +6,7 @@
6
6
  * logic (which fixes to attempt, in what order, when to escalate) lives here.
7
7
  */
8
8
  var FunnelDoctor = class {
9
+ props;
9
10
  constructor(props) {
10
11
  this.props = props;
11
12
  Object.freeze(this);
@@ -1,18 +1,29 @@
1
- import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-kbd27d7I.js";
2
- import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-D8MkiTpk.js";
3
-
1
+ import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-CnKus3Jg.js";
2
+ import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-BwcSNNSN.js";
4
3
  //#region lib/services/doctor/funnel-doctor.d.ts
5
4
  type Props = {
6
5
  diagnostics: FunnelDiagnostics;
7
6
  recovery: FunnelRecovery;
8
7
  };
9
- type DoctorFixMode = /** No mutations. Run diagnoseAll and report what would be fixed. */"off" /** Apply only idempotent, low-risk fixes — start the gateway, restart dead listeners. */ | "safe" /** Add high-impact fixes — full gateway restart when partial fixes are insufficient. */ | "aggressive";
8
+ type DoctorFixMode =
9
+ /** No mutations. Run diagnoseAll and report what would be fixed. */
10
+ "off" |
11
+ /** Apply only idempotent, low-risk fixes — start the gateway, restart dead listeners. */
12
+ "safe" |
13
+ /** Add high-impact fixes — full gateway restart when partial fixes are insufficient. */
14
+ "aggressive";
10
15
  type DoctorReport = {
11
- /** "ok" if every channel is healthy after the run; "warn" if anything is still off; "error" if a fix step itself failed. */status: "ok" | "warn" | "error"; /** Human-readable summary suitable for stdout. */
12
- message: string; /** Aggregated diagnosis after any fix pass. */
13
- after: DiagnoseAllReport; /** Diagnosis before fixing, only included when fix mode is not "off". */
14
- before: DiagnoseAllReport | null; /** Each recovery action that ran during the fix pass. */
15
- appliedActions: RecoveryAction[]; /** Channels still unhealthy after the fix pass (or all unhealthy channels when fix is off). */
16
+ /** "ok" if every channel is healthy after the run; "warn" if anything is still off; "error" if a fix step itself failed. */
17
+ status: "ok" | "warn" | "error";
18
+ /** Human-readable summary suitable for stdout. */
19
+ message: string;
20
+ /** Aggregated diagnosis after any fix pass. */
21
+ after: DiagnoseAllReport;
22
+ /** Diagnosis before fixing, only included when fix mode is not "off". */
23
+ before: DiagnoseAllReport | null;
24
+ /** Each recovery action that ran during the fix pass. */
25
+ appliedActions: RecoveryAction[];
26
+ /** Channels still unhealthy after the fix pass (or all unhealthy channels when fix is off). */
16
27
  remainingIssues: Array<{
17
28
  channel: string;
18
29
  diagnosis: ChannelDiagnosis["diagnosis"];