@interactive-inc/claude-funnel 0.52.0 → 0.55.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 (72) hide show
  1. package/README.md +25 -3
  2. package/dist/bin.js +1276 -520
  3. package/dist/claude.d.ts +22 -5
  4. package/dist/claude.js +456 -169
  5. package/dist/connector-adapter-1PxjN-Uk.d.ts +25 -0
  6. package/dist/{connector-adapter-D5Utumgz.js → connector-adapter-qwXLjQId.js} +1 -1
  7. package/dist/{connector-listener-DU54DN-f.js → connector-listener-CpHBecCj.js} +1 -1
  8. package/dist/connectors/discord.d.ts +6 -6
  9. package/dist/connectors/discord.js +2 -2
  10. package/dist/connectors/gh.d.ts +6 -6
  11. package/dist/connectors/gh.js +2 -2
  12. package/dist/connectors/schedule.d.ts +12 -2
  13. package/dist/connectors/schedule.js +2 -2
  14. package/dist/connectors/slack.d.ts +3 -3
  15. package/dist/connectors/slack.js +2 -2
  16. package/dist/{connector-diagnostic-log-yTOojKUR.d.ts → diagnostic-log-Bxe7Bbvw.d.ts} +2 -2
  17. package/dist/diagnostic-sql-reader-CzYgZpq2.js +83 -0
  18. package/dist/diagnostics.d.ts +2 -0
  19. package/dist/diagnostics.js +2 -0
  20. package/dist/{discord-connector-schema-CBDyGdOI.js → discord-connector-schema-B_N6IXLz.js} +1 -1
  21. package/dist/{discord-connector-schema-R0Uu-3ns.d.ts → discord-connector-schema-CPgcZkXh.d.ts} +1 -1
  22. package/dist/{discord-listener-_jSE3HsQ.js → discord-listener-C0MoKdQO.js} +6 -6
  23. package/dist/docs.d.ts +2 -0
  24. package/dist/docs.js +2 -0
  25. package/dist/doctor.d.ts +2 -0
  26. package/dist/doctor.js +2 -0
  27. package/dist/{file-process-guard-BgrVHe9I.d.ts → file-process-guard-DI1742H5.d.ts} +31 -15
  28. package/dist/funnel-diagnostics-BpKYrMSu.js +300 -0
  29. package/dist/funnel-diagnostics-qWy5tPSq.d.ts +176 -0
  30. package/dist/funnel-docs-dXPokzr5.d.ts +18 -0
  31. package/dist/funnel-docs-ng5K8w4j.js +653 -0
  32. package/dist/funnel-doctor-BF3Rdgk0.d.ts +34 -0
  33. package/dist/funnel-doctor-CApCezTq.js +82 -0
  34. package/dist/funnel-recovery-BUBsu7WX.d.ts +101 -0
  35. package/dist/funnel-recovery-D9CxD5Zs.js +134 -0
  36. package/dist/gateway/daemon.js +810 -211
  37. package/dist/{settings-store-D2XSXTyt.js → gateway-base-url-6foMXfFf.js} +19 -6
  38. package/dist/gateway.d.ts +3 -3
  39. package/dist/gateway.js +3 -2
  40. package/dist/{gh-connector-schema-eoTtHbY6.d.ts → gh-connector-schema-CU1ojfIF.d.ts} +1 -1
  41. package/dist/{gh-connector-schema-o3Q1-ojL.js → gh-connector-schema-DUcZgN2Q.js} +1 -1
  42. package/dist/{gh-listener-DH-fClQm.js → gh-listener-Dsx6AmhH.js} +5 -5
  43. package/dist/{index-NFs2jzCa.d.ts → index-CrngHrne.d.ts} +187 -619
  44. package/dist/index.d.ts +16 -11
  45. package/dist/index.js +512 -976
  46. package/dist/{local-config-json-schema-8IHjS4Q7.js → local-config-json-schema-DE1zkMcb.js} +35 -9
  47. package/dist/{local-config-sync-BdsrDZOu.d.ts → local-config-sync-B8b04LrZ.d.ts} +45 -25
  48. package/dist/local-config.d.ts +2 -2
  49. package/dist/local-config.js +2 -2
  50. package/dist/{memory-connector-diagnostic-log-CrW1ltLM.js → memory-diagnostic-log-BZ1VD80X.js} +61 -99
  51. package/dist/{memory-token-prompter-B5FFCsGP.d.ts → memory-token-prompter-Lo3YRDzq.d.ts} +4 -4
  52. package/dist/{memory-token-prompter-CLerGsgM.js → memory-token-prompter-vBXxY20-.js} +2 -2
  53. package/dist/{profiles-f0mNmEyP.d.ts → profiles-EHTeCOqB.d.ts} +3 -2
  54. package/dist/profiles.d.ts +1 -1
  55. package/dist/profiles.js +1 -1
  56. package/dist/recovery.d.ts +2 -0
  57. package/dist/recovery.js +2 -0
  58. package/dist/{resolve-connector-token-BHmZLRrV.js → resolve-connector-token-CczqG_Ig.js} +1 -1
  59. package/dist/{schedule-connector-schema-iCI61gzU.js → schedule-connector-schema-B_xO5z5B.js} +1 -1
  60. package/dist/{schedule-listener-CUyUFFR1.d.ts → schedule-listener-DKh0hnkK.d.ts} +5 -5
  61. package/dist/{schedule-listener-ePAjians.js → schedule-listener-DP9Jhc6U.js} +14 -4
  62. package/dist/settings-reader-CBrgz01o.d.ts +18 -0
  63. package/dist/{settings-reader-BSU6JyvM.d.ts → settings-schema-zhnMIa8I.d.ts} +1 -16
  64. package/dist/{slack-connector-schema-BCNWluHM.js → slack-connector-schema-C1zEf4TG.js} +1 -1
  65. package/dist/{slack-listener-Bv5xI9gC.d.ts → slack-listener-COQA8wAZ.d.ts} +4 -4
  66. package/dist/{slack-listener-ClQuHhEF.js → slack-listener-DUKPcpJH.js} +7 -7
  67. package/dist/{mcp-Dr-nIBwN.js → yaml-render-OhUN-qkS.js} +52 -34
  68. package/package.json +21 -1
  69. package/dist/connector-adapter-DKgsVuMH.d.ts +0 -11
  70. /package/dist/{file-system-BeOKXjlV.d.ts → file-system-Wub9Nto4.d.ts} +0 -0
  71. /package/dist/{process-runner-DfniuWVU.d.ts → process-runner-D5I_jhYQ.d.ts} +0 -0
  72. /package/dist/{profiles-wMRnjSid.js → profiles-MnXvYfZF.js} +0 -0
@@ -0,0 +1,25 @@
1
+ //#region lib/engine/connectors/connector-adapter.d.ts
2
+ /**
3
+ * A JSON-serializable value. Connector call bodies are sent to external APIs as
4
+ * JSON, so the body must be representable as JSON — `JsonValue` says exactly
5
+ * that, replacing a bare `unknown` that let non-serializable values (functions,
6
+ * symbols, class instances) slip through to `JSON.stringify`.
7
+ */
8
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
9
+ [key: string]: JsonValue;
10
+ };
11
+ type CallInput = {
12
+ method: string;
13
+ path: string; /** JSON request body. Omit for GET-like calls. */
14
+ body?: JsonValue;
15
+ };
16
+ declare abstract class FunnelConnectorAdapter {
17
+ /**
18
+ * Dispatches one Claude → external call. The response is the external API's
19
+ * raw payload, typed `unknown` because its shape is the provider's concern —
20
+ * the caller (Claude, via MCP) interprets it.
21
+ */
22
+ abstract call(input: CallInput): Promise<unknown>;
23
+ }
24
+ //#endregion
25
+ export { FunnelConnectorAdapter as n, CallInput as t };
@@ -1,4 +1,4 @@
1
- //#region lib/connectors/connector-adapter.ts
1
+ //#region lib/engine/connectors/connector-adapter.ts
2
2
  var FunnelConnectorAdapter = class {};
3
3
  //#endregion
4
4
  export { FunnelConnectorAdapter as t };
@@ -1,4 +1,4 @@
1
- //#region lib/connectors/connector-listener.ts
1
+ //#region lib/engine/connectors/connector-listener.ts
2
2
  /**
3
3
  * Long-lived event source for one connector.
4
4
  *
@@ -1,6 +1,6 @@
1
- import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../connector-diagnostic-log-yTOojKUR.js";
2
- import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-DKgsVuMH.js";
3
- import { n as discordConnectorSchema, t as DiscordConnectorConfig } from "../discord-connector-schema-R0Uu-3ns.js";
1
+ import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../diagnostic-log-Bxe7Bbvw.js";
2
+ import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-1PxjN-Uk.js";
3
+ import { n as discordConnectorSchema, t as DiscordConnectorConfig } from "../discord-connector-schema-CPgcZkXh.js";
4
4
 
5
5
  //#region lib/engine/http/http-client.d.ts
6
6
  type HttpRequest = {
@@ -19,7 +19,7 @@ declare abstract class FunnelHttpClient {
19
19
  abstract fetch(request: HttpRequest): Promise<HttpResponse>;
20
20
  }
21
21
  //#endregion
22
- //#region lib/connectors/discord-adapter.d.ts
22
+ //#region lib/engine/connectors/discord-adapter.d.ts
23
23
  type Deps$1 = {
24
24
  config: DiscordConnectorConfig; /** Environment used to resolve a `botTokenEnv` reference. Defaults to process.env. */
25
25
  env?: NodeJS.ProcessEnv;
@@ -32,7 +32,7 @@ declare class FunnelDiscordAdapter extends FunnelConnectorAdapter {
32
32
  call(input: CallInput): Promise<unknown>;
33
33
  }
34
34
  //#endregion
35
- //#region lib/connectors/discord-event-processor.d.ts
35
+ //#region lib/engine/connectors/discord-event-processor.d.ts
36
36
  type DiscordInboundMessage = {
37
37
  authorId: string;
38
38
  authorIsBot: boolean;
@@ -59,7 +59,7 @@ declare class FunnelDiscordEventProcessor {
59
59
  process(message: DiscordInboundMessage): DiscordProcessed;
60
60
  }
61
61
  //#endregion
62
- //#region lib/connectors/discord-listener.d.ts
62
+ //#region lib/engine/connectors/discord-listener.d.ts
63
63
  type Deps = {
64
64
  config: DiscordConnectorConfig; /** Funnel channel uuid this connector lives under; stamped onto diagnostic-log rows. */
65
65
  channelId?: string; /** Environment used to resolve a `botTokenEnv` reference. Defaults to process.env. */
@@ -1,3 +1,3 @@
1
- import { n as FunnelDiscordEventProcessor, r as FunnelDiscordAdapter, t as FunnelDiscordListener } from "../discord-listener-_jSE3HsQ.js";
2
- import { t as discordConnectorSchema } from "../discord-connector-schema-CBDyGdOI.js";
1
+ import { n as FunnelDiscordEventProcessor, r as FunnelDiscordAdapter, t as FunnelDiscordListener } from "../discord-listener-C0MoKdQO.js";
2
+ import { t as discordConnectorSchema } from "../discord-connector-schema-B_N6IXLz.js";
3
3
  export { FunnelDiscordAdapter, FunnelDiscordEventProcessor, FunnelDiscordListener, discordConnectorSchema };
@@ -1,9 +1,9 @@
1
- import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../connector-diagnostic-log-yTOojKUR.js";
2
- import { r as FunnelProcessRunner } from "../process-runner-DfniuWVU.js";
3
- import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-DKgsVuMH.js";
4
- import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-eoTtHbY6.js";
1
+ import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../diagnostic-log-Bxe7Bbvw.js";
2
+ import { r as FunnelProcessRunner } from "../process-runner-D5I_jhYQ.js";
3
+ import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-1PxjN-Uk.js";
4
+ import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-CU1ojfIF.js";
5
5
 
6
- //#region lib/connectors/gh-adapter.d.ts
6
+ //#region lib/engine/connectors/gh-adapter.d.ts
7
7
  type Deps$1 = {
8
8
  process?: FunnelProcessRunner;
9
9
  };
@@ -13,7 +13,7 @@ declare class FunnelGhAdapter extends FunnelConnectorAdapter {
13
13
  call(input: CallInput): Promise<unknown>;
14
14
  }
15
15
  //#endregion
16
- //#region lib/connectors/gh-listener.d.ts
16
+ //#region lib/engine/connectors/gh-listener.d.ts
17
17
  type Deps = {
18
18
  config: GhConnectorConfig; /** Funnel channel uuid this connector lives under; stamped onto diagnostic-log rows. */
19
19
  channelId?: string;
@@ -1,3 +1,3 @@
1
- import { t as ghConnectorSchema } from "../gh-connector-schema-o3Q1-ojL.js";
2
- import { n as FunnelGhAdapter, t as FunnelGhListener } from "../gh-listener-DH-fClQm.js";
1
+ import { t as ghConnectorSchema } from "../gh-connector-schema-DUcZgN2Q.js";
2
+ import { n as FunnelGhAdapter, t as FunnelGhListener } from "../gh-listener-Dsx6AmhH.js";
3
3
  export { FunnelGhAdapter, FunnelGhListener, ghConnectorSchema };
@@ -1,6 +1,16 @@
1
- import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, l as ScheduleStateStore, n as ScheduleOnFired, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema, t as FunnelScheduleListener } from "../schedule-listener-CUyUFFR1.js";
1
+ import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, l as ScheduleStateStore, n as ScheduleOnFired, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema, t as FunnelScheduleListener } from "../schedule-listener-DKh0hnkK.js";
2
2
 
3
- //#region lib/connectors/match-cron.d.ts
3
+ //#region lib/engine/connectors/match-cron.d.ts
4
+ /**
5
+ * Returns true when `date` (local time) satisfies a 5-field cron expression.
6
+ *
7
+ * Two deliberate deviations from Vixie cron, called out so schedules are not
8
+ * written expecting the other behavior:
9
+ * - Day-of-month and day-of-week are ANDed, not ORed. Vixie cron fires when
10
+ * EITHER matches once both are restricted; here every field must match.
11
+ * - Day-of-week is 0-6 (Sunday=0). `7` for Sunday is NOT accepted (it throws
12
+ * as out-of-range); use `0`.
13
+ */
4
14
  declare const matchCron: (expr: string, date: Date) => boolean;
5
15
  //#endregion
6
16
  export { FunnelScheduleListener, ScheduleCatchupPolicy, ScheduleConnectorConfig, ScheduleEntry, ScheduleOnFired, ScheduleStateStore, matchCron, scheduleCatchupPolicySchema, scheduleConnectorSchema, scheduleEntrySchema };
@@ -1,3 +1,3 @@
1
- import { n as ScheduleStateStore, r as matchCron, t as FunnelScheduleListener } from "../schedule-listener-ePAjians.js";
2
- import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "../schedule-connector-schema-iCI61gzU.js";
1
+ import { n as ScheduleStateStore, r as matchCron, t as FunnelScheduleListener } from "../schedule-listener-DP9Jhc6U.js";
2
+ import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "../schedule-connector-schema-B_xO5z5B.js";
3
3
  export { FunnelScheduleListener, ScheduleStateStore, matchCron, scheduleCatchupPolicySchema, scheduleConnectorSchema, scheduleEntrySchema };
@@ -1,7 +1,7 @@
1
- import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-DKgsVuMH.js";
2
- import { a as slackConnectorSchema, c as SlackProcessedEmit, d as SlackSkipReason, i as SlackConnectorConfig, l as SlackProcessedSkip, n as SlackOnAppCreated, o as FunnelSlackEventProcessor, r as SlackPreprocessEvent, s as SlackProcessed, t as FunnelSlackListener, u as SlackRawEvent } from "../slack-listener-Bv5xI9gC.js";
1
+ import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-1PxjN-Uk.js";
2
+ import { a as slackConnectorSchema, c as SlackProcessedEmit, d as SlackSkipReason, i as SlackConnectorConfig, l as SlackProcessedSkip, n as SlackOnAppCreated, o as FunnelSlackEventProcessor, r as SlackPreprocessEvent, s as SlackProcessed, t as FunnelSlackListener, u as SlackRawEvent } from "../slack-listener-COQA8wAZ.js";
3
3
 
4
- //#region lib/connectors/slack-adapter.d.ts
4
+ //#region lib/engine/connectors/slack-adapter.d.ts
5
5
  type SlackWebClientLike = {
6
6
  apiCall: (method: string, options?: Record<string, unknown>) => Promise<unknown>;
7
7
  };
@@ -1,3 +1,3 @@
1
- import { n as FunnelSlackEventProcessor, r as FunnelSlackAdapter, t as FunnelSlackListener } from "../slack-listener-ClQuHhEF.js";
2
- import { t as slackConnectorSchema } from "../slack-connector-schema-BCNWluHM.js";
1
+ import { n as FunnelSlackEventProcessor, r as FunnelSlackAdapter, t as FunnelSlackListener } from "../slack-listener-DUKPcpJH.js";
2
+ import { t as slackConnectorSchema } from "../slack-connector-schema-C1zEf4TG.js";
3
3
  export { FunnelSlackAdapter, FunnelSlackEventProcessor, FunnelSlackListener, slackConnectorSchema };
@@ -13,7 +13,7 @@ declare abstract class FunnelLogger {
13
13
  abstract readonly file: string | null;
14
14
  }
15
15
  //#endregion
16
- //#region lib/connectors/connector-listener.d.ts
16
+ //#region lib/engine/connectors/connector-listener.d.ts
17
17
  type NotifyFn = (content: string, meta?: Record<string, string>) => Promise<void>;
18
18
  /**
19
19
  * Long-lived event source for one connector.
@@ -32,7 +32,7 @@ declare abstract class FunnelConnectorListener {
32
32
  isAlive(): boolean;
33
33
  }
34
34
  //#endregion
35
- //#region lib/gateway/connector-diagnostic-log.d.ts
35
+ //#region lib/gateway/diagnostic-log/diagnostic-log.d.ts
36
36
  /**
37
37
  * Points in the listener's connection lifecycle. The single source of truth
38
38
  * for the value set: the `status` column schema, the `ConnectorConnectionStatus`
@@ -0,0 +1,83 @@
1
+ import { Database } from "bun:sqlite";
2
+ //#region lib/gateway/diagnostic-log/diagnostic-sql-reader.ts
3
+ /**
4
+ * Read-only SQL surface over the three diagnostic tables, for Claude to query
5
+ * the log with arbitrary `SELECT`s. It opens all files read-only and exposes
6
+ * three views — `raw`, `processed`, `connection` — that hide the storage
7
+ * details (the physical table is `leuco_log` and each row's columns live
8
+ * inside a JSON `event` blob): the views surface the columns as plain fields,
9
+ * with `payload` already pulled out of the nested JSON.
10
+ *
11
+ * The tables are separate files. `raw` and `processed` share an `event_id`,
12
+ * so a `JOIN` answers "the event arrived, but what verdict did it get?";
13
+ * `connection` answers the other half — "did the listener ever connect at
14
+ * all?". Writes are impossible: the connection is read-only and `query`
15
+ * rejects anything but a single `SELECT`.
16
+ */
17
+ var ConnectorDiagnosticSqlReader = class {
18
+ db;
19
+ constructor(props) {
20
+ const db = new Database(props.rawPath, { readonly: true });
21
+ try {
22
+ db.run("PRAGMA busy_timeout = 500");
23
+ db.prepare("ATTACH DATABASE ? AS processeddb").run(props.processedPath);
24
+ db.prepare("ATTACH DATABASE ? AS connectiondb").run(props.connectionPath);
25
+ db.run(rawViewSql);
26
+ db.run(processedViewSql);
27
+ db.run(connectionViewSql);
28
+ } catch (error) {
29
+ db.close();
30
+ throw error;
31
+ }
32
+ this.db = db;
33
+ Object.freeze(this);
34
+ }
35
+ /**
36
+ * Run one read-only `SELECT` and return the rows. Returns an `Error` (rather
37
+ * than throwing) for a non-SELECT statement or a SQL error, so the caller
38
+ * can surface the message without a stack trace.
39
+ */
40
+ query(sql, params = []) {
41
+ const trimmed = sql.trim().replace(/;$/, "").trim();
42
+ if (!/^select\b/i.test(trimmed)) return /* @__PURE__ */ new Error("only a single SELECT statement is allowed");
43
+ if (trimmed.includes(";")) return /* @__PURE__ */ new Error("only a single statement is allowed (remove the ';')");
44
+ try {
45
+ return this.db.prepare(trimmed).all(...params);
46
+ } catch (error) {
47
+ return error instanceof Error ? error : new Error(String(error));
48
+ }
49
+ }
50
+ close() {
51
+ this.db.close();
52
+ }
53
+ };
54
+ const rawViewSql = `CREATE TEMP VIEW raw AS SELECT
55
+ seq,
56
+ ts,
57
+ json_extract(event, '$.event_id') AS event_id,
58
+ json_extract(event, '$.type') AS type,
59
+ json_extract(event, '$.connector_id') AS connector_id,
60
+ json_extract(event, '$.channel_id') AS channel_id,
61
+ json_extract(event, '$.payload') AS payload
62
+ FROM main.leuco_log`;
63
+ const processedViewSql = `CREATE TEMP VIEW processed AS SELECT
64
+ seq,
65
+ ts,
66
+ json_extract(event, '$.event_id') AS event_id,
67
+ json_extract(event, '$.type') AS type,
68
+ json_extract(event, '$.connector_id') AS connector_id,
69
+ json_extract(event, '$.channel_id') AS channel_id,
70
+ json_extract(event, '$.outcome') AS outcome,
71
+ json_extract(event, '$.payload') AS payload
72
+ FROM processeddb.leuco_log`;
73
+ const connectionViewSql = `CREATE TEMP VIEW connection AS SELECT
74
+ seq,
75
+ ts,
76
+ json_extract(event, '$.type') AS type,
77
+ json_extract(event, '$.connector_id') AS connector_id,
78
+ json_extract(event, '$.channel_id') AS channel_id,
79
+ json_extract(event, '$.status') AS status,
80
+ json_extract(event, '$.detail') AS detail
81
+ FROM connectiondb.leuco_log`;
82
+ //#endregion
83
+ export { ConnectorDiagnosticSqlReader as t };
@@ -0,0 +1,2 @@
1
+ import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, h as toDiagnosticEvent, i as DiagnosticsChannelSource, l as ReplayResult, m as toDiagnosticConnectionError, n as DiagnoseAllReport, o as DiagnosticsPublisher, p as queryRows, r as DiagnosisStatus, s as DiagnosticsTokenReader, t as ChannelDiagnosis, u as DiagnosticConnectionError } from "./funnel-diagnostics-qWy5tPSq.js";
2
+ export { ChannelDiagnosis, DiagnoseAllReport, DiagnosisStatus, DiagnosticConnectionError, DiagnosticEvent, DiagnosticsChannelSource, DiagnosticsGatewayProbe, DiagnosticsPublisher, DiagnosticsTokenReader, FunnelDiagnostics, ReplayResult, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
@@ -0,0 +1,2 @@
1
+ import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-BpKYrMSu.js";
2
+ export { FunnelDiagnostics, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- //#region lib/connectors/discord-connector-schema.ts
2
+ //#region lib/engine/connectors/discord-connector-schema.ts
3
3
  /**
4
4
  * Like slack, a discord connector holds either a literal `botToken` or a
5
5
  * `botTokenEnv` reference resolved from `process.env` at listener start. The
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- //#region lib/connectors/discord-connector-schema.d.ts
3
+ //#region lib/engine/connectors/discord-connector-schema.d.ts
4
4
  /**
5
5
  * Like slack, a discord connector holds either a literal `botToken` or a
6
6
  * `botTokenEnv` reference resolved from `process.env` at listener start. The
@@ -1,6 +1,6 @@
1
- import { t as FunnelConnectorAdapter } from "./connector-adapter-D5Utumgz.js";
2
- import { t as resolveConnectorToken } from "./resolve-connector-token-BHmZLRrV.js";
3
- import { t as FunnelConnectorListener } from "./connector-listener-DU54DN-f.js";
1
+ import { t as FunnelConnectorAdapter } from "./connector-adapter-qwXLjQId.js";
2
+ import { t as resolveConnectorToken } from "./resolve-connector-token-CczqG_Ig.js";
3
+ import { t as FunnelConnectorListener } from "./connector-listener-CpHBecCj.js";
4
4
  import { Client, GatewayIntentBits, Partials } from "discord.js";
5
5
  //#region lib/engine/http/http-client.ts
6
6
  var FunnelHttpClient = class {};
@@ -26,7 +26,7 @@ var NodeFunnelHttpClient = class extends FunnelHttpClient {
26
26
  }
27
27
  };
28
28
  //#endregion
29
- //#region lib/connectors/discord-adapter.ts
29
+ //#region lib/engine/connectors/discord-adapter.ts
30
30
  const DISCORD_API_BASE = "https://discord.com/api/v10";
31
31
  const defaultHttp = new NodeFunnelHttpClient();
32
32
  var FunnelDiscordAdapter = class extends FunnelConnectorAdapter {
@@ -63,7 +63,7 @@ var FunnelDiscordAdapter = class extends FunnelConnectorAdapter {
63
63
  }
64
64
  };
65
65
  //#endregion
66
- //#region lib/connectors/discord-event-processor.ts
66
+ //#region lib/engine/connectors/discord-event-processor.ts
67
67
  var FunnelDiscordEventProcessor = class {
68
68
  ownUserId;
69
69
  constructor(props) {
@@ -86,7 +86,7 @@ var FunnelDiscordEventProcessor = class {
86
86
  }
87
87
  };
88
88
  //#endregion
89
- //#region lib/connectors/discord-listener.ts
89
+ //#region lib/engine/connectors/discord-listener.ts
90
90
  var FunnelDiscordListener = class extends FunnelConnectorListener {
91
91
  config;
92
92
  channelId;
package/dist/docs.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-dXPokzr5.js";
2
+ export { DocsTopicListing, FunnelDocs };
package/dist/docs.js ADDED
@@ -0,0 +1,2 @@
1
+ import { t as FunnelDocs } from "./funnel-docs-ng5K8w4j.js";
2
+ export { FunnelDocs };
@@ -0,0 +1,2 @@
1
+ import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-BF3Rdgk0.js";
2
+ export { DoctorFixMode, DoctorReport, FunnelDoctor };
package/dist/doctor.js ADDED
@@ -0,0 +1,2 @@
1
+ import { t as FunnelDoctor } from "./funnel-doctor-CApCezTq.js";
2
+ export { FunnelDoctor };
@@ -1,7 +1,8 @@
1
- import { n as FunnelIdGenerator, r as ChannelConfig } from "./settings-reader-BSU6JyvM.js";
2
- import { S as FunnelLogger } from "./connector-diagnostic-log-yTOojKUR.js";
3
- import { r as FunnelProcessRunner } from "./process-runner-DfniuWVU.js";
4
- import { n as FunnelFileSystem } from "./file-system-BeOKXjlV.js";
1
+ import { t as ChannelConfig } from "./settings-schema-zhnMIa8I.js";
2
+ import { n as FunnelIdGenerator } from "./settings-reader-CBrgz01o.js";
3
+ import { S as FunnelLogger } from "./diagnostic-log-Bxe7Bbvw.js";
4
+ import { r as FunnelProcessRunner } from "./process-runner-D5I_jhYQ.js";
5
+ import { n as FunnelFileSystem } from "./file-system-Wub9Nto4.js";
5
6
 
6
7
  //#region lib/engine/claude/channel-resolver.d.ts
7
8
  type ChannelResolver = {
@@ -38,21 +39,12 @@ type SessionStore = {
38
39
  };
39
40
  //#endregion
40
41
  //#region lib/engine/claude/claude.d.ts
41
- type LaunchOptions = {
42
+ type LaunchCommon = {
42
43
  channel: string;
43
44
  cwd?: string;
44
- userArgs?: string[];
45
- /** Stable id of the launching profile (uuid). Keys the singleton PID file and
46
- * the resumable session. Absent for a profile-less launch (raw `--channel`),
47
- * which never enforces singleton-ness and never resumes. */
48
- profileId?: string; /** Args prepended to the claude argv (typically a profile's recipe). Defaults to none. */
45
+ userArgs?: string[]; /** Args prepended to the claude argv (typically a profile's recipe). Defaults to none. */
49
46
  options?: string[]; /** Env vars layered under the launched claude process. process.env wins on collision. */
50
47
  env?: Record<string, string>;
51
- /** Whether to inject a `--session-id`/`--resume` for this profile.
52
- * Defaults to false: resuming is opt-in and only meaningful for a profile,
53
- * since the persisted session is owned by the profile (by id). A launch
54
- * without a profile always starts a fresh session regardless of this flag. */
55
- resume?: boolean;
56
48
  /** Invoked synchronously after the child claude process has been spawned, with its PID.
57
49
  * Useful for hosts that need to register the spawned process before it exits
58
50
  * (e.g. multi-session registries that track per-claude liveness). */
@@ -62,6 +54,30 @@ type LaunchOptions = {
62
54
  * does not need the funnel binary as an MCP endpoint. */
63
55
  installMcp?: boolean;
64
56
  };
57
+ /**
58
+ * A launch carries one of two targets, distinguished by `profileId`.
59
+ *
60
+ * - **profile launch** — has a stable `profileId` (uuid). Enforces singleton-ness
61
+ * via the PID file and may opt into `resume` to reuse the profile's session.
62
+ * - **profile-less launch** — raw `--channel`. Never enforces singleton-ness and
63
+ * always starts a fresh session, so `resume` is meaningless and disallowed.
64
+ *
65
+ * Modeling these as a union (rather than two independent optional fields) makes
66
+ * `resume` without a `profileId` a compile error — previously it was silently
67
+ * ignored, which masked real bugs (a profile resume that never took effect).
68
+ */
69
+ type LaunchTarget = {
70
+ /** Stable id of the launching profile (uuid). Keys the singleton PID file
71
+ * and the resumable session. */
72
+ profileId: string;
73
+ /** Inject `--session-id`/`--resume` for this profile (opt-in, default false).
74
+ * The persisted session is owned by the profile (by id). */
75
+ resume?: boolean;
76
+ } | {
77
+ profileId?: undefined;
78
+ resume?: undefined;
79
+ };
80
+ type LaunchOptions = LaunchCommon & LaunchTarget;
65
81
  type Deps$1 = {
66
82
  channels: ChannelResolver;
67
83
  mcp: McpInstaller;