@closedrouter/cli 1.0.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.
- package/LICENSE +21 -0
- package/README.md +192 -0
- package/bin/closedrouter.js +20 -0
- package/dist/bridge/claude-executor.d.ts +39 -0
- package/dist/bridge/claude-executor.d.ts.map +1 -0
- package/dist/bridge/tunnel-client.d.ts +50 -0
- package/dist/bridge/tunnel-client.d.ts.map +1 -0
- package/dist/client.d.ts +62 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/commands/antigravity-gui.d.ts +25 -0
- package/dist/commands/antigravity-gui.d.ts.map +1 -0
- package/dist/commands/gateway.d.ts +14 -0
- package/dist/commands/gateway.d.ts.map +1 -0
- package/dist/commands/import.d.ts +30 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/keys.d.ts +5 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/login.d.ts +7 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/logout.d.ts +5 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/onboard.d.ts +10 -0
- package/dist/commands/onboard.d.ts.map +1 -0
- package/dist/commands/scan.d.ts +9 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/start.d.ts +31 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/status.d.ts +6 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/whoami.d.ts +6 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8817 -0
- package/dist/scanners/antigravity.d.ts +18 -0
- package/dist/scanners/antigravity.d.ts.map +1 -0
- package/dist/scanners/claude.d.ts +17 -0
- package/dist/scanners/claude.d.ts.map +1 -0
- package/dist/scanners/cockpit.d.ts +18 -0
- package/dist/scanners/cockpit.d.ts.map +1 -0
- package/dist/scanners/codex.d.ts +15 -0
- package/dist/scanners/codex.d.ts.map +1 -0
- package/dist/scanners/cursor.d.ts +15 -0
- package/dist/scanners/cursor.d.ts.map +1 -0
- package/dist/scanners/env.d.ts +13 -0
- package/dist/scanners/env.d.ts.map +1 -0
- package/dist/scanners/grok.d.ts +15 -0
- package/dist/scanners/grok.d.ts.map +1 -0
- package/dist/scanners/index.d.ts +17 -0
- package/dist/scanners/index.d.ts.map +1 -0
- package/dist/scanners/sqlite.d.ts +6 -0
- package/dist/scanners/sqlite.d.ts.map +1 -0
- package/dist/scanners/types.d.ts +37 -0
- package/dist/scanners/types.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ClosedRouter Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# @closedrouter/cli
|
|
2
|
+
|
|
3
|
+
> Modern interactive TUI/CLI for **ClosedRouter** — automatically scan, discover, and import your local AI subscriptions and API keys into a unified token pool.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- **Modern TUI/CLI Experience**: Powered by `@clack/prompts`, featuring beautiful spinners, interactive multi-select menus, and status banners.
|
|
8
|
+
- **Deep Local Discovery**: Automatically discovers active accounts, subscriptions, and tokens on your machine:
|
|
9
|
+
- **Google Antigravity**: Standalone jetski OAuth tokens (`~/.gemini`) & IDE state database
|
|
10
|
+
- **Cursor**: SQLite state storage (`ItemTable` tokens, email, membership tier)
|
|
11
|
+
- **Claude Code**: macOS Keychain Services credentials (`Claude Code-credentials`) & `~/.claude.json`
|
|
12
|
+
- **ChatGPT Codex**: CLI auth tokens (`~/.codex/auth.json`)
|
|
13
|
+
- **Cockpit Tools Vault**: Decrypts local AES-256-GCM encrypted vaults (`~/.antigravity_cockpit`)
|
|
14
|
+
- **Grok CLI**: OAuth profiles (`~/.grok/auth.json`)
|
|
15
|
+
- **Environment Variables**: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `GROK_API_KEY`
|
|
16
|
+
- **Granular Contribution Control**: Choose to contribute accounts to your workspace's **Shared Pool** or keep them **Private**.
|
|
17
|
+
- **Instant Client Configuration**: Generates personal platform API keys (`cr-sk-...`) and prints copy-pasteable configuration for Cursor, Claude Code CLI, Python SDK, and shell environments.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### Run with `npx` (No Install Required)
|
|
24
|
+
```bash
|
|
25
|
+
npx @closedrouter/cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Install Globally
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g @closedrouter/cli
|
|
31
|
+
# or with bun
|
|
32
|
+
bun install -g @closedrouter/cli
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Once installed, simply run:
|
|
36
|
+
```bash
|
|
37
|
+
closedrouter
|
|
38
|
+
# or alias
|
|
39
|
+
cr
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
### `closedrouter` / `closedrouter onboard`
|
|
47
|
+
Launches the full interactive onboarding wizard:
|
|
48
|
+
1. Connects to your ClosedRouter server (default: `http://localhost:8000`)
|
|
49
|
+
2. Authenticates via email/password, new account registration, or session token
|
|
50
|
+
3. Scans your computer for local AI subscriptions and API keys
|
|
51
|
+
4. Presents an interactive multi-select checklist of discovered accounts
|
|
52
|
+
5. Configures sharing policies (Shared Pool vs Private)
|
|
53
|
+
6. Imports accounts and registers them with the discovery engine
|
|
54
|
+
7. Generates a platform API key (`cr-sk-...`) ready for immediate use
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
closedrouter onboard --server http://my-router.lan:8000
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `closedrouter scan`
|
|
61
|
+
Inspects your machine and prints all discovered AI accounts and keys without sending anything to the server.
|
|
62
|
+
```bash
|
|
63
|
+
# Formatted interactive table
|
|
64
|
+
closedrouter scan
|
|
65
|
+
|
|
66
|
+
# Target specific providers only
|
|
67
|
+
closedrouter scan --provider cursor,claude
|
|
68
|
+
|
|
69
|
+
# Machine-readable JSON output (great for scripting)
|
|
70
|
+
closedrouter scan --json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### `closedrouter import`
|
|
74
|
+
Import discovered accounts. New accounts stay private unless `--shared` is explicitly supplied. Existing accounts are skipped unless `--update-existing` is passed, which refreshes credentials while preserving their existing sharing and limit settings.
|
|
75
|
+
```bash
|
|
76
|
+
# Import all discovered accounts privately (the default)
|
|
77
|
+
closedrouter import --all
|
|
78
|
+
|
|
79
|
+
# Explicitly contribute all discovered accounts to the shared pool
|
|
80
|
+
closedrouter import --all --shared
|
|
81
|
+
|
|
82
|
+
# Refresh local credentials for accounts already connected to ClosedRouter
|
|
83
|
+
closedrouter import --all --update-existing
|
|
84
|
+
|
|
85
|
+
# Import only Cursor and Claude accounts into private pool
|
|
86
|
+
closedrouter import --provider cursor,claude --private
|
|
87
|
+
|
|
88
|
+
# Import a Cursor SDK user or service-account key from the environment
|
|
89
|
+
export CURSOR_API_KEY="your-cursor-api-key"
|
|
90
|
+
cr import --provider cursor_sdk --private
|
|
91
|
+
|
|
92
|
+
# Import only the OpenAI API key from your shell environment
|
|
93
|
+
closedrouter import --provider openai_api --private
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### `closedrouter status`
|
|
97
|
+
Displays the health status, active models, and daily token consumption of all accounts connected to your pool.
|
|
98
|
+
```bash
|
|
99
|
+
closedrouter status
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `closedrouter whoami`
|
|
103
|
+
Displays your current active user session, server connection URL, and platform API key.
|
|
104
|
+
```bash
|
|
105
|
+
closedrouter whoami
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `closedrouter keys`
|
|
109
|
+
Manage your personal platform API keys (`cr-sk-...`).
|
|
110
|
+
```bash
|
|
111
|
+
# List all your platform keys
|
|
112
|
+
closedrouter keys list
|
|
113
|
+
|
|
114
|
+
# Create a new platform key
|
|
115
|
+
closedrouter keys create "MacBook Pro M3"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `closedrouter login` / `closedrouter logout`
|
|
119
|
+
Manage your authentication session. Session tokens are stored securely in `~/.closedrouter/config.json`.
|
|
120
|
+
```bash
|
|
121
|
+
closedrouter login --server http://localhost:8000
|
|
122
|
+
closedrouter logout
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `cr start` / `cr launch`
|
|
126
|
+
Configure and start an installed coding CLI using models exposed to your platform key. The command discovers available models, keeps keys out of arguments and generated client profiles, and checks or starts the local Claude subscription bridge before launching Claude Code.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Interactive model and tool selection
|
|
130
|
+
cr start
|
|
131
|
+
|
|
132
|
+
# Start a selected tool and model
|
|
133
|
+
cr start claude --model claude-sonnet-4-6
|
|
134
|
+
cr start codex --model gpt-4.1
|
|
135
|
+
cr start gemini --model gemini-2.5-flash
|
|
136
|
+
cr start aider --model gpt-4o-mini
|
|
137
|
+
cr start opencode --model gpt-4o-mini
|
|
138
|
+
|
|
139
|
+
# Forward arguments to the coding tool
|
|
140
|
+
cr start claude --model claude-sonnet-4-6 -- --resume
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Claude Code sends an explicit `claude_oauth` provider choice to ClosedRouter so its requests use the local Claude subscription bridge. Codex gets a separate `~/.codex/closedrouter-launch.config.toml` profile using the Responses API. OpenCode gets an app-owned configuration file under `~/.closedrouter/`. The launchers do not change the tools' main configuration files.
|
|
144
|
+
|
|
145
|
+
Cursor SDK keys can also be connected in the web account dialog or imported from `CURSOR_API_KEY`. ClosedRouter discovers models using Cursor's SDK and sends text-only, tools-disabled SDK runs through its normal gateway and telemetry path. This credential type is separate from Cursor OAuth tokens imported from the editor.
|
|
146
|
+
|
|
147
|
+
Desktop application launch support is deferred from the MVP. Antigravity credentials and models remain available through the account pool and compatible gateway endpoints.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Tool Integration Examples
|
|
152
|
+
|
|
153
|
+
Once onboarded, point any OpenAI or Anthropic compatible tool to your ClosedRouter endpoint:
|
|
154
|
+
|
|
155
|
+
### 1. Cursor / Windsurf
|
|
156
|
+
- **Override OpenAI Base URL**: `http://localhost:8000/v1`
|
|
157
|
+
- **OpenAI API Key**: `cr-sk-...` (your platform key)
|
|
158
|
+
|
|
159
|
+
### 2. Claude Code CLI
|
|
160
|
+
```bash
|
|
161
|
+
export ANTHROPIC_BASE_URL="http://localhost:8000"
|
|
162
|
+
export ANTHROPIC_API_KEY="cr-sk-your-key-here"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 3. Shell / Environment Variables
|
|
166
|
+
```bash
|
|
167
|
+
export OPENAI_BASE_URL="http://localhost:8000/v1"
|
|
168
|
+
export OPENAI_API_KEY="cr-sk-your-key-here"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 4. Python `openai` Client
|
|
172
|
+
```python
|
|
173
|
+
from openai import OpenAI
|
|
174
|
+
|
|
175
|
+
client = OpenAI(
|
|
176
|
+
base_url="http://localhost:8000/v1",
|
|
177
|
+
api_key="cr-sk-your-key-here",
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
response = client.chat.completions.create(
|
|
181
|
+
model="claude-3-7-sonnet", # or gpt-4o, gemini-2.5-pro, etc.
|
|
182
|
+
messages=[{"role": "user", "content": "Hello via ClosedRouter!"}]
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
print(response.choices[0].message.content)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
MIT © ClosedRouter Contributors
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --no-warnings
|
|
2
|
+
|
|
3
|
+
process.env.NODE_NO_WARNINGS = "1";
|
|
4
|
+
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import { resolve, dirname } from "node:path";
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
|
+
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const distEntry = resolve(__dirname, "../dist/index.js");
|
|
11
|
+
const srcEntry = resolve(__dirname, "../src/index.ts");
|
|
12
|
+
|
|
13
|
+
if (existsSync(distEntry)) {
|
|
14
|
+
await import(pathToFileURL(distEntry).href);
|
|
15
|
+
} else if (existsSync(srcEntry)) {
|
|
16
|
+
await import(pathToFileURL(srcEntry).href);
|
|
17
|
+
} else {
|
|
18
|
+
console.error("Error: Could not find ClosedRouter CLI entry point. Please run 'npm run build' first.");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Local Claude Code Subprocess Executor
|
|
3
|
+
* Invokes the local `claude` CLI via JSON / stream-json output formats.
|
|
4
|
+
*/
|
|
5
|
+
export interface ClaudeJob {
|
|
6
|
+
job_id: string;
|
|
7
|
+
model: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
system_prompt?: string | null;
|
|
10
|
+
temperature?: number | null;
|
|
11
|
+
max_tokens?: number | null;
|
|
12
|
+
}
|
|
13
|
+
export interface ClaudeUsage {
|
|
14
|
+
input_tokens: number;
|
|
15
|
+
output_tokens: number;
|
|
16
|
+
total_tokens: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ClaudeChunkEvent {
|
|
19
|
+
delta_text?: string;
|
|
20
|
+
delta_thinking?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ClaudeDoneEvent {
|
|
23
|
+
result: string;
|
|
24
|
+
thinking?: string;
|
|
25
|
+
usage: ClaudeUsage;
|
|
26
|
+
finish_reason?: string;
|
|
27
|
+
duration_ms?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare class ClaudeExecutor {
|
|
30
|
+
private binaryPath;
|
|
31
|
+
private cachedVersion;
|
|
32
|
+
constructor(customBinaryPath?: string);
|
|
33
|
+
resolveBinary(): Promise<string>;
|
|
34
|
+
getVersion(): Promise<string>;
|
|
35
|
+
mapModel(model: string): string;
|
|
36
|
+
executeNonStreaming(job: ClaudeJob): Promise<ClaudeDoneEvent>;
|
|
37
|
+
executeStreaming(job: ClaudeJob, onChunk: (chunk: ClaudeChunkEvent) => void, onDone: (done: ClaudeDoneEvent) => void, onError: (err: Error) => void): () => void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=claude-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-executor.d.ts","sourceRoot":"","sources":["../../src/bridge/claude-executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,aAAa,CAAuB;IAE5C,YAAY,gBAAgB,CAAC,EAAE,MAAM,EAIpC;IAEK,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAgCrC;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAUlC;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9B;IAEK,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAgClE;IAED,gBAAgB,CACd,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,EAC1C,MAAM,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,EACvC,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAC5B,MAAM,IAAI,CAoHZ;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Local Bridge Tunnel Client
|
|
3
|
+
* Maintains persistent WebSocket tunnel to ClosedRouter backend and dispatches jobs.
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter } from "node:events";
|
|
6
|
+
export interface BridgeTelemetryEvent {
|
|
7
|
+
timestamp: string;
|
|
8
|
+
jobId: string;
|
|
9
|
+
model: string;
|
|
10
|
+
protocol: string;
|
|
11
|
+
isStream: boolean;
|
|
12
|
+
tokens?: number;
|
|
13
|
+
latencyMs?: number;
|
|
14
|
+
status: "running" | "success" | "error";
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TunnelClientOptions {
|
|
18
|
+
serverUrl: string;
|
|
19
|
+
apiKey: string;
|
|
20
|
+
nodeName?: string;
|
|
21
|
+
nodeId?: string;
|
|
22
|
+
claudePath?: string;
|
|
23
|
+
supportedModels: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare class TunnelClient extends EventEmitter {
|
|
26
|
+
private serverUrl;
|
|
27
|
+
private apiKey;
|
|
28
|
+
private nodeName;
|
|
29
|
+
private nodeId;
|
|
30
|
+
private supportedModels;
|
|
31
|
+
private ws;
|
|
32
|
+
private executor;
|
|
33
|
+
private isStopping;
|
|
34
|
+
private pingInterval;
|
|
35
|
+
private activeJobsCount;
|
|
36
|
+
private totalJobsServed;
|
|
37
|
+
constructor(options: TunnelClientOptions);
|
|
38
|
+
get stats(): {
|
|
39
|
+
activeJobs: number;
|
|
40
|
+
totalJobs: number;
|
|
41
|
+
nodeId: string;
|
|
42
|
+
nodeName: string;
|
|
43
|
+
};
|
|
44
|
+
getClaudeVersion(): Promise<string>;
|
|
45
|
+
connect(): Promise<void>;
|
|
46
|
+
private clearIntervals;
|
|
47
|
+
private handleJob;
|
|
48
|
+
disconnect(): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=tunnel-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-client.d.ts","sourceRoot":"","sources":["../../src/bridge/tunnel-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,eAAe,CAAK;IAE5B,YAAY,OAAO,EAAE,mBAAmB,EAQvC;IAED,IAAI,KAAK;QAEL,UAAU;QACV,SAAS;QACT,MAAM;QACN,QAAQ;MAEX;IAEK,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAExC;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAqF7B;IAED,OAAO,CAAC,cAAc;YAOR,SAAS;IA0GjB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAOhC;CACF"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - API Client
|
|
3
|
+
* Interacts with FastAPI backend and BetterAuth endpoints.
|
|
4
|
+
*/
|
|
5
|
+
import type { DiscoveredAccount } from "./scanners/types";
|
|
6
|
+
export interface ApiClientOptions {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
sessionToken?: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AuthResponse {
|
|
12
|
+
user: {
|
|
13
|
+
id: string;
|
|
14
|
+
email: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
};
|
|
17
|
+
token: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AccountPayload {
|
|
20
|
+
provider_type: string;
|
|
21
|
+
account_name: string;
|
|
22
|
+
display_name?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
plan_tier?: string;
|
|
25
|
+
is_shared?: boolean;
|
|
26
|
+
daily_token_cap?: number;
|
|
27
|
+
max_concurrency?: number;
|
|
28
|
+
credentials: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
export declare class ClosedRouterClient {
|
|
31
|
+
private baseUrl;
|
|
32
|
+
private sessionToken?;
|
|
33
|
+
private apiKey?;
|
|
34
|
+
constructor(options: ApiClientOptions);
|
|
35
|
+
setSessionToken(token: string): void;
|
|
36
|
+
setApiKey(key: string): void;
|
|
37
|
+
private getHeaders;
|
|
38
|
+
checkHealth(): Promise<{
|
|
39
|
+
ok: boolean;
|
|
40
|
+
message: string;
|
|
41
|
+
version?: string;
|
|
42
|
+
}>;
|
|
43
|
+
signUp(name: string, email: string, password: string): Promise<AuthResponse>;
|
|
44
|
+
signIn(email: string, password: string): Promise<AuthResponse>;
|
|
45
|
+
private getAuthHeaders;
|
|
46
|
+
getSession(): Promise<{
|
|
47
|
+
id: string;
|
|
48
|
+
email: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
} | null>;
|
|
51
|
+
listAccounts(): Promise<Record<string, any>[]>;
|
|
52
|
+
createAccount(payload: AccountPayload): Promise<Record<string, any>>;
|
|
53
|
+
createApiKey(name: string, budgetTokens?: number, allowedModels?: string[], rateLimitRpm?: number): Promise<Record<string, any>>;
|
|
54
|
+
listApiKeys(): Promise<Record<string, any>[]>;
|
|
55
|
+
listGatewayModels(options?: {
|
|
56
|
+
preferApiKey?: boolean;
|
|
57
|
+
}): Promise<Record<string, any>[]>;
|
|
58
|
+
listClaudeBridgeModels(): Promise<string[]>;
|
|
59
|
+
listBridgeNodes(): Promise<Record<string, any>[]>;
|
|
60
|
+
formatAccountForIngestion(account: DiscoveredAccount, isShared?: boolean, includeProviderDefaults?: boolean): AccountPayload;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local CCPA adapter for routing Antigravity desktop generation through ClosedRouter.
|
|
3
|
+
* The Antigravity language server is pointed at a loopback HTTP proxy with its
|
|
4
|
+
* SetCloudCodeURL RPC; non-generation Cloud Code calls continue to Google.
|
|
5
|
+
*/
|
|
6
|
+
import { type Server } from "node:http";
|
|
7
|
+
export interface AntigravityProxyOptions {
|
|
8
|
+
serverUrl: string;
|
|
9
|
+
apiKey: string;
|
|
10
|
+
defaultModel: string;
|
|
11
|
+
port: number;
|
|
12
|
+
upstreamOrigin?: string;
|
|
13
|
+
}
|
|
14
|
+
export type AntigravityFetch = typeof fetch;
|
|
15
|
+
export declare function createAntigravityProxyServer(options: AntigravityProxyOptions, fetcher?: AntigravityFetch): Server;
|
|
16
|
+
export declare function runAntigravityProxyDaemon(options: Omit<AntigravityProxyOptions, "apiKey">): Promise<void>;
|
|
17
|
+
export declare function startAntigravityGui(options: {
|
|
18
|
+
serverUrl: string;
|
|
19
|
+
apiKey: string;
|
|
20
|
+
model: string;
|
|
21
|
+
appPath?: string;
|
|
22
|
+
appArgs?: string[];
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
export declare function stopAntigravityProxy(): Promise<boolean>;
|
|
25
|
+
//# sourceMappingURL=antigravity-gui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity-gui.d.ts","sourceRoot":"","sources":["../../src/commands/antigravity-gui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAsC,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAC;AAWjG,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,KAAK,CAAC;AAoO5C,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,uBAAuB,EAChC,OAAO,GAAE,gBAAwB,GAChC,MAAM,CAQR;AA6ED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmD/G;AAgED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAahB;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAkC7D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Local Gateway Bridge Daemon Command
|
|
3
|
+
* Starts a persistent local bridge daemon connecting your machine's Claude Code instance
|
|
4
|
+
* to the ClosedRouter shared platform pool.
|
|
5
|
+
*/
|
|
6
|
+
export interface GatewayCommandOptions {
|
|
7
|
+
server?: string;
|
|
8
|
+
key?: string;
|
|
9
|
+
keyStdin?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
claudePath?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function gatewayCommand(options?: GatewayCommandOptions): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/commands/gateway.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CA2KvF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Import Command
|
|
3
|
+
* Scans and uploads local accounts to the ClosedRouter token pool.
|
|
4
|
+
*/
|
|
5
|
+
import type { DiscoveredAccount } from "../scanners/types";
|
|
6
|
+
interface ExistingAccountIdentity {
|
|
7
|
+
provider_type?: string;
|
|
8
|
+
account_identifier?: string | null;
|
|
9
|
+
account_name?: string;
|
|
10
|
+
owned_by_you?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function importShareSetting(options: {
|
|
13
|
+
shared?: boolean;
|
|
14
|
+
private?: boolean;
|
|
15
|
+
}): boolean | undefined;
|
|
16
|
+
export declare function importAccountsAreShared(options: {
|
|
17
|
+
shared?: boolean;
|
|
18
|
+
private?: boolean;
|
|
19
|
+
}): boolean;
|
|
20
|
+
export declare function accountAlreadyImported(account: DiscoveredAccount, existingAccounts: readonly ExistingAccountIdentity[]): boolean;
|
|
21
|
+
export declare function importCommand(options: {
|
|
22
|
+
all?: boolean;
|
|
23
|
+
shared?: boolean;
|
|
24
|
+
private?: boolean;
|
|
25
|
+
updateExisting?: boolean;
|
|
26
|
+
provider?: string;
|
|
27
|
+
server?: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,UAAU,uBAAuB;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,GAAG,SAAS,CAIxG;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEjG;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,GACnD,OAAO,CAKT;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAC3C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiHhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,wBAAsB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0ElF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,wBAAsB,YAAY,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuF9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,wBAAgB,aAAa,IAAI,IAAI,CAIpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Interactive Onboarding Command
|
|
3
|
+
* Guides the user from discovery to shared token pool in one smooth interactive flow.
|
|
4
|
+
*/
|
|
5
|
+
export declare function onboardCommand(options: {
|
|
6
|
+
server?: string;
|
|
7
|
+
all?: boolean;
|
|
8
|
+
shared?: boolean;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=onboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboard.d.ts","sourceRoot":"","sources":["../../src/commands/onboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyVjH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Scan Command
|
|
3
|
+
* Discovers and lists local AI accounts without modifying server state.
|
|
4
|
+
*/
|
|
5
|
+
export declare function scanCommand(options: {
|
|
6
|
+
json?: boolean;
|
|
7
|
+
provider?: string;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,wBAAsB,WAAW,CAAC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiD/F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start supported coding tools against the ClosedRouter gateway.
|
|
3
|
+
* The per-tool adapters follow the launcher pattern used by Ollama: discover a
|
|
4
|
+
* model, write only app-owned config, then start the installed client process.
|
|
5
|
+
*/
|
|
6
|
+
export type StartTool = "claude" | "codex" | "gemini" | "aider" | "opencode";
|
|
7
|
+
type CliTool = StartTool;
|
|
8
|
+
export interface StartCommandOptions {
|
|
9
|
+
tool?: string;
|
|
10
|
+
toolArgs?: string[];
|
|
11
|
+
server?: string;
|
|
12
|
+
key?: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
executablePath?: string;
|
|
15
|
+
}
|
|
16
|
+
interface ConfigFile {
|
|
17
|
+
path: string;
|
|
18
|
+
contents: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LaunchPlan {
|
|
21
|
+
tool: CliTool;
|
|
22
|
+
command: string;
|
|
23
|
+
args: string[];
|
|
24
|
+
env: NodeJS.ProcessEnv;
|
|
25
|
+
configFile?: ConfigFile;
|
|
26
|
+
}
|
|
27
|
+
export declare function isGatewayModelAvailable(availableModels: string[], model: string): boolean;
|
|
28
|
+
export declare function buildLaunchPlan(tool: CliTool, serverUrl: string, apiKey: string, model: string, toolArgs?: string[], homeDir?: string, executablePath?: string): LaunchPlan;
|
|
29
|
+
export declare function startCommand(options?: StartCommandOptions): Promise<void>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAC7E,KAAK,OAAO,GAAG,SAAS,CAAC;AAEzB,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzF;AA6BD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAM,EAAO,EACvB,OAAO,SAAY,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,UAAU,CA2FZ;AA6FD,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAqDnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../src/commands/whoami.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAyCnD"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClosedRouter CLI - Local Configuration & Credentials Store
|
|
3
|
+
* Stored at ~/.closedrouter/config.json
|
|
4
|
+
*/
|
|
5
|
+
export interface UserProfile {
|
|
6
|
+
id: string;
|
|
7
|
+
email: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CliConfig {
|
|
11
|
+
serverUrl: string;
|
|
12
|
+
sessionToken?: string;
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
bridgeApiKey?: string;
|
|
15
|
+
user?: UserProfile;
|
|
16
|
+
}
|
|
17
|
+
export declare function getConfigDir(): string;
|
|
18
|
+
export declare function getConfigPath(): string;
|
|
19
|
+
export declare function loadConfig(): CliConfig;
|
|
20
|
+
export declare function saveConfig(updates: Partial<CliConfig>): CliConfig;
|
|
21
|
+
export declare function clearSession(): void;
|
|
22
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAID,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,UAAU,IAAI,SAAS,CAkBtC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAmBjE;AAED,wBAAgB,YAAY,IAAI,IAAI,CAgBnC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|