sleev 0.0.13 → 0.1.0

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.
Files changed (133) hide show
  1. package/README.md +9 -8
  2. package/bin/sleev.js +84 -0
  3. package/package.json +36 -55
  4. package/postinstall.mjs +66 -0
  5. package/dist/auth/browser.d.ts +0 -12
  6. package/dist/auth/browser.js +0 -89
  7. package/dist/auth/browser.js.map +0 -1
  8. package/dist/auth/firebase-tokens.d.ts +0 -39
  9. package/dist/auth/firebase-tokens.js +0 -173
  10. package/dist/auth/firebase-tokens.js.map +0 -1
  11. package/dist/auth/firebase.d.ts +0 -17
  12. package/dist/auth/firebase.js +0 -55
  13. package/dist/auth/firebase.js.map +0 -1
  14. package/dist/auth/login.d.ts +0 -22
  15. package/dist/auth/login.js +0 -58
  16. package/dist/auth/login.js.map +0 -1
  17. package/dist/auth/loopback.d.ts +0 -19
  18. package/dist/auth/loopback.js +0 -204
  19. package/dist/auth/loopback.js.map +0 -1
  20. package/dist/auth/schema.d.ts +0 -26
  21. package/dist/auth/schema.js +0 -88
  22. package/dist/auth/schema.js.map +0 -1
  23. package/dist/auth/token.d.ts +0 -19
  24. package/dist/auth/token.js +0 -53
  25. package/dist/auth/token.js.map +0 -1
  26. package/dist/auth/verify.d.ts +0 -6
  27. package/dist/auth/verify.js +0 -22
  28. package/dist/auth/verify.js.map +0 -1
  29. package/dist/cli.d.ts +0 -8
  30. package/dist/cli.js +0 -255
  31. package/dist/cli.js.map +0 -1
  32. package/dist/config/paths.d.ts +0 -12
  33. package/dist/config/paths.js +0 -34
  34. package/dist/config/paths.js.map +0 -1
  35. package/dist/config/store.d.ts +0 -63
  36. package/dist/config/store.js +0 -270
  37. package/dist/config/store.js.map +0 -1
  38. package/dist/control/local-installations.d.ts +0 -13
  39. package/dist/control/local-installations.js +0 -37
  40. package/dist/control/local-installations.js.map +0 -1
  41. package/dist/daemon/config.d.ts +0 -10
  42. package/dist/daemon/config.js +0 -52
  43. package/dist/daemon/config.js.map +0 -1
  44. package/dist/daemon/controller.d.ts +0 -29
  45. package/dist/daemon/controller.js +0 -34
  46. package/dist/daemon/controller.js.map +0 -1
  47. package/dist/daemon/health.d.ts +0 -8
  48. package/dist/daemon/health.js +0 -47
  49. package/dist/daemon/health.js.map +0 -1
  50. package/dist/daemon/start.d.ts +0 -5
  51. package/dist/daemon/start.js +0 -24
  52. package/dist/daemon/start.js.map +0 -1
  53. package/dist/daemon/systemd.d.ts +0 -35
  54. package/dist/daemon/systemd.js +0 -181
  55. package/dist/daemon/systemd.js.map +0 -1
  56. package/dist/gateway/acquire.d.ts +0 -14
  57. package/dist/gateway/acquire.js +0 -112
  58. package/dist/gateway/acquire.js.map +0 -1
  59. package/dist/gateway/manifest.d.ts +0 -26
  60. package/dist/gateway/manifest.js +0 -98
  61. package/dist/gateway/manifest.js.map +0 -1
  62. package/dist/gateway/platform.d.ts +0 -5
  63. package/dist/gateway/platform.js +0 -27
  64. package/dist/gateway/platform.js.map +0 -1
  65. package/dist/harness/claude.d.ts +0 -8
  66. package/dist/harness/claude.js +0 -151
  67. package/dist/harness/claude.js.map +0 -1
  68. package/dist/harness/codex.d.ts +0 -10
  69. package/dist/harness/codex.js +0 -213
  70. package/dist/harness/codex.js.map +0 -1
  71. package/dist/harness/index.d.ts +0 -13
  72. package/dist/harness/index.js +0 -63
  73. package/dist/harness/index.js.map +0 -1
  74. package/dist/harness/opencode-config.d.ts +0 -8
  75. package/dist/harness/opencode-config.js +0 -301
  76. package/dist/harness/opencode-config.js.map +0 -1
  77. package/dist/harness/opencode.d.ts +0 -14
  78. package/dist/harness/opencode.js +0 -50
  79. package/dist/harness/opencode.js.map +0 -1
  80. package/dist/harness/providers.d.ts +0 -8
  81. package/dist/harness/providers.js +0 -30
  82. package/dist/harness/providers.js.map +0 -1
  83. package/dist/harness/types.d.ts +0 -14
  84. package/dist/harness/types.js +0 -2
  85. package/dist/harness/types.js.map +0 -1
  86. package/dist/product.d.ts +0 -12
  87. package/dist/product.js +0 -70
  88. package/dist/product.js.map +0 -1
  89. package/dist/tui/clipboard.d.ts +0 -1
  90. package/dist/tui/clipboard.js +0 -48
  91. package/dist/tui/clipboard.js.map +0 -1
  92. package/dist/tui/openTuiApp.d.ts +0 -1
  93. package/dist/tui/openTuiApp.js +0 -1436
  94. package/dist/tui/openTuiApp.js.map +0 -1
  95. package/dist/tui/pages/flow-screen.d.ts +0 -50
  96. package/dist/tui/pages/flow-screen.js +0 -435
  97. package/dist/tui/pages/flow-screen.js.map +0 -1
  98. package/dist/tui/pages/footer.d.ts +0 -7
  99. package/dist/tui/pages/footer.js +0 -14
  100. package/dist/tui/pages/footer.js.map +0 -1
  101. package/dist/tui/pages/home-screen.d.ts +0 -19
  102. package/dist/tui/pages/home-screen.js +0 -89
  103. package/dist/tui/pages/home-screen.js.map +0 -1
  104. package/dist/tui/pages/index.d.ts +0 -17
  105. package/dist/tui/pages/index.js +0 -11
  106. package/dist/tui/pages/index.js.map +0 -1
  107. package/dist/tui/pages/local-setup-screen.d.ts +0 -23
  108. package/dist/tui/pages/local-setup-screen.js +0 -134
  109. package/dist/tui/pages/local-setup-screen.js.map +0 -1
  110. package/dist/tui/pages/location-card.d.ts +0 -19
  111. package/dist/tui/pages/location-card.js +0 -116
  112. package/dist/tui/pages/location-card.js.map +0 -1
  113. package/dist/tui/pages/menu-screen.d.ts +0 -24
  114. package/dist/tui/pages/menu-screen.js +0 -117
  115. package/dist/tui/pages/menu-screen.js.map +0 -1
  116. package/dist/tui/pages/session-grid.d.ts +0 -23
  117. package/dist/tui/pages/session-grid.js +0 -552
  118. package/dist/tui/pages/session-grid.js.map +0 -1
  119. package/dist/tui/pages/setup-screen.d.ts +0 -15
  120. package/dist/tui/pages/setup-screen.js +0 -80
  121. package/dist/tui/pages/setup-screen.js.map +0 -1
  122. package/dist/tui/pages/terminal-log.d.ts +0 -14
  123. package/dist/tui/pages/terminal-log.js +0 -104
  124. package/dist/tui/pages/terminal-log.js.map +0 -1
  125. package/dist/tui/pages/welcome-screen.d.ts +0 -16
  126. package/dist/tui/pages/welcome-screen.js +0 -80
  127. package/dist/tui/pages/welcome-screen.js.map +0 -1
  128. package/dist/tui/saved-tokens.d.ts +0 -10
  129. package/dist/tui/saved-tokens.js +0 -104
  130. package/dist/tui/saved-tokens.js.map +0 -1
  131. package/dist/tui/theme.d.ts +0 -25
  132. package/dist/tui/theme.js +0 -27
  133. package/dist/tui/theme.js.map +0 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # sleeved
1
+ # sleev
2
2
 
3
3
  Local Sleeve proxy daemon and setup TUI.
4
4
 
@@ -10,20 +10,21 @@ installer shell:
10
10
  - prepare daemon lifecycle commands
11
11
  - prepare harness setup commands
12
12
 
13
- OpenTUI currently runs on Bun. The package is still structured for npm
14
- publication, with non-TUI commands kept Node-compatible while the interactive
15
- TUI entrypoint is isolated.
13
+ Published npm releases include native binaries, so end users do not need Bun
14
+ installed to run the TUI. Development and release builds still use Bun to compile
15
+ the OpenTUI app.
16
16
 
17
17
  ```bash
18
18
  npm install
19
19
  npm run check
20
20
  npm test
21
21
  npm run build
22
+ npm run build:native
22
23
  ```
23
24
 
24
25
  ```bash
25
- sleeved
26
- sleeved paths
27
- sleeved status
28
- sleeved daemon status
26
+ sleev
27
+ sleev paths
28
+ sleev status
29
+ sleev daemon status
29
30
  ```
package/bin/sleev.js ADDED
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ import { existsSync, realpathSync } from "node:fs";
4
+ import { dirname, join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ const forwardedSignals = ["SIGINT", "SIGTERM", "SIGHUP"];
7
+ function run(target) {
8
+ const child = spawn(target, process.argv.slice(2), {
9
+ stdio: "inherit",
10
+ });
11
+ child.on("error", (error) => {
12
+ console.error(error.message);
13
+ process.exit(1);
14
+ });
15
+ const forwarders = new Map();
16
+ for (const signal of forwardedSignals) {
17
+ const forwarder = () => {
18
+ try {
19
+ child.kill(signal);
20
+ }
21
+ catch {
22
+ // The child may have already exited.
23
+ }
24
+ };
25
+ forwarders.set(signal, forwarder);
26
+ process.on(signal, forwarder);
27
+ }
28
+ child.on("exit", (code, signal) => {
29
+ for (const [forwardedSignal, forwarder] of forwarders) {
30
+ process.removeListener(forwardedSignal, forwarder);
31
+ }
32
+ if (signal) {
33
+ process.kill(process.pid, signal);
34
+ return;
35
+ }
36
+ process.exit(typeof code === "number" ? code : 0);
37
+ });
38
+ }
39
+ const platformMap = {
40
+ darwin: "darwin",
41
+ linux: "linux",
42
+ win32: "windows",
43
+ };
44
+ const archMap = {
45
+ arm64: "arm64",
46
+ x64: "x64",
47
+ };
48
+ function packageNames() {
49
+ const platform = platformMap[process.platform] ?? process.platform;
50
+ const arch = archMap[process.arch] ?? process.arch;
51
+ return [`sleev-${platform}-${arch}`];
52
+ }
53
+ function findBinary(startDir) {
54
+ const binary = process.platform === "win32" ? "sleev.exe" : "sleev";
55
+ let current = startDir;
56
+ for (;;) {
57
+ const modules = join(current, "node_modules");
58
+ if (existsSync(modules)) {
59
+ for (const name of packageNames()) {
60
+ const candidate = join(modules, name, "bin", binary);
61
+ if (existsSync(candidate))
62
+ return candidate;
63
+ }
64
+ }
65
+ const parent = dirname(current);
66
+ if (parent === current)
67
+ return undefined;
68
+ current = parent;
69
+ }
70
+ }
71
+ const envPath = process.env.SLEEV_BIN_PATH?.trim();
72
+ const scriptDir = dirname(realpathSync(fileURLToPath(import.meta.url)));
73
+ const resolved = envPath || findBinary(scriptDir);
74
+ if (!resolved) {
75
+ console.error([
76
+ "Sleev could not find the native binary for this platform.",
77
+ `Tried: ${packageNames().join(", ")}`,
78
+ "This usually means npm skipped optional dependencies or this platform is not supported yet.",
79
+ "Try reinstalling without --ignore-scripts/--omit=optional, or set SLEEV_BIN_PATH to a local binary.",
80
+ ].join("\n"));
81
+ process.exit(1);
82
+ }
83
+ run(resolved);
84
+ //# sourceMappingURL=bin.js.map
package/package.json CHANGED
@@ -1,57 +1,38 @@
1
1
  {
2
- "name": "sleev",
3
- "version": "0.0.13",
4
- "description": "Local Sleeve proxy daemon and setup TUI for coding harnesses.",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/sleev3/cli.git"
8
- },
9
- "type": "module",
10
- "bin": {
11
- "sleev": "./dist/cli.js",
12
- "sleeved": "./dist/cli.js"
13
- },
14
- "publishConfig": {
15
- "access": "public"
16
- },
17
- "files": [
18
- "dist",
19
- "README.md"
20
- ],
21
- "scripts": {
22
- "dev": "bun src/cli.ts tui",
23
- "dev:watch": "bun --watch src/cli.ts tui",
24
- "build": "tsc -p tsconfig.build.json",
25
- "check": "npm run format:check && npm run lint && npm run typecheck",
26
- "format": "prettier --write .",
27
- "format:check": "prettier --check .",
28
- "lint": "eslint .",
29
- "typecheck": "tsc --noEmit -p tsconfig.json",
30
- "test": "node --test --import tsx tests/**/*.test.ts",
31
- "check:gateway": "bash tools/check-gateway.sh",
32
- "logs:gateway": "bash tools/gateway-logs.sh"
33
- },
34
- "keywords": [
35
- "sleeve",
36
- "proxy",
37
- "tui",
38
- "claude-code",
39
- "codex"
40
- ],
41
- "license": "UNLICENSED",
42
- "engines": {
43
- "node": ">=22"
44
- },
45
- "dependencies": {
46
- "@opentui/core": "^0.2.6"
47
- },
48
- "devDependencies": {
49
- "@eslint/js": "^10.0.1",
50
- "@types/node": "^22.15.3",
51
- "eslint": "^10.4.0",
52
- "prettier": "^3.8.3",
53
- "tsx": "^4.19.4",
54
- "typescript": "^5.8.3",
55
- "typescript-eslint": "^8.59.3"
56
- }
2
+ "name": "sleev",
3
+ "version": "0.1.0",
4
+ "description": "Sleeve CLI tool.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/sleev3/cli.git"
8
+ },
9
+ "type": "module",
10
+ "bin": {
11
+ "sleev": "./bin/sleev.js"
12
+ },
13
+ "scripts": {
14
+ "postinstall": "node ./postinstall.mjs"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "optionalDependencies": {
20
+ "sleev-linux-x64": "0.1.0",
21
+ "sleev-linux-arm64": "0.1.0",
22
+ "sleev-darwin-x64": "0.1.0",
23
+ "sleev-darwin-arm64": "0.1.0",
24
+ "sleev-windows-x64": "0.1.0",
25
+ "sleev-windows-arm64": "0.1.0"
26
+ },
27
+ "keywords": [
28
+ "sleeve",
29
+ "proxy",
30
+ "tui",
31
+ "claude-code",
32
+ "codex"
33
+ ],
34
+ "license": "UNLICENSED",
35
+ "engines": {
36
+ "node": ">=22"
37
+ }
57
38
  }
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from "node:child_process";
4
+ import { existsSync, realpathSync } from "node:fs";
5
+ import { dirname, join } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ if (process.env.SLEEV_SKIP_POSTINSTALL) process.exit(0);
9
+
10
+ const platformMap = {
11
+ darwin: "darwin",
12
+ linux: "linux",
13
+ win32: "windows",
14
+ };
15
+
16
+ const archMap = {
17
+ arm64: "arm64",
18
+ x64: "x64",
19
+ };
20
+
21
+ const platform = platformMap[process.platform] ?? process.platform;
22
+ const arch = archMap[process.arch] ?? process.arch;
23
+ const packageName = `sleev-${platform}-${arch}`;
24
+ const binary = process.platform === "win32" ? "sleev.exe" : "sleev";
25
+
26
+ function findBinary(startDir) {
27
+ let current = startDir;
28
+ for (;;) {
29
+ const candidate = join(
30
+ current,
31
+ "node_modules",
32
+ packageName,
33
+ "bin",
34
+ binary,
35
+ );
36
+ if (existsSync(candidate)) return candidate;
37
+
38
+ const parent = dirname(current);
39
+ if (parent === current) return undefined;
40
+ current = parent;
41
+ }
42
+ }
43
+
44
+ const scriptDir = dirname(realpathSync(fileURLToPath(import.meta.url)));
45
+ const resolved = process.env.SLEEV_BIN_PATH || findBinary(scriptDir);
46
+
47
+ if (!resolved) {
48
+ console.error(
49
+ [
50
+ `Sleev could not find ${packageName}.`,
51
+ "This package is installed as an optional dependency that matches your platform.",
52
+ "Try reinstalling without --ignore-scripts/--omit=optional, or set SLEEV_SKIP_POSTINSTALL=1 to skip this check.",
53
+ ].join("\n"),
54
+ );
55
+ process.exit(1);
56
+ }
57
+
58
+ const result = spawnSync(resolved, ["paths"], {
59
+ stdio: "ignore",
60
+ timeout: 5000,
61
+ });
62
+
63
+ if (result.status !== 0) {
64
+ console.error(`Sleev native binary verification failed: ${resolved}`);
65
+ process.exit(result.status ?? 1);
66
+ }
@@ -1,12 +0,0 @@
1
- type Command = {
2
- command: string;
3
- args: string[];
4
- };
5
- type Context = {
6
- platform?: NodeJS.Platform;
7
- env?: NodeJS.ProcessEnv;
8
- release?: string;
9
- };
10
- export declare function openBrowser(url: string): Promise<boolean>;
11
- export declare function browserCommands(url: string, context?: Context): Command[];
12
- export {};
@@ -1,89 +0,0 @@
1
- // Cross-platform browser opener used by the login handoff, including WSL fallbacks.
2
- import { spawn } from "node:child_process";
3
- import { existsSync, readFileSync } from "node:fs";
4
- export async function openBrowser(url) {
5
- const commands = browserCommands(url);
6
- for (const command of commands) {
7
- const opened = await open(command);
8
- if (opened)
9
- return true;
10
- }
11
- return false;
12
- }
13
- function open(command) {
14
- return new Promise((resolve) => {
15
- const child = spawn(command.command, command.args, {
16
- stdio: "ignore",
17
- windowsHide: true,
18
- });
19
- const timer = setTimeout(() => finish(true), 3000);
20
- let done = false;
21
- const finish = (ok) => {
22
- if (done)
23
- return;
24
- done = true;
25
- clearTimeout(timer);
26
- child.removeAllListeners("error");
27
- child.removeAllListeners("close");
28
- if (ok)
29
- child.unref();
30
- resolve(ok);
31
- };
32
- child.once("error", () => finish(false));
33
- child.once("close", (code) => finish(code === 0));
34
- });
35
- }
36
- export function browserCommands(url, context = {}) {
37
- const platform = context.platform ?? process.platform;
38
- if (platform === "darwin")
39
- return [{ command: "open", args: [url] }];
40
- if (platform === "win32") {
41
- return [
42
- { command: "rundll32", args: ["url.dll,FileProtocolHandler", url] },
43
- { command: "powershell", args: powershellArgs(url) },
44
- ];
45
- }
46
- if (platform === "linux" && isWsl(context)) {
47
- return [
48
- ...linuxCommands(url),
49
- { command: "wslview", args: [url] },
50
- { command: "powershell.exe", args: powershellArgs(url) },
51
- ];
52
- }
53
- return linuxCommands(url);
54
- }
55
- function linuxCommands(url) {
56
- return [
57
- { command: "sensible-browser", args: [url] },
58
- { command: "gio", args: ["open", url] },
59
- { command: "xdg-open", args: [url] },
60
- ];
61
- }
62
- function powershellArgs(url) {
63
- return [
64
- "-NoProfile",
65
- "-NonInteractive",
66
- "-ExecutionPolicy",
67
- "Bypass",
68
- "-Command",
69
- `Start-Process '${ps(url)}'`,
70
- ];
71
- }
72
- function ps(value) {
73
- return value.replace(/'/g, "''");
74
- }
75
- function isWsl(context) {
76
- const env = context.env ?? process.env;
77
- if (env.WSL_DISTRO_NAME || env.WSL_INTEROP)
78
- return true;
79
- const release = context.release ?? kernelRelease();
80
- return (release.toLowerCase().includes("microsoft") ||
81
- release.toLowerCase().includes("wsl"));
82
- }
83
- function kernelRelease() {
84
- const path = "/proc/sys/kernel/osrelease";
85
- if (!existsSync(path))
86
- return "";
87
- return readFileSync(path, "utf8");
88
- }
89
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/auth/browser.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUnD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW;IACzC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAEtC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,MAAM;YAAE,OAAO,IAAI,CAAC;IAC5B,CAAC;IAED,OAAO,K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gB;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,IAAI,GAAG,CAAC,eAAe,IAAI,GAAG,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAExD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,aAAa,EAAE,CAAC;IACnD,OAAO,CACH,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC3C,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CACxC,CAAC;AACN,CAAC;AAED,SAAS,aAAa;IAClB,MAAM,IAAI,GAAG,4BAA4B,CAAC;IAC1C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC"}
@@ -1,39 +0,0 @@
1
- import type { FirebaseLoginResult } from "./firebase.js";
2
- export type StoredFirebaseAuth = {
3
- version: 1;
4
- refreshToken: string;
5
- accountId: string;
6
- email: string | null;
7
- label: string | null;
8
- updatedAt: string;
9
- };
10
- export declare class FirebaseAuthRequiredError extends Error {
11
- constructor(message?: string);
12
- }
13
- export declare class FirebaseTokenError extends Error {
14
- constructor(message: string);
15
- }
16
- export declare function readStoredFirebaseAuth(file?: string): Promise<StoredFirebaseAuth | null>;
17
- export declare function writeStoredFirebaseAuth(auth: StoredFirebaseAuth, file?: string): Promise<void>;
18
- export declare function clearStoredFirebaseAuth(file?: string): Promise<void>;
19
- export declare function saveFirebaseLogin(result: FirebaseLoginResult, now?: () => Date): Promise<StoredFirebaseAuth>;
20
- export type FirebaseTokenManagerDeps = {
21
- apiKey?: string;
22
- fetchImpl?: typeof fetch;
23
- now?: () => number;
24
- load?: () => Promise<StoredFirebaseAuth | null>;
25
- save?: (auth: StoredFirebaseAuth) => Promise<void>;
26
- clear?: () => Promise<void>;
27
- };
28
- export declare class FirebaseTokenManager {
29
- private readonly apiKey;
30
- private readonly fetchImpl;
31
- private readonly now;
32
- private readonly load;
33
- private readonly save;
34
- private readonly clear;
35
- private cache;
36
- constructor(deps?: FirebaseTokenManagerDeps);
37
- getIdToken(forceRefresh?: boolean): Promise<string>;
38
- private exchange;
39
- }
@@ -1,173 +0,0 @@
1
- // Stores the Firebase refresh token and mints short-lived ID tokens from it
2
- // so the CLI can call the control server with Firebase auth, headlessly.
3
- import fs from "node:fs/promises";
4
- import path from "node:path";
5
- import { resolveSleevedPaths } from "../config/paths.js";
6
- import { firebaseConfig } from "../product.js";
7
- const SECURE_TOKEN_URL = "https://securetoken.googleapis.com/v1/token";
8
- // Refresh a little early so an in-flight request never carries a token that
9
- // expires mid-flight.
10
- const EXPIRY_SKEW_MS = 60_000;
11
- // Thrown when there is no usable refresh token (never signed in, or the
12
- // refresh token was revoked/expired). Callers should prompt a fresh sign-in.
13
- export class FirebaseAuthRequiredError extends Error {
14
- constructor(message = "Firebase sign-in is required.") {
15
- super(message);
16
- this.name = "FirebaseAuthRequiredError";
17
- }
18
- }
19
- export class FirebaseTokenError extends Error {
20
- constructor(message) {
21
- super(message);
22
- this.name = "FirebaseTokenError";
23
- }
24
- }
25
- export async function readStoredFirebaseAuth(file = resolveSleevedPaths().firebaseCredentialsFile) {
26
- try {
27
- return normalize(JSON.parse(await fs.readFile(file, "utf8")));
28
- }
29
- catch (error) {
30
- if (isNotFoundError(error))
31
- return null;
32
- throw error;
33
- }
34
- }
35
- export async function writeStoredFirebaseAuth(auth, file = resolveSleevedPaths().firebaseCredentialsFile) {
36
- await fs.mkdir(path.dirname(file), { recursive: true });
37
- await fs.writeFile(file, `${JSON.stringify(auth, null, 2)}\n`, {
38
- mode: 0o600,
39
- });
40
- }
41
- export async function clearStoredFirebaseAuth(file = resolveSleevedPaths().firebaseCredentialsFile) {
42
- try {
43
- await fs.unlink(file);
44
- }
45
- catch (error) {
46
- if (!isNotFoundError(error))
47
- throw error;
48
- }
49
- }
50
- export async function saveFirebaseLogin(result, now = () => new Date()) {
51
- const auth = {
52
- version: 1,
53
- refreshToken: result.refreshToken,
54
- accountId: result.accountId,
55
- email: result.email,
56
- label: result.label,
57
- updatedAt: now().toISOString(),
58
- };
59
- await writeStoredFirebaseAuth(auth);
60
- return auth;
61
- }
62
- // Caches the ID token in memory and refreshes it from the stored refresh
63
- // token when it is missing or about to expire.
64
- export class FirebaseTokenManager {
65
- apiKey;
66
- fetchImpl;
67
- now;
68
- load;
69
- save;
70
- clear;
71
- cache = null;
72
- constructor(deps = {}) {
73
- this.apiKey = deps.apiKey ?? firebaseConfig().apiKey;
74
- this.fetchImpl = deps.fetchImpl ?? fetch;
75
- this.now = deps.now ?? Date.now;
76
- this.load = deps.load ?? (() => readStoredFirebaseAuth());
77
- this.save = deps.save ?? ((auth) => writeStoredFirebaseAuth(auth));
78
- this.clear = deps.clear ?? (() => clearStoredFirebaseAuth());
79
- }
80
- async getIdToken(forceRefresh = false) {
81
- if (!forceRefresh &&
82
- this.cache &&
83
- this.now() < this.cache.expiresAtMs - EXPIRY_SKEW_MS) {
84
- return this.cache.idToken;
85
- }
86
- const stored = await this.load();
87
- if (!stored) {
88
- throw new FirebaseAuthRequiredError();
89
- }
90
- const exchanged = await this.exchange(stored.refreshToken);
91
- // Firebase may rotate the refresh token; persist it if it changed.
92
- if (exchanged.refresh_token !== stored.refreshToken) {
93
- await this.save({
94
- ...stored,
95
- refreshToken: exchanged.refresh_token,
96
- updatedAt: new Date(this.now()).toISOString(),
97
- });
98
- }
99
- const ttlMs = Number(exchanged.expires_in) * 1000;
100
- this.cache = {
101
- idToken: exchanged.id_token,
102
- expiresAtMs: this.now() + (Number.isFinite(ttlMs) ? ttlMs : 3_600_000),
103
- };
104
- return exchanged.id_token;
105
- }
106
- async exchange(refreshToken) {
107
- let response;
108
- try {
109
- response = await this.fetchImpl(`${SECURE_TOKEN_URL}?key=${encodeURIComponent(this.apiKey)}`, {
110
- method: "POST",
111
- headers: {
112
- "content-type": "application/x-www-form-urlencoded",
113
- },
114
- body: `grant_type=refresh_token&refresh_token=${encodeURIComponent(refreshToken)}`,
115
- });
116
- }
117
- catch (error) {
118
- throw new FirebaseTokenError(`Could not reach Firebase token endpoint: ${error instanceof Error ? error.message : "network error"}`);
119
- }
120
- const body = (await response.json().catch(() => null));
121
- if (!response.ok) {
122
- const reason = body?.error?.message ?? `HTTP ${response.status}`;
123
- // A revoked/invalid/expired refresh token is unrecoverable
124
- // without a fresh browser sign-in.
125
- if (reason === "TOKEN_EXPIRED" ||
126
- reason === "USER_DISABLED" ||
127
- reason === "USER_NOT_FOUND" ||
128
- reason === "INVALID_REFRESH_TOKEN" ||
129
- reason === "INVALID_GRANT") {
130
- this.cache = null;
131
- await this.clear();
132
- throw new FirebaseAuthRequiredError(`Firebase session is no longer valid (${reason}). Sign in again.`);
133
- }
134
- throw new FirebaseTokenError(`Firebase token refresh failed: ${reason}`);
135
- }
136
- if (!body ||
137
- typeof body.id_token !== "string" ||
138
- typeof body.refresh_token !== "string" ||
139
- typeof body.expires_in !== "string") {
140
- throw new FirebaseTokenError("Firebase token response was malformed.");
141
- }
142
- return {
143
- id_token: body.id_token,
144
- refresh_token: body.refresh_token,
145
- expires_in: body.expires_in,
146
- };
147
- }
148
- }
149
- function normalize(value) {
150
- if (typeof value !== "object" || value === null)
151
- return null;
152
- const v = value;
153
- if (typeof v.refreshToken !== "string" || !v.refreshToken)
154
- return null;
155
- if (typeof v.accountId !== "string" || !v.accountId)
156
- return null;
157
- return {
158
- version: 1,
159
- refreshToken: v.refreshToken,
160
- accountId: v.accountId,
161
- email: typeof v.email === "string" ? v.email : null,
162
- label: typeof v.label === "string" ? v.label : null,
163
- updatedAt: typeof v.updatedAt === "string"
164
- ? v.updatedAt
165
- : new Date(0).toISOString(),
166
- };
167
- }
168
- function isNotFoundError(error) {
169
- return (error instanceof Error &&
170
- "code" in error &&
171
- error.code === "ENOENT");
172
- }
173
- //# sourceMappingURL=firebase-tokens.js.map
@@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O;QACH,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QACnD,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QACnD,SAAS,EACL,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ;YAC3B,CAAC,CAAC,CAAC,CAAC,SAAS;YACb,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;KACtC,CAAC;AACN,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACnC,OAAO,CACH,KAAK,YAAY,KAAK;QACtB,MAAM,IAAI,KAAK;QACd,KAA+B,CAAC,IAAI,KAAK,QAAQ,CACrD,CAAC;AACN,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Writable } from "node:stream";
2
- export type FirebaseLoginResult = {
3
- refreshToken: string;
4
- accountId: string;
5
- email: string | null;
6
- label: string | null;
7
- };
8
- export type FirebaseLoginOptions = {
9
- webOrigin?: string;
10
- label?: string;
11
- output?: Writable;
12
- opener?: (url: string) => Promise<boolean>;
13
- onUrl?: (url: string) => void;
14
- timeoutMs?: number;
15
- signal?: AbortSignal;
16
- };
17
- export declare function firebaseLogin(options?: FirebaseLoginOptions): Promise<FirebaseLoginResult>;