autokap 1.6.1 → 1.6.3

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 (41) hide show
  1. package/dist/browser-pool.d.ts +1 -0
  2. package/dist/browser-pool.js +2 -0
  3. package/dist/browser.js +13 -1
  4. package/dist/cli-config.js +69 -25
  5. package/dist/cli-contract.d.ts +25 -5
  6. package/dist/cli-contract.js +55 -151
  7. package/dist/cli-doctor.d.ts +1 -1
  8. package/dist/cli-doctor.js +67 -82
  9. package/dist/cli-runner.d.ts +1 -1
  10. package/dist/cli-runner.js +23 -10
  11. package/dist/cli.js +25 -1163
  12. package/dist/execution-schema.d.ts +9 -3
  13. package/dist/execution-schema.js +12 -0
  14. package/dist/execution-types.d.ts +33 -2
  15. package/dist/mockup.d.ts +66 -2
  16. package/dist/mockup.js +31 -14
  17. package/dist/opcode-runner.js +9 -0
  18. package/dist/program-signing.d.ts +4 -1
  19. package/dist/program-signing.js +4 -0
  20. package/dist/skill-packaging.d.ts +0 -16
  21. package/dist/skill-packaging.js +1 -51
  22. package/dist/transform-browser-url.d.ts +6 -0
  23. package/dist/transform-browser-url.js +28 -0
  24. package/dist/types.d.ts +11 -0
  25. package/dist/video-narration-schema.d.ts +4 -1
  26. package/dist/web-playwright-local.d.ts +1 -0
  27. package/dist/web-playwright-local.js +0 -0
  28. package/package.json +6 -6
  29. package/readme.md +15 -12
  30. package/assets/skill/OPCODE-REFERENCE.md +0 -625
  31. package/assets/skill/README.md +0 -38
  32. package/assets/skill/SKILL.md +0 -590
  33. package/assets/skill/references/STANDARDS.md +0 -236
  34. package/assets/skill/references/examples.md +0 -88
  35. package/assets/skill/references/mock-data.md +0 -178
  36. package/dist/auth-capture.d.ts +0 -17
  37. package/dist/auth-capture.js +0 -199
  38. package/dist/cli-utils.d.ts +0 -5
  39. package/dist/cli-utils.js +0 -14
  40. package/dist/version-check.d.ts +0 -4
  41. package/dist/version-check.js +0 -102
@@ -19,6 +19,7 @@ declare class BrowserPool {
19
19
  lang?: string;
20
20
  colorScheme?: 'light' | 'dark';
21
21
  storageState?: BrowserStorageState;
22
+ extraHttpHeaders?: Record<string, string>;
22
23
  }): Promise<BrowserContext>;
23
24
  /**
24
25
  * Release a context back to the pool. Closes the context and unblocks
@@ -67,12 +67,14 @@ class BrowserPool {
67
67
  await new Promise((resolve) => this.queue.push(resolve));
68
68
  }
69
69
  await this.ensureBrowser();
70
+ const extra = options?.extraHttpHeaders;
70
71
  const context = await this.browser.newContext({
71
72
  viewport,
72
73
  deviceScaleFactor: normalizeDeviceScaleFactor(deviceScaleFactor),
73
74
  locale: options?.lang ? options.lang : 'en-US',
74
75
  colorScheme: options?.colorScheme ?? 'light',
75
76
  storageState: options?.storageState,
77
+ ...(extra && Object.keys(extra).length > 0 ? { extraHTTPHeaders: extra } : {}),
76
78
  });
77
79
  this.activeContexts++;
78
80
  this.captureCount++;
package/dist/browser.js CHANGED
@@ -911,6 +911,7 @@ export class Browser {
911
911
  lang: langToLocale(options.lang ?? 'en'),
912
912
  colorScheme: options.colorScheme ?? 'light',
913
913
  storageState: options.storageState,
914
+ extraHttpHeaders: options.extraHttpHeaders,
914
915
  });
915
916
  instance.page = await instance.context.newPage();
916
917
  instance.poolContext = true;
@@ -1030,6 +1031,9 @@ export class Browser {
1030
1031
  locale: langToLocale(options.lang ?? 'en'),
1031
1032
  colorScheme: options.colorScheme ?? 'light',
1032
1033
  storageState: options.storageState,
1034
+ ...(options.extraHttpHeaders && Object.keys(options.extraHttpHeaders).length > 0
1035
+ ? { extraHTTPHeaders: options.extraHttpHeaders }
1036
+ : {}),
1033
1037
  };
1034
1038
  // Dedicated browser process for clip capture. Not pooled because clip
1035
1039
  // capture installs context-level init scripts (cursor overlay). Cloud Run
@@ -5368,7 +5372,13 @@ export class Browser {
5368
5372
  async setLanguage(lang) {
5369
5373
  const context = this.ensureContext();
5370
5374
  const page = this.ensurePage();
5371
- await context.setExtraHTTPHeaders({ 'Accept-Language': lang });
5375
+ // `setExtraHTTPHeaders` REPLACES the header map — merge with the
5376
+ // environment-level auth headers so a SET_LOCALE opcode doesn't strip
5377
+ // them mid-run.
5378
+ await context.setExtraHTTPHeaders({
5379
+ ...(this.options.extraHttpHeaders ?? {}),
5380
+ 'Accept-Language': lang,
5381
+ });
5372
5382
  await page.addInitScript((locale) => {
5373
5383
  Object.defineProperty(navigator, 'language', { get: () => locale, configurable: true });
5374
5384
  Object.defineProperty(navigator, 'languages', { get: () => [locale], configurable: true });
@@ -5485,12 +5495,14 @@ export class Browser {
5485
5495
  return this.context;
5486
5496
  }
5487
5497
  buildContextOptions() {
5498
+ const extra = this.options.extraHttpHeaders;
5488
5499
  return {
5489
5500
  viewport: this.options.viewport,
5490
5501
  deviceScaleFactor: normalizeDeviceScaleFactor(this.options.deviceScaleFactor),
5491
5502
  locale: langToLocale(this.options.lang ?? 'en'),
5492
5503
  colorScheme: this.options.colorScheme ?? 'light',
5493
5504
  storageState: this.options.storageState,
5505
+ ...(extra && Object.keys(extra).length > 0 ? { extraHTTPHeaders: extra } : {}),
5494
5506
  };
5495
5507
  }
5496
5508
  }
@@ -1,5 +1,18 @@
1
+ // CLI-local config helpers.
2
+ //
3
+ // NOTE: this file currently duplicates the canonical implementation in
4
+ // `@autokap/core/config`. The MCP server consumes the core package directly;
5
+ // the bundled CLI binary still ships a self-contained copy because
6
+ // `@autokap/core` is not yet published to npm. Once core@0.1.0 is on the
7
+ // registry and the published CLI bumps to declare it as a runtime dep, this
8
+ // file can become a thin re-export shim (just LOCAL_WS_URL + requireConfig).
9
+ //
10
+ // Hardening here must stay in lockstep with packages/core/src/config.ts:
11
+ // atomic writes, scheme allowlist on URL inputs, env-var precedence, and
12
+ // the "untrusted origin override" guard.
1
13
  import path from 'node:path';
2
14
  import os from 'node:os';
15
+ import crypto from 'node:crypto';
3
16
  import fs from 'node:fs/promises';
4
17
  import { logger } from './logger.js';
5
18
  const DEFAULT_API_BASE_URL = 'https://autokap.app';
@@ -46,45 +59,76 @@ export async function readConfig() {
46
59
  wsUrl,
47
60
  };
48
61
  }
62
+ // Only swallow IO / parse failures. Origin-allowlist / schema errors must
63
+ // bubble up so the user sees what's wrong instead of "not authenticated".
64
+ let raw;
49
65
  try {
50
- const raw = await fs.readFile(getConfigPath(), 'utf-8');
51
- const parsed = JSON.parse(raw);
52
- if (!parsed.apiKey)
53
- return null;
54
- const envApiBaseUrl = normalizeUrl(process.env[API_BASE_URL_ENV_VAR]);
55
- const envWsUrl = normalizeUrl(process.env[WS_URL_ENV_VAR]);
56
- const storedApiBaseUrl = normalizeUrl(parsed.apiBaseUrl) ?? DEFAULT_API_BASE_URL;
57
- const apiBaseUrl = envApiBaseUrl ?? storedApiBaseUrl;
58
- const wsUrl = envWsUrl
59
- ?? (envApiBaseUrl ? deriveWsUrl(apiBaseUrl) : normalizeUrl(parsed.wsUrl) ?? deriveWsUrl(apiBaseUrl));
60
- assertAllowedApiOrigin(apiBaseUrl, storedApiBaseUrl, envApiBaseUrl ? API_BASE_URL_ENV_VAR : undefined);
61
- if (envWsUrl) {
62
- assertAllowedApiOrigin(wsUrl.replace(/^ws/, 'http'), deriveWsUrl(storedApiBaseUrl).replace(/^ws/, 'http'), WS_URL_ENV_VAR);
63
- }
64
- return {
65
- apiKey: parsed.apiKey,
66
- apiBaseUrl,
67
- wsUrl,
68
- };
66
+ raw = await fs.readFile(getConfigPath(), 'utf-8');
67
+ }
68
+ catch {
69
+ return null;
70
+ }
71
+ let parsed;
72
+ try {
73
+ parsed = JSON.parse(raw);
69
74
  }
70
75
  catch {
71
76
  return null;
72
77
  }
78
+ if (!parsed || typeof parsed !== 'object')
79
+ return null;
80
+ const record = parsed;
81
+ if (typeof record.apiKey !== 'string' || record.apiKey.length === 0)
82
+ return null;
83
+ const storedApiBaseUrlRaw = typeof record.apiBaseUrl === 'string' ? record.apiBaseUrl : null;
84
+ const storedWsUrlRaw = typeof record.wsUrl === 'string' ? record.wsUrl : null;
85
+ const envApiBaseUrl = normalizeUrl(process.env[API_BASE_URL_ENV_VAR]);
86
+ const envWsUrl = normalizeUrl(process.env[WS_URL_ENV_VAR]);
87
+ const storedApiBaseUrl = normalizeUrl(storedApiBaseUrlRaw) ?? DEFAULT_API_BASE_URL;
88
+ const apiBaseUrl = envApiBaseUrl ?? storedApiBaseUrl;
89
+ const wsUrl = envWsUrl ??
90
+ (envApiBaseUrl
91
+ ? deriveWsUrl(apiBaseUrl)
92
+ : normalizeUrl(storedWsUrlRaw) ?? deriveWsUrl(apiBaseUrl));
93
+ assertAllowedApiOrigin(apiBaseUrl, storedApiBaseUrl, envApiBaseUrl ? API_BASE_URL_ENV_VAR : undefined);
94
+ if (envWsUrl) {
95
+ assertAllowedApiOrigin(wsUrl.replace(/^ws/, 'http'), deriveWsUrl(storedApiBaseUrl).replace(/^ws/, 'http'), WS_URL_ENV_VAR);
96
+ }
97
+ return {
98
+ apiKey: record.apiKey,
99
+ apiBaseUrl,
100
+ wsUrl,
101
+ };
73
102
  }
74
103
  export async function writeConfig(config) {
75
104
  const dir = getConfigDir();
76
105
  await fs.mkdir(dir, { recursive: true });
106
+ if (process.platform !== 'win32') {
107
+ try {
108
+ await fs.chmod(dir, 0o700);
109
+ }
110
+ catch {
111
+ // best-effort — the file's 0600 below is the real safety
112
+ }
113
+ }
77
114
  const configPath = getConfigPath();
78
115
  const normalizedConfig = {
79
116
  ...config,
80
117
  apiBaseUrl: normalizeUrl(config.apiBaseUrl) ?? DEFAULT_API_BASE_URL,
81
118
  wsUrl: normalizeUrl(config.wsUrl) ?? deriveWsUrl(config.apiBaseUrl),
82
119
  };
83
- await fs.writeFile(configPath, JSON.stringify(normalizedConfig, null, 2), 'utf-8');
84
- // Restrict file permissions on Unix (NTFS ignores POSIX modes)
85
- if (process.platform !== 'win32') {
86
- await fs.chmod(dir, 0o700);
87
- await fs.chmod(configPath, 0o600);
120
+ // Atomic write — see packages/core/src/config.ts for the canonical impl.
121
+ const tmpPath = `${configPath}.${process.pid}.${crypto.randomBytes(4).toString('hex')}.tmp`;
122
+ try {
123
+ await fs.writeFile(tmpPath, JSON.stringify(normalizedConfig, null, 2), 'utf-8');
124
+ if (process.platform !== 'win32') {
125
+ await fs.chmod(tmpPath, 0o600);
126
+ }
127
+ await fs.rename(tmpPath, configPath);
128
+ }
129
+ catch (err) {
130
+ await fs.rm(tmpPath, { force: true }).catch(() => undefined);
131
+ throw err;
88
132
  }
89
133
  }
90
134
  export async function deleteConfig() {
@@ -105,7 +149,7 @@ export async function requireConfig() {
105
149
  process.exit(1);
106
150
  }
107
151
  if (!config) {
108
- logger.error(`Not authenticated. Run \`npx autokap@latest init --cli-key <key>\` first, or set ${API_KEY_ENV_VAR} in CI.`);
152
+ logger.error(`Not authenticated. Authenticate via your IDE's MCP integration (autokap_authenticate) or run \`autokap login <key>\` for CI / Cloud Run. CI may also set ${API_KEY_ENV_VAR} directly.`);
109
153
  process.exit(1);
110
154
  }
111
155
  return config;
@@ -4,15 +4,29 @@ export interface CliPublicCommandDescriptor {
4
4
  summary: string;
5
5
  docsDescriptionKey?: string;
6
6
  }
7
- export declare const CLI_KEY_TERM = "CLI key";
7
+ export declare const API_KEY_TERM = "API key";
8
+ /**
9
+ * Back-compat alias for internal callers that still import `CLI_KEY_TERM`.
10
+ * Points at the same string as `API_KEY_TERM`.
11
+ */
12
+ export declare const CLI_KEY_TERM = "API key";
13
+ /** HTTP header sent by the bundled CLI binary on every request. */
8
14
  export declare const CLI_VERSION_HEADER = "x-autokap-cli-version";
9
15
  export declare const MIN_CLI_VERSION_FOR_SIGNED_PROGRAMS = "1.0.9";
10
16
  export declare const MIN_CLI_VERSION_FOR_DIRECT_ARTIFACT_UPLOADS = "1.5.0";
11
- export declare const CLI_DEFAULT_INSTALL_COMMAND = "npm install -g autokap";
12
- export declare const CLI_DEFAULT_INSTALLED_SETUP_COMMAND = "autokap init --cli-key <your-cli-key>";
13
- export declare const CLI_DEFAULT_SETUP_COMMAND = "npx autokap@latest init --cli-key <your-cli-key>";
14
- export declare const CLI_ADVANCED_SKILL_COMMAND = "autokap skill --agent <agent>";
17
+ export declare const CLI_DEFAULT_INSTALL_COMMAND = "npx -y autokap@latest";
18
+ export declare const CLI_DEFAULT_INSTALLED_SETUP_COMMAND = "autokap login <your-api-key>";
19
+ export declare const CLI_DEFAULT_SETUP_COMMAND = "npx -y autokap@latest login <your-api-key>";
15
20
  export declare const CLI_FALLBACK_PROGRAM_COMMAND = "autokap run <preset-id> --program <file>";
21
+ /** Bare MCP runner. Used by generic clients and as the npx command. */
22
+ export declare const MCP_INSTALL_COMMAND = "npx -y @autokap/mcp";
23
+ /** One-shot install command for Claude Code (CLI flag `claude mcp add`). */
24
+ export declare const MCP_CLAUDE_CODE_COMMAND = "claude mcp add autokap -- npx -y @autokap/mcp";
25
+ /**
26
+ * JSON snippet to merge into the IDE-specific MCP config file (Cursor, Codex,
27
+ * Windsurf, Cline...). Format follows the shared `mcpServers` schema.
28
+ */
29
+ export declare const MCP_CONFIG_SNIPPET_JSON: string;
16
30
  export declare function buildCliRunCommand(presetId: string, options?: {
17
31
  local?: boolean;
18
32
  env?: string;
@@ -114,6 +128,12 @@ export interface ArtifactUploadMetadata {
114
128
  mimeType: string;
115
129
  captureType: "fullpage" | "element";
116
130
  captureUrl: string;
131
+ /**
132
+ * Document title captured from the page at screenshot time (Playwright's
133
+ * `page.title()`). Server uses it as the tab title in browser mockups; falls
134
+ * back to `parsed.hostname` when absent (older CLIs do not send it).
135
+ */
136
+ pageTitle?: string | null;
117
137
  lang: string;
118
138
  theme: "light" | "dark";
119
139
  deviceFrame?: string | null;
@@ -1,12 +1,54 @@
1
- export const CLI_KEY_TERM = "CLI key";
1
+ export const API_KEY_TERM = "API key";
2
+ /**
3
+ * Back-compat alias for internal callers that still import `CLI_KEY_TERM`.
4
+ * Points at the same string as `API_KEY_TERM`.
5
+ */
6
+ export const CLI_KEY_TERM = API_KEY_TERM;
7
+ /** HTTP header sent by the bundled CLI binary on every request. */
2
8
  export const CLI_VERSION_HEADER = "x-autokap-cli-version";
3
9
  export const MIN_CLI_VERSION_FOR_SIGNED_PROGRAMS = "1.0.9";
4
10
  export const MIN_CLI_VERSION_FOR_DIRECT_ARTIFACT_UPLOADS = "1.5.0";
5
- export const CLI_DEFAULT_INSTALL_COMMAND = "npm install -g autokap";
6
- export const CLI_DEFAULT_INSTALLED_SETUP_COMMAND = "autokap init --cli-key <your-cli-key>";
7
- export const CLI_DEFAULT_SETUP_COMMAND = "npx autokap@latest init --cli-key <your-cli-key>";
8
- export const CLI_ADVANCED_SKILL_COMMAND = "autokap skill --agent <agent>";
11
+ // MCP-first install. The bundled CLI binary ships only for CI / Cloud Run;
12
+ // recommend `npx -y autokap@latest` over a global install to keep version
13
+ // drift contained and avoid the npm supply-chain anxiety the migration was
14
+ // designed to remove. The `CLI_DEFAULT_INSTALL_COMMAND` alias is retained for
15
+ // legacy doc surfaces that still want a single shell snippet.
16
+ export const CLI_DEFAULT_INSTALL_COMMAND = "npx -y autokap@latest";
17
+ // `autokap init` was removed in v2. The setup command now uses the surviving
18
+ // `autokap login` for the same purpose (store the API key in ~/.autokap/config.json).
19
+ // MCP-first workflows should use `autokap_authenticate` from the IDE instead.
20
+ export const CLI_DEFAULT_INSTALLED_SETUP_COMMAND = "autokap login <your-api-key>";
21
+ export const CLI_DEFAULT_SETUP_COMMAND = "npx -y autokap@latest login <your-api-key>";
22
+ // `autokap skill --agent` was removed in v2. The skill ships as the MCP resource
23
+ // `autokap://skill/preset-spec` (or `autokap_get_skill` tool fallback). The
24
+ // legacy `CLI_ADVANCED_SKILL_COMMAND` constant that pointed at the removed
25
+ // command was dropped entirely — it had no consumers and any future doc page
26
+ // surfacing it would mislead users into typing a non-existent command.
9
27
  export const CLI_FALLBACK_PROGRAM_COMMAND = "autokap run <preset-id> --program <file>";
28
+ // ── MCP-first install contract ──────────────────────────────────────
29
+ //
30
+ // AutoKap is primarily exposed as a Model Context Protocol server via the
31
+ // `@autokap/mcp` package. Every supported IDE installs the server by adding a
32
+ // single stdio entry that runs `npx -y @autokap/mcp` — the constants below
33
+ // are the canonical shell forms used across onboarding surfaces (wizard,
34
+ // modal, banner, docs). For per-IDE payloads (config paths, snippets, notes),
35
+ // use `getMcpInstallEntries()` from `web/lib/site-discovery.ts`.
36
+ /** Bare MCP runner. Used by generic clients and as the npx command. */
37
+ export const MCP_INSTALL_COMMAND = "npx -y @autokap/mcp";
38
+ /** One-shot install command for Claude Code (CLI flag `claude mcp add`). */
39
+ export const MCP_CLAUDE_CODE_COMMAND = "claude mcp add autokap -- npx -y @autokap/mcp";
40
+ /**
41
+ * JSON snippet to merge into the IDE-specific MCP config file (Cursor, Codex,
42
+ * Windsurf, Cline...). Format follows the shared `mcpServers` schema.
43
+ */
44
+ export const MCP_CONFIG_SNIPPET_JSON = JSON.stringify({
45
+ mcpServers: {
46
+ autokap: {
47
+ command: "npx",
48
+ args: ["-y", "@autokap/mcp"],
49
+ },
50
+ },
51
+ }, null, 2);
10
52
  export function buildCliRunCommand(presetId, options = {}) {
11
53
  const flags = [
12
54
  options.local ? " --local" : "",
@@ -17,170 +59,32 @@ export function buildCliRunCommand(presetId, options = {}) {
17
59
  return `autokap run${flags} ${presetId}`;
18
60
  }
19
61
  export function buildCliInstalledSetupCommand(cliKey) {
20
- return `autokap init --cli-key ${cliKey}`;
62
+ return `autokap login ${cliKey}`;
21
63
  }
22
64
  export const CLI_PUBLIC_COMMANDS = [
23
- {
24
- id: "init",
25
- command: "autokap init",
26
- summary: "Authenticate and install the AI skill in one step",
27
- docsDescriptionKey: "cliCmdInit",
28
- },
29
65
  {
30
66
  id: "login",
31
67
  command: "autokap login <key>",
32
- summary: "Authenticate with your CLI key",
68
+ summary: "Authenticate with your API key (used by Cloud Run + CI; from the IDE, call autokap_authenticate via MCP instead)",
33
69
  docsDescriptionKey: "cliCmdLogin",
34
70
  },
35
- {
36
- id: "logout",
37
- command: "autokap logout",
38
- summary: "Remove stored credentials",
39
- docsDescriptionKey: "cliCmdLogout",
40
- },
41
- {
42
- id: "whoami",
43
- command: "autokap whoami",
44
- summary: "Show the account linked to the current CLI key",
45
- docsDescriptionKey: "cliCmdWhoami",
46
- },
47
- {
48
- id: "ping",
49
- command: "autokap ping",
50
- summary: "Verify CLI connection and confirm the stored key is still valid",
51
- docsDescriptionKey: "cliCmdPing",
52
- },
53
71
  {
54
72
  id: "run",
55
73
  command: "autokap run <preset-id> --env local",
56
- summary: "Run a preset capture using local Playwright",
74
+ summary: "Run a preset capture using local Playwright (also spawned by autokap_start_capture from the MCP server)",
57
75
  docsDescriptionKey: "cliCmdRun",
58
76
  },
59
77
  {
60
78
  id: "auto-recapture",
61
79
  command: "autokap auto-recapture --project <project-id> --env local",
62
- summary: "Run every preset enabled for Recapture Cloud in a project",
80
+ summary: "Run every preset enabled for Recapture Cloud in a project (the canonical surface for Cloud Run + CI; MCP exposes autokap_start_auto_recapture for end users)",
63
81
  docsDescriptionKey: "cliCmdAutoRecapture",
64
82
  },
65
83
  {
66
- id: "run-headed",
67
- command: "autokap run <preset-id> --headed",
68
- summary: "Show the browser window for debugging",
69
- docsDescriptionKey: "cliCmdHeaded",
70
- },
71
- {
72
- id: "run-dry",
73
- command: "autokap run <preset-id> --dry",
74
- summary: "Dry run: execute the opcode program without capturing or uploading (0 credits charged)",
75
- docsDescriptionKey: "cliCmdRunDry",
76
- },
77
- {
78
- id: "project-list",
79
- command: "autokap project list",
80
- summary: "List accessible projects as JSON",
81
- docsDescriptionKey: "cliCmdProjectList",
82
- },
83
- {
84
- id: "project-get",
85
- command: "autokap project get <project-id>",
86
- summary: "Get a single project as JSON",
87
- docsDescriptionKey: "cliCmdProjectGet",
88
- },
89
- {
90
- id: "project-create",
91
- command: "autokap project create --name <name> --url <url>",
92
- summary: "Create a project and print its ID",
93
- docsDescriptionKey: "cliCmdProjectCreate",
94
- },
95
- {
96
- id: "preset-info",
97
- command: "autokap preset info <preset-id>",
98
- summary: "Get structured JSON with endpoints, variants, and URL parameters",
99
- docsDescriptionKey: "cliCmdPresetInfo",
100
- },
101
- {
102
- id: "capture-list",
103
- command: "autokap capture list",
104
- summary: "List captures as JSON",
105
- docsDescriptionKey: "cliCmdCaptureList",
106
- },
107
- {
108
- id: "usage",
109
- command: "autokap usage",
110
- summary: "Show the current billing-period usage as JSON",
111
- docsDescriptionKey: "cliCmdUsage",
112
- },
113
- {
114
- id: "endpoints-list",
115
- command: "autokap endpoints list --preset <id>",
116
- summary: "List dev link endpoints as JSON or table",
117
- docsDescriptionKey: "cliCmdEndpointsList",
118
- },
119
- {
120
- id: "endpoints-get",
121
- command: "autokap endpoints get <endpoint-id>",
122
- summary: "Get a single dev link endpoint as JSON",
123
- docsDescriptionKey: "cliCmdEndpointsGet",
124
- },
125
- {
126
- id: "endpoints-export",
127
- command: "autokap endpoints export --preset <id>",
128
- summary: "Export dev link endpoints as JSON or CSV",
129
- docsDescriptionKey: "cliCmdEndpointsExport",
130
- },
131
- {
132
- id: "auth-capture",
133
- command: "autokap auth capture <project-id>",
134
- summary: "Capture a browser session for a session account",
135
- docsDescriptionKey: "cliCmdAuthCapture",
136
- },
137
- {
138
- id: "auth-account-list",
139
- command: "autokap auth account list <project-id>",
140
- summary: "List project credential accounts as JSON",
141
- docsDescriptionKey: "cliCmdAuthAccountList",
142
- },
143
- {
144
- id: "auth-account-create",
145
- command: "autokap auth account create <project-id> --name <name>",
146
- summary: "Create a project credential account and print its ID",
147
- docsDescriptionKey: "cliCmdAuthAccountCreate",
148
- },
149
- {
150
- id: "auth-account-update",
151
- command: "autokap auth account update <project-id> --account <name-or-id>",
152
- summary: "Update a project credential account",
153
- docsDescriptionKey: "cliCmdAuthAccountUpdate",
154
- },
155
- {
156
- id: "auth-account-delete",
157
- command: "autokap auth account delete <project-id> --account <name-or-id>",
158
- summary: "Delete an unused project credential account",
159
- docsDescriptionKey: "cliCmdAuthAccountDelete",
160
- },
161
- {
162
- id: "auth-session-clear",
163
- command: "autokap auth session clear <project-id> --account <name-or-id>",
164
- summary: "Clear the stored browser session for a session account",
165
- docsDescriptionKey: "cliCmdAuthSessionClear",
166
- },
167
- {
168
- id: "proxy-register",
169
- command: "autokap proxy register --project <id> --proxy-url <url>",
170
- summary: "Register a user-side proxy for dev links",
171
- docsDescriptionKey: "cliCmdProxyRegister",
172
- },
173
- {
174
- id: "proxy-verify",
175
- command: "autokap proxy verify --project <id>",
176
- summary: "Verify the configured proxy for a project",
177
- docsDescriptionKey: "cliCmdProxyVerify",
178
- },
179
- {
180
- id: "skill",
181
- command: "autokap skill",
182
- summary: "Export the AI agent skill bundle",
183
- docsDescriptionKey: "cliCmdSkill",
84
+ id: "doctor",
85
+ command: "autokap doctor",
86
+ summary: "Run environment diagnostics (Node version, config, API key validity, Chromium cache, ffmpeg)",
87
+ docsDescriptionKey: "cliCmdDoctor",
184
88
  },
185
89
  {
186
90
  id: "version",
@@ -1,4 +1,4 @@
1
1
  export declare function runDoctor(opts: {
2
2
  fix: boolean;
3
- agent?: string;
3
+ json?: boolean;
4
4
  }, currentVersion: string): Promise<void>;