@interactive-inc/claude-funnel 0.8.0 → 0.10.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 (54) hide show
  1. package/README.md +179 -80
  2. package/dist/bin.js +693 -698
  3. package/dist/connector-adapter-CXB-q_XC.d.ts +11 -0
  4. package/dist/connector-adapter-D5Utumgz.js +4 -0
  5. package/dist/connectors/discord.d.ts +76 -0
  6. package/dist/connectors/discord.js +2 -0
  7. package/dist/connectors/gh.d.ts +38 -0
  8. package/dist/connectors/gh.js +2 -0
  9. package/dist/connectors/schedule.d.ts +53 -0
  10. package/dist/connectors/schedule.js +2 -0
  11. package/dist/connectors/slack.d.ts +62 -0
  12. package/dist/connectors/slack.js +2 -0
  13. package/dist/discord-connector-schema-Dww2I4zH.d.ts +14 -0
  14. package/dist/discord-connector-schema-ygf5Df-2.js +173 -0
  15. package/dist/file-system-Co60LrmR.d.ts +74 -0
  16. package/dist/gateway/daemon.js +243 -221
  17. package/dist/gh-connector-schema-2ml29MBC.js +218 -0
  18. package/dist/gh-connector-schema-BZFAS-p-.d.ts +45 -0
  19. package/dist/index.d.ts +3888 -0
  20. package/dist/index.js +6296 -0
  21. package/dist/logger-CTlXs7z4.d.ts +33 -0
  22. package/dist/node-logger-DQz_BGOD.js +61 -0
  23. package/dist/schedule-connector-schema-CkuIQ0JQ.js +325 -0
  24. package/dist/slack-connector-schema-Cd22WiHB.js +153 -0
  25. package/dist/slack-connector-schema-D7zAHN8k.d.ts +15 -0
  26. package/lib/bin.ts +1 -76
  27. package/lib/cli/index.ts +85 -0
  28. package/lib/cli/router/to-request.ts +1 -0
  29. package/lib/cli/routes/channels.$channel.publish.ts +52 -0
  30. package/lib/cli/routes/claude.ts +1 -0
  31. package/lib/cli/routes/index.ts +35 -18
  32. package/lib/cli/routes/profiles.add.$profile.ts +5 -2
  33. package/lib/cli/routes/profiles.set.$profile.ts +10 -11
  34. package/lib/connectors/discord.ts +4 -0
  35. package/lib/connectors/gh.ts +3 -0
  36. package/lib/connectors/schedule.ts +4 -0
  37. package/lib/connectors/slack.ts +4 -0
  38. package/lib/engine/claude/claude.ts +6 -0
  39. package/lib/engine/mcp/channel-server.ts +34 -115
  40. package/lib/engine/mcp/channel-subscriber.ts +82 -0
  41. package/lib/engine/mcp/read-channel-connectors.ts +34 -0
  42. package/lib/engine/mcp/read-gateway-token.ts +16 -0
  43. package/lib/engine/mcp/usage-hint-for-type.ts +15 -0
  44. package/lib/engine/settings/settings-schema.ts +2 -0
  45. package/lib/funnel.ts +162 -55
  46. package/lib/gateway/broadcaster.ts +1 -1
  47. package/lib/gateway/channel-publisher.ts +67 -0
  48. package/lib/gateway/gateway-server.ts +28 -16
  49. package/lib/gateway/publish-schema.ts +27 -0
  50. package/lib/gateway/routes/channels.publish.ts +44 -0
  51. package/lib/gateway/routes/index.ts +2 -0
  52. package/lib/gateway/routes/route-deps.ts +8 -0
  53. package/lib/index.ts +17 -0
  54. package/package.json +41 -25
@@ -0,0 +1,3888 @@
1
+ import { n as FunnelConnectorAdapter, t as CallInput } from "./connector-adapter-CXB-q_XC.js";
2
+ import { n as discordConnectorSchema, t as DiscordConnectorConfig } from "./discord-connector-schema-Dww2I4zH.js";
3
+ import { n as FunnelConnectorListener, r as NotifyFn, t as FunnelLogger } from "./logger-CTlXs7z4.js";
4
+ import { a as FunnelProcessRunner, i as DetachOptions, n as ghConnectorSchema, o as RunOptions, r as AttachOptions, s as RunResult, t as GhConnectorConfig } from "./gh-connector-schema-BZFAS-p-.js";
5
+ import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, n as FunnelFileSystem, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema, t as FileStat } from "./file-system-Co60LrmR.js";
6
+ import { n as slackConnectorSchema, t as SlackConnectorConfig } from "./slack-connector-schema-D7zAHN8k.js";
7
+ import { z } from "zod";
8
+ import { Server, ServerWebSocket } from "bun";
9
+ import * as _$hono_factory0 from "hono/factory";
10
+ import * as _$hono_utils_http_status0 from "hono/utils/http-status";
11
+ import * as _$hono_hono_base0 from "hono/hono-base";
12
+
13
+ //#region lib/connectors/connector-config-schema.d.ts
14
+ declare const connectorConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
15
+ id: z.ZodString;
16
+ name: z.ZodString;
17
+ type: z.ZodLiteral<"slack">;
18
+ botToken: z.ZodString;
19
+ appToken: z.ZodString;
20
+ createdAt: z.ZodOptional<z.ZodString>;
21
+ updatedAt: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ id: z.ZodString;
24
+ name: z.ZodString;
25
+ type: z.ZodLiteral<"gh">;
26
+ pollInterval: z.ZodOptional<z.ZodNumber>;
27
+ createdAt: z.ZodOptional<z.ZodString>;
28
+ updatedAt: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ id: z.ZodString;
31
+ name: z.ZodString;
32
+ type: z.ZodLiteral<"discord">;
33
+ botToken: z.ZodString;
34
+ createdAt: z.ZodOptional<z.ZodString>;
35
+ updatedAt: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ id: z.ZodString;
38
+ name: z.ZodString;
39
+ type: z.ZodLiteral<"schedule">;
40
+ entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
41
+ id: z.ZodString;
42
+ cron: z.ZodString;
43
+ prompt: z.ZodString;
44
+ enabled: z.ZodDefault<z.ZodBoolean>;
45
+ catchupPolicy: z.ZodDefault<z.ZodEnum<{
46
+ latest: "latest";
47
+ all: "all";
48
+ skip: "skip";
49
+ }>>;
50
+ }, z.core.$strip>>>;
51
+ createdAt: z.ZodOptional<z.ZodString>;
52
+ updatedAt: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>], "type">;
54
+ type ConnectorConfig = z.infer<typeof connectorConfigSchema>;
55
+ type ConnectorType = ConnectorConfig["type"];
56
+ //#endregion
57
+ //#region lib/connectors/connector-factory.d.ts
58
+ type Deps$12 = {
59
+ fs?: FunnelFileSystem;
60
+ process?: FunnelProcessRunner;
61
+ logger?: FunnelLogger;
62
+ dir?: string;
63
+ };
64
+ /**
65
+ * Pure factory for per-type listeners and adapters. The factory has no CRUD
66
+ * responsibility — connector configs live inside settings.json under their
67
+ * channel, and FunnelChannels passes them in by value.
68
+ *
69
+ * `dir` is the funnel home (defaults to ~/.funnel); per-connector state files
70
+ * land at `<dir>/channels/<channel-id>/connectors/<connector-id>/state.json`.
71
+ */
72
+ declare class FunnelConnectorFactory {
73
+ private readonly fs;
74
+ private readonly process;
75
+ private readonly logger;
76
+ private readonly dir;
77
+ constructor(deps?: Deps$12);
78
+ createListener(channelId: string, config: ConnectorConfig): FunnelConnectorListener;
79
+ createAdapter(config: ConnectorConfig): FunnelConnectorAdapter | null;
80
+ connectorDir(channelId: string, connectorId: string): string;
81
+ channelDir(channelId: string): string;
82
+ }
83
+ //#endregion
84
+ //#region lib/engine/profiles/profile-channel-checker.d.ts
85
+ /**
86
+ * Read-side dependency that lets FunnelChannels ask whether a profile
87
+ * references a given channel id, without depending on FunnelProfiles directly.
88
+ */
89
+ type ProfileChannelChecker = {
90
+ hasChannelRef(channelId: string): boolean;
91
+ };
92
+ //#endregion
93
+ //#region lib/engine/time/clock.d.ts
94
+ /**
95
+ * Time boundary. Default NodeFunnelClock returns `new Date()`; MemoryFunnelClock
96
+ * is settable and `advance(ms)`-able for deterministic schedule / timeout tests.
97
+ */
98
+ declare abstract class FunnelClock {
99
+ abstract now(): Date;
100
+ millis(): number;
101
+ iso(): string;
102
+ }
103
+ //#endregion
104
+ //#region lib/engine/id/id-generator.d.ts
105
+ /**
106
+ * ID generator boundary. Default NodeFunnelIdGenerator wraps `crypto.randomUUID()`;
107
+ * MemoryFunnelIdGenerator emits `<prefix>-1, <prefix>-2, ...` for deterministic tests.
108
+ */
109
+ declare abstract class FunnelIdGenerator {
110
+ abstract generate(): string;
111
+ }
112
+ //#endregion
113
+ //#region lib/engine/settings/settings-schema.d.ts
114
+ /**
115
+ * Routing mode when multiple WS clients are subscribed to the same channel.
116
+ *
117
+ * - `fanout` (default): every connected client receives every event. Right when each
118
+ * subscriber has its own job (e.g., TUI mirrors, distinct Claude profiles each running
119
+ * their own pipeline against the same source).
120
+ * - `exclusive`: each event is delivered to exactly one connected client, picked
121
+ * round-robin per channel. Right when subscribers are interchangeable workers and you
122
+ * want each event handled once. Tap=all clients (TUI dashboard) always receive,
123
+ * regardless of mode, so they can passively observe.
124
+ */
125
+ declare const channelDeliveryModeSchema: z.ZodEnum<{
126
+ fanout: "fanout";
127
+ exclusive: "exclusive";
128
+ }>;
129
+ type ChannelDeliveryMode = z.infer<typeof channelDeliveryModeSchema>;
130
+ declare const channelConfigSchema: z.ZodObject<{
131
+ id: z.ZodString;
132
+ name: z.ZodString;
133
+ delivery: z.ZodDefault<z.ZodEnum<{
134
+ fanout: "fanout";
135
+ exclusive: "exclusive";
136
+ }>>;
137
+ connectors: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
138
+ id: z.ZodString;
139
+ name: z.ZodString;
140
+ type: z.ZodLiteral<"slack">;
141
+ botToken: z.ZodString;
142
+ appToken: z.ZodString;
143
+ createdAt: z.ZodOptional<z.ZodString>;
144
+ updatedAt: z.ZodOptional<z.ZodString>;
145
+ }, z.core.$strip>, z.ZodObject<{
146
+ id: z.ZodString;
147
+ name: z.ZodString;
148
+ type: z.ZodLiteral<"gh">;
149
+ pollInterval: z.ZodOptional<z.ZodNumber>;
150
+ createdAt: z.ZodOptional<z.ZodString>;
151
+ updatedAt: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ id: z.ZodString;
154
+ name: z.ZodString;
155
+ type: z.ZodLiteral<"discord">;
156
+ botToken: z.ZodString;
157
+ createdAt: z.ZodOptional<z.ZodString>;
158
+ updatedAt: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ id: z.ZodString;
161
+ name: z.ZodString;
162
+ type: z.ZodLiteral<"schedule">;
163
+ entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
164
+ id: z.ZodString;
165
+ cron: z.ZodString;
166
+ prompt: z.ZodString;
167
+ enabled: z.ZodDefault<z.ZodBoolean>;
168
+ catchupPolicy: z.ZodDefault<z.ZodEnum<{
169
+ latest: "latest";
170
+ all: "all";
171
+ skip: "skip";
172
+ }>>;
173
+ }, z.core.$strip>>>;
174
+ createdAt: z.ZodOptional<z.ZodString>;
175
+ updatedAt: z.ZodOptional<z.ZodString>;
176
+ }, z.core.$strip>], "type">>>;
177
+ }, z.core.$strip>;
178
+ type ChannelConfig = z.infer<typeof channelConfigSchema>;
179
+ declare const profileConfigSchema: z.ZodObject<{
180
+ name: z.ZodString;
181
+ path: z.ZodString;
182
+ subAgent: z.ZodString;
183
+ channelId: z.ZodString;
184
+ brief: z.ZodOptional<z.ZodBoolean>;
185
+ }, z.core.$strip>;
186
+ type ProfileConfig = z.infer<typeof profileConfigSchema>;
187
+ declare const SETTINGS_VERSION = 1;
188
+ declare const settingsSchema: z.ZodObject<{
189
+ version: z.ZodDefault<z.ZodLiteral<1>>;
190
+ channels: z.ZodDefault<z.ZodArray<z.ZodObject<{
191
+ id: z.ZodString;
192
+ name: z.ZodString;
193
+ delivery: z.ZodDefault<z.ZodEnum<{
194
+ fanout: "fanout";
195
+ exclusive: "exclusive";
196
+ }>>;
197
+ connectors: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
198
+ id: z.ZodString;
199
+ name: z.ZodString;
200
+ type: z.ZodLiteral<"slack">;
201
+ botToken: z.ZodString;
202
+ appToken: z.ZodString;
203
+ createdAt: z.ZodOptional<z.ZodString>;
204
+ updatedAt: z.ZodOptional<z.ZodString>;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ id: z.ZodString;
207
+ name: z.ZodString;
208
+ type: z.ZodLiteral<"gh">;
209
+ pollInterval: z.ZodOptional<z.ZodNumber>;
210
+ createdAt: z.ZodOptional<z.ZodString>;
211
+ updatedAt: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ id: z.ZodString;
214
+ name: z.ZodString;
215
+ type: z.ZodLiteral<"discord">;
216
+ botToken: z.ZodString;
217
+ createdAt: z.ZodOptional<z.ZodString>;
218
+ updatedAt: z.ZodOptional<z.ZodString>;
219
+ }, z.core.$strip>, z.ZodObject<{
220
+ id: z.ZodString;
221
+ name: z.ZodString;
222
+ type: z.ZodLiteral<"schedule">;
223
+ entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
224
+ id: z.ZodString;
225
+ cron: z.ZodString;
226
+ prompt: z.ZodString;
227
+ enabled: z.ZodDefault<z.ZodBoolean>;
228
+ catchupPolicy: z.ZodDefault<z.ZodEnum<{
229
+ latest: "latest";
230
+ all: "all";
231
+ skip: "skip";
232
+ }>>;
233
+ }, z.core.$strip>>>;
234
+ createdAt: z.ZodOptional<z.ZodString>;
235
+ updatedAt: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strip>], "type">>>;
237
+ }, z.core.$strip>>>;
238
+ profiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
239
+ name: z.ZodString;
240
+ path: z.ZodString;
241
+ subAgent: z.ZodString;
242
+ channelId: z.ZodString;
243
+ brief: z.ZodOptional<z.ZodBoolean>;
244
+ }, z.core.$strip>>>;
245
+ }, z.core.$strip>;
246
+ type Settings = z.infer<typeof settingsSchema>;
247
+ //#endregion
248
+ //#region lib/engine/settings/settings-reader.d.ts
249
+ declare abstract class FunnelSettingsReader {
250
+ abstract read(): Settings;
251
+ abstract write(settings: Settings): void;
252
+ }
253
+ //#endregion
254
+ //#region lib/engine/channels/channels.d.ts
255
+ type Deps$11 = {
256
+ store: FunnelSettingsReader;
257
+ factory: FunnelConnectorFactory;
258
+ profileChecker: ProfileChannelChecker;
259
+ clock?: FunnelClock;
260
+ idGenerator?: FunnelIdGenerator;
261
+ };
262
+ type ChannelConnectorView = ConnectorConfig & {
263
+ channelId: string;
264
+ channelName: string;
265
+ };
266
+ type AddConnectorInput = {
267
+ type: "slack";
268
+ name: string;
269
+ botToken: string;
270
+ appToken: string;
271
+ } | {
272
+ type: "gh";
273
+ name: string;
274
+ pollInterval?: number;
275
+ } | {
276
+ type: "discord";
277
+ name: string;
278
+ botToken: string;
279
+ } | {
280
+ type: "schedule";
281
+ name: string;
282
+ entries?: ScheduleEntry[];
283
+ };
284
+ /**
285
+ * Channels own their connectors. Each channel has a stable id (UUID); the
286
+ * `name` is the human-facing label used by the CLI. Connectors live nested
287
+ * inside `channel.connectors[]`, so add/remove/rename are channel-scoped — no
288
+ * global connector namespace exists. Token uniqueness is enforced across all
289
+ * channels at add/update time so the same Slack/Discord credentials cannot
290
+ * be registered twice.
291
+ */
292
+ declare class FunnelChannels {
293
+ private readonly store;
294
+ private readonly factory;
295
+ private readonly profileChecker;
296
+ private readonly clock;
297
+ private readonly idGenerator;
298
+ constructor(deps: Deps$11);
299
+ list(): ChannelConfig[];
300
+ get(name: string): ChannelConfig | null;
301
+ getById(id: string): ChannelConfig | null;
302
+ add(input: {
303
+ name: string;
304
+ delivery?: ChannelDeliveryMode;
305
+ }): ChannelConfig;
306
+ setDelivery(name: string, delivery: ChannelDeliveryMode): void;
307
+ remove(name: string): void;
308
+ rename(oldName: string, newName: string): void;
309
+ listConnectors(channelName: string): ConnectorConfig[];
310
+ getConnector(channelName: string, connectorName: string): ConnectorConfig | null;
311
+ listAllConnectors(): ChannelConnectorView[];
312
+ addConnector(channelName: string, input: AddConnectorInput): ConnectorConfig;
313
+ private fromInput;
314
+ removeConnector(channelName: string, connectorName: string): void;
315
+ renameConnector(channelName: string, oldName: string, newName: string): void;
316
+ updateSlackConnector(channelName: string, connectorName: string, fields: {
317
+ botToken?: string;
318
+ appToken?: string;
319
+ }): void;
320
+ updateGhConnector(channelName: string, connectorName: string, fields: {
321
+ pollInterval?: number;
322
+ }): void;
323
+ updateDiscordConnector(channelName: string, connectorName: string, fields: {
324
+ botToken?: string;
325
+ }): void;
326
+ listScheduleEntries(channelName: string, connectorName: string): ScheduleEntry[];
327
+ addScheduleEntry(channelName: string, connectorName: string, entry: Pick<ScheduleEntry, "cron" | "prompt"> & Partial<Pick<ScheduleEntry, "id" | "enabled" | "catchupPolicy">>): ScheduleEntry;
328
+ removeScheduleEntry(channelName: string, connectorName: string, id: string): void;
329
+ call(channelName: string, connectorName: string, input: CallInput): Promise<unknown>;
330
+ createListener(channelName: string, connectorName: string): {
331
+ config: ConnectorConfig;
332
+ channelId: string;
333
+ listener: FunnelConnectorListener;
334
+ } | null;
335
+ createAllListeners(): {
336
+ config: ConnectorConfig;
337
+ channelId: string;
338
+ channelName: string;
339
+ listener: FunnelConnectorListener;
340
+ }[];
341
+ private requireChannel;
342
+ private requireConnector;
343
+ private requireSlackConnector;
344
+ private requireGhConnector;
345
+ private requireDiscordConnector;
346
+ private requireScheduleConnector;
347
+ private assertNoTokenCollision;
348
+ private tokensOf;
349
+ }
350
+ //#endregion
351
+ //#region lib/engine/claude/gateway-controller.d.ts
352
+ type GatewayController = {
353
+ isRunning(): boolean;
354
+ start(options?: {
355
+ caffeinate?: boolean;
356
+ }): Promise<boolean>;
357
+ };
358
+ //#endregion
359
+ //#region lib/engine/mcp/mcp.d.ts
360
+ declare const FUNNEL_MCP_COMMAND = "funnel";
361
+ declare const FUNNEL_MCP_NAME = "funnel";
362
+ type Deps$10 = {
363
+ fs?: FunnelFileSystem;
364
+ };
365
+ /**
366
+ * Installs/uninstalls the funnel MCP entry into a target repository's
367
+ * `.mcp.json`. Detects an existing entry by command match so renaming is
368
+ * preserved across re-installs.
369
+ */
370
+ declare class FunnelMcp {
371
+ private readonly fs;
372
+ constructor(deps?: Deps$10);
373
+ install(repoPath: string): void;
374
+ uninstall(repoPath: string): void;
375
+ findInstalledName(cwd: string): string | null;
376
+ private findServerName;
377
+ private readConfig;
378
+ private writeConfig;
379
+ }
380
+ //#endregion
381
+ //#region lib/engine/claude/claude.d.ts
382
+ type LaunchOptions = {
383
+ channel: string;
384
+ cwd?: string;
385
+ subAgent?: string;
386
+ userArgs?: string[];
387
+ profileName?: string; /** Forward `--brief` to claude on launch (enables the SendUserMessage tool). */
388
+ brief?: boolean;
389
+ };
390
+ type Deps$9 = {
391
+ channels: FunnelChannels;
392
+ mcp: FunnelMcp;
393
+ gateway: GatewayController;
394
+ process?: FunnelProcessRunner;
395
+ fs?: FunnelFileSystem;
396
+ logger?: FunnelLogger;
397
+ dir?: string;
398
+ };
399
+ /**
400
+ * Launches Claude Code with funnel pre-wired: ensures the gateway is running,
401
+ * installs the funnel MCP into the target repo's `.mcp.json` if missing,
402
+ * injects `FUNNEL_CHANNEL_ID` into the child env, and writes a per-profile
403
+ * PID file to enforce singleton launches.
404
+ */
405
+ declare class FunnelClaude {
406
+ private readonly channels;
407
+ private readonly mcp;
408
+ private readonly gateway;
409
+ private readonly process;
410
+ private readonly fs;
411
+ private readonly logger;
412
+ private readonly pidDir;
413
+ constructor(deps: Deps$9);
414
+ launch(options: LaunchOptions): Promise<number>;
415
+ isRunning(profileName: string): boolean;
416
+ private pidPath;
417
+ private readPid;
418
+ private writePidFile;
419
+ private removePidFile;
420
+ private installCleanup;
421
+ private isProcessAlive;
422
+ private buildArgs;
423
+ private buildEnv;
424
+ }
425
+ //#endregion
426
+ //#region lib/engine/profiles/profiles.d.ts
427
+ type Deps$8 = {
428
+ store: FunnelSettingsReader;
429
+ };
430
+ /**
431
+ * Named launch presets for `fnl claude`. Each profile bundles a working
432
+ * directory, a sub-agent name, and the channel id its Claude instance will
433
+ * subscribe to. Implements ProfileChannelChecker so FunnelChannels can refuse
434
+ * to remove a channel that is still referenced.
435
+ *
436
+ * The first entry in the persisted array is treated as the default profile;
437
+ * `asDefault` reorders the array to put a named profile first.
438
+ *
439
+ * `channelId` always stores the channel's stable id (uuid). CLI surfaces
440
+ * resolve channel name → id before calling `add`/`update` here.
441
+ */
442
+ declare class FunnelProfiles {
443
+ private readonly store;
444
+ constructor(deps: Deps$8);
445
+ list(): ProfileConfig[];
446
+ get(name: string): ProfileConfig | null;
447
+ getDefault(): ProfileConfig | null;
448
+ add(config: ProfileConfig): void;
449
+ remove(name: string): void;
450
+ rename(oldName: string, newName: string): void;
451
+ asDefault(name: string): void;
452
+ hasChannelRef(channelId: string): boolean;
453
+ update(name: string, fields: Partial<Omit<ProfileConfig, "name">>): void;
454
+ }
455
+ //#endregion
456
+ //#region lib/gateway/publish-schema.d.ts
457
+ /**
458
+ * Shared schema for `POST /channels/:channel/publish` — used by both the
459
+ * gateway route handler (input validation) and the CLI / programmable client
460
+ * (request shape). The route resolves `channel` from the path; this body
461
+ * covers everything else.
462
+ */
463
+ declare const publishRequestSchema: z.ZodObject<{
464
+ content: z.ZodString;
465
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
466
+ connector: z.ZodOptional<z.ZodString>;
467
+ }, z.core.$strip>;
468
+ type PublishRequest = z.infer<typeof publishRequestSchema>;
469
+ declare const publishResponseSchema: z.ZodObject<{
470
+ ok: z.ZodLiteral<true>;
471
+ offset: z.ZodNumber;
472
+ }, z.core.$strip>;
473
+ type PublishResponse = z.infer<typeof publishResponseSchema>;
474
+ type PublishResult = {
475
+ state: "ok";
476
+ offset: number;
477
+ } | {
478
+ state: "offline";
479
+ } | {
480
+ state: "error";
481
+ reason: string;
482
+ };
483
+ //#endregion
484
+ //#region lib/gateway/channel-publisher.d.ts
485
+ type Deps$7 = {
486
+ port: number;
487
+ isDaemonRunning: () => boolean; /** Returns the daemon's gateway token, or null if unavailable. Sent as `Authorization: Bearer`. */
488
+ getToken?: () => string | null;
489
+ };
490
+ /**
491
+ * HTTP client for `POST /channels/:channel/publish` on a running gateway
492
+ * daemon. Returns `{ state: "offline" }` when the daemon isn't up so callers
493
+ * can branch without exceptions, mirroring `FunnelListenersClient`.
494
+ */
495
+ declare class FunnelChannelPublisher {
496
+ private readonly port;
497
+ private readonly isDaemonRunning;
498
+ private readonly getToken;
499
+ constructor(deps: Deps$7);
500
+ publish(channelName: string, request: PublishRequest): Promise<PublishResult>;
501
+ private authHeaders;
502
+ }
503
+ //#endregion
504
+ //#region lib/gateway/gateway.d.ts
505
+ type Deps$6 = {
506
+ process?: FunnelProcessRunner;
507
+ fs?: FunnelFileSystem;
508
+ clock?: FunnelClock;
509
+ dir?: string;
510
+ tmpDir?: string;
511
+ port?: number;
512
+ sleep?: (ms: number) => Promise<void>;
513
+ };
514
+ /**
515
+ * Manages the gateway daemon as a separate process via PID file.
516
+ * Use `start()` to spawn `bun daemon.ts` in the background and `stop()` to
517
+ * terminate it. For an in-process gateway, use `Funnel.gatewayServer` instead.
518
+ */
519
+ declare class FunnelGateway {
520
+ private readonly process;
521
+ private readonly fs;
522
+ private readonly clock;
523
+ private readonly pidFile;
524
+ private readonly logDir;
525
+ private readonly gatewayLog;
526
+ private readonly tmpDir;
527
+ private readonly port;
528
+ private readonly sleep;
529
+ constructor(deps?: Deps$6);
530
+ isRunning(): boolean;
531
+ getStatus(): {
532
+ running: boolean;
533
+ pid: number | null;
534
+ port: number;
535
+ };
536
+ start(options?: {
537
+ caffeinate?: boolean;
538
+ }): Promise<boolean>;
539
+ buildStartCommand(gatewayScript: string, options?: {
540
+ caffeinate?: boolean;
541
+ }): string;
542
+ stop(): Promise<boolean>;
543
+ restart(options?: {
544
+ onlyIfRunning?: boolean;
545
+ caffeinate?: boolean;
546
+ }): Promise<{
547
+ ok: boolean;
548
+ wasRunning: boolean;
549
+ stopped: boolean;
550
+ started: boolean;
551
+ }>;
552
+ getLogDir(): string;
553
+ getGatewayLog(): string;
554
+ getPort(): number;
555
+ private readPid;
556
+ private removePid;
557
+ private isProcessAlive;
558
+ }
559
+ //#endregion
560
+ //#region lib/gateway/broadcaster.d.ts
561
+ type ClientData = {
562
+ /** Stable channel id (uuid) that the WS client subscribed to. */channel: string; /** Human-facing channel name resolved at upgrade time, kept for log readability. */
563
+ channelName?: string | null; /** Connector names belonging to that channel; used by tap-all replay filtering. */
564
+ connectors: string[];
565
+ tapAll?: boolean; /** Routing mode resolved from channel config at upgrade time. Defaults to fanout. */
566
+ delivery?: "fanout" | "exclusive";
567
+ };
568
+ type BroadcastEvent = {
569
+ content: string;
570
+ meta?: Record<string, string>;
571
+ };
572
+ type ReplayableEvent = BroadcastEvent & {
573
+ offset: number;
574
+ };
575
+ type BroadcastSubscriber = (event: ReplayableEvent) => void;
576
+ /**
577
+ * Optional persistent replay source. Wired in by the gateway-server with
578
+ * `FunnelEventStore` (SQLite-backed) so reconnects across daemon restarts
579
+ * can recover events older than the in-memory buffer via an indexed
580
+ * `seq > since` range scan.
581
+ */
582
+ type ReplaySource = {
583
+ loadSince(since: number): ReplayableEvent[];
584
+ };
585
+ type Deps$5 = {
586
+ logger?: FunnelLogger;
587
+ maxBufferedBytes?: number;
588
+ now?: () => number; /** Number of recent events kept in the in-memory replay buffer. */
589
+ replayBufferSize?: number; /** Hard byte cap on replay buffer payloads. Older events are evicted FIFO until under this cap. */
590
+ replayBufferMaxBytes?: number; /** Persistent replay source consulted when the in-memory buffer cannot satisfy `since`. */
591
+ persistentReplay?: ReplaySource;
592
+ };
593
+ type BroadcasterMetrics = {
594
+ clients: number;
595
+ subscribers: number;
596
+ eventsBroadcast: number;
597
+ droppedSlowClients: number;
598
+ lastBroadcastAt: string | null; /** Latest emitted offset. Clients can `?since=<offset>` to ask for events strictly after this point. */
599
+ latestOffset: number; /** Oldest offset still held in the replay buffer. Older values cannot be replayed and trigger a full resync. */
600
+ oldestReplayableOffset: number | null;
601
+ };
602
+ /**
603
+ * In-process pub/sub for connector events.
604
+ *
605
+ * Two outbound paths:
606
+ * - WS clients connected via the gateway's `/ws` endpoint, scoped per channel
607
+ * - In-process subscribers registered via `subscribe()` (programmable API)
608
+ *
609
+ * Backpressure: if a WS client's `bufferedAmount` exceeds `maxBufferedBytes`
610
+ * (default 1 MiB), the client is closed with code 1009 and dropped from the
611
+ * registry to keep one slow consumer from blocking the daemon.
612
+ *
613
+ * Replay: every emitted event gets a strictly increasing `offset`. The latest
614
+ * `replayBufferSize` events are kept in memory; reconnecting WS clients can
615
+ * pass `?since=<offset>` and the broadcaster resends matching events before
616
+ * resuming the live stream. The in-memory ring covers short reconnects;
617
+ * older history is served from the SQLite event store wired in as
618
+ * `persistentReplay`.
619
+ */
620
+ declare class FunnelBroadcaster {
621
+ private readonly clients;
622
+ private readonly subscribers;
623
+ private readonly logger;
624
+ private readonly maxBufferedBytes;
625
+ private readonly now;
626
+ private readonly replayBufferSize;
627
+ private readonly replayBufferMaxBytes;
628
+ private readonly replayBuffer;
629
+ private readonly persistentReplay;
630
+ private readonly exclusiveCursor;
631
+ private replayBufferBytes;
632
+ private eventsBroadcast;
633
+ private droppedSlowClients;
634
+ private lastBroadcastAt;
635
+ private latestOffset;
636
+ constructor(deps?: Deps$5);
637
+ getMetrics(): BroadcasterMetrics;
638
+ /**
639
+ * Returns events with offset > since, filtered by the connector subscription
640
+ * rules of `data`. Used at WS upgrade time when the client passes `?since=<offset>`.
641
+ *
642
+ * Two-tier lookup:
643
+ * 1. The in-memory ring buffer (covers short reconnects, last `replayBufferSize` events).
644
+ * 2. If `since` predates the oldest in-memory entry and a persistent replay source
645
+ * is wired in (SQLite), the gap is filled from disk. This covers reconnects across
646
+ * daemon restarts where the in-memory buffer was lost.
647
+ *
648
+ * Result is sorted ascending by offset and de-duplicated against the in-memory buffer.
649
+ */
650
+ replaySince(since: number, data: ClientData): ReplayableEvent[];
651
+ private matchesClient;
652
+ /**
653
+ * Returns the list of WS clients that should receive `event`. Tap=all clients always
654
+ * receive (passive observation). For each per-channel group:
655
+ * - fanout → every matching client receives
656
+ * - exclusive → exactly one client receives, picked round-robin per channel
657
+ */
658
+ private pickRecipients;
659
+ addClient(ws: ServerWebSocket<unknown>, data: ClientData): void;
660
+ removeClient(ws: ServerWebSocket<unknown>): void;
661
+ getClientCount(): number;
662
+ listChannels(): {
663
+ channel: string;
664
+ connectors: string[];
665
+ }[];
666
+ subscribe(handler: BroadcastSubscriber): () => void;
667
+ broadcast(content: string, meta?: Record<string, string>): ReplayableEvent;
668
+ /** Forward-seed the offset counter (used at startup from the persisted event store). */
669
+ seedLatestOffset(offset: number): void;
670
+ }
671
+ //#endregion
672
+ //#region lib/gateway/funnel-event-store.d.ts
673
+ /**
674
+ * Replayable event payload persisted by the gateway. Domain events the
675
+ * broadcaster emits to WS clients land here so reconnects across daemon
676
+ * restarts can be served from disk. System events (gateway start, channel
677
+ * connected, etc.) are routed to `FunnelLogger` instead — they never go
678
+ * through this store, which keeps the seq space clean for replay.
679
+ */
680
+ declare const funnelEventSchema: z.ZodObject<{
681
+ type: z.ZodString;
682
+ content: z.ZodString;
683
+ channel_id: z.ZodNullable<z.ZodString>;
684
+ connector_id: z.ZodNullable<z.ZodString>;
685
+ meta: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
686
+ }, z.core.$strip>;
687
+ type FunnelEvent = z.infer<typeof funnelEventSchema>;
688
+ type Props$5 = {
689
+ /** SQLite database file path. Created on first write. ":memory:" for tests. */path: string; /** Override for tests. Defaults to `Date.now`. */
690
+ now?: () => number; /** Optional row cap. Pruned on every insert. */
691
+ maxRows?: number; /** Optional age cap in ms. Pruned on every insert. */
692
+ maxAgeMs?: number;
693
+ };
694
+ /**
695
+ * SQLite-backed event store. One indexed table holds every broadcaster
696
+ * event with `channel_id` and `connector_id` as dedicated columns, so
697
+ * per-channel and per-connector replay is an indexed range scan.
698
+ *
699
+ * Concurrency: `seq` is `INTEGER PRIMARY KEY`, so SQLite assigns it
700
+ * atomically. The broadcaster owns its own offset counter at runtime
701
+ * (seeded from `findMaxOffset()` at startup); each broadcaster event
702
+ * flows in here via `record()` with that pre-assigned offset, which the
703
+ * sink stores via `write()` — PK uniqueness catches double-emit bugs.
704
+ *
705
+ * System events (gateway lifecycle, channel connect/disconnect, etc.) do
706
+ * NOT go through this store. They are diagnostic only and live in
707
+ * `FunnelLogger`'s file so the seq space here stays exclusive to
708
+ * broadcaster traffic. This is what makes the broadcaster's seq seeding
709
+ * (`getMaxSeq()` at startup) correct without per-event coordination.
710
+ */
711
+ declare class FunnelEventStore {
712
+ private readonly sink;
713
+ private readonly now;
714
+ constructor(props: Props$5);
715
+ /**
716
+ * Persist a broadcaster-driven event with its assigned offset. Caller
717
+ * (the gateway-server) supplies the offset from `broadcaster.broadcast()`
718
+ * so this store and the broadcaster's in-memory ring stay aligned.
719
+ */
720
+ record(props: {
721
+ content: string;
722
+ channelId: string | null;
723
+ connectorId: string | null;
724
+ meta: Record<string, string> | null;
725
+ offset: number;
726
+ }): void;
727
+ /**
728
+ * Returns events with offset > since. Filtering by channel/connector is
729
+ * the broadcaster's responsibility (it knows the client's subscription),
730
+ * so this returns the full slice and lets the caller filter.
731
+ */
732
+ loadSince(since: number): ReplayableEvent[];
733
+ /**
734
+ * Returns events for one channel (and optionally one connector). Used
735
+ * by the gateway logs CLI for scoped queries. Channel/connector filters
736
+ * are indexed columns, so this is an indexed range scan.
737
+ */
738
+ loadForChannel(props: {
739
+ channelId: string;
740
+ connectorId?: string;
741
+ sinceSeq?: number;
742
+ limit?: number;
743
+ }): ReplayableEvent[];
744
+ findMaxOffset(): number;
745
+ close(): void;
746
+ }
747
+ //#endregion
748
+ //#region lib/gateway/listener-supervisor.d.ts
749
+ type ConnectorRegistry = {
750
+ listAllConnectors(): ChannelConnectorView[];
751
+ createListener(channelName: string, connectorName: string): {
752
+ config: ConnectorConfig;
753
+ channelId: string;
754
+ listener: FunnelConnectorListener;
755
+ } | null;
756
+ };
757
+ type SupervisorNotify = (channelName: string, connectorName: string, content: string, meta?: Record<string, string>) => Promise<void>;
758
+ type Deps$4 = {
759
+ channels: ConnectorRegistry;
760
+ notify: SupervisorNotify;
761
+ logger?: FunnelLogger;
762
+ healthCheckIntervalMs?: number;
763
+ maxBackoffMs?: number;
764
+ sleep?: (ms: number) => Promise<void>;
765
+ now?: () => number;
766
+ };
767
+ type ListenerEntryStatus = {
768
+ channelName: string;
769
+ channelId: string;
770
+ name: string;
771
+ type: ConnectorConfig["type"];
772
+ alive: boolean;
773
+ events: number;
774
+ errors: number;
775
+ failureCount: number;
776
+ lastEventAt: string | null;
777
+ };
778
+ /**
779
+ * Owns the running listener instances and their lifecycle.
780
+ *
781
+ * Lives in the gateway process and is the only place that calls
782
+ * `listener.start()` / `listener.stop()`. Each entry is keyed by
783
+ * `${channelName}/${connectorName}` so the same connector name can exist in
784
+ * multiple channels without colliding.
785
+ *
786
+ * Periodically polls each running listener's `isAlive()` and auto-restarts
787
+ * dead listeners with exponential backoff (1s, 2s, 4s, ... capped). Resets
788
+ * the backoff counter on successful restart.
789
+ */
790
+ declare class FunnelListenerSupervisor {
791
+ private readonly channels;
792
+ private readonly notify;
793
+ private readonly logger;
794
+ private readonly running;
795
+ private readonly failureCounts;
796
+ private readonly stats;
797
+ private readonly healthCheckIntervalMs;
798
+ private readonly maxBackoffMs;
799
+ private readonly sleep;
800
+ private readonly now;
801
+ private healthCheckTimer;
802
+ private healthCheckInFlight;
803
+ constructor(deps: Deps$4);
804
+ static keyOf(channelName: string, connectorName: string): string;
805
+ isRunning(channelName: string, connectorName: string): boolean;
806
+ list(): ListenerEntryStatus[];
807
+ start(channelName: string, connectorName: string): Promise<{
808
+ ok: boolean;
809
+ reason?: string;
810
+ }>;
811
+ stop(channelName: string, connectorName: string): Promise<{
812
+ ok: boolean;
813
+ reason?: string;
814
+ }>;
815
+ restart(channelName: string, connectorName: string): Promise<{
816
+ ok: boolean;
817
+ reason?: string;
818
+ }>;
819
+ startAll(): Promise<void>;
820
+ stopAll(): Promise<void>;
821
+ private ensureStats;
822
+ private recordEvent;
823
+ private recordError;
824
+ private startHealthCheck;
825
+ private stopHealthCheck;
826
+ private runHealthCheck;
827
+ private recoverDead;
828
+ }
829
+ //#endregion
830
+ //#region lib/gateway/gateway-server.d.ts
831
+ type Deps$3 = {
832
+ channels: FunnelChannels;
833
+ settings: FunnelSettingsReader;
834
+ port?: number; /** Directory holding the SQLite event store. The DB file lives at `<logDir>/events.db`. */
835
+ logDir?: string;
836
+ process?: FunnelProcessRunner;
837
+ clock?: FunnelClock;
838
+ logger?: FunnelLogger;
839
+ selfPid?: number;
840
+ killCompetingSlack?: boolean; /** Bearer token required for `/listeners*`, `/status`, and `/ws`. Empty string disables auth (tests only). */
841
+ token?: string;
842
+ };
843
+ type WsData = {
844
+ /** Stable channel id (uuid) the client subscribed to. "" for tap-all clients. */channel: string; /** Resolved channel name (for log readability). null for tap-all or unknown. */
845
+ channelName: string | null; /** Connector names belonging to that channel; used by tap-all replay filtering. */
846
+ connectors: string[];
847
+ tapAll?: boolean; /** Routing mode for this channel; resolved at upgrade time from settings. */
848
+ delivery: "fanout" | "exclusive"; /** Replay any events with offset strictly greater than this on open, then resume the live stream. */
849
+ since?: number;
850
+ };
851
+ /**
852
+ * In-process gateway: runs `Bun.serve` (HTTP + WebSocket /ws), boots connector
853
+ * listeners through `FunnelListenerSupervisor`, fans events out via
854
+ * `FunnelBroadcaster`, and persists them via `FunnelEventStore` (SQLite).
855
+ * System events (gateway lifecycle, connect/disconnect) flow to `FunnelLogger`
856
+ * instead — keeping the SQLite seq space exclusive to broadcaster traffic so
857
+ * the broadcaster's offset counter and `getMaxSeq()` stay aligned without
858
+ * per-event coordination. Exposes `/listeners` HTTP for runtime
859
+ * start/stop/restart of individual connectors.
860
+ */
861
+ declare class FunnelGatewayServer {
862
+ private readonly channels;
863
+ private readonly settings;
864
+ private readonly port;
865
+ private readonly logDir;
866
+ private readonly process?;
867
+ private readonly logger;
868
+ private readonly selfPid;
869
+ private readonly killCompetingSlack;
870
+ private readonly token;
871
+ private readonly broadcaster;
872
+ private readonly eventStore;
873
+ private readonly supervisor;
874
+ private readonly nowMs;
875
+ private startedAt;
876
+ private server;
877
+ constructor(deps: Deps$3);
878
+ start(): Promise<Server<WsData>>;
879
+ stop(): Promise<void>;
880
+ getStatus(): {
881
+ clients: number;
882
+ channels: {
883
+ channel: string;
884
+ connectors: string[];
885
+ }[];
886
+ };
887
+ getBroadcaster(): FunnelBroadcaster;
888
+ getSupervisor(): FunnelListenerSupervisor;
889
+ getEventStore(): FunnelEventStore;
890
+ private handleFetch;
891
+ private handleWsOpen;
892
+ private handleWsClose;
893
+ private logServerStarted;
894
+ private buildApp;
895
+ /**
896
+ * Reads the bearer token from the WebSocket upgrade request. Accepts:
897
+ * - `Sec-WebSocket-Protocol: funnel.token.<value>` (preferred — header, never logged in URLs)
898
+ * - `Authorization: Bearer <value>` (also header-based)
899
+ * Returns true on a constant-time match against the daemon token.
900
+ */
901
+ private tokenMatchesUpgrade;
902
+ private resolveChannel;
903
+ private bootListeners;
904
+ /**
905
+ * Broadcast `content` to subscribers of `channel`, persisting the event in
906
+ * the SQLite store and stamping `meta.channel{,Id}` / `meta.connector{,Id}`
907
+ * when they resolve. Used by both the connector-listener path (via the
908
+ * supervisor's `notify` callback) and the public `/channels/:channel/publish`
909
+ * route. Returns the assigned event offset.
910
+ */
911
+ emit(input: {
912
+ channel: string;
913
+ connector?: string;
914
+ content: string;
915
+ meta?: Record<string, string>;
916
+ }): {
917
+ offset: number;
918
+ };
919
+ private lookupChannelId;
920
+ private lookupConnectorId;
921
+ }
922
+ //#endregion
923
+ //#region lib/gateway/gateway-token.d.ts
924
+ type Deps$2 = {
925
+ fs?: FunnelFileSystem;
926
+ dir?: string;
927
+ generate?: () => string;
928
+ };
929
+ /**
930
+ * Reads / generates the gateway daemon token used to authenticate
931
+ * `/listeners*`, `/status`, and `/ws` connections.
932
+ *
933
+ * Token file: `<dir>/gateway.token` (default `~/.funnel/gateway.token`),
934
+ * written with mode 0600. Clients on the same machine as the daemon read
935
+ * the file directly; the token never leaves the user's home directory.
936
+ */
937
+ declare class FunnelGatewayToken {
938
+ private readonly fs;
939
+ private readonly path;
940
+ private readonly generate;
941
+ constructor(deps?: Deps$2);
942
+ read(): string | null;
943
+ /**
944
+ * Returns the existing token or, if missing, generates one and writes it with mode 0600.
945
+ *
946
+ * NOTE: not atomic — two concurrent `ensure()` calls (e.g., `fnl gateway start` racing
947
+ * itself before the PID lock is acquired) could each generate independent tokens. The
948
+ * gateway PID file makes this practically a non-issue; if you need stronger guarantees,
949
+ * take a file lock around this call externally.
950
+ */
951
+ ensure(): string;
952
+ getPath(): string;
953
+ }
954
+ declare const DEFAULT_GATEWAY_TOKEN_PATH: string;
955
+ //#endregion
956
+ //#region lib/gateway/listeners-client.d.ts
957
+ type Deps$1 = {
958
+ port: number;
959
+ isDaemonRunning: () => boolean; /** Returns the daemon's gateway token, or null if unavailable. Sent as `Authorization: Bearer`. */
960
+ getToken?: () => string | null;
961
+ };
962
+ declare const listenerEntrySchema: z.ZodObject<{
963
+ channelName: z.ZodString;
964
+ channelId: z.ZodString;
965
+ name: z.ZodString;
966
+ type: z.ZodString;
967
+ alive: z.ZodBoolean;
968
+ }, z.core.$strip>;
969
+ type ListenerEntry = z.infer<typeof listenerEntrySchema>;
970
+ type ListenerOpResult = {
971
+ state: "ok";
972
+ } | {
973
+ state: "offline";
974
+ } | {
975
+ state: "error";
976
+ reason: string;
977
+ };
978
+ type ListListenersResult = {
979
+ state: "ok";
980
+ listeners: ListenerEntry[];
981
+ } | {
982
+ state: "offline";
983
+ } | {
984
+ state: "error";
985
+ reason: string;
986
+ };
987
+ /**
988
+ * HTTP client for listener operations on a running gateway daemon.
989
+ *
990
+ * Returns `{ state: "offline" }` when the daemon isn't running so callers
991
+ * (CLI hot-reload paths) can treat that as a no-op without parsing strings.
992
+ * Pair this with `FunnelGateway` (process control) for the full picture.
993
+ */
994
+ declare class FunnelListenersClient {
995
+ private readonly port;
996
+ private readonly isDaemonRunning;
997
+ private readonly getToken;
998
+ constructor(deps: Deps$1);
999
+ list(): Promise<ListListenersResult>;
1000
+ start(channelName: string, connectorName: string): Promise<ListenerOpResult>;
1001
+ stop(channelName: string, connectorName: string): Promise<ListenerOpResult>;
1002
+ restart(channelName: string, connectorName: string): Promise<ListenerOpResult>;
1003
+ private path;
1004
+ private authHeaders;
1005
+ private call;
1006
+ }
1007
+ //#endregion
1008
+ //#region lib/funnel.d.ts
1009
+ type Props$4 = {
1010
+ /** Settings persistence (channels with nested connectors / profiles). Defaults to a FunnelSettingsStore rooted at `dir`. */store?: FunnelSettingsReader; /** Filesystem boundary. Replace with MemoryFunnelFileSystem to sandbox all disk I/O. */
1011
+ fs?: FunnelFileSystem; /** Process runner used by gateway / claude / gh listener. Replace with MemoryFunnelProcessRunner for tests. */
1012
+ process?: FunnelProcessRunner; /** Logger flowed into every facet. Replace with MemoryFunnelLogger or NoopFunnelLogger to silence/inspect. */
1013
+ logger?: FunnelLogger; /** Clock used by schedule listener, gh poll watermarks, and gateway timeouts. */
1014
+ clock?: FunnelClock; /** ID generator for channel and connector ids. Use MemoryFunnelIdGenerator for deterministic tests. */
1015
+ idGenerator?: FunnelIdGenerator; /** Funnel home directory (settings.json + per-channel/per-connector dirs). Defaults to ~/.funnel. */
1016
+ dir?: string; /** Temp / runtime directory (gateway logs and PID adjacent files). Defaults to /tmp/funnel. */
1017
+ tmpDir?: string;
1018
+ };
1019
+ /**
1020
+ * Facade exposing every funnel facet as a getter.
1021
+ *
1022
+ * The same `Funnel` is used by the CLI, the TUI, and as a programmable library.
1023
+ * All side-effecting boundaries (filesystem, process, logger, clock, id, paths) are
1024
+ * injectable via `Props` — passing memory implementations gives a fully sandboxed
1025
+ * Funnel that touches no real disk, processes, or wall-clock time.
1026
+ *
1027
+ * Connectors live nested inside their owning channel (channels[].connectors[]),
1028
+ * so connector CRUD is reached via `funnel.channels.addConnector(...)` etc.
1029
+ *
1030
+ * @example
1031
+ * ```ts
1032
+ * const funnel = new Funnel({})
1033
+ * const channel = funnel.channels.add({ name: "inbox" })
1034
+ * funnel.channels.addConnector("inbox", { type: "slack", name: "ops", botToken, appToken })
1035
+ * await funnel.gatewayServer({ port: 9742 }).start()
1036
+ * ```
1037
+ */
1038
+ declare class Funnel {
1039
+ private readonly props;
1040
+ private readonly cache;
1041
+ constructor(props?: Props$4);
1042
+ /**
1043
+ * Sandboxed Funnel wired with in-memory implementations for every IO boundary.
1044
+ * Touches no real disk, processes, wall-clock time, or UUIDs — safe for tests
1045
+ * and ad-hoc experiments. Override individual fields by passing them in `props`.
1046
+ */
1047
+ static inMemory(props?: Props$4): Funnel;
1048
+ private memo;
1049
+ /** Resolved on-disk paths the facade will read/write when methods are called. Pure compute, not memoized. */
1050
+ get paths(): {
1051
+ dir: string;
1052
+ tmpDir: string;
1053
+ settings: string;
1054
+ };
1055
+ /** Filesystem boundary. Defaults to NodeFunnelFileSystem. */
1056
+ get fs(): FunnelFileSystem;
1057
+ /** Process runner boundary. Defaults to NodeFunnelProcessRunner. */
1058
+ get process(): FunnelProcessRunner;
1059
+ /** Logger boundary. Defaults to NodeFunnelLogger. */
1060
+ get logger(): FunnelLogger;
1061
+ /** Clock boundary. Defaults to NodeFunnelClock. */
1062
+ get clock(): FunnelClock;
1063
+ /** ID generator boundary. Defaults to NodeFunnelIdGenerator. */
1064
+ get idGenerator(): FunnelIdGenerator;
1065
+ /** Settings reader. If not injected, a FunnelSettingsStore rooted at `dir` is created. */
1066
+ get store(): FunnelSettingsReader;
1067
+ /** Pure factory that constructs per-type listeners and adapters from connector configs. */
1068
+ get factory(): FunnelConnectorFactory;
1069
+ /** Channel CRUD + nested connector CRUD + schedule entries + listener/adapter dispatch. */
1070
+ get channels(): FunnelChannels;
1071
+ /** Launch profiles (named presets for `fnl claude`: path + sub-agent + channel id). */
1072
+ get profiles(): FunnelProfiles;
1073
+ /** funnel MCP installer (writes/removes `.mcp.json` entries in target repos). */
1074
+ get mcp(): FunnelMcp;
1075
+ /** Launch Claude Code with a channel injected via env, MCP installed, gateway ensured. */
1076
+ get claude(): FunnelClaude;
1077
+ /** Gateway daemon controller (PID-file, start/stop the separate `bun daemon.ts` process). */
1078
+ get gateway(): FunnelGateway;
1079
+ /** Read / generate the daemon's gateway token (mode 0600 file under `dir`). */
1080
+ get gatewayToken(): FunnelGatewayToken;
1081
+ /**
1082
+ * HTTP client for `POST /channels/:channel/publish` on the running gateway
1083
+ * daemon. Use it to push arbitrary content into a channel from outside any
1084
+ * connector. Returns `{ state: "offline" }` if the daemon isn't up.
1085
+ */
1086
+ get publisher(): FunnelChannelPublisher;
1087
+ /**
1088
+ * HTTP client for listener operations on the running gateway daemon.
1089
+ * Returns `{ state: "offline" }` when the daemon is offline so hot-reload
1090
+ * paths stay write-only without parsing strings.
1091
+ */
1092
+ get listeners(): FunnelListenersClient;
1093
+ /**
1094
+ * In-process gateway server. Unlike `gateway.start()` (which spawns a daemon),
1095
+ * this returns a class that runs `Bun.serve` + listeners inside the current process —
1096
+ * useful for tests, embedding, or custom hosts.
1097
+ */
1098
+ gatewayServer(options?: {
1099
+ port?: number;
1100
+ logDir?: string;
1101
+ killCompetingSlack?: boolean; /** Override the auth token. Defaults to the persisted gateway.token. Pass "" to disable auth (tests). */
1102
+ token?: string;
1103
+ }): FunnelGatewayServer;
1104
+ }
1105
+ //#endregion
1106
+ //#region lib/engine/mcp/channel-server.d.ts
1107
+ type ChannelServerOptions = {
1108
+ /** Funnel home directory (settings.json + gateway.token). Defaults to ~/.funnel. */dir?: string; /** Gateway base URL. Defaults to `$FUNNEL_GATEWAY_URL` or `http://localhost:9742`. */
1109
+ gatewayUrl?: string; /** Channel id to subscribe to. Defaults to `$FUNNEL_CHANNEL_ID`. */
1110
+ channelId?: string; /** Auth token. Defaults to `$FUNNEL_GATEWAY_TOKEN` then `<dir>/gateway.token`. */
1111
+ token?: string;
1112
+ };
1113
+ declare const startChannelServer: (options?: ChannelServerOptions) => Promise<void>;
1114
+ //#endregion
1115
+ //#region lib/engine/settings/settings-store.d.ts
1116
+ declare const FUNNEL_DIR: string;
1117
+ declare const SETTINGS_PATH: string;
1118
+ type Deps = {
1119
+ path?: string;
1120
+ fs?: FunnelFileSystem;
1121
+ };
1122
+ declare class FunnelSettingsStore extends FunnelSettingsReader {
1123
+ private readonly path;
1124
+ private readonly fs;
1125
+ constructor(deps?: Deps);
1126
+ read(): Settings;
1127
+ private looksLikeLegacy;
1128
+ write(settings: Settings): void;
1129
+ }
1130
+ //#endregion
1131
+ //#region lib/engine/settings/mock-settings-reader.d.ts
1132
+ declare const createSettings: (partial?: Partial<Settings>) => Settings;
1133
+ declare class MockFunnelSettingsReader extends FunnelSettingsReader {
1134
+ private state;
1135
+ constructor(initial?: Partial<Settings>);
1136
+ read(): Settings;
1137
+ write(settings: Settings): void;
1138
+ }
1139
+ //#endregion
1140
+ //#region lib/engine/fs/node-file-system.d.ts
1141
+ declare class NodeFunnelFileSystem extends FunnelFileSystem {
1142
+ constructor();
1143
+ existsSync(path: string): boolean;
1144
+ readFileSync(path: string): string;
1145
+ writeFileSync(path: string, data: string): void;
1146
+ writeSecretFileSync(path: string, data: string): void;
1147
+ appendFileSync(path: string, data: string): void;
1148
+ unlink(path: string): void;
1149
+ mkdirSync(path: string, options?: {
1150
+ recursive?: boolean;
1151
+ }): void;
1152
+ readdirSync(path: string): string[];
1153
+ statSync(path: string): FileStat;
1154
+ }
1155
+ //#endregion
1156
+ //#region lib/engine/fs/memory-file-system.d.ts
1157
+ type Props$3 = {
1158
+ dirs?: string[];
1159
+ files?: Record<string, string>;
1160
+ mtimes?: Record<string, number>;
1161
+ modes?: Record<string, number>;
1162
+ now?: () => number;
1163
+ };
1164
+ declare class MemoryFunnelFileSystem extends FunnelFileSystem {
1165
+ private readonly dirs;
1166
+ private readonly files;
1167
+ private readonly mtimes;
1168
+ private readonly modes;
1169
+ private readonly now;
1170
+ constructor(props?: Props$3);
1171
+ existsSync(path: string): boolean;
1172
+ readFileSync(path: string): string;
1173
+ writeFileSync(path: string, data: string): void;
1174
+ writeSecretFileSync(path: string, data: string): void;
1175
+ appendFileSync(path: string, data: string): void;
1176
+ unlink(path: string): void;
1177
+ mkdirSync(path: string, options?: {
1178
+ recursive?: boolean;
1179
+ }): void;
1180
+ readdirSync(path: string): string[];
1181
+ statSync(path: string): FileStat;
1182
+ setMtime(path: string, mtimeMs: number): void;
1183
+ setMode(path: string, mode: number): void;
1184
+ private touch;
1185
+ }
1186
+ //#endregion
1187
+ //#region lib/engine/process/node-process-runner.d.ts
1188
+ declare class NodeFunnelProcessRunner extends FunnelProcessRunner {
1189
+ constructor();
1190
+ runSync(command: string[]): RunResult;
1191
+ run(command: string[], options?: RunOptions): Promise<RunResult>;
1192
+ attach(command: string[], options?: AttachOptions): Promise<number>;
1193
+ detach(command: string[], options?: DetachOptions): void;
1194
+ kill(pid: number, signal?: string): void;
1195
+ }
1196
+ //#endregion
1197
+ //#region lib/engine/process/memory-process-runner.d.ts
1198
+ type MemoryProcessResponse = {
1199
+ exitCode?: number;
1200
+ stdout?: string;
1201
+ stderr?: string;
1202
+ };
1203
+ type MemoryProcessHandler = (command: string[]) => MemoryProcessResponse | Promise<MemoryProcessResponse>;
1204
+ type MemoryProcessSyncHandler = (command: string[]) => MemoryProcessResponse;
1205
+ type MemoryProcessCall = {
1206
+ kind: "run";
1207
+ command: string[];
1208
+ options: RunOptions;
1209
+ } | {
1210
+ kind: "runSync";
1211
+ command: string[];
1212
+ } | {
1213
+ kind: "attach";
1214
+ command: string[];
1215
+ options: AttachOptions;
1216
+ } | {
1217
+ kind: "detach";
1218
+ command: string[];
1219
+ options: DetachOptions;
1220
+ } | {
1221
+ kind: "kill";
1222
+ command: string[];
1223
+ };
1224
+ declare class MemoryFunnelProcessRunner extends FunnelProcessRunner {
1225
+ readonly calls: MemoryProcessCall[];
1226
+ readonly killed: {
1227
+ pid: number;
1228
+ signal: string;
1229
+ }[];
1230
+ private handler;
1231
+ private syncHandler;
1232
+ on(handler: MemoryProcessHandler): this;
1233
+ onSync(handler: MemoryProcessSyncHandler): this;
1234
+ run(command: string[], options?: RunOptions): Promise<RunResult>;
1235
+ runSync(command: string[]): RunResult;
1236
+ attach(command: string[], options?: AttachOptions): Promise<number>;
1237
+ detach(command: string[], options?: DetachOptions): void;
1238
+ kill(pid: number, signal?: string): void;
1239
+ }
1240
+ //#endregion
1241
+ //#region lib/engine/logger/node-logger.d.ts
1242
+ type Props$2 = {
1243
+ file?: string;
1244
+ now?: () => Date;
1245
+ };
1246
+ declare class NodeFunnelLogger extends FunnelLogger {
1247
+ readonly file: string;
1248
+ private readonly now;
1249
+ constructor(props?: Props$2);
1250
+ info(message: string, meta?: Record<string, unknown>): void;
1251
+ warn(message: string, meta?: Record<string, unknown>): void;
1252
+ error(message: string, meta?: Record<string, unknown>): void;
1253
+ private write;
1254
+ }
1255
+ //#endregion
1256
+ //#region lib/engine/logger/memory-logger.d.ts
1257
+ type LogEntry = {
1258
+ level: "info" | "warn" | "error";
1259
+ message: string;
1260
+ meta?: Record<string, unknown>;
1261
+ };
1262
+ declare class MemoryFunnelLogger extends FunnelLogger {
1263
+ readonly file: null;
1264
+ readonly entries: LogEntry[];
1265
+ info(message: string, meta?: Record<string, unknown>): void;
1266
+ warn(message: string, meta?: Record<string, unknown>): void;
1267
+ error(message: string, meta?: Record<string, unknown>): void;
1268
+ clear(): void;
1269
+ }
1270
+ //#endregion
1271
+ //#region lib/engine/logger/noop-logger.d.ts
1272
+ declare class NoopFunnelLogger extends FunnelLogger {
1273
+ readonly file: null;
1274
+ info(): void;
1275
+ warn(): void;
1276
+ error(): void;
1277
+ }
1278
+ //#endregion
1279
+ //#region lib/engine/time/node-clock.d.ts
1280
+ declare class NodeFunnelClock extends FunnelClock {
1281
+ now(): Date;
1282
+ }
1283
+ //#endregion
1284
+ //#region lib/engine/time/memory-clock.d.ts
1285
+ type Props$1 = {
1286
+ start?: Date;
1287
+ };
1288
+ declare class MemoryFunnelClock extends FunnelClock {
1289
+ private current;
1290
+ constructor(props?: Props$1);
1291
+ now(): Date;
1292
+ set(date: Date): void;
1293
+ advance(ms: number): void;
1294
+ }
1295
+ //#endregion
1296
+ //#region lib/engine/id/node-id-generator.d.ts
1297
+ declare class NodeFunnelIdGenerator extends FunnelIdGenerator {
1298
+ generate(): string;
1299
+ }
1300
+ //#endregion
1301
+ //#region lib/engine/id/memory-id-generator.d.ts
1302
+ type Props = {
1303
+ prefix?: string;
1304
+ };
1305
+ declare class MemoryFunnelIdGenerator extends FunnelIdGenerator {
1306
+ private counter;
1307
+ private readonly prefix;
1308
+ constructor(props?: Props);
1309
+ generate(): string;
1310
+ }
1311
+ //#endregion
1312
+ //#region lib/cli/factory.d.ts
1313
+ type Env = {
1314
+ Variables: {
1315
+ funnel: Funnel;
1316
+ };
1317
+ };
1318
+ declare const factory: _$hono_factory0.Factory<Env, string>;
1319
+ //#endregion
1320
+ //#region lib/cli/router/to-request.d.ts
1321
+ declare const toRequest: (args: string[]) => {
1322
+ method: string;
1323
+ path: string;
1324
+ url: string;
1325
+ };
1326
+ //#endregion
1327
+ //#region lib/cli/router/query-to-cli-args.d.ts
1328
+ declare const queryToCliArgs: (url: string, reservedKeys?: string[]) => string[];
1329
+ //#endregion
1330
+ //#region lib/cli/routes/index.d.ts
1331
+ /**
1332
+ * Build the CLI Hono app wired to a specific Funnel instance.
1333
+ * Exposed so library consumers can mount the same routes their `fnl` CLI
1334
+ * uses against a custom Funnel (e.g. one with sandboxed boundaries).
1335
+ *
1336
+ * All CLI verbs (`add` / `remove` / `set` / `rename` / `as-default` / `request`) map to POST in
1337
+ * to-request.ts and stay in the URL as a literal segment. Read paths (list / show / launch) keep GET.
1338
+ * Help shortcuts at parameterless URLs return the help text directly so `funnel <verb>` (no args) is
1339
+ * informative instead of 404.
1340
+ */
1341
+ declare const createCliApp: (funnel: Funnel) => _$hono_hono_base0.HonoBase<Env, {
1342
+ "/claude": {
1343
+ $get: {
1344
+ input: {
1345
+ query: {
1346
+ [x: string]: string | string[];
1347
+ profile?: string | undefined;
1348
+ channel?: string | undefined;
1349
+ };
1350
+ };
1351
+ output: string;
1352
+ outputFormat: "text";
1353
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1354
+ } | {
1355
+ input: {
1356
+ query: {
1357
+ [x: string]: string | string[];
1358
+ profile?: string | undefined;
1359
+ channel?: string | undefined;
1360
+ };
1361
+ };
1362
+ output: "funnel claude — launch Claude Code\n\nusage:\n funnel claude launch the default profile (first in the list)\n funnel claude -p <name> launch a named profile\n funnel claude --profile <name> (long form)\n funnel claude --channel <name> raw launch (no profile, cwd = current dir)\n\noptions:\n -p, --profile profile name to launch\n --channel channel name (raw launch, ignored when --profile is given)\n\nAny other arguments are forwarded to the claude CLI.\nOn launch the FUNNEL_CHANNEL_ID env var is set and MCP connects to the gateway.";
1363
+ outputFormat: "text";
1364
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1365
+ };
1366
+ };
1367
+ } & {
1368
+ "/channels": {
1369
+ $get: {
1370
+ input: {
1371
+ query: Record<string, never>;
1372
+ };
1373
+ output: string;
1374
+ outputFormat: "text";
1375
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1376
+ };
1377
+ };
1378
+ } & {
1379
+ "/channels/add": {
1380
+ $post: {
1381
+ input: {};
1382
+ output: string;
1383
+ outputFormat: "text";
1384
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1385
+ };
1386
+ };
1387
+ } & {
1388
+ "/channels/add/:channel": {
1389
+ $post: {
1390
+ input: {
1391
+ param: {
1392
+ channel: string;
1393
+ };
1394
+ } & {
1395
+ query: {
1396
+ delivery?: "fanout" | "exclusive" | undefined;
1397
+ };
1398
+ };
1399
+ output: string;
1400
+ outputFormat: "text";
1401
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1402
+ } | {
1403
+ input: {
1404
+ param: {
1405
+ channel: string;
1406
+ };
1407
+ } & {
1408
+ query: {
1409
+ delivery?: "fanout" | "exclusive" | undefined;
1410
+ };
1411
+ };
1412
+ output: `added channel "${string}" (id: ${string})`;
1413
+ outputFormat: "text";
1414
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1415
+ };
1416
+ };
1417
+ } & {
1418
+ "/channels/remove": {
1419
+ $post: {
1420
+ input: {};
1421
+ output: string;
1422
+ outputFormat: "text";
1423
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1424
+ };
1425
+ };
1426
+ } & {
1427
+ "/channels/remove/:channel": {
1428
+ $post: {
1429
+ input: {
1430
+ param: {
1431
+ channel: string;
1432
+ };
1433
+ } & {
1434
+ query: Record<string, never>;
1435
+ };
1436
+ output: string;
1437
+ outputFormat: "text";
1438
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1439
+ } | {
1440
+ input: {
1441
+ param: {
1442
+ channel: string;
1443
+ };
1444
+ } & {
1445
+ query: Record<string, never>;
1446
+ };
1447
+ output: `removed channel "${string}"`;
1448
+ outputFormat: "text";
1449
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1450
+ };
1451
+ };
1452
+ } & {
1453
+ "/channels/rename/:channel/:newName": {
1454
+ $post: {
1455
+ input: {
1456
+ param: {
1457
+ channel: string;
1458
+ newName: string;
1459
+ };
1460
+ } & {
1461
+ query: Record<string, never>;
1462
+ };
1463
+ output: string;
1464
+ outputFormat: "text";
1465
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1466
+ } | {
1467
+ input: {
1468
+ param: {
1469
+ channel: string;
1470
+ newName: string;
1471
+ };
1472
+ } & {
1473
+ query: Record<string, never>;
1474
+ };
1475
+ output: `renamed channel "${string}" to "${string}"`;
1476
+ outputFormat: "text";
1477
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1478
+ };
1479
+ };
1480
+ } & {
1481
+ "/channels/:channel/rename/:newName": {
1482
+ $post: {
1483
+ input: {
1484
+ param: {
1485
+ channel: string;
1486
+ newName: string;
1487
+ };
1488
+ } & {
1489
+ query: Record<string, never>;
1490
+ };
1491
+ output: string;
1492
+ outputFormat: "text";
1493
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1494
+ } | {
1495
+ input: {
1496
+ param: {
1497
+ channel: string;
1498
+ newName: string;
1499
+ };
1500
+ } & {
1501
+ query: Record<string, never>;
1502
+ };
1503
+ output: `renamed channel "${string}" to "${string}"`;
1504
+ outputFormat: "text";
1505
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1506
+ };
1507
+ };
1508
+ } & {
1509
+ "/channels/rename": {
1510
+ $post: {
1511
+ input: {};
1512
+ output: string;
1513
+ outputFormat: "text";
1514
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1515
+ };
1516
+ };
1517
+ } & {
1518
+ "/channels/:channel/rename": {
1519
+ $post: {
1520
+ input: {
1521
+ param: {
1522
+ channel: string;
1523
+ };
1524
+ };
1525
+ output: string;
1526
+ outputFormat: "text";
1527
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1528
+ };
1529
+ };
1530
+ } & {
1531
+ "/channels/:channel/set/delivery/:mode": {
1532
+ $post: {
1533
+ input: {
1534
+ param: {
1535
+ channel: string;
1536
+ mode: "fanout" | "exclusive";
1537
+ };
1538
+ };
1539
+ output: string;
1540
+ outputFormat: "text";
1541
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1542
+ } | {
1543
+ input: {
1544
+ param: {
1545
+ channel: string;
1546
+ mode: "fanout" | "exclusive";
1547
+ };
1548
+ };
1549
+ output: `channel "${string}" delivery set to fanout` | `channel "${string}" delivery set to exclusive`;
1550
+ outputFormat: "text";
1551
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1552
+ };
1553
+ };
1554
+ } & {
1555
+ "/channels/publish": {
1556
+ $post: {
1557
+ input: {};
1558
+ output: string;
1559
+ outputFormat: "text";
1560
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1561
+ };
1562
+ };
1563
+ } & {
1564
+ "/channels/:channel/publish": {
1565
+ $post: {
1566
+ input: {
1567
+ param: {
1568
+ channel: string;
1569
+ };
1570
+ } & {
1571
+ query: {
1572
+ [x: string]: string | string[];
1573
+ content: string | string[];
1574
+ connector?: string | undefined;
1575
+ };
1576
+ };
1577
+ output: string;
1578
+ outputFormat: "text";
1579
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1580
+ } | {
1581
+ input: {
1582
+ param: {
1583
+ channel: string;
1584
+ };
1585
+ } & {
1586
+ query: {
1587
+ [x: string]: string | string[];
1588
+ content: string | string[];
1589
+ connector?: string | undefined;
1590
+ };
1591
+ };
1592
+ output: `published (offset=${number})`;
1593
+ outputFormat: "text";
1594
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1595
+ };
1596
+ };
1597
+ } & {
1598
+ "/channels/:channel": {
1599
+ $get: {
1600
+ input: {
1601
+ param: {
1602
+ channel: string;
1603
+ };
1604
+ } & {
1605
+ query: Record<string, never>;
1606
+ };
1607
+ output: string;
1608
+ outputFormat: "text";
1609
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1610
+ };
1611
+ };
1612
+ } & {
1613
+ "/channels/:channel/connectors": {
1614
+ $get: {
1615
+ input: {
1616
+ param: {
1617
+ channel: string;
1618
+ };
1619
+ } & {
1620
+ query: Record<string, never>;
1621
+ };
1622
+ output: string;
1623
+ outputFormat: "text";
1624
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1625
+ };
1626
+ };
1627
+ } & {
1628
+ "/channels/:channel/connectors/add": {
1629
+ $post: {
1630
+ input: {
1631
+ param: {
1632
+ channel: string;
1633
+ };
1634
+ };
1635
+ output: string;
1636
+ outputFormat: "text";
1637
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1638
+ };
1639
+ };
1640
+ } & {
1641
+ "/channels/:channel/connectors/add/:connector": {
1642
+ $post: {
1643
+ input: {
1644
+ param: {
1645
+ channel: string;
1646
+ connector: string;
1647
+ };
1648
+ } & {
1649
+ query: {
1650
+ type: string | string[];
1651
+ "bot-token": string | string[];
1652
+ "app-token": string | string[];
1653
+ } | {
1654
+ type: string | string[];
1655
+ "poll-interval"?: string | string[] | undefined;
1656
+ } | {
1657
+ type: string | string[];
1658
+ "bot-token": string | string[];
1659
+ } | {
1660
+ type: string | string[];
1661
+ };
1662
+ };
1663
+ output: string;
1664
+ outputFormat: "text";
1665
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1666
+ } | {
1667
+ input: {
1668
+ param: {
1669
+ channel: string;
1670
+ connector: string;
1671
+ };
1672
+ } & {
1673
+ query: {
1674
+ type: string | string[];
1675
+ "bot-token": string | string[];
1676
+ "app-token": string | string[];
1677
+ } | {
1678
+ type: string | string[];
1679
+ "poll-interval"?: string | string[] | undefined;
1680
+ } | {
1681
+ type: string | string[];
1682
+ "bot-token": string | string[];
1683
+ } | {
1684
+ type: string | string[];
1685
+ };
1686
+ };
1687
+ output: `added slack connector "${string}" to channel "${string}"`;
1688
+ outputFormat: "text";
1689
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1690
+ } | {
1691
+ input: {
1692
+ param: {
1693
+ channel: string;
1694
+ connector: string;
1695
+ };
1696
+ } & {
1697
+ query: {
1698
+ type: string | string[];
1699
+ "bot-token": string | string[];
1700
+ "app-token": string | string[];
1701
+ } | {
1702
+ type: string | string[];
1703
+ "poll-interval"?: string | string[] | undefined;
1704
+ } | {
1705
+ type: string | string[];
1706
+ "bot-token": string | string[];
1707
+ } | {
1708
+ type: string | string[];
1709
+ };
1710
+ };
1711
+ output: `added gh connector "${string}" to channel "${string}"`;
1712
+ outputFormat: "text";
1713
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1714
+ } | {
1715
+ input: {
1716
+ param: {
1717
+ channel: string;
1718
+ connector: string;
1719
+ };
1720
+ } & {
1721
+ query: {
1722
+ type: string | string[];
1723
+ "bot-token": string | string[];
1724
+ "app-token": string | string[];
1725
+ } | {
1726
+ type: string | string[];
1727
+ "poll-interval"?: string | string[] | undefined;
1728
+ } | {
1729
+ type: string | string[];
1730
+ "bot-token": string | string[];
1731
+ } | {
1732
+ type: string | string[];
1733
+ };
1734
+ };
1735
+ output: `added discord connector "${string}" to channel "${string}"`;
1736
+ outputFormat: "text";
1737
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1738
+ } | {
1739
+ input: {
1740
+ param: {
1741
+ channel: string;
1742
+ connector: string;
1743
+ };
1744
+ } & {
1745
+ query: {
1746
+ type: string | string[];
1747
+ "bot-token": string | string[];
1748
+ "app-token": string | string[];
1749
+ } | {
1750
+ type: string | string[];
1751
+ "poll-interval"?: string | string[] | undefined;
1752
+ } | {
1753
+ type: string | string[];
1754
+ "bot-token": string | string[];
1755
+ } | {
1756
+ type: string | string[];
1757
+ };
1758
+ };
1759
+ output: `added schedule connector "${string}" to channel "${string}"`;
1760
+ outputFormat: "text";
1761
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1762
+ };
1763
+ };
1764
+ } & {
1765
+ "/channels/:channel/connectors/remove": {
1766
+ $post: {
1767
+ input: {
1768
+ param: {
1769
+ channel: string;
1770
+ };
1771
+ };
1772
+ output: string;
1773
+ outputFormat: "text";
1774
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1775
+ };
1776
+ };
1777
+ } & {
1778
+ "/channels/:channel/connectors/remove/:connector": {
1779
+ $post: {
1780
+ input: {
1781
+ param: {
1782
+ channel: string;
1783
+ connector: string;
1784
+ };
1785
+ } & {
1786
+ query: Record<string, never>;
1787
+ };
1788
+ output: string;
1789
+ outputFormat: "text";
1790
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1791
+ } | {
1792
+ input: {
1793
+ param: {
1794
+ channel: string;
1795
+ connector: string;
1796
+ };
1797
+ } & {
1798
+ query: Record<string, never>;
1799
+ };
1800
+ output: `removed connector "${string}" from channel "${string}"`;
1801
+ outputFormat: "text";
1802
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1803
+ };
1804
+ };
1805
+ } & {
1806
+ "/channels/:channel/connectors/set": {
1807
+ $post: {
1808
+ input: {
1809
+ param: {
1810
+ channel: string;
1811
+ };
1812
+ };
1813
+ output: string;
1814
+ outputFormat: "text";
1815
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1816
+ };
1817
+ };
1818
+ } & {
1819
+ "/channels/:channel/connectors/set/:connector": {
1820
+ $post: {
1821
+ input: {
1822
+ param: {
1823
+ channel: string;
1824
+ connector: string;
1825
+ };
1826
+ } & {
1827
+ query: {
1828
+ [x: string]: string | string[];
1829
+ "bot-token"?: string | undefined;
1830
+ "app-token"?: string | undefined;
1831
+ "poll-interval"?: string | string[] | undefined;
1832
+ };
1833
+ };
1834
+ output: string;
1835
+ outputFormat: "text";
1836
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1837
+ } | {
1838
+ input: {
1839
+ param: {
1840
+ channel: string;
1841
+ connector: string;
1842
+ };
1843
+ } & {
1844
+ query: {
1845
+ [x: string]: string | string[];
1846
+ "bot-token"?: string | undefined;
1847
+ "app-token"?: string | undefined;
1848
+ "poll-interval"?: string | string[] | undefined;
1849
+ };
1850
+ };
1851
+ output: `updated connector "${string}" in channel "${string}"`;
1852
+ outputFormat: "text";
1853
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1854
+ };
1855
+ };
1856
+ } & {
1857
+ "/channels/:channel/connectors/rename/:connector/:newName": {
1858
+ $post: {
1859
+ input: {
1860
+ param: {
1861
+ channel: string;
1862
+ connector: string;
1863
+ newName: string;
1864
+ };
1865
+ } & {
1866
+ query: Record<string, never>;
1867
+ };
1868
+ output: string;
1869
+ outputFormat: "text";
1870
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1871
+ } | {
1872
+ input: {
1873
+ param: {
1874
+ channel: string;
1875
+ connector: string;
1876
+ newName: string;
1877
+ };
1878
+ } & {
1879
+ query: Record<string, never>;
1880
+ };
1881
+ output: `renamed connector "${string}" to "${string}"`;
1882
+ outputFormat: "text";
1883
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1884
+ };
1885
+ };
1886
+ } & {
1887
+ "/channels/:channel/connectors/:connector/rename/:newName": {
1888
+ $post: {
1889
+ input: {
1890
+ param: {
1891
+ channel: string;
1892
+ connector: string;
1893
+ newName: string;
1894
+ };
1895
+ } & {
1896
+ query: Record<string, never>;
1897
+ };
1898
+ output: string;
1899
+ outputFormat: "text";
1900
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1901
+ } | {
1902
+ input: {
1903
+ param: {
1904
+ channel: string;
1905
+ connector: string;
1906
+ newName: string;
1907
+ };
1908
+ } & {
1909
+ query: Record<string, never>;
1910
+ };
1911
+ output: `renamed connector "${string}" to "${string}"`;
1912
+ outputFormat: "text";
1913
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1914
+ };
1915
+ };
1916
+ } & {
1917
+ "/channels/:channel/connectors/rename": {
1918
+ $post: {
1919
+ input: {
1920
+ param: {
1921
+ channel: string;
1922
+ };
1923
+ };
1924
+ output: string;
1925
+ outputFormat: "text";
1926
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1927
+ };
1928
+ };
1929
+ } & {
1930
+ "/channels/:channel/connectors/:connector/rename": {
1931
+ $post: {
1932
+ input: {
1933
+ param: {
1934
+ channel: string;
1935
+ } & {
1936
+ connector: string;
1937
+ };
1938
+ };
1939
+ output: string;
1940
+ outputFormat: "text";
1941
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1942
+ };
1943
+ };
1944
+ } & {
1945
+ "/channels/:channel/connectors/:connector/request": {
1946
+ $post: {
1947
+ input: {
1948
+ param: {
1949
+ channel: string;
1950
+ connector: string;
1951
+ };
1952
+ } & {
1953
+ query: {
1954
+ [x: string]: string | string[];
1955
+ method: string | string[];
1956
+ };
1957
+ };
1958
+ output: string;
1959
+ outputFormat: "text";
1960
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1961
+ };
1962
+ };
1963
+ } & {
1964
+ "/channels/:channel/connectors/:connector": {
1965
+ $get: {
1966
+ input: {
1967
+ param: {
1968
+ channel: string;
1969
+ connector: string;
1970
+ };
1971
+ } & {
1972
+ query: Record<string, never>;
1973
+ };
1974
+ output: string;
1975
+ outputFormat: "text";
1976
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1977
+ };
1978
+ };
1979
+ } & {
1980
+ "/channels/:channel/connectors/:connector/schedules": {
1981
+ $get: {
1982
+ input: {
1983
+ param: {
1984
+ channel: string;
1985
+ connector: string;
1986
+ };
1987
+ } & {
1988
+ query: Record<string, never>;
1989
+ };
1990
+ output: string;
1991
+ outputFormat: "text";
1992
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
1993
+ };
1994
+ };
1995
+ } & {
1996
+ "/channels/:channel/connectors/:connector/schedules/add": {
1997
+ $post: {
1998
+ input: {
1999
+ param: {
2000
+ channel: string;
2001
+ } & {
2002
+ connector: string;
2003
+ };
2004
+ };
2005
+ output: string;
2006
+ outputFormat: "text";
2007
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2008
+ };
2009
+ };
2010
+ } & {
2011
+ "/channels/:channel/connectors/:connector/schedules/add/:id": {
2012
+ $post: {
2013
+ input: {
2014
+ param: {
2015
+ channel: string;
2016
+ connector: string;
2017
+ id: string;
2018
+ };
2019
+ } & {
2020
+ query: {
2021
+ cron: string | string[];
2022
+ prompt: string | string[];
2023
+ enabled?: string | string[] | undefined;
2024
+ "catchup-policy"?: "latest" | "all" | "skip" | undefined;
2025
+ };
2026
+ };
2027
+ output: string;
2028
+ outputFormat: "text";
2029
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2030
+ } | {
2031
+ input: {
2032
+ param: {
2033
+ channel: string;
2034
+ connector: string;
2035
+ id: string;
2036
+ };
2037
+ } & {
2038
+ query: {
2039
+ cron: string | string[];
2040
+ prompt: string | string[];
2041
+ enabled?: string | string[] | undefined;
2042
+ "catchup-policy"?: "latest" | "all" | "skip" | undefined;
2043
+ };
2044
+ };
2045
+ output: `added schedule entry "${string}"`;
2046
+ outputFormat: "text";
2047
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2048
+ };
2049
+ };
2050
+ } & {
2051
+ "/channels/:channel/connectors/:connector/schedules/remove": {
2052
+ $post: {
2053
+ input: {
2054
+ param: {
2055
+ channel: string;
2056
+ } & {
2057
+ connector: string;
2058
+ };
2059
+ };
2060
+ output: string;
2061
+ outputFormat: "text";
2062
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2063
+ };
2064
+ };
2065
+ } & {
2066
+ "/channels/:channel/connectors/:connector/schedules/remove/:id": {
2067
+ $post: {
2068
+ input: {
2069
+ param: {
2070
+ channel: string;
2071
+ connector: string;
2072
+ id: string;
2073
+ };
2074
+ } & {
2075
+ query: Record<string, never>;
2076
+ };
2077
+ output: string;
2078
+ outputFormat: "text";
2079
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2080
+ } | {
2081
+ input: {
2082
+ param: {
2083
+ channel: string;
2084
+ connector: string;
2085
+ id: string;
2086
+ };
2087
+ } & {
2088
+ query: Record<string, never>;
2089
+ };
2090
+ output: `removed schedule entry "${string}"`;
2091
+ outputFormat: "text";
2092
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2093
+ };
2094
+ };
2095
+ } & {
2096
+ "/profiles": {
2097
+ $get: {
2098
+ input: {
2099
+ query: Record<string, never>;
2100
+ };
2101
+ output: string;
2102
+ outputFormat: "text";
2103
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2104
+ };
2105
+ };
2106
+ } & {
2107
+ "/profiles/add": {
2108
+ $post: {
2109
+ input: {};
2110
+ output: string;
2111
+ outputFormat: "text";
2112
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2113
+ };
2114
+ };
2115
+ } & {
2116
+ "/profiles/add/:profile": {
2117
+ $post: {
2118
+ input: {
2119
+ param: {
2120
+ profile: string;
2121
+ };
2122
+ } & {
2123
+ query: {
2124
+ path: string | string[];
2125
+ "sub-agent": string | string[];
2126
+ channel: string | string[];
2127
+ brief?: string | string[] | undefined;
2128
+ };
2129
+ };
2130
+ output: string;
2131
+ outputFormat: "text";
2132
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2133
+ } | {
2134
+ input: {
2135
+ param: {
2136
+ profile: string;
2137
+ };
2138
+ } & {
2139
+ query: {
2140
+ path: string | string[];
2141
+ "sub-agent": string | string[];
2142
+ channel: string | string[];
2143
+ brief?: string | string[] | undefined;
2144
+ };
2145
+ };
2146
+ output: `added profile "${string}"`;
2147
+ outputFormat: "text";
2148
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2149
+ };
2150
+ };
2151
+ } & {
2152
+ "/profiles/set": {
2153
+ $post: {
2154
+ input: {};
2155
+ output: string;
2156
+ outputFormat: "text";
2157
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2158
+ };
2159
+ };
2160
+ } & {
2161
+ "/profiles/set/:profile": {
2162
+ $post: {
2163
+ input: {
2164
+ param: {
2165
+ profile: string;
2166
+ };
2167
+ } & {
2168
+ query: {
2169
+ path?: string | undefined;
2170
+ "sub-agent"?: string | undefined;
2171
+ channel?: string | undefined;
2172
+ brief?: string | string[] | undefined;
2173
+ "no-brief"?: string | string[] | undefined;
2174
+ };
2175
+ };
2176
+ output: string;
2177
+ outputFormat: "text";
2178
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2179
+ } | {
2180
+ input: {
2181
+ param: {
2182
+ profile: string;
2183
+ };
2184
+ } & {
2185
+ query: {
2186
+ path?: string | undefined;
2187
+ "sub-agent"?: string | undefined;
2188
+ channel?: string | undefined;
2189
+ brief?: string | string[] | undefined;
2190
+ "no-brief"?: string | string[] | undefined;
2191
+ };
2192
+ };
2193
+ output: `updated profile "${string}"`;
2194
+ outputFormat: "text";
2195
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2196
+ };
2197
+ };
2198
+ } & {
2199
+ "/profiles/remove": {
2200
+ $post: {
2201
+ input: {};
2202
+ output: string;
2203
+ outputFormat: "text";
2204
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2205
+ };
2206
+ };
2207
+ } & {
2208
+ "/profiles/remove/:profile": {
2209
+ $post: {
2210
+ input: {
2211
+ param: {
2212
+ profile: string;
2213
+ };
2214
+ } & {
2215
+ query: Record<string, never>;
2216
+ };
2217
+ output: string;
2218
+ outputFormat: "text";
2219
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2220
+ } | {
2221
+ input: {
2222
+ param: {
2223
+ profile: string;
2224
+ };
2225
+ } & {
2226
+ query: Record<string, never>;
2227
+ };
2228
+ output: `removed profile "${string}"`;
2229
+ outputFormat: "text";
2230
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2231
+ };
2232
+ };
2233
+ } & {
2234
+ "/profiles/rename/:profile/:newName": {
2235
+ $post: {
2236
+ input: {
2237
+ param: {
2238
+ profile: string;
2239
+ newName: string;
2240
+ };
2241
+ } & {
2242
+ query: Record<string, never>;
2243
+ };
2244
+ output: string;
2245
+ outputFormat: "text";
2246
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2247
+ } | {
2248
+ input: {
2249
+ param: {
2250
+ profile: string;
2251
+ newName: string;
2252
+ };
2253
+ } & {
2254
+ query: Record<string, never>;
2255
+ };
2256
+ output: `renamed profile "${string}" to "${string}"`;
2257
+ outputFormat: "text";
2258
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2259
+ };
2260
+ };
2261
+ } & {
2262
+ "/profiles/:profile/rename/:newName": {
2263
+ $post: {
2264
+ input: {
2265
+ param: {
2266
+ profile: string;
2267
+ newName: string;
2268
+ };
2269
+ } & {
2270
+ query: Record<string, never>;
2271
+ };
2272
+ output: string;
2273
+ outputFormat: "text";
2274
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2275
+ } | {
2276
+ input: {
2277
+ param: {
2278
+ profile: string;
2279
+ newName: string;
2280
+ };
2281
+ } & {
2282
+ query: Record<string, never>;
2283
+ };
2284
+ output: `renamed profile "${string}" to "${string}"`;
2285
+ outputFormat: "text";
2286
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2287
+ };
2288
+ };
2289
+ } & {
2290
+ "/profiles/rename": {
2291
+ $post: {
2292
+ input: {};
2293
+ output: string;
2294
+ outputFormat: "text";
2295
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2296
+ };
2297
+ };
2298
+ } & {
2299
+ "/profiles/:profile/rename": {
2300
+ $post: {
2301
+ input: {
2302
+ param: {
2303
+ profile: string;
2304
+ };
2305
+ };
2306
+ output: string;
2307
+ outputFormat: "text";
2308
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2309
+ };
2310
+ };
2311
+ } & {
2312
+ "/profiles/:profile/as-default": {
2313
+ $post: {
2314
+ input: {
2315
+ param: {
2316
+ profile: string;
2317
+ };
2318
+ } & {
2319
+ query: Record<string, never>;
2320
+ };
2321
+ output: string;
2322
+ outputFormat: "text";
2323
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2324
+ } | {
2325
+ input: {
2326
+ param: {
2327
+ profile: string;
2328
+ };
2329
+ } & {
2330
+ query: Record<string, never>;
2331
+ };
2332
+ output: `profile "${string}" is now the default`;
2333
+ outputFormat: "text";
2334
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2335
+ };
2336
+ };
2337
+ } & {
2338
+ "/profiles/:profile/run": {
2339
+ $get: {
2340
+ input: {
2341
+ param: {
2342
+ profile: string;
2343
+ };
2344
+ } & {
2345
+ query: {
2346
+ [x: string]: string | string[];
2347
+ };
2348
+ };
2349
+ output: string;
2350
+ outputFormat: "text";
2351
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2352
+ } | {
2353
+ input: {
2354
+ param: {
2355
+ profile: string;
2356
+ };
2357
+ } & {
2358
+ query: {
2359
+ [x: string]: string | string[];
2360
+ };
2361
+ };
2362
+ output: Promise<never>;
2363
+ outputFormat: "json";
2364
+ status: _$hono_utils_http_status0.StatusCode;
2365
+ };
2366
+ };
2367
+ } & {
2368
+ "/profiles/:profile": {
2369
+ $get: {
2370
+ input: {
2371
+ param: {
2372
+ profile: string;
2373
+ };
2374
+ } & {
2375
+ query: {
2376
+ [x: string]: string | string[];
2377
+ };
2378
+ };
2379
+ output: string;
2380
+ outputFormat: "text";
2381
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2382
+ } | {
2383
+ input: {
2384
+ param: {
2385
+ profile: string;
2386
+ };
2387
+ } & {
2388
+ query: {
2389
+ [x: string]: string | string[];
2390
+ };
2391
+ };
2392
+ output: Promise<never>;
2393
+ outputFormat: "json";
2394
+ status: _$hono_utils_http_status0.StatusCode;
2395
+ };
2396
+ };
2397
+ } & {
2398
+ "/gateway": {
2399
+ $get: {
2400
+ input: {};
2401
+ output: string;
2402
+ outputFormat: "text";
2403
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2404
+ } | {
2405
+ input: {};
2406
+ output: "funnel gateway: running (pid null) — health check failed" | `funnel gateway: running (pid ${number}) \u2014 health check failed`;
2407
+ outputFormat: "text";
2408
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2409
+ } | {
2410
+ input: {};
2411
+ output: `funnel gateway: running (pid null)
2412
+ port: ${number}
2413
+ clients: ${string}` | `funnel gateway: running (pid ${number})
2414
+ port: ${number}
2415
+ clients: ${string}`;
2416
+ outputFormat: "text";
2417
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2418
+ };
2419
+ };
2420
+ } & {
2421
+ "/gateway/status": {
2422
+ $get: {
2423
+ input: {};
2424
+ output: string;
2425
+ outputFormat: "text";
2426
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2427
+ } | {
2428
+ input: {};
2429
+ output: "funnel gateway: running (pid null) — health check failed" | `funnel gateway: running (pid ${number}) \u2014 health check failed`;
2430
+ outputFormat: "text";
2431
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2432
+ } | {
2433
+ input: {};
2434
+ output: `funnel gateway: running (pid null)
2435
+ port: ${number}
2436
+ clients: ${string}` | `funnel gateway: running (pid ${number})
2437
+ port: ${number}
2438
+ clients: ${string}`;
2439
+ outputFormat: "text";
2440
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2441
+ };
2442
+ };
2443
+ } & {
2444
+ "/gateway/start": {
2445
+ $get: {
2446
+ input: {
2447
+ query: {
2448
+ "no-caffeine"?: string | undefined;
2449
+ };
2450
+ };
2451
+ output: string;
2452
+ outputFormat: "text";
2453
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2454
+ } | {
2455
+ input: {
2456
+ query: {
2457
+ "no-caffeine"?: string | undefined;
2458
+ };
2459
+ };
2460
+ output: "funnel gateway: already running (pid null)" | `funnel gateway: already running (pid ${number})`;
2461
+ outputFormat: "text";
2462
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2463
+ } | {
2464
+ input: {
2465
+ query: {
2466
+ "no-caffeine"?: string | undefined;
2467
+ };
2468
+ };
2469
+ output: "funnel gateway: started";
2470
+ outputFormat: "text";
2471
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2472
+ };
2473
+ };
2474
+ } & {
2475
+ "/gateway/stop": {
2476
+ $get: {
2477
+ input: {
2478
+ query: Record<string, never>;
2479
+ };
2480
+ output: string;
2481
+ outputFormat: "text";
2482
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2483
+ } | {
2484
+ input: {
2485
+ query: Record<string, never>;
2486
+ };
2487
+ output: "funnel gateway: no running process";
2488
+ outputFormat: "text";
2489
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2490
+ } | {
2491
+ input: {
2492
+ query: Record<string, never>;
2493
+ };
2494
+ output: "funnel gateway: stopped";
2495
+ outputFormat: "text";
2496
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2497
+ };
2498
+ };
2499
+ } & {
2500
+ "/gateway/restart": {
2501
+ $get: {
2502
+ input: {
2503
+ query: {
2504
+ "no-caffeine"?: string | undefined;
2505
+ };
2506
+ };
2507
+ output: string;
2508
+ outputFormat: "text";
2509
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2510
+ };
2511
+ };
2512
+ } & {
2513
+ "/gateway/run": {
2514
+ $get: {
2515
+ input: {
2516
+ query: {
2517
+ "no-caffeine"?: string | undefined;
2518
+ };
2519
+ };
2520
+ output: string;
2521
+ outputFormat: "text";
2522
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2523
+ } | {
2524
+ input: {
2525
+ query: {
2526
+ "no-caffeine"?: string | undefined;
2527
+ };
2528
+ };
2529
+ output: Promise<never>;
2530
+ outputFormat: "json";
2531
+ status: _$hono_utils_http_status0.StatusCode;
2532
+ };
2533
+ };
2534
+ } & {
2535
+ "/gateway/logs": {
2536
+ $get: {
2537
+ input: {
2538
+ query: {
2539
+ n?: string | undefined;
2540
+ };
2541
+ };
2542
+ output: string;
2543
+ outputFormat: "text";
2544
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2545
+ } | {
2546
+ input: {
2547
+ query: {
2548
+ n?: string | undefined;
2549
+ };
2550
+ };
2551
+ output: "no logs";
2552
+ outputFormat: "text";
2553
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2554
+ };
2555
+ };
2556
+ } & {
2557
+ "/gateway/listeners": {
2558
+ $get: {
2559
+ input: {
2560
+ query: Record<string, never>;
2561
+ };
2562
+ output: string;
2563
+ outputFormat: "text";
2564
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2565
+ } | {
2566
+ input: {
2567
+ query: Record<string, never>;
2568
+ };
2569
+ output: "funnel gateway: no running listeners";
2570
+ outputFormat: "text";
2571
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2572
+ } | {
2573
+ input: {
2574
+ query: Record<string, never>;
2575
+ };
2576
+ output: `funnel gateway: running listeners
2577
+ ${string}`;
2578
+ outputFormat: "text";
2579
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2580
+ };
2581
+ };
2582
+ } & {
2583
+ "/status": {
2584
+ $get: {
2585
+ input: {
2586
+ query: Record<string, never>;
2587
+ };
2588
+ output: string;
2589
+ outputFormat: "text";
2590
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2591
+ };
2592
+ };
2593
+ } & {
2594
+ "/update": {
2595
+ $get: {
2596
+ input: {
2597
+ query: Record<string, never>;
2598
+ };
2599
+ output: string;
2600
+ outputFormat: "text";
2601
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2602
+ } | {
2603
+ input: {
2604
+ query: Record<string, never>;
2605
+ };
2606
+ output: "updated @interactive-inc/claude-funnel";
2607
+ outputFormat: "text";
2608
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2609
+ };
2610
+ };
2611
+ }, "/", "/update">;
2612
+ /** CLI Hono app wired to a default `new Funnel()`. For embedding with a custom Funnel use `createCliApp`. */
2613
+ declare const app: _$hono_hono_base0.HonoBase<Env, {
2614
+ "/claude": {
2615
+ $get: {
2616
+ input: {
2617
+ query: {
2618
+ [x: string]: string | string[];
2619
+ profile?: string | undefined;
2620
+ channel?: string | undefined;
2621
+ };
2622
+ };
2623
+ output: string;
2624
+ outputFormat: "text";
2625
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2626
+ } | {
2627
+ input: {
2628
+ query: {
2629
+ [x: string]: string | string[];
2630
+ profile?: string | undefined;
2631
+ channel?: string | undefined;
2632
+ };
2633
+ };
2634
+ output: "funnel claude — launch Claude Code\n\nusage:\n funnel claude launch the default profile (first in the list)\n funnel claude -p <name> launch a named profile\n funnel claude --profile <name> (long form)\n funnel claude --channel <name> raw launch (no profile, cwd = current dir)\n\noptions:\n -p, --profile profile name to launch\n --channel channel name (raw launch, ignored when --profile is given)\n\nAny other arguments are forwarded to the claude CLI.\nOn launch the FUNNEL_CHANNEL_ID env var is set and MCP connects to the gateway.";
2635
+ outputFormat: "text";
2636
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2637
+ };
2638
+ };
2639
+ } & {
2640
+ "/channels": {
2641
+ $get: {
2642
+ input: {
2643
+ query: Record<string, never>;
2644
+ };
2645
+ output: string;
2646
+ outputFormat: "text";
2647
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2648
+ };
2649
+ };
2650
+ } & {
2651
+ "/channels/add": {
2652
+ $post: {
2653
+ input: {};
2654
+ output: string;
2655
+ outputFormat: "text";
2656
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2657
+ };
2658
+ };
2659
+ } & {
2660
+ "/channels/add/:channel": {
2661
+ $post: {
2662
+ input: {
2663
+ param: {
2664
+ channel: string;
2665
+ };
2666
+ } & {
2667
+ query: {
2668
+ delivery?: "fanout" | "exclusive" | undefined;
2669
+ };
2670
+ };
2671
+ output: string;
2672
+ outputFormat: "text";
2673
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2674
+ } | {
2675
+ input: {
2676
+ param: {
2677
+ channel: string;
2678
+ };
2679
+ } & {
2680
+ query: {
2681
+ delivery?: "fanout" | "exclusive" | undefined;
2682
+ };
2683
+ };
2684
+ output: `added channel "${string}" (id: ${string})`;
2685
+ outputFormat: "text";
2686
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2687
+ };
2688
+ };
2689
+ } & {
2690
+ "/channels/remove": {
2691
+ $post: {
2692
+ input: {};
2693
+ output: string;
2694
+ outputFormat: "text";
2695
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2696
+ };
2697
+ };
2698
+ } & {
2699
+ "/channels/remove/:channel": {
2700
+ $post: {
2701
+ input: {
2702
+ param: {
2703
+ channel: string;
2704
+ };
2705
+ } & {
2706
+ query: Record<string, never>;
2707
+ };
2708
+ output: string;
2709
+ outputFormat: "text";
2710
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2711
+ } | {
2712
+ input: {
2713
+ param: {
2714
+ channel: string;
2715
+ };
2716
+ } & {
2717
+ query: Record<string, never>;
2718
+ };
2719
+ output: `removed channel "${string}"`;
2720
+ outputFormat: "text";
2721
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2722
+ };
2723
+ };
2724
+ } & {
2725
+ "/channels/rename/:channel/:newName": {
2726
+ $post: {
2727
+ input: {
2728
+ param: {
2729
+ channel: string;
2730
+ newName: string;
2731
+ };
2732
+ } & {
2733
+ query: Record<string, never>;
2734
+ };
2735
+ output: string;
2736
+ outputFormat: "text";
2737
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2738
+ } | {
2739
+ input: {
2740
+ param: {
2741
+ channel: string;
2742
+ newName: string;
2743
+ };
2744
+ } & {
2745
+ query: Record<string, never>;
2746
+ };
2747
+ output: `renamed channel "${string}" to "${string}"`;
2748
+ outputFormat: "text";
2749
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2750
+ };
2751
+ };
2752
+ } & {
2753
+ "/channels/:channel/rename/:newName": {
2754
+ $post: {
2755
+ input: {
2756
+ param: {
2757
+ channel: string;
2758
+ newName: string;
2759
+ };
2760
+ } & {
2761
+ query: Record<string, never>;
2762
+ };
2763
+ output: string;
2764
+ outputFormat: "text";
2765
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2766
+ } | {
2767
+ input: {
2768
+ param: {
2769
+ channel: string;
2770
+ newName: string;
2771
+ };
2772
+ } & {
2773
+ query: Record<string, never>;
2774
+ };
2775
+ output: `renamed channel "${string}" to "${string}"`;
2776
+ outputFormat: "text";
2777
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2778
+ };
2779
+ };
2780
+ } & {
2781
+ "/channels/rename": {
2782
+ $post: {
2783
+ input: {};
2784
+ output: string;
2785
+ outputFormat: "text";
2786
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2787
+ };
2788
+ };
2789
+ } & {
2790
+ "/channels/:channel/rename": {
2791
+ $post: {
2792
+ input: {
2793
+ param: {
2794
+ channel: string;
2795
+ };
2796
+ };
2797
+ output: string;
2798
+ outputFormat: "text";
2799
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2800
+ };
2801
+ };
2802
+ } & {
2803
+ "/channels/:channel/set/delivery/:mode": {
2804
+ $post: {
2805
+ input: {
2806
+ param: {
2807
+ channel: string;
2808
+ mode: "fanout" | "exclusive";
2809
+ };
2810
+ };
2811
+ output: string;
2812
+ outputFormat: "text";
2813
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2814
+ } | {
2815
+ input: {
2816
+ param: {
2817
+ channel: string;
2818
+ mode: "fanout" | "exclusive";
2819
+ };
2820
+ };
2821
+ output: `channel "${string}" delivery set to fanout` | `channel "${string}" delivery set to exclusive`;
2822
+ outputFormat: "text";
2823
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2824
+ };
2825
+ };
2826
+ } & {
2827
+ "/channels/publish": {
2828
+ $post: {
2829
+ input: {};
2830
+ output: string;
2831
+ outputFormat: "text";
2832
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2833
+ };
2834
+ };
2835
+ } & {
2836
+ "/channels/:channel/publish": {
2837
+ $post: {
2838
+ input: {
2839
+ param: {
2840
+ channel: string;
2841
+ };
2842
+ } & {
2843
+ query: {
2844
+ [x: string]: string | string[];
2845
+ content: string | string[];
2846
+ connector?: string | undefined;
2847
+ };
2848
+ };
2849
+ output: string;
2850
+ outputFormat: "text";
2851
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2852
+ } | {
2853
+ input: {
2854
+ param: {
2855
+ channel: string;
2856
+ };
2857
+ } & {
2858
+ query: {
2859
+ [x: string]: string | string[];
2860
+ content: string | string[];
2861
+ connector?: string | undefined;
2862
+ };
2863
+ };
2864
+ output: `published (offset=${number})`;
2865
+ outputFormat: "text";
2866
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2867
+ };
2868
+ };
2869
+ } & {
2870
+ "/channels/:channel": {
2871
+ $get: {
2872
+ input: {
2873
+ param: {
2874
+ channel: string;
2875
+ };
2876
+ } & {
2877
+ query: Record<string, never>;
2878
+ };
2879
+ output: string;
2880
+ outputFormat: "text";
2881
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2882
+ };
2883
+ };
2884
+ } & {
2885
+ "/channels/:channel/connectors": {
2886
+ $get: {
2887
+ input: {
2888
+ param: {
2889
+ channel: string;
2890
+ };
2891
+ } & {
2892
+ query: Record<string, never>;
2893
+ };
2894
+ output: string;
2895
+ outputFormat: "text";
2896
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2897
+ };
2898
+ };
2899
+ } & {
2900
+ "/channels/:channel/connectors/add": {
2901
+ $post: {
2902
+ input: {
2903
+ param: {
2904
+ channel: string;
2905
+ };
2906
+ };
2907
+ output: string;
2908
+ outputFormat: "text";
2909
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2910
+ };
2911
+ };
2912
+ } & {
2913
+ "/channels/:channel/connectors/add/:connector": {
2914
+ $post: {
2915
+ input: {
2916
+ param: {
2917
+ channel: string;
2918
+ connector: string;
2919
+ };
2920
+ } & {
2921
+ query: {
2922
+ type: string | string[];
2923
+ "bot-token": string | string[];
2924
+ "app-token": string | string[];
2925
+ } | {
2926
+ type: string | string[];
2927
+ "poll-interval"?: string | string[] | undefined;
2928
+ } | {
2929
+ type: string | string[];
2930
+ "bot-token": string | string[];
2931
+ } | {
2932
+ type: string | string[];
2933
+ };
2934
+ };
2935
+ output: string;
2936
+ outputFormat: "text";
2937
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2938
+ } | {
2939
+ input: {
2940
+ param: {
2941
+ channel: string;
2942
+ connector: string;
2943
+ };
2944
+ } & {
2945
+ query: {
2946
+ type: string | string[];
2947
+ "bot-token": string | string[];
2948
+ "app-token": string | string[];
2949
+ } | {
2950
+ type: string | string[];
2951
+ "poll-interval"?: string | string[] | undefined;
2952
+ } | {
2953
+ type: string | string[];
2954
+ "bot-token": string | string[];
2955
+ } | {
2956
+ type: string | string[];
2957
+ };
2958
+ };
2959
+ output: `added slack connector "${string}" to channel "${string}"`;
2960
+ outputFormat: "text";
2961
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2962
+ } | {
2963
+ input: {
2964
+ param: {
2965
+ channel: string;
2966
+ connector: string;
2967
+ };
2968
+ } & {
2969
+ query: {
2970
+ type: string | string[];
2971
+ "bot-token": string | string[];
2972
+ "app-token": string | string[];
2973
+ } | {
2974
+ type: string | string[];
2975
+ "poll-interval"?: string | string[] | undefined;
2976
+ } | {
2977
+ type: string | string[];
2978
+ "bot-token": string | string[];
2979
+ } | {
2980
+ type: string | string[];
2981
+ };
2982
+ };
2983
+ output: `added gh connector "${string}" to channel "${string}"`;
2984
+ outputFormat: "text";
2985
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
2986
+ } | {
2987
+ input: {
2988
+ param: {
2989
+ channel: string;
2990
+ connector: string;
2991
+ };
2992
+ } & {
2993
+ query: {
2994
+ type: string | string[];
2995
+ "bot-token": string | string[];
2996
+ "app-token": string | string[];
2997
+ } | {
2998
+ type: string | string[];
2999
+ "poll-interval"?: string | string[] | undefined;
3000
+ } | {
3001
+ type: string | string[];
3002
+ "bot-token": string | string[];
3003
+ } | {
3004
+ type: string | string[];
3005
+ };
3006
+ };
3007
+ output: `added discord connector "${string}" to channel "${string}"`;
3008
+ outputFormat: "text";
3009
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3010
+ } | {
3011
+ input: {
3012
+ param: {
3013
+ channel: string;
3014
+ connector: string;
3015
+ };
3016
+ } & {
3017
+ query: {
3018
+ type: string | string[];
3019
+ "bot-token": string | string[];
3020
+ "app-token": string | string[];
3021
+ } | {
3022
+ type: string | string[];
3023
+ "poll-interval"?: string | string[] | undefined;
3024
+ } | {
3025
+ type: string | string[];
3026
+ "bot-token": string | string[];
3027
+ } | {
3028
+ type: string | string[];
3029
+ };
3030
+ };
3031
+ output: `added schedule connector "${string}" to channel "${string}"`;
3032
+ outputFormat: "text";
3033
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3034
+ };
3035
+ };
3036
+ } & {
3037
+ "/channels/:channel/connectors/remove": {
3038
+ $post: {
3039
+ input: {
3040
+ param: {
3041
+ channel: string;
3042
+ };
3043
+ };
3044
+ output: string;
3045
+ outputFormat: "text";
3046
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3047
+ };
3048
+ };
3049
+ } & {
3050
+ "/channels/:channel/connectors/remove/:connector": {
3051
+ $post: {
3052
+ input: {
3053
+ param: {
3054
+ channel: string;
3055
+ connector: string;
3056
+ };
3057
+ } & {
3058
+ query: Record<string, never>;
3059
+ };
3060
+ output: string;
3061
+ outputFormat: "text";
3062
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3063
+ } | {
3064
+ input: {
3065
+ param: {
3066
+ channel: string;
3067
+ connector: string;
3068
+ };
3069
+ } & {
3070
+ query: Record<string, never>;
3071
+ };
3072
+ output: `removed connector "${string}" from channel "${string}"`;
3073
+ outputFormat: "text";
3074
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3075
+ };
3076
+ };
3077
+ } & {
3078
+ "/channels/:channel/connectors/set": {
3079
+ $post: {
3080
+ input: {
3081
+ param: {
3082
+ channel: string;
3083
+ };
3084
+ };
3085
+ output: string;
3086
+ outputFormat: "text";
3087
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3088
+ };
3089
+ };
3090
+ } & {
3091
+ "/channels/:channel/connectors/set/:connector": {
3092
+ $post: {
3093
+ input: {
3094
+ param: {
3095
+ channel: string;
3096
+ connector: string;
3097
+ };
3098
+ } & {
3099
+ query: {
3100
+ [x: string]: string | string[];
3101
+ "bot-token"?: string | undefined;
3102
+ "app-token"?: string | undefined;
3103
+ "poll-interval"?: string | string[] | undefined;
3104
+ };
3105
+ };
3106
+ output: string;
3107
+ outputFormat: "text";
3108
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3109
+ } | {
3110
+ input: {
3111
+ param: {
3112
+ channel: string;
3113
+ connector: string;
3114
+ };
3115
+ } & {
3116
+ query: {
3117
+ [x: string]: string | string[];
3118
+ "bot-token"?: string | undefined;
3119
+ "app-token"?: string | undefined;
3120
+ "poll-interval"?: string | string[] | undefined;
3121
+ };
3122
+ };
3123
+ output: `updated connector "${string}" in channel "${string}"`;
3124
+ outputFormat: "text";
3125
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3126
+ };
3127
+ };
3128
+ } & {
3129
+ "/channels/:channel/connectors/rename/:connector/:newName": {
3130
+ $post: {
3131
+ input: {
3132
+ param: {
3133
+ channel: string;
3134
+ connector: string;
3135
+ newName: string;
3136
+ };
3137
+ } & {
3138
+ query: Record<string, never>;
3139
+ };
3140
+ output: string;
3141
+ outputFormat: "text";
3142
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3143
+ } | {
3144
+ input: {
3145
+ param: {
3146
+ channel: string;
3147
+ connector: string;
3148
+ newName: string;
3149
+ };
3150
+ } & {
3151
+ query: Record<string, never>;
3152
+ };
3153
+ output: `renamed connector "${string}" to "${string}"`;
3154
+ outputFormat: "text";
3155
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3156
+ };
3157
+ };
3158
+ } & {
3159
+ "/channels/:channel/connectors/:connector/rename/:newName": {
3160
+ $post: {
3161
+ input: {
3162
+ param: {
3163
+ channel: string;
3164
+ connector: string;
3165
+ newName: string;
3166
+ };
3167
+ } & {
3168
+ query: Record<string, never>;
3169
+ };
3170
+ output: string;
3171
+ outputFormat: "text";
3172
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3173
+ } | {
3174
+ input: {
3175
+ param: {
3176
+ channel: string;
3177
+ connector: string;
3178
+ newName: string;
3179
+ };
3180
+ } & {
3181
+ query: Record<string, never>;
3182
+ };
3183
+ output: `renamed connector "${string}" to "${string}"`;
3184
+ outputFormat: "text";
3185
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3186
+ };
3187
+ };
3188
+ } & {
3189
+ "/channels/:channel/connectors/rename": {
3190
+ $post: {
3191
+ input: {
3192
+ param: {
3193
+ channel: string;
3194
+ };
3195
+ };
3196
+ output: string;
3197
+ outputFormat: "text";
3198
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3199
+ };
3200
+ };
3201
+ } & {
3202
+ "/channels/:channel/connectors/:connector/rename": {
3203
+ $post: {
3204
+ input: {
3205
+ param: {
3206
+ channel: string;
3207
+ } & {
3208
+ connector: string;
3209
+ };
3210
+ };
3211
+ output: string;
3212
+ outputFormat: "text";
3213
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3214
+ };
3215
+ };
3216
+ } & {
3217
+ "/channels/:channel/connectors/:connector/request": {
3218
+ $post: {
3219
+ input: {
3220
+ param: {
3221
+ channel: string;
3222
+ connector: string;
3223
+ };
3224
+ } & {
3225
+ query: {
3226
+ [x: string]: string | string[];
3227
+ method: string | string[];
3228
+ };
3229
+ };
3230
+ output: string;
3231
+ outputFormat: "text";
3232
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3233
+ };
3234
+ };
3235
+ } & {
3236
+ "/channels/:channel/connectors/:connector": {
3237
+ $get: {
3238
+ input: {
3239
+ param: {
3240
+ channel: string;
3241
+ connector: string;
3242
+ };
3243
+ } & {
3244
+ query: Record<string, never>;
3245
+ };
3246
+ output: string;
3247
+ outputFormat: "text";
3248
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3249
+ };
3250
+ };
3251
+ } & {
3252
+ "/channels/:channel/connectors/:connector/schedules": {
3253
+ $get: {
3254
+ input: {
3255
+ param: {
3256
+ channel: string;
3257
+ connector: string;
3258
+ };
3259
+ } & {
3260
+ query: Record<string, never>;
3261
+ };
3262
+ output: string;
3263
+ outputFormat: "text";
3264
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3265
+ };
3266
+ };
3267
+ } & {
3268
+ "/channels/:channel/connectors/:connector/schedules/add": {
3269
+ $post: {
3270
+ input: {
3271
+ param: {
3272
+ channel: string;
3273
+ } & {
3274
+ connector: string;
3275
+ };
3276
+ };
3277
+ output: string;
3278
+ outputFormat: "text";
3279
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3280
+ };
3281
+ };
3282
+ } & {
3283
+ "/channels/:channel/connectors/:connector/schedules/add/:id": {
3284
+ $post: {
3285
+ input: {
3286
+ param: {
3287
+ channel: string;
3288
+ connector: string;
3289
+ id: string;
3290
+ };
3291
+ } & {
3292
+ query: {
3293
+ cron: string | string[];
3294
+ prompt: string | string[];
3295
+ enabled?: string | string[] | undefined;
3296
+ "catchup-policy"?: "latest" | "all" | "skip" | undefined;
3297
+ };
3298
+ };
3299
+ output: string;
3300
+ outputFormat: "text";
3301
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3302
+ } | {
3303
+ input: {
3304
+ param: {
3305
+ channel: string;
3306
+ connector: string;
3307
+ id: string;
3308
+ };
3309
+ } & {
3310
+ query: {
3311
+ cron: string | string[];
3312
+ prompt: string | string[];
3313
+ enabled?: string | string[] | undefined;
3314
+ "catchup-policy"?: "latest" | "all" | "skip" | undefined;
3315
+ };
3316
+ };
3317
+ output: `added schedule entry "${string}"`;
3318
+ outputFormat: "text";
3319
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3320
+ };
3321
+ };
3322
+ } & {
3323
+ "/channels/:channel/connectors/:connector/schedules/remove": {
3324
+ $post: {
3325
+ input: {
3326
+ param: {
3327
+ channel: string;
3328
+ } & {
3329
+ connector: string;
3330
+ };
3331
+ };
3332
+ output: string;
3333
+ outputFormat: "text";
3334
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3335
+ };
3336
+ };
3337
+ } & {
3338
+ "/channels/:channel/connectors/:connector/schedules/remove/:id": {
3339
+ $post: {
3340
+ input: {
3341
+ param: {
3342
+ channel: string;
3343
+ connector: string;
3344
+ id: string;
3345
+ };
3346
+ } & {
3347
+ query: Record<string, never>;
3348
+ };
3349
+ output: string;
3350
+ outputFormat: "text";
3351
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3352
+ } | {
3353
+ input: {
3354
+ param: {
3355
+ channel: string;
3356
+ connector: string;
3357
+ id: string;
3358
+ };
3359
+ } & {
3360
+ query: Record<string, never>;
3361
+ };
3362
+ output: `removed schedule entry "${string}"`;
3363
+ outputFormat: "text";
3364
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3365
+ };
3366
+ };
3367
+ } & {
3368
+ "/profiles": {
3369
+ $get: {
3370
+ input: {
3371
+ query: Record<string, never>;
3372
+ };
3373
+ output: string;
3374
+ outputFormat: "text";
3375
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3376
+ };
3377
+ };
3378
+ } & {
3379
+ "/profiles/add": {
3380
+ $post: {
3381
+ input: {};
3382
+ output: string;
3383
+ outputFormat: "text";
3384
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3385
+ };
3386
+ };
3387
+ } & {
3388
+ "/profiles/add/:profile": {
3389
+ $post: {
3390
+ input: {
3391
+ param: {
3392
+ profile: string;
3393
+ };
3394
+ } & {
3395
+ query: {
3396
+ path: string | string[];
3397
+ "sub-agent": string | string[];
3398
+ channel: string | string[];
3399
+ brief?: string | string[] | undefined;
3400
+ };
3401
+ };
3402
+ output: string;
3403
+ outputFormat: "text";
3404
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3405
+ } | {
3406
+ input: {
3407
+ param: {
3408
+ profile: string;
3409
+ };
3410
+ } & {
3411
+ query: {
3412
+ path: string | string[];
3413
+ "sub-agent": string | string[];
3414
+ channel: string | string[];
3415
+ brief?: string | string[] | undefined;
3416
+ };
3417
+ };
3418
+ output: `added profile "${string}"`;
3419
+ outputFormat: "text";
3420
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3421
+ };
3422
+ };
3423
+ } & {
3424
+ "/profiles/set": {
3425
+ $post: {
3426
+ input: {};
3427
+ output: string;
3428
+ outputFormat: "text";
3429
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3430
+ };
3431
+ };
3432
+ } & {
3433
+ "/profiles/set/:profile": {
3434
+ $post: {
3435
+ input: {
3436
+ param: {
3437
+ profile: string;
3438
+ };
3439
+ } & {
3440
+ query: {
3441
+ path?: string | undefined;
3442
+ "sub-agent"?: string | undefined;
3443
+ channel?: string | undefined;
3444
+ brief?: string | string[] | undefined;
3445
+ "no-brief"?: string | string[] | undefined;
3446
+ };
3447
+ };
3448
+ output: string;
3449
+ outputFormat: "text";
3450
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3451
+ } | {
3452
+ input: {
3453
+ param: {
3454
+ profile: string;
3455
+ };
3456
+ } & {
3457
+ query: {
3458
+ path?: string | undefined;
3459
+ "sub-agent"?: string | undefined;
3460
+ channel?: string | undefined;
3461
+ brief?: string | string[] | undefined;
3462
+ "no-brief"?: string | string[] | undefined;
3463
+ };
3464
+ };
3465
+ output: `updated profile "${string}"`;
3466
+ outputFormat: "text";
3467
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3468
+ };
3469
+ };
3470
+ } & {
3471
+ "/profiles/remove": {
3472
+ $post: {
3473
+ input: {};
3474
+ output: string;
3475
+ outputFormat: "text";
3476
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3477
+ };
3478
+ };
3479
+ } & {
3480
+ "/profiles/remove/:profile": {
3481
+ $post: {
3482
+ input: {
3483
+ param: {
3484
+ profile: string;
3485
+ };
3486
+ } & {
3487
+ query: Record<string, never>;
3488
+ };
3489
+ output: string;
3490
+ outputFormat: "text";
3491
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3492
+ } | {
3493
+ input: {
3494
+ param: {
3495
+ profile: string;
3496
+ };
3497
+ } & {
3498
+ query: Record<string, never>;
3499
+ };
3500
+ output: `removed profile "${string}"`;
3501
+ outputFormat: "text";
3502
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3503
+ };
3504
+ };
3505
+ } & {
3506
+ "/profiles/rename/:profile/:newName": {
3507
+ $post: {
3508
+ input: {
3509
+ param: {
3510
+ profile: string;
3511
+ newName: string;
3512
+ };
3513
+ } & {
3514
+ query: Record<string, never>;
3515
+ };
3516
+ output: string;
3517
+ outputFormat: "text";
3518
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3519
+ } | {
3520
+ input: {
3521
+ param: {
3522
+ profile: string;
3523
+ newName: string;
3524
+ };
3525
+ } & {
3526
+ query: Record<string, never>;
3527
+ };
3528
+ output: `renamed profile "${string}" to "${string}"`;
3529
+ outputFormat: "text";
3530
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3531
+ };
3532
+ };
3533
+ } & {
3534
+ "/profiles/:profile/rename/:newName": {
3535
+ $post: {
3536
+ input: {
3537
+ param: {
3538
+ profile: string;
3539
+ newName: string;
3540
+ };
3541
+ } & {
3542
+ query: Record<string, never>;
3543
+ };
3544
+ output: string;
3545
+ outputFormat: "text";
3546
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3547
+ } | {
3548
+ input: {
3549
+ param: {
3550
+ profile: string;
3551
+ newName: string;
3552
+ };
3553
+ } & {
3554
+ query: Record<string, never>;
3555
+ };
3556
+ output: `renamed profile "${string}" to "${string}"`;
3557
+ outputFormat: "text";
3558
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3559
+ };
3560
+ };
3561
+ } & {
3562
+ "/profiles/rename": {
3563
+ $post: {
3564
+ input: {};
3565
+ output: string;
3566
+ outputFormat: "text";
3567
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3568
+ };
3569
+ };
3570
+ } & {
3571
+ "/profiles/:profile/rename": {
3572
+ $post: {
3573
+ input: {
3574
+ param: {
3575
+ profile: string;
3576
+ };
3577
+ };
3578
+ output: string;
3579
+ outputFormat: "text";
3580
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3581
+ };
3582
+ };
3583
+ } & {
3584
+ "/profiles/:profile/as-default": {
3585
+ $post: {
3586
+ input: {
3587
+ param: {
3588
+ profile: string;
3589
+ };
3590
+ } & {
3591
+ query: Record<string, never>;
3592
+ };
3593
+ output: string;
3594
+ outputFormat: "text";
3595
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3596
+ } | {
3597
+ input: {
3598
+ param: {
3599
+ profile: string;
3600
+ };
3601
+ } & {
3602
+ query: Record<string, never>;
3603
+ };
3604
+ output: `profile "${string}" is now the default`;
3605
+ outputFormat: "text";
3606
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3607
+ };
3608
+ };
3609
+ } & {
3610
+ "/profiles/:profile/run": {
3611
+ $get: {
3612
+ input: {
3613
+ param: {
3614
+ profile: string;
3615
+ };
3616
+ } & {
3617
+ query: {
3618
+ [x: string]: string | string[];
3619
+ };
3620
+ };
3621
+ output: string;
3622
+ outputFormat: "text";
3623
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3624
+ } | {
3625
+ input: {
3626
+ param: {
3627
+ profile: string;
3628
+ };
3629
+ } & {
3630
+ query: {
3631
+ [x: string]: string | string[];
3632
+ };
3633
+ };
3634
+ output: Promise<never>;
3635
+ outputFormat: "json";
3636
+ status: _$hono_utils_http_status0.StatusCode;
3637
+ };
3638
+ };
3639
+ } & {
3640
+ "/profiles/:profile": {
3641
+ $get: {
3642
+ input: {
3643
+ param: {
3644
+ profile: string;
3645
+ };
3646
+ } & {
3647
+ query: {
3648
+ [x: string]: string | string[];
3649
+ };
3650
+ };
3651
+ output: string;
3652
+ outputFormat: "text";
3653
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3654
+ } | {
3655
+ input: {
3656
+ param: {
3657
+ profile: string;
3658
+ };
3659
+ } & {
3660
+ query: {
3661
+ [x: string]: string | string[];
3662
+ };
3663
+ };
3664
+ output: Promise<never>;
3665
+ outputFormat: "json";
3666
+ status: _$hono_utils_http_status0.StatusCode;
3667
+ };
3668
+ };
3669
+ } & {
3670
+ "/gateway": {
3671
+ $get: {
3672
+ input: {};
3673
+ output: string;
3674
+ outputFormat: "text";
3675
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3676
+ } | {
3677
+ input: {};
3678
+ output: "funnel gateway: running (pid null) — health check failed" | `funnel gateway: running (pid ${number}) \u2014 health check failed`;
3679
+ outputFormat: "text";
3680
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3681
+ } | {
3682
+ input: {};
3683
+ output: `funnel gateway: running (pid null)
3684
+ port: ${number}
3685
+ clients: ${string}` | `funnel gateway: running (pid ${number})
3686
+ port: ${number}
3687
+ clients: ${string}`;
3688
+ outputFormat: "text";
3689
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3690
+ };
3691
+ };
3692
+ } & {
3693
+ "/gateway/status": {
3694
+ $get: {
3695
+ input: {};
3696
+ output: string;
3697
+ outputFormat: "text";
3698
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3699
+ } | {
3700
+ input: {};
3701
+ output: "funnel gateway: running (pid null) — health check failed" | `funnel gateway: running (pid ${number}) \u2014 health check failed`;
3702
+ outputFormat: "text";
3703
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3704
+ } | {
3705
+ input: {};
3706
+ output: `funnel gateway: running (pid null)
3707
+ port: ${number}
3708
+ clients: ${string}` | `funnel gateway: running (pid ${number})
3709
+ port: ${number}
3710
+ clients: ${string}`;
3711
+ outputFormat: "text";
3712
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3713
+ };
3714
+ };
3715
+ } & {
3716
+ "/gateway/start": {
3717
+ $get: {
3718
+ input: {
3719
+ query: {
3720
+ "no-caffeine"?: string | undefined;
3721
+ };
3722
+ };
3723
+ output: string;
3724
+ outputFormat: "text";
3725
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3726
+ } | {
3727
+ input: {
3728
+ query: {
3729
+ "no-caffeine"?: string | undefined;
3730
+ };
3731
+ };
3732
+ output: "funnel gateway: already running (pid null)" | `funnel gateway: already running (pid ${number})`;
3733
+ outputFormat: "text";
3734
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3735
+ } | {
3736
+ input: {
3737
+ query: {
3738
+ "no-caffeine"?: string | undefined;
3739
+ };
3740
+ };
3741
+ output: "funnel gateway: started";
3742
+ outputFormat: "text";
3743
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3744
+ };
3745
+ };
3746
+ } & {
3747
+ "/gateway/stop": {
3748
+ $get: {
3749
+ input: {
3750
+ query: Record<string, never>;
3751
+ };
3752
+ output: string;
3753
+ outputFormat: "text";
3754
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3755
+ } | {
3756
+ input: {
3757
+ query: Record<string, never>;
3758
+ };
3759
+ output: "funnel gateway: no running process";
3760
+ outputFormat: "text";
3761
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3762
+ } | {
3763
+ input: {
3764
+ query: Record<string, never>;
3765
+ };
3766
+ output: "funnel gateway: stopped";
3767
+ outputFormat: "text";
3768
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3769
+ };
3770
+ };
3771
+ } & {
3772
+ "/gateway/restart": {
3773
+ $get: {
3774
+ input: {
3775
+ query: {
3776
+ "no-caffeine"?: string | undefined;
3777
+ };
3778
+ };
3779
+ output: string;
3780
+ outputFormat: "text";
3781
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3782
+ };
3783
+ };
3784
+ } & {
3785
+ "/gateway/run": {
3786
+ $get: {
3787
+ input: {
3788
+ query: {
3789
+ "no-caffeine"?: string | undefined;
3790
+ };
3791
+ };
3792
+ output: string;
3793
+ outputFormat: "text";
3794
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3795
+ } | {
3796
+ input: {
3797
+ query: {
3798
+ "no-caffeine"?: string | undefined;
3799
+ };
3800
+ };
3801
+ output: Promise<never>;
3802
+ outputFormat: "json";
3803
+ status: _$hono_utils_http_status0.StatusCode;
3804
+ };
3805
+ };
3806
+ } & {
3807
+ "/gateway/logs": {
3808
+ $get: {
3809
+ input: {
3810
+ query: {
3811
+ n?: string | undefined;
3812
+ };
3813
+ };
3814
+ output: string;
3815
+ outputFormat: "text";
3816
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3817
+ } | {
3818
+ input: {
3819
+ query: {
3820
+ n?: string | undefined;
3821
+ };
3822
+ };
3823
+ output: "no logs";
3824
+ outputFormat: "text";
3825
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3826
+ };
3827
+ };
3828
+ } & {
3829
+ "/gateway/listeners": {
3830
+ $get: {
3831
+ input: {
3832
+ query: Record<string, never>;
3833
+ };
3834
+ output: string;
3835
+ outputFormat: "text";
3836
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3837
+ } | {
3838
+ input: {
3839
+ query: Record<string, never>;
3840
+ };
3841
+ output: "funnel gateway: no running listeners";
3842
+ outputFormat: "text";
3843
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3844
+ } | {
3845
+ input: {
3846
+ query: Record<string, never>;
3847
+ };
3848
+ output: `funnel gateway: running listeners
3849
+ ${string}`;
3850
+ outputFormat: "text";
3851
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3852
+ };
3853
+ };
3854
+ } & {
3855
+ "/status": {
3856
+ $get: {
3857
+ input: {
3858
+ query: Record<string, never>;
3859
+ };
3860
+ output: string;
3861
+ outputFormat: "text";
3862
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3863
+ };
3864
+ };
3865
+ } & {
3866
+ "/update": {
3867
+ $get: {
3868
+ input: {
3869
+ query: Record<string, never>;
3870
+ };
3871
+ output: string;
3872
+ outputFormat: "text";
3873
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3874
+ } | {
3875
+ input: {
3876
+ query: Record<string, never>;
3877
+ };
3878
+ output: "updated @interactive-inc/claude-funnel";
3879
+ outputFormat: "text";
3880
+ status: _$hono_utils_http_status0.ContentfulStatusCode;
3881
+ };
3882
+ };
3883
+ }, "/", "/update">;
3884
+ //#endregion
3885
+ //#region lib/tui/tui.d.ts
3886
+ declare function launchTui(funnel: Funnel): Promise<void>;
3887
+ //#endregion
3888
+ export { AttachOptions, BroadcastEvent, BroadcastSubscriber, ChannelConfig, ChannelConnectorView, ChannelDeliveryMode, ChannelServerOptions, ConnectorConfig, ConnectorType, DEFAULT_GATEWAY_TOKEN_PATH, DetachOptions, DiscordConnectorConfig, Env, FUNNEL_DIR, FUNNEL_MCP_COMMAND, FUNNEL_MCP_NAME, FileStat, Funnel, FunnelBroadcaster, FunnelChannelPublisher, FunnelChannels, FunnelClaude, FunnelClock, FunnelConnectorFactory, FunnelConnectorListener, FunnelEvent, FunnelEventStore, FunnelFileSystem, FunnelGateway, FunnelGatewayServer, FunnelGatewayToken, FunnelIdGenerator, FunnelListenerSupervisor, FunnelListenersClient, FunnelLogger, FunnelMcp, FunnelProcessRunner, FunnelProfiles, FunnelSettingsReader, FunnelSettingsStore, GhConnectorConfig, LaunchOptions, ListListenersResult, ListenerEntry, ListenerOpResult, LogEntry, MemoryFunnelClock, MemoryFunnelFileSystem, MemoryFunnelIdGenerator, MemoryFunnelLogger, MemoryFunnelProcessRunner, MemoryProcessCall, MemoryProcessHandler, MemoryProcessResponse, MemoryProcessSyncHandler, MockFunnelSettingsReader, NodeFunnelClock, NodeFunnelFileSystem, NodeFunnelIdGenerator, NodeFunnelLogger, NodeFunnelProcessRunner, NoopFunnelLogger, NotifyFn, ProfileConfig, PublishRequest, PublishResponse, PublishResult, ReplayableEvent, RunOptions, RunResult, SETTINGS_PATH, SETTINGS_VERSION, ScheduleCatchupPolicy, type ScheduleConnectorConfig, ScheduleEntry, Settings, SlackConnectorConfig, channelConfigSchema, channelDeliveryModeSchema, app as cliApp, connectorConfigSchema, createCliApp, createSettings, discordConnectorSchema, factory, funnelEventSchema, ghConnectorSchema, launchTui, profileConfigSchema, publishRequestSchema, publishResponseSchema, queryToCliArgs, scheduleCatchupPolicySchema, scheduleConnectorSchema, scheduleEntrySchema, settingsSchema, slackConnectorSchema, startChannelServer, toRequest };