@interactive-inc/claude-funnel 0.8.1 → 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 (175) hide show
  1. package/README.md +179 -80
  2. package/dist/bin.js +724 -656
  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 +233 -183
  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 -36
  20. package/dist/index.js +6206 -3485
  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 +15 -0
  54. package/package.json +34 -23
  55. package/dist/cli/factory.d.ts +0 -7
  56. package/dist/cli/router/query-to-cli-args.d.ts +0 -1
  57. package/dist/cli/router/to-request.d.ts +0 -5
  58. package/dist/cli/router/validator.d.ts +0 -5
  59. package/dist/cli/routes/channels.$channel.connectors.$connector.d.ts +0 -42
  60. package/dist/cli/routes/channels.$channel.connectors.$connector.rename.$newName.d.ts +0 -46
  61. package/dist/cli/routes/channels.$channel.connectors.$connector.request.d.ts +0 -54
  62. package/dist/cli/routes/channels.$channel.connectors.$connector.schedules.add.$id.d.ts +0 -66
  63. package/dist/cli/routes/channels.$channel.connectors.$connector.schedules.d.ts +0 -42
  64. package/dist/cli/routes/channels.$channel.connectors.$connector.schedules.remove.$id.d.ts +0 -46
  65. package/dist/cli/routes/channels.$channel.connectors.add.$connector.d.ts +0 -90
  66. package/dist/cli/routes/channels.$channel.connectors.d.ts +0 -38
  67. package/dist/cli/routes/channels.$channel.connectors.remove.$connector.d.ts +0 -42
  68. package/dist/cli/routes/channels.$channel.connectors.set.$connector.d.ts +0 -62
  69. package/dist/cli/routes/channels.$channel.d.ts +0 -38
  70. package/dist/cli/routes/channels.$channel.rename.$newName.d.ts +0 -42
  71. package/dist/cli/routes/channels.$channel.set.delivery.$mode.d.ts +0 -28
  72. package/dist/cli/routes/channels.add.$channel.d.ts +0 -46
  73. package/dist/cli/routes/channels.d.ts +0 -16
  74. package/dist/cli/routes/channels.remove.$channel.d.ts +0 -38
  75. package/dist/cli/routes/claude.d.ts +0 -32
  76. package/dist/cli/routes/gateway.d.ts +0 -20
  77. package/dist/cli/routes/gateway.listeners.d.ts +0 -17
  78. package/dist/cli/routes/gateway.logs.d.ts +0 -24
  79. package/dist/cli/routes/gateway.restart.d.ts +0 -24
  80. package/dist/cli/routes/gateway.run.d.ts +0 -24
  81. package/dist/cli/routes/gateway.start.d.ts +0 -24
  82. package/dist/cli/routes/gateway.status.d.ts +0 -13
  83. package/dist/cli/routes/gateway.stop.d.ts +0 -16
  84. package/dist/cli/routes/index.d.ts +0 -1222
  85. package/dist/cli/routes/profiles.$profile.as-default.d.ts +0 -38
  86. package/dist/cli/routes/profiles.$profile.rename.$newName.d.ts +0 -42
  87. package/dist/cli/routes/profiles.$profile.run.d.ts +0 -46
  88. package/dist/cli/routes/profiles.add.$profile.d.ts +0 -54
  89. package/dist/cli/routes/profiles.d.ts +0 -16
  90. package/dist/cli/routes/profiles.remove.$profile.d.ts +0 -38
  91. package/dist/cli/routes/profiles.set.$profile.d.ts +0 -54
  92. package/dist/cli/routes/status.d.ts +0 -16
  93. package/dist/cli/routes/update.d.ts +0 -16
  94. package/dist/connectors/connector-adapter.d.ts +0 -8
  95. package/dist/connectors/connector-config-schema.d.ts +0 -43
  96. package/dist/connectors/connector-factory.d.ts +0 -32
  97. package/dist/connectors/connector-listener.d.ts +0 -17
  98. package/dist/connectors/discord-adapter.d.ts +0 -14
  99. package/dist/connectors/discord-connector-schema.d.ts +0 -10
  100. package/dist/connectors/discord-event-processor.d.ts +0 -26
  101. package/dist/connectors/discord-listener.d.ts +0 -17
  102. package/dist/connectors/gh-adapter.d.ts +0 -11
  103. package/dist/connectors/gh-connector-schema.d.ts +0 -10
  104. package/dist/connectors/gh-listener.d.ts +0 -26
  105. package/dist/connectors/match-cron.d.ts +0 -1
  106. package/dist/connectors/schedule-connector-schema.d.ts +0 -45
  107. package/dist/connectors/schedule-listener.d.ts +0 -30
  108. package/dist/connectors/schedule-state-store.d.ts +0 -19
  109. package/dist/connectors/slack-adapter.d.ts +0 -15
  110. package/dist/connectors/slack-connector-schema.d.ts +0 -11
  111. package/dist/connectors/slack-event-processor.d.ts +0 -27
  112. package/dist/connectors/slack-listener.d.ts +0 -17
  113. package/dist/engine/channels/channels.d.ts +0 -106
  114. package/dist/engine/claude/claude.d.ts +0 -49
  115. package/dist/engine/claude/gateway-controller.d.ts +0 -6
  116. package/dist/engine/fs/file-system.d.ts +0 -24
  117. package/dist/engine/fs/memory-file-system.d.ts +0 -31
  118. package/dist/engine/fs/node-file-system.d.ts +0 -15
  119. package/dist/engine/http/http-client.d.ts +0 -15
  120. package/dist/engine/http/memory-http-client.d.ts +0 -12
  121. package/dist/engine/http/node-http-client.d.ts +0 -5
  122. package/dist/engine/id/id-generator.d.ts +0 -7
  123. package/dist/engine/id/memory-id-generator.d.ts +0 -11
  124. package/dist/engine/id/node-id-generator.d.ts +0 -4
  125. package/dist/engine/logger/logger.d.ts +0 -11
  126. package/dist/engine/logger/memory-logger.d.ts +0 -14
  127. package/dist/engine/logger/node-logger.d.ts +0 -15
  128. package/dist/engine/logger/noop-logger.d.ts +0 -7
  129. package/dist/engine/mcp/channel-server.d.ts +0 -1
  130. package/dist/engine/mcp/mcp.d.ts +0 -22
  131. package/dist/engine/process/memory-process-runner.d.ts +0 -43
  132. package/dist/engine/process/node-process-runner.d.ts +0 -9
  133. package/dist/engine/process/process-runner.d.ts +0 -29
  134. package/dist/engine/profiles/profile-channel-checker.d.ts +0 -7
  135. package/dist/engine/profiles/profiles.d.ts +0 -31
  136. package/dist/engine/settings/mock-settings-reader.d.ts +0 -9
  137. package/dist/engine/settings/settings-reader.d.ts +0 -5
  138. package/dist/engine/settings/settings-schema.d.ts +0 -132
  139. package/dist/engine/settings/settings-store.d.ts +0 -18
  140. package/dist/engine/time/clock.d.ts +0 -9
  141. package/dist/engine/time/memory-clock.d.ts +0 -12
  142. package/dist/engine/time/node-clock.d.ts +0 -4
  143. package/dist/funnel.d.ts +0 -95
  144. package/dist/gateway/auth-middleware.d.ts +0 -14
  145. package/dist/gateway/broadcaster.d.ts +0 -122
  146. package/dist/gateway/daemon.d.ts +0 -2
  147. package/dist/gateway/factory.d.ts +0 -7
  148. package/dist/gateway/funnel-event-store.d.ts +0 -81
  149. package/dist/gateway/gateway-server.d.ts +0 -94
  150. package/dist/gateway/gateway-token.d.ts +0 -33
  151. package/dist/gateway/gateway.d.ts +0 -58
  152. package/dist/gateway/kill-competing-slack-gateways.d.ts +0 -9
  153. package/dist/gateway/listener-supervisor.d.ts +0 -85
  154. package/dist/gateway/listeners-client.d.ts +0 -53
  155. package/dist/gateway/resolve-daemon-script.d.ts +0 -11
  156. package/dist/gateway/routes/channels.connectors.call.d.ts +0 -41
  157. package/dist/gateway/routes/health.d.ts +0 -17
  158. package/dist/gateway/routes/index.d.ts +0 -209
  159. package/dist/gateway/routes/listeners.list.d.ts +0 -14
  160. package/dist/gateway/routes/listeners.restart.d.ts +0 -34
  161. package/dist/gateway/routes/listeners.start.d.ts +0 -34
  162. package/dist/gateway/routes/listeners.stop.d.ts +0 -34
  163. package/dist/gateway/routes/route-deps.d.ts +0 -10
  164. package/dist/gateway/routes/status.d.ts +0 -30
  165. package/dist/gateway/routes/validator.d.ts +0 -19
  166. package/dist/logger/leuco-human-file-writer.d.ts +0 -33
  167. package/dist/logger/leuco-human-logger.d.ts +0 -46
  168. package/dist/logger/leuco-human-record.d.ts +0 -15
  169. package/dist/logger/leuco-human-stdout-writer.d.ts +0 -20
  170. package/dist/logger/leuco-human-writer.d.ts +0 -13
  171. package/dist/logger/leuco-logger-memory-sink.d.ts +0 -33
  172. package/dist/logger/leuco-logger-record.d.ts +0 -13
  173. package/dist/logger/leuco-logger-sink.d.ts +0 -34
  174. package/dist/logger/leuco-logger-sqlite-sink.d.ts +0 -102
  175. package/dist/logger/leuco-logger.d.ts +0 -56
@@ -1,58 +0,0 @@
1
- import { FunnelFileSystem } from "../engine/fs/file-system";
2
- import { FunnelProcessRunner } from "../engine/process/process-runner";
3
- import { FunnelClock } from "../engine/time/clock";
4
- type Deps = {
5
- process?: FunnelProcessRunner;
6
- fs?: FunnelFileSystem;
7
- clock?: FunnelClock;
8
- dir?: string;
9
- tmpDir?: string;
10
- port?: number;
11
- sleep?: (ms: number) => Promise<void>;
12
- };
13
- /**
14
- * Manages the gateway daemon as a separate process via PID file.
15
- * Use `start()` to spawn `bun daemon.ts` in the background and `stop()` to
16
- * terminate it. For an in-process gateway, use `Funnel.gatewayServer` instead.
17
- */
18
- export declare class FunnelGateway {
19
- private readonly process;
20
- private readonly fs;
21
- private readonly clock;
22
- private readonly pidFile;
23
- private readonly logDir;
24
- private readonly gatewayLog;
25
- private readonly tmpDir;
26
- private readonly port;
27
- private readonly sleep;
28
- constructor(deps?: Deps);
29
- isRunning(): boolean;
30
- getStatus(): {
31
- running: boolean;
32
- pid: number | null;
33
- port: number;
34
- };
35
- start(options?: {
36
- caffeinate?: boolean;
37
- }): Promise<boolean>;
38
- buildStartCommand(gatewayScript: string, options?: {
39
- caffeinate?: boolean;
40
- }): string;
41
- stop(): Promise<boolean>;
42
- restart(options?: {
43
- onlyIfRunning?: boolean;
44
- caffeinate?: boolean;
45
- }): Promise<{
46
- ok: boolean;
47
- wasRunning: boolean;
48
- stopped: boolean;
49
- started: boolean;
50
- }>;
51
- getLogDir(): string;
52
- getGatewayLog(): string;
53
- getPort(): number;
54
- private readPid;
55
- private removePid;
56
- private isProcessAlive;
57
- }
58
- export {};
@@ -1,9 +0,0 @@
1
- import { FunnelLogger } from "../engine/logger/logger";
2
- import { FunnelProcessRunner } from "../engine/process/process-runner";
3
- type Props = {
4
- selfPid: number;
5
- process?: FunnelProcessRunner;
6
- logger?: FunnelLogger;
7
- };
8
- export declare const killCompetingSlackGateways: (props: Props) => Promise<number[]>;
9
- export {};
@@ -1,85 +0,0 @@
1
- import type { ConnectorConfig } from "../connectors/connector-config-schema";
2
- import type { FunnelConnectorListener } from "../connectors/connector-listener";
3
- import type { ChannelConnectorView } from "../engine/channels/channels";
4
- import { FunnelLogger } from "../engine/logger/logger";
5
- type ConnectorRegistry = {
6
- listAllConnectors(): ChannelConnectorView[];
7
- createListener(channelName: string, connectorName: string): {
8
- config: ConnectorConfig;
9
- channelId: string;
10
- listener: FunnelConnectorListener;
11
- } | null;
12
- };
13
- type SupervisorNotify = (channelName: string, connectorName: string, content: string, meta?: Record<string, string>) => Promise<void>;
14
- type Deps = {
15
- channels: ConnectorRegistry;
16
- notify: SupervisorNotify;
17
- logger?: FunnelLogger;
18
- healthCheckIntervalMs?: number;
19
- maxBackoffMs?: number;
20
- sleep?: (ms: number) => Promise<void>;
21
- now?: () => number;
22
- };
23
- type ListenerEntryStatus = {
24
- channelName: string;
25
- channelId: string;
26
- name: string;
27
- type: ConnectorConfig["type"];
28
- alive: boolean;
29
- events: number;
30
- errors: number;
31
- failureCount: number;
32
- lastEventAt: string | null;
33
- };
34
- /**
35
- * Owns the running listener instances and their lifecycle.
36
- *
37
- * Lives in the gateway process and is the only place that calls
38
- * `listener.start()` / `listener.stop()`. Each entry is keyed by
39
- * `${channelName}/${connectorName}` so the same connector name can exist in
40
- * multiple channels without colliding.
41
- *
42
- * Periodically polls each running listener's `isAlive()` and auto-restarts
43
- * dead listeners with exponential backoff (1s, 2s, 4s, ... capped). Resets
44
- * the backoff counter on successful restart.
45
- */
46
- export declare class FunnelListenerSupervisor {
47
- private readonly channels;
48
- private readonly notify;
49
- private readonly logger;
50
- private readonly running;
51
- private readonly failureCounts;
52
- private readonly stats;
53
- private readonly healthCheckIntervalMs;
54
- private readonly maxBackoffMs;
55
- private readonly sleep;
56
- private readonly now;
57
- private healthCheckTimer;
58
- private healthCheckInFlight;
59
- constructor(deps: Deps);
60
- static keyOf(channelName: string, connectorName: string): string;
61
- isRunning(channelName: string, connectorName: string): boolean;
62
- list(): ListenerEntryStatus[];
63
- start(channelName: string, connectorName: string): Promise<{
64
- ok: boolean;
65
- reason?: string;
66
- }>;
67
- stop(channelName: string, connectorName: string): Promise<{
68
- ok: boolean;
69
- reason?: string;
70
- }>;
71
- restart(channelName: string, connectorName: string): Promise<{
72
- ok: boolean;
73
- reason?: string;
74
- }>;
75
- startAll(): Promise<void>;
76
- stopAll(): Promise<void>;
77
- private ensureStats;
78
- private recordEvent;
79
- private recordError;
80
- private startHealthCheck;
81
- private stopHealthCheck;
82
- private runHealthCheck;
83
- private recoverDead;
84
- }
85
- export {};
@@ -1,53 +0,0 @@
1
- import { z } from "zod";
2
- type Deps = {
3
- port: number;
4
- isDaemonRunning: () => boolean;
5
- /** Returns the daemon's gateway token, or null if unavailable. Sent as `Authorization: Bearer`. */
6
- getToken?: () => string | null;
7
- };
8
- declare const listenerEntrySchema: z.ZodObject<{
9
- channelName: z.ZodString;
10
- channelId: z.ZodString;
11
- name: z.ZodString;
12
- type: z.ZodString;
13
- alive: z.ZodBoolean;
14
- }, z.core.$strip>;
15
- export type ListenerEntry = z.infer<typeof listenerEntrySchema>;
16
- export type ListenerOpResult = {
17
- state: "ok";
18
- } | {
19
- state: "offline";
20
- } | {
21
- state: "error";
22
- reason: string;
23
- };
24
- export type ListListenersResult = {
25
- state: "ok";
26
- listeners: ListenerEntry[];
27
- } | {
28
- state: "offline";
29
- } | {
30
- state: "error";
31
- reason: string;
32
- };
33
- /**
34
- * HTTP client for listener operations on a running gateway daemon.
35
- *
36
- * Returns `{ state: "offline" }` when the daemon isn't running so callers
37
- * (CLI hot-reload paths) can treat that as a no-op without parsing strings.
38
- * Pair this with `FunnelGateway` (process control) for the full picture.
39
- */
40
- export declare class FunnelListenersClient {
41
- private readonly port;
42
- private readonly isDaemonRunning;
43
- private readonly getToken;
44
- constructor(deps: Deps);
45
- list(): Promise<ListListenersResult>;
46
- start(channelName: string, connectorName: string): Promise<ListenerOpResult>;
47
- stop(channelName: string, connectorName: string): Promise<ListenerOpResult>;
48
- restart(channelName: string, connectorName: string): Promise<ListenerOpResult>;
49
- private path;
50
- private authHeaders;
51
- private call;
52
- }
53
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * Locate the daemon entry script. Works in both dev (running from source)
3
- * and built mode (bundled into dist/bin.js with daemon at dist/gateway/daemon.js).
4
- *
5
- * The candidates cover:
6
- * 1. dev: this helper lives at lib/gateway/, so daemon.ts is its sibling
7
- * 2. built sibling: dist/gateway/daemon.js if the helper itself ends up at dist/gateway/
8
- * 3. bundled: when this helper is inlined into dist/bin.js, import.meta.dir is dist/,
9
- * and daemon.js lives at dist/gateway/daemon.js
10
- */
11
- export declare const resolveDaemonScript: () => string;
@@ -1,41 +0,0 @@
1
- /**
2
- * POST /channels/:channel/connectors/:connector/call
3
- *
4
- * Generic adapter call. Used by the funnel MCP server (running in the Claude
5
- * Code process) to send replies/reactions/etc. without spawning a CLI
6
- * subprocess. Mirrors the CLI's `funnel channels <c> connectors <conn> request
7
- * --method=...` but with a structured JSON body and no shell.
8
- */
9
- export declare const channelsConnectorsCallHandler: [import("hono/types").H<import("hono").Env, string, {
10
- in: {
11
- param: {
12
- channel: string;
13
- connector: string;
14
- };
15
- };
16
- out: {
17
- param: {
18
- channel: string;
19
- connector: string;
20
- };
21
- };
22
- }, import("hono").TypedResponse<{
23
- ok: boolean;
24
- reason: string;
25
- }, 400, "json">>, import("hono/types").H<import("../factory").Env, string, {
26
- in: {
27
- param: {
28
- channel: string;
29
- connector: string;
30
- };
31
- };
32
- out: {
33
- param: {
34
- channel: string;
35
- connector: string;
36
- };
37
- };
38
- }, Promise<Response & import("hono").TypedResponse<{
39
- ok: true;
40
- result: import("hono/utils/types").JSONValue;
41
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">>>];
@@ -1,17 +0,0 @@
1
- /** GET /health — liveness + listener registry snapshot. */
2
- export declare const healthHandler: [import("hono/types").H<import("../factory").Env, string, {}, Response & import("hono").TypedResponse<{
3
- ok: true;
4
- pid: number;
5
- clients: number;
6
- listeners: {
7
- channelName: string;
8
- channelId: string;
9
- name: string;
10
- type: import("../..").ConnectorConfig["type"];
11
- alive: boolean;
12
- events: number;
13
- errors: number;
14
- failureCount: number;
15
- lastEventAt: string | null;
16
- }[];
17
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">>];
@@ -1,209 +0,0 @@
1
- /**
2
- * Top-level Hono app for the gateway daemon. Mounts every HTTP endpoint flat
3
- * (the WebSocket /ws upgrade is handled directly by `Bun.serve`). Deps come
4
- * from the `deps` variable set by `FunnelGatewayServer`'s middleware — same
5
- * shape as CLI's `c.var.funnel`.
6
- */
7
- export declare const gatewayRoutes: import("hono/hono-base").HonoBase<import("../factory").Env, {
8
- "/health": {
9
- $get: {
10
- input: {};
11
- output: {
12
- ok: true;
13
- pid: number;
14
- clients: number;
15
- listeners: {
16
- channelName: string;
17
- channelId: string;
18
- name: string;
19
- type: import("../..").ConnectorConfig["type"];
20
- alive: boolean;
21
- events: number;
22
- errors: number;
23
- failureCount: number;
24
- lastEventAt: string | null;
25
- }[];
26
- };
27
- outputFormat: "json";
28
- status: import("hono/utils/http-status").ContentfulStatusCode;
29
- };
30
- };
31
- } & {
32
- "/status": {
33
- $get: {
34
- input: {};
35
- output: {
36
- ok: true;
37
- pid: number;
38
- uptimeMs: number;
39
- clients: {
40
- channel: string;
41
- connectors: string[];
42
- }[];
43
- listeners: {
44
- channelName: string;
45
- channelId: string;
46
- name: string;
47
- type: import("../..").ConnectorConfig["type"];
48
- alive: boolean;
49
- events: number;
50
- errors: number;
51
- failureCount: number;
52
- lastEventAt: string | null;
53
- }[];
54
- broadcaster: {
55
- clients: number;
56
- subscribers: number;
57
- eventsBroadcast: number;
58
- droppedSlowClients: number;
59
- lastBroadcastAt: string | null;
60
- latestOffset: number;
61
- oldestReplayableOffset: number | null;
62
- };
63
- };
64
- outputFormat: "json";
65
- status: import("hono/utils/http-status").ContentfulStatusCode;
66
- };
67
- };
68
- } & {
69
- "/listeners": {
70
- $get: {
71
- input: {};
72
- output: {
73
- listeners: {
74
- channelName: string;
75
- channelId: string;
76
- name: string;
77
- type: import("../..").ConnectorConfig["type"];
78
- alive: boolean;
79
- events: number;
80
- errors: number;
81
- failureCount: number;
82
- lastEventAt: string | null;
83
- }[];
84
- };
85
- outputFormat: "json";
86
- status: import("hono/utils/http-status").ContentfulStatusCode;
87
- };
88
- };
89
- } & {
90
- "/listeners/:channel/:connector/start": {
91
- $post: {
92
- input: {
93
- param: {
94
- channel: string;
95
- connector: string;
96
- };
97
- };
98
- output: {
99
- ok: boolean;
100
- reason: string;
101
- };
102
- outputFormat: "json";
103
- status: 400;
104
- } | {
105
- input: {
106
- param: {
107
- channel: string;
108
- connector: string;
109
- };
110
- };
111
- output: {
112
- ok: boolean;
113
- reason?: string | undefined;
114
- };
115
- outputFormat: "json";
116
- status: 200 | 400;
117
- };
118
- };
119
- } & {
120
- "/listeners/:channel/:connector": {
121
- $delete: {
122
- input: {
123
- param: {
124
- channel: string;
125
- connector: string;
126
- };
127
- };
128
- output: {
129
- ok: boolean;
130
- reason: string;
131
- };
132
- outputFormat: "json";
133
- status: 400;
134
- } | {
135
- input: {
136
- param: {
137
- channel: string;
138
- connector: string;
139
- };
140
- };
141
- output: {
142
- ok: boolean;
143
- reason?: string | undefined;
144
- };
145
- outputFormat: "json";
146
- status: 200 | 400;
147
- };
148
- };
149
- } & {
150
- "/listeners/:channel/:connector/restart": {
151
- $post: {
152
- input: {
153
- param: {
154
- channel: string;
155
- connector: string;
156
- };
157
- };
158
- output: {
159
- ok: boolean;
160
- reason: string;
161
- };
162
- outputFormat: "json";
163
- status: 400;
164
- } | {
165
- input: {
166
- param: {
167
- channel: string;
168
- connector: string;
169
- };
170
- };
171
- output: {
172
- ok: boolean;
173
- reason?: string | undefined;
174
- };
175
- outputFormat: "json";
176
- status: 200 | 400;
177
- };
178
- };
179
- } & {
180
- "/channels/:channel/connectors/:connector/call": {
181
- $post: {
182
- input: {
183
- param: {
184
- channel: string;
185
- connector: string;
186
- };
187
- };
188
- output: {
189
- ok: boolean;
190
- reason: string;
191
- };
192
- outputFormat: "json";
193
- status: 400;
194
- } | {
195
- input: {
196
- param: {
197
- channel: string;
198
- connector: string;
199
- };
200
- };
201
- output: {
202
- ok: true;
203
- result: import("hono/utils/types").JSONValue;
204
- };
205
- outputFormat: "json";
206
- status: import("hono/utils/http-status").ContentfulStatusCode;
207
- };
208
- };
209
- }, "/", "/channels/:channel/connectors/:connector/call">;
@@ -1,14 +0,0 @@
1
- /** GET /listeners — running connector listeners with alive/dead status. */
2
- export declare const listenersListHandler: [import("hono/types").H<import("../factory").Env, string, {}, Response & import("hono").TypedResponse<{
3
- listeners: {
4
- channelName: string;
5
- channelId: string;
6
- name: string;
7
- type: import("../..").ConnectorConfig["type"];
8
- alive: boolean;
9
- events: number;
10
- errors: number;
11
- failureCount: number;
12
- lastEventAt: string | null;
13
- }[];
14
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">>];
@@ -1,34 +0,0 @@
1
- /** POST /listeners/:channel/:connector/restart — stop + start a connector listener. */
2
- export declare const listenersRestartHandler: [import("hono/types").H<import("hono").Env, string, {
3
- in: {
4
- param: {
5
- channel: string;
6
- connector: string;
7
- };
8
- };
9
- out: {
10
- param: {
11
- channel: string;
12
- connector: string;
13
- };
14
- };
15
- }, import("hono").TypedResponse<{
16
- ok: boolean;
17
- reason: string;
18
- }, 400, "json">>, import("hono/types").H<import("../factory").Env, string, {
19
- in: {
20
- param: {
21
- channel: string;
22
- connector: string;
23
- };
24
- };
25
- out: {
26
- param: {
27
- channel: string;
28
- connector: string;
29
- };
30
- };
31
- }, Promise<Response & import("hono").TypedResponse<{
32
- ok: boolean;
33
- reason?: string | undefined;
34
- }, 200 | 400, "json">>>];
@@ -1,34 +0,0 @@
1
- /** POST /listeners/:channel/:connector/start — start a connector listener. */
2
- export declare const listenersStartHandler: [import("hono/types").H<import("hono").Env, string, {
3
- in: {
4
- param: {
5
- channel: string;
6
- connector: string;
7
- };
8
- };
9
- out: {
10
- param: {
11
- channel: string;
12
- connector: string;
13
- };
14
- };
15
- }, import("hono").TypedResponse<{
16
- ok: boolean;
17
- reason: string;
18
- }, 400, "json">>, import("hono/types").H<import("../factory").Env, string, {
19
- in: {
20
- param: {
21
- channel: string;
22
- connector: string;
23
- };
24
- };
25
- out: {
26
- param: {
27
- channel: string;
28
- connector: string;
29
- };
30
- };
31
- }, Promise<Response & import("hono").TypedResponse<{
32
- ok: boolean;
33
- reason?: string | undefined;
34
- }, 200 | 400, "json">>>];
@@ -1,34 +0,0 @@
1
- /** DELETE /listeners/:channel/:connector — stop a connector listener. */
2
- export declare const listenersStopHandler: [import("hono/types").H<import("hono").Env, string, {
3
- in: {
4
- param: {
5
- channel: string;
6
- connector: string;
7
- };
8
- };
9
- out: {
10
- param: {
11
- channel: string;
12
- connector: string;
13
- };
14
- };
15
- }, import("hono").TypedResponse<{
16
- ok: boolean;
17
- reason: string;
18
- }, 400, "json">>, import("hono/types").H<import("../factory").Env, string, {
19
- in: {
20
- param: {
21
- channel: string;
22
- connector: string;
23
- };
24
- };
25
- out: {
26
- param: {
27
- channel: string;
28
- connector: string;
29
- };
30
- };
31
- }, Promise<Response & import("hono").TypedResponse<{
32
- ok: boolean;
33
- reason?: string | undefined;
34
- }, 200 | 400, "json">>>];
@@ -1,10 +0,0 @@
1
- import type { FunnelChannels } from "../../engine/channels/channels";
2
- import type { FunnelBroadcaster } from "../broadcaster";
3
- import type { FunnelListenerSupervisor } from "../listener-supervisor";
4
- export type GatewayRouteDeps = {
5
- selfPid: number;
6
- broadcaster: FunnelBroadcaster;
7
- supervisor: FunnelListenerSupervisor;
8
- channels: FunnelChannels;
9
- uptimeMs: () => number;
10
- };
@@ -1,30 +0,0 @@
1
- /** GET /status — listener registry, connected channels, and broadcaster metrics. */
2
- export declare const statusHandler: [import("hono/types").H<import("../factory").Env, string, {}, Response & import("hono").TypedResponse<{
3
- ok: true;
4
- pid: number;
5
- uptimeMs: number;
6
- clients: {
7
- channel: string;
8
- connectors: string[];
9
- }[];
10
- listeners: {
11
- channelName: string;
12
- channelId: string;
13
- name: string;
14
- type: import("../..").ConnectorConfig["type"];
15
- alive: boolean;
16
- events: number;
17
- errors: number;
18
- failureCount: number;
19
- lastEventAt: string | null;
20
- }[];
21
- broadcaster: {
22
- clients: number;
23
- subscribers: number;
24
- eventsBroadcast: number;
25
- droppedSlowClients: number;
26
- lastBroadcastAt: string | null;
27
- latestOffset: number;
28
- oldestReplayableOffset: number | null;
29
- };
30
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">>];