@agentvault/grok-bridge 0.4.17 → 0.4.19

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.
@@ -0,0 +1,28 @@
1
+ /** The lines shown to the customer — same wording as the OpenClaw setup. */
2
+ export declare function fingerprintLines(fingerprint: string): string[];
3
+ export declare function pendingFingerprintPath(dataDir: string): string;
4
+ export declare function writePendingFingerprint(dataDir: string, fingerprint: string): void;
5
+ export declare function readPendingFingerprint(dataDir: string): string | undefined;
6
+ export declare function clearPendingFingerprint(dataDir: string): void;
7
+ /**
8
+ * Block (synchronously — the service subcommands are sync) until the daemon has
9
+ * written the fingerprint, or `timeoutMs` passes. Enrolment is one HTTP round
10
+ * trip after the service boots, so this normally returns within seconds.
11
+ */
12
+ export declare function waitForPendingFingerprint(dataDir: string, opts?: {
13
+ timeoutMs?: number;
14
+ intervalMs?: number;
15
+ sleep?: (ms: number) => void;
16
+ now?: () => number;
17
+ }): string | undefined;
18
+ interface FingerprintChannel {
19
+ on(ev: "state", cb: (s: string) => void): unknown;
20
+ readonly fingerprint: string | null;
21
+ }
22
+ /**
23
+ * Daemon side: when the channel starts waiting for approval, log the
24
+ * fingerprint and publish it for `install` / `status`; drop it once approved.
25
+ */
26
+ export declare function watchEnrollmentFingerprint(channel: FingerprintChannel, dataDir: string, log: (msg: string) => void): void;
27
+ export {};
28
+ //# sourceMappingURL=enrollment-fingerprint.d.ts.map
@@ -19,6 +19,7 @@ export declare class GrokDriver implements AgentDriver {
19
19
  private readonly opts;
20
20
  private readonly acp;
21
21
  private session;
22
+ private invalidated;
22
23
  /** State for the turn currently in flight. Null between turns, so a late
23
24
  * update frame after a turn ends cannot bleed into the next one. */
24
25
  private current;
@@ -26,6 +26,7 @@ export declare class GrokSession implements RoomSession {
26
26
  private readonly opts;
27
27
  private queue;
28
28
  private running;
29
+ private invalidated;
29
30
  /** The message whose turn is in flight, or null between turns. Null is a
30
31
  * DISTINCT state from "a message that carries no reply sink" — conflating
31
32
  * them is what let a post-turn say fall through to the session-level sink. */
@@ -52,6 +53,8 @@ export declare class GrokSession implements RoomSession {
52
53
  * it. Revisit once `_meta.agentProfile` is probed properly.
53
54
  */
54
55
  identity?: string;
56
+ /** Fatal delivery failure: tear down this process for supervised restart. */
57
+ onFatal?: (error: unknown) => void | Promise<void>;
55
58
  });
56
59
  push(text: string, reply?: (text: string) => Promise<void>, opts?: {
57
60
  autoReplyOnText?: boolean;
@@ -62,6 +65,8 @@ export declare class GrokSession implements RoomSession {
62
65
  * the listener — but each call returns a NEW closure; do not rely on
63
66
  * identity (e.g. for `===` comparisons or `removeListener`-style APIs). */
64
67
  sayHandler(): (text: string) => void;
68
+ /** Revoke output and future work BEFORE asynchronous process cleanup. */
69
+ invalidate(): void;
65
70
  /** Resolves when the queue is empty. For tests and shutdown. */
66
71
  idle(): Promise<void>;
67
72
  private log;