@agentvault/grok-bridge 0.4.17 → 0.4.18

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,5 @@
1
+ import { type HistoryRecoveryCommandInput } from "@agentvault/agentvault";
2
+ type HistoryRecoveryRunner = (input: HistoryRecoveryCommandInput) => Promise<void>;
3
+ export declare function maybeRunRecoverySubcommand(argv?: string[], env?: NodeJS.ProcessEnv, runRecovery?: HistoryRecoveryRunner): Promise<boolean>;
4
+ export {};
5
+ //# sourceMappingURL=recovery.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/grok-bridge",
3
- "version": "0.4.17",
3
+ "version": "0.4.18",
4
4
  "type": "module",
5
5
  "description": "AgentVault Grok Bridge — daemon bridging a Grok agent into E2E-encrypted AgentVault direct messages and rooms.",
6
6
  "main": "dist/index.js",
@@ -1,57 +0,0 @@
1
- import { type BridgeConfig } from "../config.js";
2
- import type { ReapResult } from "../reap.js";
3
- import { type ServiceBackend } from "./backend.js";
4
- export interface InstallOnReadyDeps {
5
- entrypoint: string;
6
- env: NodeJS.ProcessEnv;
7
- backend?: ServiceBackend;
8
- hasCreds?: (dataDir: string) => boolean;
9
- /** Contents of the installed launcher, or undefined when none is installed. */
10
- readLauncher?: (path: string) => string | undefined;
11
- fenceAuthExists?: (fenceHome: string) => boolean;
12
- /** Resolves when no turn is in flight (GrokSession.idle). See rule 2. */
13
- waitForIdle?: () => Promise<void>;
14
- /** Bound on that wait. The terminal coming back is the product promise, so a
15
- * wedged turn must never hold the customer's shell open. */
16
- idleTimeoutMs?: number;
17
- /** The ONE teardown (src/reap.ts). Must complete before launchctl runs. */
18
- reap: () => Promise<ReapResult>;
19
- exit: (code: number) => void;
20
- log: (msg: string) => void;
21
- }
22
- interface ReadyChannel {
23
- on(ev: "ready", cb: () => void): unknown;
24
- }
25
- /**
26
- * One-paste install: enrol in the foreground, hand off to the supervisor, exit —
27
- * so the customer's terminal comes back and the agent survives a reboot.
28
- *
29
- * Four rules this module exists to enforce.
30
- *
31
- * 1. REFUSE BEFORE REAPING. Everything that can say no does so before anything is
32
- * torn down. Refusing afterwards leaves the customer with an approved device,
33
- * a spent invite token, and no running process — strictly worse than never
34
- * having guarded at all.
35
- *
36
- * 2. REAP COMPLETELY, THEN BOOTSTRAP. `LaunchdBackend.install` runs bootout →
37
- * poll-until-gone → bootstrap → kickstart synchronously, so the service is
38
- * live the instant install returns. A partial teardown means two ACP sessions
39
- * and two WebSockets on one device. `reap()` reports failure rather than
40
- * swallowing it, and a failed reap is a refusal.
41
- *
42
- * 3. COMPARE, DON'T DETECT. `status().loaded` means only that a plist with this
43
- * label exists. The old `install` subcommand never guarded its entrypoint
44
- * (subcommand.ts), so a customer can hold a LOADED plist baked against a
45
- * pruned npx cache; restarting that repairs nothing and reports success.
46
- * Restart only when a service is loaded AND its baked entrypoint is the one we
47
- * would install. Compare the ENTRYPOINT, never the whole launcher script —
48
- * that embeds the install-time PATH and is volatile across shells.
49
- *
50
- * 4. VERIFY BEFORE CLAIMING. `backend.install` returns void, and launchd's
51
- * implementation runs `kickstart` regardless of every `bootstrap` exit code.
52
- * This log line is the customer's only feedback, so it comes after a
53
- * `status()` that returned loaded:true.
54
- */
55
- export declare function installOnReady(channel: ReadyChannel, cfg: BridgeConfig, deps: InstallOnReadyDeps): void;
56
- export {};
57
- //# sourceMappingURL=install-on-ready.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-on-ready.d.ts","sourceRoot":"","sources":["../../src/service/install-on-ready.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB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