@interactive-inc/claude-funnel 0.58.0 → 0.59.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 (43) hide show
  1. package/dist/bin.js +354 -293
  2. package/dist/claude.d.ts +5 -5
  3. package/dist/claude.js +1 -1
  4. package/dist/connectors/discord.d.ts +3 -3
  5. package/dist/connectors/gh.d.ts +4 -4
  6. package/dist/connectors/schedule.d.ts +1 -1
  7. package/dist/connectors/slack.d.ts +2 -2
  8. package/dist/diagnostics.d.ts +1 -1
  9. package/dist/docs.d.ts +1 -1
  10. package/dist/doctor.d.ts +1 -1
  11. package/dist/{file-process-guard-DI1742H5.d.ts → file-process-guard-B3IFCj_G.d.ts} +5 -5
  12. package/dist/{funnel-diagnostics-qWy5tPSq.d.ts → funnel-diagnostics-K-wON25Y.d.ts} +1 -1
  13. package/dist/{funnel-doctor-BF3Rdgk0.d.ts → funnel-doctor-vxO96TCA.d.ts} +2 -2
  14. package/dist/funnel-log-sqlite-sink-B_5_4ybn.js +301 -0
  15. package/dist/{funnel-recovery-BUBsu7WX.d.ts → funnel-recovery-COExL9MD.d.ts} +1 -1
  16. package/dist/gateway.d.ts +2 -2
  17. package/dist/gateway.js +1 -1
  18. package/dist/{index-tP67P1Sy.d.ts → index-Conbxl5O.d.ts} +748 -166
  19. package/dist/index.d.ts +16 -16
  20. package/dist/index.js +142 -83
  21. package/dist/{local-config-sync-BY20ixEV.d.ts → local-config-sync--f739oCJ.d.ts} +8 -8
  22. package/dist/local-config.d.ts +2 -2
  23. package/dist/local-config.js +1 -1
  24. package/dist/logger.d.ts +384 -0
  25. package/dist/logger.js +281 -0
  26. package/dist/{memory-diagnostic-log-CvqobDDs.js → memory-diagnostic-log-5LzwJ_F7.js} +1 -298
  27. package/dist/{memory-token-prompter-DOgptiIb.d.ts → memory-token-prompter-BlFwK9k7.d.ts} +2 -2
  28. package/dist/{profiles-EHTeCOqB.d.ts → profiles-g2qGVOWv.d.ts} +3 -3
  29. package/dist/profiles.d.ts +1 -1
  30. package/dist/recovery.d.ts +1 -1
  31. package/dist/{schedule-listener-DKh0hnkK.d.ts → schedule-listener-DoMPjHZj.d.ts} +2 -2
  32. package/dist/{settings-reader-CBrgz01o.d.ts → settings-reader-DPwqOVUm.d.ts} +1 -1
  33. package/dist/{slack-listener-DFW9vck4.d.ts → slack-listener-Dj9NFbAJ.d.ts} +1 -1
  34. package/package.json +2 -2
  35. /package/dist/{connector-adapter-BkYC6qiK.d.ts → connector-adapter-DGacCppE.d.ts} +0 -0
  36. /package/dist/{diagnostic-log-Bxe7Bbvw.d.ts → diagnostic-log-Cb3v8P7p.d.ts} +0 -0
  37. /package/dist/{discord-connector-schema-CWHVNIcB.d.ts → discord-connector-schema-CQyfDkLD.d.ts} +0 -0
  38. /package/dist/{file-system-Wub9Nto4.d.ts → file-system-DxpnnUVb.d.ts} +0 -0
  39. /package/dist/{funnel-docs-dXPokzr5.d.ts → funnel-docs-DYBs1-H_.d.ts} +0 -0
  40. /package/dist/{gh-connector-schema-CU1ojfIF.d.ts → gh-connector-schema-CZzwzvqY.d.ts} +0 -0
  41. /package/dist/{memory-token-prompter-vBXxY20-.js → memory-token-prompter-C7vREzCL.js} +0 -0
  42. /package/dist/{process-runner-D5I_jhYQ.d.ts → process-runner-Cx5O_fTf.d.ts} +0 -0
  43. /package/dist/{settings-schema-zhnMIa8I.d.ts → settings-schema-1hh11jnN.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { a as Settings, c as profileConfigSchema, i as SETTINGS_VERSION, l as settingsSchema, n as ChannelDeliveryMode, o as channelConfigSchema, r as ProfileConfig, s as channelDeliveryModeSchema, t as ChannelConfig } from "./settings-schema-zhnMIa8I.js";
2
- import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-CBrgz01o.js";
3
- import { S as FunnelLogger, _ as connectorConnectionEventSchema, a as ConnectorConnectionStatus, b as FunnelConnectorListener, c as ConnectorProcessedQuery, d as ConnectorRawEvent, f as ConnectorRawQuery, g as StoredRawEvent, h as StoredProcessedEvent, i as ConnectorConnectionRecord, l as ConnectorProcessedRecord, m as StoredConnectionEvent, n as ConnectorConnectionEvent, o as ConnectorDiagnosticLog, p as ConnectorRawRecord, r as ConnectorConnectionQuery, s as ConnectorProcessedEvent, t as CONNECTOR_CONNECTION_STATUSES, u as ConnectorQuery, v as connectorProcessedEventSchema, x as NotifyFn, y as connectorRawEventSchema } from "./diagnostic-log-Bxe7Bbvw.js";
4
- import { a as RunOptions, i as ProcessSnapshot, n as DetachOptions, o as RunResult, r as FunnelProcessRunner, t as AttachOptions } from "./process-runner-D5I_jhYQ.js";
5
- import { n as FunnelFileSystem, t as FileStat } from "./file-system-Wub9Nto4.js";
6
- import { a as ChannelConnectorView, c as FunnelConnectorFactory, d as ConnectorConfig, f as ConnectorType, l as ScheduleListenerOptions, o as FunnelChannels, p as connectorConfigSchema, s as FunnelClock, u as SlackListenerOptions } from "./local-config-sync-BY20ixEV.js";
7
- import { n as FunnelConnectorAdapter, r as JsonValue, t as CallInput } from "./connector-adapter-BkYC6qiK.js";
8
- import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema } from "./schedule-listener-DKh0hnkK.js";
9
- import { a as slackConnectorSchema, c as SlackProcessedEmit, d as SlackSkipReason, i as SlackConnectorConfig, l as SlackProcessedSkip, o as FunnelSlackEventProcessor, s as SlackProcessed, u as SlackRawEvent } from "./slack-listener-DFW9vck4.js";
10
- import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, g as ConnectorDiagnosticSqlReader, 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-qWy5tPSq.js";
11
- import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-dXPokzr5.js";
12
- import { a as RecoveryListenerControl, i as RecoveryGatewayControl, n as RecoveryAction, o as RecoveryResult, r as RecoveryChannelSource, t as FunnelRecovery } from "./funnel-recovery-BUBsu7WX.js";
13
- import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-BF3Rdgk0.js";
14
- import { a as HttpResponse, i as HttpRequest, n as discordConnectorSchema, r as FunnelHttpClient, t as DiscordConnectorConfig } from "./discord-connector-schema-CWHVNIcB.js";
15
- import { n as ghConnectorSchema, t as GhConnectorConfig } from "./gh-connector-schema-CU1ojfIF.js";
16
- import { $ as PublishResult, A as NodeFunnelFileSystem, B as GatewayServerOptions, C as MemoryProcessCall, D as ProcessListStub, E as MemoryProcessSyncHandler, F as FunnelSettingsStore, G as FunnelGateway, H as ListListenersResult, I as SETTINGS_PATH, J as MemoryFunnelEventLog, K as MemoryConnectorDiagnosticLog, L as resolveFunnelDir, M as createSettings, N as DEFAULT_GATEWAY_PORT, O as NodeFunnelProcessRunner, P as FUNNEL_DIR, Q as PublishResponse, R as resolveFunnelPort, S as MemoryFunnelProcessRunner, St as OnFunnelError, T as MemoryProcessResponse, U as ListenerEntry, V as FunnelListenersClient, W as ListenerOpResult, X as FunnelChannelPublisher, Y as SqliteFunnelEventLog, Z as PublishRequest, _ as NoopFunnelLogger, _t as FunnelListenerSupervisor, a as toRequest, at as ChannelWsUrlInput, b as NodeFunnelLogger, bt as FunnelBroadcaster, c as buildServiceRoutes, ct as FunnelGatewayServer, d as MemoryHttpResponse, dt as FunnelEventLog, et as publishRequestSchema, f as NodeFunnelHttpClient, ft as FunnelEventRecord, g as NodeFunnelClock, gt as GatewayRouteDeps, h as MemoryFunnelClock, ht as GatewayEmitInput, i as queryToCliArgs, it as gatewayLoopbackUrl, j as MockFunnelSettingsReader, k as MemoryFunnelFileSystem, l as MemoryFunnelHttpClient, lt as GatewayEventStore, m as NodeFunnelIdGenerator, mt as Env$1, n as CliApp, nt as DEFAULT_GATEWAY_TOKEN_PATH, o as Env, ot as channelWsProtocols, p as MemoryFunnelIdGenerator, pt as funnelEventSchema, q as SqliteConnectorDiagnosticLog, r as routes, rt as FunnelGatewayToken, s as factory, st as channelWsUrl, t as GatewayApp, tt as publishResponseSchema, u as MemoryHttpHandler, ut as FunnelEvent, v as LogEntry, vt as BroadcastEvent, w as MemoryProcessHandler, x as AliveStub, xt as ReplayableEvent, y as MemoryFunnelLogger, yt as BroadcastSubscriber, z as Funnel } from "./index-tP67P1Sy.js";
1
+ import { a as Settings, c as profileConfigSchema, i as SETTINGS_VERSION, l as settingsSchema, n as ChannelDeliveryMode, o as channelConfigSchema, r as ProfileConfig, s as channelDeliveryModeSchema, t as ChannelConfig } from "./settings-schema-1hh11jnN.js";
2
+ import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-DPwqOVUm.js";
3
+ import { S as FunnelLogger, _ as connectorConnectionEventSchema, a as ConnectorConnectionStatus, b as FunnelConnectorListener, c as ConnectorProcessedQuery, d as ConnectorRawEvent, f as ConnectorRawQuery, g as StoredRawEvent, h as StoredProcessedEvent, i as ConnectorConnectionRecord, l as ConnectorProcessedRecord, m as StoredConnectionEvent, n as ConnectorConnectionEvent, o as ConnectorDiagnosticLog, p as ConnectorRawRecord, r as ConnectorConnectionQuery, s as ConnectorProcessedEvent, t as CONNECTOR_CONNECTION_STATUSES, u as ConnectorQuery, v as connectorProcessedEventSchema, x as NotifyFn, y as connectorRawEventSchema } from "./diagnostic-log-Cb3v8P7p.js";
4
+ import { a as RunOptions, i as ProcessSnapshot, n as DetachOptions, o as RunResult, r as FunnelProcessRunner, t as AttachOptions } from "./process-runner-Cx5O_fTf.js";
5
+ import { n as FunnelFileSystem, t as FileStat } from "./file-system-DxpnnUVb.js";
6
+ import { a as ChannelConnectorView, c as FunnelConnectorFactory, d as ConnectorConfig, f as ConnectorType, l as ScheduleListenerOptions, o as FunnelChannels, p as connectorConfigSchema, s as FunnelClock, u as SlackListenerOptions } from "./local-config-sync--f739oCJ.js";
7
+ import { n as FunnelConnectorAdapter, r as JsonValue, t as CallInput } from "./connector-adapter-DGacCppE.js";
8
+ import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema } from "./schedule-listener-DoMPjHZj.js";
9
+ import { a as slackConnectorSchema, c as SlackProcessedEmit, d as SlackSkipReason, i as SlackConnectorConfig, l as SlackProcessedSkip, o as FunnelSlackEventProcessor, s as SlackProcessed, u as SlackRawEvent } from "./slack-listener-Dj9NFbAJ.js";
10
+ import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, g as ConnectorDiagnosticSqlReader, 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-K-wON25Y.js";
11
+ import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-DYBs1-H_.js";
12
+ import { a as RecoveryListenerControl, i as RecoveryGatewayControl, n as RecoveryAction, o as RecoveryResult, r as RecoveryChannelSource, t as FunnelRecovery } from "./funnel-recovery-COExL9MD.js";
13
+ import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-vxO96TCA.js";
14
+ import { a as HttpResponse, i as HttpRequest, n as discordConnectorSchema, r as FunnelHttpClient, t as DiscordConnectorConfig } from "./discord-connector-schema-CQyfDkLD.js";
15
+ import { n as ghConnectorSchema, t as GhConnectorConfig } from "./gh-connector-schema-CZzwzvqY.js";
16
+ import { $ as PublishResult, A as NodeFunnelFileSystem, B as GatewayServerOptions, C as MemoryProcessCall, D as ProcessListStub, E as MemoryProcessSyncHandler, F as FunnelSettingsStore, G as FunnelGateway, H as ListListenersResult, I as SETTINGS_PATH, J as MemoryFunnelEventLog, K as MemoryConnectorDiagnosticLog, L as resolveFunnelDir, M as createSettings, N as DEFAULT_GATEWAY_PORT, O as NodeFunnelProcessRunner, P as FUNNEL_DIR, Q as PublishResponse, R as resolveFunnelPort, S as MemoryFunnelProcessRunner, St as OnFunnelError, T as MemoryProcessResponse, U as ListenerEntry, V as FunnelListenersClient, W as ListenerOpResult, X as FunnelChannelPublisher, Y as SqliteFunnelEventLog, Z as PublishRequest, _ as NoopFunnelLogger, _t as FunnelListenerSupervisor, a as toRequest, at as ChannelWsUrlInput, b as NodeFunnelLogger, bt as FunnelBroadcaster, c as buildServiceRoutes, ct as FunnelGatewayServer, d as MemoryHttpResponse, dt as FunnelEventLog, et as publishRequestSchema, f as NodeFunnelHttpClient, ft as FunnelEventRecord, g as NodeFunnelClock, gt as GatewayRouteDeps, h as MemoryFunnelClock, ht as GatewayEmitInput, i as queryToCliArgs, it as gatewayLoopbackUrl, j as MockFunnelSettingsReader, k as MemoryFunnelFileSystem, l as MemoryFunnelHttpClient, lt as GatewayEventStore, m as NodeFunnelIdGenerator, mt as Env$1, n as CliApp, nt as DEFAULT_GATEWAY_TOKEN_PATH, o as Env, ot as channelWsProtocols, p as MemoryFunnelIdGenerator, pt as funnelEventSchema, q as SqliteConnectorDiagnosticLog, r as routes, rt as FunnelGatewayToken, s as factory, st as channelWsUrl, t as GatewayApp, tt as publishResponseSchema, u as MemoryHttpHandler, ut as FunnelEvent, v as LogEntry, vt as BroadcastEvent, w as MemoryProcessHandler, x as AliveStub, xt as ReplayableEvent, y as MemoryFunnelLogger, yt as BroadcastSubscriber, z as Funnel } from "./index-Conbxl5O.js";
17
17
  export { AliveStub, AttachOptions, BroadcastEvent, BroadcastSubscriber, CONNECTOR_CONNECTION_STATUSES, CallInput, ChannelConfig, ChannelConnectorView, ChannelDeliveryMode, ChannelDiagnosis, ChannelWsUrlInput, CliApp, ConnectorConfig, ConnectorConnectionEvent, ConnectorConnectionQuery, ConnectorConnectionRecord, ConnectorConnectionStatus, ConnectorDiagnosticLog, ConnectorDiagnosticSqlReader, ConnectorProcessedEvent, ConnectorProcessedQuery, ConnectorProcessedRecord, ConnectorQuery, ConnectorRawEvent, ConnectorRawQuery, ConnectorRawRecord, ConnectorType, DEFAULT_GATEWAY_PORT, DEFAULT_GATEWAY_TOKEN_PATH, DetachOptions, DiagnoseAllReport, DiagnosisStatus, DiagnosticConnectionError, DiagnosticEvent, DiagnosticsChannelSource, DiagnosticsGatewayProbe, DiagnosticsPublisher, DiagnosticsTokenReader, DiscordConnectorConfig, DocsTopicListing, DoctorFixMode, DoctorReport, Env, FUNNEL_DIR, FileStat, Funnel, FunnelBroadcaster, FunnelChannelPublisher, FunnelChannels, FunnelClock, FunnelConnectorAdapter, FunnelConnectorFactory, FunnelConnectorListener, FunnelDiagnostics, FunnelDocs, FunnelDoctor, FunnelEvent, FunnelEventLog, FunnelEventRecord, FunnelFileSystem, FunnelGateway, FunnelGatewayServer, FunnelGatewayToken, FunnelHttpClient, FunnelIdGenerator, FunnelListenerSupervisor, FunnelListenersClient, FunnelLogger, FunnelProcessRunner, FunnelRecovery, FunnelSettingsReader, FunnelSettingsStore, FunnelSlackEventProcessor, GatewayApp, GatewayEmitInput, GatewayEventStore, GatewayRouteDeps, Env$1 as GatewayServerEnv, GatewayServerOptions, GhConnectorConfig, HttpRequest, HttpResponse, JsonValue, ListListenersResult, ListenerEntry, ListenerOpResult, LogEntry, MemoryConnectorDiagnosticLog, MemoryFunnelClock, MemoryFunnelEventLog, MemoryFunnelFileSystem, MemoryFunnelHttpClient, MemoryFunnelIdGenerator, MemoryFunnelLogger, MemoryFunnelProcessRunner, MemoryHttpHandler, MemoryHttpResponse, MemoryProcessCall, MemoryProcessHandler, MemoryProcessResponse, MemoryProcessSyncHandler, MockFunnelSettingsReader, NodeFunnelClock, NodeFunnelFileSystem, NodeFunnelHttpClient, NodeFunnelIdGenerator, NodeFunnelLogger, NodeFunnelProcessRunner, NoopFunnelLogger, NotifyFn, OnFunnelError, ProcessListStub, ProcessSnapshot, ProfileConfig, PublishRequest, PublishResponse, PublishResult, RecoveryAction, RecoveryChannelSource, RecoveryGatewayControl, RecoveryListenerControl, RecoveryResult, ReplayResult, ReplayableEvent, RunOptions, RunResult, SETTINGS_PATH, SETTINGS_VERSION, ScheduleCatchupPolicy, ScheduleConnectorConfig, ScheduleEntry, ScheduleListenerOptions, Settings, SlackConnectorConfig, SlackListenerOptions, SlackProcessed, SlackProcessedEmit, SlackProcessedSkip, SlackRawEvent, SlackSkipReason, SqliteConnectorDiagnosticLog, SqliteFunnelEventLog, StoredConnectionEvent, StoredProcessedEvent, StoredRawEvent, buildServiceRoutes, channelConfigSchema, channelDeliveryModeSchema, channelWsProtocols, channelWsUrl, routes as cliRoutes, connectorConfigSchema, connectorConnectionEventSchema, connectorProcessedEventSchema, connectorRawEventSchema, createSettings, discordConnectorSchema, factory, funnelEventSchema, gatewayLoopbackUrl, ghConnectorSchema, previewOf, profileConfigSchema, publishRequestSchema, publishResponseSchema, queryRows, queryToCliArgs, resolveFunnelDir, resolveFunnelPort, scheduleCatchupPolicySchema, scheduleConnectorSchema, scheduleEntrySchema, settingsSchema, slackConnectorSchema, toDiagnosticConnectionError, toDiagnosticEvent, toRequest };
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ import { t as FunnelDocs } from "./funnel-docs-ng5K8w4j.js";
21
21
  import { a as FunnelLocalConfig, n as NodeFunnelTokenPrompter, r as FunnelLocalConfigSync, t as funnelJsonSchema } from "./local-config-json-schema-DE1zkMcb.js";
22
22
  import { t as FunnelProfiles } from "./profiles-MnXvYfZF.js";
23
23
  import { t as FunnelRecovery } from "./funnel-recovery-D9CxD5Zs.js";
24
- import { C as funnelTmpDir, S as publishResponseSchema, _ as funnelEventSchema, a as connectorConnectionEventSchema, b as FunnelChannelPublisher, c as MemoryFunnelEventLog, d as DEFAULT_GATEWAY_TOKEN_PATH, f as FunnelGatewayToken, g as FunnelEventLog, h as SqliteFunnelEventLog, i as ConnectorDiagnosticLog, l as channelWsProtocols, m as FunnelListenerSupervisor, n as SqliteConnectorDiagnosticLog, o as connectorProcessedEventSchema, p as FunnelGatewayServer, r as CONNECTOR_CONNECTION_STATUSES, s as connectorRawEventSchema, t as MemoryConnectorDiagnosticLog, u as channelWsUrl, v as FunnelBroadcaster, x as publishRequestSchema, y as requireBearerToken } from "./memory-diagnostic-log-CvqobDDs.js";
24
+ import { C as funnelTmpDir, S as publishResponseSchema, _ as funnelEventSchema, a as connectorConnectionEventSchema, b as FunnelChannelPublisher, c as MemoryFunnelEventLog, d as DEFAULT_GATEWAY_TOKEN_PATH, f as FunnelGatewayToken, g as FunnelEventLog, h as SqliteFunnelEventLog, i as ConnectorDiagnosticLog, l as channelWsProtocols, m as FunnelListenerSupervisor, n as SqliteConnectorDiagnosticLog, o as connectorProcessedEventSchema, p as FunnelGatewayServer, r as CONNECTOR_CONNECTION_STATUSES, s as connectorRawEventSchema, t as MemoryConnectorDiagnosticLog, u as channelWsUrl, v as FunnelBroadcaster, x as publishRequestSchema, y as requireBearerToken } from "./memory-diagnostic-log-5LzwJ_F7.js";
25
25
  import { dirname, join, resolve } from "node:path";
26
26
  import { hc } from "hono/client";
27
27
  import { appendFileSync, existsSync, mkdirSync } from "node:fs";
@@ -29,7 +29,7 @@ import { z } from "zod";
29
29
  import { fileURLToPath } from "node:url";
30
30
  import { createFactory } from "hono/factory";
31
31
  import { HTTPException } from "hono/http-exception";
32
- import { zValidator } from "@hono/zod-validator";
32
+ import { zValidator as zValidator$1 } from "@hono/zod-validator";
33
33
  import { Hono } from "hono";
34
34
  //#region lib/engine/connectors/connector-factory.ts
35
35
  const defaultFs$1 = new NodeFunnelFileSystem();
@@ -1469,19 +1469,19 @@ usage: funnel channels add <name> [--delivery fanout|exclusive]
1469
1469
  options:
1470
1470
  --delivery routing mode (default fanout):
1471
1471
  fanout every connected client receives every event
1472
- exclusive each event delivered to exactly one client (round-robin)`;
1472
+ exclusive each event delivered to exactly one client (round-robin)
1473
+
1474
+ A channel is a named event stream. After creating it, add connectors
1475
+ (Slack, Discord, GitHub, schedule) to feed events into it, then connect
1476
+ Claude Code clients to consume them.
1477
+
1478
+ examples:
1479
+ funnel channels add production
1480
+ funnel channels add ci-events --delivery exclusive
1481
+
1482
+ see also: funnel channels, funnel channels <name> connectors add`;
1473
1483
  const channelsAddHelpHandler = factory.createHandlers((c) => c.text(help$17));
1474
1484
  //#endregion
1475
- //#region lib/cli/router/validator.ts
1476
- const zValidator$1 = (target, schema, helpText) => zValidator(target, schema, (result, c) => {
1477
- if (helpText && c.req.query("help")) return c.text(helpText);
1478
- if (result.success) return;
1479
- const issue = result.error.issues[0];
1480
- if (!issue) throw new HTTPException(400, { message: "invalid request" });
1481
- const path = issue.path.join(".");
1482
- throw new HTTPException(400, { message: path ? `${path}: ${issue.message}` : issue.message });
1483
- });
1484
- //#endregion
1485
1485
  //#region lib/cli/routes/channels.add.$channel.ts
1486
1486
  const channelsAddHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), zValidator$1("query", z.object({ delivery: channelDeliveryModeSchema.optional() })), (c) => {
1487
1487
  const param = c.req.valid("param");
@@ -1492,7 +1492,15 @@ const channelsAddHandler = factory.createHandlers(zValidator$1("param", z.object
1492
1492
  });
1493
1493
  return c.text(`added channel "${created.name}" (id: ${created.id})`);
1494
1494
  });
1495
- const channelsConnectorsGroupHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), zValidator$1("query", z.object({}), `funnel channels <channel> connectors — manage connectors in a channel
1495
+ //#endregion
1496
+ //#region lib/cli/router/help-guard.ts
1497
+ function helpGuard(help) {
1498
+ return async (c, next) => {
1499
+ if (c.req.query("help")) return c.text(help);
1500
+ await next();
1501
+ };
1502
+ }
1503
+ const channelsConnectorsGroupHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), helpGuard(`funnel channels <channel> connectors — manage connectors in a channel
1496
1504
 
1497
1505
  usage: funnel channels <channel> connectors [subcommand]
1498
1506
 
@@ -1516,15 +1524,29 @@ subcommands:
1516
1524
  });
1517
1525
  //#endregion
1518
1526
  //#region lib/cli/routes/channels.$channel.connectors.add.ts
1519
- const help$16 = `funnel channels <channel> connectors add <connector> — add a connector to a channel
1527
+ const help$16 = `funnel channels <channel> connectors add <name> — add a connector to a channel
1520
1528
 
1521
1529
  usage:
1522
- funnel channels <channel> connectors add <connector> --type=slack --bot-token=xoxb-... --app-token=xapp-...
1523
- funnel channels <channel> connectors add <connector> --type=gh [--poll-interval=60]
1524
- funnel channels <channel> connectors add <connector> --type=discord --bot-token=...
1525
- funnel channels <channel> connectors add <connector> --type=schedule
1530
+ funnel channels <channel> connectors add <name> --type=slack --bot-token=xoxb-... --app-token=xapp-...
1531
+ funnel channels <channel> connectors add <name> --type=gh [--poll-interval=60]
1532
+ funnel channels <channel> connectors add <name> --type=discord --bot-token=...
1533
+ funnel channels <channel> connectors add <name> --type=schedule
1526
1534
 
1527
- Token uniqueness is enforced across all channels.`;
1535
+ connector types:
1536
+ slack Slack Socket Mode (requires bot-token + app-token)
1537
+ gh GitHub webhook polling
1538
+ discord Discord bot gateway
1539
+ schedule cron / one-shot timer (no external service)
1540
+
1541
+ Token uniqueness is enforced across all channels — the same bot-token
1542
+ cannot appear in two connectors.
1543
+
1544
+ examples:
1545
+ funnel channels prod connectors add main-slack --type=slack --bot-token=xoxb-... --app-token=xapp-...
1546
+ funnel channels ci connectors add gh-events --type=gh --poll-interval=30
1547
+ funnel channels alerts connectors add daily --type=schedule
1548
+
1549
+ see also: funnel channels <channel> connectors, funnel channels <channel> connectors remove`;
1528
1550
  const channelsConnectorsAddHelpHandler = factory.createHandlers((c) => c.text(help$16));
1529
1551
  //#endregion
1530
1552
  //#region lib/cli/routes/channels.$channel.connectors.add.$connector.ts
@@ -1595,7 +1617,16 @@ const channelsConnectorsAddHandler = factory.createHandlers(zValidator$1("param"
1595
1617
  //#region lib/cli/routes/channels.$channel.connectors.remove.ts
1596
1618
  const help$15 = `funnel channels <channel> connectors remove <connector> — remove a connector
1597
1619
 
1598
- usage: funnel channels <channel> connectors remove <connector>`;
1620
+ usage: funnel channels <channel> connectors remove <connector>
1621
+
1622
+ Removes the connector from the channel configuration. The gateway drops
1623
+ it on the next reload. No external resources (Slack apps, Discord bots,
1624
+ GitHub webhooks) are touched.
1625
+
1626
+ examples:
1627
+ funnel channels production connectors remove slack-main
1628
+
1629
+ see also: funnel channels <channel> connectors, funnel channels <channel> connectors add`;
1599
1630
  const channelsConnectorsRemoveHelpHandler = factory.createHandlers((c) => c.text(help$15));
1600
1631
  //#endregion
1601
1632
  //#region lib/cli/routes/channels.$channel.connectors.remove.$connector.ts
@@ -1646,7 +1677,7 @@ const channelsConnectorsSetHandler = factory.createHandlers(zValidator$1("param"
1646
1677
  const channelsConnectorsShowHandler = factory.createHandlers(zValidator$1("param", z.object({
1647
1678
  channel: z.string(),
1648
1679
  connector: z.string()
1649
- })), zValidator$1("query", z.object({}), `funnel channels <channel> connectors <connector> / show connector config
1680
+ })), helpGuard(`funnel channels <channel> connectors <connector> / show connector config
1650
1681
 
1651
1682
  subcommands:
1652
1683
  rename <new> / rename this connector
@@ -1661,9 +1692,18 @@ output / valid YAML`), (c) => {
1661
1692
  });
1662
1693
  //#endregion
1663
1694
  //#region lib/cli/routes/channels.$channel.connectors.rename.ts
1664
- const help$13 = `funnel channels <channel> connectors rename <connector> <new-name>
1695
+ const help$13 = `funnel channels <channel> connectors rename <old> <new> — rename a connector
1665
1696
 
1666
- usage: funnel channels <channel> connectors rename <connector> <new-name>`;
1697
+ usage: funnel channels <channel> connectors rename <old> <new>
1698
+
1699
+ Renames the connector in the configuration file. Tokens, type, and
1700
+ schedules are preserved. The gateway picks up the new name on the
1701
+ next reload.
1702
+
1703
+ examples:
1704
+ funnel channels production connectors rename slack-1 slack-main
1705
+
1706
+ see also: funnel channels <channel> connectors`;
1667
1707
  const channelsConnectorsRenameHelpHandler = factory.createHandlers((c) => c.text(help$13));
1668
1708
  //#endregion
1669
1709
  //#region lib/cli/routes/channels.$channel.connectors.$connector.rename.$newName.ts
@@ -1688,10 +1728,7 @@ const channelsConnectorRenameHelpHandler = factory.createHandlers((c) => c.text(
1688
1728
  const channelsConnectorsRequestHandler = factory.createHandlers(zValidator$1("param", z.object({
1689
1729
  channel: z.string(),
1690
1730
  connector: z.string()
1691
- })), zValidator$1("query", z.object({
1692
- method: z.string(),
1693
- path: z.string().optional()
1694
- }).passthrough(), `funnel channels <channel> connectors <connector> request / call a connector's outbound API
1731
+ })), helpGuard(`funnel channels <channel> connectors <connector> request / call a connector's outbound API
1695
1732
 
1696
1733
  usage / funnel channels <channel> connectors <connector> request --method=<m> [--path=<p>] [--key=value ...]
1697
1734
 
@@ -1699,7 +1736,10 @@ options:
1699
1736
  --method / slack: API method (e.g. chat.postMessage). gh/discord: HTTP verb (GET/POST/...).
1700
1737
  --path / gh/discord: endpoint (e.g. repos/o/r/issues). Omit for slack (defaults to --method).
1701
1738
 
1702
- output / valid YAML (or raw text when the adapter returns text)`), async (c) => {
1739
+ output / valid YAML (or raw text when the adapter returns text)`), zValidator$1("query", z.object({
1740
+ method: z.string(),
1741
+ path: z.string().optional()
1742
+ }).passthrough()), async (c) => {
1703
1743
  const param = c.req.valid("param");
1704
1744
  const query = c.req.valid("query");
1705
1745
  const funnel = c.env.funnel;
@@ -1718,7 +1758,7 @@ output / valid YAML (or raw text when the adapter returns text)`), async (c) =>
1718
1758
  const channelsConnectorsSchedulesGroupHandler = factory.createHandlers(zValidator$1("param", z.object({
1719
1759
  channel: z.string(),
1720
1760
  connector: z.string()
1721
- })), zValidator$1("query", z.object({}), `funnel channels <ch> connectors <conn> schedules — manage schedule entries
1761
+ })), helpGuard(`funnel channels <ch> connectors <conn> schedules — manage schedule entries
1722
1762
 
1723
1763
  usage: funnel channels <ch> connectors <conn> schedules [subcommand]
1724
1764
 
@@ -1815,9 +1855,18 @@ const channelsPublishHandler = factory.createHandlers(zValidator$1("param", z.ob
1815
1855
  });
1816
1856
  //#endregion
1817
1857
  //#region lib/cli/routes/channels.remove.ts
1818
- const help$8 = `funnel channels remove — remove a channel
1858
+ const help$8 = `funnel channels remove — remove a channel and all its connectors
1859
+
1860
+ usage: funnel channels remove <name>
1861
+
1862
+ The channel, its connectors, and their schedules are deleted from the
1863
+ configuration file. The gateway drops the channel on the next reload.
1864
+ No external resources (Slack apps, Discord bots, etc.) are touched.
1865
+
1866
+ examples:
1867
+ funnel channels remove staging
1819
1868
 
1820
- usage: funnel channels remove <name>`;
1869
+ see also: funnel channels, funnel channels add`;
1821
1870
  const channelsRemoveHelpHandler = factory.createHandlers((c) => c.text(help$8));
1822
1871
  //#endregion
1823
1872
  //#region lib/cli/routes/channels.remove.$channel.ts
@@ -1832,7 +1881,17 @@ const help$7 = `funnel channels rename — rename a channel
1832
1881
 
1833
1882
  usage:
1834
1883
  funnel channels rename <old> <new>
1835
- funnel channels <old> rename <new>`;
1884
+ funnel channels <old> rename <new>
1885
+
1886
+ Renames the channel in the configuration file. Connectors, schedules,
1887
+ and delivery mode are preserved. The gateway picks up the new name on
1888
+ the next reload.
1889
+
1890
+ examples:
1891
+ funnel channels rename staging production
1892
+ funnel channels staging rename production
1893
+
1894
+ see also: funnel channels, funnel channels <name>`;
1836
1895
  const channelsRenameHelpHandler = factory.createHandlers((c) => c.text(help$7));
1837
1896
  //#endregion
1838
1897
  //#region lib/cli/routes/channels.$channel.rename.ts
@@ -1852,10 +1911,7 @@ const channelsRenameHandler = factory.createHandlers(zValidator$1("param", z.obj
1852
1911
  c.env.funnel.channels.rename(param.channel, param.newName);
1853
1912
  return c.text(`renamed channel "${param.channel}" to "${param.newName}"`);
1854
1913
  });
1855
- const channelsSetDeliveryHandler = factory.createHandlers(zValidator$1("param", z.object({
1856
- channel: z.string(),
1857
- mode: channelDeliveryModeSchema
1858
- }), `funnel channels <name> set delivery <mode> — change a channel's routing mode
1914
+ const channelsSetDeliveryHandler = factory.createHandlers(helpGuard(`funnel channels <name> set delivery <mode> — change a channel's routing mode
1859
1915
 
1860
1916
  usage: funnel channels <name> set delivery fanout | exclusive
1861
1917
 
@@ -1863,12 +1919,15 @@ modes:
1863
1919
  fanout every connected WS client receives every event (default)
1864
1920
  exclusive each event is delivered to exactly one connected client (round-robin)
1865
1921
 
1866
- `), (c) => {
1922
+ `), zValidator$1("param", z.object({
1923
+ channel: z.string(),
1924
+ mode: channelDeliveryModeSchema
1925
+ })), (c) => {
1867
1926
  const param = c.req.valid("param");
1868
1927
  c.env.funnel.channels.setDelivery(param.channel, param.mode);
1869
1928
  return c.text(`channel "${param.channel}" delivery set to ${param.mode}`);
1870
1929
  });
1871
- const channelsShowHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), zValidator$1("query", z.object({}), `funnel channels <name> / show channel details
1930
+ const channelsShowHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), helpGuard(`funnel channels <name> / show channel details
1872
1931
 
1873
1932
  subcommands:
1874
1933
  set delivery fanout|exclusive / change routing mode
@@ -1892,7 +1951,7 @@ output / valid YAML`), (c) => {
1892
1951
  }))
1893
1952
  }));
1894
1953
  });
1895
- const channelsGroupHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel channels / manage subscription boxes
1954
+ const channelsGroupHandler = factory.createHandlers(helpGuard(`funnel channels / manage subscription boxes
1896
1955
 
1897
1956
  usage / funnel channels [subcommand]
1898
1957
 
@@ -2057,10 +2116,10 @@ see also:
2057
2116
 
2058
2117
  programmable: funnel.claude.launch({ profileId | channelId, options, env, resume })`;
2059
2118
  const RESERVED_KEYS$1 = ["profile", "channel"];
2060
- const claudeHandler = factory.createHandlers(zValidator$1("query", z.object({
2119
+ const claudeHandler = factory.createHandlers(helpGuard(claudeHelp), zValidator$1("query", z.object({
2061
2120
  profile: z.string().optional(),
2062
2121
  channel: z.string().optional()
2063
- }).passthrough(), claudeHelp), async (c) => {
2122
+ }).passthrough()), async (c) => {
2064
2123
  const query = c.req.valid("query");
2065
2124
  const { funnel, claude, profiles, localConfig, localConfigSync } = c.env;
2066
2125
  const userArgs = queryToCliArgs(c.req.url, RESERVED_KEYS$1);
@@ -2204,7 +2263,7 @@ const resolveTargetChannel = (c, channelArg) => {
2204
2263
  }
2205
2264
  };
2206
2265
  };
2207
- const debugHandler = factory.createHandlers(zValidator$1("query", z.object({
2266
+ const debugHandler = factory.createHandlers(helpGuard(debugHelp), zValidator$1("query", z.object({
2208
2267
  channel: z.string().optional(),
2209
2268
  all: z.enum([
2210
2269
  "true",
@@ -2212,7 +2271,7 @@ const debugHandler = factory.createHandlers(zValidator$1("query", z.object({
2212
2271
  ""
2213
2272
  ]).optional(),
2214
2273
  limit: z.string().optional()
2215
- }), debugHelp), async (c) => {
2274
+ })), async (c) => {
2216
2275
  const query = c.req.valid("query");
2217
2276
  const funnel = c.env.funnel;
2218
2277
  if (query.all === "true" || query.all === "") {
@@ -2242,7 +2301,7 @@ const debugHandler = factory.createHandlers(zValidator$1("query", z.object({
2242
2301
  if (!report) return c.text(renderYaml({ error: "channel not resolvable" }));
2243
2302
  return c.text(renderYaml(report));
2244
2303
  });
2245
- const debugEventsHandler = factory.createHandlers(zValidator$1("query", channelLimitQuery, debugEventsHelp), async (c) => {
2304
+ const debugEventsHandler = factory.createHandlers(helpGuard(debugEventsHelp), zValidator$1("query", channelLimitQuery), async (c) => {
2246
2305
  const query = c.req.valid("query");
2247
2306
  const funnel = c.env.funnel;
2248
2307
  const limit = query.limit ? Math.max(1, Number(query.limit)) : 20;
@@ -2251,7 +2310,7 @@ const debugEventsHandler = factory.createHandlers(zValidator$1("query", channelL
2251
2310
  const events = await funnel.diagnostics.recentEvents(resolved.name, limit);
2252
2311
  return c.text(renderYaml({ events }));
2253
2312
  });
2254
- const debugDroppedHandler = factory.createHandlers(zValidator$1("query", channelLimitQuery, debugDroppedHelp), async (c) => {
2313
+ const debugDroppedHandler = factory.createHandlers(helpGuard(debugDroppedHelp), zValidator$1("query", channelLimitQuery), async (c) => {
2255
2314
  const query = c.req.valid("query");
2256
2315
  const funnel = c.env.funnel;
2257
2316
  const limit = query.limit ? Math.max(1, Number(query.limit)) : 20;
@@ -2260,7 +2319,7 @@ const debugDroppedHandler = factory.createHandlers(zValidator$1("query", channel
2260
2319
  const events = await funnel.diagnostics.droppedEvents(resolved.name, limit);
2261
2320
  return c.text(renderYaml({ dropped: events }));
2262
2321
  });
2263
- const debugErrorsHandler = factory.createHandlers(zValidator$1("query", channelLimitQuery, debugErrorsHelp), async (c) => {
2322
+ const debugErrorsHandler = factory.createHandlers(helpGuard(debugErrorsHelp), zValidator$1("query", channelLimitQuery), async (c) => {
2264
2323
  const query = c.req.valid("query");
2265
2324
  const funnel = c.env.funnel;
2266
2325
  const limit = query.limit ? Math.max(1, Number(query.limit)) : 20;
@@ -2269,10 +2328,10 @@ const debugErrorsHandler = factory.createHandlers(zValidator$1("query", channelL
2269
2328
  const errors = await funnel.diagnostics.connectionErrors(resolved.name, limit);
2270
2329
  return c.text(renderYaml({ errors }));
2271
2330
  });
2272
- const debugReplayHandler = factory.createHandlers(zValidator$1("query", z.object({
2331
+ const debugReplayHandler = factory.createHandlers(helpGuard(debugReplayHelp), zValidator$1("query", z.object({
2273
2332
  channel: z.string().optional(),
2274
2333
  seq: z.string().optional()
2275
- }), debugReplayHelp), async (c) => {
2334
+ })), async (c) => {
2276
2335
  const query = c.req.valid("query");
2277
2336
  const funnel = c.env.funnel;
2278
2337
  const resolved = resolveTargetChannel(c, query.channel);
@@ -2282,7 +2341,7 @@ const debugReplayHandler = factory.createHandlers(zValidator$1("query", z.object
2282
2341
  const result = await funnel.diagnostics.replay(resolved.name, seq);
2283
2342
  return c.text(renderYaml(result));
2284
2343
  });
2285
- const docsIndexHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel docs / embedded documentation
2344
+ const docsIndexHandler = factory.createHandlers(helpGuard(`funnel docs / embedded documentation
2286
2345
 
2287
2346
  usage / funnel docs [topic]
2288
2347
 
@@ -2309,18 +2368,7 @@ const docsTopicHandler = factory.createHandlers(zValidator$1("param", z.object({
2309
2368
  }));
2310
2369
  return c.text(text);
2311
2370
  });
2312
- const doctorHandler = factory.createHandlers(zValidator$1("query", z.object({
2313
- fix: z.enum([
2314
- "true",
2315
- "false",
2316
- ""
2317
- ]).optional(),
2318
- aggressive: z.enum([
2319
- "true",
2320
- "false",
2321
- ""
2322
- ]).optional()
2323
- }), `funnel doctor / diagnose every channel; --fix applies safe self-healing
2371
+ const doctorHandler = factory.createHandlers(helpGuard(`funnel doctor / diagnose every channel; --fix applies safe self-healing
2324
2372
 
2325
2373
  usage / funnel doctor [--fix] [--aggressive]
2326
2374
 
@@ -2336,7 +2384,18 @@ programmable / await funnel.doctor.run() / await funnel.doctor.run("safe") / awa
2336
2384
  examples:
2337
2385
  funnel doctor
2338
2386
  funnel doctor --fix
2339
- funnel doctor --fix --aggressive`), async (c) => {
2387
+ funnel doctor --fix --aggressive`), zValidator$1("query", z.object({
2388
+ fix: z.enum([
2389
+ "true",
2390
+ "false",
2391
+ ""
2392
+ ]).optional(),
2393
+ aggressive: z.enum([
2394
+ "true",
2395
+ "false",
2396
+ ""
2397
+ ]).optional()
2398
+ })), async (c) => {
2340
2399
  const query = c.req.valid("query");
2341
2400
  const wantsFix = query.fix === "true" || query.fix === "";
2342
2401
  const wantsAggressive = query.aggressive === "true" || query.aggressive === "";
@@ -2407,8 +2466,8 @@ const renderGatewayStatus = async (c) => {
2407
2466
  }))
2408
2467
  }));
2409
2468
  };
2410
- const gatewayGroupHandler = factory.createHandlers(zValidator$1("query", z.object({}), groupHelp$1), renderGatewayStatus);
2411
- const gatewayListenersHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel gateway listeners / show running connector listeners
2469
+ const gatewayGroupHandler = factory.createHandlers(helpGuard(groupHelp$1), renderGatewayStatus);
2470
+ const gatewayListenersHandler = factory.createHandlers(helpGuard(`funnel gateway listeners / show running connector listeners
2412
2471
 
2413
2472
  usage / funnel gateway listeners
2414
2473
 
@@ -2477,10 +2536,10 @@ const formatMeta = (meta) => {
2477
2536
  const formatPlain = (entry) => {
2478
2537
  return `${entry.time.slice(11, 19)} ${entry.level.toUpperCase().padEnd(5)} ${entry.message.padEnd(30)}${formatMeta(entry.meta)}\n`;
2479
2538
  };
2480
- const gatewayLogsHandler = factory.createHandlers(zValidator$1("query", z.object({
2539
+ const gatewayLogsHandler = factory.createHandlers(helpGuard(logsHelp), zValidator$1("query", z.object({
2481
2540
  n: z.string().optional(),
2482
2541
  format: z.enum(["plain", "json"]).optional()
2483
- }), logsHelp), async (c) => {
2542
+ })), async (c) => {
2484
2543
  const query = c.req.valid("query");
2485
2544
  const path = logger.file;
2486
2545
  if (!path || !existsSync(path)) return c.text("no logs");
@@ -2585,12 +2644,12 @@ programmable: const reader = new ConnectorDiagnosticSqlReader({ rawPath, process
2585
2644
  reader.query("SELECT …")
2586
2645
  — but for most cases, funnel.diagnostics.recentEvents() / .droppedEvents()
2587
2646
  / .connectionErrors() are higher level and don't need SQL.`;
2588
- const gatewaySqlHandler = factory.createHandlers(zValidator$1("query", z.object({
2647
+ const gatewaySqlHandler = factory.createHandlers(helpGuard(sqlHelp), zValidator$1("query", z.object({
2589
2648
  query: z.string().optional(),
2590
2649
  preset: z.enum(Object.keys(PRESETS)).optional(),
2591
2650
  channel: z.string().optional(),
2592
2651
  limit: z.string().optional()
2593
- }), sqlHelp), async (c) => {
2652
+ })), async (c) => {
2594
2653
  const query = c.req.valid("query");
2595
2654
  const funnel = c.env.funnel;
2596
2655
  let sql = null;
@@ -2629,7 +2688,7 @@ const gatewaySqlHandler = factory.createHandlers(zValidator$1("query", z.object(
2629
2688
  if (rows instanceof Error) return c.text(renderYaml({ error: rows.message }));
2630
2689
  return c.text(renderYaml({ rows }));
2631
2690
  });
2632
- const gatewayRestartHandler = factory.createHandlers(zValidator$1("query", z.object({ "no-caffeine": z.string().optional() }), `funnel gateway restart — restart the gateway
2691
+ const gatewayRestartHandler = factory.createHandlers(helpGuard(`funnel gateway restart — restart the gateway
2633
2692
 
2634
2693
  usage: funnel gateway restart [--no-caffeine]
2635
2694
 
@@ -2641,7 +2700,7 @@ examples:
2641
2700
  funnel gateway restart --no-caffeine
2642
2701
 
2643
2702
  programmable: funnel.gateway.restart({ caffeinate })
2644
- funnel.recovery.restartGateway()`), async (c) => {
2703
+ funnel.recovery.restartGateway()`), zValidator$1("query", z.object({ "no-caffeine": z.string().optional() })), async (c) => {
2645
2704
  const query = c.req.valid("query");
2646
2705
  const result = await c.env.funnel.gateway.restart({ caffeinate: query["no-caffeine"] !== "true" });
2647
2706
  const lines = [];
@@ -2651,7 +2710,7 @@ programmable: funnel.gateway.restart({ caffeinate })
2651
2710
  if (!result.ok) throw new HTTPException(500, { message: body });
2652
2711
  return c.text(body);
2653
2712
  });
2654
- const gatewayRunHandler = factory.createHandlers(zValidator$1("query", z.object({ "no-caffeine": z.string().optional() }), `funnel gateway run — run the gateway in foreground
2713
+ const gatewayRunHandler = factory.createHandlers(helpGuard(`funnel gateway run — run the gateway in foreground
2655
2714
 
2656
2715
  usage: funnel gateway run [--no-caffeine]
2657
2716
 
@@ -2664,7 +2723,7 @@ examples:
2664
2723
  funnel gateway run
2665
2724
  funnel gateway run --no-caffeine
2666
2725
 
2667
- programmable: funnel.runGatewayForeground({ caffeinate })`), async (c) => {
2726
+ programmable: funnel.runGatewayForeground({ caffeinate })`), zValidator$1("query", z.object({ "no-caffeine": z.string().optional() })), async (c) => {
2668
2727
  const query = c.req.valid("query");
2669
2728
  const exitCode = await c.env.funnel.runGatewayForeground({ caffeinate: query["no-caffeine"] !== "true" });
2670
2729
  process.exit(exitCode);
@@ -2688,7 +2747,7 @@ examples:
2688
2747
  funnel gateway start --no-caffeine
2689
2748
 
2690
2749
  programmable: funnel.gateway.start({ caffeinate })`;
2691
- const gatewayStartHandler = factory.createHandlers(zValidator$1("query", z.object({ "no-caffeine": z.string().optional() }), startHelp), async (c) => {
2750
+ const gatewayStartHandler = factory.createHandlers(helpGuard(startHelp), zValidator$1("query", z.object({ "no-caffeine": z.string().optional() })), async (c) => {
2692
2751
  const query = c.req.valid("query");
2693
2752
  const funnel = c.env.funnel;
2694
2753
  if (funnel.gateway.isRunning()) {
@@ -2698,14 +2757,14 @@ const gatewayStartHandler = factory.createHandlers(zValidator$1("query", z.objec
2698
2757
  if (!await funnel.gateway.start({ caffeinate: query["no-caffeine"] !== "true" })) throw new HTTPException(500, { message: "funnel gateway: failed to start" });
2699
2758
  return c.text("funnel gateway: started");
2700
2759
  });
2701
- const gatewayStatusHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel gateway status / show gateway running status
2760
+ const gatewayStatusHandler = factory.createHandlers(helpGuard(`funnel gateway status / show gateway running status
2702
2761
 
2703
2762
  usage / funnel gateway status
2704
2763
 
2705
2764
  output / valid YAML
2706
2765
 
2707
2766
  programmable / funnel.gateway.getStatus()`), async (c) => renderGatewayStatus(c));
2708
- const gatewayStopHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel gateway stop — stop the gateway
2767
+ const gatewayStopHandler = factory.createHandlers(helpGuard(`funnel gateway stop — stop the gateway
2709
2768
 
2710
2769
  usage: funnel gateway stop
2711
2770
 
@@ -2798,7 +2857,7 @@ const profilesAddHandler = factory.createHandlers(zValidator$1("param", z.object
2798
2857
  });
2799
2858
  return c.text(`added profile "${param.profile}"`);
2800
2859
  });
2801
- const profilesAsDefaultHandler = factory.createHandlers(zValidator$1("param", z.object({ profile: z.string() })), zValidator$1("query", z.object({}), `funnel profiles <name> as-default — move profile to the front of the list
2860
+ const profilesAsDefaultHandler = factory.createHandlers(zValidator$1("param", z.object({ profile: z.string() })), helpGuard(`funnel profiles <name> as-default — move profile to the front of the list
2802
2861
 
2803
2862
  usage: funnel profiles <name> as-default
2804
2863
 
@@ -2844,7 +2903,7 @@ const launchHelp = `funnel profiles <name> run — launch a profile (sugar for f
2844
2903
  usage: funnel profiles <name> run [additional claude args...]
2845
2904
  funnel profiles <name> (alias)`;
2846
2905
  const RESERVED_KEYS = [];
2847
- const profilesLaunchHandler = factory.createHandlers(zValidator$1("param", z.object({ profile: z.string() })), zValidator$1("query", z.object({}).passthrough(), launchHelp), async (c) => {
2906
+ const profilesLaunchHandler = factory.createHandlers(zValidator$1("param", z.object({ profile: z.string() })), helpGuard(launchHelp), zValidator$1("query", z.object({}).passthrough()), async (c) => {
2848
2907
  const param = c.req.valid("param");
2849
2908
  c.env.funnel;
2850
2909
  const { profiles, claude } = c.env;
@@ -2920,7 +2979,7 @@ const profilesSetHandler = factory.createHandlers(zValidator$1("param", z.object
2920
2979
  });
2921
2980
  return c.text(`updated profile "${param.profile}"`);
2922
2981
  });
2923
- const profilesGroupHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel profiles / manage launch profiles
2982
+ const profilesGroupHandler = factory.createHandlers(helpGuard(`funnel profiles / manage launch profiles
2924
2983
 
2925
2984
  usage / funnel profiles [subcommand]
2926
2985
 
@@ -2957,7 +3016,7 @@ examples:
2957
3016
  resume: profile.resume
2958
3017
  })) }));
2959
3018
  });
2960
- const schemaHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel schema — print the JSON Schema for funnel.json
3019
+ const schemaHandler = factory.createHandlers(helpGuard(`funnel schema — print the JSON Schema for funnel.json
2961
3020
 
2962
3021
  usage: funnel schema
2963
3022
 
@@ -3056,14 +3115,14 @@ const buildStatusReport = async (funnel, profiles) => {
3056
3115
  })
3057
3116
  };
3058
3117
  };
3059
- const statusHandler = factory.createHandlers(zValidator$1("query", z.object({
3118
+ const statusHandler = factory.createHandlers(helpGuard(statusHelp), zValidator$1("query", z.object({
3060
3119
  watch: z.enum([
3061
3120
  "true",
3062
3121
  "false",
3063
3122
  ""
3064
3123
  ]).optional(),
3065
3124
  interval: z.string().optional()
3066
- }), statusHelp), async (c) => {
3125
+ })), async (c) => {
3067
3126
  const query = c.req.valid("query");
3068
3127
  const funnel = c.env.funnel;
3069
3128
  const isWatch = query.watch === "true" || query.watch === "";
@@ -3100,7 +3159,7 @@ Runs "bun i -g @interactive-inc/claude-funnel".
3100
3159
  This command has no programmable equivalent — package management belongs to
3101
3160
  the host (npm / bun / yarn install in the host's own way).`;
3102
3161
  const PACKAGE = "@interactive-inc/claude-funnel";
3103
- const updateHandler = factory.createHandlers(zValidator$1("query", z.object({}), updateHelp), async (c) => {
3162
+ const updateHandler = factory.createHandlers(helpGuard(updateHelp), async (c) => {
3104
3163
  const exitCode = await new NodeFunnelProcessRunner().attach([
3105
3164
  "bun",
3106
3165
  "i",
@@ -1,11 +1,11 @@
1
- import { n as ChannelDeliveryMode, t as ChannelConfig } from "./settings-schema-zhnMIa8I.js";
2
- import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-CBrgz01o.js";
3
- import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog } from "./diagnostic-log-Bxe7Bbvw.js";
4
- import { r as FunnelProcessRunner } from "./process-runner-D5I_jhYQ.js";
5
- import { n as FunnelFileSystem } from "./file-system-Wub9Nto4.js";
6
- import { n as FunnelConnectorAdapter, t as CallInput } from "./connector-adapter-BkYC6qiK.js";
7
- import { a as ScheduleEntry, n as ScheduleOnFired } from "./schedule-listener-DKh0hnkK.js";
8
- import { n as SlackOnAppCreated, r as SlackPreprocessEvent } from "./slack-listener-DFW9vck4.js";
1
+ import { n as ChannelDeliveryMode, t as ChannelConfig } from "./settings-schema-1hh11jnN.js";
2
+ import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-DPwqOVUm.js";
3
+ import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog } from "./diagnostic-log-Cb3v8P7p.js";
4
+ import { r as FunnelProcessRunner } from "./process-runner-Cx5O_fTf.js";
5
+ import { n as FunnelFileSystem } from "./file-system-DxpnnUVb.js";
6
+ import { n as FunnelConnectorAdapter, t as CallInput } from "./connector-adapter-DGacCppE.js";
7
+ import { a as ScheduleEntry, n as ScheduleOnFired } from "./schedule-listener-DoMPjHZj.js";
8
+ import { n as SlackOnAppCreated, r as SlackPreprocessEvent } from "./slack-listener-Dj9NFbAJ.js";
9
9
  import { z } from "zod";
10
10
 
11
11
  //#region lib/services/local-config/local-config-schema.d.ts
@@ -1,3 +1,3 @@
1
- import { C as profileSpecSchema, S as localConfigSchema, _ as LOCAL_CONFIG_FILENAME, b as channelSpecSchema, g as ConnectorSpec, h as ChannelSpec, i as FunnelTokenPrompter, m as FunnelLocalConfig, n as FunnelLocalConfigSync, r as LocalConfigSyncResult, t as ConnectorSyncOutcome, v as LocalConfig, x as connectorSpecSchema, y as ProfileSpec } from "./local-config-sync-BY20ixEV.js";
2
- import { i as funnelJsonSchema, n as NodeFunnelTokenPrompter, r as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-DOgptiIb.js";
1
+ import { C as profileSpecSchema, S as localConfigSchema, _ as LOCAL_CONFIG_FILENAME, b as channelSpecSchema, g as ConnectorSpec, h as ChannelSpec, i as FunnelTokenPrompter, m as FunnelLocalConfig, n as FunnelLocalConfigSync, r as LocalConfigSyncResult, t as ConnectorSyncOutcome, v as LocalConfig, x as connectorSpecSchema, y as ProfileSpec } from "./local-config-sync--f739oCJ.js";
2
+ import { i as funnelJsonSchema, n as NodeFunnelTokenPrompter, r as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-BlFwK9k7.js";
3
3
  export { ChannelSpec, ConnectorSpec, ConnectorSyncOutcome, FunnelLocalConfig, FunnelLocalConfigSync, FunnelLocalConfigWriter, FunnelTokenPrompter, LOCAL_CONFIG_FILENAME, LocalConfig, LocalConfigSyncResult, MemoryFunnelTokenPrompter, NodeFunnelTokenPrompter, ProfileSpec, channelSpecSchema, connectorSpecSchema, funnelJsonSchema, localConfigSchema, profileSpecSchema };
@@ -1,3 +1,3 @@
1
1
  import { a as FunnelLocalConfig, c as connectorSpecSchema, i as FunnelTokenPrompter, l as localConfigSchema, n as NodeFunnelTokenPrompter, o as LOCAL_CONFIG_FILENAME, r as FunnelLocalConfigSync, s as channelSpecSchema, t as funnelJsonSchema, u as profileSpecSchema } from "./local-config-json-schema-DE1zkMcb.js";
2
- import { n as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-vBXxY20-.js";
2
+ import { n as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-C7vREzCL.js";
3
3
  export { FunnelLocalConfig, FunnelLocalConfigSync, FunnelLocalConfigWriter, FunnelTokenPrompter, LOCAL_CONFIG_FILENAME, MemoryFunnelTokenPrompter, NodeFunnelTokenPrompter, channelSpecSchema, connectorSpecSchema, funnelJsonSchema, localConfigSchema, profileSpecSchema };