Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

926 B
Raw Blame
// Only the primitives needed by bundled adapters. Navigation, tabs and file
// uploads use the normal runtime routes and their existing policy checks.
const METHODS = new Set([
  "Accessibility.enable",
  "Accessibility.getFullAXTree",
  "DOM.enable",
  "DOM.focus",
  "DOM.getDocument",
  "DOM.querySelector",
  "DOM.querySelectorAll",
  "DOM.describeNode",
  "DOM.resolveNode",
  "DOM.getContentQuads",
  "DOM.getBoxModel",
  "DOM.scrollIntoViewIfNeeded",
  "Input.dispatchKeyEvent",
  "Input.dispatchMouseEvent",
  "Input.insertText",
  "Network.getCookies",
  "Storage.getCookies",
  "Page.captureScreenshot",
  "Page.getLayoutMetrics",
  "Page.getFrameTree",
  "Page.handleJavaScriptDialog",
  "Runtime.callFunctionOn",
  "Runtime.releaseObject",
]);

export function assertRecipeCommand(method: string): void {
  if (!METHODS.has(method))
    throw new Error(`Unsupported bundled recipe browser command: ${method}`);
}