@interactive-inc/claude-funnel 0.53.0 → 0.56.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 +3 -3
- package/dist/bin.js +1229 -486
- package/dist/claude.d.ts +22 -5
- package/dist/claude.js +455 -168
- package/dist/{connector-adapter-CePYBTgW.d.ts → connector-adapter-1PxjN-Uk.d.ts} +1 -1
- package/dist/{connector-adapter-D5Utumgz.js → connector-adapter-qwXLjQId.js} +1 -1
- package/dist/{connector-listener-DU54DN-f.js → connector-listener-CpHBecCj.js} +1 -1
- package/dist/connectors/discord.d.ts +6 -6
- package/dist/connectors/discord.js +2 -2
- package/dist/connectors/gh.d.ts +6 -6
- package/dist/connectors/gh.js +2 -2
- package/dist/connectors/schedule.d.ts +12 -2
- package/dist/connectors/schedule.js +2 -2
- package/dist/connectors/slack.d.ts +3 -3
- package/dist/connectors/slack.js +2 -2
- package/dist/{connector-diagnostic-log-yTOojKUR.d.ts → diagnostic-log-Bxe7Bbvw.d.ts} +2 -2
- package/dist/diagnostic-sql-reader-CzYgZpq2.js +83 -0
- package/dist/diagnostics.d.ts +2 -0
- package/dist/diagnostics.js +2 -0
- package/dist/{discord-connector-schema-CBDyGdOI.js → discord-connector-schema-B_N6IXLz.js} +1 -1
- package/dist/{discord-connector-schema-R0Uu-3ns.d.ts → discord-connector-schema-CPgcZkXh.d.ts} +1 -1
- package/dist/{discord-listener-_jSE3HsQ.js → discord-listener-C0MoKdQO.js} +6 -6
- package/dist/docs.d.ts +2 -0
- package/dist/docs.js +2 -0
- package/dist/doctor.d.ts +2 -0
- package/dist/doctor.js +2 -0
- package/dist/{file-process-guard-DMeLB6Zd.d.ts → file-process-guard-DI1742H5.d.ts} +5 -4
- package/dist/funnel-diagnostics-BpKYrMSu.js +300 -0
- package/dist/funnel-diagnostics-qWy5tPSq.d.ts +176 -0
- package/dist/funnel-docs-dXPokzr5.d.ts +18 -0
- package/dist/funnel-docs-ng5K8w4j.js +653 -0
- package/dist/funnel-doctor-BF3Rdgk0.d.ts +34 -0
- package/dist/funnel-doctor-CApCezTq.js +82 -0
- package/dist/funnel-recovery-BUBsu7WX.d.ts +101 -0
- package/dist/funnel-recovery-D9CxD5Zs.js +134 -0
- package/dist/gateway/daemon.js +838 -252
- package/dist/{gateway-base-url-ssk_He5G.js → gateway-base-url-6foMXfFf.js} +5 -5
- package/dist/gateway.d.ts +2 -2
- package/dist/gateway.js +2 -2
- package/dist/{gh-connector-schema-eoTtHbY6.d.ts → gh-connector-schema-CU1ojfIF.d.ts} +1 -1
- package/dist/{gh-connector-schema-o3Q1-ojL.js → gh-connector-schema-DUcZgN2Q.js} +1 -1
- package/dist/{gh-listener-DH-fClQm.js → gh-listener-Dsx6AmhH.js} +5 -5
- package/dist/{index-DF5VmCPJ.d.ts → index-CrngHrne.d.ts} +104 -607
- package/dist/index.d.ts +16 -11
- package/dist/index.js +509 -973
- package/dist/{local-config-json-schema-D8i-BogY.js → local-config-json-schema-DE1zkMcb.js} +12 -8
- package/dist/{local-config-sync-Cq39mT6p.d.ts → local-config-sync-B8b04LrZ.d.ts} +21 -16
- package/dist/local-config.d.ts +2 -2
- package/dist/local-config.js +2 -2
- package/dist/{memory-connector-diagnostic-log-COUWCsT_.js → memory-diagnostic-log-BbFVqDzz.js} +30 -95
- package/dist/{memory-token-prompter-CKV7VBM5.d.ts → memory-token-prompter-Lo3YRDzq.d.ts} +4 -4
- package/dist/{memory-token-prompter-Q7Snwsv2.js → memory-token-prompter-vBXxY20-.js} +2 -2
- package/dist/{profiles-f0mNmEyP.d.ts → profiles-EHTeCOqB.d.ts} +3 -2
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/recovery.d.ts +2 -0
- package/dist/recovery.js +2 -0
- package/dist/{resolve-connector-token-BHmZLRrV.js → resolve-connector-token-CczqG_Ig.js} +1 -1
- package/dist/{schedule-connector-schema-iCI61gzU.js → schedule-connector-schema-B_xO5z5B.js} +1 -1
- package/dist/{schedule-listener-CUyUFFR1.d.ts → schedule-listener-DKh0hnkK.d.ts} +5 -5
- package/dist/{schedule-listener-ePAjians.js → schedule-listener-DP9Jhc6U.js} +14 -4
- package/dist/settings-reader-CBrgz01o.d.ts +18 -0
- package/dist/{settings-reader-BSU6JyvM.d.ts → settings-schema-zhnMIa8I.d.ts} +1 -16
- package/dist/{slack-connector-schema-BCNWluHM.js → slack-connector-schema-C1zEf4TG.js} +1 -1
- package/dist/{slack-listener-Bv5xI9gC.d.ts → slack-listener-COQA8wAZ.d.ts} +4 -4
- package/dist/{slack-listener-ClQuHhEF.js → slack-listener-DUKPcpJH.js} +7 -7
- package/dist/{mcp-QeNCBhOD.js → yaml-render-OhUN-qkS.js} +52 -34
- package/package.json +21 -1
- /package/dist/{file-system-BeOKXjlV.d.ts → file-system-Wub9Nto4.d.ts} +0 -0
- /package/dist/{process-runner-DfniuWVU.d.ts → process-runner-D5I_jhYQ.d.ts} +0 -0
- /package/dist/{profiles-wMRnjSid.js → profiles-MnXvYfZF.js} +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { t as ChannelConfig } from "./settings-schema-zhnMIa8I.js";
|
|
2
|
+
|
|
3
|
+
//#region lib/gateway/diagnostic-log/diagnostic-sql-reader.d.ts
|
|
4
|
+
type Props$1 = {
|
|
5
|
+
/** SQLite file holding the raw (pre-filter) table. */rawPath: string; /** SQLite file holding the processed (verdict) table. */
|
|
6
|
+
processedPath: string; /** SQLite file holding the connection (lifecycle) table. */
|
|
7
|
+
connectionPath: string;
|
|
8
|
+
};
|
|
9
|
+
type Row = Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Read-only SQL surface over the three diagnostic tables, for Claude to query
|
|
12
|
+
* the log with arbitrary `SELECT`s. It opens all files read-only and exposes
|
|
13
|
+
* three views — `raw`, `processed`, `connection` — that hide the storage
|
|
14
|
+
* details (the physical table is `leuco_log` and each row's columns live
|
|
15
|
+
* inside a JSON `event` blob): the views surface the columns as plain fields,
|
|
16
|
+
* with `payload` already pulled out of the nested JSON.
|
|
17
|
+
*
|
|
18
|
+
* The tables are separate files. `raw` and `processed` share an `event_id`,
|
|
19
|
+
* so a `JOIN` answers "the event arrived, but what verdict did it get?";
|
|
20
|
+
* `connection` answers the other half — "did the listener ever connect at
|
|
21
|
+
* all?". Writes are impossible: the connection is read-only and `query`
|
|
22
|
+
* rejects anything but a single `SELECT`.
|
|
23
|
+
*/
|
|
24
|
+
declare class ConnectorDiagnosticSqlReader {
|
|
25
|
+
private readonly db;
|
|
26
|
+
constructor(props: Props$1);
|
|
27
|
+
/**
|
|
28
|
+
* Run one read-only `SELECT` and return the rows. Returns an `Error` (rather
|
|
29
|
+
* than throwing) for a non-SELECT statement or a SQL error, so the caller
|
|
30
|
+
* can surface the message without a stack trace.
|
|
31
|
+
*/
|
|
32
|
+
query(sql: string, params?: (string | number | null)[]): Row[] | Error;
|
|
33
|
+
close(): void;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region lib/services/diagnostics/diagnostic-event.d.ts
|
|
37
|
+
type DiagnosticEvent = {
|
|
38
|
+
seq: number | null;
|
|
39
|
+
ts: number | null;
|
|
40
|
+
type: string;
|
|
41
|
+
outcome: string;
|
|
42
|
+
eventId: string | null;
|
|
43
|
+
payload: string | null;
|
|
44
|
+
payloadParsed: Record<string, unknown> | null;
|
|
45
|
+
preview: string | null;
|
|
46
|
+
};
|
|
47
|
+
type DiagnosticConnectionError = {
|
|
48
|
+
seq: number | null;
|
|
49
|
+
ts: number | null;
|
|
50
|
+
type: string;
|
|
51
|
+
status: string;
|
|
52
|
+
detail: string | null;
|
|
53
|
+
};
|
|
54
|
+
declare const previewOf: (payload: unknown) => string | null;
|
|
55
|
+
declare const toDiagnosticEvent: (row: Record<string, unknown>) => DiagnosticEvent;
|
|
56
|
+
declare const toDiagnosticConnectionError: (row: Record<string, unknown>) => DiagnosticConnectionError;
|
|
57
|
+
declare const queryRows: (reader: ConnectorDiagnosticSqlReader, sql: string, params: (string | number | null)[]) => Record<string, unknown>[] | Error;
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region lib/services/diagnostics/funnel-diagnostics.d.ts
|
|
60
|
+
/** Narrow channel registry — only `list()` is needed. */
|
|
61
|
+
type DiagnosticsChannelSource = {
|
|
62
|
+
list(): ChannelConfig[];
|
|
63
|
+
};
|
|
64
|
+
/** Narrow gateway probe — only the daemon status is needed. */
|
|
65
|
+
type DiagnosticsGatewayProbe = {
|
|
66
|
+
getStatus(): {
|
|
67
|
+
running: boolean;
|
|
68
|
+
pid: number | null;
|
|
69
|
+
port: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/** Narrow token reader — diagnostics only needs to read the token, never to mint or rotate it. */
|
|
73
|
+
type DiagnosticsTokenReader = {
|
|
74
|
+
read(): string | null;
|
|
75
|
+
};
|
|
76
|
+
/** Narrow publisher used only for replay. */
|
|
77
|
+
type DiagnosticsPublisher = {
|
|
78
|
+
publish(channelName: string, request: {
|
|
79
|
+
content: string;
|
|
80
|
+
connector?: string;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
state: "ok";
|
|
83
|
+
offset: number;
|
|
84
|
+
} | {
|
|
85
|
+
state: "offline";
|
|
86
|
+
} | {
|
|
87
|
+
state: "error";
|
|
88
|
+
reason: string;
|
|
89
|
+
}>;
|
|
90
|
+
};
|
|
91
|
+
type Props = {
|
|
92
|
+
gateway: DiagnosticsGatewayProbe;
|
|
93
|
+
gatewayToken: DiagnosticsTokenReader;
|
|
94
|
+
channels: DiagnosticsChannelSource;
|
|
95
|
+
publisher: DiagnosticsPublisher;
|
|
96
|
+
tmpDir: string;
|
|
97
|
+
};
|
|
98
|
+
type DiagnosisStatus = "ok" | "warn" | "error";
|
|
99
|
+
type ChannelDiagnosis = {
|
|
100
|
+
channel: string;
|
|
101
|
+
channelId: string;
|
|
102
|
+
gateway: {
|
|
103
|
+
running: boolean;
|
|
104
|
+
pid: number | null;
|
|
105
|
+
port: number | null;
|
|
106
|
+
uptimeMs: number | null;
|
|
107
|
+
};
|
|
108
|
+
listeners: Array<{
|
|
109
|
+
name: string;
|
|
110
|
+
type: string;
|
|
111
|
+
alive: boolean;
|
|
112
|
+
events: number;
|
|
113
|
+
errors: number;
|
|
114
|
+
lastEventAt: string | null;
|
|
115
|
+
}>;
|
|
116
|
+
claudeClients: number;
|
|
117
|
+
recentEvents: DiagnosticEvent[];
|
|
118
|
+
connectionErrors: DiagnosticConnectionError[];
|
|
119
|
+
diagnosis: {
|
|
120
|
+
status: DiagnosisStatus;
|
|
121
|
+
message: string;
|
|
122
|
+
nextActions: string[];
|
|
123
|
+
rootCause: string | null;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
type DiagnoseAllReport = {
|
|
127
|
+
summary: {
|
|
128
|
+
total: number;
|
|
129
|
+
ok: number;
|
|
130
|
+
warn: number;
|
|
131
|
+
error: number;
|
|
132
|
+
criticalChannels: string[];
|
|
133
|
+
warnChannels: string[];
|
|
134
|
+
suggestedActions: string[];
|
|
135
|
+
};
|
|
136
|
+
channels: ChannelDiagnosis[];
|
|
137
|
+
};
|
|
138
|
+
type ReplayResult = {
|
|
139
|
+
state: "ok";
|
|
140
|
+
seq: number | null;
|
|
141
|
+
offset: number;
|
|
142
|
+
preview: string | null;
|
|
143
|
+
} | {
|
|
144
|
+
state: "offline";
|
|
145
|
+
} | {
|
|
146
|
+
state: "error";
|
|
147
|
+
reason: string;
|
|
148
|
+
} | {
|
|
149
|
+
state: "not-found";
|
|
150
|
+
};
|
|
151
|
+
type StorePaths = {
|
|
152
|
+
rawPath: string;
|
|
153
|
+
processedPath: string;
|
|
154
|
+
connectionPath: string;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Programmable diagnostics surface — used by both the CLI (fnl debug …) and
|
|
158
|
+
* the MCP tools (fnl_debug, fnl_recent_events, …). Pure read-side, no
|
|
159
|
+
* mutation; pair with FunnelRecovery for self-healing actions.
|
|
160
|
+
*/
|
|
161
|
+
declare class FunnelDiagnostics {
|
|
162
|
+
private readonly props;
|
|
163
|
+
constructor(props: Props);
|
|
164
|
+
diagnose(channelName?: string): Promise<ChannelDiagnosis | null>;
|
|
165
|
+
diagnoseAll(): Promise<DiagnoseAllReport>;
|
|
166
|
+
recentEvents(channelName: string | null, limit?: number): Promise<DiagnosticEvent[]>;
|
|
167
|
+
droppedEvents(channelName: string | null, limit?: number): Promise<DiagnosticEvent[]>;
|
|
168
|
+
connectionErrors(channelName: string | null, limit?: number): Promise<DiagnosticConnectionError[]>;
|
|
169
|
+
replay(channelName: string, seq?: number): Promise<ReplayResult>;
|
|
170
|
+
resolveStore(): StorePaths | null;
|
|
171
|
+
private resolveChannelId;
|
|
172
|
+
private fetchGatewayStatus;
|
|
173
|
+
private buildChannelDiagnosis;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { DiagnosticsGatewayProbe as a, FunnelDiagnostics as c, DiagnosticEvent as d, previewOf as f, ConnectorDiagnosticSqlReader as g, toDiagnosticEvent as h, DiagnosticsChannelSource as i, ReplayResult as l, toDiagnosticConnectionError as m, DiagnoseAllReport as n, DiagnosticsPublisher as o, queryRows as p, DiagnosisStatus as r, DiagnosticsTokenReader as s, ChannelDiagnosis as t, DiagnosticConnectionError as u };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region lib/services/docs/funnel-docs.d.ts
|
|
2
|
+
type DocsTopicListing = {
|
|
3
|
+
name: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Programmable docs surface — used by both the CLI (fnl docs <topic>) and the
|
|
8
|
+
* MCP / SDK consumers. Docs are embedded into the build so a Claude session
|
|
9
|
+
* can self-discover funnel's vocabulary without external network access.
|
|
10
|
+
*/
|
|
11
|
+
declare class FunnelDocs {
|
|
12
|
+
constructor();
|
|
13
|
+
list(): DocsTopicListing[];
|
|
14
|
+
get(topic: string): string | null;
|
|
15
|
+
topics(): string[];
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { FunnelDocs as n, DocsTopicListing as t };
|