@interactive-inc/claude-funnel 0.59.1 → 0.60.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 (85) hide show
  1. package/README.md +9 -3
  2. package/dist/bin.js +549 -487
  3. package/dist/channels-2g_BU1N0.d.ts +174 -0
  4. package/dist/claude.d.ts +9 -5
  5. package/dist/claude.js +54 -17
  6. package/dist/{diagnostic-log-Cb3v8P7p.d.ts → connector-descriptor-6SXJoszo.d.ts} +158 -2
  7. package/dist/connectors/discord.d.ts +30 -4
  8. package/dist/connectors/discord.js +2 -2
  9. package/dist/connectors/gh.d.ts +21 -5
  10. package/dist/connectors/gh.js +3 -3
  11. package/dist/connectors/schedule.d.ts +124 -2
  12. package/dist/connectors/schedule.js +3 -3
  13. package/dist/connectors/slack.d.ts +149 -5
  14. package/dist/connectors/slack.js +2 -2
  15. package/dist/{diagnostic-sql-reader-CzYgZpq2.js → diagnostic-sql-reader-C9zR-Csp.js} +5 -5
  16. package/dist/diagnostics.d.ts +1 -1
  17. package/dist/diagnostics.js +1 -1
  18. package/dist/{discord-listener-CKsZGTnH.js → discord-connector-BL36yvbL.js} +60 -37
  19. package/dist/docs.d.ts +1 -1
  20. package/dist/docs.js +1 -1
  21. package/dist/doctor.d.ts +1 -1
  22. package/dist/doctor.js +1 -1
  23. package/dist/error-message-of-Byi4y0Uf.js +9 -0
  24. package/dist/{file-process-guard-JhFpmHYo.d.ts → file-process-guard-DOlCr4GF.d.ts} +4 -5
  25. package/dist/{funnel-diagnostics-BpKYrMSu.js → funnel-diagnostics-CSiJmPlZ.js} +19 -2
  26. package/dist/{funnel-diagnostics-K-wON25Y.d.ts → funnel-diagnostics-DpXOsCty.d.ts} +3 -3
  27. package/dist/{funnel-docs-ng5K8w4j.js → funnel-docs-BxXZ9Ksx.js} +76 -3
  28. package/dist/{funnel-docs-DYBs1-H_.d.ts → funnel-docs-CNklHvbt.d.ts} +1 -1
  29. package/dist/{funnel-doctor-vxO96TCA.d.ts → funnel-doctor-CZf_0Luq.d.ts} +2 -2
  30. package/dist/{funnel-recovery-COExL9MD.d.ts → funnel-recovery-DnLrdWO9.d.ts} +1 -1
  31. package/dist/gateway/daemon.js +326 -266
  32. package/dist/gateway-base-url-Dy4Ykuoh.js +14 -0
  33. package/dist/gateway.d.ts +2 -2
  34. package/dist/gateway.js +2 -2
  35. package/dist/{gh-listener-B2I4s8qh.js → gh-connector-DpiixfQZ.js} +53 -5
  36. package/dist/gh-connector-schema-Rzwc1c1N.js +12 -0
  37. package/dist/http-client-oICicjuO.d.ts +18 -0
  38. package/dist/index-CgY8NdMz.d.ts +1057 -0
  39. package/dist/index.d.ts +1558 -17
  40. package/dist/index.js +374 -342
  41. package/dist/{local-config-json-schema-DE1zkMcb.js → local-config-json-schema-JyLqOQNX.js} +9 -5
  42. package/dist/local-config-sync-Dh1Croqe.d.ts +169 -0
  43. package/dist/local-config.d.ts +2 -2
  44. package/dist/local-config.js +2 -2
  45. package/dist/logger.js +1 -1
  46. package/dist/{memory-diagnostic-log-B9Us7X05.js → memory-diagnostic-log-CI60kNfB.js} +33 -18
  47. package/dist/{memory-token-prompter-CcShtF8B.d.ts → memory-token-prompter-B4sjyaAq.d.ts} +2 -2
  48. package/dist/{memory-token-prompter-C7vREzCL.js → memory-token-prompter-CZde7e6y.js} +1 -1
  49. package/dist/{node-file-system-BcrmWN9I.js → node-file-system-Blr8pAir.js} +1 -1
  50. package/dist/node-http-client-lowp60Oa.js +25 -0
  51. package/dist/{gh-connector-schema-ClPLSYD9.js → node-process-runner-DxTvycoK.js} +1 -12
  52. package/dist/{profiles-g2qGVOWv.d.ts → profiles-Cy5wXQ0L.d.ts} +3 -3
  53. package/dist/{profiles-MnXvYfZF.js → profiles-DSzTeKQw.js} +1 -1
  54. package/dist/profiles.d.ts +1 -1
  55. package/dist/profiles.js +1 -1
  56. package/dist/recovery.d.ts +1 -1
  57. package/dist/recovery.js +1 -1
  58. package/dist/{schedule-listener-DP9Jhc6U.js → schedule-connector-L4uzg5M8.js} +109 -9
  59. package/dist/{settings-reader-DPwqOVUm.d.ts → settings-reader-BIFB_j2f.d.ts} +1 -1
  60. package/dist/settings-schema-D1xcOqRu.d.ts +78 -0
  61. package/dist/{gateway-base-url-DxVjjDoW.js → settings-store-CUKSeTXC.js} +27 -29
  62. package/dist/{slack-listener-C4wlZaOq.js → slack-connector-DQIFPdBF.js} +67 -12
  63. package/dist/slot-fields-CMoRpwuy.js +45 -0
  64. package/dist/{yaml-render-cZu6CxkE.js → yaml-render-qW34NlYz.js} +4 -4
  65. package/package.json +1 -1
  66. package/dist/connector-adapter-DGacCppE.d.ts +0 -25
  67. package/dist/discord-connector-schema-CQyfDkLD.d.ts +0 -39
  68. package/dist/gh-connector-schema-CZzwzvqY.d.ts +0 -14
  69. package/dist/index-D7mjirUL.d.ts +0 -3602
  70. package/dist/local-config-sync-BGPAS9Be.d.ts +0 -401
  71. package/dist/process-runner-DIm1cy95.d.ts +0 -52
  72. package/dist/resolve-connector-token-CczqG_Ig.js +0 -22
  73. package/dist/schedule-listener-DoMPjHZj.d.ts +0 -112
  74. package/dist/settings-schema-1hh11jnN.d.ts +0 -152
  75. package/dist/slack-listener-Dj9NFbAJ.d.ts +0 -136
  76. /package/dist/{connector-adapter-qwXLjQId.js → connector-adapter-DU9Rvyec.js} +0 -0
  77. /package/dist/{connector-listener-CpHBecCj.js → connector-listener-DR3aKOuK.js} +0 -0
  78. /package/dist/{file-system-PWKKU7lA.js → file-system-Wvzc2ePY.js} +0 -0
  79. /package/dist/{file-system-DxpnnUVb.d.ts → file-system-o51IsM0W.d.ts} +0 -0
  80. /package/dist/{funnel-doctor-CApCezTq.js → funnel-doctor-DiJCjHsg.js} +0 -0
  81. /package/dist/{funnel-log-sqlite-sink-B_5_4ybn.js → funnel-log-sqlite-sink-kqJbx2H7.js} +0 -0
  82. /package/dist/{funnel-recovery-D9CxD5Zs.js → funnel-recovery-BFdPjL6Z.js} +0 -0
  83. /package/dist/{logger-BP6SisKt.js → logger-B6iyNbxM.js} +0 -0
  84. /package/dist/{schedule-connector-schema-B_xO5z5B.js → schedule-connector-schema-CfyuMCMh.js} +0 -0
  85. /package/dist/{settings-reader-DPqrpV7s.js → settings-reader-CtQ-Ix8_.js} +0 -0
@@ -0,0 +1,14 @@
1
+ //#region lib/engine/http/gateway-base-url.ts
2
+ /**
3
+ * The HTTP base URL of a gateway daemon on the loopback interface. The daemon
4
+ * always binds 127.0.0.1 for its management API (only the WS `/ws` endpoint is
5
+ * ever exposed off-box), so every in-process HTTP client — publisher, listeners
6
+ * client, MCP channel server — talks to it here. Centralizing the construction
7
+ * keeps the host/port shape in one place instead of re-spelling
8
+ * `http://127.0.0.1:${port}` at each call site.
9
+ */
10
+ function gatewayLoopbackUrl(port) {
11
+ return `http://127.0.0.1:${port}`;
12
+ }
13
+ //#endregion
14
+ export { gatewayLoopbackUrl as t };
package/dist/gateway.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as connectorConnectionEventSchema, a as ConnectorConnectionStatus, c as ConnectorProcessedQuery, d as ConnectorRawEvent, f as ConnectorRawQuery, g as StoredRawEvent, h as StoredProcessedEvent, i as ConnectorConnectionRecord, l as ConnectorProcessedRecord, m as StoredConnectionEvent, n as ConnectorConnectionEvent, o as ConnectorDiagnosticLog, p as ConnectorRawRecord, r as ConnectorConnectionQuery, s as ConnectorProcessedEvent, t as CONNECTOR_CONNECTION_STATUSES, u as ConnectorQuery, v as connectorProcessedEventSchema, y as connectorRawEventSchema } from "./diagnostic-log-Cb3v8P7p.js";
2
- import { $ as PublishResponse, J as SqliteConnectorDiagnosticLog, Q as PublishRequest, St as ReplayableEvent, X as SqliteFunnelEventLog, Y as MemoryFunnelEventLog, Z as FunnelChannelPublisher, _t as GatewayRouteDeps, at as gatewayLoopbackUrl, bt as BroadcastSubscriber, ct as channelWsUrl, dt as FunnelEvent, et as PublishResult, ft as FunnelEventLog, gt as GatewayEmitInput, ht as Env, it as FunnelGatewayToken, lt as FunnelGatewayServer, mt as funnelEventSchema, nt as publishResponseSchema, ot as ChannelWsUrlInput, pt as FunnelEventRecord, q as MemoryConnectorDiagnosticLog, rt as DEFAULT_GATEWAY_TOKEN_PATH, st as channelWsProtocols, t as GatewayApp, tt as publishRequestSchema, ut as GatewayEventStore, vt as FunnelListenerSupervisor, xt as FunnelBroadcaster, yt as BroadcastEvent } from "./index-D7mjirUL.js";
1
+ import { C as StoredRawEvent, E as connectorRawEventSchema, S as StoredProcessedEvent, T as connectorProcessedEventSchema, _ as ConnectorQuery, b as ConnectorRawRecord, c as CONNECTOR_CONNECTION_STATUSES, d as ConnectorConnectionRecord, f as ConnectorConnectionStatus, g as ConnectorProcessedRecord, h as ConnectorProcessedQuery, l as ConnectorConnectionEvent, m as ConnectorProcessedEvent, p as ConnectorDiagnosticLog, u as ConnectorConnectionQuery, v as ConnectorRawEvent, w as connectorConnectionEventSchema, x as StoredConnectionEvent, y as ConnectorRawQuery } from "./connector-descriptor-6SXJoszo.js";
2
+ import { A as FunnelBroadcaster, C as funnelEventSchema, D as FunnelListenerSupervisor, E as GatewayRouteDeps, O as BroadcastEvent, S as FunnelEventRecord, T as GatewayEmitInput, _ as channelWsUrl, a as SqliteFunnelEventLog, b as FunnelEvent, c as PublishResponse, d as publishResponseSchema, f as DEFAULT_GATEWAY_TOKEN_PATH, g as channelWsProtocols, h as ChannelWsUrlInput, i as MemoryFunnelEventLog, j as ReplayableEvent, k as BroadcastSubscriber, l as PublishResult, m as gatewayLoopbackUrl, n as MemoryConnectorDiagnosticLog, o as FunnelChannelPublisher, p as FunnelGatewayToken, r as SqliteConnectorDiagnosticLog, s as PublishRequest, t as GatewayApp, u as publishRequestSchema, v as FunnelGatewayServer, w as Env, x as FunnelEventLog, y as GatewayEventStore } from "./index-CgY8NdMz.js";
3
3
  export { BroadcastEvent, BroadcastSubscriber, CONNECTOR_CONNECTION_STATUSES, ChannelWsUrlInput, ConnectorConnectionEvent, ConnectorConnectionQuery, ConnectorConnectionRecord, ConnectorConnectionStatus, ConnectorDiagnosticLog, ConnectorProcessedEvent, ConnectorProcessedQuery, ConnectorProcessedRecord, ConnectorQuery, ConnectorRawEvent, ConnectorRawQuery, ConnectorRawRecord, DEFAULT_GATEWAY_TOKEN_PATH, FunnelBroadcaster, FunnelChannelPublisher, FunnelEvent, FunnelEventLog, FunnelEventRecord, FunnelGatewayServer, FunnelGatewayToken, FunnelListenerSupervisor, type GatewayApp, type GatewayEmitInput, GatewayEventStore, type GatewayRouteDeps, type Env as GatewayServerEnv, MemoryConnectorDiagnosticLog, MemoryFunnelEventLog, PublishRequest, PublishResponse, PublishResult, ReplayableEvent, SqliteConnectorDiagnosticLog, SqliteFunnelEventLog, StoredConnectionEvent, StoredProcessedEvent, StoredRawEvent, channelWsProtocols, channelWsUrl, connectorConnectionEventSchema, connectorProcessedEventSchema, connectorRawEventSchema, funnelEventSchema, gatewayLoopbackUrl, publishRequestSchema, publishResponseSchema };
package/dist/gateway.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as gatewayLoopbackUrl } from "./gateway-base-url-DxVjjDoW.js";
2
- import { S as publishResponseSchema, _ as funnelEventSchema, a as connectorConnectionEventSchema, b as FunnelChannelPublisher, c as MemoryFunnelEventLog, d as DEFAULT_GATEWAY_TOKEN_PATH, f as FunnelGatewayToken, g as FunnelEventLog, h as SqliteFunnelEventLog, i as ConnectorDiagnosticLog, l as channelWsProtocols, m as FunnelListenerSupervisor, n as SqliteConnectorDiagnosticLog, o as connectorProcessedEventSchema, p as FunnelGatewayServer, r as CONNECTOR_CONNECTION_STATUSES, s as connectorRawEventSchema, t as MemoryConnectorDiagnosticLog, u as channelWsUrl, v as FunnelBroadcaster, x as publishRequestSchema } from "./memory-diagnostic-log-B9Us7X05.js";
1
+ import { t as gatewayLoopbackUrl } from "./gateway-base-url-Dy4Ykuoh.js";
2
+ import { S as publishResponseSchema, _ as funnelEventSchema, a as connectorConnectionEventSchema, b as FunnelChannelPublisher, c as MemoryFunnelEventLog, d as DEFAULT_GATEWAY_TOKEN_PATH, f as FunnelGatewayToken, g as FunnelEventLog, h as SqliteFunnelEventLog, i as ConnectorDiagnosticLog, l as channelWsProtocols, m as FunnelListenerSupervisor, n as SqliteConnectorDiagnosticLog, o as connectorProcessedEventSchema, p as FunnelGatewayServer, r as CONNECTOR_CONNECTION_STATUSES, s as connectorRawEventSchema, t as MemoryConnectorDiagnosticLog, u as channelWsUrl, v as FunnelBroadcaster, x as publishRequestSchema } from "./memory-diagnostic-log-CI60kNfB.js";
3
3
  export { CONNECTOR_CONNECTION_STATUSES, ConnectorDiagnosticLog, DEFAULT_GATEWAY_TOKEN_PATH, FunnelBroadcaster, FunnelChannelPublisher, FunnelEventLog, FunnelGatewayServer, FunnelGatewayToken, FunnelListenerSupervisor, MemoryConnectorDiagnosticLog, MemoryFunnelEventLog, SqliteConnectorDiagnosticLog, SqliteFunnelEventLog, channelWsProtocols, channelWsUrl, connectorConnectionEventSchema, connectorProcessedEventSchema, connectorRawEventSchema, funnelEventSchema, gatewayLoopbackUrl, publishRequestSchema, publishResponseSchema };
@@ -1,6 +1,8 @@
1
- import { t as FunnelConnectorAdapter } from "./connector-adapter-qwXLjQId.js";
2
- import { t as FunnelConnectorListener } from "./connector-listener-CpHBecCj.js";
3
- import { n as NodeFunnelProcessRunner } from "./gh-connector-schema-ClPLSYD9.js";
1
+ import { t as NodeFunnelProcessRunner } from "./node-process-runner-DxTvycoK.js";
2
+ import { t as ghConnectorSchema } from "./gh-connector-schema-Rzwc1c1N.js";
3
+ import { t as FunnelConnectorAdapter } from "./connector-adapter-DU9Rvyec.js";
4
+ import { t as FunnelConnectorListener } from "./connector-listener-DR3aKOuK.js";
5
+ import { t as errorMessageOf } from "./error-message-of-Byi4y0Uf.js";
4
6
  import { z } from "zod";
5
7
  //#region lib/engine/connectors/gh-adapter.ts
6
8
  const defaultProcess$1 = new NodeFunnelProcessRunner();
@@ -142,7 +144,8 @@ var FunnelGhListener = class extends FunnelConnectorListener {
142
144
  this.since = nextSince;
143
145
  this.bootstrapped = true;
144
146
  } catch (error) {
145
- this.logger?.error("gh poll error", { error: error instanceof Error ? error.message : String(error) });
147
+ this.recordConnection("error", errorMessageOf(error));
148
+ this.logger?.error("gh poll error", { error: errorMessageOf(error) });
146
149
  }
147
150
  }
148
151
  recordRaw(eventId, item) {
@@ -175,4 +178,49 @@ var FunnelGhListener = class extends FunnelConnectorListener {
175
178
  }
176
179
  };
177
180
  //#endregion
178
- export { FunnelGhAdapter as n, FunnelGhListener as t };
181
+ //#region lib/engine/connectors/gh-connector.ts
182
+ /**
183
+ * GitHub connector descriptor. Pass `ghConnector()` to
184
+ * `new Funnel({ connectors: [...] })` to enable the type.
185
+ */
186
+ const ghConnector = () => ({
187
+ type: "gh",
188
+ toolExposed: true,
189
+ createListener(config, deps) {
190
+ return new FunnelGhListener({
191
+ config: ghConnectorSchema.parse(config),
192
+ channelId: deps.channelId,
193
+ process: deps.process,
194
+ logger: deps.logger,
195
+ diagnosticLog: deps.diagnosticLog
196
+ });
197
+ },
198
+ createAdapter(config, deps) {
199
+ ghConnectorSchema.parse(config);
200
+ return new FunnelGhAdapter({ process: deps.process });
201
+ },
202
+ secretTokens() {
203
+ return [];
204
+ },
205
+ buildConfig(input, context) {
206
+ return ghConnectorSchema.parse({
207
+ id: context.id,
208
+ type: "gh",
209
+ name: input.name,
210
+ ...typeof input.pollInterval === "number" ? { pollInterval: input.pollInterval } : {},
211
+ createdAt: context.now,
212
+ updatedAt: context.now
213
+ });
214
+ },
215
+ applyUpdate(config, fields, context) {
216
+ const current = ghConnectorSchema.parse(config);
217
+ return ghConnectorSchema.parse({
218
+ ...current,
219
+ ...typeof fields.pollInterval === "number" ? { pollInterval: fields.pollInterval } : {},
220
+ updatedAt: context.now
221
+ });
222
+ },
223
+ operations: {}
224
+ });
225
+ //#endregion
226
+ export { FunnelGhListener as n, FunnelGhAdapter as r, ghConnector as t };
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ //#region lib/engine/connectors/gh-connector-schema.ts
3
+ const ghConnectorSchema = z.object({
4
+ id: z.string(),
5
+ name: z.string(),
6
+ type: z.literal("gh"),
7
+ pollInterval: z.number().int().positive().optional(),
8
+ createdAt: z.string().datetime().optional(),
9
+ updatedAt: z.string().datetime().optional()
10
+ });
11
+ //#endregion
12
+ export { ghConnectorSchema as t };
@@ -0,0 +1,18 @@
1
+ //#region lib/engine/http/http-client.d.ts
2
+ type HttpRequest = {
3
+ method: string;
4
+ url: string;
5
+ headers?: Record<string, string>;
6
+ body?: string;
7
+ };
8
+ type HttpResponse = {
9
+ status: number;
10
+ ok: boolean;
11
+ text(): Promise<string>;
12
+ json(): Promise<unknown>;
13
+ };
14
+ declare abstract class FunnelHttpClient {
15
+ abstract fetch(request: HttpRequest): Promise<HttpResponse>;
16
+ }
17
+ //#endregion
18
+ export { HttpRequest as n, HttpResponse as r, FunnelHttpClient as t };