@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.
- package/README.md +9 -3
- package/dist/bin.js +549 -487
- package/dist/channels-2g_BU1N0.d.ts +174 -0
- package/dist/claude.d.ts +9 -5
- package/dist/claude.js +54 -17
- package/dist/{diagnostic-log-Cb3v8P7p.d.ts → connector-descriptor-6SXJoszo.d.ts} +158 -2
- package/dist/connectors/discord.d.ts +30 -4
- package/dist/connectors/discord.js +2 -2
- package/dist/connectors/gh.d.ts +21 -5
- package/dist/connectors/gh.js +3 -3
- package/dist/connectors/schedule.d.ts +124 -2
- package/dist/connectors/schedule.js +3 -3
- package/dist/connectors/slack.d.ts +149 -5
- package/dist/connectors/slack.js +2 -2
- package/dist/{diagnostic-sql-reader-CzYgZpq2.js → diagnostic-sql-reader-C9zR-Csp.js} +5 -5
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.js +1 -1
- package/dist/{discord-listener-CKsZGTnH.js → discord-connector-BL36yvbL.js} +60 -37
- 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/error-message-of-Byi4y0Uf.js +9 -0
- package/dist/{file-process-guard-JhFpmHYo.d.ts → file-process-guard-DOlCr4GF.d.ts} +4 -5
- package/dist/{funnel-diagnostics-BpKYrMSu.js → funnel-diagnostics-CSiJmPlZ.js} +19 -2
- package/dist/{funnel-diagnostics-K-wON25Y.d.ts → funnel-diagnostics-DpXOsCty.d.ts} +3 -3
- package/dist/{funnel-docs-ng5K8w4j.js → funnel-docs-BxXZ9Ksx.js} +76 -3
- package/dist/{funnel-docs-DYBs1-H_.d.ts → funnel-docs-CNklHvbt.d.ts} +1 -1
- package/dist/{funnel-doctor-vxO96TCA.d.ts → funnel-doctor-CZf_0Luq.d.ts} +2 -2
- package/dist/{funnel-recovery-COExL9MD.d.ts → funnel-recovery-DnLrdWO9.d.ts} +1 -1
- package/dist/gateway/daemon.js +326 -266
- package/dist/gateway-base-url-Dy4Ykuoh.js +14 -0
- package/dist/gateway.d.ts +2 -2
- package/dist/gateway.js +2 -2
- package/dist/{gh-listener-B2I4s8qh.js → gh-connector-DpiixfQZ.js} +53 -5
- package/dist/gh-connector-schema-Rzwc1c1N.js +12 -0
- package/dist/http-client-oICicjuO.d.ts +18 -0
- package/dist/index-CgY8NdMz.d.ts +1057 -0
- package/dist/index.d.ts +1558 -17
- package/dist/index.js +374 -342
- package/dist/{local-config-json-schema-DE1zkMcb.js → local-config-json-schema-JyLqOQNX.js} +9 -5
- package/dist/local-config-sync-Dh1Croqe.d.ts +169 -0
- package/dist/local-config.d.ts +2 -2
- package/dist/local-config.js +2 -2
- package/dist/logger.js +1 -1
- package/dist/{memory-diagnostic-log-B9Us7X05.js → memory-diagnostic-log-CI60kNfB.js} +33 -18
- package/dist/{memory-token-prompter-CcShtF8B.d.ts → memory-token-prompter-B4sjyaAq.d.ts} +2 -2
- package/dist/{memory-token-prompter-C7vREzCL.js → memory-token-prompter-CZde7e6y.js} +1 -1
- package/dist/{node-file-system-BcrmWN9I.js → node-file-system-Blr8pAir.js} +1 -1
- package/dist/node-http-client-lowp60Oa.js +25 -0
- package/dist/{gh-connector-schema-ClPLSYD9.js → node-process-runner-DxTvycoK.js} +1 -12
- package/dist/{profiles-g2qGVOWv.d.ts → profiles-Cy5wXQ0L.d.ts} +3 -3
- package/dist/{profiles-MnXvYfZF.js → profiles-DSzTeKQw.js} +1 -1
- 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-listener-DP9Jhc6U.js → schedule-connector-L4uzg5M8.js} +109 -9
- package/dist/{settings-reader-DPwqOVUm.d.ts → settings-reader-BIFB_j2f.d.ts} +1 -1
- package/dist/settings-schema-D1xcOqRu.d.ts +78 -0
- package/dist/{gateway-base-url-DxVjjDoW.js → settings-store-CUKSeTXC.js} +27 -29
- package/dist/{slack-listener-C4wlZaOq.js → slack-connector-DQIFPdBF.js} +67 -12
- package/dist/slot-fields-CMoRpwuy.js +45 -0
- package/dist/{yaml-render-cZu6CxkE.js → yaml-render-qW34NlYz.js} +4 -4
- package/package.json +1 -1
- package/dist/connector-adapter-DGacCppE.d.ts +0 -25
- package/dist/discord-connector-schema-CQyfDkLD.d.ts +0 -39
- package/dist/gh-connector-schema-CZzwzvqY.d.ts +0 -14
- package/dist/index-D7mjirUL.d.ts +0 -3602
- package/dist/local-config-sync-BGPAS9Be.d.ts +0 -401
- package/dist/process-runner-DIm1cy95.d.ts +0 -52
- package/dist/resolve-connector-token-CczqG_Ig.js +0 -22
- package/dist/schedule-listener-DoMPjHZj.d.ts +0 -112
- package/dist/settings-schema-1hh11jnN.d.ts +0 -152
- package/dist/slack-listener-Dj9NFbAJ.d.ts +0 -136
- /package/dist/{connector-adapter-qwXLjQId.js → connector-adapter-DU9Rvyec.js} +0 -0
- /package/dist/{connector-listener-CpHBecCj.js → connector-listener-DR3aKOuK.js} +0 -0
- /package/dist/{file-system-PWKKU7lA.js → file-system-Wvzc2ePY.js} +0 -0
- /package/dist/{file-system-DxpnnUVb.d.ts → file-system-o51IsM0W.d.ts} +0 -0
- /package/dist/{funnel-doctor-CApCezTq.js → funnel-doctor-DiJCjHsg.js} +0 -0
- /package/dist/{funnel-log-sqlite-sink-B_5_4ybn.js → funnel-log-sqlite-sink-kqJbx2H7.js} +0 -0
- /package/dist/{funnel-recovery-D9CxD5Zs.js → funnel-recovery-BFdPjL6Z.js} +0 -0
- /package/dist/{logger-BP6SisKt.js → logger-B6iyNbxM.js} +0 -0
- /package/dist/{schedule-connector-schema-B_xO5z5B.js → schedule-connector-schema-CfyuMCMh.js} +0 -0
- /package/dist/{settings-reader-DPqrpV7s.js → settings-reader-CtQ-Ix8_.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#endregion
|
|
2
|
-
//#region lib/
|
|
2
|
+
//#region lib/engine/docs/funnel-docs.ts
|
|
3
3
|
const DOCS = {
|
|
4
4
|
architecture: `funnel docs architecture — how Funnel routes events
|
|
5
5
|
|
|
@@ -492,8 +492,12 @@ Hono app over these services.
|
|
|
492
492
|
── facade ──────────────────────────────────────────────────────────────────
|
|
493
493
|
|
|
494
494
|
import { Funnel } from "@interactive-inc/claude-funnel"
|
|
495
|
+
import { slackConnector } from "@interactive-inc/claude-funnel/connectors/slack"
|
|
495
496
|
|
|
496
|
-
|
|
497
|
+
// Connectors are fully DI: pass only the types you use. The core import never
|
|
498
|
+
// bundles a connector SDK (@slack/bolt, discord.js) — importing the sub-entry
|
|
499
|
+
// does. With no connectors, the funnel handles zero connector types.
|
|
500
|
+
const funnel = new Funnel({ connectors: [slackConnector()] }) // uses ~/.funnel
|
|
497
501
|
const sandbox = Funnel.inMemory() // touches no disk / process / clock
|
|
498
502
|
|
|
499
503
|
funnel.paths // { dir, tmpDir, settings }
|
|
@@ -534,6 +538,72 @@ For targeted imports (smaller bundle / clearer dependency footprint):
|
|
|
534
538
|
import { FunnelGatewayServer } from "@interactive-inc/claude-funnel/gateway"
|
|
535
539
|
import { FunnelProfiles } from "@interactive-inc/claude-funnel/profiles"
|
|
536
540
|
import { FunnelLocalConfig } from "@interactive-inc/claude-funnel/local-config"
|
|
541
|
+
import { slackConnector } from "@interactive-inc/claude-funnel/connectors/slack"
|
|
542
|
+
import { ghConnector } from "@interactive-inc/claude-funnel/connectors/gh"
|
|
543
|
+
import { discordConnector } from "@interactive-inc/claude-funnel/connectors/discord"
|
|
544
|
+
import { scheduleConnector } from "@interactive-inc/claude-funnel/connectors/schedule"
|
|
545
|
+
|
|
546
|
+
// Connector launch hooks are closed over by the descriptor factory:
|
|
547
|
+
// slackConnector({ onAppCreated, preprocessEvent })
|
|
548
|
+
// scheduleConnector({ onFired })
|
|
549
|
+
|
|
550
|
+
── in-process gateway: receive events in your own process ──────────────────
|
|
551
|
+
|
|
552
|
+
The daemon (funnel.gateway.start()) runs in a separate process, so your code
|
|
553
|
+
cannot observe its events directly. To receive events in-process, host the
|
|
554
|
+
gateway yourself with gatewayServer():
|
|
555
|
+
|
|
556
|
+
import { Funnel, channelWsUrl } from "@interactive-inc/claude-funnel"
|
|
557
|
+
import { slackConnector } from "@interactive-inc/claude-funnel/connectors/slack"
|
|
558
|
+
|
|
559
|
+
const funnel = new Funnel({ connectors: [slackConnector()] })
|
|
560
|
+
funnel.channels.add({ name: "inbox" })
|
|
561
|
+
funnel.channels.addConnector("inbox", {
|
|
562
|
+
type: "slack", name: "ops",
|
|
563
|
+
botTokenEnv: "SLACK_BOT_TOKEN", appTokenEnv: "SLACK_APP_TOKEN",
|
|
564
|
+
})
|
|
565
|
+
|
|
566
|
+
const server = funnel.gatewayServer({ port: 9742 })
|
|
567
|
+
await server.start() // boots listeners, binds HTTP + WS
|
|
568
|
+
server.port // resolved port (use port: 0 to auto-assign)
|
|
569
|
+
|
|
570
|
+
const unsubscribe = server.onEvent((event) => {
|
|
571
|
+
console.log(event.content, event.meta, event.offset)
|
|
572
|
+
})
|
|
573
|
+
|
|
574
|
+
await funnel.publisher.publish("inbox", { content: "hello" })
|
|
575
|
+
|
|
576
|
+
unsubscribe()
|
|
577
|
+
await server.stop() // stops listeners, closes the socket
|
|
578
|
+
|
|
579
|
+
To observe a daemon (separate process) instead, connect a WebSocket client:
|
|
580
|
+
|
|
581
|
+
const url = channelWsUrl({ base: "ws://127.0.0.1:9743/ws", channel: "inbox" })
|
|
582
|
+
const ws = new WebSocket(url, channelWsProtocols(token))
|
|
583
|
+
|
|
584
|
+
── publishing: publisher.publish vs server emit ────────────────────────────
|
|
585
|
+
|
|
586
|
+
funnel.publisher.publish(channel, req) // HTTP hop to the daemon; works from
|
|
587
|
+
// any process; returns { state: "ok" |
|
|
588
|
+
// "offline" | "error" }
|
|
589
|
+
server.emit(event) // direct in-process injection into a
|
|
590
|
+
// gatewayServer() you host yourself;
|
|
591
|
+
// no HTTP, no offline state
|
|
592
|
+
|
|
593
|
+
Rule of thumb: talking to the shared daemon → publish; hosting the gateway
|
|
594
|
+
in your own process → emit (or publish against your own port).
|
|
595
|
+
|
|
596
|
+
── error handling: two deliberate styles ───────────────────────────────────
|
|
597
|
+
|
|
598
|
+
- Engine CRUD (channels / profiles / localConfig) THROWS. A failure there is
|
|
599
|
+
a programming or configuration error (duplicate name, unknown channel) —
|
|
600
|
+
let it surface, or try/catch at your boundary.
|
|
601
|
+
- Gateway clients (publisher / listeners / gateway / recovery) return result
|
|
602
|
+
objects like { state: "ok" | "offline" | "error" } or { ok, actions }. A
|
|
603
|
+
daemon being down is an expected runtime state, not an exception.
|
|
604
|
+
|
|
605
|
+
If a method talks over HTTP to a daemon that might not be running, expect a
|
|
606
|
+
result object; otherwise expect a throw.
|
|
537
607
|
|
|
538
608
|
── building your own CLI ───────────────────────────────────────────────────
|
|
539
609
|
|
|
@@ -541,8 +611,11 @@ The Funnel CLI is a Hono app you can embed:
|
|
|
541
611
|
|
|
542
612
|
import { cliRoutes, toRequest } from "@interactive-inc/claude-funnel"
|
|
543
613
|
import { Funnel } from "@interactive-inc/claude-funnel"
|
|
614
|
+
import { slackConnector } from "@interactive-inc/claude-funnel/connectors/slack"
|
|
615
|
+
import { ghConnector } from "@interactive-inc/claude-funnel/connectors/gh"
|
|
544
616
|
|
|
545
|
-
|
|
617
|
+
// List every connector type your CLI's "channels ... connectors" commands accept.
|
|
618
|
+
const funnel = new Funnel({ connectors: [slackConnector(), ghConnector()] })
|
|
546
619
|
const { method, url } = toRequest(process.argv.slice(2))
|
|
547
620
|
const res = await cliRoutes.request(url, { method }, { funnel })
|
|
548
621
|
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
1
|
+
import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-DpXOsCty.js";
|
|
2
|
+
import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-DnLrdWO9.js";
|
|
3
3
|
|
|
4
4
|
//#region lib/services/doctor/funnel-doctor.d.ts
|
|
5
5
|
type Props = {
|