@agentvault/grok-bridge 0.4.23 → 0.4.25
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 +10 -1
- package/dist/index.js +769 -118
- package/dist/service/self-uninstall.d.ts +30 -2
- package/dist/service/self-uninstall.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
import { type ServiceBackend } from "./backend.js";
|
|
2
|
+
/**
|
|
3
|
+
* #913 item 2 / 2026-10-25 — what it takes to remove this agent's service.
|
|
4
|
+
*
|
|
5
|
+
* `attachLifecycle` routes every terminal signal here, and most of them mean
|
|
6
|
+
* the device is ALIVE:
|
|
7
|
+
*
|
|
8
|
+
* session_replaced another session took over — the device still exists
|
|
9
|
+
* device_jwt_expired the JWT aged out — the device still exists
|
|
10
|
+
* reconnect_loop gave up reconnecting — the device still exists
|
|
11
|
+
*
|
|
12
|
+
* This used to key on the reason string `device_revoked`. That was not proof:
|
|
13
|
+
* on 2026-10-25 a PAUSED (suspended) device's reissue 403 was mapped to
|
|
14
|
+
* "device_revoked" and this function removed loopita's launchd service — the
|
|
15
|
+
* owner switched the agent back on and nothing was installed to resume.
|
|
16
|
+
*
|
|
17
|
+
* So it now keys on the channel's CONFIRMED verdict only. SecureChannel sets
|
|
18
|
+
* `deviceGone: true` on `auth_failed` exclusively after the public status
|
|
19
|
+
* endpoint answered REVOKED or the device row is gone (404). Any reason string
|
|
20
|
+
* without that verdict — including `device_revoked` — leaves the service alone.
|
|
21
|
+
* An older channel that never sets the flag therefore never uninstalls: the
|
|
22
|
+
* safe direction.
|
|
23
|
+
*/
|
|
24
|
+
export interface TerminalVerdict {
|
|
25
|
+
reason: string;
|
|
26
|
+
/** Set by SecureChannel only when the status endpoint CONFIRMED revoked/deleted. */
|
|
27
|
+
deviceGone?: boolean;
|
|
28
|
+
}
|
|
2
29
|
export interface SelfUninstallDeps {
|
|
3
30
|
backend?: ServiceBackend;
|
|
4
31
|
log?: (msg: string) => void;
|
|
5
32
|
}
|
|
6
33
|
/**
|
|
7
|
-
* Remove this agent's supervised service after its device was
|
|
34
|
+
* Remove this agent's supervised service after its device was CONFIRMED
|
|
35
|
+
* revoked or deleted.
|
|
8
36
|
*
|
|
9
37
|
* Returns whether a service was actually removed. NEVER throws: this runs on
|
|
10
38
|
* the shutdown path, and a cleanup that cannot happen must not stop the bridge
|
|
@@ -15,5 +43,5 @@ export interface SelfUninstallDeps {
|
|
|
15
43
|
* and LEAVES the credentials on disk. A false positive therefore costs the
|
|
16
44
|
* customer a re-install, not their identity.
|
|
17
45
|
*/
|
|
18
|
-
export declare function selfUninstallOnTerminal(
|
|
46
|
+
export declare function selfUninstallOnTerminal(verdict: TerminalVerdict, env: NodeJS.ProcessEnv, deps?: SelfUninstallDeps): boolean;
|
|
19
47
|
//# sourceMappingURL=self-uninstall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-uninstall.d.ts","sourceRoot":"","sources":["../../src/service/self-uninstall.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"self-uninstall.d.ts","sourceRoot":"","sources":["../../src/service/self-uninstall.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGlE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,EACxB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAyCT"}
|
package/package.json
CHANGED