@interactive-inc/claude-funnel 0.58.1 → 0.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
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
2
  import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-DPwqOVUm.js";
3
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";
4
+ import { a as RunOptions, i as ProcessSnapshot, n as DetachOptions, o as RunResult, r as FunnelProcessRunner, t as AttachOptions } from "./process-runner-DIm1cy95.js";
5
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";
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-BGPAS9Be.js";
7
7
  import { n as FunnelConnectorAdapter, r as JsonValue, t as CallInput } from "./connector-adapter-DGacCppE.js";
8
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
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";
@@ -13,5 +13,5 @@ import { a as RecoveryListenerControl, i as RecoveryGatewayControl, n as Recover
13
13
  import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-vxO96TCA.js";
14
14
  import { a as HttpResponse, i as HttpRequest, n as discordConnectorSchema, r as FunnelHttpClient, t as DiscordConnectorConfig } from "./discord-connector-schema-CQyfDkLD.js";
15
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-B9iyugar.js";
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 };
16
+ import { $ as PublishResponse, A as MemoryFunnelFileSystem, B as Funnel, C as MemoryProcessCall, Ct as OnFunnelError, D as ProcessListStub, E as MemoryProcessSyncHandler, F as FUNNEL_DIR, G as ListenerOpResult, H as FunnelListenersClient, I as FunnelSettingsStore, J as SqliteConnectorDiagnosticLog, K as FunnelGateway, L as SETTINGS_PATH, M as MockFunnelSettingsReader, N as createSettings, O as StartTimeStub, P as DEFAULT_GATEWAY_PORT, Q as PublishRequest, R as resolveFunnelDir, S as MemoryFunnelProcessRunner, St as ReplayableEvent, T as MemoryProcessResponse, U as ListListenersResult, V as GatewayServerOptions, W as ListenerEntry, X as SqliteFunnelEventLog, Y as MemoryFunnelEventLog, Z as FunnelChannelPublisher, _ as NoopFunnelLogger, _t as GatewayRouteDeps, a as toRequest, at as gatewayLoopbackUrl, b as NodeFunnelLogger, bt as BroadcastSubscriber, c as buildServiceRoutes, ct as channelWsUrl, d as MemoryHttpResponse, dt as FunnelEvent, et as PublishResult, f as NodeFunnelHttpClient, ft as FunnelEventLog, g as NodeFunnelClock, gt as GatewayEmitInput, h as MemoryFunnelClock, ht as Env$1, i as queryToCliArgs, it as FunnelGatewayToken, j as NodeFunnelFileSystem, k as NodeFunnelProcessRunner, l as MemoryFunnelHttpClient, lt as FunnelGatewayServer, m as NodeFunnelIdGenerator, mt as funnelEventSchema, n as CliApp, nt as publishResponseSchema, o as Env, ot as ChannelWsUrlInput, p as MemoryFunnelIdGenerator, pt as FunnelEventRecord, q as MemoryConnectorDiagnosticLog, r as routes, rt as DEFAULT_GATEWAY_TOKEN_PATH, s as factory, st as channelWsProtocols, t as GatewayApp, tt as publishRequestSchema, u as MemoryHttpHandler, ut as GatewayEventStore, v as LogEntry, vt as FunnelListenerSupervisor, w as MemoryProcessHandler, x as AliveStub, xt as FunnelBroadcaster, y as MemoryFunnelLogger, yt as BroadcastEvent, z as resolveFunnelPort } from "./index-D7mjirUL.js";
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, StartTimeStub, 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
@@ -2,18 +2,18 @@ import { t as FunnelConnectorAdapter } from "./connector-adapter-qwXLjQId.js";
2
2
  import { a as FunnelHttpClient, i as NodeFunnelHttpClient, r as FunnelDiscordAdapter, t as FunnelDiscordListener } from "./discord-listener-CKsZGTnH.js";
3
3
  import { t as FunnelConnectorListener } from "./connector-listener-CpHBecCj.js";
4
4
  import { t as FunnelLogger } from "./logger-BP6SisKt.js";
5
- import { n as NodeFunnelProcessRunner, r as FunnelProcessRunner, t as ghConnectorSchema } from "./gh-connector-schema-DUcZgN2Q.js";
6
- import { n as FunnelGhAdapter, t as FunnelGhListener } from "./gh-listener-Dsx6AmhH.js";
5
+ import { n as NodeFunnelProcessRunner, r as FunnelProcessRunner, t as ghConnectorSchema } from "./gh-connector-schema-ClPLSYD9.js";
6
+ import { n as FunnelGhAdapter, t as FunnelGhListener } from "./gh-listener-B2I4s8qh.js";
7
7
  import { n as ScheduleStateStore, t as FunnelScheduleListener } from "./schedule-listener-DP9Jhc6U.js";
8
8
  import { t as FunnelFileSystem } from "./file-system-PWKKU7lA.js";
9
9
  import { t as NodeFunnelFileSystem } from "./node-file-system-BcrmWN9I.js";
10
10
  import { n as FunnelSlackEventProcessor, r as FunnelSlackAdapter, t as FunnelSlackListener } from "./slack-listener-C4wlZaOq.js";
11
11
  import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-DPqrpV7s.js";
12
- import { a as SETTINGS_PATH, c as SETTINGS_VERSION, d as profileConfigSchema, f as settingsSchema, i as FunnelSettingsStore, l as channelConfigSchema, m as NodeFunnelIdGenerator, n as DEFAULT_GATEWAY_PORT, o as resolveFunnelDir, p as connectorConfigSchema, r as FUNNEL_DIR, s as resolveFunnelPort, t as gatewayLoopbackUrl, u as channelDeliveryModeSchema } from "./gateway-base-url-6foMXfFf.js";
12
+ import { a as SETTINGS_PATH, c as SETTINGS_VERSION, d as profileConfigSchema, f as settingsSchema, i as FunnelSettingsStore, l as channelConfigSchema, m as NodeFunnelIdGenerator, n as DEFAULT_GATEWAY_PORT, o as resolveFunnelDir, p as connectorConfigSchema, r as FUNNEL_DIR, s as resolveFunnelPort, t as gatewayLoopbackUrl, u as channelDeliveryModeSchema } from "./gateway-base-url-DxVjjDoW.js";
13
13
  import { t as discordConnectorSchema } from "./discord-connector-schema-B_N6IXLz.js";
14
14
  import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "./schedule-connector-schema-B_xO5z5B.js";
15
15
  import { t as slackConnectorSchema } from "./slack-connector-schema-C1zEf4TG.js";
16
- import { a as FunnelMcp, o as FileProcessGuard, s as FunnelClaude, t as renderYaml } from "./yaml-render-C9Hhjk-0.js";
16
+ import { a as FunnelMcp, o as FileProcessGuard, s as FunnelClaude, t as renderYaml } from "./yaml-render-cZu6CxkE.js";
17
17
  import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-BpKYrMSu.js";
18
18
  import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-CzYgZpq2.js";
19
19
  import { t as FunnelDoctor } from "./funnel-doctor-CApCezTq.js";
@@ -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-5LzwJ_F7.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-B9Us7X05.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();
@@ -596,6 +596,7 @@ var MemoryFunnelProcessRunner = class extends FunnelProcessRunner {
596
596
  syncHandler = () => empty;
597
597
  aliveStub = null;
598
598
  listStub = null;
599
+ startTimeStub = null;
599
600
  on(handler) {
600
601
  this.handler = handler;
601
602
  return this;
@@ -612,6 +613,10 @@ var MemoryFunnelProcessRunner = class extends FunnelProcessRunner {
612
613
  this.listStub = stub;
613
614
  return this;
614
615
  }
616
+ onGetStartTime(stub) {
617
+ this.startTimeStub = stub;
618
+ return this;
619
+ }
615
620
  async run(command, options = {}) {
616
621
  this.calls.push({
617
622
  kind: "run",
@@ -681,6 +686,10 @@ var MemoryFunnelProcessRunner = class extends FunnelProcessRunner {
681
686
  if (this.listStub) return this.listStub(marker);
682
687
  return [];
683
688
  }
689
+ getStartTime(pid) {
690
+ if (this.startTimeStub) return this.startTimeStub(pid);
691
+ return null;
692
+ }
684
693
  };
685
694
  //#endregion
686
695
  //#region lib/engine/settings/mock-settings-reader.ts
@@ -1469,19 +1478,19 @@ usage: funnel channels add <name> [--delivery fanout|exclusive]
1469
1478
  options:
1470
1479
  --delivery routing mode (default fanout):
1471
1480
  fanout every connected client receives every event
1472
- exclusive each event delivered to exactly one client (round-robin)`;
1481
+ exclusive each event delivered to exactly one client (round-robin)
1482
+
1483
+ A channel is a named event stream. After creating it, add connectors
1484
+ (Slack, Discord, GitHub, schedule) to feed events into it, then connect
1485
+ Claude Code clients to consume them.
1486
+
1487
+ examples:
1488
+ funnel channels add production
1489
+ funnel channels add ci-events --delivery exclusive
1490
+
1491
+ see also: funnel channels, funnel channels <name> connectors add`;
1473
1492
  const channelsAddHelpHandler = factory.createHandlers((c) => c.text(help$17));
1474
1493
  //#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
1494
  //#region lib/cli/routes/channels.add.$channel.ts
1486
1495
  const channelsAddHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), zValidator$1("query", z.object({ delivery: channelDeliveryModeSchema.optional() })), (c) => {
1487
1496
  const param = c.req.valid("param");
@@ -1492,7 +1501,15 @@ const channelsAddHandler = factory.createHandlers(zValidator$1("param", z.object
1492
1501
  });
1493
1502
  return c.text(`added channel "${created.name}" (id: ${created.id})`);
1494
1503
  });
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
1504
+ //#endregion
1505
+ //#region lib/cli/router/help-guard.ts
1506
+ function helpGuard(help) {
1507
+ return async (c, next) => {
1508
+ if (c.req.query("help")) return c.text(help);
1509
+ await next();
1510
+ };
1511
+ }
1512
+ const channelsConnectorsGroupHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), helpGuard(`funnel channels <channel> connectors — manage connectors in a channel
1496
1513
 
1497
1514
  usage: funnel channels <channel> connectors [subcommand]
1498
1515
 
@@ -1516,15 +1533,29 @@ subcommands:
1516
1533
  });
1517
1534
  //#endregion
1518
1535
  //#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
1536
+ const help$16 = `funnel channels <channel> connectors add <name> — add a connector to a channel
1520
1537
 
1521
1538
  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
1539
+ funnel channels <channel> connectors add <name> --type=slack --bot-token=xoxb-... --app-token=xapp-...
1540
+ funnel channels <channel> connectors add <name> --type=gh [--poll-interval=60]
1541
+ funnel channels <channel> connectors add <name> --type=discord --bot-token=...
1542
+ funnel channels <channel> connectors add <name> --type=schedule
1543
+
1544
+ connector types:
1545
+ slack Slack Socket Mode (requires bot-token + app-token)
1546
+ gh GitHub webhook polling
1547
+ discord Discord bot gateway
1548
+ schedule cron / one-shot timer (no external service)
1549
+
1550
+ Token uniqueness is enforced across all channels — the same bot-token
1551
+ cannot appear in two connectors.
1526
1552
 
1527
- Token uniqueness is enforced across all channels.`;
1553
+ examples:
1554
+ funnel channels prod connectors add main-slack --type=slack --bot-token=xoxb-... --app-token=xapp-...
1555
+ funnel channels ci connectors add gh-events --type=gh --poll-interval=30
1556
+ funnel channels alerts connectors add daily --type=schedule
1557
+
1558
+ see also: funnel channels <channel> connectors, funnel channels <channel> connectors remove`;
1528
1559
  const channelsConnectorsAddHelpHandler = factory.createHandlers((c) => c.text(help$16));
1529
1560
  //#endregion
1530
1561
  //#region lib/cli/routes/channels.$channel.connectors.add.$connector.ts
@@ -1595,7 +1626,16 @@ const channelsConnectorsAddHandler = factory.createHandlers(zValidator$1("param"
1595
1626
  //#region lib/cli/routes/channels.$channel.connectors.remove.ts
1596
1627
  const help$15 = `funnel channels <channel> connectors remove <connector> — remove a connector
1597
1628
 
1598
- usage: funnel channels <channel> connectors remove <connector>`;
1629
+ usage: funnel channels <channel> connectors remove <connector>
1630
+
1631
+ Removes the connector from the channel configuration. The gateway drops
1632
+ it on the next reload. No external resources (Slack apps, Discord bots,
1633
+ GitHub webhooks) are touched.
1634
+
1635
+ examples:
1636
+ funnel channels production connectors remove slack-main
1637
+
1638
+ see also: funnel channels <channel> connectors, funnel channels <channel> connectors add`;
1599
1639
  const channelsConnectorsRemoveHelpHandler = factory.createHandlers((c) => c.text(help$15));
1600
1640
  //#endregion
1601
1641
  //#region lib/cli/routes/channels.$channel.connectors.remove.$connector.ts
@@ -1646,7 +1686,7 @@ const channelsConnectorsSetHandler = factory.createHandlers(zValidator$1("param"
1646
1686
  const channelsConnectorsShowHandler = factory.createHandlers(zValidator$1("param", z.object({
1647
1687
  channel: z.string(),
1648
1688
  connector: z.string()
1649
- })), zValidator$1("query", z.object({}), `funnel channels <channel> connectors <connector> / show connector config
1689
+ })), helpGuard(`funnel channels <channel> connectors <connector> / show connector config
1650
1690
 
1651
1691
  subcommands:
1652
1692
  rename <new> / rename this connector
@@ -1661,9 +1701,18 @@ output / valid YAML`), (c) => {
1661
1701
  });
1662
1702
  //#endregion
1663
1703
  //#region lib/cli/routes/channels.$channel.connectors.rename.ts
1664
- const help$13 = `funnel channels <channel> connectors rename <connector> <new-name>
1704
+ const help$13 = `funnel channels <channel> connectors rename <old> <new> — rename a connector
1665
1705
 
1666
- usage: funnel channels <channel> connectors rename <connector> <new-name>`;
1706
+ usage: funnel channels <channel> connectors rename <old> <new>
1707
+
1708
+ Renames the connector in the configuration file. Tokens, type, and
1709
+ schedules are preserved. The gateway picks up the new name on the
1710
+ next reload.
1711
+
1712
+ examples:
1713
+ funnel channels production connectors rename slack-1 slack-main
1714
+
1715
+ see also: funnel channels <channel> connectors`;
1667
1716
  const channelsConnectorsRenameHelpHandler = factory.createHandlers((c) => c.text(help$13));
1668
1717
  //#endregion
1669
1718
  //#region lib/cli/routes/channels.$channel.connectors.$connector.rename.$newName.ts
@@ -1688,10 +1737,7 @@ const channelsConnectorRenameHelpHandler = factory.createHandlers((c) => c.text(
1688
1737
  const channelsConnectorsRequestHandler = factory.createHandlers(zValidator$1("param", z.object({
1689
1738
  channel: z.string(),
1690
1739
  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
1740
+ })), helpGuard(`funnel channels <channel> connectors <connector> request / call a connector's outbound API
1695
1741
 
1696
1742
  usage / funnel channels <channel> connectors <connector> request --method=<m> [--path=<p>] [--key=value ...]
1697
1743
 
@@ -1699,7 +1745,10 @@ options:
1699
1745
  --method / slack: API method (e.g. chat.postMessage). gh/discord: HTTP verb (GET/POST/...).
1700
1746
  --path / gh/discord: endpoint (e.g. repos/o/r/issues). Omit for slack (defaults to --method).
1701
1747
 
1702
- output / valid YAML (or raw text when the adapter returns text)`), async (c) => {
1748
+ output / valid YAML (or raw text when the adapter returns text)`), zValidator$1("query", z.object({
1749
+ method: z.string(),
1750
+ path: z.string().optional()
1751
+ }).passthrough()), async (c) => {
1703
1752
  const param = c.req.valid("param");
1704
1753
  const query = c.req.valid("query");
1705
1754
  const funnel = c.env.funnel;
@@ -1718,7 +1767,7 @@ output / valid YAML (or raw text when the adapter returns text)`), async (c) =>
1718
1767
  const channelsConnectorsSchedulesGroupHandler = factory.createHandlers(zValidator$1("param", z.object({
1719
1768
  channel: z.string(),
1720
1769
  connector: z.string()
1721
- })), zValidator$1("query", z.object({}), `funnel channels <ch> connectors <conn> schedules — manage schedule entries
1770
+ })), helpGuard(`funnel channels <ch> connectors <conn> schedules — manage schedule entries
1722
1771
 
1723
1772
  usage: funnel channels <ch> connectors <conn> schedules [subcommand]
1724
1773
 
@@ -1815,9 +1864,18 @@ const channelsPublishHandler = factory.createHandlers(zValidator$1("param", z.ob
1815
1864
  });
1816
1865
  //#endregion
1817
1866
  //#region lib/cli/routes/channels.remove.ts
1818
- const help$8 = `funnel channels remove — remove a channel
1867
+ const help$8 = `funnel channels remove — remove a channel and all its connectors
1868
+
1869
+ usage: funnel channels remove <name>
1819
1870
 
1820
- usage: funnel channels remove <name>`;
1871
+ The channel, its connectors, and their schedules are deleted from the
1872
+ configuration file. The gateway drops the channel on the next reload.
1873
+ No external resources (Slack apps, Discord bots, etc.) are touched.
1874
+
1875
+ examples:
1876
+ funnel channels remove staging
1877
+
1878
+ see also: funnel channels, funnel channels add`;
1821
1879
  const channelsRemoveHelpHandler = factory.createHandlers((c) => c.text(help$8));
1822
1880
  //#endregion
1823
1881
  //#region lib/cli/routes/channels.remove.$channel.ts
@@ -1832,7 +1890,17 @@ const help$7 = `funnel channels rename — rename a channel
1832
1890
 
1833
1891
  usage:
1834
1892
  funnel channels rename <old> <new>
1835
- funnel channels <old> rename <new>`;
1893
+ funnel channels <old> rename <new>
1894
+
1895
+ Renames the channel in the configuration file. Connectors, schedules,
1896
+ and delivery mode are preserved. The gateway picks up the new name on
1897
+ the next reload.
1898
+
1899
+ examples:
1900
+ funnel channels rename staging production
1901
+ funnel channels staging rename production
1902
+
1903
+ see also: funnel channels, funnel channels <name>`;
1836
1904
  const channelsRenameHelpHandler = factory.createHandlers((c) => c.text(help$7));
1837
1905
  //#endregion
1838
1906
  //#region lib/cli/routes/channels.$channel.rename.ts
@@ -1852,10 +1920,7 @@ const channelsRenameHandler = factory.createHandlers(zValidator$1("param", z.obj
1852
1920
  c.env.funnel.channels.rename(param.channel, param.newName);
1853
1921
  return c.text(`renamed channel "${param.channel}" to "${param.newName}"`);
1854
1922
  });
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
1923
+ const channelsSetDeliveryHandler = factory.createHandlers(helpGuard(`funnel channels <name> set delivery <mode> — change a channel's routing mode
1859
1924
 
1860
1925
  usage: funnel channels <name> set delivery fanout | exclusive
1861
1926
 
@@ -1863,12 +1928,15 @@ modes:
1863
1928
  fanout every connected WS client receives every event (default)
1864
1929
  exclusive each event is delivered to exactly one connected client (round-robin)
1865
1930
 
1866
- `), (c) => {
1931
+ `), zValidator$1("param", z.object({
1932
+ channel: z.string(),
1933
+ mode: channelDeliveryModeSchema
1934
+ })), (c) => {
1867
1935
  const param = c.req.valid("param");
1868
1936
  c.env.funnel.channels.setDelivery(param.channel, param.mode);
1869
1937
  return c.text(`channel "${param.channel}" delivery set to ${param.mode}`);
1870
1938
  });
1871
- const channelsShowHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), zValidator$1("query", z.object({}), `funnel channels <name> / show channel details
1939
+ const channelsShowHandler = factory.createHandlers(zValidator$1("param", z.object({ channel: z.string() })), helpGuard(`funnel channels <name> / show channel details
1872
1940
 
1873
1941
  subcommands:
1874
1942
  set delivery fanout|exclusive / change routing mode
@@ -1892,7 +1960,7 @@ output / valid YAML`), (c) => {
1892
1960
  }))
1893
1961
  }));
1894
1962
  });
1895
- const channelsGroupHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel channels / manage subscription boxes
1963
+ const channelsGroupHandler = factory.createHandlers(helpGuard(`funnel channels / manage subscription boxes
1896
1964
 
1897
1965
  usage / funnel channels [subcommand]
1898
1966
 
@@ -2057,10 +2125,10 @@ see also:
2057
2125
 
2058
2126
  programmable: funnel.claude.launch({ profileId | channelId, options, env, resume })`;
2059
2127
  const RESERVED_KEYS$1 = ["profile", "channel"];
2060
- const claudeHandler = factory.createHandlers(zValidator$1("query", z.object({
2128
+ const claudeHandler = factory.createHandlers(helpGuard(claudeHelp), zValidator$1("query", z.object({
2061
2129
  profile: z.string().optional(),
2062
2130
  channel: z.string().optional()
2063
- }).passthrough(), claudeHelp), async (c) => {
2131
+ }).passthrough()), async (c) => {
2064
2132
  const query = c.req.valid("query");
2065
2133
  const { funnel, claude, profiles, localConfig, localConfigSync } = c.env;
2066
2134
  const userArgs = queryToCliArgs(c.req.url, RESERVED_KEYS$1);
@@ -2204,7 +2272,7 @@ const resolveTargetChannel = (c, channelArg) => {
2204
2272
  }
2205
2273
  };
2206
2274
  };
2207
- const debugHandler = factory.createHandlers(zValidator$1("query", z.object({
2275
+ const debugHandler = factory.createHandlers(helpGuard(debugHelp), zValidator$1("query", z.object({
2208
2276
  channel: z.string().optional(),
2209
2277
  all: z.enum([
2210
2278
  "true",
@@ -2212,7 +2280,7 @@ const debugHandler = factory.createHandlers(zValidator$1("query", z.object({
2212
2280
  ""
2213
2281
  ]).optional(),
2214
2282
  limit: z.string().optional()
2215
- }), debugHelp), async (c) => {
2283
+ })), async (c) => {
2216
2284
  const query = c.req.valid("query");
2217
2285
  const funnel = c.env.funnel;
2218
2286
  if (query.all === "true" || query.all === "") {
@@ -2242,7 +2310,7 @@ const debugHandler = factory.createHandlers(zValidator$1("query", z.object({
2242
2310
  if (!report) return c.text(renderYaml({ error: "channel not resolvable" }));
2243
2311
  return c.text(renderYaml(report));
2244
2312
  });
2245
- const debugEventsHandler = factory.createHandlers(zValidator$1("query", channelLimitQuery, debugEventsHelp), async (c) => {
2313
+ const debugEventsHandler = factory.createHandlers(helpGuard(debugEventsHelp), zValidator$1("query", channelLimitQuery), async (c) => {
2246
2314
  const query = c.req.valid("query");
2247
2315
  const funnel = c.env.funnel;
2248
2316
  const limit = query.limit ? Math.max(1, Number(query.limit)) : 20;
@@ -2251,7 +2319,7 @@ const debugEventsHandler = factory.createHandlers(zValidator$1("query", channelL
2251
2319
  const events = await funnel.diagnostics.recentEvents(resolved.name, limit);
2252
2320
  return c.text(renderYaml({ events }));
2253
2321
  });
2254
- const debugDroppedHandler = factory.createHandlers(zValidator$1("query", channelLimitQuery, debugDroppedHelp), async (c) => {
2322
+ const debugDroppedHandler = factory.createHandlers(helpGuard(debugDroppedHelp), zValidator$1("query", channelLimitQuery), async (c) => {
2255
2323
  const query = c.req.valid("query");
2256
2324
  const funnel = c.env.funnel;
2257
2325
  const limit = query.limit ? Math.max(1, Number(query.limit)) : 20;
@@ -2260,7 +2328,7 @@ const debugDroppedHandler = factory.createHandlers(zValidator$1("query", channel
2260
2328
  const events = await funnel.diagnostics.droppedEvents(resolved.name, limit);
2261
2329
  return c.text(renderYaml({ dropped: events }));
2262
2330
  });
2263
- const debugErrorsHandler = factory.createHandlers(zValidator$1("query", channelLimitQuery, debugErrorsHelp), async (c) => {
2331
+ const debugErrorsHandler = factory.createHandlers(helpGuard(debugErrorsHelp), zValidator$1("query", channelLimitQuery), async (c) => {
2264
2332
  const query = c.req.valid("query");
2265
2333
  const funnel = c.env.funnel;
2266
2334
  const limit = query.limit ? Math.max(1, Number(query.limit)) : 20;
@@ -2269,10 +2337,10 @@ const debugErrorsHandler = factory.createHandlers(zValidator$1("query", channelL
2269
2337
  const errors = await funnel.diagnostics.connectionErrors(resolved.name, limit);
2270
2338
  return c.text(renderYaml({ errors }));
2271
2339
  });
2272
- const debugReplayHandler = factory.createHandlers(zValidator$1("query", z.object({
2340
+ const debugReplayHandler = factory.createHandlers(helpGuard(debugReplayHelp), zValidator$1("query", z.object({
2273
2341
  channel: z.string().optional(),
2274
2342
  seq: z.string().optional()
2275
- }), debugReplayHelp), async (c) => {
2343
+ })), async (c) => {
2276
2344
  const query = c.req.valid("query");
2277
2345
  const funnel = c.env.funnel;
2278
2346
  const resolved = resolveTargetChannel(c, query.channel);
@@ -2282,7 +2350,7 @@ const debugReplayHandler = factory.createHandlers(zValidator$1("query", z.object
2282
2350
  const result = await funnel.diagnostics.replay(resolved.name, seq);
2283
2351
  return c.text(renderYaml(result));
2284
2352
  });
2285
- const docsIndexHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel docs / embedded documentation
2353
+ const docsIndexHandler = factory.createHandlers(helpGuard(`funnel docs / embedded documentation
2286
2354
 
2287
2355
  usage / funnel docs [topic]
2288
2356
 
@@ -2309,18 +2377,7 @@ const docsTopicHandler = factory.createHandlers(zValidator$1("param", z.object({
2309
2377
  }));
2310
2378
  return c.text(text);
2311
2379
  });
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
2380
+ const doctorHandler = factory.createHandlers(helpGuard(`funnel doctor / diagnose every channel; --fix applies safe self-healing
2324
2381
 
2325
2382
  usage / funnel doctor [--fix] [--aggressive]
2326
2383
 
@@ -2336,7 +2393,18 @@ programmable / await funnel.doctor.run() / await funnel.doctor.run("safe") / awa
2336
2393
  examples:
2337
2394
  funnel doctor
2338
2395
  funnel doctor --fix
2339
- funnel doctor --fix --aggressive`), async (c) => {
2396
+ funnel doctor --fix --aggressive`), zValidator$1("query", z.object({
2397
+ fix: z.enum([
2398
+ "true",
2399
+ "false",
2400
+ ""
2401
+ ]).optional(),
2402
+ aggressive: z.enum([
2403
+ "true",
2404
+ "false",
2405
+ ""
2406
+ ]).optional()
2407
+ })), async (c) => {
2340
2408
  const query = c.req.valid("query");
2341
2409
  const wantsFix = query.fix === "true" || query.fix === "";
2342
2410
  const wantsAggressive = query.aggressive === "true" || query.aggressive === "";
@@ -2407,8 +2475,8 @@ const renderGatewayStatus = async (c) => {
2407
2475
  }))
2408
2476
  }));
2409
2477
  };
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
2478
+ const gatewayGroupHandler = factory.createHandlers(helpGuard(groupHelp$1), renderGatewayStatus);
2479
+ const gatewayListenersHandler = factory.createHandlers(helpGuard(`funnel gateway listeners / show running connector listeners
2412
2480
 
2413
2481
  usage / funnel gateway listeners
2414
2482
 
@@ -2477,10 +2545,10 @@ const formatMeta = (meta) => {
2477
2545
  const formatPlain = (entry) => {
2478
2546
  return `${entry.time.slice(11, 19)} ${entry.level.toUpperCase().padEnd(5)} ${entry.message.padEnd(30)}${formatMeta(entry.meta)}\n`;
2479
2547
  };
2480
- const gatewayLogsHandler = factory.createHandlers(zValidator$1("query", z.object({
2548
+ const gatewayLogsHandler = factory.createHandlers(helpGuard(logsHelp), zValidator$1("query", z.object({
2481
2549
  n: z.string().optional(),
2482
2550
  format: z.enum(["plain", "json"]).optional()
2483
- }), logsHelp), async (c) => {
2551
+ })), async (c) => {
2484
2552
  const query = c.req.valid("query");
2485
2553
  const path = logger.file;
2486
2554
  if (!path || !existsSync(path)) return c.text("no logs");
@@ -2585,12 +2653,12 @@ programmable: const reader = new ConnectorDiagnosticSqlReader({ rawPath, process
2585
2653
  reader.query("SELECT …")
2586
2654
  — but for most cases, funnel.diagnostics.recentEvents() / .droppedEvents()
2587
2655
  / .connectionErrors() are higher level and don't need SQL.`;
2588
- const gatewaySqlHandler = factory.createHandlers(zValidator$1("query", z.object({
2656
+ const gatewaySqlHandler = factory.createHandlers(helpGuard(sqlHelp), zValidator$1("query", z.object({
2589
2657
  query: z.string().optional(),
2590
2658
  preset: z.enum(Object.keys(PRESETS)).optional(),
2591
2659
  channel: z.string().optional(),
2592
2660
  limit: z.string().optional()
2593
- }), sqlHelp), async (c) => {
2661
+ })), async (c) => {
2594
2662
  const query = c.req.valid("query");
2595
2663
  const funnel = c.env.funnel;
2596
2664
  let sql = null;
@@ -2629,7 +2697,7 @@ const gatewaySqlHandler = factory.createHandlers(zValidator$1("query", z.object(
2629
2697
  if (rows instanceof Error) return c.text(renderYaml({ error: rows.message }));
2630
2698
  return c.text(renderYaml({ rows }));
2631
2699
  });
2632
- const gatewayRestartHandler = factory.createHandlers(zValidator$1("query", z.object({ "no-caffeine": z.string().optional() }), `funnel gateway restart — restart the gateway
2700
+ const gatewayRestartHandler = factory.createHandlers(helpGuard(`funnel gateway restart — restart the gateway
2633
2701
 
2634
2702
  usage: funnel gateway restart [--no-caffeine]
2635
2703
 
@@ -2641,7 +2709,7 @@ examples:
2641
2709
  funnel gateway restart --no-caffeine
2642
2710
 
2643
2711
  programmable: funnel.gateway.restart({ caffeinate })
2644
- funnel.recovery.restartGateway()`), async (c) => {
2712
+ funnel.recovery.restartGateway()`), zValidator$1("query", z.object({ "no-caffeine": z.string().optional() })), async (c) => {
2645
2713
  const query = c.req.valid("query");
2646
2714
  const result = await c.env.funnel.gateway.restart({ caffeinate: query["no-caffeine"] !== "true" });
2647
2715
  const lines = [];
@@ -2651,7 +2719,7 @@ programmable: funnel.gateway.restart({ caffeinate })
2651
2719
  if (!result.ok) throw new HTTPException(500, { message: body });
2652
2720
  return c.text(body);
2653
2721
  });
2654
- const gatewayRunHandler = factory.createHandlers(zValidator$1("query", z.object({ "no-caffeine": z.string().optional() }), `funnel gateway run — run the gateway in foreground
2722
+ const gatewayRunHandler = factory.createHandlers(helpGuard(`funnel gateway run — run the gateway in foreground
2655
2723
 
2656
2724
  usage: funnel gateway run [--no-caffeine]
2657
2725
 
@@ -2664,7 +2732,7 @@ examples:
2664
2732
  funnel gateway run
2665
2733
  funnel gateway run --no-caffeine
2666
2734
 
2667
- programmable: funnel.runGatewayForeground({ caffeinate })`), async (c) => {
2735
+ programmable: funnel.runGatewayForeground({ caffeinate })`), zValidator$1("query", z.object({ "no-caffeine": z.string().optional() })), async (c) => {
2668
2736
  const query = c.req.valid("query");
2669
2737
  const exitCode = await c.env.funnel.runGatewayForeground({ caffeinate: query["no-caffeine"] !== "true" });
2670
2738
  process.exit(exitCode);
@@ -2688,7 +2756,7 @@ examples:
2688
2756
  funnel gateway start --no-caffeine
2689
2757
 
2690
2758
  programmable: funnel.gateway.start({ caffeinate })`;
2691
- const gatewayStartHandler = factory.createHandlers(zValidator$1("query", z.object({ "no-caffeine": z.string().optional() }), startHelp), async (c) => {
2759
+ const gatewayStartHandler = factory.createHandlers(helpGuard(startHelp), zValidator$1("query", z.object({ "no-caffeine": z.string().optional() })), async (c) => {
2692
2760
  const query = c.req.valid("query");
2693
2761
  const funnel = c.env.funnel;
2694
2762
  if (funnel.gateway.isRunning()) {
@@ -2698,14 +2766,14 @@ const gatewayStartHandler = factory.createHandlers(zValidator$1("query", z.objec
2698
2766
  if (!await funnel.gateway.start({ caffeinate: query["no-caffeine"] !== "true" })) throw new HTTPException(500, { message: "funnel gateway: failed to start" });
2699
2767
  return c.text("funnel gateway: started");
2700
2768
  });
2701
- const gatewayStatusHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel gateway status / show gateway running status
2769
+ const gatewayStatusHandler = factory.createHandlers(helpGuard(`funnel gateway status / show gateway running status
2702
2770
 
2703
2771
  usage / funnel gateway status
2704
2772
 
2705
2773
  output / valid YAML
2706
2774
 
2707
2775
  programmable / funnel.gateway.getStatus()`), async (c) => renderGatewayStatus(c));
2708
- const gatewayStopHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel gateway stop — stop the gateway
2776
+ const gatewayStopHandler = factory.createHandlers(helpGuard(`funnel gateway stop — stop the gateway
2709
2777
 
2710
2778
  usage: funnel gateway stop
2711
2779
 
@@ -2798,7 +2866,7 @@ const profilesAddHandler = factory.createHandlers(zValidator$1("param", z.object
2798
2866
  });
2799
2867
  return c.text(`added profile "${param.profile}"`);
2800
2868
  });
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
2869
+ 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
2870
 
2803
2871
  usage: funnel profiles <name> as-default
2804
2872
 
@@ -2844,7 +2912,7 @@ const launchHelp = `funnel profiles <name> run — launch a profile (sugar for f
2844
2912
  usage: funnel profiles <name> run [additional claude args...]
2845
2913
  funnel profiles <name> (alias)`;
2846
2914
  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) => {
2915
+ const profilesLaunchHandler = factory.createHandlers(zValidator$1("param", z.object({ profile: z.string() })), helpGuard(launchHelp), zValidator$1("query", z.object({}).passthrough()), async (c) => {
2848
2916
  const param = c.req.valid("param");
2849
2917
  c.env.funnel;
2850
2918
  const { profiles, claude } = c.env;
@@ -2920,7 +2988,7 @@ const profilesSetHandler = factory.createHandlers(zValidator$1("param", z.object
2920
2988
  });
2921
2989
  return c.text(`updated profile "${param.profile}"`);
2922
2990
  });
2923
- const profilesGroupHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel profiles / manage launch profiles
2991
+ const profilesGroupHandler = factory.createHandlers(helpGuard(`funnel profiles / manage launch profiles
2924
2992
 
2925
2993
  usage / funnel profiles [subcommand]
2926
2994
 
@@ -2957,7 +3025,7 @@ examples:
2957
3025
  resume: profile.resume
2958
3026
  })) }));
2959
3027
  });
2960
- const schemaHandler = factory.createHandlers(zValidator$1("query", z.object({}), `funnel schema — print the JSON Schema for funnel.json
3028
+ const schemaHandler = factory.createHandlers(helpGuard(`funnel schema — print the JSON Schema for funnel.json
2961
3029
 
2962
3030
  usage: funnel schema
2963
3031
 
@@ -3056,14 +3124,14 @@ const buildStatusReport = async (funnel, profiles) => {
3056
3124
  })
3057
3125
  };
3058
3126
  };
3059
- const statusHandler = factory.createHandlers(zValidator$1("query", z.object({
3127
+ const statusHandler = factory.createHandlers(helpGuard(statusHelp), zValidator$1("query", z.object({
3060
3128
  watch: z.enum([
3061
3129
  "true",
3062
3130
  "false",
3063
3131
  ""
3064
3132
  ]).optional(),
3065
3133
  interval: z.string().optional()
3066
- }), statusHelp), async (c) => {
3134
+ })), async (c) => {
3067
3135
  const query = c.req.valid("query");
3068
3136
  const funnel = c.env.funnel;
3069
3137
  const isWatch = query.watch === "true" || query.watch === "";
@@ -3100,7 +3168,7 @@ Runs "bun i -g @interactive-inc/claude-funnel".
3100
3168
  This command has no programmable equivalent — package management belongs to
3101
3169
  the host (npm / bun / yarn install in the host's own way).`;
3102
3170
  const PACKAGE = "@interactive-inc/claude-funnel";
3103
- const updateHandler = factory.createHandlers(zValidator$1("query", z.object({}), updateHelp), async (c) => {
3171
+ const updateHandler = factory.createHandlers(helpGuard(updateHelp), async (c) => {
3104
3172
  const exitCode = await new NodeFunnelProcessRunner().attach([
3105
3173
  "bun",
3106
3174
  "i",
@@ -1,7 +1,7 @@
1
1
  import { n as ChannelDeliveryMode, t as ChannelConfig } from "./settings-schema-1hh11jnN.js";
2
2
  import { n as FunnelIdGenerator, t as FunnelSettingsReader } from "./settings-reader-DPwqOVUm.js";
3
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";
4
+ import { r as FunnelProcessRunner } from "./process-runner-DIm1cy95.js";
5
5
  import { n as FunnelFileSystem } from "./file-system-DxpnnUVb.js";
6
6
  import { n as FunnelConnectorAdapter, t as CallInput } from "./connector-adapter-DGacCppE.js";
7
7
  import { a as ScheduleEntry, n as ScheduleOnFired } from "./schedule-listener-DoMPjHZj.js";