@liberseek/boft-cli 0.1.2 → 0.4.4

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 (53) hide show
  1. package/README.md +13 -237
  2. package/bin/boft.js +435 -0
  3. package/bin/codexhost.js +435 -0
  4. package/package.json +30 -32
  5. package/dist/api.d.ts +0 -93
  6. package/dist/api.d.ts.map +0 -1
  7. package/dist/api.js +0 -249
  8. package/dist/api.js.map +0 -1
  9. package/dist/cli.d.ts +0 -19
  10. package/dist/cli.d.ts.map +0 -1
  11. package/dist/cli.js +0 -744
  12. package/dist/cli.js.map +0 -1
  13. package/dist/codex.d.ts +0 -70
  14. package/dist/codex.d.ts.map +0 -1
  15. package/dist/codex.js +0 -664
  16. package/dist/codex.js.map +0 -1
  17. package/dist/config.d.ts +0 -14
  18. package/dist/config.d.ts.map +0 -1
  19. package/dist/config.js +0 -105
  20. package/dist/config.js.map +0 -1
  21. package/dist/index.d.ts +0 -3
  22. package/dist/index.d.ts.map +0 -1
  23. package/dist/index.js +0 -4
  24. package/dist/index.js.map +0 -1
  25. package/dist/output.d.ts +0 -11
  26. package/dist/output.d.ts.map +0 -1
  27. package/dist/output.js +0 -87
  28. package/dist/output.js.map +0 -1
  29. package/dist/platforms.d.ts +0 -63
  30. package/dist/platforms.d.ts.map +0 -1
  31. package/dist/platforms.js +0 -568
  32. package/dist/platforms.js.map +0 -1
  33. package/dist/prompt.d.ts +0 -4
  34. package/dist/prompt.d.ts.map +0 -1
  35. package/dist/prompt.js +0 -49
  36. package/dist/prompt.js.map +0 -1
  37. package/dist/redact.d.ts +0 -3
  38. package/dist/redact.d.ts.map +0 -1
  39. package/dist/redact.js +0 -23
  40. package/dist/redact.js.map +0 -1
  41. package/dist/types.d.ts +0 -116
  42. package/dist/types.d.ts.map +0 -1
  43. package/dist/types.js +0 -2
  44. package/dist/types.js.map +0 -1
  45. package/dist/validate.d.ts +0 -6
  46. package/dist/validate.d.ts.map +0 -1
  47. package/dist/validate.js +0 -47
  48. package/dist/validate.js.map +0 -1
  49. package/dist/version.d.ts +0 -2
  50. package/dist/version.d.ts.map +0 -1
  51. package/dist/version.js +0 -7
  52. package/dist/version.js.map +0 -1
  53. package/docs/HTTP_CONTRACT.md +0 -121
@@ -0,0 +1,435 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ import { existsSync, realpathSync } from "node:fs";
4
+ import { createRequire } from "node:module";
5
+ import { homedir } from "node:os";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const version = "0.4.4";
10
+ const userArguments = process.argv.slice(2);
11
+ const startupTraceStartedAt = Date.now();
12
+ function startupTrace(stage) {
13
+ if (process.env.CODEXHOST_STARTUP_TRACE !== "1") return;
14
+ console.error(
15
+ "[codexhost startup +" + (Date.now() - startupTraceStartedAt) + "ms] npm: " + stage,
16
+ );
17
+ }
18
+ if (
19
+ userArguments.length === 1 &&
20
+ (userArguments[0] === "--version" || userArguments[0] === "-v")
21
+ ) {
22
+ console.log(version);
23
+ process.exit(0);
24
+ }
25
+ startupTrace("entry");
26
+
27
+ const platformPackages = {
28
+ "darwin-arm64": "@liberseek/boft-cli-darwin-arm64",
29
+ "darwin-x64": "@liberseek/boft-cli-darwin-x64",
30
+ "win32-x64": "@liberseek/boft-cli-win32-x64",
31
+ "win32-arm64": "@liberseek/boft-cli-win32-arm64",
32
+ "linux-x64": "@liberseek/boft-cli-linux-x64",
33
+ "linux-arm64": "@liberseek/boft-cli-linux-arm64"
34
+ };
35
+ const platformKey = `${process.platform}-${process.arch}`;
36
+ const platformPackage = platformPackages[platformKey];
37
+ if (!platformPackage) fail(`unsupported platform '${platformKey}'`);
38
+
39
+ const require = createRequire(import.meta.url);
40
+ let packageRoot;
41
+ try {
42
+ packageRoot = path.dirname(require.resolve(`${platformPackage}/package.json`));
43
+ } catch {
44
+ // Local folder installs symlink packages into the source tree; Node realpaths
45
+ // the entry script, so the sibling platform package drops off the resolution
46
+ // chain. Fall back to the npm global layout derived from the bin symlink.
47
+ packageRoot = null;
48
+ if (process.platform !== "win32" && process.argv[1]) {
49
+ const prefix = path.dirname(path.dirname(path.resolve(process.argv[1])));
50
+ const globalPackage = path.join(
51
+ prefix,
52
+ "lib",
53
+ "node_modules",
54
+ platformPackage,
55
+ "package.json",
56
+ );
57
+ if (existsSync(globalPackage)) packageRoot = path.dirname(globalPackage);
58
+ }
59
+ if (!packageRoot) {
60
+ fail(
61
+ `missing optional platform package '${platformPackage}'. Reinstall @liberseek/boft-cli without --omit=optional.`,
62
+ );
63
+ }
64
+ }
65
+
66
+ startupTrace("platform package resolved");
67
+ const executableSuffix = process.platform === "win32" ? ".exe" : "";
68
+ const launcher = path.join(packageRoot, "bin", `codexhost${executableSuffix}`);
69
+ const shim = path.join(packageRoot, "libexec", `codexhost-shim${executableSuffix}`);
70
+ const hostRuntime = path.join(packageRoot, "app", "host-runtime.mjs");
71
+ const desktopController = path.join(packageRoot, "app", "desktop-controller.mjs");
72
+ const rendererExtension = path.join(packageRoot, "app", "renderer-extension.js");
73
+
74
+ function fail(message) {
75
+ console.error(`codexhost: ${message}`);
76
+ process.exit(1);
77
+ }
78
+
79
+ for (const [label, filePath] of [
80
+ ["launcher", launcher],
81
+ ["shim", shim],
82
+ ["host runtime", hostRuntime],
83
+ ["desktop controller", desktopController],
84
+ ["renderer extension", rendererExtension],
85
+ ]) {
86
+ if (!existsSync(filePath)) fail(`missing ${label}: ${filePath}`);
87
+ }
88
+
89
+ function existingFile(filePath) {
90
+ return typeof filePath === "string" && filePath.length > 0 && existsSync(filePath)
91
+ ? filePath
92
+ : undefined;
93
+ }
94
+ function officialNpmCliPath(nodePath) {
95
+ return process.platform === "win32"
96
+ ? path.join(path.dirname(nodePath), "node_modules", "npm", "bin", "npm-cli.js")
97
+ : path.join(
98
+ path.dirname(path.dirname(nodePath)),
99
+ "lib",
100
+ "node_modules",
101
+ "npm",
102
+ "bin",
103
+ "npm-cli.js",
104
+ );
105
+ }
106
+ function homebrewNpmCliPath(nodePath) {
107
+ if (process.platform === "win32") return undefined;
108
+ const segments = nodePath.split(path.sep);
109
+ const cellarIndex = segments.lastIndexOf("Cellar");
110
+ if (
111
+ cellarIndex >= 1 &&
112
+ segments[cellarIndex + 1] === "node" &&
113
+ segments.at(-2) === "bin" &&
114
+ segments.at(-1) === "node"
115
+ ) {
116
+ const brewPrefix = segments.slice(0, cellarIndex).join(path.sep);
117
+ return (
118
+ existingFile(
119
+ path.join(brewPrefix, "lib", "node_modules", "npm", "bin", "npm-cli.js"),
120
+ ) ??
121
+ existingFile(
122
+ path.join(
123
+ path.dirname(path.dirname(nodePath)),
124
+ "libexec",
125
+ "lib",
126
+ "node_modules",
127
+ "npm",
128
+ "bin",
129
+ "npm-cli.js",
130
+ ),
131
+ )
132
+ );
133
+ }
134
+ const brewPrefix = process.env.HOMEBREW_PREFIX;
135
+ if (typeof brewPrefix === "string" && brewPrefix.length > 0) {
136
+ return existingFile(
137
+ path.join(brewPrefix, "lib", "node_modules", "npm", "bin", "npm-cli.js"),
138
+ );
139
+ }
140
+ return undefined;
141
+ }
142
+ function pathNpmCliPath() {
143
+ const pathValue = process.env.PATH;
144
+ if (typeof pathValue !== "string" || pathValue.length === 0) return undefined;
145
+ const npmName = process.platform === "win32" ? "npm.cmd" : "npm";
146
+ for (const directory of pathValue.split(path.delimiter)) {
147
+ if (!directory) continue;
148
+ const candidate = path.join(directory, npmName);
149
+ if (!existsSync(candidate)) continue;
150
+ try {
151
+ const resolved = realpathSync(candidate);
152
+ if (path.basename(resolved) === "npm-cli.js") return resolved;
153
+ } catch {
154
+ continue;
155
+ }
156
+ }
157
+ return undefined;
158
+ }
159
+ const npmCliPath =
160
+ existingFile(process.env.npm_execpath) ??
161
+ existingFile(officialNpmCliPath(process.execPath)) ??
162
+ homebrewNpmCliPath(process.execPath) ??
163
+ pathNpmCliPath();
164
+ if (!npmCliPath) fail("could not locate the npm CLI used to update this global installation");
165
+ const updateEnvironment = {
166
+ ...process.env,
167
+ CODEXHOST_NPM_NODE_PATH: process.execPath,
168
+ CODEXHOST_NPM_CLI_PATH: path.resolve(npmCliPath),
169
+ CODEXHOST_NPM_LAUNCHER_PATH: fileURLToPath(import.meta.url),
170
+ CODEXHOST_NPM_PACKAGE_ROOT: packageRoot,
171
+ };
172
+ // A managed SSH installation deliberately exports these variables from the
173
+ // remote login profile so stock Codex can enter the remote Host. When this npm
174
+ // command starts the local Desktop on that same machine, replace the remote
175
+ // bootstrap with a local data root. CODEXHOST_CLAUDE_COMMAND is intentionally
176
+ // shared and therefore preserved.
177
+ const remoteSshBootstrapEnvironment = [
178
+ "CODEX_INSTALL_DIR",
179
+ "CODEXHOST_DATA_DIR",
180
+ "CODEXHOST_DEFAULT_AGENT",
181
+ "CODEXHOST_HOST_NODE_PATH",
182
+ "CODEXHOST_HOST_RUNTIME_PATH",
183
+ "CODEXHOST_REMOTE_SSH_MANAGED",
184
+ "CODEXHOST_STOCK_CODEX_PATH",
185
+ ];
186
+ if (updateEnvironment.CODEXHOST_REMOTE_SSH_MANAGED === "1") {
187
+ for (const name of remoteSshBootstrapEnvironment) delete updateEnvironment[name];
188
+ updateEnvironment.CODEXHOST_DATA_DIR = path.join(homedir(), ".codexhost");
189
+ }
190
+
191
+ let launchArguments;
192
+ let remoteArguments = null;
193
+ let brokerArguments = null;
194
+ let delegationArguments = null;
195
+ if (userArguments.length === 0) {
196
+ launchArguments = ["launch"];
197
+ } else if (userArguments[0] === "launch") {
198
+ launchArguments = userArguments;
199
+ } else if (userArguments[0] === "inspect") {
200
+ launchArguments = userArguments;
201
+ } else if (userArguments[0] === "remote") {
202
+ launchArguments = null;
203
+ remoteArguments = userArguments.slice(1);
204
+ } else if (userArguments[0] === "broker") {
205
+ launchArguments = null;
206
+ brokerArguments = userArguments.slice(1);
207
+ } else if (
208
+ userArguments[0] === "harness" ||
209
+ userArguments[0] === "delegate" ||
210
+ userArguments[0] === "thread"
211
+ ) {
212
+ launchArguments = null;
213
+ delegationArguments = userArguments;
214
+ } else if (userArguments[0] === "--help" || userArguments[0] === "-h") {
215
+ console.log(
216
+ [
217
+ "usage:",
218
+ " codexhost",
219
+ " codexhost --version",
220
+ " codexhost inspect",
221
+ " codexhost launch [launcher options]",
222
+ " codexhost remote install|start|stop|status|uninstall",
223
+ " codexhost broker install|status|stop|uninstall",
224
+ " codexhost delegate --help",
225
+ " codexhost harness inspect ...",
226
+ " codexhost delegate start ...",
227
+ " codexhost thread send|cancel|read|wait|list ...",
228
+ "",
229
+ "This npm package uses the current Node.js runtime and the packaged",
230
+ "Rust launcher/shim. Codex Desktop must already be installed.",
231
+ ].join("\n"),
232
+ );
233
+ process.exit(0);
234
+ } else {
235
+ fail(
236
+ `unknown command '${userArguments[0]}'. Run 'codexhost --help' for usage.`,
237
+ );
238
+ }
239
+
240
+ if (launchArguments?.[0] === "launch") {
241
+ const injected = new Set();
242
+ for (let index = 1; index < launchArguments.length; index += 1) {
243
+ const argument = launchArguments[index];
244
+ if (
245
+ argument === "--node" ||
246
+ argument === "--shim" ||
247
+ argument === "--host-runtime" ||
248
+ argument === "--desktop-controller" ||
249
+ argument === "--renderer"
250
+ ) {
251
+ injected.add(argument);
252
+ index += 1;
253
+ }
254
+ }
255
+ const extras = [];
256
+ if (!injected.has("--node")) extras.push("--node", process.execPath);
257
+ if (!injected.has("--shim")) extras.push("--shim", shim);
258
+ if (!injected.has("--host-runtime")) extras.push("--host-runtime", hostRuntime);
259
+ if (!injected.has("--desktop-controller")) {
260
+ extras.push("--desktop-controller", desktopController);
261
+ }
262
+ if (!injected.has("--renderer")) extras.push("--renderer", rendererExtension);
263
+ launchArguments = ["launch", ...extras, ...launchArguments.slice(1)];
264
+ }
265
+
266
+ if (delegationArguments !== null) {
267
+ const child = spawn(
268
+ process.execPath,
269
+ [hostRuntime, "--codexhost-delegation-cli", ...delegationArguments],
270
+ {
271
+ env: {
272
+ ...updateEnvironment,
273
+ CODEXHOST_CLI_PATH: fileURLToPath(import.meta.url),
274
+ },
275
+ stdio: "inherit",
276
+ windowsHide: true,
277
+ },
278
+ );
279
+ child.on("error", (error) => fail(error.message));
280
+ child.on("exit", (code, signal) => {
281
+ if (signal) {
282
+ process.kill(process.pid, signal);
283
+ return;
284
+ }
285
+ process.exit(code ?? 1);
286
+ });
287
+ } else if (brokerArguments !== null) {
288
+ const child = spawn(
289
+ launcher,
290
+ [
291
+ "broker",
292
+ ...brokerArguments,
293
+ "--node", process.execPath, "--host-runtime", hostRuntime,
294
+ ],
295
+ {
296
+ env: updateEnvironment,
297
+ stdio: "inherit",
298
+ windowsHide: true,
299
+ },
300
+ );
301
+ child.on("error", (error) => fail(error.message));
302
+ child.on("exit", (code, signal) => {
303
+ if (signal) {
304
+ process.kill(process.pid, signal);
305
+ return;
306
+ }
307
+ process.exit(code ?? 1);
308
+ });
309
+ } else if (remoteArguments !== null) {
310
+ const runNativeBroker = (command) => {
311
+ const broker = spawn(
312
+ launcher,
313
+ ["broker", command, "--node", process.execPath, "--host-runtime", hostRuntime],
314
+ {
315
+ env: updateEnvironment,
316
+ // remote status is a stable JSON stdout surface. Keep the broker's
317
+ // human-readable status beside it on stderr instead of corrupting JSON.
318
+ stdio: command === "status" ? ["inherit", process.stderr, "inherit"] : "inherit",
319
+ windowsHide: true,
320
+ },
321
+ );
322
+ broker.on("error", (error) => fail(error.message));
323
+ broker.on("exit", (code, signal) => {
324
+ if (signal) {
325
+ process.kill(process.pid, signal);
326
+ return;
327
+ }
328
+ process.exit(code ?? 1);
329
+ });
330
+ };
331
+ const child = spawn(
332
+ process.execPath,
333
+ [
334
+ hostRuntime,
335
+ "--codexhost-remote",
336
+ ...remoteArguments,
337
+ "--node",
338
+ process.execPath,
339
+ "--shim",
340
+ shim,
341
+ "--host-runtime",
342
+ hostRuntime,
343
+ ],
344
+ {
345
+ env: updateEnvironment,
346
+ stdio: "inherit",
347
+ windowsHide: true,
348
+ },
349
+ );
350
+ child.on("error", (error) => fail(error.message));
351
+ child.on("exit", (code, signal) => {
352
+ if (signal) {
353
+ process.kill(process.pid, signal);
354
+ return;
355
+ }
356
+ if (code === 0 && process.platform === "darwin") {
357
+ if (remoteArguments[0] === "install") {
358
+ runNativeBroker("install");
359
+ return;
360
+ }
361
+ if (remoteArguments[0] === "status") {
362
+ runNativeBroker("status");
363
+ return;
364
+ }
365
+ if (remoteArguments[0] === "uninstall") {
366
+ runNativeBroker("uninstall");
367
+ return;
368
+ }
369
+ }
370
+ process.exit(code ?? 1);
371
+ });
372
+ } else if (launchArguments?.[0] === "launch") {
373
+ // The Launcher prints "ready" once the Desktop, Controller, and Host chain
374
+ // are up, then detaches from the terminal to keep supervising. Windows
375
+ // command hosts may clean up a completed command's process tree, so keep the
376
+ // npm parent alive there until the managed Desktop exits. Other platforms
377
+ // return immediately after startup as before.
378
+ startupTrace("spawning Launcher");
379
+ const keepLauncherForeground = process.platform === "win32";
380
+ const child = spawn(launcher, launchArguments, {
381
+ env: updateEnvironment,
382
+ stdio: ["ignore", "pipe", "inherit"],
383
+ windowsHide: true,
384
+ });
385
+ let finished = false;
386
+ const finish = (code) => {
387
+ if (finished) return;
388
+ finished = true;
389
+ startupTrace("Launcher finished startup with code " + code);
390
+ process.exit(code);
391
+ };
392
+ child.stdout.setEncoding("utf8");
393
+ let ready = false;
394
+ let launcherOutput = "";
395
+ const readyMarker = "ready\n";
396
+ child.stdout.on("data", (chunk) => {
397
+ if (ready) return;
398
+ const output = launcherOutput + chunk;
399
+ if (output.includes(readyMarker)) {
400
+ ready = true;
401
+ launcherOutput = "";
402
+ startupTrace("received Launcher ready");
403
+ if (!keepLauncherForeground) finish(0);
404
+ return;
405
+ }
406
+ // Only retain the tail needed to recognize a marker split across chunks.
407
+ launcherOutput = output.slice(1 - readyMarker.length);
408
+ });
409
+ child.on("error", (error) => {
410
+ startupTrace("Launcher spawn failed: " + error.message);
411
+ fail(error.message);
412
+ });
413
+ child.on("exit", (code, signal) => {
414
+ startupTrace(ready ? "Launcher exited after ready" : "Launcher exited before ready");
415
+ if (signal) {
416
+ process.kill(process.pid, signal);
417
+ return;
418
+ }
419
+ finish(code ?? 1);
420
+ });
421
+ } else {
422
+ const child = spawn(launcher, launchArguments, {
423
+ env: updateEnvironment,
424
+ stdio: "inherit",
425
+ windowsHide: true,
426
+ });
427
+ child.on("error", (error) => fail(error.message));
428
+ child.on("exit", (code, signal) => {
429
+ if (signal) {
430
+ process.kill(process.pid, signal);
431
+ return;
432
+ }
433
+ process.exit(code ?? 1);
434
+ });
435
+ }
package/package.json CHANGED
@@ -1,46 +1,44 @@
1
1
  {
2
2
  "name": "@liberseek/boft-cli",
3
- "version": "0.1.2",
4
- "description": "Secure BOFT CLI for Agent setup, balances, API Keys, and self-service recharge payments",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+ssh://git@github.com/LiberSeek/BOFT-CLI.git"
8
- },
9
- "publishConfig": {
10
- "access": "public",
11
- "registry": "https://registry.npmjs.org"
12
- },
3
+ "version": "0.4.4",
4
+ "description": "BOFT CLI runs Pi and other external harnesses inside Codex Desktop.",
13
5
  "type": "module",
14
6
  "bin": {
15
- "boft": "dist/index.js"
7
+ "boft": "bin/boft.js",
8
+ "codexhost": "bin/codexhost.js"
16
9
  },
17
10
  "files": [
18
- "dist",
19
- "docs",
11
+ "bin/**",
20
12
  "README.md"
21
13
  ],
22
14
  "engines": {
23
- "node": ">=20"
15
+ "node": ">=22"
24
16
  },
25
- "scripts": {
26
- "build": "tsc -p tsconfig.build.json && node --input-type=module -e \"import { chmodSync } from 'node:fs'; chmodSync('dist/index.js', 0o755)\"",
27
- "lint": "eslint .",
28
- "typecheck": "tsc -p tsconfig.json --noEmit",
29
- "test": "vitest run"
17
+ "optionalDependencies": {
18
+ "@liberseek/boft-cli-darwin-arm64": "0.4.4",
19
+ "@liberseek/boft-cli-darwin-x64": "0.4.4",
20
+ "@liberseek/boft-cli-win32-x64": "0.4.4",
21
+ "@liberseek/boft-cli-win32-arm64": "0.4.4",
22
+ "@liberseek/boft-cli-linux-x64": "0.4.4",
23
+ "@liberseek/boft-cli-linux-arm64": "0.4.4"
30
24
  },
31
- "dependencies": {
32
- "@decimalturn/toml-patch": "^3.0.1",
33
- "commander": "^14.0.0",
34
- "qrcode-terminal": "^0.12.0"
25
+ "keywords": [
26
+ "codex",
27
+ "codexhost",
28
+ "pi",
29
+ "claude-code",
30
+ "agent",
31
+ "harness"
32
+ ],
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/LiberSeek/BOFT-CLI.git"
35
36
  },
36
- "devDependencies": {
37
- "@eslint/js": "9.32.0",
38
- "@types/node": "20.19.9",
39
- "@types/qrcode-terminal": "0.12.2",
40
- "eslint": "9.32.0",
41
- "typescript": "~5.6.3",
42
- "typescript-eslint": "8.38.0",
43
- "vitest": "^3.2.7"
37
+ "bugs": {
38
+ "url": "https://github.com/LiberSeek/BOFT-CLI/issues"
44
39
  },
45
- "license": "AGPL-3.0-only"
40
+ "homepage": "https://github.com/LiberSeek/BOFT-CLI#readme",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ }
46
44
  }
package/dist/api.d.ts DELETED
@@ -1,93 +0,0 @@
1
- import type { Account, ApiKeyRecord, AutoKeyRoutePreview, AvailableGroupsResponse, CodexSetupGrant, SetupGrant, SetupTarget, PaginatedResponse, PaymentOption, PaymentOrder, ProviderGroupConstraint } from './types.js';
2
- interface ApiClientOptions {
3
- baseUrl: string;
4
- token: string;
5
- timeoutMs?: number;
6
- fetchImpl?: typeof fetch;
7
- }
8
- export declare class ApiError extends Error {
9
- readonly status?: number;
10
- readonly code?: number | string;
11
- readonly reason?: string;
12
- constructor(message: string, options?: {
13
- status?: number;
14
- code?: number | string;
15
- reason?: string;
16
- });
17
- }
18
- export declare class BoftApiClient {
19
- private readonly baseUrl;
20
- private readonly token;
21
- private readonly timeoutMs;
22
- private readonly fetchImpl;
23
- constructor(options: ApiClientOptions);
24
- account(): Promise<Account>;
25
- paymentOptions(): Promise<PaymentOption[]>;
26
- createPayment(input: {
27
- amount: string;
28
- payment_method: string;
29
- idempotency_key: string;
30
- }): Promise<PaymentOrder>;
31
- paymentStatus(id: string, waitSeconds?: number): Promise<PaymentOrder>;
32
- cancelPayment(id: string): Promise<PaymentOrder>;
33
- listApiKeys(input?: {
34
- page?: number;
35
- pageSize?: number;
36
- scope?: string;
37
- }): Promise<PaginatedResponse<ApiKeyRecord>>;
38
- createApiKey(input: {
39
- name: string;
40
- group_id: number;
41
- scope?: string;
42
- idempotency_key: string;
43
- quota?: number;
44
- expires_at?: string;
45
- }): Promise<ApiKeyRecord>;
46
- updateApiKeyGroup(id: number, groupId: number): Promise<ApiKeyRecord>;
47
- availableGroups(scope?: string): Promise<AvailableGroupsResponse>;
48
- listAutoKeys(input?: {
49
- page?: number;
50
- pageSize?: number;
51
- scope?: string;
52
- }): Promise<PaginatedResponse<ApiKeyRecord>>;
53
- createAutoKey(input: {
54
- name: string;
55
- models: string[];
56
- scope?: string;
57
- strategy?: string;
58
- include_byok?: boolean;
59
- fallback_enabled?: boolean;
60
- provider_group_constraints?: ProviderGroupConstraint[];
61
- quota?: number;
62
- expires_at?: string;
63
- idempotency_key: string;
64
- }): Promise<ApiKeyRecord>;
65
- updateAutoKeyRouting(id: number, input: {
66
- expected_config_version?: number;
67
- strategy?: string;
68
- disabled_providers?: string[];
69
- provider_group_constraints?: ProviderGroupConstraint[];
70
- models?: string[];
71
- include_byok?: boolean;
72
- fallback_enabled?: boolean;
73
- }): Promise<ApiKeyRecord>;
74
- autoKeyRoutePreview(id: number): Promise<AutoKeyRoutePreview>;
75
- private request;
76
- }
77
- export declare function exchangeSetupGrant(options: {
78
- baseUrl: string;
79
- code: string;
80
- target: SetupTarget;
81
- timeoutMs?: number;
82
- fetchImpl?: typeof fetch;
83
- machineName?: string;
84
- }): Promise<SetupGrant>;
85
- export declare function exchangeCodexSetupGrant(options: {
86
- baseUrl: string;
87
- code: string;
88
- timeoutMs?: number;
89
- fetchImpl?: typeof fetch;
90
- machineName?: string;
91
- }): Promise<CodexSetupGrant>;
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