@agentvault/claude-bridge 0.1.2 → 0.2.1

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/dist/bridge.d.ts CHANGED
@@ -12,6 +12,32 @@ export interface RoomSession {
12
12
  push(text: string): void;
13
13
  onActiveRoom(roomId: string): void;
14
14
  }
15
+ export interface LifecycleChannel {
16
+ on(ev: "auth_failed", cb: (e: {
17
+ reason: string;
18
+ }) => void): unknown;
19
+ on(ev: "session_replaced", cb: (e: {
20
+ code?: number;
21
+ }) => void): unknown;
22
+ on(ev: "error", cb: (err: unknown) => void): unknown;
23
+ }
24
+ /**
25
+ * Wire terminal lifecycle events — conditions SecureChannel can't recover from
26
+ * by reconnecting, after which the daemon would otherwise idle forever. We log
27
+ * clearly and exit. Three terminal signals:
28
+ * - `auth_failed` — device revoked / JWT expired (needs re-enroll).
29
+ * - `session_replaced` — another session took over (close code 4000/4001).
30
+ * - `error` matching "Reconnect loop detected" — the one terminal error the
31
+ * channel emits AFTER it has given up reconnecting.
32
+ * All OTHER `error` events are transient (handled + survived by wireBridge's
33
+ * own `error` listener, #387) and recover via the built-in reconnect — so we
34
+ * deliberately do NOT exit on the generic `error`/`"error"`-state, which would
35
+ * regress that survival behavior.
36
+ */
37
+ export declare function attachLifecycle(channel: LifecycleChannel, opts?: {
38
+ log?: (msg: string) => void;
39
+ onTerminal?: (reason: string) => void;
40
+ }): void;
15
41
  export declare function wireBridge(channel: RoomChannel, session: RoomSession, opts?: {
16
42
  roomFilter?: string;
17
43
  log?: (msg: string) => void;