@interactive-inc/claude-funnel 0.65.0 → 0.67.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.
- package/README.md +8 -4
- package/dist/bin.js +275 -372
- package/dist/channel.d.ts +185 -0
- package/dist/channel.js +238 -0
- package/dist/{channels-CRGb6B5_.d.ts → channels-BBA3GTAa.d.ts} +5 -5
- package/dist/claude.d.ts +11 -8
- package/dist/claude.js +31 -15
- package/dist/{connector-descriptor-BFIhyTfa.d.ts → connector-descriptor-F75ZI8Fh.d.ts} +27 -39
- package/dist/{connector-diagnostics-recorder-COtNEmUp.js → connector-diagnostics-recorder-BmOijU1p.js} +1 -0
- package/dist/connectors/discord.d.ts +10 -7
- package/dist/connectors/discord.js +2 -2
- package/dist/connectors/gh.d.ts +6 -5
- package/dist/connectors/gh.js +2 -2
- package/dist/connectors/schedule.d.ts +10 -7
- package/dist/connectors/schedule.js +2 -2
- package/dist/connectors/slack.d.ts +14 -9
- package/dist/connectors/slack.js +3 -3
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.js +1 -1
- package/dist/{discord-connector-DXARcO6w.js → discord-connector-CdjwPoty.js} +6 -6
- package/dist/{discord-connector-schema-D-bOVAKt.d.ts → discord-connector-schema-BaBZYHxK.d.ts} +0 -1
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +1 -1
- package/dist/doctor.d.ts +1 -1
- package/dist/doctor.js +1 -1
- package/dist/{file-process-guard-tVcgckH6.d.ts → file-process-guard-DAYe9Ndt.d.ts} +22 -17
- package/dist/{file-system-VhwwXZbm.d.ts → file-system-BNtl997T.d.ts} +2 -1
- package/dist/{flume-source-listener-BNyAII7N.d.ts → flume-source-listener-CLtsdcT2.d.ts} +8 -5
- package/dist/{funnel-diagnostics-Cvk6Sk4x.js → funnel-diagnostics-B-PCuv_E.js} +4 -3
- package/dist/{funnel-diagnostics-b9ar0Ing.d.ts → funnel-diagnostics-CnKus3Jg.d.ts} +8 -5
- package/dist/{funnel-docs-C-ge0MuB.js → funnel-docs-BFcqITFA.js} +4 -0
- package/dist/{funnel-doctor-XrI2GBH8.js → funnel-doctor-Csw5qjcH.js} +1 -0
- package/dist/{funnel-doctor-CnRQi4kM.d.ts → funnel-doctor-CviUTINw.d.ts} +20 -9
- package/dist/{funnel-error-0t1MK1R6.js → funnel-error-DoSBCogD.js} +13 -0
- package/dist/{funnel-log-sqlite-sink-DLYkY0pZ.js → funnel-log-sqlite-sink-CXbs3qQp.js} +1 -1
- package/dist/{funnel-recovery-CMhY8Jfk.d.ts → funnel-recovery-BwcSNNSN.d.ts} +1 -2
- package/dist/{funnel-recovery-DKnEutUS.js → funnel-recovery-DYbSYGWC.js} +1 -0
- package/dist/gateway/daemon.js +66 -125
- package/dist/gateway.d.ts +2 -2
- package/dist/gateway.js +2 -2
- package/dist/{gh-connector-BUGCOEWS.js → gh-connector-D-iyjl-d.js} +5 -5
- package/dist/{gh-connector-schema-DWQaB6gX.d.ts → gh-connector-schema-BrNsCl1T.d.ts} +0 -1
- package/dist/{index-Ds6sHhA-.d.ts → index-B4RvEaW-.d.ts} +78 -46
- package/dist/index.d.ts +115 -107
- package/dist/index.js +123 -32
- package/dist/{local-config-json-schema-DexV8vX3.js → local-config-json-schema-_-YVHX4c.js} +4 -4
- package/dist/local-config.d.ts +2 -3
- package/dist/local-config.js +1 -1
- package/dist/logger-mMZvblTx.d.ts +25 -0
- package/dist/logger.d.ts +29 -13
- package/dist/logger.js +1 -1
- package/dist/{memory-token-prompter-BoV8Hf-n.d.ts → memory-token-prompter-D3R_kgM_.d.ts} +2 -3
- package/dist/{node-file-system-BOXIHW_Q.js → node-file-system-xJx7dymE.js} +11 -3
- package/dist/{profiles-cVZQkM69.d.ts → profiles-CePRnv3F.d.ts} +3 -4
- package/dist/{profiles-ZHLONml4.js → profiles-KpN7_gBw.js} +19 -5
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/recovery.d.ts +1 -1
- package/dist/recovery.js +1 -1
- package/dist/{schedule-connector-schema-Z0RXLgPI.d.ts → schedule-connector-schema-DBko_Bf7.d.ts} +0 -1
- package/dist/{schedule-connector-9k3gOIgl.js → schedule-connector-teeDMHUe.js} +5 -5
- package/dist/{settings-reader-BNxjsxCB.d.ts → settings-reader-CyTpbAre.d.ts} +1 -2
- package/dist/{settings-schema-BL_c2Udm.d.ts → settings-schema-B-CKLuST.d.ts} +0 -1
- package/dist/{settings-store-ccv291GV.js → settings-store-ZFWBhOnp.js} +12 -3
- package/dist/{slack-connector-CxpWagbT.js → slack-connector-BE0KAjCs.js} +10 -9
- package/dist/{slack-event-processor-xFDG3US0.js → slack-event-processor-Cs_YuI3w.js} +2 -2
- package/dist/{slack-event-processor-BhCf5Wiy.d.ts → slack-event-processor-DmAlq4cV.d.ts} +0 -1
- package/dist/{slot-fields-D-pvMgTK.js → slot-fields-5ERhytIA.js} +3 -3
- package/dist/{sqlite-diagnostic-log-CwhXE9Qh.js → sqlite-diagnostic-log-BDxfXGZy.js} +42 -19
- package/dist/{yaml-render-DVEtYuF1.js → yaml-render-DxxRQT-V.js} +3 -3
- package/package.json +15 -10
- package/dist/file-system-Wvzc2ePY.js +0 -9
- package/dist/logger-B6iyNbxM.js +0 -9
- package/dist/settings-reader-9FcX3qS1.js +0 -11
- /package/dist/{connector-adapter-Dvs8N7ew.js → connector-adapter-BL2ehMej.js} +0 -0
- /package/dist/{connector-listener-mPGZYa8e.js → connector-listener-BcQMzY6Q.js} +0 -0
- /package/dist/{diagnostic-sql-reader-oXZnWFf_.js → diagnostic-sql-reader-CoBk_EFF.js} +0 -0
- /package/dist/{discord-connector-schema-B4YpWpR3.js → discord-connector-schema-saAGuPmJ.js} +0 -0
- /package/dist/{error-message-of-ColuYmAk.js → error-message-of-BG4ezZ_s.js} +0 -0
- /package/dist/{funnel-docs-CNklHvbt.d.ts → funnel-docs-BJWawfWI.d.ts} +0 -0
- /package/dist/{gh-connector-schema-CAqIhzGr.js → gh-connector-schema-DmZTrzUu.js} +0 -0
- /package/dist/{loopback-fetch-CVNuN3YZ.js → loopback-fetch-HP-bo9Kv.js} +0 -0
- /package/dist/{node-http-client-u00atiKx.js → node-http-client-SX3xFh4h.js} +0 -0
- /package/dist/{node-process-runner-DxTvycoK.js → node-process-runner-D4rzPl8Q.js} +0 -0
- /package/dist/{resolve-connector-token-DxDG9mhf.js → resolve-connector-token-BwiJCu82.js} +0 -0
- /package/dist/{schedule-connector-schema-DKEPZnVv.js → schedule-connector-schema-C2AChpwX.js} +0 -0
- /package/dist/{slack-connector-schema-Dem8to4P.js → slack-connector-schema-EGVuuqSX.js} +0 -0
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as FunnelClock, t as FunnelLogger } from "./logger-mMZvblTx.js";
|
|
2
|
+
import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region lib/engine/logger/logger.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Structured logger with three levels and an optional log-file path.
|
|
7
|
-
* Defaults to NodeFunnelLogger (appends to `<os.tmpdir()>/funnel/funnel.log`);
|
|
8
|
-
* MemoryFunnelLogger captures entries in memory and NoopFunnelLogger silences output.
|
|
9
|
-
*/
|
|
10
|
-
declare abstract class FunnelLogger {
|
|
11
|
-
abstract info(message: string, meta?: Record<string, unknown>): void;
|
|
12
|
-
abstract warn(message: string, meta?: Record<string, unknown>): void;
|
|
13
|
-
abstract error(message: string, meta?: Record<string, unknown>): void;
|
|
14
|
-
abstract readonly file: string | null;
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
4
|
//#region lib/engine/process/process-runner.d.ts
|
|
18
5
|
type RunOptions = {
|
|
19
6
|
cwd?: string;
|
|
@@ -33,8 +20,10 @@ type AttachOptions = {
|
|
|
33
20
|
onSpawned?: (pid: number) => void;
|
|
34
21
|
};
|
|
35
22
|
type DetachOptions = {
|
|
36
|
-
env?: Record<string, string>;
|
|
37
|
-
|
|
23
|
+
env?: Record<string, string>;
|
|
24
|
+
/** Append stdout to this file. Parent dir is the caller's responsibility. */
|
|
25
|
+
stdoutFile?: string;
|
|
26
|
+
/** Append stderr to this file. Parent dir is the caller's responsibility. */
|
|
38
27
|
stderrFile?: string;
|
|
39
28
|
};
|
|
40
29
|
type ProcessSnapshot = {
|
|
@@ -94,7 +83,8 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
|
94
83
|
};
|
|
95
84
|
type CallInput = {
|
|
96
85
|
method: string;
|
|
97
|
-
path: string;
|
|
86
|
+
path: string;
|
|
87
|
+
/** JSON request body. Omit for GET-like calls. */
|
|
98
88
|
body?: JsonValue;
|
|
99
89
|
};
|
|
100
90
|
declare abstract class FunnelConnectorAdapter {
|
|
@@ -202,11 +192,13 @@ type ConnectorRef = {
|
|
|
202
192
|
};
|
|
203
193
|
/** A row tied to one inbound event, joinable to its twin by `eventId`. */
|
|
204
194
|
type ConnectorEventKeys = ConnectorRef & {
|
|
205
|
-
/** Correlation id shared by the raw and processed rows of the same inbound event. */
|
|
195
|
+
/** Correlation id shared by the raw and processed rows of the same inbound event. */
|
|
196
|
+
eventId: string;
|
|
206
197
|
};
|
|
207
198
|
/** One untouched inbound event to persist, before any processing. */
|
|
208
199
|
type ConnectorRawRecord = ConnectorEventKeys & {
|
|
209
|
-
/** The listener's untouched payload, already JSON-stringified by the caller. */
|
|
200
|
+
/** The listener's untouched payload, already JSON-stringified by the caller. */
|
|
201
|
+
payload: string;
|
|
210
202
|
};
|
|
211
203
|
/** The processor's verdict for one inbound event. */
|
|
212
204
|
type ConnectorProcessedRecord = ConnectorEventKeys & {
|
|
@@ -223,7 +215,8 @@ type ConnectorProcessedRecord = ConnectorEventKeys & {
|
|
|
223
215
|
payload: string;
|
|
224
216
|
};
|
|
225
217
|
type ConnectorConnectionRecord = ConnectorRef & {
|
|
226
|
-
status: ConnectorConnectionStatus;
|
|
218
|
+
status: ConnectorConnectionStatus;
|
|
219
|
+
/** Free-form context (an error message, a reason) or "" when none. */
|
|
227
220
|
detail: string;
|
|
228
221
|
};
|
|
229
222
|
/**
|
|
@@ -235,7 +228,8 @@ type ConnectorConnectionRecord = ConnectorRef & {
|
|
|
235
228
|
type ConnectorQuery = {
|
|
236
229
|
type?: string;
|
|
237
230
|
connectorId?: string | null;
|
|
238
|
-
channelId?: string | null;
|
|
231
|
+
channelId?: string | null;
|
|
232
|
+
/** Cap on returned rows. The most recent matching rows are returned, oldest first. */
|
|
239
233
|
limit?: number;
|
|
240
234
|
};
|
|
241
235
|
type ConnectorRawQuery = ConnectorQuery;
|
|
@@ -315,24 +309,15 @@ declare abstract class FunnelHttpClient {
|
|
|
315
309
|
abstract fetch(request: HttpRequest): Promise<HttpResponse>;
|
|
316
310
|
}
|
|
317
311
|
//#endregion
|
|
318
|
-
//#region lib/engine/time/clock.d.ts
|
|
319
|
-
/**
|
|
320
|
-
* Time boundary. Default NodeFunnelClock returns `new Date()`; MemoryFunnelClock
|
|
321
|
-
* is settable and `advance(ms)`-able for deterministic schedule / timeout tests.
|
|
322
|
-
*/
|
|
323
|
-
declare abstract class FunnelClock {
|
|
324
|
-
abstract now(): Date;
|
|
325
|
-
millis(): number;
|
|
326
|
-
iso(): string;
|
|
327
|
-
}
|
|
328
|
-
//#endregion
|
|
329
312
|
//#region lib/engine/connectors/connector-descriptor.d.ts
|
|
330
313
|
/** Boundaries a listener needs, supplied by the registry at build time. */
|
|
331
314
|
type ConnectorListenerDeps = {
|
|
332
315
|
channelId: string;
|
|
333
316
|
fs: FunnelFileSystem;
|
|
334
|
-
process: FunnelProcessRunner;
|
|
335
|
-
|
|
317
|
+
process: FunnelProcessRunner;
|
|
318
|
+
/** HTTP client for self-detection (Slack auth.test), reactions, and other listener-side REST calls. */
|
|
319
|
+
http: FunnelHttpClient;
|
|
320
|
+
/** Wall clock — listeners that own a timer (schedule) read it from here so tests can inject a fake. */
|
|
336
321
|
clock: FunnelClock;
|
|
337
322
|
logger?: FunnelLogger;
|
|
338
323
|
diagnosticLog?: ConnectorDiagnosticLog;
|
|
@@ -343,13 +328,15 @@ type ConnectorListenerDeps = {
|
|
|
343
328
|
* a clean SIGTERM story wire `controller.signal` here and call
|
|
344
329
|
* `controller.abort()` in their shutdown handler.
|
|
345
330
|
*/
|
|
346
|
-
signal?: AbortSignal;
|
|
331
|
+
signal?: AbortSignal;
|
|
332
|
+
/** Resolves the per-connector state directory (`<dir>/channels/<id>/connectors/<id>`). */
|
|
347
333
|
connectorDir: (channelId: string, connectorId: string) => string;
|
|
348
334
|
};
|
|
349
335
|
/** Boundaries an adapter needs. Adapters are channel-agnostic. */
|
|
350
336
|
type ConnectorAdapterDeps = {
|
|
351
337
|
fs: FunnelFileSystem;
|
|
352
|
-
process: FunnelProcessRunner;
|
|
338
|
+
process: FunnelProcessRunner;
|
|
339
|
+
/** HTTP client for outbound calls. Used by the Slack adapter, future REST adapters. */
|
|
353
340
|
http: FunnelHttpClient;
|
|
354
341
|
logger?: FunnelLogger;
|
|
355
342
|
};
|
|
@@ -392,7 +379,8 @@ type ConnectorOperation = (props: {
|
|
|
392
379
|
type ConnectorDescriptor = {
|
|
393
380
|
type: string;
|
|
394
381
|
createListener: (config: BaseConnectorConfig, deps: ConnectorListenerDeps) => FunnelConnectorListener;
|
|
395
|
-
createAdapter: ((config: BaseConnectorConfig, deps: ConnectorAdapterDeps) => FunnelConnectorAdapter) | null;
|
|
382
|
+
createAdapter: ((config: BaseConnectorConfig, deps: ConnectorAdapterDeps) => FunnelConnectorAdapter) | null;
|
|
383
|
+
/** Whether the MCP channel server exposes this type as a callable tool. */
|
|
396
384
|
toolExposed: boolean;
|
|
397
385
|
secretTokens: (config: BaseConnectorConfig) => string[];
|
|
398
386
|
buildConfig: (input: Record<string, unknown>, context: ConnectorBuildContext) => BaseConnectorConfig;
|
|
@@ -400,4 +388,4 @@ type ConnectorDescriptor = {
|
|
|
400
388
|
operations: Record<string, ConnectorOperation>;
|
|
401
389
|
};
|
|
402
390
|
//#endregion
|
|
403
|
-
export {
|
|
391
|
+
export { FunnelConnectorListener as A, ProcessSnapshot as B, ConnectorRawRecord as C, connectorConnectionEventSchema as D, StoredRawEvent as E, BaseConnectorConfig as F, RunResult as H, baseConnectorConfigSchema as I, AttachOptions as L, CallInput as M, FunnelConnectorAdapter as N, connectorProcessedEventSchema as O, JsonValue as P, DetachOptions as R, ConnectorRawQuery as S, StoredProcessedEvent as T, RunOptions as V, ConnectorProcessedEvent as _, ConnectorOperation as a, ConnectorQuery as b, FunnelHttpClient as c, CONNECTOR_CONNECTION_STATUSES as d, ConnectorConnectionEvent as f, ConnectorDiagnosticLog as g, ConnectorConnectionStatus as h, ConnectorListenerDeps as i, NotifyFn as j, connectorRawEventSchema as k, HttpRequest as l, ConnectorConnectionRecord as m, ConnectorBuildContext as n, ConnectorOperationContext as o, ConnectorConnectionQuery as p, ConnectorDescriptor as r, ConnectorUpdateContext as s, ConnectorAdapterDeps as t, HttpResponse as u, ConnectorProcessedQuery as v, StoredConnectionEvent as w, ConnectorRawEvent as x, ConnectorProcessedRecord as y, FunnelProcessRunner as z };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
1
|
+
import { t as FunnelLogger } from "../logger-mMZvblTx.js";
|
|
2
|
+
import { M as CallInput, N as FunnelConnectorAdapter, c as FunnelHttpClient, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-F75ZI8Fh.js";
|
|
3
|
+
import { n as discordConnectorSchema, t as DiscordConnectorConfig } from "../discord-connector-schema-BaBZYHxK.js";
|
|
4
|
+
import { t as FunnelFlumeSourceListener } from "../flume-source-listener-CLtsdcT2.js";
|
|
4
5
|
import { FlumeRuntimeDeps } from "@interactive-inc/flume";
|
|
5
|
-
|
|
6
6
|
//#region lib/engine/connectors/discord-adapter.d.ts
|
|
7
7
|
type Deps$1 = {
|
|
8
|
-
config: DiscordConnectorConfig;
|
|
8
|
+
config: DiscordConnectorConfig;
|
|
9
|
+
/** Environment used to resolve a `botTokenEnv` reference. Defaults to process.env. */
|
|
9
10
|
env?: NodeJS.ProcessEnv;
|
|
10
11
|
http?: FunnelHttpClient;
|
|
11
12
|
};
|
|
@@ -78,8 +79,10 @@ type Deps = {
|
|
|
78
79
|
env?: NodeJS.ProcessEnv;
|
|
79
80
|
logger?: FunnelLogger;
|
|
80
81
|
diagnosticLog?: ConnectorDiagnosticLog;
|
|
81
|
-
flumeDeps?: Partial<FlumeRuntimeDeps>;
|
|
82
|
-
signal
|
|
82
|
+
flumeDeps?: Partial<FlumeRuntimeDeps>;
|
|
83
|
+
/** Shutdown signal forwarded to the underlying Flume. */
|
|
84
|
+
signal?: AbortSignal;
|
|
85
|
+
/** See `DiscordConnectorOptions.eventTypes`. */
|
|
83
86
|
eventTypes?: ReadonlyArray<string> | "all";
|
|
84
87
|
};
|
|
85
88
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as discordConnectorSchema } from "../discord-connector-schema-
|
|
2
|
-
import { i as FunnelDiscordAdapter, n as FunnelFlumeDiscordListener, r as FunnelDiscordEventProcessor, t as discordConnector } from "../discord-connector-
|
|
1
|
+
import { t as discordConnectorSchema } from "../discord-connector-schema-saAGuPmJ.js";
|
|
2
|
+
import { i as FunnelDiscordAdapter, n as FunnelFlumeDiscordListener, r as FunnelDiscordEventProcessor, t as discordConnector } from "../discord-connector-CdjwPoty.js";
|
|
3
3
|
export { FunnelDiscordAdapter, FunnelDiscordEventProcessor, FunnelFlumeDiscordListener, discordConnector, discordConnectorSchema };
|
package/dist/connectors/gh.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as FunnelLogger } from "../logger-mMZvblTx.js";
|
|
2
|
+
import { M as CallInput, N as FunnelConnectorAdapter, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor, z as FunnelProcessRunner } from "../connector-descriptor-F75ZI8Fh.js";
|
|
3
|
+
import { t as FunnelFlumeSourceListener } from "../flume-source-listener-CLtsdcT2.js";
|
|
4
|
+
import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-BrNsCl1T.js";
|
|
4
5
|
import { FlumeRuntimeDeps } from "@interactive-inc/flume";
|
|
5
|
-
|
|
6
6
|
//#region lib/engine/connectors/gh-adapter.d.ts
|
|
7
7
|
type Deps$1 = {
|
|
8
8
|
process?: FunnelProcessRunner;
|
|
@@ -33,7 +33,8 @@ type Deps = {
|
|
|
33
33
|
process?: FunnelProcessRunner;
|
|
34
34
|
logger?: FunnelLogger;
|
|
35
35
|
diagnosticLog?: ConnectorDiagnosticLog;
|
|
36
|
-
flumeDeps?: Partial<FlumeRuntimeDeps>;
|
|
36
|
+
flumeDeps?: Partial<FlumeRuntimeDeps>;
|
|
37
|
+
/** Shutdown signal forwarded to the underlying Flume. */
|
|
37
38
|
signal?: AbortSignal;
|
|
38
39
|
};
|
|
39
40
|
/**
|
package/dist/connectors/gh.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as ghConnectorSchema } from "../gh-connector-schema-
|
|
2
|
-
import { n as FunnelFlumeGhListener, r as FunnelGhAdapter, t as ghConnector } from "../gh-connector-
|
|
1
|
+
import { t as ghConnectorSchema } from "../gh-connector-schema-DmZTrzUu.js";
|
|
2
|
+
import { n as FunnelFlumeGhListener, r as FunnelGhAdapter, t as ghConnector } from "../gh-connector-D-iyjl-d.js";
|
|
3
3
|
export { FunnelFlumeGhListener, FunnelGhAdapter, ghConnector, ghConnectorSchema };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as FunnelFileSystem } from "../file-system-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { t as FunnelLogger } from "../logger-mMZvblTx.js";
|
|
2
|
+
import { n as FunnelFileSystem } from "../file-system-BNtl997T.js";
|
|
3
|
+
import { A as FunnelConnectorListener, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-F75ZI8Fh.js";
|
|
4
|
+
import { a as scheduleConnectorSchema, i as scheduleCatchupPolicySchema, n as ScheduleConnectorConfig, o as scheduleEntrySchema, r as ScheduleEntry, t as ScheduleCatchupPolicy } from "../schedule-connector-schema-DBko_Bf7.js";
|
|
5
5
|
//#region lib/engine/connectors/match-cron.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns true when `date` (local time) satisfies a 5-field cron expression.
|
|
@@ -38,9 +38,11 @@ declare class FunnelScheduleStateStore {
|
|
|
38
38
|
type ScheduleOnFired = (entry: ScheduleEntry, firedAt: Date) => void | Promise<void>;
|
|
39
39
|
type Deps = {
|
|
40
40
|
config: ScheduleConnectorConfig;
|
|
41
|
-
lastFiredStore: FunnelScheduleStateStore;
|
|
41
|
+
lastFiredStore: FunnelScheduleStateStore;
|
|
42
|
+
/** Funnel channel uuid this connector lives under; stamped onto diagnostic-log rows. */
|
|
42
43
|
channelId?: string;
|
|
43
|
-
logger?: FunnelLogger;
|
|
44
|
+
logger?: FunnelLogger;
|
|
45
|
+
/** Diagnostic log of fired entries and lifecycle. No-op when absent. */
|
|
44
46
|
diagnosticLog?: ConnectorDiagnosticLog;
|
|
45
47
|
now?: () => Date;
|
|
46
48
|
/**
|
|
@@ -76,7 +78,8 @@ declare class FunnelScheduleListener extends FunnelConnectorListener {
|
|
|
76
78
|
//#endregion
|
|
77
79
|
//#region lib/engine/connectors/schedule-connector.d.ts
|
|
78
80
|
type ScheduleConnectorOptions = {
|
|
79
|
-
/** Invoked after a schedule entry fires successfully — e.g. to drop one-shot entries. */
|
|
81
|
+
/** Invoked after a schedule entry fires successfully — e.g. to drop one-shot entries. */
|
|
82
|
+
onFired?: ScheduleOnFired;
|
|
80
83
|
};
|
|
81
84
|
/**
|
|
82
85
|
* Schedule connector descriptor. Pass `scheduleConnector()` to
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "../schedule-connector-schema-
|
|
2
|
-
import { i as matchCron, n as FunnelScheduleListener, r as FunnelScheduleStateStore, t as scheduleConnector } from "../schedule-connector-
|
|
1
|
+
import { n as scheduleConnectorSchema, r as scheduleEntrySchema, t as scheduleCatchupPolicySchema } from "../schedule-connector-schema-C2AChpwX.js";
|
|
2
|
+
import { i as matchCron, n as FunnelScheduleListener, r as FunnelScheduleStateStore, t as scheduleConnector } from "../schedule-connector-teeDMHUe.js";
|
|
3
3
|
export { FunnelScheduleListener, FunnelScheduleStateStore, matchCron, scheduleCatchupPolicySchema, scheduleConnector, scheduleConnectorSchema, scheduleEntrySchema };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as FunnelLogger } from "../logger-mMZvblTx.js";
|
|
2
|
+
import { M as CallInput, N as FunnelConnectorAdapter, c as FunnelHttpClient, g as ConnectorDiagnosticLog, j as NotifyFn, r as ConnectorDescriptor } from "../connector-descriptor-F75ZI8Fh.js";
|
|
3
|
+
import { t as FunnelFlumeSourceListener } from "../flume-source-listener-CLtsdcT2.js";
|
|
4
|
+
import { a as SlackRawEvent, c as SlackMessageEvent, d as slackConnectorSchema, i as SlackProcessedSkip, l as SlackReactionEvent, n as SlackProcessed, o as SlackSkipReason, r as SlackProcessedEmit, s as SlackEvent, t as FunnelSlackEventProcessor, u as SlackConnectorConfig } from "../slack-event-processor-DmAlq4cV.js";
|
|
4
5
|
import { FlumeRuntimeDeps } from "@interactive-inc/flume";
|
|
5
|
-
|
|
6
6
|
//#region lib/engine/connectors/slack-adapter.d.ts
|
|
7
7
|
type Deps$1 = {
|
|
8
8
|
config: SlackConnectorConfig;
|
|
9
|
-
env?: NodeJS.ProcessEnv;
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
/** HTTP client injection — defaults to `NodeFunnelHttpClient`. Tests inject `MemoryFunnelHttpClient`. */
|
|
10
11
|
http?: FunnelHttpClient;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
@@ -72,10 +73,14 @@ type Deps = {
|
|
|
72
73
|
env?: NodeJS.ProcessEnv;
|
|
73
74
|
logger?: FunnelLogger;
|
|
74
75
|
diagnosticLog?: ConnectorDiagnosticLog;
|
|
75
|
-
flumeDeps?: Partial<FlumeRuntimeDeps>;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
flumeDeps?: Partial<FlumeRuntimeDeps>;
|
|
77
|
+
/** HTTP client for `auth.test` and `reactions.add`. Defaults to NodeFunnelHttpClient. */
|
|
78
|
+
http?: FunnelHttpClient;
|
|
79
|
+
/** Shutdown signal forwarded to the underlying Flume. */
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
/** See `SlackPreprocessEvent`. Default: identity (no preprocessing). */
|
|
82
|
+
preprocessEvent?: SlackPreprocessEvent;
|
|
83
|
+
/** See `SlackInteractiveHandler`. Default: drop interactive envelopes silently. */
|
|
79
84
|
onInteractive?: SlackInteractiveHandler;
|
|
80
85
|
};
|
|
81
86
|
/**
|
package/dist/connectors/slack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as slackConnectorSchema } from "../slack-connector-schema-
|
|
2
|
-
import { t as FunnelSlackEventProcessor } from "../slack-event-processor-
|
|
3
|
-
import { n as FunnelFlumeSlackListener, r as FunnelSlackAdapter, t as slackConnector } from "../slack-connector-
|
|
1
|
+
import { t as slackConnectorSchema } from "../slack-connector-schema-EGVuuqSX.js";
|
|
2
|
+
import { t as FunnelSlackEventProcessor } from "../slack-event-processor-Cs_YuI3w.js";
|
|
3
|
+
import { n as FunnelFlumeSlackListener, r as FunnelSlackAdapter, t as slackConnector } from "../slack-connector-BE0KAjCs.js";
|
|
4
4
|
export { FunnelFlumeSlackListener, FunnelSlackAdapter, FunnelSlackEventProcessor, slackConnector, slackConnectorSchema };
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -1,2 +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-
|
|
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-CnKus3Jg.js";
|
|
2
2
|
export { ChannelDiagnosis, DiagnoseAllReport, DiagnosisStatus, DiagnosticConnectionError, DiagnosticEvent, DiagnosticsChannelSource, DiagnosticsGatewayProbe, DiagnosticsPublisher, DiagnosticsTokenReader, FunnelDiagnostics, ReplayResult, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
|
package/dist/diagnostics.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-
|
|
1
|
+
import { a as toDiagnosticEvent, i as toDiagnosticConnectionError, n as previewOf, r as queryRows, t as FunnelDiagnostics } from "./funnel-diagnostics-B-PCuv_E.js";
|
|
2
2
|
export { FunnelDiagnostics, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as NodeFunnelHttpClient } from "./node-http-client-
|
|
2
|
-
import { t as errorMessageOf } from "./error-message-of-
|
|
3
|
-
import { t as discordConnectorSchema } from "./discord-connector-schema-
|
|
4
|
-
import { t as FunnelConnectorAdapter } from "./connector-adapter-
|
|
5
|
-
import { t as resolveConnectorToken } from "./resolve-connector-token-
|
|
6
|
-
import { i as resolveFlumeDeps, n as FunnelFlumeSourceListener, r as flumeLogHandler, t as slotFields } from "./slot-fields-
|
|
1
|
+
import { t as NodeFunnelHttpClient } from "./node-http-client-SX3xFh4h.js";
|
|
2
|
+
import { t as errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
|
|
3
|
+
import { t as discordConnectorSchema } from "./discord-connector-schema-saAGuPmJ.js";
|
|
4
|
+
import { t as FunnelConnectorAdapter } from "./connector-adapter-BL2ehMej.js";
|
|
5
|
+
import { t as resolveConnectorToken } from "./resolve-connector-token-BwiJCu82.js";
|
|
6
|
+
import { i as resolveFlumeDeps, n as FunnelFlumeSourceListener, r as flumeLogHandler, t as slotFields } from "./slot-fields-5ERhytIA.js";
|
|
7
7
|
import { FlumeDiscordGatewayIntents, FlumeDiscordSource } from "@interactive-inc/flume/discord";
|
|
8
8
|
//#region lib/engine/connectors/discord-adapter.ts
|
|
9
9
|
const DISCORD_API_BASE = "https://discord.com/api/v10";
|
package/dist/docs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-
|
|
1
|
+
import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-BJWawfWI.js";
|
|
2
2
|
export { DocsTopicListing, FunnelDocs };
|
package/dist/docs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FunnelDocs } from "./funnel-docs-
|
|
1
|
+
import { t as FunnelDocs } from "./funnel-docs-BFcqITFA.js";
|
|
2
2
|
export { FunnelDocs };
|
package/dist/doctor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-
|
|
1
|
+
import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-CviUTINw.js";
|
|
2
2
|
export { DoctorFixMode, DoctorReport, FunnelDoctor };
|
package/dist/doctor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FunnelDoctor } from "./funnel-doctor-
|
|
1
|
+
import { t as FunnelDoctor } from "./funnel-doctor-Csw5qjcH.js";
|
|
2
2
|
export { FunnelDoctor };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
|
|
1
|
+
import { t as FunnelLogger } from "./logger-mMZvblTx.js";
|
|
2
|
+
import { n as FunnelFileSystem } from "./file-system-BNtl997T.js";
|
|
3
|
+
import { t as ChannelConfig } from "./settings-schema-B-CKLuST.js";
|
|
4
|
+
import { n as FunnelIdGenerator } from "./settings-reader-CyTpbAre.js";
|
|
5
|
+
import { z as FunnelProcessRunner } from "./connector-descriptor-F75ZI8Fh.js";
|
|
6
6
|
//#region lib/engine/claude/channel-resolver.d.ts
|
|
7
7
|
type ChannelResolver = {
|
|
8
8
|
get(name: string): ChannelConfig | null;
|
|
@@ -25,15 +25,19 @@ type McpInstaller = {
|
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region lib/engine/claude/process-guard.d.ts
|
|
27
27
|
type ProcessGuard = {
|
|
28
|
-
/** Returns true if a live process is already registered for this profile. */
|
|
29
|
-
|
|
28
|
+
/** Returns true if a live process is already registered for this profile. */
|
|
29
|
+
isRunning(profileId: string): boolean;
|
|
30
|
+
/** Writes the PID file and registers an exit hook to clean it up. */
|
|
31
|
+
acquire(profileId: string): void;
|
|
32
|
+
/** Removes the PID file. */
|
|
30
33
|
release(profileId: string): void;
|
|
31
34
|
};
|
|
32
35
|
//#endregion
|
|
33
36
|
//#region lib/engine/claude/session-store.d.ts
|
|
34
37
|
type SessionStore = {
|
|
35
38
|
getSessionId(profileId: string): string | null;
|
|
36
|
-
setSessionId(profileId: string, sessionId: string): void;
|
|
39
|
+
setSessionId(profileId: string, sessionId: string): void;
|
|
40
|
+
/** Returns true when the session jsonl exists on disk and is non-empty. */
|
|
37
41
|
sessionFileExists(cwd: string, sessionId: string, env: Record<string, string>): boolean;
|
|
38
42
|
};
|
|
39
43
|
//#endregion
|
|
@@ -41,8 +45,10 @@ type SessionStore = {
|
|
|
41
45
|
type LaunchCommon = {
|
|
42
46
|
channel: string;
|
|
43
47
|
cwd?: string;
|
|
44
|
-
userArgs?: string[];
|
|
45
|
-
|
|
48
|
+
userArgs?: string[];
|
|
49
|
+
/** Args prepended to the claude argv (typically a profile's recipe). Defaults to none. */
|
|
50
|
+
options?: string[];
|
|
51
|
+
/** Env vars layered under the launched claude process. process.env wins on collision. */
|
|
46
52
|
env?: Record<string, string>;
|
|
47
53
|
/** Invoked synchronously after the child claude process has been spawned, with its PID.
|
|
48
54
|
* Useful for hosts that need to register the spawned process before it exits
|
|
@@ -56,18 +62,17 @@ type LaunchCommon = {
|
|
|
56
62
|
/**
|
|
57
63
|
* A launch carries one of two targets, distinguished by `profileId`.
|
|
58
64
|
*
|
|
59
|
-
* - **profile launch** — has a stable `profileId` (uuid
|
|
60
|
-
* via the PID file and
|
|
65
|
+
* - **profile launch** — has a stable `profileId` (a global uuid or a
|
|
66
|
+
* deterministic repo-local id). Enforces singleton-ness via the PID file and
|
|
67
|
+
* may opt into `resume` to reuse the profile's session.
|
|
61
68
|
* - **profile-less launch** — raw `--channel`. Never enforces singleton-ness and
|
|
62
69
|
* always starts a fresh session, so `resume` is meaningless and disallowed.
|
|
63
70
|
*
|
|
64
|
-
* Modeling these as a union
|
|
65
|
-
* `resume` without a `profileId` a compile error — previously it was silently
|
|
66
|
-
* ignored, which masked real bugs (a profile resume that never took effect).
|
|
71
|
+
* Modeling these as a union makes `resume` without a profile id a compile error.
|
|
67
72
|
*/
|
|
68
73
|
type LaunchTarget = {
|
|
69
|
-
/** Stable id of the launching profile
|
|
70
|
-
*
|
|
74
|
+
/** Stable id of the launching profile. Keys the singleton PID file and
|
|
75
|
+
* the resumable session. */
|
|
71
76
|
profileId: string;
|
|
72
77
|
/** Inject `--session-id`/`--resume` for this profile (opt-in, default false).
|
|
73
78
|
* The persisted session is owned by the profile (by id). */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region lib/engine/fs/file-system.d.ts
|
|
2
2
|
type FileStat = {
|
|
3
|
-
mtimeMs: number;
|
|
3
|
+
mtimeMs: number;
|
|
4
|
+
/** POSIX mode bits (e.g. 0o600). `null` when the underlying FS does not expose mode. */
|
|
4
5
|
mode: number | null;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as FunnelLogger } from "./logger-mMZvblTx.js";
|
|
2
|
+
import { A as FunnelConnectorListener, g as ConnectorDiagnosticLog, h as ConnectorConnectionStatus } from "./connector-descriptor-F75ZI8Fh.js";
|
|
2
3
|
import { FlumeEventHandler, FlumeLogHandler, FlumeReconnectOptions, FlumeRunning, FlumeRuntimeDeps, FlumeSource, FlumeStatus } from "@interactive-inc/flume";
|
|
3
|
-
|
|
4
4
|
//#region lib/engine/connectors/connector-diagnostics-recorder.d.ts
|
|
5
5
|
type Props$1 = {
|
|
6
6
|
type: string;
|
|
@@ -23,15 +23,18 @@ declare class FunnelConnectorDiagnosticsRecorder {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region lib/engine/connectors/flume-source-listener.d.ts
|
|
25
25
|
type Props = {
|
|
26
|
-
/** Funnel connector type ("slack" / "discord" / "gh") — stamped onto diagnostic rows. */
|
|
26
|
+
/** Funnel connector type ("slack" / "discord" / "gh") — stamped onto diagnostic rows. */
|
|
27
|
+
type: string;
|
|
27
28
|
connectorId: string;
|
|
28
29
|
channelId: string | null;
|
|
29
30
|
logger?: FunnelLogger;
|
|
30
31
|
diagnosticLog?: ConnectorDiagnosticLog;
|
|
31
32
|
};
|
|
32
33
|
type RunStartOptions = {
|
|
33
|
-
source: FlumeSource;
|
|
34
|
-
|
|
34
|
+
source: FlumeSource;
|
|
35
|
+
/** Typed event handler — receives the source's events only (logs are routed separately). */
|
|
36
|
+
onEvent: FlumeEventHandler;
|
|
37
|
+
/** Optional log handler for everything the firehose emits (including status transitions). */
|
|
35
38
|
onLog?: FlumeLogHandler;
|
|
36
39
|
deps?: FlumeRuntimeDeps;
|
|
37
40
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as gatewayLoopbackUrl, t as loopbackFetch } from "./loopback-fetch-
|
|
2
|
-
import { t as errorMessageOf } from "./error-message-of-
|
|
3
|
-
import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-
|
|
1
|
+
import { n as gatewayLoopbackUrl, t as loopbackFetch } from "./loopback-fetch-HP-bo9Kv.js";
|
|
2
|
+
import { t as errorMessageOf } from "./error-message-of-BG4ezZ_s.js";
|
|
3
|
+
import { t as ConnectorDiagnosticSqlReader } from "./diagnostic-sql-reader-CoBk_EFF.js";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
//#region lib/services/diagnostics/diagnostic-event.ts
|
|
@@ -164,6 +164,7 @@ const diagnoseSlackEventSubscriptionGap = (report) => {
|
|
|
164
164
|
* mutation; pair with FunnelRecovery for self-healing actions.
|
|
165
165
|
*/
|
|
166
166
|
var FunnelDiagnostics = class {
|
|
167
|
+
props;
|
|
167
168
|
constructor(props) {
|
|
168
169
|
this.props = props;
|
|
169
170
|
Object.freeze(this);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { t as ChannelConfig } from "./settings-schema-
|
|
2
|
-
|
|
1
|
+
import { t as ChannelConfig } from "./settings-schema-B-CKLuST.js";
|
|
3
2
|
//#region lib/engine/diagnostic-log/diagnostic-sql-reader.d.ts
|
|
4
3
|
type Props$1 = {
|
|
5
|
-
/** SQLite file holding the raw (pre-filter) table. */
|
|
6
|
-
|
|
4
|
+
/** SQLite file holding the raw (pre-filter) table. */
|
|
5
|
+
rawPath: string;
|
|
6
|
+
/** SQLite file holding the processed (verdict) table. */
|
|
7
|
+
processedPath: string;
|
|
8
|
+
/** SQLite file holding the connection (lifecycle) table. */
|
|
7
9
|
connectionPath: string;
|
|
8
10
|
};
|
|
9
11
|
type Row = Record<string, unknown>;
|
|
@@ -111,7 +113,8 @@ type ChannelDiagnosis = {
|
|
|
111
113
|
* but the probe failed (auth refused, fetch error, non-OK response).
|
|
112
114
|
*/
|
|
113
115
|
statusError: string | null;
|
|
114
|
-
};
|
|
116
|
+
};
|
|
117
|
+
/** Connectors declared in settings for this channel. */
|
|
115
118
|
configuredConnectors: number;
|
|
116
119
|
listeners: Array<{
|
|
117
120
|
name: string;
|
|
@@ -378,6 +378,10 @@ what funnel never writes to funnel.json:
|
|
|
378
378
|
|
|
379
379
|
~/.funnel/projects/<id>/settings.json per-repo, set via CLI or TTY prompt
|
|
380
380
|
|
|
381
|
+
When a profile declares resume: true, its generated Claude session id lives
|
|
382
|
+
in ~/.funnel/projects/<id>/claude/local-sessions.json. The id is runtime
|
|
383
|
+
state and is never written to the committed funnel.json.
|
|
384
|
+
|
|
381
385
|
how it is read:
|
|
382
386
|
|
|
383
387
|
All CLI commands check for funnel.json in cwd. If found, FUNNEL_DIR is
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-
|
|
2
|
-
import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-
|
|
3
|
-
|
|
1
|
+
import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-CnKus3Jg.js";
|
|
2
|
+
import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-BwcSNNSN.js";
|
|
4
3
|
//#region lib/services/doctor/funnel-doctor.d.ts
|
|
5
4
|
type Props = {
|
|
6
5
|
diagnostics: FunnelDiagnostics;
|
|
7
6
|
recovery: FunnelRecovery;
|
|
8
7
|
};
|
|
9
|
-
type DoctorFixMode =
|
|
8
|
+
type DoctorFixMode =
|
|
9
|
+
/** No mutations. Run diagnoseAll and report what would be fixed. */
|
|
10
|
+
"off" |
|
|
11
|
+
/** Apply only idempotent, low-risk fixes — start the gateway, restart dead listeners. */
|
|
12
|
+
"safe" |
|
|
13
|
+
/** Add high-impact fixes — full gateway restart when partial fixes are insufficient. */
|
|
14
|
+
"aggressive";
|
|
10
15
|
type DoctorReport = {
|
|
11
|
-
/** "ok" if every channel is healthy after the run; "warn" if anything is still off; "error" if a fix step itself failed. */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
/** "ok" if every channel is healthy after the run; "warn" if anything is still off; "error" if a fix step itself failed. */
|
|
17
|
+
status: "ok" | "warn" | "error";
|
|
18
|
+
/** Human-readable summary suitable for stdout. */
|
|
19
|
+
message: string;
|
|
20
|
+
/** Aggregated diagnosis after any fix pass. */
|
|
21
|
+
after: DiagnoseAllReport;
|
|
22
|
+
/** Diagnosis before fixing, only included when fix mode is not "off". */
|
|
23
|
+
before: DiagnoseAllReport | null;
|
|
24
|
+
/** Each recovery action that ran during the fix pass. */
|
|
25
|
+
appliedActions: RecoveryAction[];
|
|
26
|
+
/** Channels still unhealthy after the fix pass (or all unhealthy channels when fix is off). */
|
|
16
27
|
remainingIssues: Array<{
|
|
17
28
|
channel: string;
|
|
18
29
|
diagnosis: ChannelDiagnosis["diagnosis"];
|