{"record":{"id":"600b121f8155cbed","repo":"garrytan/gstack","slug":"usage-b-cdp-domain-method-json-params-cause","errorCode":null,"errorMessage":"Usage: $B cdp <Domain.method> [json-params]\nCause: '${name}' is not in Domain.method format.\nAction: e.g. $B cdp Accessibility.getFullAXTree {}","messagePattern":"Usage: \\$B cdp <Domain\\.method> \\[json-params\\]\nCause: '(.+?)' is not in Domain\\.method format\\.\nAction: e\\.g\\. \\$B cdp Accessibility\\.getFullAXTree (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/cdp-commands.ts","lineNumber":17,"sourceCode":"/**\n * $B cdp <Domain.method> [json-params] — CLI surface for the CDP escape hatch.\n *\n * Output for trusted methods is a plain JSON pretty-print.\n * Output for untrusted methods is wrapped with the centralized UNTRUSTED EXTERNAL\n * CONTENT envelope so the sidebar-agent classifier sees it (matches the pattern\n * used by other untrusted-content commands in commands.ts).\n */\n\nimport type { BrowserManager } from './browser-manager';\nimport { dispatchCdpCall } from './cdp-bridge';\nimport { wrapUntrustedContent } from './commands';\n\nfunction parseQualified(name: string): { domain: string; method: string } {\n  const idx = name.indexOf('.');\n  if (idx <= 0 || idx === name.length - 1) {\n    throw new Error(\n      `Usage: $B cdp <Domain.method> [json-params]\\n` +\n        `Cause: '${name}' is not in Domain.method format.\\n` +\n        'Action: e.g. $B cdp Accessibility.getFullAXTree {}'\n    );\n  }\n  return { domain: name.slice(0, idx), method: name.slice(idx + 1) };\n}\n\nexport async function handleCdpCommand(args: string[], bm: BrowserManager): Promise<string> {\n  if (args.length === 0 || args[0] === 'help' || args[0] === '--help') {\n    return [\n      '$B cdp — raw CDP method dispatch (deny-default escape hatch)',\n      '',\n      'Usage: $B cdp <Domain.method> [json-params]',\n      '',\n      'Allowed methods are listed in browse/src/cdp-allowlist.ts. To add one,',\n      'open a PR with a one-line justification and the (scope, output) tags.',\n      'Examples:',","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/cdp-commands.ts#L1-L35","documentation":"Error \"Usage: $B cdp <Domain.method> [json-params]\nCause: '${name}' is not in Domain.method format.\nAction: e.g. $B cdp Accessibility.getFullAXTree {}\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/cdp-commands.ts:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}