@solongate/proxy 0.81.69 → 0.81.71

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.
@@ -26,6 +26,14 @@ export declare function isActiveAccount(apiKey: string): boolean;
26
26
  * account. Best-effort; returns false on failure.
27
27
  */
28
28
  export declare function setActiveAccount(creds: Credentials): boolean;
29
+ /**
30
+ * Clear the ACTIVE login credential — a local sign-out. Removes the key/url from
31
+ * the active-key file so `listAccounts` no longer re-seeds it (the source of the
32
+ * "ghost account …xxxx" that lingers after removing the account you're logged in
33
+ * as). The guard hooks then have NO key until the next `solongate login`, so this
34
+ * only runs when the user removes their LAST account. Best-effort; false on error.
35
+ */
36
+ export declare function clearActiveCredential(): boolean;
29
37
  /**
30
38
  * Thrown for any non-2xx response. `code`/`message` come from the API's
31
39
  * `{ error: { code, message } }` envelope when present; `status` is the HTTP
@@ -9,6 +9,7 @@ export declare function globalPaths(): {
9
9
  backupPath: string;
10
10
  configPath: string;
11
11
  };
12
+ export declare function clearGuardUpdateCheck(): boolean;
12
13
  export declare function runGlobalRestore(): void;
13
14
  export declare function installClaudeShim(shieldPath: string): void;
14
15
  export declare function removeClaudeShim(): void;
@@ -1,5 +1,5 @@
1
1
  // src/global-install.ts
2
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
2
+ import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync } from "fs";
3
3
  import { resolve, join, dirname } from "path";
4
4
  import { homedir } from "os";
5
5
  import { fileURLToPath } from "url";
@@ -95,6 +95,14 @@ function globalPaths() {
95
95
  configPath: join(sgDir, "cloud-guard.json")
96
96
  };
97
97
  }
98
+ function clearGuardUpdateCheck() {
99
+ try {
100
+ rmSync(join(globalPaths().sgDir, ".hook-update-check"), { force: true });
101
+ return true;
102
+ } catch {
103
+ return false;
104
+ }
105
+ }
98
106
  function readHook(filename) {
99
107
  return readFileSync(join(HOOKS_DIR, filename), "utf-8");
100
108
  }
@@ -267,6 +275,7 @@ async function installGlobalWithKey(apiKey, apiUrl) {
267
275
  await runGlobalInstall({ apiKey, apiUrl });
268
276
  }
269
277
  export {
278
+ clearGuardUpdateCheck,
270
279
  globalPaths,
271
280
  installClaudeShim,
272
281
  installGlobalWithKey,