@interactive-inc/claude-funnel 0.51.0 → 0.53.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 CHANGED
@@ -375,6 +375,28 @@ unsubscribe()
375
375
 
376
376
  永続化と再生は `FunnelEventLog` port の裏にある。デフォルトは `SqliteFunnelEventLog`(デーモン再起動を跨いで durable。reconnect 時の再生を提供する)。`gatewayServer({ eventLog })` に `MemoryFunnelEventLog` を渡せば durable な再生を差し替え・無効化できる。`onEvent` は書き込み専用の観測フックで、再生(読み戻し)は EventLog の責務。
377
377
 
378
+ ### 間違えにくい API
379
+
380
+ URL やオプションは型で安全側に倒している。
381
+
382
+ ```ts
383
+ import {
384
+ channelWsUrl,
385
+ channelWsProtocols,
386
+ gatewayLoopbackUrl,
387
+ } from "@interactive-inc/claude-funnel/gateway"
388
+
389
+ // WS 購読 URL。channel は必須(付け忘れるとコンパイルエラー)。
390
+ const url = channelWsUrl({ base: "ws://localhost:9743/ws", channel: "inbox", subscriberId })
391
+ const ws = new WebSocket(url, channelWsProtocols(token)) // token は subprotocol で渡す
392
+
393
+ // HTTP の loopback base は手で組まずこれを使う
394
+ const base = gatewayLoopbackUrl(9743) // → http://127.0.0.1:9743
395
+ ```
396
+
397
+ - 非ループバック bind(`gatewayServer({ hostname: "0.0.0.0" })`)は token 無しだと `start()` が throw する。前段で自前認証する場合のみ `allowInsecureHost: true`
398
+ - コネクタの token は `botToken` か `botTokenEnv` の片方だけ(両方同時はコンパイルエラー)、event store は `dbPath` か `eventLog` の片方だけ、launch の `resume` は `profileId` がある時だけ指定できる
399
+
378
400
  ### サブエントリ
379
401
 
380
402
  個別の層だけを import したい場合は sub-entry を使う。