{"version":3,"sources":["../../../runtime-core/src/json.ts","../../../runtime-core/src/internal/filesystem.ts","../../src/internal/filesystem.ts","../../src/local-browser/browser-brands.ts","../../src/local-browser/chrome-discovery.ts","../../src/local-browser/cdp-discovery.ts","../../src/live-session.ts","../../src/local-browser/process-owner.ts","../../src/local-view/runtime-dir.ts","../../src/local-view/session-manifest.ts","../../src/local-view/service-state.ts","../../src/local-browser/chrome-singletons.ts","../../src/local-browser/profile-clone.ts","../../src/local-browser/stealth-init-script.ts","../../src/local-browser/stealth.ts","../../src/local-browser/stealth-profiles.ts","../../../runtime-core/src/artifacts.ts","../../../protocol/src/json.ts","../../../protocol/src/validation.ts","../../../protocol/src/version.ts","../../../protocol/src/binary-location.ts","../../../protocol/src/identity.ts","../../../protocol/src/geometry.ts","../../../protocol/src/metadata.ts","../../../protocol/src/network.ts","../../../protocol/src/storage.ts","../../../protocol/src/requests.ts","../../../protocol/src/state.ts","../../../protocol/src/snapshots.ts","../../../protocol/src/capabilities.ts","../../../protocol/src/cloud.ts","../../../protocol/src/errors.ts","../../../protocol/src/events.ts","../../../protocol/src/artifacts.ts","../../../protocol/src/captcha.ts","../../../protocol/src/traces.ts","../../../protocol/src/observability.ts","../../../protocol/src/envelopes.ts","../../../protocol/src/session-info.ts","../../../protocol/src/local-view.ts","../../../protocol/src/automation.ts","../../../protocol/src/operations.ts","../../../protocol/src/rest.ts","../../../protocol/src/scripts.ts","../../../protocol/src/interaction.ts","../../../protocol/src/semantic.ts","../../../protocol/src/mcp.ts","../../../protocol/src/computer-use-bridge.ts","../../../protocol/src/dom-path-types.ts","../../../protocol/src/dom-action-bridge.ts","../../../protocol/src/index.ts","../../../runtime-core/src/registry.ts","../../../runtime-core/src/network/saved-store.ts","../../../runtime-core/src/observation-utils.ts","../../../runtime-core/src/observations.ts","../../../runtime-core/src/traces.ts","../../../runtime-core/src/root.ts","../../src/root.ts","../../src/local-view/preferences.ts","../../src/local-browser/dir-lock.ts","../../src/local-view/service.ts","../../src/local-view/registration.ts","../../../runtime-core/src/internal/engine-selection.ts","../../src/internal/engine-selection.ts","../../src/browser-manager.ts","../../src/local-view/session-control.ts","../../src/local-view/discovery.ts","../../src/local-view/resolve-browser-websocket.ts","../../src/local-view/runtime-state.ts","../../src/local-view/ws-types.ts","../../src/local-view/cdp-proxy.ts","../../src/local-view/server.ts","../../src/local-view/browser-target-order.ts","../../src/local-view/tab-state-tracker.ts","../../src/local-view/view-stream-capture-policy.ts","../../src/local-view/view-stream-protocol.ts","../../src/local-view/view-stream.ts","../../src/local-view/serve.ts","../../src/local-view/serve-entry.ts"],"names":["path","mkdir","access","readFile","randomUUID","writeFile","rename","open","readdir","createHash","pathToFileURL","resolve","rm","stat","init_filesystem","join","homedir","existsSync","readFileSync","execFileSync","isProcessRunning","PROCESS_LIST_MAX_BUFFER_BYTES","PS_COMMAND_ENV","promisify","execFile","cp","copyFile","relative","getPlatformString","init_json","init_artifacts","targetByElementSchema","targetByPersistSchema","targetBySelectorSchema","jsonValueSchema","normalizeProvenance","record","cleared","init_traces","init_root","dirname","spawn","randomBytes","fileURLToPath","require","createRequire","init_engine_selection","sleep","tmpdir","mkdtemp","connectPlaywrightChromiumBrowser","createPlaywrightBrowserCoreEngine","disconnectPlaywrightChromiumBrowser","wsModule","WebSocket","page","createServer","url","once","closeLocalViewSessionBrowser","LocalViewSessionCloseError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,cAAc,KAAA,EAAkD;AACvE,EAAA,IAAI,KAAA,KAAU,QAAQ,OAAO,KAAA,KAAU,YAAY,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACvE,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,cAAA,CAAe,KAAK,CAAA;AAC7C,EAAA,OAAO,SAAA,KAAc,MAAA,CAAO,SAAA,IAAa,SAAA,KAAc,IAAA;AACzD;AAEA,SAA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,CAAQ,KAAK,CAAC,CAAA;AAAA,IAChB;AAAA,GACD,CAAA;AAED,EAAA,MAAM,uBAAuB,MAAM;AACjC,IAAA,KAAK,OAAO,KAAA,EAAM;AAAA,EACpB,CAAA;AACA,EAAA,OAAA,CAAQ,IAAA,CAAK,UAAU,oBAAoB,CAAA;AAC3C,EAAA,OAAA,CAAQ,IAAA,CAAK,WAAW,oBAAoB,CAAA;AAE5C,EAAA,MAAM,IAAI,OAAA,CAAc,MAAM,MAAS,CAAA;AACzC;;;ACfA,mBAAA,EAAoB,CAAE,KAAA,CAAM,CAAC,KAAA,KAAU;AACrC,EAAA,MAAM,OAAA,GACJ,iBAAiB,KAAA,GACb;AAAA,IACE,KAAA,EAAO;AAAA,MACL,MAAM,KAAA,CAAM,IAAA;AAAA,MACZ,SAAS,KAAA,CAAM;AAAA;AACjB,GACF,GACA;AAAA,IACE,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,OAAA;AAAA,MACN,OAAA,EAAS,OAAO,KAAK;AAAA;AACvB,GACF;AACN,EAAA,OAAA,CAAQ,OAAO,KAAA,CAAM,CAAA,EAAG,IAAA,CAAK,SAAA,CAAU,OAAO,CAAC;AAAA,CAAI,CAAA;AACnD,EAAA,OAAA,CAAQ,QAAA,GAAW,CAAA;AACrB,CAAC,CAAA","file":"serve-entry.cjs","sourcesContent":["export type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonPrimitive | JsonObject | JsonArray;\n\nexport interface JsonObject {\n  readonly [key: string]: JsonValue;\n}\n\nexport type JsonArray = readonly JsonValue[];\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n  if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n    return false;\n  }\n\n  const prototype = Object.getPrototypeOf(value);\n  return prototype === Object.prototype || prototype === null;\n}\n\nfunction canonicalizeJsonValue(value: unknown, path: string): JsonValue {\n  if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n    return value;\n  }\n\n  if (typeof value === \"number\") {\n    if (!Number.isFinite(value)) {\n      throw new TypeError(`${path} must be a finite JSON number`);\n    }\n\n    return value;\n  }\n\n  if (Array.isArray(value)) {\n    return value.map((entry, index) => canonicalizeJsonValue(entry, `${path}[${index}]`));\n  }\n\n  if (!isPlainObject(value)) {\n    throw new TypeError(`${path} must be a plain JSON object`);\n  }\n\n  const sorted = Object.keys(value).sort((left, right) => left.localeCompare(right));\n  const result: Record<string, JsonValue> = {};\n\n  for (const key of sorted) {\n    const entry = value[key];\n    if (entry === undefined) {\n      throw new TypeError(`${path}.${key} must not be undefined`);\n    }\n\n    result[key] = canonicalizeJsonValue(entry, `${path}.${key}`);\n  }\n\n  return result;\n}\n\nexport function toCanonicalJsonValue(value: unknown): JsonValue {\n  return canonicalizeJsonValue(value, \"value\");\n}\n\nexport function canonicalJsonString(value: unknown): string {\n  return JSON.stringify(toCanonicalJsonValue(value));\n}\n\nexport function stableJsonString(value: unknown): string {\n  return `${JSON.stringify(toCanonicalJsonValue(value), null, 2)}\\n`;\n}\n","import {\n  access,\n  mkdir,\n  open,\n  readFile,\n  readdir,\n  rename,\n  rm,\n  stat,\n  writeFile,\n} from \"node:fs/promises\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\n\nimport { stableJsonString } from \"../json.js\";\n\nconst LOCK_RETRY_DELAYS_MS = [1, 2, 5, 10, 20, 50] as const;\nconst LOCK_METADATA_FILENAME = \"owner.json\";\nconst LOCK_METADATA_VERSION = 1;\nconst LOCK_HEARTBEAT_INTERVAL_MS = 1_000;\nconst LOCK_ORPHAN_GRACE_MS = 2_000;\nconst LOCK_METADATALESS_STALE_MS = 30_000;\n\ninterface FilesystemLockMetadata {\n  readonly version: typeof LOCK_METADATA_VERSION;\n  readonly ownerToken: string;\n  readonly pid: number;\n  readonly acquiredAt: number;\n  readonly heartbeatAt: number;\n}\n\nexport function normalizeNonEmptyString(name: string, value: string): string {\n  const normalized = value.trim();\n  if (normalized.length === 0) {\n    throw new TypeError(`${name} must not be empty`);\n  }\n\n  return normalized;\n}\n\nexport function normalizeTimestamp(name: string, value: number): number {\n  if (!Number.isInteger(value) || value < 0) {\n    throw new RangeError(`${name} must be a non-negative integer`);\n  }\n\n  return value;\n}\n\nexport function encodePathSegment(value: string): string {\n  return encodeURIComponent(normalizeNonEmptyString(\"path segment\", value));\n}\n\nexport function joinStoragePath(...segments: readonly string[]): string {\n  return segments.join(\"/\");\n}\n\nexport function resolveStoragePath(rootPath: string, relativePath: string): string {\n  if (path.isAbsolute(relativePath)) {\n    throw new TypeError(`storage path ${relativePath} must be relative`);\n  }\n\n  const segments = relativePath.split(\"/\");\n  if (segments.length === 0 || segments.some((segment) => segment.length === 0)) {\n    throw new TypeError(`storage path ${relativePath} is invalid`);\n  }\n\n  for (const segment of segments) {\n    if (segment === \".\" || segment === \"..\") {\n      throw new TypeError(`storage path ${relativePath} must not contain path traversal`);\n    }\n  }\n\n  return path.join(rootPath, ...segments);\n}\n\nexport async function ensureDirectory(directoryPath: string): Promise<void> {\n  await mkdir(directoryPath, { recursive: true });\n}\n\nexport async function pathExists(targetPath: string): Promise<boolean> {\n  try {\n    await access(targetPath);\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nexport async function readJsonFile<T>(filePath: string): Promise<T> {\n  return JSON.parse(await readFile(filePath, \"utf8\")) as T;\n}\n\nexport async function writeJsonFileAtomic(filePath: string, value: unknown): Promise<void> {\n  await writeTextFileAtomic(filePath, stableJsonString(value));\n}\n\nasync function writeTextFileAtomic(filePath: string, value: string): Promise<void> {\n  await ensureDirectory(path.dirname(filePath));\n  const temporaryPath = `${filePath}.${randomUUID()}.tmp`;\n\n  await writeFile(temporaryPath, value, \"utf8\");\n  await rename(temporaryPath, filePath);\n}\n\nexport async function writeJsonFileExclusive(filePath: string, value: unknown): Promise<void> {\n  await writeTextFileExclusive(filePath, stableJsonString(value));\n}\n\nasync function writeTextFileExclusive(filePath: string, value: string): Promise<void> {\n  await ensureDirectory(path.dirname(filePath));\n  const handle = await open(filePath, \"wx\");\n\n  try {\n    await handle.writeFile(value, \"utf8\");\n  } finally {\n    await handle.close();\n  }\n}\n\nexport async function writeBufferIfMissing(filePath: string, value: Uint8Array): Promise<void> {\n  await ensureDirectory(path.dirname(filePath));\n\n  try {\n    const handle = await open(filePath, \"wx\");\n    try {\n      await handle.writeFile(value);\n    } finally {\n      await handle.close();\n    }\n  } catch (error) {\n    if (isAlreadyExistsError(error)) {\n      return;\n    }\n\n    throw error;\n  }\n}\n\nexport async function readBinaryFile(filePath: string): Promise<Uint8Array> {\n  return new Uint8Array(await readFile(filePath));\n}\n\nexport async function listJsonFiles(directoryPath: string): Promise<readonly string[]> {\n  if (!(await pathExists(directoryPath))) {\n    return [];\n  }\n\n  return (await readdir(directoryPath))\n    .filter((entry) => entry.endsWith(\".json\"))\n    .sort((left, right) => left.localeCompare(right));\n}\n\nexport function sha256Hex(value: Uint8Array): string {\n  return createHash(\"sha256\").update(value).digest(\"hex\");\n}\n\nexport function filePathToUri(filePath: string): string {\n  return pathToFileURL(filePath).toString();\n}\n\nexport function fileUriToPath(uri: string): string {\n  return fileURLToPath(uri);\n}\n\nexport function isAlreadyExistsError(error: unknown): error is NodeJS.ErrnoException {\n  return (error as NodeJS.ErrnoException | undefined)?.code === \"EEXIST\";\n}\n\nexport async function withFilesystemLock<T>(lockPath: string, task: () => Promise<T>): Promise<T> {\n  await ensureDirectory(path.dirname(lockPath));\n\n  const ownerToken = randomUUID();\n  let attempt = 0;\n  while (true) {\n    try {\n      await mkdir(lockPath);\n      const acquiredAt = Date.now();\n      await writeLockMetadata(lockPath, {\n        version: LOCK_METADATA_VERSION,\n        ownerToken,\n        pid: process.pid,\n        acquiredAt,\n        heartbeatAt: acquiredAt,\n      });\n      break;\n    } catch (error) {\n      if (!isAlreadyExistsError(error)) {\n        throw error;\n      }\n\n      if (await tryRecoverFilesystemLock(lockPath)) {\n        attempt = 0;\n        continue;\n      }\n\n      const delayMs = LOCK_RETRY_DELAYS_MS[Math.min(attempt, LOCK_RETRY_DELAYS_MS.length - 1)];\n      attempt += 1;\n      await new Promise((resolve) => setTimeout(resolve, delayMs));\n    }\n  }\n\n  const heartbeatTimer = setInterval(() => {\n    void touchLockMetadata(lockPath, ownerToken);\n  }, LOCK_HEARTBEAT_INTERVAL_MS);\n  heartbeatTimer.unref?.();\n\n  try {\n    return await task();\n  } finally {\n    clearInterval(heartbeatTimer);\n    const metadata = await readLockMetadata(lockPath);\n    if (metadata?.ownerToken === ownerToken) {\n      await rm(lockPath, { recursive: true, force: true });\n    }\n  }\n}\n\nasync function tryRecoverFilesystemLock(lockPath: string): Promise<boolean> {\n  if (!(await shouldRecoverFilesystemLock(lockPath))) {\n    return false;\n  }\n\n  await rm(lockPath, { recursive: true, force: true });\n  return true;\n}\n\nasync function shouldRecoverFilesystemLock(lockPath: string): Promise<boolean> {\n  const metadata = await readLockMetadata(lockPath);\n  if (metadata !== undefined) {\n    if (isProcessRunning(metadata.pid)) {\n      return false;\n    }\n    return Date.now() - metadata.heartbeatAt >= LOCK_ORPHAN_GRACE_MS;\n  }\n\n  const lockStat = await stat(lockPath).catch(() => undefined);\n  if (lockStat === undefined) {\n    return false;\n  }\n  return Date.now() - lockStat.mtimeMs >= LOCK_METADATALESS_STALE_MS;\n}\n\nasync function readLockMetadata(lockPath: string): Promise<FilesystemLockMetadata | undefined> {\n  const metadataPath = path.join(lockPath, LOCK_METADATA_FILENAME);\n  if (!(await pathExists(metadataPath))) {\n    return undefined;\n  }\n\n  try {\n    const parsed = await readJsonFile<Partial<FilesystemLockMetadata>>(metadataPath);\n    const pid = parsed.pid;\n    const acquiredAt = parsed.acquiredAt;\n    const heartbeatAt = parsed.heartbeatAt;\n    if (\n      parsed.version !== LOCK_METADATA_VERSION ||\n      typeof parsed.ownerToken !== \"string\" ||\n      parsed.ownerToken.length === 0 ||\n      typeof pid !== \"number\" ||\n      !Number.isInteger(pid) ||\n      pid <= 0 ||\n      typeof acquiredAt !== \"number\" ||\n      !Number.isFinite(acquiredAt) ||\n      typeof heartbeatAt !== \"number\" ||\n      !Number.isFinite(heartbeatAt)\n    ) {\n      return undefined;\n    }\n    return {\n      version: LOCK_METADATA_VERSION,\n      ownerToken: parsed.ownerToken,\n      pid: pid,\n      acquiredAt: acquiredAt,\n      heartbeatAt: heartbeatAt,\n    };\n  } catch {\n    return undefined;\n  }\n}\n\nasync function writeLockMetadata(\n  lockPath: string,\n  metadata: FilesystemLockMetadata,\n): Promise<void> {\n  try {\n    await writeJsonFileAtomic(path.join(lockPath, LOCK_METADATA_FILENAME), metadata);\n  } catch (error) {\n    await rm(lockPath, { recursive: true, force: true }).catch(() => undefined);\n    throw error;\n  }\n}\n\nasync function touchLockMetadata(lockPath: string, ownerToken: string): Promise<void> {\n  const metadata = await readLockMetadata(lockPath);\n  if (metadata === undefined || metadata.ownerToken !== ownerToken) {\n    return;\n  }\n\n  await writeJsonFileAtomic(path.join(lockPath, LOCK_METADATA_FILENAME), {\n    ...metadata,\n    heartbeatAt: Date.now(),\n  }).catch(() => undefined);\n}\n\nfunction isProcessRunning(pid: number): boolean {\n  if (!Number.isInteger(pid) || pid <= 0) {\n    return false;\n  }\n\n  try {\n    process.kill(pid, 0);\n    return true;\n  } catch (error) {\n    return (error as NodeJS.ErrnoException | undefined)?.code === \"EPERM\";\n  }\n}\n","export * from \"../../../runtime-core/src/internal/filesystem.js\";\n","import { execFileSync } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\n\nimport { expandHome, firstExistingPath, resolveBinaryFromPath } from \"./chrome-discovery.js\";\n\nconst PROCESS_LIST_MAX_BUFFER_BYTES = 16 * 1024 * 1024;\nconst PS_COMMAND_ENV = { ...process.env, LC_ALL: \"C\" };\nconst WINDOWS_PROGRAM_FILES = process.env.PROGRAMFILES ?? \"C:\\\\Program Files\";\nconst WINDOWS_PROGRAM_FILES_X86 = process.env[\"PROGRAMFILES(X86)\"] ?? \"C:\\\\Program Files (x86)\";\n\nexport type BrowserBrandId =\n  | \"chrome\"\n  | \"chrome-canary\"\n  | \"chromium\"\n  | \"brave\"\n  | \"edge\"\n  | \"vivaldi\"\n  | \"helium\";\n\nexport interface BrowserBrandPlatformConfig {\n  readonly executableCandidates: readonly (string | null)[];\n  readonly userDataDir: string;\n  readonly bundleId?: string;\n  readonly processNames: readonly string[];\n}\n\nexport interface BrowserBrandRecord {\n  readonly id: BrowserBrandId;\n  readonly displayName: string;\n  readonly darwin?: BrowserBrandPlatformConfig;\n  readonly win32?: BrowserBrandPlatformConfig;\n  readonly linux?: BrowserBrandPlatformConfig;\n}\n\nexport interface InstalledBrowserBrand {\n  readonly brand: BrowserBrandRecord;\n  readonly brandId: BrowserBrandId;\n  readonly displayName: string;\n  readonly executablePath: string;\n  readonly userDataDir: string;\n}\n\nconst BROWSER_BRANDS: readonly BrowserBrandRecord[] = [\n  {\n    id: \"chrome\",\n    displayName: \"Google Chrome\",\n    darwin: {\n      executableCandidates: [\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"],\n      userDataDir: \"~/Library/Application Support/Google/Chrome\",\n      bundleId: \"com.google.Chrome\",\n      processNames: [\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"],\n    },\n    win32: {\n      executableCandidates: [\n        join(WINDOWS_PROGRAM_FILES, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n        join(WINDOWS_PROGRAM_FILES_X86, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n        join(\"~\", \"AppData\", \"Local\", \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n      ],\n      userDataDir: \"~/AppData/Local/Google/Chrome/User Data\",\n      processNames: [\"/google/chrome/application/chrome.exe\"],\n    },\n    linux: {\n      executableCandidates: [\n        \"/usr/bin/google-chrome\",\n        \"/usr/bin/google-chrome-stable\",\n        \"/opt/google/chrome/chrome\",\n        resolveBinaryFromPath(\"google-chrome\"),\n        resolveBinaryFromPath(\"google-chrome-stable\"),\n      ],\n      userDataDir: \"~/.config/google-chrome\",\n      processNames: [\"/google-chrome\", \"/google-chrome-stable\", \"/opt/google/chrome/chrome\"],\n    },\n  },\n  {\n    id: \"chrome-canary\",\n    displayName: \"Google Chrome Canary\",\n    darwin: {\n      executableCandidates: [\n        \"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary\",\n      ],\n      userDataDir: \"~/Library/Application Support/Google/Chrome Canary\",\n      bundleId: \"com.google.Chrome.canary\",\n      processNames: [\"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary\"],\n    },\n    win32: {\n      executableCandidates: [\n        join(\"~\", \"AppData\", \"Local\", \"Google\", \"Chrome SxS\", \"Application\", \"chrome.exe\"),\n      ],\n      userDataDir: \"~/AppData/Local/Google/Chrome SxS/User Data\",\n      processNames: [\"/google/chrome sxs/application/chrome.exe\"],\n    },\n  },\n  {\n    id: \"edge\",\n    displayName: \"Microsoft Edge\",\n    darwin: {\n      executableCandidates: [\"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge\"],\n      userDataDir: \"~/Library/Application Support/Microsoft Edge\",\n      bundleId: \"com.microsoft.edgemac\",\n      processNames: [\"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge\"],\n    },\n    win32: {\n      executableCandidates: [\n        join(WINDOWS_PROGRAM_FILES, \"Microsoft\", \"Edge\", \"Application\", \"msedge.exe\"),\n        join(WINDOWS_PROGRAM_FILES_X86, \"Microsoft\", \"Edge\", \"Application\", \"msedge.exe\"),\n        join(\"~\", \"AppData\", \"Local\", \"Microsoft\", \"Edge\", \"Application\", \"msedge.exe\"),\n      ],\n      userDataDir: \"~/AppData/Local/Microsoft/Edge/User Data\",\n      processNames: [\"/microsoft/edge/application/msedge.exe\"],\n    },\n    linux: {\n      executableCandidates: [\n        \"/usr/bin/microsoft-edge\",\n        \"/usr/bin/microsoft-edge-stable\",\n        \"/opt/microsoft/msedge/msedge\",\n        resolveBinaryFromPath(\"microsoft-edge\"),\n        resolveBinaryFromPath(\"microsoft-edge-stable\"),\n      ],\n      userDataDir: \"~/.config/microsoft-edge\",\n      processNames: [\"/microsoft-edge\", \"/microsoft-edge-stable\", \"/opt/microsoft/msedge/msedge\"],\n    },\n  },\n  {\n    id: \"brave\",\n    displayName: \"Brave Browser\",\n    darwin: {\n      executableCandidates: [\"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser\"],\n      userDataDir: \"~/Library/Application Support/BraveSoftware/Brave-Browser\",\n      bundleId: \"com.brave.Browser\",\n      processNames: [\"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser\"],\n    },\n    win32: {\n      executableCandidates: [\n        join(WINDOWS_PROGRAM_FILES, \"BraveSoftware\", \"Brave-Browser\", \"Application\", \"brave.exe\"),\n        join(\n          WINDOWS_PROGRAM_FILES_X86,\n          \"BraveSoftware\",\n          \"Brave-Browser\",\n          \"Application\",\n          \"brave.exe\",\n        ),\n        join(\"~\", \"AppData\", \"Local\", \"BraveSoftware\", \"Brave-Browser\", \"Application\", \"brave.exe\"),\n      ],\n      userDataDir: \"~/AppData/Local/BraveSoftware/Brave-Browser/User Data\",\n      processNames: [\"/bravesoftware/brave-browser/application/brave.exe\"],\n    },\n    linux: {\n      executableCandidates: [\n        \"/usr/bin/brave-browser\",\n        \"/opt/brave.com/brave/brave-browser\",\n        resolveBinaryFromPath(\"brave-browser\"),\n      ],\n      userDataDir: \"~/.config/BraveSoftware/Brave-Browser\",\n      processNames: [\"/brave-browser\", \"/opt/brave.com/brave/brave-browser\"],\n    },\n  },\n  {\n    id: \"vivaldi\",\n    displayName: \"Vivaldi\",\n    darwin: {\n      executableCandidates: [\"/Applications/Vivaldi.app/Contents/MacOS/Vivaldi\"],\n      userDataDir: \"~/Library/Application Support/Vivaldi\",\n      bundleId: \"com.vivaldi.Vivaldi\",\n      processNames: [\"/Applications/Vivaldi.app/Contents/MacOS/Vivaldi\"],\n    },\n    win32: {\n      executableCandidates: [\n        join(WINDOWS_PROGRAM_FILES, \"Vivaldi\", \"Application\", \"vivaldi.exe\"),\n        join(WINDOWS_PROGRAM_FILES_X86, \"Vivaldi\", \"Application\", \"vivaldi.exe\"),\n        join(\"~\", \"AppData\", \"Local\", \"Vivaldi\", \"Application\", \"vivaldi.exe\"),\n      ],\n      userDataDir: \"~/AppData/Local/Vivaldi/User Data\",\n      processNames: [\"/vivaldi/application/vivaldi.exe\"],\n    },\n    linux: {\n      executableCandidates: [\n        \"/usr/bin/vivaldi\",\n        \"/usr/bin/vivaldi-stable\",\n        \"/opt/vivaldi/vivaldi\",\n        resolveBinaryFromPath(\"vivaldi\"),\n        resolveBinaryFromPath(\"vivaldi-stable\"),\n      ],\n      userDataDir: \"~/.config/vivaldi\",\n      processNames: [\"/vivaldi\", \"/vivaldi-stable\", \"/opt/vivaldi/vivaldi\"],\n    },\n  },\n  {\n    id: \"helium\",\n    displayName: \"Helium\",\n    darwin: {\n      executableCandidates: [\"/Applications/Helium.app/Contents/MacOS/Helium\"],\n      userDataDir: \"~/Library/Application Support/net.imput.helium\",\n      processNames: [\"/Applications/Helium.app/Contents/MacOS/Helium\"],\n    },\n  },\n  {\n    id: \"chromium\",\n    displayName: \"Chromium\",\n    darwin: {\n      executableCandidates: [\"/Applications/Chromium.app/Contents/MacOS/Chromium\"],\n      userDataDir: \"~/Library/Application Support/Chromium\",\n      bundleId: \"org.chromium.Chromium\",\n      processNames: [\"/Applications/Chromium.app/Contents/MacOS/Chromium\"],\n    },\n    win32: {\n      executableCandidates: [\n        join(WINDOWS_PROGRAM_FILES, \"Chromium\", \"Application\", \"chrome.exe\"),\n        join(WINDOWS_PROGRAM_FILES_X86, \"Chromium\", \"Application\", \"chrome.exe\"),\n        join(\"~\", \"AppData\", \"Local\", \"Chromium\", \"Application\", \"chrome.exe\"),\n      ],\n      userDataDir: \"~/AppData/Local/Chromium/User Data\",\n      processNames: [\"/chromium/application/chrome.exe\"],\n    },\n    linux: {\n      executableCandidates: [\n        \"/usr/bin/chromium\",\n        \"/usr/bin/chromium-browser\",\n        resolveBinaryFromPath(\"chromium\"),\n        resolveBinaryFromPath(\"chromium-browser\"),\n      ],\n      userDataDir: \"~/.config/chromium\",\n      processNames: [\"/chromium\", \"/chromium-browser\"],\n    },\n  },\n] as const;\n\nexport function getAllBrowserBrands(): readonly BrowserBrandRecord[] {\n  return BROWSER_BRANDS;\n}\n\nexport function getBrowserBrand(id: BrowserBrandId): BrowserBrandRecord {\n  const brand = BROWSER_BRANDS.find((candidate) => candidate.id === id);\n  if (!brand) {\n    throw new Error(`Unknown browser brand \"${id}\".`);\n  }\n  return brand;\n}\n\nexport function resolveBrandPlatformConfig(\n  brand: BrowserBrandRecord,\n  platform: NodeJS.Platform = process.platform,\n): BrowserBrandPlatformConfig | undefined {\n  if (platform === \"darwin\") {\n    return brand.darwin;\n  }\n  if (platform === \"win32\") {\n    return brand.win32;\n  }\n  if (platform === \"linux\") {\n    return brand.linux;\n  }\n  return undefined;\n}\n\nexport function detectInstalledBrowserBrands(): readonly InstalledBrowserBrand[] {\n  const installations: InstalledBrowserBrand[] = [];\n\n  for (const brand of BROWSER_BRANDS) {\n    const platformConfig = resolveBrandPlatformConfig(brand);\n    if (!platformConfig) {\n      continue;\n    }\n\n    const executablePath = firstExistingPath(\n      resolveExecutableCandidates(platformConfig.executableCandidates),\n    );\n    if (!executablePath) {\n      continue;\n    }\n\n    installations.push({\n      brand,\n      brandId: brand.id,\n      displayName: brand.displayName,\n      executablePath,\n      userDataDir: resolve(expandHome(platformConfig.userDataDir)),\n    });\n  }\n\n  return installations;\n}\n\nexport function resolveBrandExecutablePath(\n  brand: BrowserBrandRecord,\n  explicitPath?: string,\n): string {\n  if (explicitPath !== undefined) {\n    const resolvedPath = resolve(expandHome(explicitPath));\n    if (!existsSync(resolvedPath)) {\n      throw new Error(`${brand.displayName} executable was not found at \"${resolvedPath}\".`);\n    }\n    return resolvedPath;\n  }\n\n  const platformConfig = resolveBrandPlatformConfig(brand);\n  if (!platformConfig) {\n    throw new Error(`${brand.displayName} is not supported on ${process.platform}.`);\n  }\n\n  const resolvedPath = firstExistingPath(\n    resolveExecutableCandidates(platformConfig.executableCandidates),\n  );\n  if (!resolvedPath) {\n    throw new Error(\n      `Could not find a ${brand.displayName} executable. Pass --executable-path or browser.executablePath.`,\n    );\n  }\n  return resolvedPath;\n}\n\nexport function resolveBrandUserDataDir(brand: BrowserBrandRecord, explicitDir?: string): string {\n  if (explicitDir !== undefined) {\n    return resolve(expandHome(explicitDir));\n  }\n\n  const platformConfig = resolveBrandPlatformConfig(brand);\n  if (!platformConfig) {\n    throw new Error(`${brand.displayName} is not supported on ${process.platform}.`);\n  }\n\n  return resolve(expandHome(platformConfig.userDataDir));\n}\n\nexport function isBrandProcess(brand: BrowserBrandRecord, commandLine: string): boolean {\n  const normalizedCommand = normalizeCommand(commandLine);\n  if (!normalizedCommand) {\n    return false;\n  }\n  if (normalizedCommand.includes(\"crashpad_handler\")) {\n    return false;\n  }\n  if (/\\s--type=/.test(normalizedCommand)) {\n    return false;\n  }\n\n  return getBrandProcessMarkers(brand).some((marker) => normalizedCommand.includes(marker));\n}\n\nexport function findBrandProcess(brand: BrowserBrandRecord): {\n  readonly pid: number;\n} | null {\n  for (const processEntry of listProcesses()) {\n    if (isBrandProcess(brand, processEntry.commandLine)) {\n      return { pid: processEntry.pid };\n    }\n  }\n\n  return null;\n}\n\nfunction getBrandProcessMarkers(brand: BrowserBrandRecord): readonly string[] {\n  const markers = new Set<string>();\n\n  for (const config of [brand.darwin, brand.win32, brand.linux]) {\n    if (!config) {\n      continue;\n    }\n\n    for (const processName of config.processNames) {\n      const normalized = normalizeCommand(processName);\n      if (normalized) {\n        markers.add(normalized);\n      }\n    }\n\n    for (const candidate of config.executableCandidates) {\n      if (!candidate) {\n        continue;\n      }\n\n      const normalized = normalizeCommand(resolve(expandHome(candidate)));\n      if (normalized) {\n        markers.add(normalized);\n      }\n    }\n  }\n\n  return [...markers];\n}\n\nfunction resolveExecutableCandidates(\n  candidates: readonly (string | null)[],\n): readonly (string | null)[] {\n  return candidates.map((candidate) => (candidate ? resolve(expandHome(candidate)) : null));\n}\n\nfunction listProcesses(): readonly {\n  readonly pid: number;\n  readonly commandLine: string;\n}[] {\n  if (process.platform === \"win32\") {\n    return listWindowsProcesses();\n  }\n  return listUnixProcesses();\n}\n\nfunction listUnixProcesses(): readonly {\n  readonly pid: number;\n  readonly commandLine: string;\n}[] {\n  try {\n    const output = execFileSync(\"ps\", [\"-A\", \"-o\", \"pid=,command=\"], {\n      encoding: \"utf8\",\n      env: PS_COMMAND_ENV,\n      maxBuffer: PROCESS_LIST_MAX_BUFFER_BYTES,\n      stdio: [\"ignore\", \"pipe\", \"ignore\"],\n    });\n\n    return output\n      .split(/\\r?\\n/)\n      .map((line) => line.trim())\n      .filter((line) => line.length > 0)\n      .map((line) => {\n        const match = /^(\\d+)\\s+(.*)$/.exec(line);\n        if (!match) {\n          return null;\n        }\n\n        const pid = Number.parseInt(match[1] ?? \"\", 10);\n        const commandLine = match[2]?.trim() ?? \"\";\n        if (!Number.isInteger(pid) || pid <= 0 || commandLine.length === 0) {\n          return null;\n        }\n\n        return {\n          pid,\n          commandLine,\n        };\n      })\n      .filter(\n        (entry): entry is { readonly pid: number; readonly commandLine: string } => entry !== null,\n      )\n      .sort((left, right) => left.pid - right.pid);\n  } catch {\n    return [];\n  }\n}\n\nfunction listWindowsProcesses(): readonly {\n  readonly pid: number;\n  readonly commandLine: string;\n}[] {\n  try {\n    const output = execFileSync(\n      \"powershell.exe\",\n      [\n        \"-NoProfile\",\n        \"-Command\",\n        \"Get-CimInstance Win32_Process | Select-Object ProcessId,CommandLine | ConvertTo-Json -Compress\",\n      ],\n      {\n        encoding: \"utf8\",\n        maxBuffer: PROCESS_LIST_MAX_BUFFER_BYTES,\n        stdio: [\"ignore\", \"pipe\", \"ignore\"],\n      },\n    ).trim();\n    if (!output) {\n      return [];\n    }\n\n    const parsed = JSON.parse(output) as\n      | {\n          readonly ProcessId?: unknown;\n          readonly CommandLine?: unknown;\n        }\n      | readonly {\n          readonly ProcessId?: unknown;\n          readonly CommandLine?: unknown;\n        }[];\n    const records = Array.isArray(parsed) ? parsed : [parsed];\n\n    return records\n      .map((record) => {\n        const pid = Number(record.ProcessId);\n        const commandLine = typeof record.CommandLine === \"string\" ? record.CommandLine.trim() : \"\";\n        if (!Number.isInteger(pid) || pid <= 0 || commandLine.length === 0) {\n          return null;\n        }\n\n        return {\n          pid,\n          commandLine,\n        };\n      })\n      .filter(\n        (entry): entry is { readonly pid: number; readonly commandLine: string } => entry !== null,\n      )\n      .sort((left, right) => left.pid - right.pid);\n  } catch {\n    return [];\n  }\n}\n\nfunction normalizeCommand(value: string): string {\n  return value.trim().replaceAll(\"\\\\\", \"/\").toLowerCase();\n}\n","import { execFileSync } from \"node:child_process\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { basename, join, resolve } from \"node:path\";\n\nimport { detectInstalledBrowserBrands } from \"./browser-brands.js\";\nimport type {\n  LocalBrowserInstallation,\n  LocalChromeInstallation,\n  LocalChromeProfileDescriptor,\n} from \"./types.js\";\n\nexport function expandHome(value: string): string {\n  if (value === \"~\" || value.startsWith(\"~/\")) {\n    return join(homedir(), value.slice(1));\n  }\n  return value;\n}\n\nexport function resolveChromeUserDataDir(userDataDir: string | undefined): string {\n  if (userDataDir !== undefined) {\n    return resolve(expandHome(userDataDir));\n  }\n\n  const installation = detectLocalChromeInstallations().find(\n    (candidate) =>\n      existsSync(join(candidate.userDataDir, \"Local State\")) || candidate.executablePath !== null,\n  );\n  if (!installation) {\n    throw new Error(\"Could not find a local Chrome or Chromium profile directory.\");\n  }\n  return installation.userDataDir;\n}\n\nexport function resolveChromeExecutablePath(executablePath: string | undefined): string {\n  if (executablePath !== undefined) {\n    const resolvedPath = resolve(expandHome(executablePath));\n    if (!existsSync(resolvedPath)) {\n      throw new Error(`Chrome executable was not found at \"${resolvedPath}\".`);\n    }\n    return resolvedPath;\n  }\n\n  const chromeInstallation = detectLocalChromeInstallations().find(\n    (installation) => installation.brand === \"chrome\" && installation.executablePath !== null,\n  );\n  if (chromeInstallation?.executablePath) {\n    return chromeInstallation.executablePath;\n  }\n\n  const brandedInstallation = detectInstalledBrowserBrands()[0];\n  if (brandedInstallation) {\n    return brandedInstallation.executablePath;\n  }\n\n  throw new Error(\n    \"Could not find a Chrome or Chromium executable. Pass browser.executablePath or --executable-path.\",\n  );\n}\n\nfunction detectLocalChromeInstallations(): readonly LocalChromeInstallation[] {\n  if (process.platform === \"darwin\") {\n    return [\n      {\n        brand: \"chrome\",\n        executablePath: firstExistingPath([\n          \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\",\n          \"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary\",\n        ]),\n        userDataDir: join(homedir(), \"Library\", \"Application Support\", \"Google\", \"Chrome\"),\n      },\n      {\n        brand: \"chromium\",\n        executablePath: firstExistingPath([\"/Applications/Chromium.app/Contents/MacOS/Chromium\"]),\n        userDataDir: join(homedir(), \"Library\", \"Application Support\", \"Chromium\"),\n      },\n    ];\n  }\n\n  if (process.platform === \"win32\") {\n    const programFiles = process.env.PROGRAMFILES ?? \"C:\\\\Program Files\";\n    const programFilesX86 = process.env[\"PROGRAMFILES(X86)\"] ?? \"C:\\\\Program Files (x86)\";\n    const localAppData = process.env.LOCALAPPDATA ?? join(homedir(), \"AppData\", \"Local\");\n    return [\n      {\n        brand: \"chrome\",\n        executablePath: firstExistingPath([\n          join(programFiles, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n          join(programFilesX86, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n          join(localAppData, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n        ]),\n        userDataDir: join(localAppData, \"Google\", \"Chrome\", \"User Data\"),\n      },\n      {\n        brand: \"chromium\",\n        executablePath: firstExistingPath([\n          join(programFiles, \"Chromium\", \"Application\", \"chrome.exe\"),\n          join(programFilesX86, \"Chromium\", \"Application\", \"chrome.exe\"),\n          join(localAppData, \"Chromium\", \"Application\", \"chrome.exe\"),\n        ]),\n        userDataDir: join(localAppData, \"Chromium\", \"User Data\"),\n      },\n    ];\n  }\n\n  return [\n    {\n      brand: \"chrome\",\n      executablePath: firstExistingPath([\n        \"/usr/bin/google-chrome\",\n        \"/usr/bin/google-chrome-stable\",\n        resolveBinaryFromPath(\"google-chrome\"),\n        resolveBinaryFromPath(\"google-chrome-stable\"),\n      ]),\n      userDataDir: join(homedir(), \".config\", \"google-chrome\"),\n    },\n    {\n      brand: \"chromium\",\n      executablePath: firstExistingPath([\n        \"/usr/bin/chromium\",\n        \"/usr/bin/chromium-browser\",\n        resolveBinaryFromPath(\"chromium\"),\n        resolveBinaryFromPath(\"chromium-browser\"),\n      ]),\n      userDataDir: join(homedir(), \".config\", \"chromium\"),\n    },\n  ];\n}\n\nexport function detectLocalBrowserInstallations(): readonly LocalBrowserInstallation[] {\n  return detectInstalledBrowserBrands().map((installation) => ({\n    brand: installation.brandId,\n    executablePath: installation.executablePath,\n    userDataDir: installation.userDataDir,\n  }));\n}\n\nexport function listLocalChromeProfiles(\n  userDataDir = resolveChromeUserDataDir(undefined),\n): readonly LocalChromeProfileDescriptor[] {\n  const resolvedUserDataDir = resolve(expandHome(userDataDir));\n  const localStatePath = join(resolvedUserDataDir, \"Local State\");\n  if (!existsSync(localStatePath)) {\n    return [];\n  }\n\n  try {\n    const raw = JSON.parse(readFileSync(localStatePath, \"utf8\")) as {\n      readonly profile?: {\n        readonly info_cache?: Record<string, unknown>;\n      };\n    };\n    const infoCache = raw.profile?.info_cache;\n    if (!infoCache || typeof infoCache !== \"object\") {\n      return [];\n    }\n\n    return Object.entries(infoCache)\n      .map(([directory, info]) => {\n        const record =\n          info && typeof info === \"object\" && !Array.isArray(info)\n            ? (info as Record<string, unknown>)\n            : {};\n        const name =\n          typeof record.name === \"string\" && record.name.trim().length > 0\n            ? record.name.trim()\n            : directory || basename(directory);\n        return {\n          directory,\n          name,\n          userDataDir: resolvedUserDataDir,\n        };\n      })\n      .filter((profile) => profile.directory.trim().length > 0)\n      .sort((left, right) => left.directory.localeCompare(right.directory));\n  } catch {\n    return [];\n  }\n}\n\nexport function readDevToolsActivePort(userDataDir: string): {\n  readonly port: number;\n  readonly webSocketPath: string;\n} | null {\n  const devToolsPath = join(userDataDir, \"DevToolsActivePort\");\n  if (!existsSync(devToolsPath)) {\n    return null;\n  }\n\n  try {\n    const lines = readFileSync(devToolsPath, \"utf8\")\n      .split(/\\r?\\n/)\n      .map((line) => line.trim())\n      .filter((line) => line.length > 0);\n    const port = Number.parseInt(lines[0] ?? \"\", 10);\n    if (!Number.isInteger(port) || port <= 0) {\n      return null;\n    }\n\n    return {\n      port,\n      webSocketPath: lines[1] ?? \"/devtools/browser\",\n    };\n  } catch {\n    return null;\n  }\n}\n\nexport function firstExistingPath(\n  candidates: readonly (string | null | undefined)[],\n): string | null {\n  for (const candidate of candidates) {\n    if (candidate && existsSync(candidate)) {\n      return candidate;\n    }\n  }\n  return null;\n}\n\nexport function resolveBinaryFromPath(name: string): string | null {\n  try {\n    const output = execFileSync(\"which\", [name], {\n      encoding: \"utf8\",\n      stdio: [\"ignore\", \"pipe\", \"ignore\"],\n    }).trim();\n    return output.length > 0 ? output : null;\n  } catch {\n    return null;\n  }\n}\n","import { detectLocalBrowserInstallations, readDevToolsActivePort } from \"./chrome-discovery.js\";\nimport type { InspectedCdpEndpoint, LocalCdpBrowserCandidate } from \"./types.js\";\n\nconst DEFAULT_DISCOVERY_TIMEOUT_MS = 2_000;\nconst DISCOVERY_FALLBACK_PORT = 9222;\n\ninterface InspectCdpEndpointInput {\n  readonly endpoint: string;\n  readonly headers?: Readonly<Record<string, string>>;\n  readonly timeoutMs?: number;\n}\n\ninterface ProbeCdpEndpointInput extends InspectCdpEndpointInput {\n  readonly fallbackBrowserWebSocketPath?: string;\n}\n\ninterface NormalizedProbeTarget {\n  readonly fallbackBrowserWebSocketUrl?: string;\n  readonly httpUrl: URL;\n}\n\ninterface CdpVersionResponse {\n  readonly Browser?: string;\n  readonly \"Protocol-Version\"?: string;\n  readonly webSocketDebuggerUrl?: string;\n}\n\nexport class OpensteerAttachAmbiguousError extends Error {\n  readonly code = \"attach-ambiguous\";\n\n  constructor(readonly candidates: readonly LocalCdpBrowserCandidate[]) {\n    super(\n      \"Multiple running Chromium DevTools endpoints were discovered. Specify the desired endpoint explicitly.\",\n    );\n    this.name = \"OpensteerAttachAmbiguousError\";\n  }\n}\n\nexport async function inspectCdpEndpoint(\n  input: InspectCdpEndpointInput,\n): Promise<InspectedCdpEndpoint> {\n  const inspected = await probeCdpEndpoint(input);\n  if (inspected === null) {\n    throw new Error(`Could not inspect CDP endpoint \"${input.endpoint}\".`);\n  }\n  return inspected;\n}\n\nexport async function discoverLocalCdpBrowsers(\n  input: {\n    readonly timeoutMs?: number;\n  } = {},\n): Promise<readonly LocalCdpBrowserCandidate[]> {\n  const timeoutMs = input.timeoutMs ?? DEFAULT_DISCOVERY_TIMEOUT_MS;\n  const candidates: LocalCdpBrowserCandidate[] = [];\n\n  for (const installation of detectLocalBrowserInstallations()) {\n    const activePort = readDevToolsActivePort(installation.userDataDir);\n    if (!activePort) {\n      continue;\n    }\n\n    const inspected = await probeCdpEndpoint({\n      endpoint: `http://127.0.0.1:${String(activePort.port)}`,\n      timeoutMs,\n      fallbackBrowserWebSocketPath: activePort.webSocketPath,\n    });\n    if (inspected === null) {\n      continue;\n    }\n\n    candidates.push({\n      ...inspected,\n      source: \"devtools-active-port\",\n      installationBrand: installation.brand,\n      userDataDir: installation.userDataDir,\n    });\n  }\n\n  const fallbackCandidate = await probeCdpEndpoint({\n    endpoint: String(DISCOVERY_FALLBACK_PORT),\n    timeoutMs,\n  });\n  if (fallbackCandidate !== null) {\n    candidates.push({\n      ...fallbackCandidate,\n      source: \"fallback-port\",\n    });\n  }\n\n  return dedupeAndSortCandidates(candidates);\n}\n\nexport async function selectAttachBrowserCandidate(\n  input: {\n    readonly timeoutMs?: number;\n  } = {},\n): Promise<LocalCdpBrowserCandidate> {\n  const candidates = await discoverLocalCdpBrowsers(input);\n  if (candidates.length === 0) {\n    throw new Error(\n      \"No running Chromium browser instance found. Enable remote debugging or specify an attach endpoint explicitly.\",\n    );\n  }\n\n  const highestPriority = Math.max(...candidates.map(getAttachCandidatePriority));\n  const winners = candidates.filter(\n    (candidate) => getAttachCandidatePriority(candidate) === highestPriority,\n  );\n  if (winners.length === 1) {\n    return winners[0]!;\n  }\n\n  throw new OpensteerAttachAmbiguousError(candidates);\n}\n\nasync function probeCdpEndpoint(\n  input: ProbeCdpEndpointInput,\n): Promise<InspectedCdpEndpoint | null> {\n  const trimmedEndpoint = input.endpoint.trim();\n  if (!trimmedEndpoint) {\n    return null;\n  }\n\n  const target = normalizeProbeTarget(trimmedEndpoint);\n  const timeoutMs = input.timeoutMs ?? DEFAULT_DISCOVERY_TIMEOUT_MS;\n\n  const versionPayload = await fetchJson<CdpVersionResponse>(\n    new URL(\"/json/version\", target.httpUrl),\n    input.headers,\n    timeoutMs,\n  );\n  if (versionPayload !== null) {\n    const payload = versionPayload;\n    if (\n      typeof payload.webSocketDebuggerUrl === \"string\" &&\n      payload.webSocketDebuggerUrl.length > 0\n    ) {\n      return createInspectedCdpEndpoint({\n        browserWebSocketUrl: rewriteBrowserWebSocketHost(\n          payload.webSocketDebuggerUrl,\n          target.httpUrl,\n        ),\n        httpUrl: target.httpUrl,\n        ...(payload.Browser === undefined ? {} : { browser: payload.Browser }),\n        ...(payload[\"Protocol-Version\"] === undefined\n          ? {}\n          : { protocolVersion: payload[\"Protocol-Version\"] }),\n      });\n    }\n  }\n\n  const listPayload = await fetchJson<\n    readonly {\n      readonly type?: unknown;\n      readonly webSocketDebuggerUrl?: unknown;\n    }[]\n  >(new URL(\"/json/list\", target.httpUrl), input.headers, timeoutMs);\n  if (listPayload !== null) {\n    const browserTarget =\n      listPayload.find((candidate) => candidate.type === \"browser\") ??\n      listPayload.find((candidate) => typeof candidate.webSocketDebuggerUrl === \"string\");\n    if (typeof browserTarget?.webSocketDebuggerUrl === \"string\") {\n      return createInspectedCdpEndpoint({\n        browserWebSocketUrl: rewriteBrowserWebSocketHost(\n          browserTarget.webSocketDebuggerUrl,\n          target.httpUrl,\n        ),\n        httpUrl: target.httpUrl,\n      });\n    }\n  }\n\n  if (\n    input.fallbackBrowserWebSocketPath !== undefined &&\n    (await isHttpEndpointReachable(target.httpUrl, timeoutMs))\n  ) {\n    return createInspectedCdpEndpoint({\n      browserWebSocketUrl: buildBrowserWebSocketUrl(\n        target.httpUrl,\n        input.fallbackBrowserWebSocketPath,\n      ),\n      httpUrl: target.httpUrl,\n    });\n  }\n\n  if (\n    target.fallbackBrowserWebSocketUrl !== undefined &&\n    (await isHttpEndpointReachable(target.httpUrl, timeoutMs))\n  ) {\n    return createInspectedCdpEndpoint({\n      browserWebSocketUrl: target.fallbackBrowserWebSocketUrl,\n      httpUrl: target.httpUrl,\n    });\n  }\n\n  return null;\n}\n\nfunction dedupeAndSortCandidates(\n  candidates: readonly LocalCdpBrowserCandidate[],\n): readonly LocalCdpBrowserCandidate[] {\n  const deduped = new Map<string, LocalCdpBrowserCandidate>();\n\n  for (const candidate of [...candidates].sort(compareCandidates)) {\n    const existing = deduped.get(candidate.endpoint);\n    if (!existing || compareCandidates(candidate, existing) < 0) {\n      deduped.set(candidate.endpoint, candidate);\n    }\n  }\n\n  return [...deduped.values()].sort(compareCandidates);\n}\n\nfunction compareCandidates(\n  left: LocalCdpBrowserCandidate,\n  right: LocalCdpBrowserCandidate,\n): number {\n  return (\n    getAttachCandidatePriority(right) - getAttachCandidatePriority(left) ||\n    left.endpoint.localeCompare(right.endpoint) ||\n    (left.userDataDir ?? \"\").localeCompare(right.userDataDir ?? \"\")\n  );\n}\n\nfunction getAttachCandidatePriority(candidate: LocalCdpBrowserCandidate): number {\n  return candidate.source === \"devtools-active-port\" ? 2 : 1;\n}\n\nfunction createInspectedCdpEndpoint(input: {\n  readonly browser?: string;\n  readonly browserWebSocketUrl: string;\n  readonly httpUrl: URL;\n  readonly protocolVersion?: string;\n}): InspectedCdpEndpoint {\n  const port = readPort(input.httpUrl);\n  return {\n    endpoint: input.browserWebSocketUrl,\n    ...(input.browser === undefined ? {} : { browser: input.browser }),\n    ...(input.protocolVersion === undefined ? {} : { protocolVersion: input.protocolVersion }),\n    httpUrl: input.httpUrl.toString(),\n    ...(port === undefined ? {} : { port }),\n  };\n}\n\nfunction normalizeProbeTarget(endpoint: string): NormalizedProbeTarget {\n  if (/^\\d+$/.test(endpoint)) {\n    return {\n      httpUrl: new URL(`http://127.0.0.1:${endpoint}`),\n    };\n  }\n\n  if (endpoint.startsWith(\"ws://\") || endpoint.startsWith(\"wss://\")) {\n    const url = new URL(endpoint);\n    return {\n      fallbackBrowserWebSocketUrl: url.toString(),\n      httpUrl: new URL(`${url.protocol === \"wss:\" ? \"https:\" : \"http:\"}//${url.host}`),\n    };\n  }\n\n  try {\n    const url =\n      endpoint.startsWith(\"http://\") || endpoint.startsWith(\"https://\")\n        ? new URL(endpoint)\n        : new URL(`http://${endpoint}`);\n    return {\n      httpUrl: new URL(`${url.protocol}//${url.host}`),\n    };\n  } catch {\n    throw new Error(`Invalid CDP endpoint \"${endpoint}\".`);\n  }\n}\n\nasync function fetchJson<T>(\n  url: URL,\n  headers: Readonly<Record<string, string>> | undefined,\n  timeoutMs: number,\n): Promise<T | null> {\n  const response = await fetch(url, {\n    ...(headers === undefined ? {} : { headers }),\n    signal: AbortSignal.timeout(timeoutMs),\n  }).catch(() => null);\n  if (!response?.ok) {\n    return null;\n  }\n\n  return (await response.json()) as T;\n}\n\nasync function isHttpEndpointReachable(url: URL, timeoutMs: number): Promise<boolean> {\n  const response = await fetch(url, {\n    signal: AbortSignal.timeout(timeoutMs),\n  }).catch(() => null);\n  return response !== null;\n}\n\nfunction buildBrowserWebSocketUrl(httpUrl: URL, webSocketPath: string): string {\n  const protocol = httpUrl.protocol === \"https:\" ? \"wss:\" : \"ws:\";\n  return `${protocol}//${httpUrl.host}${normalizeWebSocketPath(webSocketPath)}`;\n}\n\nfunction normalizeWebSocketPath(path: string): string {\n  return path.startsWith(\"/\") ? path : `/${path}`;\n}\n\nfunction rewriteBrowserWebSocketHost(browserWsUrl: string, requestedUrl: URL): string {\n  try {\n    const parsed = new URL(browserWsUrl);\n    parsed.protocol = requestedUrl.protocol === \"https:\" ? \"wss:\" : \"ws:\";\n    parsed.hostname = requestedUrl.hostname;\n    parsed.port = requestedUrl.port;\n    return parsed.toString();\n  } catch {\n    return browserWsUrl;\n  }\n}\n\nfunction readPort(url: URL): number | undefined {\n  const port = Number.parseInt(url.port, 10);\n  return Number.isInteger(port) && port > 0 ? port : undefined;\n}\n","import { rm } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { OpensteerSessionCapabilities, OpensteerSessionOwnership } from \"@opensteer/protocol\";\n\nimport { pathExists, readJsonFile, writeJsonFileAtomic } from \"./internal/filesystem.js\";\nimport { inspectCdpEndpoint } from \"./local-browser/cdp-discovery.js\";\n\nexport const OPENSTEER_LIVE_SESSION_LAYOUT = \"opensteer-session\";\nexport const OPENSTEER_LIVE_SESSION_VERSION = 1;\n\nexport type OpensteerLiveSessionProvider = \"local\" | \"cloud\";\n\ninterface PersistedSessionRecordBase {\n  readonly layout: typeof OPENSTEER_LIVE_SESSION_LAYOUT;\n  readonly version: typeof OPENSTEER_LIVE_SESSION_VERSION;\n  readonly provider: OpensteerLiveSessionProvider;\n  readonly workspace?: string;\n  readonly updatedAt: number;\n  readonly activePageRef?: string;\n  readonly activePageUrl?: string;\n  readonly activePageTitle?: string;\n  readonly reconnectable?: boolean;\n  readonly capabilities?: OpensteerSessionCapabilities;\n}\n\nexport interface PersistedLocalBrowserSessionRecord extends PersistedSessionRecordBase {\n  readonly provider: \"local\";\n  readonly engine: \"playwright\" | \"abp\";\n  readonly ownership?: Exclude<OpensteerSessionOwnership, \"managed\">;\n  readonly endpoint?: string;\n  readonly baseUrl?: string;\n  readonly remoteDebuggingUrl?: string;\n  readonly sessionDir?: string;\n  readonly pid: number;\n  readonly startedAt: number;\n  readonly executablePath?: string;\n  readonly userDataDir: string;\n}\n\nexport interface PersistedCloudSessionRecord extends PersistedSessionRecordBase {\n  readonly provider: \"cloud\";\n  readonly sessionId: string;\n  readonly startedAt: number;\n}\n\nexport type PersistedSessionRecord =\n  | PersistedLocalBrowserSessionRecord\n  | PersistedCloudSessionRecord;\n\nexport function resolveLiveSessionRecordPath(\n  rootPath: string,\n  provider: OpensteerLiveSessionProvider,\n): string {\n  return path.join(rootPath, \"live\", provider === \"local\" ? \"local.json\" : \"cloud.json\");\n}\n\nexport function resolveLocalSessionRecordPath(rootPath: string): string {\n  return resolveLiveSessionRecordPath(rootPath, \"local\");\n}\n\nexport function resolveCloudSessionRecordPath(rootPath: string): string {\n  return resolveLiveSessionRecordPath(rootPath, \"cloud\");\n}\n\nexport async function readPersistedSessionRecord(\n  rootPath: string,\n  provider: OpensteerLiveSessionProvider,\n): Promise<PersistedSessionRecord | undefined> {\n  const sessionPath = resolveLiveSessionRecordPath(rootPath, provider);\n  if (!(await pathExists(sessionPath))) {\n    return undefined;\n  }\n\n  const parsed = await readJsonFile<Partial<PersistedSessionRecord>>(sessionPath);\n  if (provider === \"local\" && isPersistedLocalBrowserSessionRecord(parsed)) {\n    return parsed;\n  }\n  if (provider === \"cloud\" && isPersistedCloudSessionRecord(parsed)) {\n    return parsed;\n  }\n  return undefined;\n}\n\nexport async function readPersistedCloudSessionRecord(\n  rootPath: string,\n): Promise<PersistedCloudSessionRecord | undefined> {\n  const record = await readPersistedSessionRecord(rootPath, \"cloud\");\n  return record?.provider === \"cloud\" ? record : undefined;\n}\n\nexport async function readPersistedLocalBrowserSessionRecord(\n  rootPath: string,\n): Promise<PersistedLocalBrowserSessionRecord | undefined> {\n  const record = await readPersistedSessionRecord(rootPath, \"local\");\n  return record?.provider === \"local\" ? record : undefined;\n}\n\nexport async function writePersistedSessionRecord(\n  rootPath: string,\n  record: PersistedSessionRecord,\n): Promise<void> {\n  await writeJsonFileAtomic(resolveLiveSessionRecordPath(rootPath, record.provider), record);\n}\n\nexport async function clearPersistedSessionRecord(\n  rootPath: string,\n  provider: OpensteerLiveSessionProvider,\n): Promise<void> {\n  await rm(resolveLiveSessionRecordPath(rootPath, provider), { force: true });\n}\n\nexport function getPersistedLocalBrowserSessionOwnership(\n  record: PersistedLocalBrowserSessionRecord,\n): Exclude<OpensteerSessionOwnership, \"managed\"> {\n  return record.ownership === \"attached\" ? \"attached\" : \"owned\";\n}\n\nexport async function isAttachedLocalBrowserSessionReachable(\n  record: PersistedLocalBrowserSessionRecord,\n): Promise<boolean> {\n  if (getPersistedLocalBrowserSessionOwnership(record) !== \"attached\") {\n    return false;\n  }\n  if (record.engine !== \"playwright\" || record.endpoint === undefined) {\n    return false;\n  }\n  try {\n    await inspectCdpEndpoint({\n      endpoint: record.endpoint,\n      timeoutMs: 1_500,\n    });\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nfunction isPersistedCloudSessionRecord(\n  value: Partial<PersistedCloudSessionRecord> | Partial<PersistedSessionRecord>,\n): value is PersistedCloudSessionRecord {\n  return (\n    value.layout === OPENSTEER_LIVE_SESSION_LAYOUT &&\n    value.version === OPENSTEER_LIVE_SESSION_VERSION &&\n    value.provider === \"cloud\" &&\n    typeof value.sessionId === \"string\" &&\n    value.sessionId.length > 0 &&\n    (value.activePageUrl === undefined || typeof value.activePageUrl === \"string\") &&\n    (value.activePageTitle === undefined || typeof value.activePageTitle === \"string\") &&\n    typeof value.startedAt === \"number\" &&\n    Number.isFinite(value.startedAt) &&\n    typeof value.updatedAt === \"number\" &&\n    Number.isFinite(value.updatedAt)\n  );\n}\n\nfunction isPersistedLocalBrowserSessionRecord(\n  value: Partial<PersistedLocalBrowserSessionRecord> | Partial<PersistedSessionRecord>,\n): value is PersistedLocalBrowserSessionRecord {\n  return (\n    value.layout === OPENSTEER_LIVE_SESSION_LAYOUT &&\n    value.version === OPENSTEER_LIVE_SESSION_VERSION &&\n    value.provider === \"local\" &&\n    (value.engine === \"playwright\" || value.engine === \"abp\") &&\n    (value.ownership === undefined ||\n      value.ownership === \"owned\" ||\n      value.ownership === \"attached\") &&\n    (value.activePageUrl === undefined || typeof value.activePageUrl === \"string\") &&\n    (value.activePageTitle === undefined || typeof value.activePageTitle === \"string\") &&\n    typeof value.pid === \"number\" &&\n    Number.isFinite(value.pid) &&\n    typeof value.startedAt === \"number\" &&\n    Number.isFinite(value.startedAt) &&\n    typeof value.updatedAt === \"number\" &&\n    Number.isFinite(value.updatedAt) &&\n    typeof value.userDataDir === \"string\" &&\n    value.userDataDir.length > 0\n  );\n}\n","import { execFile } from \"node:child_process\";\nimport { readFile } from \"node:fs/promises\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\nconst PROCESS_STARTED_AT_MS = Math.floor(Date.now() - process.uptime() * 1_000);\nconst PROCESS_START_TIME_TOLERANCE_MS = 1_000;\nconst PROCESS_LIST_MAX_BUFFER_BYTES = 16 * 1024 * 1024;\nconst PS_COMMAND_ENV = { ...process.env, LC_ALL: \"C\" };\nconst LINUX_STAT_START_TIME_FIELD_INDEX = 19;\n\nexport interface ProcessOwner {\n  readonly pid: number;\n  readonly processStartedAtMs: number;\n}\n\nexport type ProcessLiveness = \"live\" | \"dead\" | \"unknown\";\n\nexport const CURRENT_PROCESS_OWNER: ProcessOwner = {\n  pid: process.pid,\n  processStartedAtMs: PROCESS_STARTED_AT_MS,\n};\n\nlet linuxClockTicksPerSecondPromise: Promise<number | null> | null = null;\n\nexport function parseProcessOwner(value: unknown): ProcessOwner | null {\n  if (!value || typeof value !== \"object\") {\n    return null;\n  }\n\n  const parsed = value as Partial<ProcessOwner>;\n  const pid = Number(parsed.pid);\n  const processStartedAtMs = Number(parsed.processStartedAtMs);\n  if (!Number.isInteger(pid) || pid <= 0) {\n    return null;\n  }\n  if (!Number.isInteger(processStartedAtMs) || processStartedAtMs <= 0) {\n    return null;\n  }\n\n  return {\n    pid,\n    processStartedAtMs,\n  };\n}\n\nexport function processOwnersEqual(left: ProcessOwner | null, right: ProcessOwner | null): boolean {\n  if (!left || !right) {\n    return left === right;\n  }\n\n  return left.pid === right.pid && left.processStartedAtMs === right.processStartedAtMs;\n}\n\nexport async function getProcessLiveness(owner: ProcessOwner): Promise<ProcessLiveness> {\n  if (\n    owner.pid === process.pid &&\n    hasMatchingProcessStartTime(owner.processStartedAtMs, PROCESS_STARTED_AT_MS)\n  ) {\n    return \"live\";\n  }\n\n  const startedAtMs = await readProcessStartedAtMs(owner.pid);\n  if (typeof startedAtMs === \"number\") {\n    return hasMatchingProcessStartTime(owner.processStartedAtMs, startedAtMs) ? \"live\" : \"dead\";\n  }\n\n  return isProcessRunning(owner.pid) ? \"unknown\" : \"dead\";\n}\n\nexport function isProcessRunning(pid: number): boolean {\n  try {\n    process.kill(pid, 0);\n    return true;\n  } catch (error) {\n    const code =\n      typeof error === \"object\" &&\n      error !== null &&\n      \"code\" in error &&\n      typeof error.code === \"string\"\n        ? error.code\n        : undefined;\n    return code !== \"ESRCH\";\n  }\n}\n\nexport async function readProcessOwner(pid: number): Promise<ProcessOwner | null> {\n  const processStartedAtMs = await readProcessStartedAtMs(pid);\n  if (processStartedAtMs === null) {\n    return null;\n  }\n\n  return {\n    pid,\n    processStartedAtMs,\n  };\n}\n\nfunction hasMatchingProcessStartTime(\n  expectedStartedAtMs: number,\n  actualStartedAtMs: number,\n): boolean {\n  return Math.abs(expectedStartedAtMs - actualStartedAtMs) <= PROCESS_START_TIME_TOLERANCE_MS;\n}\n\nasync function readProcessStartedAtMs(pid: number): Promise<number | null> {\n  if (pid <= 0) {\n    return null;\n  }\n\n  if (process.platform === \"linux\") {\n    return readLinuxProcessStartedAtMs(pid);\n  }\n\n  if (process.platform === \"win32\") {\n    return readWindowsProcessStartedAtMs(pid);\n  }\n\n  return readPsProcessStartedAtMs(pid);\n}\n\nasync function readLinuxProcessStartedAtMs(pid: number): Promise<number | null> {\n  let statRaw: string;\n  try {\n    statRaw = await readFile(`/proc/${String(pid)}/stat`, \"utf8\");\n  } catch {\n    return null;\n  }\n\n  const startTicks = parseLinuxProcessStartTicks(statRaw);\n  if (startTicks === null) {\n    return null;\n  }\n\n  const [bootTimeMs, clockTicksPerSecond] = await Promise.all([\n    readLinuxBootTimeMs(),\n    readLinuxClockTicksPerSecond(),\n  ]);\n  if (bootTimeMs === null || clockTicksPerSecond === null) {\n    return null;\n  }\n\n  return Math.floor(bootTimeMs + (startTicks * 1_000) / clockTicksPerSecond);\n}\n\nfunction parseLinuxProcessStartTicks(statRaw: string): number | null {\n  const closingParenIndex = statRaw.lastIndexOf(\")\");\n  if (closingParenIndex === -1) {\n    return null;\n  }\n\n  const fields = statRaw\n    .slice(closingParenIndex + 2)\n    .trim()\n    .split(/\\s+/);\n  const startTicks = Number(fields[LINUX_STAT_START_TIME_FIELD_INDEX]);\n  return Number.isFinite(startTicks) && startTicks >= 0 ? startTicks : null;\n}\n\nasync function readLinuxBootTimeMs(): Promise<number | null> {\n  try {\n    const statRaw = await readFile(\"/proc/stat\", \"utf8\");\n    const bootTimeLine = statRaw.split(\"\\n\").find((line) => line.startsWith(\"btime \"));\n    if (!bootTimeLine) {\n      return null;\n    }\n\n    const bootTimeSeconds = Number.parseInt(bootTimeLine.slice(\"btime \".length), 10);\n    return Number.isFinite(bootTimeSeconds) ? bootTimeSeconds * 1_000 : null;\n  } catch {\n    return null;\n  }\n}\n\nasync function readLinuxClockTicksPerSecond(): Promise<number | null> {\n  if (!linuxClockTicksPerSecondPromise) {\n    linuxClockTicksPerSecondPromise = execFileAsync(\"getconf\", [\"CLK_TCK\"], {\n      encoding: \"utf8\",\n      maxBuffer: PROCESS_LIST_MAX_BUFFER_BYTES,\n    })\n      .then(({ stdout }) => {\n        const value = Number.parseInt(stdout.trim(), 10);\n        return Number.isFinite(value) && value > 0 ? value : null;\n      })\n      .catch(() => null);\n  }\n\n  return linuxClockTicksPerSecondPromise;\n}\n\nasync function readWindowsProcessStartedAtMs(pid: number): Promise<number | null> {\n  try {\n    const { stdout } = await execFileAsync(\n      \"powershell.exe\",\n      [\n        \"-NoProfile\",\n        \"-Command\",\n        `(Get-Process -Id ${String(pid)}).StartTime.ToUniversalTime().ToString(\"o\")`,\n      ],\n      {\n        encoding: \"utf8\",\n        maxBuffer: PROCESS_LIST_MAX_BUFFER_BYTES,\n      },\n    );\n    const isoTimestamp = stdout.trim();\n    if (!isoTimestamp) {\n      return null;\n    }\n    const startedAtMs = Date.parse(isoTimestamp);\n    return Number.isFinite(startedAtMs) ? startedAtMs : null;\n  } catch {\n    return null;\n  }\n}\n\nasync function readPsProcessStartedAtMs(pid: number): Promise<number | null> {\n  try {\n    const { stdout } = await execFileAsync(\"ps\", [\"-o\", \"lstart=\", \"-p\", String(pid)], {\n      encoding: \"utf8\",\n      env: PS_COMMAND_ENV,\n      maxBuffer: PROCESS_LIST_MAX_BUFFER_BYTES,\n    });\n    const startedAt = stdout.trim();\n    if (!startedAt) {\n      return null;\n    }\n\n    const startedAtMs = Date.parse(startedAt.replace(/\\s+/g, \" \"));\n    return Number.isFinite(startedAtMs) ? startedAtMs : null;\n  } catch {\n    return null;\n  }\n}\n","import { homedir } from \"node:os\";\nimport path from \"node:path\";\n\nexport function resolveOpensteerStateDir(): string {\n  const explicit = process.env.OPENSTEER_HOME?.trim();\n  if (explicit) {\n    return path.resolve(explicit);\n  }\n\n  if (process.platform === \"win32\") {\n    return path.join(\n      process.env.LOCALAPPDATA ?? path.join(homedir(), \"AppData\", \"Local\"),\n      \"Opensteer\",\n    );\n  }\n\n  if (process.platform === \"darwin\") {\n    return path.join(homedir(), \"Library\", \"Application Support\", \"Opensteer\");\n  }\n\n  return path.join(\n    process.env.XDG_STATE_HOME ?? path.join(homedir(), \".local\", \"state\"),\n    \"opensteer\",\n  );\n}\n\nexport function resolveLocalViewRootDir(): string {\n  return path.join(resolveOpensteerStateDir(), \"local-view\");\n}\n\nexport function resolveLocalViewPreferencesPath(): string {\n  return path.join(resolveLocalViewRootDir(), \"preferences.json\");\n}\n\nexport function resolveLocalViewServiceDir(): string {\n  return path.join(resolveLocalViewRootDir(), \"service\");\n}\n\nexport function resolveLocalViewSessionsDir(): string {\n  return path.join(resolveLocalViewRootDir(), \"sessions\");\n}\n\nexport function resolveLocalViewServiceLockDir(): string {\n  return path.join(resolveLocalViewServiceDir(), \"startup.lock\");\n}\n\nexport function resolveLocalViewServiceStatePath(): string {\n  return path.join(resolveLocalViewServiceDir(), \"state.json\");\n}\n","import { createHash } from \"node:crypto\";\nimport { rm } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { OpensteerSessionOwnership } from \"@opensteer/protocol\";\n\nimport {\n  ensureDirectory,\n  listJsonFiles,\n  pathExists,\n  readJsonFile,\n  writeJsonFileAtomic,\n} from \"../internal/filesystem.js\";\nimport {\n  getPersistedLocalBrowserSessionOwnership,\n  type PersistedLocalBrowserSessionRecord,\n} from \"../live-session.js\";\nimport { resolveLocalViewSessionsDir } from \"./runtime-dir.js\";\n\nexport const OPENSTEER_LOCAL_VIEW_SESSION_LAYOUT = \"opensteer-local-view-session\";\nexport const OPENSTEER_LOCAL_VIEW_SESSION_VERSION = 1;\n\nexport interface PersistedLocalViewSessionManifest {\n  readonly layout: typeof OPENSTEER_LOCAL_VIEW_SESSION_LAYOUT;\n  readonly version: typeof OPENSTEER_LOCAL_VIEW_SESSION_VERSION;\n  readonly sessionId: string;\n  readonly rootPath: string;\n  readonly workspace?: string;\n  readonly engine: PersistedLocalBrowserSessionRecord[\"engine\"];\n  readonly ownership: OpensteerSessionOwnership;\n  readonly pid: number;\n  readonly startedAt: number;\n  readonly updatedAt: number;\n}\n\nexport function buildLocalViewSessionId(input: {\n  readonly rootPath: string;\n  readonly startedAt: number;\n  readonly pid?: number;\n  readonly ownership?: OpensteerSessionOwnership;\n  readonly endpoint?: string;\n  readonly baseUrl?: string;\n  readonly remoteDebuggingUrl?: string;\n}): string {\n  const ownership = input.ownership ?? \"owned\";\n  const identity =\n    ownership === \"attached\"\n      ? (input.endpoint ?? input.remoteDebuggingUrl ?? input.baseUrl ?? \"attached\")\n      : `pid:${String(input.pid ?? 0)}`;\n  const hash = createHash(\"sha256\")\n    .update(`${input.rootPath}\\n${ownership}\\n${identity}\\n${String(input.startedAt)}`)\n    .digest(\"hex\");\n  return `local_${hash.slice(0, 24)}`;\n}\n\nexport function buildLocalViewSessionIdForRecord(input: {\n  readonly rootPath: string;\n  readonly live: PersistedLocalBrowserSessionRecord;\n}): string {\n  const ownership = getPersistedLocalBrowserSessionOwnership(input.live);\n  if (ownership === \"attached\") {\n    return buildLocalViewSessionId({\n      rootPath: input.rootPath,\n      ownership,\n      startedAt: input.live.startedAt,\n      ...(input.live.endpoint === undefined ? {} : { endpoint: input.live.endpoint }),\n      ...(input.live.baseUrl === undefined ? {} : { baseUrl: input.live.baseUrl }),\n      ...(input.live.remoteDebuggingUrl === undefined\n        ? {}\n        : { remoteDebuggingUrl: input.live.remoteDebuggingUrl }),\n    });\n  }\n  return buildLocalViewSessionId({\n    rootPath: input.rootPath,\n    ownership,\n    startedAt: input.live.startedAt,\n    pid: input.live.pid,\n  });\n}\n\nexport function createLocalViewSessionManifest(input: {\n  readonly rootPath: string;\n  readonly workspace?: string;\n  readonly live: PersistedLocalBrowserSessionRecord;\n  readonly ownership: OpensteerSessionOwnership;\n}): PersistedLocalViewSessionManifest {\n  return {\n    layout: OPENSTEER_LOCAL_VIEW_SESSION_LAYOUT,\n    version: OPENSTEER_LOCAL_VIEW_SESSION_VERSION,\n    sessionId: buildLocalViewSessionIdForRecord({\n      rootPath: input.rootPath,\n      live: input.live,\n    }),\n    rootPath: input.rootPath,\n    ...(input.workspace === undefined ? {} : { workspace: input.workspace }),\n    engine: input.live.engine,\n    ownership: input.ownership,\n    pid: input.live.pid,\n    startedAt: input.live.startedAt,\n    updatedAt: Date.now(),\n  };\n}\n\nexport async function writeLocalViewSessionManifest(\n  manifest: PersistedLocalViewSessionManifest,\n): Promise<void> {\n  await ensureDirectory(resolveLocalViewSessionsDir());\n  await writeJsonFileAtomic(resolveLocalViewSessionManifestPath(manifest.sessionId), manifest);\n}\n\nexport async function deleteLocalViewSessionManifest(sessionId: string): Promise<void> {\n  await rm(resolveLocalViewSessionManifestPath(sessionId), { force: true }).catch(() => undefined);\n}\n\nexport async function readLocalViewSessionManifest(\n  sessionId: string,\n): Promise<PersistedLocalViewSessionManifest | undefined> {\n  const manifestPath = resolveLocalViewSessionManifestPath(sessionId);\n  if (!(await pathExists(manifestPath))) {\n    return undefined;\n  }\n\n  const parsed = await readJsonFile<Partial<PersistedLocalViewSessionManifest>>(manifestPath);\n  return isPersistedLocalViewSessionManifest(parsed) ? parsed : undefined;\n}\n\nexport async function listLocalViewSessionManifests(): Promise<\n  readonly PersistedLocalViewSessionManifest[]\n> {\n  const directoryPath = resolveLocalViewSessionsDir();\n  const fileNames = await listJsonFiles(directoryPath);\n  const manifests = await Promise.all(\n    fileNames.map(async (fileName) => {\n      const parsed = await readJsonFile<Partial<PersistedLocalViewSessionManifest>>(\n        path.join(directoryPath, fileName),\n      ).catch(() => undefined);\n      return isPersistedLocalViewSessionManifest(parsed) ? parsed : undefined;\n    }),\n  );\n  return manifests\n    .filter((manifest): manifest is PersistedLocalViewSessionManifest => manifest !== undefined)\n    .sort(\n      (left, right) =>\n        left.startedAt - right.startedAt || left.sessionId.localeCompare(right.sessionId),\n    );\n}\n\nexport function resolveLocalViewSessionManifestPath(sessionId: string): string {\n  return path.join(resolveLocalViewSessionsDir(), `${sessionId}.json`);\n}\n\nfunction isPersistedLocalViewSessionManifest(\n  value: Partial<PersistedLocalViewSessionManifest> | null | undefined,\n): value is PersistedLocalViewSessionManifest {\n  return (\n    value?.layout === OPENSTEER_LOCAL_VIEW_SESSION_LAYOUT &&\n    value.version === OPENSTEER_LOCAL_VIEW_SESSION_VERSION &&\n    typeof value.sessionId === \"string\" &&\n    value.sessionId.length > 0 &&\n    typeof value.rootPath === \"string\" &&\n    value.rootPath.length > 0 &&\n    (value.engine === \"playwright\" || value.engine === \"abp\") &&\n    (value.ownership === \"owned\" ||\n      value.ownership === \"attached\" ||\n      value.ownership === \"managed\") &&\n    typeof value.pid === \"number\" &&\n    Number.isFinite(value.pid) &&\n    typeof value.startedAt === \"number\" &&\n    Number.isFinite(value.startedAt) &&\n    typeof value.updatedAt === \"number\" &&\n    Number.isFinite(value.updatedAt)\n  );\n}\n","import { rm } from \"node:fs/promises\";\n\nimport { pathExists, readJsonFile, writeJsonFileAtomic } from \"../internal/filesystem.js\";\nimport { getProcessLiveness, type ProcessLiveness } from \"../local-browser/process-owner.js\";\nimport { resolveLocalViewServiceStatePath } from \"./runtime-dir.js\";\n\nexport const OPENSTEER_LOCAL_VIEW_SERVICE_LAYOUT = \"opensteer-local-view-service\";\nexport const OPENSTEER_LOCAL_VIEW_SERVICE_VERSION = 3;\n\nexport interface PersistedLocalViewServiceState {\n  readonly layout: typeof OPENSTEER_LOCAL_VIEW_SERVICE_LAYOUT;\n  readonly version: typeof OPENSTEER_LOCAL_VIEW_SERVICE_VERSION;\n  readonly pid: number;\n  readonly processStartedAtMs: number;\n  readonly startedAt: number;\n  readonly port: number;\n  readonly token: string;\n  readonly url: string;\n}\n\nexport async function readLocalViewServiceState(): Promise<\n  PersistedLocalViewServiceState | undefined\n> {\n  const statePath = resolveLocalViewServiceStatePath();\n  if (!(await pathExists(statePath))) {\n    return undefined;\n  }\n\n  const parsed = await readJsonFile<Partial<PersistedLocalViewServiceState>>(statePath);\n  if (!isPersistedLocalViewServiceState(parsed)) {\n    return undefined;\n  }\n\n  return parsed;\n}\n\nexport async function writeLocalViewServiceState(\n  state: PersistedLocalViewServiceState,\n): Promise<void> {\n  await writeJsonFileAtomic(resolveLocalViewServiceStatePath(), state);\n}\n\nexport async function clearLocalViewServiceState(\n  match:\n    | {\n        readonly pid: number;\n        readonly token: string;\n      }\n    | undefined = undefined,\n): Promise<void> {\n  if (match !== undefined) {\n    const current = await readLocalViewServiceState();\n    if (current === undefined || current.pid !== match.pid || current.token !== match.token) {\n      return;\n    }\n  }\n\n  await rm(resolveLocalViewServiceStatePath(), { force: true });\n}\n\nexport async function isLocalViewServiceStateLive(\n  state: PersistedLocalViewServiceState | undefined,\n): Promise<boolean> {\n  return (await getLocalViewServiceStateLiveness(state)) !== \"dead\";\n}\n\nexport async function getLocalViewServiceStateLiveness(\n  state: PersistedLocalViewServiceState | undefined,\n): Promise<ProcessLiveness> {\n  if (state === undefined) {\n    return \"dead\";\n  }\n\n  return getProcessLiveness({\n    pid: state.pid,\n    processStartedAtMs: state.processStartedAtMs,\n  });\n}\n\nfunction isPersistedLocalViewServiceState(\n  value: Partial<PersistedLocalViewServiceState> | null | undefined,\n): value is PersistedLocalViewServiceState {\n  return (\n    value?.layout === OPENSTEER_LOCAL_VIEW_SERVICE_LAYOUT &&\n    value.version === OPENSTEER_LOCAL_VIEW_SERVICE_VERSION &&\n    typeof value.pid === \"number\" &&\n    Number.isFinite(value.pid) &&\n    typeof value.processStartedAtMs === \"number\" &&\n    Number.isFinite(value.processStartedAtMs) &&\n    typeof value.startedAt === \"number\" &&\n    Number.isFinite(value.startedAt) &&\n    typeof value.port === \"number\" &&\n    Number.isFinite(value.port) &&\n    typeof value.token === \"string\" &&\n    value.token.length > 0 &&\n    typeof value.url === \"string\" &&\n    value.url.length > 0\n  );\n}\n","import { readFile, readdir, rm, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nexport const CHROME_SINGLETON_ARTIFACTS = [\n  \"SingletonCookie\",\n  \"SingletonLock\",\n  \"SingletonSocket\",\n  \"DevToolsActivePort\",\n  \"lockfile\",\n] as const;\n\nexport type ChromeSingletonArtifact = (typeof CHROME_SINGLETON_ARTIFACTS)[number];\n\nexport async function clearChromeSingletonEntries(userDataDir: string): Promise<void> {\n  await Promise.all(\n    CHROME_SINGLETON_ARTIFACTS.map((entry) =>\n      rm(join(userDataDir, entry), {\n        recursive: true,\n        force: true,\n      }).catch(() => undefined),\n    ),\n  );\n}\n\n/**\n * Fix Chrome profile state so the browser does not show \"something is wrong\n * with the profile\" on the next launch.\n *\n * Chrome writes `exit_type: \"Crashed\"` (or leaves it empty) in the\n * per-profile `Preferences` file when it does not shut down cleanly.  On the\n * next launch it detects this and shows a recovery/error dialog.  For cloned\n * profiles the problem is even more common because the source browser was\n * still running when the copy was made.\n *\n * We reset `exit_type` to `\"Normal\"` and `exited_cleanly` to `true`.\n * Because Chrome also validates the HMAC stored in `Secure Preferences`, we\n * remove that file so Chrome regenerates it from the corrected Preferences.\n */\nexport async function sanitizeChromeProfile(userDataDir: string): Promise<void> {\n  const entries = await readdir(userDataDir).catch(() => []);\n  const profileDirs = entries.filter(\n    (entry) => entry === \"Default\" || /^Profile \\d+$/i.test(entry),\n  );\n\n  await Promise.all(profileDirs.map((dir) => sanitizeProfilePreferences(userDataDir, dir)));\n}\n\nasync function sanitizeProfilePreferences(userDataDir: string, profileDir: string): Promise<void> {\n  const prefsPath = join(userDataDir, profileDir, \"Preferences\");\n  try {\n    const raw = await readFile(prefsPath, \"utf8\");\n    const prefs = JSON.parse(raw) as Record<string, unknown>;\n    const profile = (prefs.profile ?? {}) as Record<string, unknown>;\n\n    if (profile.exit_type === \"Normal\" && profile.exited_cleanly === true) {\n      return;\n    }\n\n    profile.exit_type = \"Normal\";\n    profile.exited_cleanly = true;\n    prefs.profile = profile;\n    await writeFile(prefsPath, JSON.stringify(prefs), \"utf8\");\n\n    // Remove Secure Preferences — its HMAC no longer matches the modified\n    // Preferences file.  Chrome will silently regenerate it on startup.\n    await rm(join(userDataDir, profileDir, \"Secure Preferences\"), { force: true }).catch(\n      () => undefined,\n    );\n  } catch {\n    // Preferences file may be missing or malformed — skip silently.\n  }\n}\n","import { copyFile, cp, mkdir, readdir, stat } from \"node:fs/promises\";\nimport { existsSync } from \"node:fs\";\nimport { join, relative, resolve } from \"node:path\";\n\nimport { expandHome } from \"./chrome-discovery.js\";\nimport {\n  CHROME_SINGLETON_ARTIFACTS,\n  clearChromeSingletonEntries,\n  sanitizeChromeProfile,\n} from \"./chrome-singletons.js\";\n\nconst CHROME_SINGLETON_ENTRIES = new Set<string>(CHROME_SINGLETON_ARTIFACTS);\n\nconst SKIPPED_ROOT_DIRECTORIES = new Set([\n  \"Crash Reports\",\n  \"Crashpad\",\n  \"BrowserMetrics\",\n  \"GrShaderCache\",\n  \"ShaderCache\",\n  \"GraphiteDawnCache\",\n  \"component_crx_cache\",\n  \"Crowd Deny\",\n  \"hyphen-data\",\n  \"OnDeviceHeadSuggestModel\",\n  \"OptimizationGuidePredictionModels\",\n  \"Segmentation Platform\",\n  \"SmartCardDeviceNames\",\n  \"WidevineCdm\",\n  \"pnacl\",\n]);\n\nconst SESSION_ROOT_FILES = new Set([\"Local State\"]);\n\nconst SESSION_SKIPPED_PROFILE_DIRECTORIES = new Set([\n  \"Cache\",\n  \"Code Cache\",\n  \"GPUCache\",\n  \"Service Worker\",\n  \"File System\",\n  \"blob_storage\",\n  \"Network\",\n]);\n\nexport async function createBrowserProfileSnapshot(input: {\n  readonly sourceUserDataDir: string;\n  readonly targetUserDataDir: string;\n  readonly profileDirectory?: string;\n  readonly copyMode?: \"full\" | \"session\";\n}): Promise<void> {\n  const sourceUserDataDir = resolve(expandHome(input.sourceUserDataDir));\n  const targetUserDataDir = resolve(expandHome(input.targetUserDataDir));\n  const profileDirectory = input.profileDirectory?.trim();\n  const copyMode = input.copyMode ?? \"full\";\n\n  await mkdir(targetUserDataDir, { recursive: true });\n  await clearChromeSingletonEntries(targetUserDataDir);\n\n  if (profileDirectory) {\n    const sourceProfileDir = join(sourceUserDataDir, profileDirectory);\n    if (!existsSync(sourceProfileDir)) {\n      throw new Error(\n        `Chrome profile \"${profileDirectory}\" was not found in \"${sourceUserDataDir}\".`,\n      );\n    }\n\n    await cp(sourceProfileDir, join(targetUserDataDir, profileDirectory), {\n      recursive: true,\n      filter: (candidate) =>\n        shouldCopyEntry({\n          candidatePath: candidate,\n          copyMode,\n          rootPath: sourceProfileDir,\n        }),\n    });\n  }\n\n  await copyRootLevelEntries({\n    copyMode,\n    sourceUserDataDir,\n    targetUserDataDir,\n    ...(profileDirectory === undefined ? {} : { selectedProfileDirectory: profileDirectory }),\n  });\n  await clearChromeSingletonEntries(targetUserDataDir);\n  await sanitizeChromeProfile(targetUserDataDir);\n}\n\nasync function copyRootLevelEntries(input: {\n  readonly copyMode: \"full\" | \"session\";\n  readonly sourceUserDataDir: string;\n  readonly targetUserDataDir: string;\n  readonly selectedProfileDirectory?: string;\n}): Promise<void> {\n  const entries = await readdir(input.sourceUserDataDir).catch(() => []);\n\n  for (const entry of entries) {\n    if (CHROME_SINGLETON_ENTRIES.has(entry) || entry === input.selectedProfileDirectory) {\n      continue;\n    }\n\n    const sourcePath = join(input.sourceUserDataDir, entry);\n    const targetPath = join(input.targetUserDataDir, entry);\n\n    const entryStat = await stat(sourcePath).catch(() => null);\n    if (!entryStat) {\n      continue;\n    }\n\n    if (entryStat.isFile()) {\n      if (input.copyMode === \"session\" && !SESSION_ROOT_FILES.has(entry)) {\n        continue;\n      }\n      await copyFile(sourcePath, targetPath).catch(() => undefined);\n      continue;\n    }\n\n    if (!entryStat.isDirectory()) {\n      continue;\n    }\n\n    if (SKIPPED_ROOT_DIRECTORIES.has(entry)) {\n      continue;\n    }\n\n    const profileDirectory = isProfileDirectory(input.sourceUserDataDir, entry);\n    if (input.copyMode === \"session\" && !profileDirectory) {\n      continue;\n    }\n\n    await cp(sourcePath, targetPath, {\n      recursive: true,\n      filter: (candidate) =>\n        shouldCopyEntry({\n          candidatePath: candidate,\n          copyMode: input.copyMode,\n          rootPath: sourcePath,\n        }),\n    }).catch(() => undefined);\n  }\n}\n\nfunction isProfileDirectory(userDataDir: string, entry: string): boolean {\n  return existsSync(join(userDataDir, entry, \"Preferences\"));\n}\n\nfunction shouldCopyEntry(input: {\n  readonly candidatePath: string;\n  readonly copyMode: \"full\" | \"session\";\n  readonly rootPath: string;\n}): boolean {\n  const entryName =\n    input.candidatePath.split(\"/\").at(-1)?.split(\"\\\\\").at(-1) ?? input.candidatePath;\n  if (CHROME_SINGLETON_ENTRIES.has(entryName)) {\n    return false;\n  }\n\n  if (input.copyMode !== \"session\") {\n    return true;\n  }\n\n  const relativePath = relative(input.rootPath, input.candidatePath);\n  if (relativePath.length === 0) {\n    return true;\n  }\n\n  const firstSegment = relativePath.split(\"/\").at(0)?.split(\"\\\\\").at(0) ?? relativePath;\n  return !SESSION_SKIPPED_PROFILE_DIRECTORIES.has(firstSegment);\n}\n","import type { StealthProfile } from \"./stealth-profiles.js\";\n\n/**\n * Generate a per-profile init script that handles fingerprint evasion defenses\n * for every new document in the context.\n *\n * CDP remains the preferred path for the current page because it updates\n * Chromium's internal state natively. This init script mirrors the same\n * navigator/screen values onto every new document so popups and later pages\n * stay consistent before their page-scoped CDP session attaches. It also covers:\n *\n *  - Canvas fingerprint noise\n *  - WebGL vendor/renderer spoofing\n *  - AudioBuffer fingerprint noise\n *  - Font availability spoofing\n *  - CDP Runtime.enable leak defense\n */\nexport function generateStealthInitScript(profile: StealthProfile): string {\n  const encodedProfile = JSON.stringify({\n    ...profile,\n    platformString: getPlatformString(profile.platform),\n    userAgentData: buildUserAgentData(profile),\n  });\n  return `(() => {\n  const profile = ${encodedProfile};\n  var define = function(target, key, value) {\n    Object.defineProperty(target, key, {\n      configurable: true,\n      get: typeof value === 'function' ? value : function() { return value; },\n    });\n  };\n\n  // --- navigator / screen mirrors for future pages ---\n  if (navigator.webdriver === true) {\n    Object.defineProperty(Navigator.prototype, 'webdriver', {\n      configurable: true,\n      get: function() { return false; },\n    });\n  }\n  define(Navigator.prototype, 'platform', profile.platformString);\n  define(Navigator.prototype, 'userAgent', profile.userAgent);\n  define(Navigator.prototype, 'language', profile.locale);\n  define(Navigator.prototype, 'languages', [profile.locale, 'en']);\n  define(Navigator.prototype, 'maxTouchPoints', profile.maxTouchPoints);\n  define(window, 'devicePixelRatio', profile.devicePixelRatio);\n  define(window.screen, 'width', profile.screenResolution.width);\n  define(window.screen, 'height', profile.screenResolution.height);\n  define(window.screen, 'availWidth', profile.screenResolution.width);\n  define(window.screen, 'availHeight', profile.screenResolution.height - 40);\n  define(window.screen, 'colorDepth', 24);\n  define(window.screen, 'pixelDepth', 24);\n  define(Navigator.prototype, 'userAgentData', {\n    brands: profile.userAgentData.brands,\n    mobile: false,\n    platform: profile.userAgentData.platform,\n    toJSON: function() {\n      return {\n        brands: this.brands,\n        mobile: this.mobile,\n        platform: this.platform,\n      };\n    },\n    getHighEntropyValues: async function(hints) {\n      var source = {\n        architecture: profile.userAgentData.architecture,\n        bitness: profile.userAgentData.bitness,\n        brands: profile.userAgentData.brands,\n        fullVersionList: profile.userAgentData.fullVersionList,\n        mobile: false,\n        model: '',\n        platform: profile.userAgentData.platform,\n        platformVersion: profile.userAgentData.platformVersion,\n        uaFullVersion: profile.browserVersion,\n        wow64: false,\n      };\n      var values = {};\n      for (var i = 0; i < hints.length; i++) {\n        var hint = hints[i];\n        if (Object.prototype.hasOwnProperty.call(source, hint)) {\n          values[hint] = source[hint];\n        }\n      }\n      return values;\n    },\n  });\n\n  if (typeof Intl !== 'undefined' && Intl.DateTimeFormat) {\n    var originalResolvedOptions = Intl.DateTimeFormat.prototype.resolvedOptions;\n    Intl.DateTimeFormat.prototype.resolvedOptions = function() {\n      var options = originalResolvedOptions.call(this);\n      options.timeZone = profile.timezoneId;\n      return options;\n    };\n  }\n\n  if (Date.prototype.getTimezoneOffset) {\n    var originalGetTimezoneOffset = Date.prototype.getTimezoneOffset;\n    var calculateTimezoneOffset = function(date) {\n      try {\n        var formatter = new Intl.DateTimeFormat('en-US', {\n          timeZone: profile.timezoneId,\n          hour12: false,\n          year: 'numeric',\n          month: '2-digit',\n          day: '2-digit',\n          hour: '2-digit',\n          minute: '2-digit',\n          second: '2-digit',\n        });\n        var parts = formatter.formatToParts(date);\n        var values = {};\n        for (var i = 0; i < parts.length; i++) {\n          if (parts[i].type !== 'literal') {\n            values[parts[i].type] = Number(parts[i].value);\n          }\n        }\n        var utcTime = Date.UTC(\n          values.year,\n          values.month - 1,\n          values.day,\n          values.hour,\n          values.minute,\n          values.second,\n        );\n        return Math.round((date.getTime() - utcTime) / 60000);\n      } catch {\n        return originalGetTimezoneOffset.call(date);\n      }\n    };\n    Date.prototype.getTimezoneOffset = function() {\n      return calculateTimezoneOffset(this);\n    };\n  }\n\n  // --- CDP Runtime.enable leak defense ---\n  var _wrap = function(name) {\n    var orig = console[name];\n    if (typeof orig !== 'function') return;\n    console[name] = new Proxy(orig, {\n      apply: function(target, thisArg, args) {\n        for (var i = 0; i < args.length; i++) {\n          if (args[i] instanceof Error) {\n            var d = Object.getOwnPropertyDescriptor(args[i], 'stack');\n            if (d && typeof d.get === 'function') return undefined;\n          }\n        }\n        return Reflect.apply(target, thisArg, args);\n      },\n    });\n  };\n  ['debug', 'log', 'info', 'error', 'warn', 'trace', 'dir'].forEach(_wrap);\n\n  // --- Canvas fingerprint noise ---\n  var seedNoise = function(seed, input) {\n    var value = Math.sin(seed + input * 12.9898) * 43758.5453;\n    return value - Math.floor(value);\n  };\n  if (HTMLCanvasElement.prototype.toDataURL) {\n    var originalToDataURL = HTMLCanvasElement.prototype.toDataURL;\n    HTMLCanvasElement.prototype.toDataURL = function() {\n      var context = this.getContext('2d');\n      if (context) {\n        var x = Math.min(1, Math.max(0, this.width - 1));\n        var y = Math.min(1, Math.max(0, this.height - 1));\n        var imageData = context.getImageData(x, y, 1, 1);\n        imageData.data[0] = Math.max(0, Math.min(255, imageData.data[0] + Math.floor(seedNoise(profile.canvasNoiseSeed, 1) * 2)));\n        context.putImageData(imageData, x, y);\n      }\n      return originalToDataURL.apply(this, arguments);\n    };\n  }\n\n  // --- WebGL vendor/renderer spoofing ---\n  if (typeof WebGLRenderingContext !== 'undefined') {\n    var originalGetParameter = WebGLRenderingContext.prototype.getParameter;\n    WebGLRenderingContext.prototype.getParameter = function(parameter) {\n      if (parameter === 37445) return profile.webglVendor;\n      if (parameter === 37446) return profile.webglRenderer;\n      return originalGetParameter.call(this, parameter);\n    };\n  }\n\n  // --- AudioBuffer fingerprint noise ---\n  if (typeof AudioBuffer !== 'undefined' && typeof AnalyserNode !== 'undefined') {\n    var originalGetFloatFrequencyData = AnalyserNode.prototype.getFloatFrequencyData;\n    AnalyserNode.prototype.getFloatFrequencyData = function(array) {\n      originalGetFloatFrequencyData.call(this, array);\n      for (var index = 0; index < array.length; index += 16) {\n        array[index] += (seedNoise(profile.audioNoiseSeed, index) - 0.5) * 0.0001;\n      }\n    };\n  }\n\n  // --- Font availability spoofing ---\n  if (document.fonts && typeof document.fonts.check === 'function') {\n    var originalCheck = document.fonts.check.bind(document.fonts);\n    document.fonts.check = function(font, text) {\n      var family = String(font).match(/[\"']([^\"']+)[\"']/)?.[1] || String(font).split(/\\\\s+/).at(-1);\n      if (family && profile.fonts.includes(family)) {\n        return true;\n      }\n      return originalCheck(font, text);\n    };\n  }\n})();`;\n}\n\nfunction buildUserAgentData(profile: StealthProfile) {\n  const majorVersion = profile.browserVersion.split(\".\")[0] ?? \"136\";\n  const platformData = {\n    macos: { platform: \"macOS\", platformVersion: \"14.4.0\", architecture: \"arm\" },\n    windows: { platform: \"Windows\", platformVersion: \"15.0.0\", architecture: \"x86\" },\n    linux: { platform: \"Linux\", platformVersion: \"6.5.0\", architecture: \"x86\" },\n  } as const;\n  const platformInfo = platformData[profile.platform];\n\n  return {\n    architecture: platformInfo.architecture,\n    bitness: \"64\",\n    brands: [\n      { brand: \"Chromium\", version: majorVersion },\n      ...(profile.browserBrand === \"edge\"\n        ? [{ brand: \"Microsoft Edge\", version: majorVersion }]\n        : [{ brand: \"Google Chrome\", version: majorVersion }]),\n      { brand: \"Not-A.Brand\", version: \"99\" },\n    ],\n    fullVersionList: [\n      { brand: \"Chromium\", version: profile.browserVersion },\n      ...(profile.browserBrand === \"edge\"\n        ? [{ brand: \"Microsoft Edge\", version: profile.browserVersion }]\n        : [{ brand: \"Google Chrome\", version: profile.browserVersion }]),\n      { brand: \"Not-A.Brand\", version: \"99.0.0.0\" },\n    ],\n    platform: platformInfo.platform,\n    platformVersion: platformInfo.platformVersion,\n  };\n}\n\nfunction getPlatformString(platform: StealthProfile[\"platform\"]): string {\n  return platform === \"macos\" ? \"MacIntel\" : platform === \"windows\" ? \"Win32\" : \"Linux x86_64\";\n}\n","import { generateStealthInitScript } from \"./stealth-init-script.js\";\nimport type { StealthProfile } from \"./stealth-profiles.js\";\nimport type { ConnectedCdpBrowserContext, ConnectedCdpPage } from \"./types.js\";\n\n/**\n * JavaScript source injected before any page scripts via\n * Page.addScriptToEvaluateOnNewDocument to mask automation signals\n * that bot-detection systems (Cloudflare Turnstile, DataDome, etc.) check.\n *\n * Runs in the main world of every new document before page-originating scripts.\n *\n * This script only handles defenses that cannot be achieved via CDP protocol\n * commands: the CDP Runtime.enable leak detection neutralization.\n * Navigator / screen / viewport overrides are handled at the CDP protocol\n * level by {@link applyCdpStealthOverrides}, which is undetectable by page JS.\n */\nconst STEALTH_INIT_SCRIPT = `(() => {\n  // Override navigator.webdriver only if Chrome reports automation.\n  // --disable-blink-features=AutomationControlled should prevent this, but some\n  // Chrome builds still set webdriver=true when --remote-debugging-port is active.\n  if (navigator.webdriver === true) {\n    Object.defineProperty(Navigator.prototype, 'webdriver', {\n      get: function() { return false; },\n      configurable: true,\n    });\n  }\n\n  // Neutralize CDP Runtime.enable leak detection.\n  //\n  // Playwright enables the CDP Runtime domain for page.evaluate(). Bot detectors\n  // exploit this: they create an Error with a user-defined getter on its 'stack'\n  // property, then pass that Error to a console method. When Runtime.enable is\n  // active, Chrome serializes the Error for the Runtime.consoleAPICalled event,\n  // which triggers the getter — proving CDP is present.\n  //\n  // Defense: wrap console methods in a Proxy that detects this specific pattern\n  // (an Error whose 'stack' is an accessor, not a data property) and suppresses\n  // the call. Normal Errors have a plain data-property 'stack', so legitimate\n  // console usage is unaffected.\n  var _wrap = function(name) {\n    var orig = console[name];\n    if (typeof orig !== 'function') return;\n    console[name] = new Proxy(orig, {\n      apply: function(target, thisArg, args) {\n        for (var i = 0; i < args.length; i++) {\n          if (args[i] instanceof Error) {\n            var d = Object.getOwnPropertyDescriptor(args[i], 'stack');\n            if (d && typeof d.get === 'function') return undefined;\n          }\n        }\n        return Reflect.apply(target, thisArg, args);\n      },\n    });\n  };\n  ['debug', 'log', 'info', 'error', 'warn', 'trace', 'dir'].forEach(_wrap);\n})();`;\n\n/**\n * Inject stealth init scripts into a browser context so that every page\n * opened in that context masks common automation-detection signals.\n *\n * When a {@link StealthProfile} is provided, this function installs context-wide\n * request headers for future navigations and popups, applies CDP protocol-level\n * overrides to all current pages in the context, and registers the same CDP\n * overrides for pages opened later in that context. The init script also mirrors\n * the spoofed navigator/screen values onto every new document so popup pages stay\n * consistent before their per-page CDP session attaches.\n *\n * When the context does not support init scripts (e.g. the ABP engine),\n * this is a silent no-op for the init-script portion.\n */\nexport async function injectBrowserStealthScripts(\n  context: ConnectedCdpBrowserContext,\n  input: {\n    readonly profile?: StealthProfile;\n    readonly page?: ConnectedCdpPage;\n  } = {},\n): Promise<void> {\n  if (input.profile !== undefined) {\n    await installContextNetworkHeaders(context, input.profile);\n    await installCdpStealthOverrides(context, input.profile, input.page);\n  }\n\n  if (typeof context.addInitScript === \"function\") {\n    await context.addInitScript({\n      content:\n        input.profile === undefined\n          ? STEALTH_INIT_SCRIPT\n          : generateStealthInitScript(input.profile),\n    });\n  }\n}\n\n/**\n * Build the User-Agent Client Hints metadata object from a stealth profile.\n *\n * Modern bot detectors compare `navigator.userAgentData.getHighEntropyValues()`\n * against the User-Agent header to detect automation.  Setting these values at\n * the CDP level ensures both the JS API and HTTP headers are internally\n * consistent — something JS injection alone cannot achieve.\n */\nfunction buildUserAgentMetadata(profile: StealthProfile): Record<string, unknown> {\n  const majorVersion = profile.browserVersion.split(\".\")[0] ?? \"136\";\n\n  const brands = [\n    { brand: \"Chromium\", version: majorVersion },\n    ...(profile.browserBrand === \"edge\"\n      ? [{ brand: \"Microsoft Edge\", version: majorVersion }]\n      : [{ brand: \"Google Chrome\", version: majorVersion }]),\n    { brand: \"Not-A.Brand\", version: \"99\" },\n  ];\n\n  const fullVersionList = [\n    { brand: \"Chromium\", version: profile.browserVersion },\n    ...(profile.browserBrand === \"edge\"\n      ? [{ brand: \"Microsoft Edge\", version: profile.browserVersion }]\n      : [{ brand: \"Google Chrome\", version: profile.browserVersion }]),\n    { brand: \"Not-A.Brand\", version: \"99.0.0.0\" },\n  ];\n\n  const platformMap: Record<\n    StealthProfile[\"platform\"],\n    { platform: string; platformVersion: string; architecture: string }\n  > = {\n    // Chromium keeps the reduced macOS UA token frozen to Intel even on Apple Silicon.\n    macos: { platform: \"macOS\", platformVersion: \"14.4.0\", architecture: \"arm\" },\n    windows: { platform: \"Windows\", platformVersion: \"15.0.0\", architecture: \"x86\" },\n    linux: { platform: \"Linux\", platformVersion: \"6.5.0\", architecture: \"x86\" },\n  };\n\n  const platformInfo = platformMap[profile.platform];\n\n  return {\n    brands,\n    fullVersionList,\n    platform: platformInfo.platform,\n    platformVersion: platformInfo.platformVersion,\n    architecture: platformInfo.architecture,\n    model: \"\",\n    mobile: false,\n    bitness: \"64\",\n    wow64: false,\n  };\n}\n\n/**\n * Apply stealth overrides at the Chrome DevTools Protocol level.\n *\n * Unlike JavaScript init-script injection, CDP commands modify Chrome's\n * internal state directly.  This means:\n *\n *  - `navigator.userAgent` returns the spoofed value as a native string, not\n *    via a getter override that bot detectors can fingerprint.\n *  - `navigator.userAgentData.getHighEntropyValues()` returns correct Client\n *    Hints metadata — impossible to achieve via JS injection alone.\n *  - `screen.width`, `screen.height`, `devicePixelRatio`, and viewport\n *    dimensions are set at the rendering-engine level.\n *  - `navigator.language` / `navigator.languages` reflect the spoofed locale.\n *\n * This function is best-effort: if the context does not expose a CDP session\n * factory (e.g. non-Playwright engines), it silently returns without error.\n */\nasync function installCdpStealthOverrides(\n  context: ConnectedCdpBrowserContext,\n  profile: StealthProfile,\n  initialPage?: ConnectedCdpPage,\n): Promise<void> {\n  const pages =\n    initialPage === undefined\n      ? context.pages()\n      : Array.from(new Set([initialPage, ...context.pages()]));\n\n  await Promise.all(pages.map((page) => applyPageOverrides(context, page, profile)));\n\n  const appliedPages = new WeakSet<ConnectedCdpPage>();\n  const applyFuturePageOverrides = async (page: ConnectedCdpPage): Promise<void> => {\n    if (appliedPages.has(page)) {\n      return;\n    }\n    appliedPages.add(page);\n    await applyPageOverrides(context, page, profile);\n  };\n\n  if (typeof context.on === \"function\") {\n    context.on(\"page\", applyFuturePageOverrides);\n  }\n}\n\nasync function installContextNetworkHeaders(\n  context: ConnectedCdpBrowserContext,\n  profile: StealthProfile,\n): Promise<void> {\n  if (typeof context.setExtraHTTPHeaders !== \"function\") {\n    return;\n  }\n\n  await context.setExtraHTTPHeaders(buildStealthRequestHeaders(profile)).catch(() => undefined);\n}\n\nasync function applyPageOverrides(\n  context: ConnectedCdpBrowserContext,\n  page: ConnectedCdpPage,\n  profile: StealthProfile,\n): Promise<void> {\n  // Access the Playwright-specific newCDPSession method via runtime check.\n  // The ConnectedCdpBrowserContext interface is engine-neutral and does not\n  // expose it, but the actual Playwright BrowserContext object does.\n  const contextWithCdp = context as { newCDPSession?: (page: unknown) => Promise<CdpSessionLike> };\n  if (typeof contextWithCdp.newCDPSession !== \"function\") {\n    return;\n  }\n\n  let cdp: CdpSessionLike;\n  try {\n    cdp = await contextWithCdp.newCDPSession(page);\n  } catch {\n    return;\n  }\n\n  try {\n    await applyCdpStealthCommands((method, params) => cdp.send(method, params), profile);\n  } catch {\n    // CDP-level overrides are best-effort. Unsupported commands are ignored so\n    // stealth setup does not fail when a Chromium build lacks one of them.\n  } finally {\n    await cdp.detach().catch(() => undefined);\n  }\n}\n\nasync function applyCdpStealthCommands(\n  send: (method: string, params?: Record<string, unknown>) => Promise<unknown>,\n  profile: StealthProfile,\n): Promise<void> {\n  await send(\"Network.setUserAgentOverride\", {\n    userAgent: profile.userAgent,\n    acceptLanguage: `${profile.locale},en;q=0.9`,\n    platform: getPlatformString(profile.platform),\n    userAgentMetadata: buildUserAgentMetadata(profile),\n  });\n\n  await send(\"Emulation.setDeviceMetricsOverride\", {\n    width: profile.viewport.width,\n    height: profile.viewport.height,\n    deviceScaleFactor: profile.devicePixelRatio,\n    mobile: false,\n    screenWidth: profile.screenResolution.width,\n    screenHeight: profile.screenResolution.height,\n  });\n\n  await send(\"Emulation.setLocaleOverride\", {\n    locale: profile.locale,\n  }).catch(() => undefined);\n\n  await send(\"Emulation.setTimezoneOverride\", {\n    timezoneId: profile.timezoneId,\n  }).catch(() => undefined);\n}\n\nfunction buildStealthRequestHeaders(profile: StealthProfile): Record<string, string> {\n  const metadata = buildUserAgentMetadata(profile) as {\n    readonly brands: ReadonlyArray<{ readonly brand: string; readonly version: string }>;\n    readonly platform: string;\n  };\n\n  return {\n    \"Accept-Language\": `${profile.locale},en;q=0.9`,\n    \"Sec-CH-UA\": metadata.brands.map(formatClientHintBrand).join(\", \"),\n    \"Sec-CH-UA-Mobile\": \"?0\",\n    \"Sec-CH-UA-Platform\": `\"${metadata.platform}\"`,\n    \"User-Agent\": profile.userAgent,\n  };\n}\n\nfunction formatClientHintBrand(brand: {\n  readonly brand: string;\n  readonly version: string;\n}): string {\n  return `\"${brand.brand}\";v=\"${brand.version}\"`;\n}\n\nfunction getPlatformString(platform: StealthProfile[\"platform\"]): string {\n  return platform === \"macos\" ? \"MacIntel\" : platform === \"windows\" ? \"Win32\" : \"Linux x86_64\";\n}\n\ninterface CdpSessionLike {\n  readonly send: (method: string, params?: Record<string, unknown>) => Promise<unknown>;\n  readonly detach: () => Promise<unknown>;\n}\n","export interface StealthProfile {\n  readonly id: string;\n  readonly platform: \"macos\" | \"windows\" | \"linux\";\n  readonly browserBrand: \"chrome\" | \"edge\";\n  readonly browserVersion: string;\n  readonly userAgent: string;\n  readonly viewport: { readonly width: number; readonly height: number };\n  readonly screenResolution: { readonly width: number; readonly height: number };\n  readonly devicePixelRatio: number;\n  readonly maxTouchPoints: number;\n  readonly webglVendor: string;\n  readonly webglRenderer: string;\n  readonly fonts: readonly string[];\n  readonly canvasNoiseSeed: number;\n  readonly audioNoiseSeed: number;\n  readonly locale: string;\n  readonly timezoneId: string;\n}\n\nexport type StealthProfileOverrides = Partial<StealthProfile>;\n\nconst PROFILE_PRESETS = [\n  {\n    platform: \"macos\" as const,\n    browserBrand: \"chrome\" as const,\n    browserVersion: \"136.0.7103.93\",\n    userAgent:\n      \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36\",\n    viewport: { width: 1440, height: 900 },\n    screenResolution: { width: 1512, height: 982 },\n    devicePixelRatio: 2,\n    maxTouchPoints: 0,\n    webglVendor: \"Apple\",\n    webglRenderer: \"Apple M2\",\n    fonts: [\"SF Pro Text\", \"Helvetica Neue\", \"Arial\", \"Menlo\", \"Apple Color Emoji\"],\n    locale: \"en-US\",\n    timezoneId: \"America/Los_Angeles\",\n  },\n  {\n    platform: \"windows\" as const,\n    browserBrand: \"chrome\" as const,\n    browserVersion: \"136.0.7103.93\",\n    userAgent:\n      \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36\",\n    viewport: { width: 1536, height: 864 },\n    screenResolution: { width: 1920, height: 1080 },\n    devicePixelRatio: 1.25,\n    maxTouchPoints: 0,\n    webglVendor: \"Google Inc. (Intel)\",\n    webglRenderer: \"ANGLE (Intel, Intel(R) Iris(R) Xe Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)\",\n    fonts: [\"Segoe UI\", \"Arial\", \"Calibri\", \"Consolas\", \"Segoe UI Emoji\"],\n    locale: \"en-US\",\n    timezoneId: \"America/New_York\",\n  },\n  {\n    platform: \"windows\" as const,\n    browserBrand: \"edge\" as const,\n    browserVersion: \"136.0.3240.50\",\n    userAgent:\n      \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.3240.50\",\n    viewport: { width: 1536, height: 864 },\n    screenResolution: { width: 1920, height: 1080 },\n    devicePixelRatio: 1.25,\n    maxTouchPoints: 0,\n    webglVendor: \"Google Inc. (Intel)\",\n    webglRenderer: \"ANGLE (Intel, Intel(R) UHD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)\",\n    fonts: [\"Segoe UI\", \"Arial\", \"Calibri\", \"Consolas\", \"Segoe UI Emoji\"],\n    locale: \"en-US\",\n    timezoneId: \"America/Chicago\",\n  },\n  {\n    platform: \"linux\" as const,\n    browserBrand: \"chrome\" as const,\n    browserVersion: \"136.0.7103.93\",\n    userAgent:\n      \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36\",\n    viewport: { width: 1366, height: 768 },\n    screenResolution: { width: 1366, height: 768 },\n    devicePixelRatio: 1,\n    maxTouchPoints: 0,\n    webglVendor: \"Google Inc. (Mesa)\",\n    webglRenderer: \"ANGLE (AMD, AMD Radeon Graphics, OpenGL 4.6)\",\n    fonts: [\"Noto Sans\", \"Ubuntu\", \"DejaVu Sans\", \"Liberation Sans\", \"Noto Color Emoji\"],\n    locale: \"en-US\",\n    timezoneId: \"UTC\",\n  },\n] as const;\n\nexport function generateStealthProfile(overrides: StealthProfileOverrides = {}): StealthProfile {\n  const preset = pickStealthProfilePreset(overrides);\n  return {\n    id:\n      overrides.id ??\n      `stealth:${preset.platform}:${preset.browserBrand}:${Math.random().toString(36).slice(2, 10)}`,\n    platform: overrides.platform ?? preset.platform,\n    browserBrand: overrides.browserBrand ?? preset.browserBrand,\n    browserVersion: overrides.browserVersion ?? preset.browserVersion,\n    userAgent: overrides.userAgent ?? preset.userAgent,\n    viewport: overrides.viewport ?? preset.viewport,\n    screenResolution: overrides.screenResolution ?? preset.screenResolution,\n    devicePixelRatio: overrides.devicePixelRatio ?? preset.devicePixelRatio,\n    maxTouchPoints: overrides.maxTouchPoints ?? preset.maxTouchPoints,\n    webglVendor: overrides.webglVendor ?? preset.webglVendor,\n    webglRenderer: overrides.webglRenderer ?? preset.webglRenderer,\n    fonts: overrides.fonts ?? preset.fonts,\n    canvasNoiseSeed: overrides.canvasNoiseSeed ?? Math.floor(Math.random() * 1_000_000),\n    audioNoiseSeed: overrides.audioNoiseSeed ?? Math.floor(Math.random() * 1_000_000),\n    locale: overrides.locale ?? preset.locale,\n    timezoneId: overrides.timezoneId ?? preset.timezoneId,\n  };\n}\n\nfunction pickStealthProfilePreset(overrides: StealthProfileOverrides) {\n  const candidates = PROFILE_PRESETS.filter(\n    (preset) =>\n      (overrides.platform === undefined || preset.platform === overrides.platform) &&\n      (overrides.browserBrand === undefined || preset.browserBrand === overrides.browserBrand),\n  );\n  const pool = candidates.length > 0 ? candidates : PROFILE_PRESETS;\n  return pool[Math.floor(Math.random() * pool.length)]!;\n}\n","import path from \"node:path\";\nimport { randomUUID } from \"node:crypto\";\n\nimport type {\n  ArtifactProvenance,\n  ArtifactReference,\n  ArtifactRelation,\n  CookieRecord,\n  DomSnapshot,\n  ExternalBinaryLocation,\n  HtmlSnapshot,\n  OpensteerArtifact,\n  OpensteerArtifactKind,\n  ScriptSourceArtifactData,\n  StorageSnapshot,\n  TraceContext,\n} from \"@opensteer/protocol\";\n\nimport {\n  encodePathSegment,\n  ensureDirectory,\n  filePathToUri,\n  isAlreadyExistsError,\n  joinStoragePath,\n  normalizeNonEmptyString,\n  normalizeTimestamp,\n  pathExists,\n  readBinaryFile,\n  readJsonFile,\n  resolveStoragePath,\n  sha256Hex,\n  writeBufferIfMissing,\n  writeJsonFileExclusive,\n} from \"./internal/filesystem.js\";\nimport { canonicalJsonString, toCanonicalJsonValue } from \"./json.js\";\n\nexport type ArtifactPayloadType = \"structured\" | \"binary\";\nexport type ProtocolArtifactDelivery = \"external\" | \"inline-if-structured\";\n\nexport interface ArtifactScope extends TraceContext {}\n\nexport interface ArtifactManifest {\n  readonly artifactId: string;\n  readonly kind: OpensteerArtifactKind;\n  readonly createdAt: number;\n  readonly provenance?: ArtifactProvenance;\n  readonly scope: ArtifactScope;\n  readonly mediaType: string;\n  readonly payloadType: ArtifactPayloadType;\n  readonly byteLength: number;\n  readonly sha256: string;\n  readonly objectRelativePath: string;\n}\n\nexport type StructuredArtifactKind = Exclude<OpensteerArtifactKind, \"screenshot\">;\n\ninterface StructuredArtifactDataByKind {\n  readonly \"html-snapshot\": HtmlSnapshot;\n  readonly \"dom-snapshot\": DomSnapshot;\n  readonly cookies: readonly CookieRecord[];\n  readonly \"storage-snapshot\": StorageSnapshot;\n  readonly \"script-source\": ScriptSourceArtifactData;\n}\n\ntype StructuredArtifactPayloadByKind = {\n  [K in StructuredArtifactKind]: {\n    readonly kind: K;\n    readonly payloadType: \"structured\";\n    readonly data: StructuredArtifactDataByKind[K];\n  };\n};\n\ntype StoredArtifactPayloadByKind = {\n  readonly screenshot: {\n    readonly kind: \"screenshot\";\n    readonly payloadType: \"binary\";\n    readonly data: Uint8Array;\n  };\n} & StructuredArtifactPayloadByKind;\n\nexport type StoredArtifactPayload = StoredArtifactPayloadByKind[OpensteerArtifactKind];\n\nexport interface StoredArtifactRecord {\n  readonly manifest: ArtifactManifest;\n  readonly payload: StoredArtifactPayload;\n}\n\ntype WriteStructuredArtifactInputByKind<K extends StructuredArtifactKind> = {\n  readonly artifactId?: string;\n  readonly kind: K;\n  readonly createdAt?: number;\n  readonly provenance?: ArtifactProvenance;\n  readonly scope?: ArtifactScope;\n  readonly mediaType?: string;\n  readonly data: StructuredArtifactDataByKind[K];\n};\n\nexport type WriteStructuredArtifactInput = {\n  [K in StructuredArtifactKind]: WriteStructuredArtifactInputByKind<K>;\n}[StructuredArtifactKind];\n\nexport interface WriteBinaryArtifactInput {\n  readonly artifactId?: string;\n  readonly kind: \"screenshot\";\n  readonly createdAt?: number;\n  readonly provenance?: ArtifactProvenance;\n  readonly scope?: ArtifactScope;\n  readonly mediaType: string;\n  readonly data: Uint8Array;\n}\n\nexport interface OpensteerArtifactStore {\n  readonly manifestsDirectory: string;\n  readonly objectsDirectory: string;\n\n  writeStructured(input: WriteStructuredArtifactInput): Promise<ArtifactManifest>;\n  writeBinary(input: WriteBinaryArtifactInput): Promise<ArtifactManifest>;\n  getManifest(artifactId: string): Promise<ArtifactManifest | undefined>;\n  read(artifactId: string): Promise<StoredArtifactRecord | undefined>;\n  toProtocolArtifactReference(\n    artifactId: string,\n    relation: ArtifactRelation,\n  ): Promise<ArtifactReference | undefined>;\n  toProtocolArtifact(\n    artifactId: string,\n    options?: {\n      readonly delivery?: ProtocolArtifactDelivery;\n    },\n  ): Promise<OpensteerArtifact | undefined>;\n}\n\nfunction normalizeScope(scope: ArtifactScope | undefined): ArtifactScope {\n  if (scope === undefined) {\n    return {};\n  }\n\n  return {\n    ...(scope.sessionRef === undefined ? {} : { sessionRef: scope.sessionRef }),\n    ...(scope.pageRef === undefined ? {} : { pageRef: scope.pageRef }),\n    ...(scope.frameRef === undefined ? {} : { frameRef: scope.frameRef }),\n    ...(scope.documentRef === undefined ? {} : { documentRef: scope.documentRef }),\n    ...(scope.documentEpoch === undefined ? {} : { documentEpoch: scope.documentEpoch }),\n  };\n}\n\nfunction normalizeProvenance(\n  provenance: ArtifactProvenance | undefined,\n): ArtifactProvenance | undefined {\n  if (provenance === undefined) {\n    return undefined;\n  }\n\n  return {\n    ...(provenance.sourceArtifactId === undefined\n      ? {}\n      : {\n          sourceArtifactId: normalizeNonEmptyString(\n            \"provenance.sourceArtifactId\",\n            provenance.sourceArtifactId,\n          ),\n        }),\n    ...(provenance.transform === undefined\n      ? {}\n      : { transform: normalizeNonEmptyString(\"provenance.transform\", provenance.transform) }),\n  };\n}\n\nasync function readStructuredPayload<TData>(objectPath: string): Promise<TData> {\n  return JSON.parse(Buffer.from(await readBinaryFile(objectPath)).toString(\"utf8\")) as TData;\n}\n\nexport class FilesystemArtifactStore implements OpensteerArtifactStore {\n  readonly manifestsDirectory: string;\n  readonly objectsDirectory: string;\n\n  constructor(private readonly rootPath: string) {\n    this.manifestsDirectory = path.join(this.rootPath, \"artifacts\", \"manifests\");\n    this.objectsDirectory = path.join(this.rootPath, \"artifacts\", \"objects\", \"sha256\");\n  }\n\n  async initialize(): Promise<void> {\n    await ensureDirectory(this.manifestsDirectory);\n    await ensureDirectory(this.objectsDirectory);\n  }\n\n  async writeStructured(input: WriteStructuredArtifactInput): Promise<ArtifactManifest> {\n    const artifactId = normalizeNonEmptyString(\n      \"artifactId\",\n      input.artifactId ?? `artifact:${randomUUID()}`,\n    );\n    const manifestPath = this.manifestPath(artifactId);\n\n    const jsonData = toCanonicalJsonValue(input.data);\n    const objectBytes = Buffer.from(canonicalJsonString(jsonData), \"utf8\");\n    const sha256 = sha256Hex(objectBytes);\n    const objectRelativePath = joinStoragePath(\"artifacts\", \"objects\", \"sha256\", sha256);\n    const objectPath = resolveStoragePath(this.rootPath, objectRelativePath);\n\n    await writeBufferIfMissing(objectPath, objectBytes);\n\n    const provenance = normalizeProvenance(input.provenance);\n    const manifest: ArtifactManifest = {\n      artifactId,\n      kind: input.kind,\n      createdAt: normalizeTimestamp(\"createdAt\", input.createdAt ?? Date.now()),\n      ...(provenance === undefined ? {} : { provenance }),\n      scope: normalizeScope(input.scope),\n      mediaType: input.mediaType ?? \"application/json\",\n      payloadType: \"structured\",\n      byteLength: objectBytes.byteLength,\n      sha256,\n      objectRelativePath,\n    };\n\n    try {\n      await writeJsonFileExclusive(manifestPath, manifest);\n    } catch (error) {\n      if (isAlreadyExistsError(error)) {\n        throw new Error(`artifact ${artifactId} already exists`);\n      }\n\n      throw error;\n    }\n\n    return manifest;\n  }\n\n  async writeBinary(input: WriteBinaryArtifactInput): Promise<ArtifactManifest> {\n    const artifactId = normalizeNonEmptyString(\n      \"artifactId\",\n      input.artifactId ?? `artifact:${randomUUID()}`,\n    );\n    const manifestPath = this.manifestPath(artifactId);\n\n    const mediaType = normalizeNonEmptyString(\"mediaType\", input.mediaType);\n    const data = new Uint8Array(input.data);\n    const sha256 = sha256Hex(data);\n    const extension = mediaTypeExtension(mediaType);\n    const objectRelativePath = joinStoragePath(\n      \"artifacts\",\n      \"objects\",\n      \"sha256\",\n      `${sha256}${extension}`,\n    );\n    const objectPath = resolveStoragePath(this.rootPath, objectRelativePath);\n\n    await writeBufferIfMissing(objectPath, data);\n\n    const provenance = normalizeProvenance(input.provenance);\n    const manifest: ArtifactManifest = {\n      artifactId,\n      kind: input.kind,\n      createdAt: normalizeTimestamp(\"createdAt\", input.createdAt ?? Date.now()),\n      ...(provenance === undefined ? {} : { provenance }),\n      scope: normalizeScope(input.scope),\n      mediaType,\n      payloadType: \"binary\",\n      byteLength: data.byteLength,\n      sha256,\n      objectRelativePath,\n    };\n\n    try {\n      await writeJsonFileExclusive(manifestPath, manifest);\n    } catch (error) {\n      if (isAlreadyExistsError(error)) {\n        throw new Error(`artifact ${artifactId} already exists`);\n      }\n\n      throw error;\n    }\n\n    return manifest;\n  }\n\n  async getManifest(artifactId: string): Promise<ArtifactManifest | undefined> {\n    const manifestPath = this.manifestPath(artifactId);\n    if (!(await pathExists(manifestPath))) {\n      return undefined;\n    }\n\n    return readJsonFile<ArtifactManifest>(manifestPath);\n  }\n\n  async read(artifactId: string): Promise<StoredArtifactRecord | undefined> {\n    const manifest = await this.getManifest(artifactId);\n    if (manifest === undefined) {\n      return undefined;\n    }\n\n    const objectPath = resolveStoragePath(this.rootPath, manifest.objectRelativePath);\n    if (manifest.kind === \"screenshot\") {\n      if (manifest.payloadType !== \"binary\") {\n        throw new Error(`artifact ${artifactId} has an invalid screenshot payload type`);\n      }\n\n      return {\n        manifest,\n        payload: {\n          kind: \"screenshot\",\n          payloadType: \"binary\",\n          data: await readBinaryFile(objectPath),\n        },\n      };\n    }\n\n    if (manifest.payloadType !== \"structured\") {\n      throw new Error(`artifact ${artifactId} has an invalid structured payload type`);\n    }\n\n    switch (manifest.kind) {\n      case \"html-snapshot\":\n        return {\n          manifest,\n          payload: {\n            kind: \"html-snapshot\",\n            payloadType: \"structured\",\n            data: await readStructuredPayload<HtmlSnapshot>(objectPath),\n          },\n        };\n      case \"dom-snapshot\":\n        return {\n          manifest,\n          payload: {\n            kind: \"dom-snapshot\",\n            payloadType: \"structured\",\n            data: await readStructuredPayload<DomSnapshot>(objectPath),\n          },\n        };\n      case \"cookies\":\n        return {\n          manifest,\n          payload: {\n            kind: \"cookies\",\n            payloadType: \"structured\",\n            data: await readStructuredPayload<readonly CookieRecord[]>(objectPath),\n          },\n        };\n      case \"storage-snapshot\":\n        return {\n          manifest,\n          payload: {\n            kind: \"storage-snapshot\",\n            payloadType: \"structured\",\n            data: await readStructuredPayload<StorageSnapshot>(objectPath),\n          },\n        };\n      case \"script-source\":\n        return {\n          manifest,\n          payload: {\n            kind: \"script-source\",\n            payloadType: \"structured\",\n            data: await readStructuredPayload<ScriptSourceArtifactData>(objectPath),\n          },\n        };\n    }\n  }\n\n  async toProtocolArtifactReference(\n    artifactId: string,\n    relation: ArtifactRelation,\n  ): Promise<ArtifactReference | undefined> {\n    const manifest = await this.getManifest(artifactId);\n    if (manifest === undefined) {\n      return undefined;\n    }\n\n    return {\n      artifactId: manifest.artifactId,\n      kind: manifest.kind,\n      relation,\n    };\n  }\n\n  async toProtocolArtifact(\n    artifactId: string,\n    options: {\n      readonly delivery?: ProtocolArtifactDelivery;\n    } = {},\n  ): Promise<OpensteerArtifact | undefined> {\n    const record = await this.read(artifactId);\n    if (record === undefined) {\n      return undefined;\n    }\n\n    const delivery = options.delivery ?? \"external\";\n    const externalPayload = manifestToExternalBinaryLocation(this.rootPath, record.manifest);\n\n    const artifactBase = {\n      artifactId: record.manifest.artifactId,\n      createdAt: record.manifest.createdAt,\n      ...(record.manifest.provenance === undefined\n        ? {}\n        : { provenance: record.manifest.provenance }),\n      ...(record.manifest.scope.sessionRef === undefined\n        ? {}\n        : { sessionRef: record.manifest.scope.sessionRef }),\n      ...(record.manifest.scope.pageRef === undefined\n        ? {}\n        : { pageRef: record.manifest.scope.pageRef }),\n      ...(record.manifest.scope.frameRef === undefined\n        ? {}\n        : { frameRef: record.manifest.scope.frameRef }),\n      ...(record.manifest.scope.documentRef === undefined\n        ? {}\n        : { documentRef: record.manifest.scope.documentRef }),\n      ...(record.manifest.scope.documentEpoch === undefined\n        ? {}\n        : { documentEpoch: record.manifest.scope.documentEpoch }),\n    };\n\n    switch (record.payload.kind) {\n      case \"screenshot\":\n        return { ...artifactBase, kind: \"screenshot\", payload: externalPayload };\n      case \"html-snapshot\":\n        return {\n          ...artifactBase,\n          kind: \"html-snapshot\",\n          payload:\n            delivery === \"inline-if-structured\"\n              ? { delivery: \"inline\", data: record.payload.data }\n              : externalPayload,\n        };\n      case \"dom-snapshot\":\n        return {\n          ...artifactBase,\n          kind: \"dom-snapshot\",\n          payload:\n            delivery === \"inline-if-structured\"\n              ? { delivery: \"inline\", data: record.payload.data }\n              : externalPayload,\n        };\n      case \"cookies\":\n        return {\n          ...artifactBase,\n          kind: \"cookies\",\n          payload:\n            delivery === \"inline-if-structured\"\n              ? { delivery: \"inline\", data: record.payload.data }\n              : externalPayload,\n        };\n      case \"storage-snapshot\":\n        return {\n          ...artifactBase,\n          kind: \"storage-snapshot\",\n          payload:\n            delivery === \"inline-if-structured\"\n              ? { delivery: \"inline\", data: record.payload.data }\n              : externalPayload,\n        };\n      case \"script-source\":\n        return {\n          ...artifactBase,\n          kind: \"script-source\",\n          payload:\n            delivery === \"inline-if-structured\"\n              ? { delivery: \"inline\", data: record.payload.data }\n              : externalPayload,\n        };\n    }\n  }\n\n  private manifestPath(artifactId: string): string {\n    return path.join(this.manifestsDirectory, `${encodePathSegment(artifactId)}.json`);\n  }\n}\n\nexport function createArtifactStore(rootPath: string): FilesystemArtifactStore {\n  return new FilesystemArtifactStore(rootPath);\n}\n\nexport function manifestToExternalBinaryLocation(\n  rootPath: string,\n  manifest: Pick<ArtifactManifest, \"objectRelativePath\" | \"mediaType\" | \"byteLength\" | \"sha256\">,\n): ExternalBinaryLocation {\n  return {\n    delivery: \"external\",\n    uri: filePathToUri(resolveStoragePath(rootPath, manifest.objectRelativePath)),\n    mimeType: manifest.mediaType,\n    byteLength: manifest.byteLength,\n    sha256: manifest.sha256,\n  };\n}\n\nfunction mediaTypeExtension(mediaType: string): string {\n  switch (mediaType) {\n    case \"image/png\":\n      return \".png\";\n    case \"image/jpeg\":\n      return \".jpeg\";\n    case \"image/webp\":\n      return \".webp\";\n    default:\n      return \"\";\n  }\n}\n","export type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonPrimitive | JsonObject | JsonArray;\n\nexport interface JsonObject {\n  readonly [key: string]: JsonValue;\n}\n\nexport type JsonArray = readonly JsonValue[];\n\nexport type JsonSchemaType =\n  | \"string\"\n  | \"number\"\n  | \"integer\"\n  | \"boolean\"\n  | \"object\"\n  | \"array\"\n  | \"null\";\n\nexport interface JsonSchema {\n  readonly $id?: string;\n  readonly $schema?: string;\n  readonly title?: string;\n  readonly description?: string;\n  readonly type?: JsonSchemaType | readonly JsonSchemaType[];\n  readonly enum?: readonly JsonPrimitive[];\n  readonly const?: JsonValue;\n  readonly format?: string;\n  readonly pattern?: string;\n  readonly minLength?: number;\n  readonly maxLength?: number;\n  readonly minimum?: number;\n  readonly maximum?: number;\n  readonly exclusiveMinimum?: number;\n  readonly exclusiveMaximum?: number;\n  readonly minItems?: number;\n  readonly maxItems?: number;\n  readonly uniqueItems?: boolean;\n  readonly items?: JsonSchema;\n  readonly properties?: Readonly<Record<string, JsonSchema>>;\n  readonly required?: readonly string[];\n  readonly additionalProperties?: boolean | JsonSchema;\n  readonly oneOf?: readonly JsonSchema[];\n  readonly anyOf?: readonly JsonSchema[];\n  readonly allOf?: readonly JsonSchema[];\n  readonly default?: JsonValue;\n  readonly examples?: readonly JsonValue[];\n}\n\nexport const JSON_SCHEMA_DRAFT_2020_12 = \"https://json-schema.org/draft/2020-12/schema\";\n\nexport function defineSchema<TSchema extends JsonSchema>(schema: TSchema): TSchema {\n  return schema;\n}\n\nexport function stringSchema(options: Omit<JsonSchema, \"type\"> = {}): JsonSchema {\n  return defineSchema({\n    type: \"string\",\n    ...options,\n  });\n}\n\nexport function numberSchema(options: Omit<JsonSchema, \"type\"> = {}): JsonSchema {\n  return defineSchema({\n    type: \"number\",\n    ...options,\n  });\n}\n\nexport function integerSchema(options: Omit<JsonSchema, \"type\"> = {}): JsonSchema {\n  return defineSchema({\n    type: \"integer\",\n    ...options,\n  });\n}\n\nexport function literalSchema(\n  value: JsonValue,\n  options: Omit<JsonSchema, \"const\"> = {},\n): JsonSchema {\n  return defineSchema({\n    const: value,\n    ...options,\n  });\n}\n\nexport function enumSchema(\n  values: readonly JsonPrimitive[],\n  options: Omit<JsonSchema, \"enum\"> = {},\n): JsonSchema {\n  return defineSchema({\n    enum: values,\n    ...options,\n  });\n}\n\nexport function arraySchema(\n  items: JsonSchema,\n  options: Omit<JsonSchema, \"type\" | \"items\"> = {},\n): JsonSchema {\n  return defineSchema({\n    type: \"array\",\n    items,\n    ...options,\n  });\n}\n\nexport function objectSchema(\n  properties: Readonly<Record<string, JsonSchema>>,\n  options: Omit<JsonSchema, \"type\" | \"properties\"> & {\n    readonly required?: readonly string[];\n    readonly additionalProperties?: boolean | JsonSchema;\n  } = {},\n): JsonSchema {\n  const { required, additionalProperties, ...rest } = options;\n\n  return defineSchema({\n    type: \"object\",\n    properties,\n    ...rest,\n    ...(required === undefined ? {} : { required }),\n    ...(additionalProperties === undefined\n      ? { additionalProperties: false }\n      : { additionalProperties }),\n  });\n}\n\nexport function recordSchema(\n  valueSchema: JsonSchema,\n  options: Omit<JsonSchema, \"type\" | \"additionalProperties\"> = {},\n): JsonSchema {\n  return defineSchema({\n    type: \"object\",\n    additionalProperties: valueSchema,\n    ...options,\n  });\n}\n\nexport function oneOfSchema(\n  members: readonly JsonSchema[],\n  options: Omit<JsonSchema, \"oneOf\"> = {},\n): JsonSchema {\n  return defineSchema({\n    oneOf: members,\n    ...options,\n  });\n}\n","import type { JsonSchema, JsonSchemaType, JsonValue } from \"./json.js\";\n\nexport interface JsonSchemaValidationIssue {\n  readonly path: string;\n  readonly message: string;\n}\n\nexport function validateJsonSchema(\n  schema: JsonSchema,\n  value: unknown,\n  path = \"$\",\n): readonly JsonSchemaValidationIssue[] {\n  return validateSchemaNode(schema, value, path);\n}\n\nfunction validateSchemaNode(\n  schema: JsonSchema,\n  value: unknown,\n  path: string,\n): JsonSchemaValidationIssue[] {\n  const issues: JsonSchemaValidationIssue[] = [];\n\n  if (\"const\" in schema && !isJsonValueEqual(schema.const, value)) {\n    issues.push({\n      path,\n      message: `must equal ${JSON.stringify(schema.const)}`,\n    });\n    return issues;\n  }\n\n  if (\n    schema.enum !== undefined &&\n    !schema.enum.some((candidate) => isJsonValueEqual(candidate, value))\n  ) {\n    issues.push({\n      path,\n      message: `must be one of ${schema.enum.map((candidate) => JSON.stringify(candidate)).join(\", \")}`,\n    });\n    return issues;\n  }\n\n  if (schema.oneOf !== undefined) {\n    const branchIssues = schema.oneOf.map((member) => validateSchemaNode(member, value, path));\n    const validBranches = branchIssues.filter((current) => current.length === 0).length;\n    if (validBranches !== 1) {\n      issues.push({\n        path,\n        message:\n          validBranches === 0\n            ? \"must match exactly one supported shape\"\n            : \"matches multiple supported shapes\",\n      });\n      return issues;\n    }\n  }\n\n  if (schema.anyOf !== undefined) {\n    const hasMatch = schema.anyOf.some(\n      (member) => validateSchemaNode(member, value, path).length === 0,\n    );\n    if (!hasMatch) {\n      issues.push({\n        path,\n        message: \"must match at least one supported shape\",\n      });\n      return issues;\n    }\n  }\n\n  if (schema.allOf !== undefined) {\n    for (const member of schema.allOf) {\n      issues.push(...validateSchemaNode(member, value, path));\n    }\n    if (issues.length > 0) {\n      return issues;\n    }\n  }\n\n  if (schema.type !== undefined && !matchesSchemaType(schema.type, value)) {\n    issues.push({\n      path,\n      message: `must be ${describeSchemaType(schema.type)}`,\n    });\n    return issues;\n  }\n\n  if (typeof value === \"string\") {\n    if (schema.minLength !== undefined && value.length < schema.minLength) {\n      issues.push({\n        path,\n        message: `must have length >= ${String(schema.minLength)}`,\n      });\n    }\n    if (schema.maxLength !== undefined && value.length > schema.maxLength) {\n      issues.push({\n        path,\n        message: `must have length <= ${String(schema.maxLength)}`,\n      });\n    }\n    if (schema.pattern !== undefined && !new RegExp(schema.pattern).test(value)) {\n      issues.push({\n        path,\n        message: `must match pattern ${schema.pattern}`,\n      });\n    }\n    return issues;\n  }\n\n  if (typeof value === \"number\") {\n    if (schema.minimum !== undefined && value < schema.minimum) {\n      issues.push({\n        path,\n        message: `must be >= ${String(schema.minimum)}`,\n      });\n    }\n    if (schema.maximum !== undefined && value > schema.maximum) {\n      issues.push({\n        path,\n        message: `must be <= ${String(schema.maximum)}`,\n      });\n    }\n    if (schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum) {\n      issues.push({\n        path,\n        message: `must be > ${String(schema.exclusiveMinimum)}`,\n      });\n    }\n    if (schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum) {\n      issues.push({\n        path,\n        message: `must be < ${String(schema.exclusiveMaximum)}`,\n      });\n    }\n    return issues;\n  }\n\n  if (Array.isArray(value)) {\n    if (schema.minItems !== undefined && value.length < schema.minItems) {\n      issues.push({\n        path,\n        message: `must have at least ${String(schema.minItems)} items`,\n      });\n    }\n    if (schema.maxItems !== undefined && value.length > schema.maxItems) {\n      issues.push({\n        path,\n        message: `must have at most ${String(schema.maxItems)} items`,\n      });\n    }\n    if (schema.uniqueItems) {\n      const seen = new Set<string>();\n      for (const item of value) {\n        const key = JSON.stringify(item);\n        if (seen.has(key)) {\n          issues.push({\n            path,\n            message: \"must not contain duplicate items\",\n          });\n          break;\n        }\n        seen.add(key);\n      }\n    }\n    if (schema.items !== undefined) {\n      for (let index = 0; index < value.length; index += 1) {\n        issues.push(...validateSchemaNode(schema.items, value[index], `${path}[${String(index)}]`));\n      }\n    }\n    return issues;\n  }\n\n  if (isPlainObject(value)) {\n    const properties = schema.properties ?? {};\n    for (const requiredKey of schema.required ?? []) {\n      if (!(requiredKey in value)) {\n        issues.push({\n          path: joinObjectPath(path, requiredKey),\n          message: \"is required\",\n        });\n      }\n    }\n\n    for (const [key, propertyValue] of Object.entries(value)) {\n      const propertySchema = properties[key];\n      if (propertySchema !== undefined) {\n        issues.push(\n          ...validateSchemaNode(propertySchema, propertyValue, joinObjectPath(path, key)),\n        );\n        continue;\n      }\n\n      if (schema.additionalProperties === false) {\n        issues.push({\n          path: joinObjectPath(path, key),\n          message: \"is not allowed\",\n        });\n        continue;\n      }\n\n      if (schema.additionalProperties !== undefined && schema.additionalProperties !== true) {\n        issues.push(\n          ...validateSchemaNode(\n            schema.additionalProperties,\n            propertyValue,\n            joinObjectPath(path, key),\n          ),\n        );\n      }\n    }\n  }\n\n  return issues;\n}\n\nfunction matchesSchemaType(\n  expected: JsonSchemaType | readonly JsonSchemaType[],\n  value: unknown,\n): boolean {\n  const candidates = Array.isArray(expected) ? expected : [expected];\n  return candidates.some((candidate) => matchesSingleSchemaType(candidate, value));\n}\n\nfunction matchesSingleSchemaType(expected: JsonSchemaType, value: unknown): boolean {\n  switch (expected) {\n    case \"string\":\n      return typeof value === \"string\";\n    case \"number\":\n      return typeof value === \"number\" && Number.isFinite(value);\n    case \"integer\":\n      return typeof value === \"number\" && Number.isInteger(value);\n    case \"boolean\":\n      return typeof value === \"boolean\";\n    case \"null\":\n      return value === null;\n    case \"array\":\n      return Array.isArray(value);\n    case \"object\":\n      return isPlainObject(value);\n  }\n}\n\nfunction describeSchemaType(expected: JsonSchemaType | readonly JsonSchemaType[]): string {\n  const candidates = Array.isArray(expected) ? expected : [expected];\n  return candidates.join(\" or \");\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n  return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n\nfunction joinObjectPath(base: string, key: string): string {\n  return `${base}.${key}`;\n}\n\nfunction isJsonValueEqual(expected: JsonValue | undefined, actual: unknown): boolean {\n  if (expected === undefined) {\n    return actual === undefined;\n  }\n  if (\n    expected === null ||\n    typeof expected === \"string\" ||\n    typeof expected === \"number\" ||\n    typeof expected === \"boolean\"\n  ) {\n    return actual === expected;\n  }\n  if (Array.isArray(expected)) {\n    return (\n      Array.isArray(actual) &&\n      actual.length === expected.length &&\n      expected.every((entry, index) => isJsonValueEqual(entry, actual[index]))\n    );\n  }\n  if (!isPlainObject(actual)) {\n    return false;\n  }\n\n  const expectedObject = expected as Record<string, JsonValue>;\n  const expectedKeys = Object.keys(expectedObject).sort((left, right) => left.localeCompare(right));\n  const actualKeys = Object.keys(actual).sort((left, right) => left.localeCompare(right));\n  return (\n    expectedKeys.length === actualKeys.length &&\n    expectedKeys.every(\n      (key, index) =>\n        key === actualKeys[index] && isJsonValueEqual(expectedObject[key], actual[key]),\n    )\n  );\n}\n","import {\n  JSON_SCHEMA_DRAFT_2020_12,\n  literalSchema,\n  objectSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\n\nexport const OPENSTEER_PROTOCOL_NAME = \"opensteer\";\nexport const OPENSTEER_PROTOCOL_COMPATIBILITY_REVISION = 3 as const;\nexport const OPENSTEER_PROTOCOL_VERSION = `0.${OPENSTEER_PROTOCOL_COMPATIBILITY_REVISION}.0`;\nexport const OPENSTEER_PROTOCOL_REVISION_DATE = \"2026-04-15\";\nexport const OPENSTEER_PROTOCOL_MEDIA_TYPE = `application/vnd.${OPENSTEER_PROTOCOL_NAME}+json;version=${OPENSTEER_PROTOCOL_VERSION}`;\nexport const OPENSTEER_PROTOCOL_REST_BASE_PATH = `/api/v${OPENSTEER_PROTOCOL_COMPATIBILITY_REVISION}`;\n\nexport type OpensteerProtocolName = typeof OPENSTEER_PROTOCOL_NAME;\nexport type OpensteerProtocolVersion = typeof OPENSTEER_PROTOCOL_VERSION;\n\nexport interface OpensteerProtocolDescriptor {\n  readonly protocol: OpensteerProtocolName;\n  readonly version: OpensteerProtocolVersion;\n  readonly revisionDate: string;\n  readonly mediaType: string;\n  readonly restBasePath: string;\n}\n\nexport const opensteerProtocolDescriptor: OpensteerProtocolDescriptor = {\n  protocol: OPENSTEER_PROTOCOL_NAME,\n  version: OPENSTEER_PROTOCOL_VERSION,\n  revisionDate: OPENSTEER_PROTOCOL_REVISION_DATE,\n  mediaType: OPENSTEER_PROTOCOL_MEDIA_TYPE,\n  restBasePath: OPENSTEER_PROTOCOL_REST_BASE_PATH,\n};\n\nexport const opensteerProtocolDescriptorSchema: JsonSchema = objectSchema(\n  {\n    protocol: literalSchema(OPENSTEER_PROTOCOL_NAME),\n    version: literalSchema(OPENSTEER_PROTOCOL_VERSION),\n    revisionDate: stringSchema({\n      format: \"date\",\n      description: \"Calendar revision for this protocol snapshot.\",\n    }),\n    mediaType: stringSchema({\n      description: \"Canonical media type for JSON payloads using this protocol revision.\",\n    }),\n    restBasePath: stringSchema({\n      description: \"Base HTTP path for the canonical REST transport.\",\n    }),\n  },\n  {\n    $schema: JSON_SCHEMA_DRAFT_2020_12,\n    $id: \"https://opensteer.dev/schemas/protocol/descriptor.json\",\n    title: \"OpensteerProtocolDescriptor\",\n    required: [\"protocol\", \"version\", \"revisionDate\", \"mediaType\", \"restBasePath\"],\n  },\n);\n\nexport function isSupportedProtocolVersion(value: string): value is OpensteerProtocolVersion {\n  return value === OPENSTEER_PROTOCOL_VERSION;\n}\n\nexport function assertSupportedProtocolVersion(value: string): OpensteerProtocolVersion {\n  if (!isSupportedProtocolVersion(value)) {\n    throw new RangeError(\n      `unsupported protocol version ${value}; expected ${OPENSTEER_PROTOCOL_VERSION}`,\n    );\n  }\n\n  return value;\n}\n","import type { JsonSchema } from \"./json.js\";\nimport { enumSchema, integerSchema, objectSchema, stringSchema } from \"./json.js\";\n\nexport interface ExternalBinaryLocation {\n  readonly delivery: \"external\";\n  readonly uri: string;\n  readonly mimeType: string;\n  readonly byteLength: number;\n  readonly sha256: string;\n}\n\nexport const externalBinaryLocationSchema: JsonSchema = objectSchema(\n  {\n    delivery: enumSchema([\"external\"] as const),\n    uri: stringSchema(),\n    mimeType: stringSchema(),\n    byteLength: integerSchema({ minimum: 0 }),\n    sha256: stringSchema(),\n  },\n  {\n    title: \"ExternalBinaryLocation\",\n    required: [\"delivery\", \"uri\", \"mimeType\", \"byteLength\", \"sha256\"],\n  },\n);\n","export type {\n  SessionRef,\n  PageRef,\n  FrameRef,\n  DocumentRef,\n  NodeRef,\n  NetworkRequestId,\n  DownloadRef,\n  DialogRef,\n  ChooserRef,\n  WorkerRef,\n  DocumentEpoch,\n  NodeLocator,\n} from \"@opensteer/browser-core\";\n\nexport {\n  createSessionRef,\n  createPageRef,\n  createFrameRef,\n  createDocumentRef,\n  createNodeRef,\n  createNetworkRequestId,\n  createDownloadRef,\n  createDialogRef,\n  createChooserRef,\n  createWorkerRef,\n  isSessionRef,\n  isPageRef,\n  isFrameRef,\n  isDocumentRef,\n  isNodeRef,\n  isNetworkRequestId,\n  isDownloadRef,\n  isDialogRef,\n  isChooserRef,\n  isWorkerRef,\n  serializeRef,\n  createDocumentEpoch,\n  nextDocumentEpoch,\n  serializeDocumentEpoch,\n  createNodeLocator,\n} from \"@opensteer/browser-core\";\n\nimport type {\n  SessionRef,\n  PageRef,\n  FrameRef,\n  DocumentRef,\n  NodeRef,\n  NetworkRequestId,\n  DownloadRef,\n  DialogRef,\n  ChooserRef,\n  WorkerRef,\n} from \"@opensteer/browser-core\";\n\nimport {\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  oneOfSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\n\nexport type OpensteerRef =\n  | SessionRef\n  | PageRef\n  | FrameRef\n  | DocumentRef\n  | NodeRef\n  | NetworkRequestId\n  | DownloadRef\n  | DialogRef\n  | ChooserRef\n  | WorkerRef;\n\ntype RefPrefix =\n  | \"session\"\n  | \"page\"\n  | \"frame\"\n  | \"document\"\n  | \"node\"\n  | \"request\"\n  | \"download\"\n  | \"dialog\"\n  | \"chooser\"\n  | \"worker\";\n\nexport interface ParsedOpensteerRef {\n  readonly kind: RefPrefix;\n  readonly value: string;\n}\n\nconst refPrefixes = [\n  \"session\",\n  \"page\",\n  \"frame\",\n  \"document\",\n  \"node\",\n  \"request\",\n  \"download\",\n  \"dialog\",\n  \"chooser\",\n  \"worker\",\n] as const satisfies readonly RefPrefix[];\n\nfunction parsePrefixedRef(value: string): ParsedOpensteerRef | null {\n  const separatorIndex = value.indexOf(\":\");\n  if (separatorIndex <= 0 || separatorIndex === value.length - 1) {\n    return null;\n  }\n\n  const kind = value.slice(0, separatorIndex);\n  if (!refPrefixes.includes(kind as RefPrefix)) {\n    return null;\n  }\n\n  return {\n    kind: kind as RefPrefix,\n    value: value.slice(separatorIndex + 1),\n  };\n}\n\nexport function isOpensteerRef(value: string): value is OpensteerRef {\n  return parsePrefixedRef(value) !== null;\n}\n\nexport function parseOpensteerRef(value: string): ParsedOpensteerRef | null {\n  return parsePrefixedRef(value);\n}\n\nfunction prefixedRefSchema(prefix: RefPrefix, title: string): JsonSchema {\n  return stringSchema({\n    title,\n    pattern: `^${prefix}:.+$`,\n  });\n}\n\nexport const opensteerRefKindSchema: JsonSchema = enumSchema(refPrefixes, {\n  title: \"OpensteerRefKind\",\n});\n\nexport const sessionRefSchema = prefixedRefSchema(\"session\", \"SessionRef\");\nexport const pageRefSchema = prefixedRefSchema(\"page\", \"PageRef\");\nexport const frameRefSchema = prefixedRefSchema(\"frame\", \"FrameRef\");\nexport const documentRefSchema = prefixedRefSchema(\"document\", \"DocumentRef\");\nexport const nodeRefSchema = prefixedRefSchema(\"node\", \"NodeRef\");\nexport const networkRequestIdSchema = prefixedRefSchema(\"request\", \"NetworkRequestId\");\nexport const downloadRefSchema = prefixedRefSchema(\"download\", \"DownloadRef\");\nexport const dialogRefSchema = prefixedRefSchema(\"dialog\", \"DialogRef\");\nexport const chooserRefSchema = prefixedRefSchema(\"chooser\", \"ChooserRef\");\nexport const workerRefSchema = prefixedRefSchema(\"worker\", \"WorkerRef\");\n\nexport const opensteerRefSchema: JsonSchema = oneOfSchema(\n  [\n    sessionRefSchema,\n    pageRefSchema,\n    frameRefSchema,\n    documentRefSchema,\n    nodeRefSchema,\n    networkRequestIdSchema,\n    downloadRefSchema,\n    dialogRefSchema,\n    chooserRefSchema,\n    workerRefSchema,\n  ],\n  {\n    title: \"OpensteerRef\",\n  },\n);\n\nexport const documentEpochSchema: JsonSchema = integerSchema({\n  title: \"DocumentEpoch\",\n  minimum: 0,\n});\n\nexport const nodeLocatorSchema: JsonSchema = objectSchema(\n  {\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    nodeRef: nodeRefSchema,\n  },\n  {\n    title: \"NodeLocator\",\n    required: [\"documentRef\", \"documentEpoch\", \"nodeRef\"],\n  },\n);\n","export type {\n  Point,\n  Size,\n  Rect,\n  Quad,\n  ScrollOffset,\n  CoordinateSpace,\n  LayoutViewport,\n  VisualViewport,\n  DevicePixelRatio,\n  PageScaleFactor,\n  PageZoomFactor,\n  ViewportMetrics,\n} from \"@opensteer/browser-core\";\n\nimport { arraySchema, enumSchema, numberSchema, objectSchema, type JsonSchema } from \"./json.js\";\n\nexport const pointSchema: JsonSchema = objectSchema(\n  {\n    x: numberSchema(),\n    y: numberSchema(),\n  },\n  {\n    title: \"Point\",\n    required: [\"x\", \"y\"],\n  },\n);\n\nexport const sizeSchema: JsonSchema = objectSchema(\n  {\n    width: numberSchema({ minimum: 0 }),\n    height: numberSchema({ minimum: 0 }),\n  },\n  {\n    title: \"Size\",\n    required: [\"width\", \"height\"],\n  },\n);\n\nexport const rectSchema: JsonSchema = objectSchema(\n  {\n    x: numberSchema(),\n    y: numberSchema(),\n    width: numberSchema({ minimum: 0 }),\n    height: numberSchema({ minimum: 0 }),\n  },\n  {\n    title: \"Rect\",\n    required: [\"x\", \"y\", \"width\", \"height\"],\n  },\n);\n\nexport const quadSchema: JsonSchema = arraySchema(pointSchema, {\n  title: \"Quad\",\n  minItems: 4,\n  maxItems: 4,\n});\n\nexport const scrollOffsetSchema: JsonSchema = objectSchema(\n  {\n    x: numberSchema(),\n    y: numberSchema(),\n  },\n  {\n    title: \"ScrollOffset\",\n    required: [\"x\", \"y\"],\n  },\n);\n\nexport const coordinateSpaceSchema: JsonSchema = enumSchema(\n  [\n    \"document-css\",\n    \"layout-viewport-css\",\n    \"visual-viewport-css\",\n    \"computer-display-css\",\n    \"window\",\n    \"screen\",\n    \"device-pixel\",\n  ] as const,\n  {\n    title: \"CoordinateSpace\",\n  },\n);\n\nexport const layoutViewportSchema: JsonSchema = objectSchema(\n  {\n    origin: pointSchema,\n    size: sizeSchema,\n  },\n  {\n    title: \"LayoutViewport\",\n    required: [\"origin\", \"size\"],\n  },\n);\n\nexport const visualViewportSchema: JsonSchema = objectSchema(\n  {\n    origin: pointSchema,\n    offsetWithinLayoutViewport: scrollOffsetSchema,\n    size: sizeSchema,\n  },\n  {\n    title: \"VisualViewport\",\n    required: [\"origin\", \"offsetWithinLayoutViewport\", \"size\"],\n  },\n);\n\nexport const viewportMetricsSchema: JsonSchema = objectSchema(\n  {\n    layoutViewport: layoutViewportSchema,\n    visualViewport: visualViewportSchema,\n    scrollOffset: scrollOffsetSchema,\n    contentSize: sizeSchema,\n    devicePixelRatio: numberSchema({ exclusiveMinimum: 0 }),\n    pageScaleFactor: numberSchema({ exclusiveMinimum: 0 }),\n    pageZoomFactor: numberSchema({ exclusiveMinimum: 0 }),\n  },\n  {\n    title: \"ViewportMetrics\",\n    required: [\n      \"layoutViewport\",\n      \"visualViewport\",\n      \"scrollOffset\",\n      \"contentSize\",\n      \"devicePixelRatio\",\n      \"pageScaleFactor\",\n      \"pageZoomFactor\",\n    ],\n  },\n);\n","export type { PageLifecycleState, PageInfo, FrameInfo } from \"@opensteer/browser-core\";\n\nimport {\n  documentEpochSchema,\n  documentRefSchema,\n  frameRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n} from \"./identity.js\";\nimport { enumSchema, objectSchema, stringSchema, type JsonSchema } from \"./json.js\";\n\nexport const pageLifecycleStateSchema: JsonSchema = enumSchema(\n  [\"opening\", \"open\", \"closing\", \"closed\", \"crashed\"] as const,\n  {\n    title: \"PageLifecycleState\",\n  },\n);\n\nexport const pageInfoSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    sessionRef: sessionRefSchema,\n    targetId: stringSchema({\n      description: \"Underlying browser target identifier when available.\",\n    }),\n    openerPageRef: pageRefSchema,\n    url: stringSchema({\n      description: \"Current main-frame URL.\",\n    }),\n    title: stringSchema(),\n    lifecycleState: pageLifecycleStateSchema,\n  },\n  {\n    title: \"PageInfo\",\n    required: [\"pageRef\", \"sessionRef\", \"url\", \"title\", \"lifecycleState\"],\n  },\n);\n\nexport const frameInfoSchema: JsonSchema = objectSchema(\n  {\n    frameRef: frameRefSchema,\n    pageRef: pageRefSchema,\n    parentFrameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    url: stringSchema(),\n    name: stringSchema(),\n    isMainFrame: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"FrameInfo\",\n    required: [\"frameRef\", \"pageRef\", \"documentRef\", \"documentEpoch\", \"url\", \"isMainFrame\"],\n  },\n);\n","export type {\n  HeaderEntry,\n  BodyPayloadEncoding,\n  NetworkCaptureState,\n  NetworkRecordKind,\n  NetworkResourceType,\n  NetworkInitiatorType,\n  NetworkInitiator,\n  NetworkTiming,\n  NetworkTransferSizes,\n  NetworkSourceMetadata,\n} from \"@opensteer/browser-core\";\n\nexport { createHeaderEntry } from \"@opensteer/browser-core\";\n\nimport type {\n  BodyPayloadEncoding,\n  DocumentRef,\n  FrameRef,\n  HeaderEntry,\n  NetworkCaptureState,\n  NetworkInitiator,\n  NetworkRecordKind,\n  NetworkRequestId,\n  NetworkResourceType,\n  NetworkSourceMetadata,\n  NetworkTiming,\n  NetworkTransferSizes,\n  PageRef,\n  SessionRef,\n  WorkerRef,\n} from \"@opensteer/browser-core\";\n\nimport {\n  documentRefSchema,\n  frameRefSchema,\n  networkRequestIdSchema,\n  pageRefSchema,\n  sessionRefSchema,\n  workerRefSchema,\n} from \"./identity.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  numberSchema,\n  objectSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\n\nexport interface BodyPayload {\n  readonly data: string;\n  readonly encoding: BodyPayloadEncoding;\n  readonly mimeType?: string;\n  readonly charset?: string;\n  readonly truncated: boolean;\n  readonly capturedByteLength: number;\n  readonly originalByteLength?: number;\n}\n\nexport interface NetworkRecord {\n  readonly kind: NetworkRecordKind;\n  readonly requestId: NetworkRequestId;\n  readonly sessionRef: SessionRef;\n  readonly pageRef?: PageRef;\n  readonly frameRef?: FrameRef;\n  readonly documentRef?: DocumentRef;\n  readonly method: string;\n  readonly url: string;\n  readonly requestHeaders: readonly HeaderEntry[];\n  readonly responseHeaders: readonly HeaderEntry[];\n  readonly status?: number;\n  readonly statusText?: string;\n  readonly resourceType: NetworkResourceType;\n  readonly redirectFromRequestId?: NetworkRequestId;\n  readonly redirectToRequestId?: NetworkRequestId;\n  readonly navigationRequest: boolean;\n  readonly initiator?: NetworkInitiator;\n  readonly timing?: NetworkTiming;\n  readonly transfer?: NetworkTransferSizes;\n  readonly source?: NetworkSourceMetadata;\n  readonly captureState: NetworkCaptureState;\n  readonly requestBodyState: NetworkCaptureState;\n  readonly responseBodyState: NetworkCaptureState;\n  readonly requestBodySkipReason?: string;\n  readonly responseBodySkipReason?: string;\n  readonly requestBodyError?: string;\n  readonly responseBodyError?: string;\n  readonly requestBody?: BodyPayload;\n  readonly responseBody?: BodyPayload;\n}\n\nexport interface NetworkQueryRecord {\n  readonly recordId: string;\n  readonly capture?: string;\n  readonly tags?: readonly string[];\n  readonly savedAt?: number;\n  readonly record: NetworkRecord;\n}\n\nexport function createBodyPayload(\n  data: string,\n  options: {\n    readonly encoding?: BodyPayloadEncoding;\n    readonly mimeType?: string;\n    readonly charset?: string;\n    readonly truncated?: boolean;\n    readonly originalByteLength?: number;\n  } = {},\n): BodyPayload {\n  const capturedByteLength = Buffer.from(data, \"base64\").byteLength;\n\n  return {\n    data,\n    encoding: options.encoding ?? \"identity\",\n    truncated: options.truncated ?? false,\n    capturedByteLength,\n    ...(options.mimeType === undefined ? {} : { mimeType: options.mimeType }),\n    ...(options.charset === undefined ? {} : { charset: options.charset }),\n    ...(options.originalByteLength === undefined\n      ? {}\n      : { originalByteLength: options.originalByteLength }),\n  };\n}\n\nexport function bodyPayloadFromUtf8(\n  value: string,\n  options: {\n    readonly mimeType?: string;\n    readonly encoding?: BodyPayloadEncoding;\n    readonly truncated?: boolean;\n    readonly originalByteLength?: number;\n  } = {},\n): BodyPayload {\n  return createBodyPayload(Buffer.from(value, \"utf8\").toString(\"base64\"), {\n    ...(options.mimeType === undefined ? {} : { mimeType: options.mimeType }),\n    ...(options.encoding === undefined ? {} : { encoding: options.encoding }),\n    ...(options.truncated === undefined ? {} : { truncated: options.truncated }),\n    ...(options.originalByteLength === undefined\n      ? {}\n      : { originalByteLength: options.originalByteLength }),\n    charset: \"utf-8\",\n  });\n}\n\nexport const headerEntrySchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema(),\n    value: stringSchema(),\n  },\n  {\n    title: \"HeaderEntry\",\n    required: [\"name\", \"value\"],\n  },\n);\n\nexport const bodyPayloadEncodingSchema: JsonSchema = enumSchema(\n  [\"identity\", \"base64\", \"gzip\", \"deflate\", \"brotli\", \"unknown\"] as const,\n  {\n    title: \"BodyPayloadEncoding\",\n  },\n);\n\nexport const bodyPayloadSchema: JsonSchema = objectSchema(\n  {\n    data: stringSchema({\n      description: \"Binary payload encoded as base64.\",\n    }),\n    encoding: bodyPayloadEncodingSchema,\n    mimeType: stringSchema(),\n    charset: stringSchema(),\n    truncated: {\n      type: \"boolean\",\n    },\n    capturedByteLength: integerSchema({ minimum: 0 }),\n    originalByteLength: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"BodyPayload\",\n    required: [\"data\", \"encoding\", \"truncated\", \"capturedByteLength\"],\n  },\n);\n\nexport const networkRecordKindSchema: JsonSchema = enumSchema(\n  [\"http\", \"websocket\", \"event-stream\"] as const,\n  {\n    title: \"NetworkRecordKind\",\n  },\n);\n\nexport const networkCaptureStateSchema: JsonSchema = enumSchema(\n  [\"pending\", \"complete\", \"failed\", \"skipped\"] as const,\n  {\n    title: \"NetworkCaptureState\",\n  },\n);\n\nexport const networkResourceTypeSchema: JsonSchema = enumSchema(\n  [\n    \"document\",\n    \"stylesheet\",\n    \"image\",\n    \"media\",\n    \"font\",\n    \"script\",\n    \"fetch\",\n    \"xhr\",\n    \"websocket\",\n    \"event-stream\",\n    \"manifest\",\n    \"texttrack\",\n    \"beacon\",\n    \"ping\",\n    \"preflight\",\n    \"other\",\n  ] as const,\n  {\n    title: \"NetworkResourceType\",\n  },\n);\n\nexport const networkInitiatorTypeSchema: JsonSchema = enumSchema(\n  [\"parser\", \"script\", \"preload\", \"redirect\", \"user\", \"service-worker\", \"other\"] as const,\n  {\n    title: \"NetworkInitiatorType\",\n  },\n);\n\nexport const networkInitiatorSchema: JsonSchema = objectSchema(\n  {\n    type: networkInitiatorTypeSchema,\n    url: stringSchema(),\n    lineNumber: integerSchema({ minimum: 0 }),\n    columnNumber: integerSchema({ minimum: 0 }),\n    requestId: networkRequestIdSchema,\n    stackTrace: arraySchema(stringSchema()),\n  },\n  {\n    title: \"NetworkInitiator\",\n    required: [\"type\"],\n  },\n);\n\nexport const networkTimingSchema: JsonSchema = objectSchema(\n  {\n    requestStartMs: numberSchema(),\n    dnsStartMs: numberSchema(),\n    dnsEndMs: numberSchema(),\n    connectStartMs: numberSchema(),\n    connectEndMs: numberSchema(),\n    sslStartMs: numberSchema(),\n    sslEndMs: numberSchema(),\n    requestSentMs: numberSchema(),\n    responseStartMs: numberSchema(),\n    responseEndMs: numberSchema(),\n    workerStartMs: numberSchema(),\n    workerReadyMs: numberSchema(),\n  },\n  {\n    title: \"NetworkTiming\",\n  },\n);\n\nexport const networkTransferSizesSchema: JsonSchema = objectSchema(\n  {\n    requestHeadersBytes: integerSchema({ minimum: 0 }),\n    responseHeadersBytes: integerSchema({ minimum: 0 }),\n    encodedBodyBytes: integerSchema({ minimum: 0 }),\n    decodedBodyBytes: integerSchema({ minimum: 0 }),\n    transferSizeBytes: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"NetworkTransferSizes\",\n  },\n);\n\nexport const networkSourceMetadataSchema: JsonSchema = objectSchema(\n  {\n    protocol: stringSchema(),\n    remoteAddress: objectSchema(\n      {\n        ip: stringSchema(),\n        port: integerSchema({ minimum: 0 }),\n      },\n      {\n        required: [],\n      },\n    ),\n    fromServiceWorker: {\n      type: \"boolean\",\n    },\n    fromDiskCache: {\n      type: \"boolean\",\n    },\n    fromMemoryCache: {\n      type: \"boolean\",\n    },\n    workerRef: workerRefSchema,\n  },\n  {\n    title: \"NetworkSourceMetadata\",\n  },\n);\n\nexport const networkRecordSchema: JsonSchema = objectSchema(\n  {\n    kind: networkRecordKindSchema,\n    requestId: networkRequestIdSchema,\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    method: stringSchema(),\n    url: stringSchema(),\n    requestHeaders: arraySchema(headerEntrySchema),\n    responseHeaders: arraySchema(headerEntrySchema),\n    status: integerSchema({ minimum: 0 }),\n    statusText: stringSchema(),\n    resourceType: networkResourceTypeSchema,\n    redirectFromRequestId: networkRequestIdSchema,\n    redirectToRequestId: networkRequestIdSchema,\n    navigationRequest: {\n      type: \"boolean\",\n    },\n    initiator: networkInitiatorSchema,\n    timing: networkTimingSchema,\n    transfer: networkTransferSizesSchema,\n    source: networkSourceMetadataSchema,\n    captureState: networkCaptureStateSchema,\n    requestBodyState: networkCaptureStateSchema,\n    responseBodyState: networkCaptureStateSchema,\n    requestBodySkipReason: stringSchema(),\n    responseBodySkipReason: stringSchema(),\n    requestBodyError: stringSchema(),\n    responseBodyError: stringSchema(),\n    requestBody: bodyPayloadSchema,\n    responseBody: bodyPayloadSchema,\n  },\n  {\n    title: \"NetworkRecord\",\n    required: [\n      \"kind\",\n      \"requestId\",\n      \"sessionRef\",\n      \"method\",\n      \"url\",\n      \"requestHeaders\",\n      \"responseHeaders\",\n      \"resourceType\",\n      \"navigationRequest\",\n      \"captureState\",\n      \"requestBodyState\",\n      \"responseBodyState\",\n    ],\n  },\n);\n\nexport const networkQueryRecordSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    capture: stringSchema({ minLength: 1 }),\n    tags: arraySchema(stringSchema({ minLength: 1 }), {\n      uniqueItems: true,\n    }),\n    savedAt: integerSchema({ minimum: 0 }),\n    record: networkRecordSchema,\n  },\n  {\n    title: \"NetworkQueryRecord\",\n    required: [\"recordId\", \"record\"],\n  },\n);\n\nexport const orderedHeadersSchema: JsonSchema = arraySchema(headerEntrySchema, {\n  title: \"OrderedHeaders\",\n});\n","export type {\n  CookieSameSite,\n  CookiePriority,\n  CookieRecord,\n  StorageEntry,\n  IndexedDbRecord,\n  IndexedDbIndexSnapshot,\n  IndexedDbObjectStoreSnapshot,\n  IndexedDbDatabaseSnapshot,\n  StorageOriginSnapshot,\n  SessionStorageSnapshot,\n  StorageSnapshot,\n} from \"@opensteer/browser-core\";\n\nimport { frameRefSchema, pageRefSchema, sessionRefSchema } from \"./identity.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  numberSchema,\n  objectSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\n\nconst jsonUnknownSchema: JsonSchema = {};\n\nexport const cookieSameSiteSchema: JsonSchema = enumSchema([\"strict\", \"lax\", \"none\"] as const, {\n  title: \"CookieSameSite\",\n});\n\nexport const cookiePrioritySchema: JsonSchema = enumSchema([\"low\", \"medium\", \"high\"] as const, {\n  title: \"CookiePriority\",\n});\n\nexport const cookieRecordSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    name: stringSchema(),\n    value: stringSchema(),\n    domain: stringSchema(),\n    path: stringSchema(),\n    secure: {\n      type: \"boolean\",\n    },\n    httpOnly: {\n      type: \"boolean\",\n    },\n    sameSite: cookieSameSiteSchema,\n    priority: cookiePrioritySchema,\n    partitionKey: stringSchema(),\n    session: {\n      type: \"boolean\",\n    },\n    expiresAt: {\n      type: [\"number\", \"null\"],\n    },\n  },\n  {\n    title: \"CookieRecord\",\n    required: [\"sessionRef\", \"name\", \"value\", \"domain\", \"path\", \"secure\", \"httpOnly\", \"session\"],\n  },\n);\n\nexport const storageEntrySchema: JsonSchema = objectSchema(\n  {\n    key: stringSchema(),\n    value: stringSchema(),\n  },\n  {\n    title: \"StorageEntry\",\n    required: [\"key\", \"value\"],\n  },\n);\n\nexport const indexedDbRecordSchema: JsonSchema = objectSchema(\n  {\n    key: jsonUnknownSchema,\n    primaryKey: jsonUnknownSchema,\n    value: jsonUnknownSchema,\n  },\n  {\n    title: \"IndexedDbRecord\",\n    required: [\"key\", \"value\"],\n  },\n);\n\nexport const indexedDbIndexSnapshotSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema(),\n    keyPath: {\n      oneOf: [stringSchema(), arraySchema(stringSchema())],\n    },\n    multiEntry: {\n      type: \"boolean\",\n    },\n    unique: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"IndexedDbIndexSnapshot\",\n    required: [\"name\", \"multiEntry\", \"unique\"],\n  },\n);\n\nexport const indexedDbObjectStoreSnapshotSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema(),\n    keyPath: {\n      oneOf: [stringSchema(), arraySchema(stringSchema())],\n    },\n    autoIncrement: {\n      type: \"boolean\",\n    },\n    indexes: arraySchema(indexedDbIndexSnapshotSchema),\n    records: arraySchema(indexedDbRecordSchema),\n  },\n  {\n    title: \"IndexedDbObjectStoreSnapshot\",\n    required: [\"name\", \"autoIncrement\", \"indexes\", \"records\"],\n  },\n);\n\nexport const indexedDbDatabaseSnapshotSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema(),\n    version: numberSchema(),\n    objectStores: arraySchema(indexedDbObjectStoreSnapshotSchema),\n  },\n  {\n    title: \"IndexedDbDatabaseSnapshot\",\n    required: [\"name\", \"version\", \"objectStores\"],\n  },\n);\n\nexport const storageOriginSnapshotSchema: JsonSchema = objectSchema(\n  {\n    origin: stringSchema(),\n    localStorage: arraySchema(storageEntrySchema),\n    indexedDb: arraySchema(indexedDbDatabaseSnapshotSchema),\n  },\n  {\n    title: \"StorageOriginSnapshot\",\n    required: [\"origin\", \"localStorage\"],\n  },\n);\n\nexport const sessionStorageSnapshotSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    origin: stringSchema(),\n    entries: arraySchema(storageEntrySchema),\n  },\n  {\n    title: \"SessionStorageSnapshot\",\n    required: [\"pageRef\", \"frameRef\", \"origin\", \"entries\"],\n  },\n);\n\nexport const storageSnapshotSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    capturedAt: integerSchema({ minimum: 0 }),\n    origins: arraySchema(storageOriginSnapshotSchema),\n    sessionStorage: arraySchema(sessionStorageSnapshotSchema),\n  },\n  {\n    title: \"StorageSnapshot\",\n    required: [\"sessionRef\", \"capturedAt\", \"origins\"],\n  },\n);\n","import type { HeaderEntry } from \"./network.js\";\nimport {\n  bodyPayloadSchema,\n  headerEntrySchema,\n  networkResourceTypeSchema,\n  type BodyPayload,\n  type NetworkQueryRecord,\n  type NetworkResourceType,\n} from \"./network.js\";\nimport type { JsonSchema, JsonValue } from \"./json.js\";\nimport { pageRefSchema, type PageRef } from \"./identity.js\";\nimport { cookieRecordSchema, storageEntrySchema } from \"./storage.js\";\nimport type { CookieRecord, StorageEntry } from \"./storage.js\";\nimport {\n  arraySchema,\n  defineSchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  oneOfSchema,\n  recordSchema,\n  stringSchema,\n} from \"./json.js\";\n\nexport type OpensteerRequestScalar = string | number | boolean;\nexport type TransportKind =\n  | \"direct-http\"\n  | \"matched-tls\"\n  | \"context-http\"\n  | \"page-http\"\n  | \"session-http\";\n\nexport interface OpensteerRequestEntry {\n  readonly name: string;\n  readonly value: string;\n}\n\nexport type OpensteerRequestParameterLocation = \"path\" | \"query\" | \"header\";\n\nexport interface OpensteerRequestPlanParameter {\n  readonly name: string;\n  readonly in: OpensteerRequestParameterLocation;\n  readonly wireName?: string;\n  readonly required?: boolean;\n  readonly description?: string;\n  readonly defaultValue?: string;\n}\n\nexport interface OpensteerRequestPlanTransport {\n  readonly kind: TransportKind;\n  readonly requiresBrowser?: boolean;\n  readonly requireSameOrigin?: boolean;\n  readonly cookieJar?: string;\n}\n\nexport interface OpensteerRequestPlanEndpoint {\n  readonly method: string;\n  readonly urlTemplate: string;\n  readonly defaultQuery?: readonly OpensteerRequestEntry[];\n  readonly defaultHeaders?: readonly OpensteerRequestEntry[];\n}\n\nexport type OpensteerRequestPlanBodyKind = \"json\" | \"form\" | \"text\";\n\nexport interface OpensteerRequestPlanBody {\n  readonly kind?: OpensteerRequestPlanBodyKind;\n  readonly contentType?: string;\n  readonly required?: boolean;\n  readonly description?: string;\n  readonly template?: JsonValue | string;\n  readonly fields?: readonly OpensteerRequestEntry[];\n}\n\nexport interface OpensteerRequestPlanResponseExpectation {\n  readonly status: number | readonly number[];\n  readonly contentType?: string;\n}\n\nexport interface OpensteerRequestFailurePolicyHeaderMatch {\n  readonly name: string;\n  readonly valueIncludes: string;\n}\n\nexport interface OpensteerRequestFailurePolicy {\n  readonly statusCodes?: readonly number[];\n  readonly finalUrlIncludes?: readonly string[];\n  readonly responseHeaders?: readonly OpensteerRequestFailurePolicyHeaderMatch[];\n  readonly responseBodyIncludes?: readonly string[];\n}\n\nexport interface OpensteerRequestRetryBackoffPolicy {\n  readonly strategy?: \"fixed\" | \"exponential\";\n  readonly delayMs: number;\n  readonly maxDelayMs?: number;\n}\n\nexport interface OpensteerRequestRetryPolicy {\n  readonly maxRetries: number;\n  readonly backoff?: OpensteerRequestRetryBackoffPolicy;\n  readonly respectRetryAfter?: boolean;\n  readonly failurePolicy?: OpensteerRequestFailurePolicy;\n}\n\nexport interface OpensteerRequestPlanAuth {\n  readonly strategy: \"session-cookie\" | \"bearer-token\" | \"api-key\" | \"custom\";\n  readonly failurePolicy?: OpensteerRequestFailurePolicy;\n  readonly description?: string;\n}\n\nexport interface OpensteerRequestPlanPayload {\n  readonly transport: OpensteerRequestPlanTransport;\n  readonly endpoint: OpensteerRequestPlanEndpoint;\n  readonly parameters?: readonly OpensteerRequestPlanParameter[];\n  readonly body?: OpensteerRequestPlanBody;\n  readonly response?: OpensteerRequestPlanResponseExpectation;\n  readonly retryPolicy?: OpensteerRequestRetryPolicy;\n  readonly auth?: OpensteerRequestPlanAuth;\n}\n\nexport interface OpensteerRegistryProvenance {\n  readonly source: string;\n  readonly sourceId?: string;\n  readonly capturedAt?: number;\n  readonly notes?: string;\n}\n\nexport interface OpensteerRequestPlanFreshness {\n  readonly lastValidatedAt?: number;\n  readonly staleAt?: number;\n  readonly expiresAt?: number;\n}\n\nexport interface OpensteerRequestPlanRecord {\n  readonly id: string;\n  readonly key: string;\n  readonly version: string;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly contentHash: string;\n  readonly tags: readonly string[];\n  readonly provenance?: OpensteerRegistryProvenance;\n  readonly freshness?: OpensteerRequestPlanFreshness;\n  readonly payload: OpensteerRequestPlanPayload;\n}\n\nexport interface OpensteerNetworkQueryInput {\n  readonly pageRef?: PageRef;\n  readonly recordId?: string;\n  readonly requestId?: string;\n  readonly capture?: string;\n  readonly tag?: string;\n  readonly url?: string;\n  readonly hostname?: string;\n  readonly path?: string;\n  readonly method?: string;\n  readonly status?: string | number;\n  readonly resourceType?: NetworkResourceType;\n  readonly includeBodies?: boolean;\n  readonly json?: boolean;\n  readonly before?: string;\n  readonly after?: string;\n  readonly limit?: number;\n}\n\nexport interface OpensteerGraphqlSummary {\n  readonly operationType?: \"query\" | \"mutation\" | \"subscription\" | \"unknown\";\n  readonly operationName?: string;\n  readonly persisted?: boolean;\n}\n\nexport interface OpensteerNetworkBodySummary {\n  readonly bytes?: number;\n  readonly contentType?: string;\n  readonly streaming?: boolean;\n}\n\nexport interface OpensteerNetworkSummaryRecord {\n  readonly recordId: string;\n  readonly capture?: string;\n  readonly savedAt?: number;\n  readonly kind: NetworkQueryRecord[\"record\"][\"kind\"];\n  readonly method: string;\n  readonly status?: number;\n  readonly resourceType: NetworkResourceType;\n  readonly url: string;\n  readonly request?: OpensteerNetworkBodySummary;\n  readonly response?: OpensteerNetworkBodySummary;\n  readonly graphql?: OpensteerGraphqlSummary;\n  readonly websocket?: {\n    readonly subprotocol?: string;\n  };\n}\n\nexport interface OpensteerNetworkQueryOutput {\n  readonly records: readonly OpensteerNetworkSummaryRecord[];\n}\n\nexport interface OpensteerParsedCookie {\n  readonly name: string;\n  readonly value: string;\n}\n\nexport interface OpensteerStructuredBodyPreview {\n  readonly contentType?: string;\n  readonly bytes: number;\n  readonly truncated: boolean;\n  readonly data?: JsonValue | string;\n  readonly note?: string;\n}\n\nexport interface OpensteerNetworkRedirectHop {\n  readonly method: string;\n  readonly status?: number;\n  readonly url: string;\n  readonly location?: string;\n  readonly setCookie?: readonly string[];\n}\n\nexport interface OpensteerNetworkDetailOutput {\n  readonly recordId: string;\n  readonly capture?: string;\n  readonly savedAt?: number;\n  readonly summary: OpensteerNetworkSummaryRecord;\n  readonly requestHeaders: readonly HeaderEntry[];\n  readonly responseHeaders: readonly HeaderEntry[];\n  readonly cookiesSent?: readonly OpensteerParsedCookie[];\n  readonly requestBody?: OpensteerStructuredBodyPreview;\n  readonly responseBody?: OpensteerStructuredBodyPreview;\n  readonly graphql?: OpensteerGraphqlSummary & {\n    readonly variables?: JsonValue;\n  };\n  readonly redirectChain?: readonly OpensteerNetworkRedirectHop[];\n  readonly notes?: readonly string[];\n  readonly transportProbe?: {\n    readonly recommended?: TransportKind;\n    readonly attempts: readonly OpensteerReplayAttempt[];\n  };\n}\n\nexport interface OpensteerNetworkDetailInput {\n  readonly recordId: string;\n  readonly probe?: boolean;\n}\n\nexport interface OpensteerReplayAttempt {\n  readonly transport: TransportKind;\n  readonly status?: number;\n  readonly ok: boolean;\n  readonly durationMs: number;\n  readonly note?: string;\n  readonly error?: string;\n}\n\nexport interface OpensteerNetworkReplayOverrides {\n  readonly query?: OpensteerRequestScalarMap;\n  readonly headers?: OpensteerRequestScalarMap;\n  readonly body?: OpensteerRequestBodyInput;\n  readonly variables?: JsonValue;\n}\n\nexport interface OpensteerNetworkReplayInput extends OpensteerNetworkReplayOverrides {\n  readonly recordId: string;\n  readonly pageRef?: PageRef;\n}\n\nexport interface OpensteerNetworkReplayOutput {\n  readonly recordId: string;\n  readonly transport?: TransportKind;\n  readonly attempts: readonly OpensteerReplayAttempt[];\n  readonly response?: OpensteerRequestResponseResult;\n  readonly data?: JsonValue | string;\n  readonly note?: string;\n}\n\nexport type OpensteerSessionFetchTransport = \"auto\" | \"direct\" | \"matched-tls\" | \"context\" | \"page\";\n\nexport interface OpensteerSessionFetchInput {\n  readonly pageRef?: PageRef;\n  readonly url: string;\n  readonly method?: string;\n  readonly query?: OpensteerRequestScalarMap;\n  readonly headers?: OpensteerRequestScalarMap;\n  readonly body?: OpensteerRequestBodyInput;\n  readonly transport?: OpensteerSessionFetchTransport;\n  readonly cookies?: boolean;\n  readonly followRedirects?: boolean;\n}\n\nexport interface OpensteerSessionFetchOutput {\n  readonly transport?: TransportKind;\n  readonly attempts: readonly OpensteerReplayAttempt[];\n  readonly response?: OpensteerRequestResponseResult;\n  readonly data?: JsonValue | string;\n  readonly note?: string;\n}\n\nexport interface OpensteerCookieQueryInput {\n  readonly domain?: string;\n}\n\nexport interface OpensteerCookieQueryOutput {\n  readonly domain?: string;\n  readonly cookies: readonly CookieRecord[];\n}\n\nexport type OpensteerStorageArea = \"local\" | \"session\";\n\nexport interface OpensteerStorageQueryInput {\n  readonly domain?: string;\n}\n\nexport interface OpensteerStorageDomainSnapshot {\n  readonly domain: string;\n  readonly localStorage: readonly StorageEntry[];\n  readonly sessionStorage: readonly StorageEntry[];\n}\n\nexport interface OpensteerStorageQueryOutput {\n  readonly domains: readonly OpensteerStorageDomainSnapshot[];\n}\n\nexport interface OpensteerHiddenField {\n  readonly path: string;\n  readonly name: string;\n  readonly value: string;\n}\n\nexport interface OpensteerStateDomainSnapshot {\n  readonly domain: string;\n  readonly cookies: readonly CookieRecord[];\n  readonly hiddenFields: readonly OpensteerHiddenField[];\n  readonly localStorage: readonly StorageEntry[];\n  readonly sessionStorage: readonly StorageEntry[];\n  readonly globals?: Readonly<Record<string, JsonValue>>;\n}\n\nexport interface OpensteerStateQueryInput {\n  readonly domain?: string;\n}\n\nexport interface OpensteerStateQueryOutput {\n  readonly domains: readonly OpensteerStateDomainSnapshot[];\n}\n\nexport interface OpensteerNetworkTagInput {\n  readonly pageRef?: PageRef;\n  readonly recordId?: string;\n  readonly requestId?: string;\n  readonly capture?: string;\n  readonly tag: string;\n  readonly url?: string;\n  readonly hostname?: string;\n  readonly path?: string;\n  readonly method?: string;\n  readonly status?: string;\n  readonly resourceType?: NetworkResourceType;\n}\n\nexport interface OpensteerNetworkTagOutput {\n  readonly taggedCount: number;\n}\n\nexport interface OpensteerNetworkClearInput {\n  readonly capture?: string;\n  readonly tag?: string;\n}\n\nexport interface OpensteerNetworkClearOutput {\n  readonly clearedCount: number;\n}\n\nexport interface OpensteerWriteRequestPlanInput {\n  readonly id?: string;\n  readonly key: string;\n  readonly version: string;\n  readonly tags?: readonly string[];\n  readonly provenance?: OpensteerRegistryProvenance;\n  readonly freshness?: OpensteerRequestPlanFreshness;\n  readonly payload: OpensteerRequestPlanPayload;\n}\n\nexport interface OpensteerGetRequestPlanInput {\n  readonly key: string;\n  readonly version?: string;\n}\n\nexport interface OpensteerListRequestPlansInput {\n  readonly key?: string;\n}\n\nexport interface OpensteerListRequestPlansOutput {\n  readonly plans: readonly OpensteerRequestPlanRecord[];\n}\n\nexport type OpensteerRequestScalarMap = Readonly<Record<string, OpensteerRequestScalar>>;\n\nexport interface OpensteerJsonRequestBodyInput {\n  readonly json: JsonValue;\n  readonly contentType?: string;\n}\n\nexport interface OpensteerTextRequestBodyInput {\n  readonly text: string;\n  readonly contentType?: string;\n}\n\nexport interface OpensteerBase64RequestBodyInput {\n  readonly base64: string;\n  readonly contentType?: string;\n}\n\nexport type OpensteerRequestBodyInput =\n  | OpensteerJsonRequestBodyInput\n  | OpensteerTextRequestBodyInput\n  | OpensteerBase64RequestBodyInput;\n\nexport interface OpensteerRequestExecuteInput {\n  readonly key: string;\n  readonly version?: string;\n  readonly pageRef?: PageRef;\n  readonly cookieJar?: string;\n  readonly params?: OpensteerRequestScalarMap;\n  readonly query?: OpensteerRequestScalarMap;\n  readonly headers?: OpensteerRequestScalarMap;\n  readonly bodyVars?: OpensteerRequestScalarMap;\n  readonly body?: OpensteerRequestBodyInput;\n  readonly validateResponse?: boolean;\n}\n\nexport interface OpensteerRawRequestInput {\n  readonly transport?: TransportKind;\n  readonly pageRef?: PageRef;\n  readonly cookieJar?: string;\n  readonly url: string;\n  readonly method?: string;\n  readonly headers?: readonly HeaderEntry[];\n  readonly body?: OpensteerRequestBodyInput;\n  readonly followRedirects?: boolean;\n}\n\nexport interface OpensteerRequestTransportResult {\n  readonly method: string;\n  readonly url: string;\n  readonly headers: readonly HeaderEntry[];\n  readonly body?: BodyPayload;\n}\n\nexport interface OpensteerRequestResponseResult {\n  readonly url: string;\n  readonly status: number;\n  readonly statusText: string;\n  readonly headers: readonly HeaderEntry[];\n  readonly body?: BodyPayload;\n  readonly redirected: boolean;\n}\n\nexport interface OpensteerRequestExecuteOutput {\n  readonly plan: {\n    readonly id: string;\n    readonly key: string;\n    readonly version: string;\n  };\n  readonly request: OpensteerRequestTransportResult;\n  readonly response: OpensteerRequestResponseResult;\n  readonly recovery?: {\n    readonly attempted: boolean;\n    readonly succeeded: boolean;\n    readonly matchedFailurePolicy?: boolean;\n  };\n  readonly data?: unknown;\n}\n\nexport interface OpensteerRawRequestOutput {\n  readonly recordId: string;\n  readonly request: OpensteerRequestTransportResult;\n  readonly response: OpensteerRequestResponseResult;\n  readonly data?: unknown;\n}\n\nexport interface OpensteerInferRequestPlanInput {\n  readonly recordId: string;\n  readonly key: string;\n  readonly version: string;\n  readonly transport?: TransportKind;\n}\n\nexport const opensteerRequestScalarSchema: JsonSchema = oneOfSchema(\n  [stringSchema(), { type: \"number\" }, { type: \"boolean\" }],\n  {\n    title: \"OpensteerRequestScalar\",\n  },\n);\n\nconst opensteerRequestScalarMapSchema: JsonSchema = recordSchema(opensteerRequestScalarSchema, {\n  title: \"OpensteerRequestScalarMap\",\n});\n\nexport const opensteerRequestEntrySchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema({ minLength: 1 }),\n    value: stringSchema(),\n  },\n  {\n    title: \"OpensteerRequestEntry\",\n    required: [\"name\", \"value\"],\n  },\n);\n\nexport const opensteerRequestPlanParameterLocationSchema: JsonSchema = enumSchema(\n  [\"path\", \"query\", \"header\"] as const,\n  {\n    title: \"OpensteerRequestParameterLocation\",\n  },\n);\n\nexport const opensteerRequestPlanParameterSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema({ minLength: 1 }),\n    in: opensteerRequestPlanParameterLocationSchema,\n    wireName: stringSchema({ minLength: 1 }),\n    required: { type: \"boolean\" },\n    description: stringSchema({ minLength: 1 }),\n    defaultValue: stringSchema(),\n  },\n  {\n    title: \"OpensteerRequestPlanParameter\",\n    required: [\"name\", \"in\"],\n  },\n);\n\nexport const opensteerRequestPlanTransportSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\n      \"direct-http\",\n      \"matched-tls\",\n      \"context-http\",\n      \"page-http\",\n      \"session-http\",\n    ] as const),\n    requiresBrowser: { type: \"boolean\" },\n    requireSameOrigin: { type: \"boolean\" },\n    cookieJar: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerRequestPlanTransport\",\n    required: [\"kind\"],\n  },\n);\n\nexport const opensteerRequestPlanEndpointSchema: JsonSchema = objectSchema(\n  {\n    method: stringSchema({ minLength: 1 }),\n    urlTemplate: stringSchema({ minLength: 1 }),\n    defaultQuery: arraySchema(opensteerRequestEntrySchema),\n    defaultHeaders: arraySchema(opensteerRequestEntrySchema),\n  },\n  {\n    title: \"OpensteerRequestPlanEndpoint\",\n    required: [\"method\", \"urlTemplate\"],\n  },\n);\n\nexport const opensteerRequestPlanBodySchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"json\", \"form\", \"text\"] as const),\n    contentType: stringSchema({ minLength: 1 }),\n    required: { type: \"boolean\" },\n    description: stringSchema({ minLength: 1 }),\n    template: defineSchema({\n      title: \"JsonValue\",\n    }),\n    fields: arraySchema(opensteerRequestEntrySchema),\n  },\n  {\n    title: \"OpensteerRequestPlanBody\",\n  },\n);\n\nexport const transportKindSchema: JsonSchema = enumSchema(\n  [\"direct-http\", \"matched-tls\", \"context-http\", \"page-http\", \"session-http\"] as const,\n  {\n    title: \"TransportKind\",\n  },\n);\n\nconst opensteerRequestPlanStatusSchema: JsonSchema = oneOfSchema(\n  [\n    integerSchema({ minimum: 100, maximum: 599 }),\n    arraySchema(integerSchema({ minimum: 100, maximum: 599 }), {\n      minItems: 1,\n      uniqueItems: true,\n    }),\n  ],\n  {\n    title: \"OpensteerRequestPlanResponseStatus\",\n  },\n);\n\nexport const opensteerRequestPlanResponseExpectationSchema: JsonSchema = objectSchema(\n  {\n    status: opensteerRequestPlanStatusSchema,\n    contentType: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerRequestPlanResponseExpectation\",\n    required: [\"status\"],\n  },\n);\n\nexport const opensteerRequestFailurePolicyHeaderMatchSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema({ minLength: 1 }),\n    valueIncludes: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerRequestFailurePolicyHeaderMatch\",\n    required: [\"name\", \"valueIncludes\"],\n  },\n);\n\nexport const opensteerRequestFailurePolicySchema: JsonSchema = objectSchema(\n  {\n    statusCodes: arraySchema(integerSchema({ minimum: 100, maximum: 599 }), {\n      minItems: 1,\n      uniqueItems: true,\n    }),\n    finalUrlIncludes: arraySchema(stringSchema({ minLength: 1 }), {\n      minItems: 1,\n      uniqueItems: true,\n    }),\n    responseHeaders: arraySchema(opensteerRequestFailurePolicyHeaderMatchSchema, {\n      minItems: 1,\n    }),\n    responseBodyIncludes: arraySchema(stringSchema({ minLength: 1 }), {\n      minItems: 1,\n      uniqueItems: true,\n    }),\n  },\n  {\n    title: \"OpensteerRequestFailurePolicy\",\n  },\n);\n\nexport const opensteerRequestRetryBackoffPolicySchema: JsonSchema = objectSchema(\n  {\n    strategy: enumSchema([\"fixed\", \"exponential\"] as const),\n    delayMs: integerSchema({ minimum: 0 }),\n    maxDelayMs: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerRequestRetryBackoffPolicy\",\n    required: [\"delayMs\"],\n  },\n);\n\nexport const opensteerRequestRetryPolicySchema: JsonSchema = objectSchema(\n  {\n    maxRetries: integerSchema({ minimum: 0 }),\n    backoff: opensteerRequestRetryBackoffPolicySchema,\n    respectRetryAfter: { type: \"boolean\" },\n    failurePolicy: opensteerRequestFailurePolicySchema,\n  },\n  {\n    title: \"OpensteerRequestRetryPolicy\",\n    required: [\"maxRetries\"],\n  },\n);\n\nexport const opensteerRequestPlanAuthSchema: JsonSchema = objectSchema(\n  {\n    strategy: enumSchema([\"session-cookie\", \"bearer-token\", \"api-key\", \"custom\"] as const),\n    failurePolicy: opensteerRequestFailurePolicySchema,\n    description: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerRequestPlanAuth\",\n    required: [\"strategy\"],\n  },\n);\n\nexport const opensteerRequestPlanPayloadSchema: JsonSchema = objectSchema(\n  {\n    transport: opensteerRequestPlanTransportSchema,\n    endpoint: opensteerRequestPlanEndpointSchema,\n    parameters: arraySchema(opensteerRequestPlanParameterSchema),\n    body: opensteerRequestPlanBodySchema,\n    response: opensteerRequestPlanResponseExpectationSchema,\n    retryPolicy: opensteerRequestRetryPolicySchema,\n    auth: opensteerRequestPlanAuthSchema,\n  },\n  {\n    title: \"OpensteerRequestPlanPayload\",\n    required: [\"transport\", \"endpoint\"],\n  },\n);\n\nexport const opensteerRegistryProvenanceSchema: JsonSchema = objectSchema(\n  {\n    source: stringSchema({ minLength: 1 }),\n    sourceId: stringSchema({ minLength: 1 }),\n    capturedAt: integerSchema({ minimum: 0 }),\n    notes: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerRegistryProvenance\",\n    required: [\"source\"],\n  },\n);\n\nexport const opensteerRequestPlanFreshnessSchema: JsonSchema = objectSchema(\n  {\n    lastValidatedAt: integerSchema({ minimum: 0 }),\n    staleAt: integerSchema({ minimum: 0 }),\n    expiresAt: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerRequestPlanFreshness\",\n  },\n);\n\nexport const opensteerRequestPlanRecordSchema: JsonSchema = objectSchema(\n  {\n    id: stringSchema({ minLength: 1 }),\n    key: stringSchema({ minLength: 1 }),\n    version: stringSchema({ minLength: 1 }),\n    createdAt: integerSchema({ minimum: 0 }),\n    updatedAt: integerSchema({ minimum: 0 }),\n    contentHash: stringSchema({ minLength: 1 }),\n    tags: arraySchema(stringSchema({ minLength: 1 }), {\n      uniqueItems: true,\n    }),\n    provenance: opensteerRegistryProvenanceSchema,\n    freshness: opensteerRequestPlanFreshnessSchema,\n    payload: opensteerRequestPlanPayloadSchema,\n  },\n  {\n    title: \"OpensteerRequestPlanRecord\",\n    required: [\"id\", \"key\", \"version\", \"createdAt\", \"updatedAt\", \"contentHash\", \"tags\", \"payload\"],\n  },\n);\n\nconst jsonValueSchema: JsonSchema = defineSchema({\n  title: \"JsonValue\",\n});\n\nexport const opensteerRequestBodyInputSchema: JsonSchema = oneOfSchema(\n  [\n    objectSchema(\n      {\n        json: jsonValueSchema,\n        contentType: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"OpensteerJsonRequestBodyInput\",\n        required: [\"json\"],\n      },\n    ),\n    objectSchema(\n      {\n        text: stringSchema(),\n        contentType: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"OpensteerTextRequestBodyInput\",\n        required: [\"text\"],\n      },\n    ),\n    objectSchema(\n      {\n        base64: stringSchema(),\n        contentType: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"OpensteerBase64RequestBodyInput\",\n        required: [\"base64\"],\n      },\n    ),\n  ],\n  {\n    title: \"OpensteerRequestBodyInput\",\n  },\n);\n\nexport const opensteerNetworkQueryInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    recordId: stringSchema({ minLength: 1 }),\n    requestId: stringSchema({ minLength: 1 }),\n    capture: stringSchema({ minLength: 1 }),\n    tag: stringSchema({ minLength: 1 }),\n    url: stringSchema({ minLength: 1 }),\n    hostname: stringSchema({ minLength: 1 }),\n    path: stringSchema({ minLength: 1 }),\n    method: stringSchema({ minLength: 1 }),\n    status: oneOfSchema([\n      integerSchema({ minimum: 100, maximum: 599 }),\n      stringSchema({ minLength: 1 }),\n    ]),\n    resourceType: networkResourceTypeSchema,\n    includeBodies: { type: \"boolean\" },\n    json: { type: \"boolean\" },\n    before: stringSchema({ minLength: 1 }),\n    after: stringSchema({ minLength: 1 }),\n    limit: integerSchema({ minimum: 1, maximum: 1000 }),\n  },\n  {\n    title: \"OpensteerNetworkQueryInput\",\n  },\n);\n\nconst opensteerGraphqlSummarySchema: JsonSchema = objectSchema(\n  {\n    operationType: enumSchema([\"query\", \"mutation\", \"subscription\", \"unknown\"] as const),\n    operationName: stringSchema({ minLength: 1 }),\n    persisted: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerGraphqlSummary\",\n  },\n);\n\nconst opensteerNetworkBodySummarySchema: JsonSchema = objectSchema(\n  {\n    bytes: integerSchema({ minimum: 0 }),\n    contentType: stringSchema({ minLength: 1 }),\n    streaming: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerNetworkBodySummary\",\n  },\n);\n\nexport const opensteerNetworkSummaryRecordSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    capture: stringSchema({ minLength: 1 }),\n    savedAt: integerSchema({ minimum: 0 }),\n    kind: enumSchema([\"http\", \"websocket\", \"event-stream\"] as const),\n    method: stringSchema({ minLength: 1 }),\n    status: integerSchema({ minimum: 100, maximum: 599 }),\n    resourceType: networkResourceTypeSchema,\n    url: stringSchema({ minLength: 1 }),\n    request: opensteerNetworkBodySummarySchema,\n    response: opensteerNetworkBodySummarySchema,\n    graphql: opensteerGraphqlSummarySchema,\n    websocket: objectSchema(\n      {\n        subprotocol: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"OpensteerWebsocketSummary\",\n      },\n    ),\n  },\n  {\n    title: \"OpensteerNetworkSummaryRecord\",\n    required: [\"recordId\", \"kind\", \"method\", \"resourceType\", \"url\"],\n  },\n);\n\nexport const opensteerNetworkQueryOutputSchema: JsonSchema = objectSchema(\n  {\n    records: arraySchema(opensteerNetworkSummaryRecordSchema),\n  },\n  {\n    title: \"OpensteerNetworkQueryOutput\",\n    required: [\"records\"],\n  },\n);\n\nexport const opensteerNetworkDetailInputSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    probe: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerNetworkDetailInput\",\n    required: [\"recordId\"],\n  },\n);\n\nconst opensteerParsedCookieSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema({ minLength: 1 }),\n    value: stringSchema(),\n  },\n  {\n    title: \"OpensteerParsedCookie\",\n    required: [\"name\", \"value\"],\n  },\n);\n\nconst opensteerStructuredBodyPreviewSchema: JsonSchema = objectSchema(\n  {\n    contentType: stringSchema({ minLength: 1 }),\n    bytes: integerSchema({ minimum: 0 }),\n    truncated: { type: \"boolean\" },\n    data: oneOfSchema([jsonValueSchema, stringSchema()]),\n    note: stringSchema(),\n  },\n  {\n    title: \"OpensteerStructuredBodyPreview\",\n    required: [\"bytes\", \"truncated\"],\n  },\n);\n\nconst opensteerNetworkRedirectHopSchema: JsonSchema = objectSchema(\n  {\n    method: stringSchema({ minLength: 1 }),\n    status: integerSchema({ minimum: 100, maximum: 599 }),\n    url: stringSchema({ minLength: 1 }),\n    location: stringSchema({ minLength: 1 }),\n    setCookie: arraySchema(stringSchema()),\n  },\n  {\n    title: \"OpensteerNetworkRedirectHop\",\n    required: [\"method\", \"url\"],\n  },\n);\n\nconst opensteerReplayAttemptSchema: JsonSchema = objectSchema(\n  {\n    transport: transportKindSchema,\n    status: integerSchema({ minimum: 100, maximum: 599 }),\n    ok: { type: \"boolean\" },\n    durationMs: integerSchema({ minimum: 0 }),\n    note: stringSchema(),\n    error: stringSchema(),\n  },\n  {\n    title: \"OpensteerReplayAttempt\",\n    required: [\"transport\", \"ok\", \"durationMs\"],\n  },\n);\n\nexport const opensteerNetworkDetailOutputSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    capture: stringSchema({ minLength: 1 }),\n    savedAt: integerSchema({ minimum: 0 }),\n    summary: opensteerNetworkSummaryRecordSchema,\n    requestHeaders: arraySchema(headerEntrySchema),\n    responseHeaders: arraySchema(headerEntrySchema),\n    cookiesSent: arraySchema(opensteerParsedCookieSchema),\n    requestBody: opensteerStructuredBodyPreviewSchema,\n    responseBody: opensteerStructuredBodyPreviewSchema,\n    graphql: objectSchema(\n      {\n        operationType: enumSchema([\"query\", \"mutation\", \"subscription\", \"unknown\"] as const),\n        operationName: stringSchema({ minLength: 1 }),\n        persisted: { type: \"boolean\" },\n        variables: jsonValueSchema,\n      },\n      {\n        title: \"OpensteerGraphqlDetail\",\n      },\n    ),\n    redirectChain: arraySchema(opensteerNetworkRedirectHopSchema),\n    notes: arraySchema(stringSchema()),\n    transportProbe: objectSchema(\n      {\n        recommended: transportKindSchema,\n        attempts: arraySchema(opensteerReplayAttemptSchema),\n      },\n      {\n        title: \"OpensteerTransportProbeResult\",\n        required: [\"attempts\"],\n      },\n    ),\n  },\n  {\n    title: \"OpensteerNetworkDetailOutput\",\n    required: [\"recordId\", \"summary\", \"requestHeaders\", \"responseHeaders\"],\n  },\n);\n\nexport const opensteerNetworkReplayInputSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    pageRef: pageRefSchema,\n    query: opensteerRequestScalarMapSchema,\n    headers: opensteerRequestScalarMapSchema,\n    body: opensteerRequestBodyInputSchema,\n    variables: jsonValueSchema,\n  },\n  {\n    title: \"OpensteerNetworkReplayInput\",\n    required: [\"recordId\"],\n  },\n);\n\nexport let opensteerNetworkReplayOutputSchema: JsonSchema;\n\nconst opensteerSessionFetchTransportSchema: JsonSchema = enumSchema(\n  [\"auto\", \"direct\", \"matched-tls\", \"context\", \"page\"] as const,\n  {\n    title: \"OpensteerSessionFetchTransport\",\n  },\n);\n\nexport const opensteerSessionFetchInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    url: stringSchema({ minLength: 1 }),\n    method: stringSchema({ minLength: 1 }),\n    query: opensteerRequestScalarMapSchema,\n    headers: opensteerRequestScalarMapSchema,\n    body: opensteerRequestBodyInputSchema,\n    transport: opensteerSessionFetchTransportSchema,\n    cookies: { type: \"boolean\" },\n    followRedirects: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerSessionFetchInput\",\n    required: [\"url\"],\n  },\n);\n\nexport let opensteerSessionFetchOutputSchema: JsonSchema;\n\nexport const opensteerCookieQueryInputSchema: JsonSchema = objectSchema(\n  {\n    domain: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerCookieQueryInput\",\n  },\n);\n\nexport const opensteerCookieQueryOutputSchema: JsonSchema = objectSchema(\n  {\n    domain: stringSchema({ minLength: 1 }),\n    cookies: arraySchema(cookieRecordSchema),\n  },\n  {\n    title: \"OpensteerCookieQueryOutput\",\n    required: [\"cookies\"],\n  },\n);\n\nconst opensteerStorageDomainSnapshotSchema: JsonSchema = objectSchema(\n  {\n    domain: stringSchema({ minLength: 1 }),\n    localStorage: arraySchema(storageEntrySchema),\n    sessionStorage: arraySchema(storageEntrySchema),\n  },\n  {\n    title: \"OpensteerStorageDomainSnapshot\",\n    required: [\"domain\", \"localStorage\", \"sessionStorage\"],\n  },\n);\n\nexport const opensteerStorageQueryInputSchema: JsonSchema = objectSchema(\n  {\n    domain: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerStorageQueryInput\",\n  },\n);\n\nexport const opensteerStorageQueryOutputSchema: JsonSchema = objectSchema(\n  {\n    domains: arraySchema(opensteerStorageDomainSnapshotSchema),\n  },\n  {\n    title: \"OpensteerStorageQueryOutput\",\n    required: [\"domains\"],\n  },\n);\n\nconst opensteerHiddenFieldSchema: JsonSchema = objectSchema(\n  {\n    path: stringSchema({ minLength: 1 }),\n    name: stringSchema({ minLength: 1 }),\n    value: stringSchema(),\n  },\n  {\n    title: \"OpensteerHiddenField\",\n    required: [\"path\", \"name\", \"value\"],\n  },\n);\n\nconst opensteerStateDomainSnapshotSchema: JsonSchema = objectSchema(\n  {\n    domain: stringSchema({ minLength: 1 }),\n    cookies: arraySchema(cookieRecordSchema),\n    hiddenFields: arraySchema(opensteerHiddenFieldSchema),\n    localStorage: arraySchema(storageEntrySchema),\n    sessionStorage: arraySchema(storageEntrySchema),\n    globals: recordSchema(jsonValueSchema),\n  },\n  {\n    title: \"OpensteerStateDomainSnapshot\",\n    required: [\"domain\", \"cookies\", \"hiddenFields\", \"localStorage\", \"sessionStorage\"],\n  },\n);\n\nexport const opensteerStateQueryInputSchema: JsonSchema = objectSchema(\n  {\n    domain: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerStateQueryInput\",\n  },\n);\n\nexport const opensteerStateQueryOutputSchema: JsonSchema = objectSchema(\n  {\n    domains: arraySchema(opensteerStateDomainSnapshotSchema),\n  },\n  {\n    title: \"OpensteerStateQueryOutput\",\n    required: [\"domains\"],\n  },\n);\n\nexport const opensteerNetworkTagInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    recordId: stringSchema({ minLength: 1 }),\n    requestId: stringSchema({ minLength: 1 }),\n    capture: stringSchema({ minLength: 1 }),\n    tag: stringSchema({ minLength: 1 }),\n    url: stringSchema({ minLength: 1 }),\n    hostname: stringSchema({ minLength: 1 }),\n    path: stringSchema({ minLength: 1 }),\n    method: stringSchema({ minLength: 1 }),\n    status: stringSchema({ minLength: 1 }),\n    resourceType: networkResourceTypeSchema,\n  },\n  {\n    title: \"OpensteerNetworkTagInput\",\n    required: [\"tag\"],\n  },\n);\n\nexport const opensteerNetworkTagOutputSchema: JsonSchema = objectSchema(\n  {\n    taggedCount: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerNetworkTagOutput\",\n    required: [\"taggedCount\"],\n  },\n);\n\nexport const opensteerNetworkClearInputSchema: JsonSchema = objectSchema(\n  {\n    capture: stringSchema({ minLength: 1 }),\n    tag: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerNetworkClearInput\",\n  },\n);\n\nexport const opensteerNetworkClearOutputSchema: JsonSchema = objectSchema(\n  {\n    clearedCount: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerNetworkClearOutput\",\n    required: [\"clearedCount\"],\n  },\n);\n\nexport const opensteerWriteRequestPlanInputSchema: JsonSchema = objectSchema(\n  {\n    id: stringSchema({ minLength: 1 }),\n    key: stringSchema({ minLength: 1 }),\n    version: stringSchema({ minLength: 1 }),\n    tags: arraySchema(stringSchema({ minLength: 1 }), {\n      uniqueItems: true,\n    }),\n    provenance: opensteerRegistryProvenanceSchema,\n    freshness: opensteerRequestPlanFreshnessSchema,\n    payload: opensteerRequestPlanPayloadSchema,\n  },\n  {\n    title: \"OpensteerWriteRequestPlanInput\",\n    required: [\"key\", \"version\", \"payload\"],\n  },\n);\n\nexport const opensteerGetRequestPlanInputSchema: JsonSchema = objectSchema(\n  {\n    key: stringSchema({ minLength: 1 }),\n    version: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerGetRequestPlanInput\",\n    required: [\"key\"],\n  },\n);\n\nexport const opensteerListRequestPlansInputSchema: JsonSchema = objectSchema(\n  {\n    key: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerListRequestPlansInput\",\n  },\n);\n\nexport const opensteerListRequestPlansOutputSchema: JsonSchema = objectSchema(\n  {\n    plans: arraySchema(opensteerRequestPlanRecordSchema),\n  },\n  {\n    title: \"OpensteerListRequestPlansOutput\",\n    required: [\"plans\"],\n  },\n);\n\nexport const opensteerRequestExecuteInputSchema: JsonSchema = objectSchema(\n  {\n    key: stringSchema({ minLength: 1 }),\n    version: stringSchema({ minLength: 1 }),\n    pageRef: pageRefSchema,\n    cookieJar: stringSchema({ minLength: 1 }),\n    params: opensteerRequestScalarMapSchema,\n    query: opensteerRequestScalarMapSchema,\n    headers: opensteerRequestScalarMapSchema,\n    bodyVars: opensteerRequestScalarMapSchema,\n    body: opensteerRequestBodyInputSchema,\n    validateResponse: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerRequestExecuteInput\",\n    required: [\"key\"],\n  },\n);\n\nexport const opensteerRawRequestInputSchema: JsonSchema = objectSchema(\n  {\n    transport: transportKindSchema,\n    pageRef: pageRefSchema,\n    cookieJar: stringSchema({ minLength: 1 }),\n    url: stringSchema({ minLength: 1 }),\n    method: stringSchema({ minLength: 1 }),\n    headers: arraySchema(headerEntrySchema),\n    body: opensteerRequestBodyInputSchema,\n    followRedirects: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerRawRequestInput\",\n    required: [\"url\"],\n  },\n);\n\nexport const opensteerRequestTransportResultSchema: JsonSchema = objectSchema(\n  {\n    method: stringSchema({ minLength: 1 }),\n    url: stringSchema({ minLength: 1 }),\n    headers: arraySchema(headerEntrySchema),\n    body: bodyPayloadSchema,\n  },\n  {\n    title: \"OpensteerRequestTransportResult\",\n    required: [\"method\", \"url\", \"headers\"],\n  },\n);\n\nexport const opensteerRequestResponseResultSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema({ minLength: 1 }),\n    status: integerSchema({ minimum: 100, maximum: 599 }),\n    statusText: stringSchema(),\n    headers: arraySchema(headerEntrySchema),\n    body: bodyPayloadSchema,\n    redirected: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerRequestResponseResult\",\n    required: [\"url\", \"status\", \"statusText\", \"headers\", \"redirected\"],\n  },\n);\n\nopensteerNetworkReplayOutputSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    transport: transportKindSchema,\n    attempts: arraySchema(opensteerReplayAttemptSchema),\n    response: opensteerRequestResponseResultSchema,\n    data: oneOfSchema([jsonValueSchema, stringSchema()]),\n    note: stringSchema(),\n  },\n  {\n    title: \"OpensteerNetworkReplayOutput\",\n    required: [\"recordId\", \"attempts\"],\n  },\n);\n\nopensteerSessionFetchOutputSchema = objectSchema(\n  {\n    transport: transportKindSchema,\n    attempts: arraySchema(opensteerReplayAttemptSchema),\n    response: opensteerRequestResponseResultSchema,\n    data: oneOfSchema([jsonValueSchema, stringSchema()]),\n    note: stringSchema(),\n  },\n  {\n    title: \"OpensteerSessionFetchOutput\",\n    required: [\"attempts\"],\n  },\n);\n\nexport const opensteerRequestExecuteOutputSchema: JsonSchema = objectSchema(\n  {\n    plan: objectSchema(\n      {\n        id: stringSchema({ minLength: 1 }),\n        key: stringSchema({ minLength: 1 }),\n        version: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"OpensteerResolvedRequestPlanRef\",\n        required: [\"id\", \"key\", \"version\"],\n      },\n    ),\n    request: opensteerRequestTransportResultSchema,\n    response: opensteerRequestResponseResultSchema,\n    recovery: objectSchema(\n      {\n        attempted: { type: \"boolean\" },\n        succeeded: { type: \"boolean\" },\n        matchedFailurePolicy: { type: \"boolean\" },\n      },\n      {\n        title: \"OpensteerRequestRecoveryMetadata\",\n        required: [\"attempted\", \"succeeded\"],\n      },\n    ),\n    data: jsonValueSchema,\n  },\n  {\n    title: \"OpensteerRequestExecuteOutput\",\n    required: [\"plan\", \"request\", \"response\"],\n  },\n);\n\nexport const opensteerRawRequestOutputSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    request: opensteerRequestTransportResultSchema,\n    response: opensteerRequestResponseResultSchema,\n    data: jsonValueSchema,\n  },\n  {\n    title: \"OpensteerRawRequestOutput\",\n    required: [\"recordId\", \"request\", \"response\"],\n  },\n);\n\nexport const opensteerInferRequestPlanInputSchema: JsonSchema = objectSchema(\n  {\n    recordId: stringSchema({ minLength: 1 }),\n    key: stringSchema({ minLength: 1 }),\n    version: stringSchema({ minLength: 1 }),\n    transport: transportKindSchema,\n  },\n  {\n    title: \"OpensteerInferRequestPlanInput\",\n    required: [\"recordId\", \"key\", \"version\"],\n  },\n);\n","import type { JsonSchema } from \"./json.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  oneOfSchema,\n  recordSchema,\n  stringSchema,\n} from \"./json.js\";\nimport { pageRefSchema, type PageRef } from \"./identity.js\";\nimport { storageSnapshotSchema, type StorageSnapshot } from \"./storage.js\";\n\nexport interface OpensteerStateSnapshot {\n  readonly id: string;\n  readonly capturedAt: number;\n  readonly pageRef?: PageRef;\n  readonly url?: string;\n  readonly cookies?: readonly {\n    readonly name: string;\n    readonly value: string;\n    readonly domain: string;\n    readonly path: string;\n    readonly secure: boolean;\n    readonly httpOnly: boolean;\n    readonly sameSite?: \"strict\" | \"lax\" | \"none\";\n    readonly priority?: \"low\" | \"medium\" | \"high\";\n    readonly partitionKey?: string;\n    readonly session: boolean;\n    readonly expiresAt?: number | null;\n  }[];\n  readonly storage?: StorageSnapshot;\n  readonly hiddenFields?: readonly {\n    readonly path: string;\n    readonly name: string;\n    readonly value: string;\n  }[];\n  readonly globals?: Readonly<Record<string, unknown>>;\n}\n\nexport interface OpensteerStateDelta {\n  readonly beforeStateId?: string;\n  readonly afterStateId?: string;\n  readonly cookiesChanged: readonly string[];\n  readonly storageChanged: readonly string[];\n  readonly hiddenFieldsChanged: readonly string[];\n  readonly globalsChanged: readonly string[];\n}\n\nconst opensteerStateSnapshotCookieSchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema({ minLength: 1 }),\n    value: stringSchema(),\n    domain: stringSchema({ minLength: 1 }),\n    path: stringSchema({ minLength: 1 }),\n    secure: { type: \"boolean\" },\n    httpOnly: { type: \"boolean\" },\n    sameSite: enumSchema([\"strict\", \"lax\", \"none\"] as const),\n    priority: enumSchema([\"low\", \"medium\", \"high\"] as const),\n    partitionKey: stringSchema({ minLength: 1 }),\n    session: { type: \"boolean\" },\n    expiresAt: oneOfSchema([integerSchema({ minimum: 0 }), { type: \"null\" }]),\n  },\n  {\n    title: \"OpensteerStateSnapshotCookie\",\n    required: [\"name\", \"value\", \"domain\", \"path\", \"secure\", \"httpOnly\", \"session\"],\n  },\n);\n\nexport const opensteerStateSnapshotSchema: JsonSchema = objectSchema(\n  {\n    id: stringSchema({ minLength: 1 }),\n    capturedAt: integerSchema({ minimum: 0 }),\n    pageRef: pageRefSchema,\n    url: stringSchema({ minLength: 1 }),\n    cookies: arraySchema(opensteerStateSnapshotCookieSchema),\n    storage: storageSnapshotSchema,\n    hiddenFields: arraySchema(\n      objectSchema(\n        {\n          path: stringSchema({ minLength: 1 }),\n          name: stringSchema({ minLength: 1 }),\n          value: stringSchema(),\n        },\n        {\n          title: \"OpensteerStateSnapshotHiddenField\",\n          required: [\"path\", \"name\", \"value\"],\n        },\n      ),\n    ),\n    globals: recordSchema({}, { title: \"OpensteerStateSnapshotGlobals\" }),\n  },\n  {\n    title: \"OpensteerStateSnapshot\",\n    required: [\"id\", \"capturedAt\"],\n  },\n);\n\nexport const opensteerStateDeltaSchema: JsonSchema = objectSchema(\n  {\n    beforeStateId: stringSchema({ minLength: 1 }),\n    afterStateId: stringSchema({ minLength: 1 }),\n    cookiesChanged: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n    storageChanged: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n    hiddenFieldsChanged: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n    globalsChanged: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n  },\n  {\n    title: \"OpensteerStateDelta\",\n    required: [\"cookiesChanged\", \"storageChanged\", \"hiddenFieldsChanged\", \"globalsChanged\"],\n  },\n);\n","export type {\n  ScreenshotFormat,\n  HtmlSnapshot,\n  DomSnapshotNode,\n  ShadowDomSnapshotMode,\n  DomSnapshot,\n  HitTestResult,\n} from \"@opensteer/browser-core\";\n\nexport { findDomSnapshotNode, findDomSnapshotNodeByRef } from \"@opensteer/browser-core\";\n\nimport type { DocumentEpoch, DocumentRef, FrameRef, PageRef } from \"./identity.js\";\nimport {\n  documentEpochSchema,\n  documentRefSchema,\n  frameRefSchema,\n  nodeRefSchema,\n  pageRefSchema,\n} from \"./identity.js\";\nimport type { ExternalBinaryLocation } from \"./binary-location.js\";\nimport { externalBinaryLocationSchema } from \"./binary-location.js\";\nimport type { CoordinateSpace, Rect, Size } from \"./geometry.js\";\nimport {\n  coordinateSpaceSchema,\n  pointSchema,\n  quadSchema,\n  rectSchema,\n  sizeSchema,\n} from \"./geometry.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\n\nexport interface ScreenshotArtifact {\n  readonly pageRef: PageRef;\n  readonly frameRef?: FrameRef;\n  readonly documentRef?: DocumentRef;\n  readonly documentEpoch?: DocumentEpoch;\n  readonly payload: ExternalBinaryLocation;\n  readonly format: \"png\" | \"jpeg\" | \"webp\";\n  readonly size: Size;\n  readonly coordinateSpace: CoordinateSpace;\n  readonly clip?: Rect;\n}\n\nexport const screenshotFormatSchema: JsonSchema = enumSchema([\"png\", \"jpeg\", \"webp\"] as const, {\n  title: \"ScreenshotFormat\",\n});\n\nexport const screenshotArtifactSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    payload: externalBinaryLocationSchema,\n    format: screenshotFormatSchema,\n    size: sizeSchema,\n    coordinateSpace: coordinateSpaceSchema,\n    clip: rectSchema,\n  },\n  {\n    title: \"ScreenshotArtifact\",\n    required: [\"pageRef\", \"payload\", \"format\", \"size\", \"coordinateSpace\"],\n  },\n);\n\nexport const htmlSnapshotSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    url: stringSchema(),\n    capturedAt: integerSchema({ minimum: 0 }),\n    html: stringSchema(),\n  },\n  {\n    title: \"HtmlSnapshot\",\n    required: [\"pageRef\", \"frameRef\", \"documentRef\", \"documentEpoch\", \"url\", \"capturedAt\", \"html\"],\n  },\n);\n\nexport const domSnapshotNodeSchema: JsonSchema = objectSchema(\n  {\n    snapshotNodeId: integerSchema({ minimum: 0 }),\n    nodeRef: nodeRefSchema,\n    parentSnapshotNodeId: integerSchema({ minimum: 0 }),\n    childSnapshotNodeIds: arraySchema(integerSchema({ minimum: 0 })),\n    shadowRootType: enumSchema([\"open\", \"closed\", \"user-agent\"] as const),\n    shadowHostNodeRef: nodeRefSchema,\n    contentDocumentRef: documentRefSchema,\n    nodeType: integerSchema({ minimum: 0 }),\n    nodeName: stringSchema(),\n    nodeValue: stringSchema(),\n    textContent: stringSchema(),\n    computedStyle: objectSchema(\n      {\n        display: stringSchema(),\n        visibility: stringSchema(),\n        opacity: stringSchema(),\n        position: stringSchema(),\n        cursor: stringSchema(),\n        overflowX: stringSchema(),\n        overflowY: stringSchema(),\n      },\n      {\n        required: [],\n      },\n    ),\n    attributes: arraySchema(\n      objectSchema(\n        {\n          name: stringSchema(),\n          value: stringSchema(),\n        },\n        {\n          required: [\"name\", \"value\"],\n        },\n      ),\n    ),\n    layout: objectSchema(\n      {\n        rect: rectSchema,\n        quad: quadSchema,\n        paintOrder: integerSchema({ minimum: 0 }),\n      },\n      {\n        required: [],\n      },\n    ),\n  },\n  {\n    title: \"DomSnapshotNode\",\n    required: [\n      \"snapshotNodeId\",\n      \"childSnapshotNodeIds\",\n      \"nodeType\",\n      \"nodeName\",\n      \"nodeValue\",\n      \"attributes\",\n    ],\n  },\n);\n\nexport const shadowDomSnapshotModeSchema: JsonSchema = enumSchema(\n  [\"flattened\", \"preserved\", \"unsupported\"] as const,\n  {\n    title: \"ShadowDomSnapshotMode\",\n  },\n);\n\nexport const domSnapshotSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    parentDocumentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    url: stringSchema(),\n    capturedAt: integerSchema({ minimum: 0 }),\n    rootSnapshotNodeId: integerSchema({ minimum: 0 }),\n    shadowDomMode: shadowDomSnapshotModeSchema,\n    geometryCoordinateSpace: coordinateSpaceSchema,\n    nodes: arraySchema(domSnapshotNodeSchema),\n  },\n  {\n    title: \"DomSnapshot\",\n    required: [\n      \"pageRef\",\n      \"frameRef\",\n      \"documentRef\",\n      \"documentEpoch\",\n      \"url\",\n      \"capturedAt\",\n      \"rootSnapshotNodeId\",\n      \"shadowDomMode\",\n      \"nodes\",\n    ],\n  },\n);\n\nexport const hitTestResultSchema: JsonSchema = objectSchema(\n  {\n    inputPoint: pointSchema,\n    inputCoordinateSpace: coordinateSpaceSchema,\n    resolvedPoint: pointSchema,\n    resolvedCoordinateSpace: coordinateSpaceSchema,\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    nodeRef: nodeRefSchema,\n    targetQuad: quadSchema,\n    obscured: {\n      type: \"boolean\",\n    },\n    pointerEventsSkipped: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"HitTestResult\",\n    required: [\n      \"inputPoint\",\n      \"inputCoordinateSpace\",\n      \"resolvedPoint\",\n      \"resolvedCoordinateSpace\",\n      \"pageRef\",\n      \"frameRef\",\n      \"documentRef\",\n      \"documentEpoch\",\n      \"obscured\",\n      \"pointerEventsSkipped\",\n    ],\n  },\n);\n","import { arraySchema, enumSchema, objectSchema, stringSchema, type JsonSchema } from \"./json.js\";\n\nexport const opensteerCapabilities = [\n  \"sessions.manage\",\n  \"pages.manage\",\n  \"pages.navigate\",\n  \"input.pointer\",\n  \"input.keyboard\",\n  \"input.touch\",\n  \"artifacts.screenshot\",\n  \"execution.pause\",\n  \"execution.resume\",\n  \"execution.freeze\",\n  \"inspect.pages\",\n  \"inspect.frames\",\n  \"inspect.html\",\n  \"inspect.domSnapshot\",\n  \"inspect.text\",\n  \"inspect.attributes\",\n  \"inspect.hitTest\",\n  \"inspect.viewportMetrics\",\n  \"inspect.network\",\n  \"inspect.networkBodies\",\n  \"inspect.cookies\",\n  \"inspect.localStorage\",\n  \"inspect.sessionStorage\",\n  \"inspect.indexedDb\",\n  \"transport.sessionHttp\",\n  \"instrumentation.initScripts\",\n  \"instrumentation.routing\",\n  \"events.pageLifecycle\",\n  \"events.dialog\",\n  \"events.download\",\n  \"events.chooser\",\n  \"events.worker\",\n  \"events.console\",\n  \"events.pageError\",\n  \"events.websocket\",\n  \"events.eventStream\",\n  \"events.executionState\",\n  \"surface.rest\",\n  \"surface.mcp\",\n] as const;\n\nexport type OpensteerCapability = (typeof opensteerCapabilities)[number];\n\nexport interface OpensteerCapabilityDescriptor {\n  readonly key: OpensteerCapability;\n  readonly description: string;\n  readonly stability: \"stable\" | \"experimental\";\n}\n\nexport const opensteerCapabilityDescriptors: readonly OpensteerCapabilityDescriptor[] = [\n  {\n    key: \"sessions.manage\",\n    description: \"Create and close isolated browser sessions.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"pages.manage\",\n    description: \"Create, close, and activate top-level browsing contexts.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"pages.navigate\",\n    description: \"Navigate, reload, and traverse session history.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"input.pointer\",\n    description: \"Inject pointer movement, click, and wheel input.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"input.keyboard\",\n    description: \"Inject key presses and raw text input.\",\n    stability: \"stable\",\n  },\n  { key: \"input.touch\", description: \"Inject touch or gesture input.\", stability: \"experimental\" },\n  {\n    key: \"artifacts.screenshot\",\n    description: \"Capture browser-rendered screenshots as evidence artifacts.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"execution.pause\",\n    description: \"Pause active page execution between protocol steps.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"execution.resume\",\n    description: \"Resume previously paused page execution.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"execution.freeze\",\n    description: \"Freeze timers or script execution at the engine boundary.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.pages\",\n    description: \"Enumerate pages and read page metadata.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.frames\",\n    description: \"Enumerate frames and read frame metadata.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.html\",\n    description: \"Read raw HTML snapshots without selector semantics.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.domSnapshot\",\n    description: \"Read structured DOM snapshots with node bindings.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.text\",\n    description: \"Read raw text from a specific node binding.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.attributes\",\n    description: \"Read ordered attributes from a specific node binding.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.hitTest\",\n    description: \"Resolve a point into the browser's current DOM target.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.viewportMetrics\",\n    description: \"Read viewport and scroll geometry.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.network\",\n    description: \"Read normalized network records without mutating traffic.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.networkBodies\",\n    description: \"Expose captured request and response bodies in network records.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.cookies\",\n    description: \"Read browser cookie state through the session boundary.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.localStorage\",\n    description: \"Read localStorage state through the session boundary.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.sessionStorage\",\n    description: \"Read sessionStorage state through the session boundary.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"inspect.indexedDb\",\n    description: \"Read IndexedDB state through the session boundary.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"transport.sessionHttp\",\n    description: \"Execute HTTP requests inside the live browser session boundary.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"instrumentation.initScripts\",\n    description: \"Inject scripts before page scripts execute inside a browser session.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"instrumentation.routing\",\n    description: \"Intercept, continue, replace, or abort browser network requests.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"events.pageLifecycle\",\n    description: \"Emit normalized page and popup lifecycle events.\",\n    stability: \"stable\",\n  },\n  { key: \"events.dialog\", description: \"Emit dialog lifecycle events.\", stability: \"stable\" },\n  { key: \"events.download\", description: \"Emit download lifecycle events.\", stability: \"stable\" },\n  {\n    key: \"events.chooser\",\n    description: \"Emit file chooser and select picker events.\",\n    stability: \"stable\",\n  },\n  { key: \"events.worker\", description: \"Emit worker lifecycle events.\", stability: \"experimental\" },\n  {\n    key: \"events.console\",\n    description: \"Emit normalized console log events.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"events.pageError\",\n    description: \"Emit page-level uncaught error events.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"events.websocket\",\n    description: \"Emit websocket open, frame, and close events.\",\n    stability: \"experimental\",\n  },\n  {\n    key: \"events.eventStream\",\n    description: \"Emit server-sent event stream messages.\",\n    stability: \"experimental\",\n  },\n  {\n    key: \"events.executionState\",\n    description: \"Emit pause, resume, and frozen execution events.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"surface.rest\",\n    description: \"Expose the protocol over the canonical REST transport.\",\n    stability: \"stable\",\n  },\n  {\n    key: \"surface.mcp\",\n    description: \"Expose the protocol over Model Context Protocol tools.\",\n    stability: \"stable\",\n  },\n] as const;\n\nexport const opensteerCapabilitySchema: JsonSchema = enumSchema(opensteerCapabilities, {\n  title: \"OpensteerCapability\",\n});\n\nexport const opensteerCapabilitySetSchema: JsonSchema = arraySchema(opensteerCapabilitySchema, {\n  title: \"OpensteerCapabilitySet\",\n  uniqueItems: true,\n});\n\nexport const opensteerCapabilityDescriptorSchema: JsonSchema = objectSchema(\n  {\n    key: opensteerCapabilitySchema,\n    description: stringSchema(),\n    stability: enumSchema([\"stable\", \"experimental\"] as const),\n  },\n  {\n    title: \"OpensteerCapabilityDescriptor\",\n    required: [\"key\", \"description\", \"stability\"],\n  },\n);\n\nexport const opensteerCapabilityDescriptorListSchema: JsonSchema = arraySchema(\n  opensteerCapabilityDescriptorSchema,\n  {\n    title: \"OpensteerCapabilityDescriptorList\",\n    uniqueItems: true,\n  },\n);\n\nexport function hasCapability(\n  capabilities: readonly OpensteerCapability[],\n  capability: OpensteerCapability,\n): boolean {\n  return capabilities.includes(capability);\n}\n","import type { CookieRecord } from \"@opensteer/browser-core\";\n\nexport const cloudActionMethods = [\n  \"goto\",\n  \"snapshot\",\n  \"screenshot\",\n  \"state\",\n  \"click\",\n  \"dblclick\",\n  \"rightclick\",\n  \"hover\",\n  \"input\",\n  \"select\",\n  \"scroll\",\n  \"tabs\",\n  \"newTab\",\n  \"switchTab\",\n  \"closeTab\",\n  \"getCookies\",\n  \"setCookie\",\n  \"clearCookies\",\n  \"pressKey\",\n  \"type\",\n  \"getElementText\",\n  \"getElementValue\",\n  \"getElementAttributes\",\n  \"getElementBoundingBox\",\n  \"getHtml\",\n  \"getTitle\",\n  \"uploadFile\",\n  \"exportCookies\",\n  \"importCookies\",\n  \"waitForText\",\n  \"extract\",\n  \"extractFromPlan\",\n  \"clearCache\",\n] as const;\n\nexport type CloudActionMethod = (typeof cloudActionMethods)[number];\n\nexport const cloudErrorCodes = [\n  \"CLOUD_AUTH_FAILED\",\n  \"CLOUD_SESSION_NOT_FOUND\",\n  \"CLOUD_ARTIFACT_NOT_FOUND\",\n  \"CLOUD_SESSION_CLOSED\",\n  \"CLOUD_UNSUPPORTED_METHOD\",\n  \"CLOUD_INVALID_REQUEST\",\n  \"CLOUD_MODEL_NOT_ALLOWED\",\n  \"CLOUD_ACTION_FAILED\",\n  \"CLOUD_CAPACITY_EXHAUSTED\",\n  \"CLOUD_RUNTIME_UNAVAILABLE\",\n  \"CLOUD_RUNTIME_MISMATCH\",\n  \"CLOUD_SESSION_STALE\",\n  \"CLOUD_CONTROL_PLANE_ERROR\",\n  \"CLOUD_CONTRACT_MISMATCH\",\n  \"CLOUD_PROXY_UNAVAILABLE\",\n  \"CLOUD_PROXY_REQUIRED\",\n  \"CLOUD_BILLING_LIMIT_REACHED\",\n  \"CLOUD_PLAN_RESTRICTED\",\n  \"CLOUD_RATE_LIMITED\",\n  \"CLOUD_BROWSER_PROFILE_NOT_FOUND\",\n  \"CLOUD_BROWSER_PROFILE_BUSY\",\n  \"CLOUD_BROWSER_PROFILE_DISABLED\",\n  \"CLOUD_BROWSER_PROFILE_NOT_READY\",\n  \"CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE\",\n  \"CLOUD_BROWSER_PROFILE_SYNC_FAILED\",\n  \"CLOUD_INTERNAL\",\n] as const;\n\nexport type CloudErrorCode = (typeof cloudErrorCodes)[number];\n\nexport const cloudSessionStatuses = [\n  \"provisioning\",\n  \"active\",\n  \"closing\",\n  \"closed\",\n  \"failed\",\n] as const;\n\nexport type CloudSessionStatus = (typeof cloudSessionStatuses)[number];\n\nexport const cloudSessionRecordingStatuses = [\"idle\", \"recording\", \"completed\", \"failed\"] as const;\n\nexport type CloudSessionRecordingStatus = (typeof cloudSessionRecordingStatuses)[number];\n\nexport const cloudSessionSourceTypes = [\n  \"agent-thread\",\n  \"agent-run\",\n  \"project-agent-run\",\n  \"local-cloud\",\n  \"manual\",\n] as const;\n\nexport type CloudSessionSourceType = (typeof cloudSessionSourceTypes)[number];\nexport type CloudSessionVisibilityScope = \"team\" | \"owner\";\nexport type CloudProxyMode = \"disabled\" | \"optional\" | \"required\";\nexport type CloudProxyProtocol = \"http\" | \"https\" | \"socks5\";\nexport type CloudFingerprintMode = \"off\" | \"auto\";\nexport type BrowserProfileStatus = \"active\" | \"archived\" | \"error\";\nexport type BrowserProfileProxyPolicy = \"strict_sticky\";\nexport type BrowserProfileArchiveFormat = \"tar.gz\";\nexport type PortableBrowserProfileSnapshotFormat = \"portable-cookies-v1+json.gz\";\nexport type PortableBrowserFamily = \"chromium\";\nexport type BrowserProfileImportStatus =\n  | \"awaiting_upload\"\n  | \"queued\"\n  | \"processing\"\n  | \"ready\"\n  | \"failed\";\n\nexport interface PortableBrowserProfileSnapshotSource {\n  readonly browserFamily: PortableBrowserFamily;\n  readonly browserName?: string;\n  readonly browserMajor?: string;\n  readonly browserBrand?: string;\n  readonly captureMethod?: string;\n  readonly platform?: string;\n  readonly capturedAt: number;\n}\n\nexport type PortableBrowserProfileCookieRecord = Omit<CookieRecord, \"sessionRef\">;\n\nexport interface PortableBrowserProfileSnapshot {\n  readonly version: \"portable-cookies-v1\";\n  readonly source: PortableBrowserProfileSnapshotSource;\n  readonly cookies: readonly PortableBrowserProfileCookieRecord[];\n}\n\nexport interface BrowserProfileImportSnapshotSummary {\n  readonly source: PortableBrowserProfileSnapshotSource;\n  readonly cookieCount: number;\n  readonly domainCount: number;\n}\n\nexport interface CloudViewport {\n  readonly width: number;\n  readonly height: number;\n}\n\nexport interface CloudGeolocation {\n  readonly latitude: number;\n  readonly longitude: number;\n  readonly accuracy?: number;\n}\n\nexport interface CloudBrowserContextConfig {\n  readonly viewport?: CloudViewport;\n  readonly locale?: string;\n  readonly timezoneId?: string;\n  readonly geolocation?: CloudGeolocation;\n  readonly colorScheme?: \"light\" | \"dark\" | \"no-preference\";\n  readonly userAgent?: string;\n  readonly javaScriptEnabled?: boolean;\n  readonly ignoreHTTPSErrors?: boolean;\n}\n\nexport interface CloudBrowserExtensionConfig {\n  readonly includeDefaults?: boolean;\n  readonly extensionKeys?: readonly string[];\n}\n\nexport interface CloudBrowserLaunchConfig {\n  readonly headless?: boolean;\n  readonly context?: CloudBrowserContextConfig;\n  readonly chromeArgs?: readonly string[];\n  readonly extensions?: CloudBrowserExtensionConfig;\n}\n\nexport interface CloudProxyPreference {\n  readonly mode?: CloudProxyMode;\n  readonly countryCode?: string;\n  readonly region?: string;\n  readonly city?: string;\n  readonly proxyId?: string;\n}\n\nexport interface CloudFingerprintPreference {\n  readonly mode?: CloudFingerprintMode;\n  readonly locales?: readonly string[];\n  readonly minWidth?: number;\n  readonly maxWidth?: number;\n  readonly minHeight?: number;\n  readonly maxHeight?: number;\n  readonly slim?: boolean;\n}\n\nexport interface CloudBrowserProfilePreference {\n  readonly profileId: string;\n  readonly reuseIfActive?: boolean;\n}\n\nexport type CloudBrowserProfileLaunchPreference = CloudBrowserProfilePreference;\n\nexport interface CloudSessionLaunchConfig {\n  readonly browser?: CloudBrowserLaunchConfig;\n  readonly proxy?: CloudProxyPreference;\n  readonly fingerprint?: CloudFingerprintPreference;\n  readonly browserProfile?: CloudBrowserProfilePreference;\n}\n\nexport interface CloudSessionSummary {\n  readonly sessionId: string;\n  readonly workspaceId: string;\n  readonly state: CloudSessionStatus;\n  readonly createdAt: number;\n  readonly sourceType: CloudSessionSourceType;\n  readonly sourceRef?: string;\n  readonly label?: string;\n}\n\nexport interface CloudSessionRecordingResult {\n  readonly fileName: string;\n  readonly script: string;\n  readonly actionCount: number;\n}\n\nexport interface CloudSessionRecordingState {\n  readonly sessionId: string;\n  readonly status: CloudSessionRecordingStatus;\n  readonly actionCount: number;\n  readonly startedAt?: number;\n  readonly stoppedAt?: number;\n  readonly updatedAt: number;\n  readonly error?: string;\n  readonly result?: CloudSessionRecordingResult;\n}\n\nexport interface CloudRegistryImportEntry {\n  readonly workspace: string;\n  readonly recordId: string;\n  readonly key: string;\n  readonly version: string;\n  readonly contentHash: string;\n  readonly tags: readonly string[];\n  readonly provenance?: unknown;\n  readonly payload: unknown;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n}\n\nexport interface CloudRequestPlanImportEntry extends CloudRegistryImportEntry {\n  readonly freshness?: unknown;\n}\n\nexport interface CloudRegistryImportRequest {\n  readonly entries: readonly CloudRegistryImportEntry[];\n}\n\nexport interface CloudRequestPlanImportRequest {\n  readonly entries: readonly CloudRequestPlanImportEntry[];\n}\n\nexport interface CloudRegistryImportResponse {\n  readonly imported: number;\n  readonly inserted: number;\n  readonly updated: number;\n  readonly skipped: number;\n}\n\nexport type ActionFailureCode =\n  | \"TARGET_NOT_FOUND\"\n  | \"TARGET_UNAVAILABLE\"\n  | \"TARGET_STALE\"\n  | \"TARGET_AMBIGUOUS\"\n  | \"BLOCKED_BY_INTERCEPTOR\"\n  | \"NOT_VISIBLE\"\n  | \"NOT_ENABLED\"\n  | \"NOT_EDITABLE\"\n  | \"INVALID_TARGET\"\n  | \"INVALID_OPTIONS\"\n  | \"ACTION_TIMEOUT\"\n  | \"UNKNOWN\";\n\nexport type ActionFailureClassificationSource =\n  | \"typed_error\"\n  | \"playwright_call_log\"\n  | \"dom_probe\"\n  | \"message_heuristic\"\n  | \"unknown\";\n\nexport interface ActionFailureBlocker {\n  readonly tag: string;\n  readonly id: string | null;\n  readonly classes: readonly string[];\n  readonly role: string | null;\n  readonly text: string | null;\n}\n\nexport interface ActionFailureDetails {\n  readonly blocker?: ActionFailureBlocker;\n  readonly observation?: string;\n}\n\nexport interface ActionFailure {\n  readonly code: ActionFailureCode;\n  readonly message: string;\n  readonly retryable: boolean;\n  readonly classificationSource: ActionFailureClassificationSource;\n  readonly details?: ActionFailureDetails;\n}\n\nexport interface CloudActionRequest {\n  readonly id: number;\n  readonly method: CloudActionMethod;\n  readonly args: Readonly<Record<string, unknown>>;\n  readonly sessionId: string;\n  readonly token: string;\n}\n\nexport interface CloudActionSuccess {\n  readonly id: number;\n  readonly ok: true;\n  readonly result: unknown;\n}\n\nexport interface CloudActionFailureDetails {\n  readonly actionFailure?: ActionFailure;\n}\n\nexport interface CloudActionFailure {\n  readonly id: number;\n  readonly ok: false;\n  readonly error: string;\n  readonly code: CloudErrorCode;\n  readonly details?: CloudActionFailureDetails;\n}\n\nexport type CloudActionResponse = CloudActionSuccess | CloudActionFailure;\n\nexport interface BrowserProfileDescriptor {\n  readonly profileId: string;\n  readonly teamId: string;\n  readonly ownerUserId: string;\n  readonly name: string;\n  readonly status: BrowserProfileStatus;\n  readonly proxyPolicy: BrowserProfileProxyPolicy;\n  readonly stickyProxyId?: string;\n  readonly proxyCountryCode?: string;\n  readonly proxyRegion?: string;\n  readonly proxyCity?: string;\n  readonly fingerprintMode: CloudFingerprintMode;\n  readonly fingerprintHash?: string;\n  readonly activeSessionId?: string;\n  readonly lastSessionId?: string;\n  readonly lastLaunchedAt?: number;\n  readonly latestRevision?: number;\n  readonly latestStorageId?: string;\n  readonly latestSizeBytes?: number;\n  readonly latestArchiveSha256?: string;\n  readonly latestArchiveFormat?: BrowserProfileArchiveFormat;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly lastError?: string;\n}\n\nexport interface BrowserProfileListResponse {\n  readonly profiles: readonly BrowserProfileDescriptor[];\n  readonly nextCursor?: string;\n}\n\nexport interface BrowserProfileCreateRequest {\n  readonly name: string;\n  readonly proxy?: {\n    readonly proxyId?: string;\n    readonly countryCode?: string;\n    readonly region?: string;\n    readonly city?: string;\n  };\n  readonly fingerprint?: {\n    readonly mode?: CloudFingerprintMode;\n  };\n}\n\nexport interface BrowserProfileImportCreateRequest {\n  readonly profileId: string;\n}\n\nexport interface BrowserProfileImportCreateResponse {\n  readonly importId: string;\n  readonly profileId: string;\n  readonly status: BrowserProfileImportStatus;\n  readonly uploadUrl: string;\n  readonly uploadMethod: \"PUT\";\n  readonly uploadFormat: PortableBrowserProfileSnapshotFormat;\n  readonly maxUploadBytes: number;\n}\n\nexport interface BrowserProfileImportDescriptor {\n  readonly importId: string;\n  readonly profileId: string;\n  readonly status: BrowserProfileImportStatus;\n  readonly uploadFormat: PortableBrowserProfileSnapshotFormat;\n  readonly storageId?: string;\n  readonly revision?: number;\n  readonly error?: string;\n  readonly snapshotSummary?: BrowserProfileImportSnapshotSummary;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n}\n\nconst cloudActionMethodSet = new Set<CloudActionMethod>(cloudActionMethods);\nconst cloudErrorCodeSet = new Set<CloudErrorCode>(cloudErrorCodes);\nconst cloudSessionRecordingStatusSet = new Set<CloudSessionRecordingStatus>(\n  cloudSessionRecordingStatuses,\n);\nconst cloudSessionSourceTypeSet = new Set<CloudSessionSourceType>(cloudSessionSourceTypes);\nconst cloudSessionStatusSet = new Set<CloudSessionStatus>(cloudSessionStatuses);\n\nexport function isCloudActionMethod(value: unknown): value is CloudActionMethod {\n  return typeof value === \"string\" && cloudActionMethodSet.has(value as CloudActionMethod);\n}\n\nexport function isCloudErrorCode(value: unknown): value is CloudErrorCode {\n  return typeof value === \"string\" && cloudErrorCodeSet.has(value as CloudErrorCode);\n}\n\nexport function isCloudSessionSourceType(value: unknown): value is CloudSessionSourceType {\n  return (\n    typeof value === \"string\" && cloudSessionSourceTypeSet.has(value as CloudSessionSourceType)\n  );\n}\n\nexport function isCloudSessionStatus(value: unknown): value is CloudSessionStatus {\n  return typeof value === \"string\" && cloudSessionStatusSet.has(value as CloudSessionStatus);\n}\n\nexport function isCloudSessionRecordingStatus(\n  value: unknown,\n): value is CloudSessionRecordingStatus {\n  return (\n    typeof value === \"string\" &&\n    cloudSessionRecordingStatusSet.has(value as CloudSessionRecordingStatus)\n  );\n}\n","import type { OpensteerCapability } from \"./capabilities.js\";\nimport { opensteerCapabilitySchema } from \"./capabilities.js\";\nimport { objectSchema, recordSchema, stringSchema, type JsonSchema } from \"./json.js\";\n\nexport const opensteerErrorCodes = [\n  \"invalid-request\",\n  \"invalid-argument\",\n  \"invalid-ref\",\n  \"unsupported-version\",\n  \"unsupported-operation\",\n  \"unsupported-capability\",\n  \"not-found\",\n  \"stale-node-ref\",\n  \"session-closed\",\n  \"page-closed\",\n  \"frame-detached\",\n  \"timeout\",\n  \"navigation-failed\",\n  \"permission-denied\",\n  \"conflict\",\n  \"profile-unavailable\",\n  \"auth-failure\",\n  \"auth-recovery-failed\",\n  \"browser-required\",\n  \"rate-limited\",\n  \"operation-failed\",\n  \"internal\",\n] as const;\n\nexport type OpensteerErrorCode = (typeof opensteerErrorCodes)[number];\n\nexport interface OpensteerError {\n  readonly code: OpensteerErrorCode;\n  readonly message: string;\n  readonly retriable: boolean;\n  readonly capability?: OpensteerCapability;\n  readonly details?: Readonly<Record<string, unknown>>;\n}\n\nexport interface OpensteerErrorOptions {\n  readonly cause?: unknown;\n  readonly retriable?: boolean;\n  readonly capability?: OpensteerCapability;\n  readonly details?: Readonly<Record<string, unknown>>;\n}\n\nexport class OpensteerProtocolError extends Error {\n  readonly code: OpensteerErrorCode;\n  readonly retriable: boolean;\n  readonly capability: OpensteerCapability | undefined;\n  readonly details: Readonly<Record<string, unknown>> | undefined;\n\n  constructor(code: OpensteerErrorCode, message: string, options: OpensteerErrorOptions = {}) {\n    super(message, { cause: options.cause });\n    this.name = \"OpensteerProtocolError\";\n    this.code = code;\n    this.retriable = options.retriable ?? false;\n    this.capability = options.capability;\n    this.details = options.details;\n  }\n}\n\nexport function createOpensteerError(\n  code: OpensteerErrorCode,\n  message: string,\n  options: Omit<OpensteerErrorOptions, \"cause\"> = {},\n): OpensteerError {\n  return {\n    code,\n    message,\n    retriable: options.retriable ?? false,\n    ...(options.capability === undefined ? {} : { capability: options.capability }),\n    ...(options.details === undefined ? {} : { details: options.details }),\n  };\n}\n\nexport function unsupportedCapabilityError(capability: OpensteerCapability): OpensteerError {\n  return createOpensteerError(\n    \"unsupported-capability\",\n    `capability ${capability} is not supported by this surface`,\n    {\n      capability,\n      details: { capability },\n    },\n  );\n}\n\nexport function isOpensteerProtocolError(value: unknown): value is OpensteerProtocolError {\n  return value instanceof OpensteerProtocolError;\n}\n\nexport function toOpensteerError(\n  error: Pick<\n    OpensteerProtocolError | OpensteerError,\n    \"code\" | \"message\" | \"retriable\" | \"capability\" | \"details\"\n  >,\n): OpensteerError {\n  return createOpensteerError(error.code, error.message, {\n    retriable: error.retriable,\n    ...(error.capability === undefined ? {} : { capability: error.capability }),\n    ...(error.details === undefined ? {} : { details: error.details }),\n  });\n}\n\nexport function unsupportedVersionError(version: string): OpensteerError {\n  return createOpensteerError(\n    \"unsupported-version\",\n    `protocol version ${version} is not supported`,\n    {\n      details: { version },\n    },\n  );\n}\n\nexport const opensteerErrorCodeSchema: JsonSchema = {\n  title: \"OpensteerErrorCode\",\n  enum: opensteerErrorCodes,\n};\n\nexport const opensteerErrorSchema: JsonSchema = objectSchema(\n  {\n    code: opensteerErrorCodeSchema,\n    message: stringSchema(),\n    retriable: {\n      type: \"boolean\",\n    },\n    capability: opensteerCapabilitySchema,\n    details: recordSchema({}),\n  },\n  {\n    title: \"OpensteerError\",\n    required: [\"code\", \"message\", \"retriable\"],\n  },\n);\n\nexport function httpStatusForOpensteerError(error: OpensteerError): number {\n  switch (error.code) {\n    case \"invalid-request\":\n    case \"invalid-argument\":\n    case \"invalid-ref\":\n    case \"unsupported-version\":\n      return 400;\n    case \"permission-denied\":\n      return 403;\n    case \"not-found\":\n    case \"stale-node-ref\":\n    case \"session-closed\":\n    case \"page-closed\":\n    case \"frame-detached\":\n      return 404;\n    case \"conflict\":\n    case \"profile-unavailable\":\n    case \"auth-failure\":\n    case \"auth-recovery-failed\":\n      return 409;\n    case \"browser-required\":\n      return 412;\n    case \"rate-limited\":\n      return 429;\n    case \"unsupported-operation\":\n    case \"unsupported-capability\":\n      return 501;\n    case \"timeout\":\n      return 504;\n    case \"navigation-failed\":\n    case \"operation-failed\":\n      return 502;\n    case \"internal\":\n      return 500;\n  }\n\n  return 500;\n}\n","export type { ConsoleLevel } from \"@opensteer/browser-core\";\n\nexport type { PageCreatedStepEvent as PageCreatedEvent } from \"@opensteer/browser-core\";\nexport type { PopupOpenedStepEvent as PopupOpenedEvent } from \"@opensteer/browser-core\";\nexport type { PageClosedStepEvent as PageClosedEvent } from \"@opensteer/browser-core\";\nexport type { DialogOpenedStepEvent as DialogOpenedEvent } from \"@opensteer/browser-core\";\nexport type { DownloadStartedStepEvent as DownloadStartedEvent } from \"@opensteer/browser-core\";\nexport type { DownloadFinishedStepEvent as DownloadFinishedEvent } from \"@opensteer/browser-core\";\nexport type { ChooserOpenedStepEvent as ChooserOpenedEvent } from \"@opensteer/browser-core\";\nexport type { WorkerCreatedStepEvent as WorkerCreatedEvent } from \"@opensteer/browser-core\";\nexport type { WorkerDestroyedStepEvent as WorkerDestroyedEvent } from \"@opensteer/browser-core\";\nexport type { ConsoleStepEvent as ConsoleEvent } from \"@opensteer/browser-core\";\nexport type { PageErrorStepEvent as PageErrorEvent } from \"@opensteer/browser-core\";\nexport type { WebSocketOpenedStepEvent as WebSocketOpenedEvent } from \"@opensteer/browser-core\";\nexport type { WebSocketFrameStepEvent as WebSocketFrameEvent } from \"@opensteer/browser-core\";\nexport type { WebSocketClosedStepEvent as WebSocketClosedEvent } from \"@opensteer/browser-core\";\nexport type { EventStreamMessageStepEvent as EventStreamMessageEvent } from \"@opensteer/browser-core\";\nexport type { PausedStepEvent as PausedEvent } from \"@opensteer/browser-core\";\nexport type { ResumedStepEvent as ResumedEvent } from \"@opensteer/browser-core\";\nexport type { FrozenStepEvent as FrozenEvent } from \"@opensteer/browser-core\";\nexport type { StepEvent as OpensteerEvent } from \"@opensteer/browser-core\";\n\nimport {\n  chooserRefSchema,\n  dialogRefSchema,\n  documentEpochSchema,\n  documentRefSchema,\n  downloadRefSchema,\n  frameRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n  workerRefSchema,\n} from \"./identity.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  oneOfSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\n\nfunction eventBaseSchema(kind: string): Record<string, JsonSchema> {\n  return {\n    eventId: stringSchema(),\n    kind: enumSchema([kind] as const),\n    timestamp: integerSchema({ minimum: 0 }),\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n  };\n}\n\nconst dialogTypeSchema = enumSchema([\"alert\", \"beforeunload\", \"confirm\", \"prompt\"] as const);\nconst downloadStateSchema = enumSchema([\"completed\", \"canceled\", \"failed\"] as const);\nconst chooserTypeSchema = enumSchema([\"file\", \"select\"] as const);\nconst workerTypeSchema = enumSchema([\"dedicated\", \"shared\", \"service\"] as const);\nconst consoleLevelSchema = enumSchema([\"debug\", \"log\", \"info\", \"warn\", \"error\", \"trace\"] as const);\nconst websocketDirectionSchema = enumSchema([\"sent\", \"received\"] as const);\n\nconst pageCreatedEventSchema = objectSchema(eventBaseSchema(\"page-created\"), {\n  title: \"PageCreatedEvent\",\n  required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"pageRef\"],\n});\n\nconst popupOpenedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"popup-opened\"),\n    openerPageRef: pageRefSchema,\n  },\n  {\n    title: \"PopupOpenedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"pageRef\", \"openerPageRef\"],\n  },\n);\n\nconst pageClosedEventSchema = objectSchema(eventBaseSchema(\"page-closed\"), {\n  title: \"PageClosedEvent\",\n  required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"pageRef\"],\n});\n\nconst dialogOpenedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"dialog-opened\"),\n    dialogRef: dialogRefSchema,\n    dialogType: dialogTypeSchema,\n    message: stringSchema(),\n    defaultValue: stringSchema(),\n  },\n  {\n    title: \"DialogOpenedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"dialogRef\", \"dialogType\", \"message\"],\n  },\n);\n\nconst downloadStartedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"download-started\"),\n    downloadRef: downloadRefSchema,\n    url: stringSchema(),\n    suggestedFilename: stringSchema(),\n  },\n  {\n    title: \"DownloadStartedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"downloadRef\", \"url\"],\n  },\n);\n\nconst downloadFinishedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"download-finished\"),\n    downloadRef: downloadRefSchema,\n    state: downloadStateSchema,\n    filePath: stringSchema(),\n  },\n  {\n    title: \"DownloadFinishedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"downloadRef\", \"state\"],\n  },\n);\n\nconst chooserOpenedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"chooser-opened\"),\n    chooserRef: chooserRefSchema,\n    chooserType: chooserTypeSchema,\n    multiple: {\n      type: \"boolean\",\n    },\n    options: arraySchema(\n      objectSchema(\n        {\n          index: integerSchema({ minimum: 0 }),\n          label: stringSchema(),\n          value: stringSchema(),\n          selected: {\n            type: \"boolean\",\n          },\n        },\n        {\n          required: [\"index\", \"label\", \"value\", \"selected\"],\n        },\n      ),\n    ),\n  },\n  {\n    title: \"ChooserOpenedEvent\",\n    required: [\n      \"eventId\",\n      \"kind\",\n      \"timestamp\",\n      \"sessionRef\",\n      \"chooserRef\",\n      \"chooserType\",\n      \"multiple\",\n    ],\n  },\n);\n\nconst workerCreatedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"worker-created\"),\n    workerRef: workerRefSchema,\n    workerType: workerTypeSchema,\n    url: stringSchema(),\n  },\n  {\n    title: \"WorkerCreatedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"workerRef\", \"workerType\", \"url\"],\n  },\n);\n\nconst workerDestroyedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"worker-destroyed\"),\n    workerRef: workerRefSchema,\n    workerType: workerTypeSchema,\n    url: stringSchema(),\n  },\n  {\n    title: \"WorkerDestroyedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"workerRef\", \"workerType\", \"url\"],\n  },\n);\n\nconst consoleEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"console\"),\n    level: consoleLevelSchema,\n    text: stringSchema(),\n    location: objectSchema(\n      {\n        url: stringSchema(),\n        lineNumber: integerSchema({ minimum: 0 }),\n        columnNumber: integerSchema({ minimum: 0 }),\n      },\n      {\n        required: [],\n      },\n    ),\n  },\n  {\n    title: \"ConsoleEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"level\", \"text\"],\n  },\n);\n\nconst pageErrorEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"page-error\"),\n    message: stringSchema(),\n    stack: stringSchema(),\n  },\n  {\n    title: \"PageErrorEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"message\"],\n  },\n);\n\nconst websocketOpenedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"websocket-opened\"),\n    socketId: stringSchema(),\n    url: stringSchema(),\n  },\n  {\n    title: \"WebSocketOpenedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"socketId\", \"url\"],\n  },\n);\n\nconst websocketFrameEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"websocket-frame\"),\n    socketId: stringSchema(),\n    direction: websocketDirectionSchema,\n    opcode: integerSchema({ minimum: 0 }),\n    payloadPreview: stringSchema(),\n  },\n  {\n    title: \"WebSocketFrameEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"socketId\", \"direction\"],\n  },\n);\n\nconst websocketClosedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"websocket-closed\"),\n    socketId: stringSchema(),\n    code: integerSchema({ minimum: 0 }),\n    reason: stringSchema(),\n  },\n  {\n    title: \"WebSocketClosedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"socketId\"],\n  },\n);\n\nconst eventStreamMessageEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"event-stream-message\"),\n    streamId: stringSchema(),\n    eventName: stringSchema(),\n    dataPreview: stringSchema(),\n  },\n  {\n    title: \"EventStreamMessageEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\", \"streamId\"],\n  },\n);\n\nconst pausedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"paused\"),\n    reason: stringSchema(),\n  },\n  {\n    title: \"PausedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\"],\n  },\n);\n\nconst resumedEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"resumed\"),\n    reason: stringSchema(),\n  },\n  {\n    title: \"ResumedEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\"],\n  },\n);\n\nconst frozenEventSchema = objectSchema(\n  {\n    ...eventBaseSchema(\"frozen\"),\n    reason: stringSchema(),\n  },\n  {\n    title: \"FrozenEvent\",\n    required: [\"eventId\", \"kind\", \"timestamp\", \"sessionRef\"],\n  },\n);\n\nexport const opensteerEventSchema: JsonSchema = oneOfSchema(\n  [\n    pageCreatedEventSchema,\n    popupOpenedEventSchema,\n    pageClosedEventSchema,\n    dialogOpenedEventSchema,\n    downloadStartedEventSchema,\n    downloadFinishedEventSchema,\n    chooserOpenedEventSchema,\n    workerCreatedEventSchema,\n    workerDestroyedEventSchema,\n    consoleEventSchema,\n    pageErrorEventSchema,\n    websocketOpenedEventSchema,\n    websocketFrameEventSchema,\n    websocketClosedEventSchema,\n    eventStreamMessageEventSchema,\n    pausedEventSchema,\n    resumedEventSchema,\n    frozenEventSchema,\n  ],\n  {\n    title: \"OpensteerEvent\",\n  },\n);\n","import type { DocumentEpoch, DocumentRef, FrameRef, PageRef, SessionRef } from \"./identity.js\";\nimport {\n  documentEpochSchema,\n  documentRefSchema,\n  frameRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n} from \"./identity.js\";\nimport type { ExternalBinaryLocation } from \"./binary-location.js\";\nimport { externalBinaryLocationSchema } from \"./binary-location.js\";\nimport type { JsonSchema } from \"./json.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  oneOfSchema,\n  stringSchema,\n} from \"./json.js\";\nimport type { HtmlSnapshot, DomSnapshot, ScreenshotArtifact } from \"./snapshots.js\";\nimport { domSnapshotSchema, htmlSnapshotSchema, screenshotArtifactSchema } from \"./snapshots.js\";\nimport type { CookieRecord, StorageSnapshot } from \"./storage.js\";\nimport { cookieRecordSchema, storageSnapshotSchema } from \"./storage.js\";\n\nexport type OpensteerArtifactKind =\n  | \"screenshot\"\n  | \"html-snapshot\"\n  | \"dom-snapshot\"\n  | \"cookies\"\n  | \"storage-snapshot\"\n  | \"script-source\";\n\nexport type ArtifactRelation = \"result\" | \"before\" | \"after\" | \"capture\" | \"evidence\" | \"snapshot\";\n\nexport type ArtifactExternalLocation = ExternalBinaryLocation;\n\nexport interface ArtifactProvenance {\n  readonly sourceArtifactId?: string;\n  readonly transform?: string;\n}\n\nexport interface ScriptSourceArtifactData {\n  readonly source: \"inline\" | \"external\" | \"dynamic\" | \"worker\";\n  readonly url?: string;\n  readonly type?: string;\n  readonly hash: string;\n  readonly loadOrder: number;\n  readonly content: string;\n}\n\nexport interface ArtifactInline<TData> {\n  readonly delivery: \"inline\";\n  readonly data: TData;\n}\n\ninterface ArtifactContext {\n  readonly sessionRef?: SessionRef;\n  readonly pageRef?: PageRef;\n  readonly frameRef?: FrameRef;\n  readonly documentRef?: DocumentRef;\n  readonly documentEpoch?: DocumentEpoch;\n}\n\ninterface OpensteerArtifactBase extends ArtifactContext {\n  readonly artifactId: string;\n  readonly kind: OpensteerArtifactKind;\n  readonly createdAt: number;\n  readonly provenance?: ArtifactProvenance;\n}\n\nexport interface ScreenshotArtifactRecord extends OpensteerArtifactBase {\n  readonly kind: \"screenshot\";\n  readonly payload: ArtifactInline<ScreenshotArtifact> | ArtifactExternalLocation;\n}\n\nexport interface HtmlSnapshotArtifactRecord extends OpensteerArtifactBase {\n  readonly kind: \"html-snapshot\";\n  readonly payload: ArtifactInline<HtmlSnapshot> | ArtifactExternalLocation;\n}\n\nexport interface DomSnapshotArtifactRecord extends OpensteerArtifactBase {\n  readonly kind: \"dom-snapshot\";\n  readonly payload: ArtifactInline<DomSnapshot> | ArtifactExternalLocation;\n}\n\nexport interface CookiesArtifactRecord extends OpensteerArtifactBase {\n  readonly kind: \"cookies\";\n  readonly payload: ArtifactInline<readonly CookieRecord[]> | ArtifactExternalLocation;\n}\n\nexport interface StorageSnapshotArtifactRecord extends OpensteerArtifactBase {\n  readonly kind: \"storage-snapshot\";\n  readonly payload: ArtifactInline<StorageSnapshot> | ArtifactExternalLocation;\n}\n\nexport interface ScriptSourceArtifactRecord extends OpensteerArtifactBase {\n  readonly kind: \"script-source\";\n  readonly payload: ArtifactInline<ScriptSourceArtifactData> | ArtifactExternalLocation;\n}\n\nexport type OpensteerArtifact =\n  | ScreenshotArtifactRecord\n  | HtmlSnapshotArtifactRecord\n  | DomSnapshotArtifactRecord\n  | CookiesArtifactRecord\n  | StorageSnapshotArtifactRecord\n  | ScriptSourceArtifactRecord;\n\nexport interface ArtifactReference {\n  readonly artifactId: string;\n  readonly kind: OpensteerArtifactKind;\n  readonly relation: ArtifactRelation;\n}\n\nexport interface OpensteerArtifactReadInput {\n  readonly artifactId: string;\n}\n\nexport interface OpensteerArtifactReadOutput {\n  readonly artifact: OpensteerArtifact;\n}\n\nconst artifactKindSchema: JsonSchema = enumSchema(\n  [\n    \"screenshot\",\n    \"html-snapshot\",\n    \"dom-snapshot\",\n    \"cookies\",\n    \"storage-snapshot\",\n    \"script-source\",\n  ] as const,\n  {\n    title: \"OpensteerArtifactKind\",\n  },\n);\n\nconst artifactRelationSchema: JsonSchema = enumSchema(\n  [\"result\", \"before\", \"after\", \"capture\", \"evidence\", \"snapshot\"] as const,\n  {\n    title: \"ArtifactRelation\",\n  },\n);\n\nfunction inlineArtifactPayloadSchema(dataSchema: JsonSchema, title: string): JsonSchema {\n  return objectSchema(\n    {\n      delivery: enumSchema([\"inline\"] as const),\n      data: dataSchema,\n    },\n    {\n      title,\n      required: [\"delivery\", \"data\"],\n    },\n  );\n}\n\nfunction artifactBaseSchema(kind: OpensteerArtifactKind): Record<string, JsonSchema> {\n  return {\n    artifactId: stringSchema(),\n    kind: enumSchema([kind] as const),\n    createdAt: integerSchema({ minimum: 0 }),\n    provenance: objectSchema(\n      {\n        sourceArtifactId: stringSchema({ minLength: 1 }),\n        transform: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"ArtifactProvenance\",\n      },\n    ),\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n  };\n}\n\nconst screenshotArtifactRecordSchema: JsonSchema = objectSchema(\n  {\n    ...artifactBaseSchema(\"screenshot\"),\n    payload: oneOfSchema([\n      inlineArtifactPayloadSchema(screenshotArtifactSchema, \"InlineScreenshotArtifact\"),\n      externalBinaryLocationSchema,\n    ]),\n  },\n  {\n    title: \"ScreenshotArtifactRecord\",\n    required: [\"artifactId\", \"kind\", \"createdAt\", \"payload\"],\n  },\n);\n\nconst htmlSnapshotArtifactRecordSchema: JsonSchema = objectSchema(\n  {\n    ...artifactBaseSchema(\"html-snapshot\"),\n    payload: oneOfSchema([\n      inlineArtifactPayloadSchema(htmlSnapshotSchema, \"InlineHtmlSnapshotArtifact\"),\n      externalBinaryLocationSchema,\n    ]),\n  },\n  {\n    title: \"HtmlSnapshotArtifactRecord\",\n    required: [\"artifactId\", \"kind\", \"createdAt\", \"payload\"],\n  },\n);\n\nconst domSnapshotArtifactRecordSchema: JsonSchema = objectSchema(\n  {\n    ...artifactBaseSchema(\"dom-snapshot\"),\n    payload: oneOfSchema([\n      inlineArtifactPayloadSchema(domSnapshotSchema, \"InlineDomSnapshotArtifact\"),\n      externalBinaryLocationSchema,\n    ]),\n  },\n  {\n    title: \"DomSnapshotArtifactRecord\",\n    required: [\"artifactId\", \"kind\", \"createdAt\", \"payload\"],\n  },\n);\n\nconst cookiesArtifactRecordSchema: JsonSchema = objectSchema(\n  {\n    ...artifactBaseSchema(\"cookies\"),\n    payload: oneOfSchema([\n      inlineArtifactPayloadSchema(arraySchema(cookieRecordSchema), \"InlineCookiesArtifact\"),\n      externalBinaryLocationSchema,\n    ]),\n  },\n  {\n    title: \"CookiesArtifactRecord\",\n    required: [\"artifactId\", \"kind\", \"createdAt\", \"payload\"],\n  },\n);\n\nconst storageSnapshotArtifactRecordSchema: JsonSchema = objectSchema(\n  {\n    ...artifactBaseSchema(\"storage-snapshot\"),\n    payload: oneOfSchema([\n      inlineArtifactPayloadSchema(storageSnapshotSchema, \"InlineStorageSnapshotArtifact\"),\n      externalBinaryLocationSchema,\n    ]),\n  },\n  {\n    title: \"StorageSnapshotArtifactRecord\",\n    required: [\"artifactId\", \"kind\", \"createdAt\", \"payload\"],\n  },\n);\n\nexport const scriptSourceArtifactDataSchema: JsonSchema = objectSchema(\n  {\n    source: enumSchema([\"inline\", \"external\", \"dynamic\", \"worker\"] as const),\n    url: stringSchema({ minLength: 1 }),\n    type: stringSchema({ minLength: 1 }),\n    hash: stringSchema({ minLength: 1 }),\n    loadOrder: integerSchema({ minimum: 0 }),\n    content: stringSchema(),\n  },\n  {\n    title: \"ScriptSourceArtifactData\",\n    required: [\"source\", \"hash\", \"loadOrder\", \"content\"],\n  },\n);\n\nconst scriptSourceArtifactRecordSchema: JsonSchema = objectSchema(\n  {\n    ...artifactBaseSchema(\"script-source\"),\n    payload: oneOfSchema([\n      inlineArtifactPayloadSchema(scriptSourceArtifactDataSchema, \"InlineScriptSourceArtifact\"),\n      externalBinaryLocationSchema,\n    ]),\n  },\n  {\n    title: \"ScriptSourceArtifactRecord\",\n    required: [\"artifactId\", \"kind\", \"createdAt\", \"payload\"],\n  },\n);\n\nexport const opensteerArtifactSchema: JsonSchema = oneOfSchema(\n  [\n    screenshotArtifactRecordSchema,\n    htmlSnapshotArtifactRecordSchema,\n    domSnapshotArtifactRecordSchema,\n    cookiesArtifactRecordSchema,\n    storageSnapshotArtifactRecordSchema,\n    scriptSourceArtifactRecordSchema,\n  ],\n  {\n    title: \"OpensteerArtifact\",\n  },\n);\n\nexport const artifactReferenceSchema: JsonSchema = objectSchema(\n  {\n    artifactId: stringSchema(),\n    kind: artifactKindSchema,\n    relation: artifactRelationSchema,\n  },\n  {\n    title: \"ArtifactReference\",\n    required: [\"artifactId\", \"kind\", \"relation\"],\n  },\n);\n\nexport const opensteerArtifactReadInputSchema: JsonSchema = objectSchema(\n  {\n    artifactId: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerArtifactReadInput\",\n    required: [\"artifactId\"],\n  },\n);\n\nexport const opensteerArtifactReadOutputSchema: JsonSchema = objectSchema(\n  {\n    artifact: opensteerArtifactSchema,\n  },\n  {\n    title: \"OpensteerArtifactReadOutput\",\n    required: [\"artifact\"],\n  },\n);\n","import type { JsonSchema } from \"./json.js\";\nimport { enumSchema, integerSchema, objectSchema, stringSchema } from \"./json.js\";\nimport { pageRefSchema, type PageRef } from \"./identity.js\";\n\nexport type CaptchaType = \"recaptcha-v2\" | \"hcaptcha\" | \"turnstile\";\nexport type CaptchaProvider = \"2captcha\" | \"capsolver\";\n\nexport interface CaptchaDetectionResult {\n  readonly type: CaptchaType;\n  readonly siteKey: string;\n  readonly pageUrl: string;\n}\n\nexport interface OpensteerCaptchaSolveInput {\n  readonly provider: CaptchaProvider;\n  readonly apiKey: string;\n  readonly pageRef?: PageRef;\n  readonly timeoutMs?: number;\n  readonly type?: CaptchaType;\n  readonly siteKey?: string;\n  readonly pageUrl?: string;\n}\n\nexport interface OpensteerCaptchaSolveOutput {\n  readonly captcha: CaptchaDetectionResult;\n  readonly token: string;\n  readonly injected: boolean;\n  readonly provider: CaptchaProvider;\n}\n\nexport const captchaTypeSchema: JsonSchema = enumSchema(\n  [\"recaptcha-v2\", \"hcaptcha\", \"turnstile\"] as const,\n  {\n    title: \"CaptchaType\",\n  },\n);\n\nexport const captchaProviderSchema: JsonSchema = enumSchema([\"2captcha\", \"capsolver\"] as const, {\n  title: \"CaptchaProvider\",\n});\n\nexport const captchaDetectionResultSchema: JsonSchema = objectSchema(\n  {\n    type: captchaTypeSchema,\n    siteKey: stringSchema({ minLength: 1 }),\n    pageUrl: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"CaptchaDetectionResult\",\n    required: [\"type\", \"siteKey\", \"pageUrl\"],\n  },\n);\n\nexport const opensteerCaptchaSolveInputSchema: JsonSchema = objectSchema(\n  {\n    provider: captchaProviderSchema,\n    apiKey: stringSchema({ minLength: 1 }),\n    pageRef: pageRefSchema,\n    timeoutMs: integerSchema({ minimum: 1 }),\n    type: captchaTypeSchema,\n    siteKey: stringSchema({ minLength: 1 }),\n    pageUrl: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerCaptchaSolveInput\",\n    required: [\"provider\", \"apiKey\"],\n  },\n);\n\nexport const opensteerCaptchaSolveOutputSchema: JsonSchema = objectSchema(\n  {\n    captcha: captchaDetectionResultSchema,\n    token: stringSchema({ minLength: 1 }),\n    injected: { type: \"boolean\" },\n    provider: captchaProviderSchema,\n  },\n  {\n    title: \"OpensteerCaptchaSolveOutput\",\n    required: [\"captcha\", \"token\", \"injected\", \"provider\"],\n  },\n);\n","import {\n  artifactReferenceSchema,\n  opensteerArtifactSchema,\n  type ArtifactReference,\n  type OpensteerArtifact,\n} from \"./artifacts.js\";\nimport { opensteerEventSchema, type OpensteerEvent } from \"./events.js\";\nimport type { DocumentEpoch, DocumentRef, FrameRef, PageRef, SessionRef } from \"./identity.js\";\nimport {\n  documentEpochSchema,\n  documentRefSchema,\n  frameRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n} from \"./identity.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\nimport { opensteerErrorSchema, type OpensteerError } from \"./errors.js\";\n\nexport type TraceOutcome = \"ok\" | \"error\";\n\nexport interface TraceContext {\n  readonly sessionRef?: SessionRef;\n  readonly pageRef?: PageRef;\n  readonly frameRef?: FrameRef;\n  readonly documentRef?: DocumentRef;\n  readonly documentEpoch?: DocumentEpoch;\n}\n\nexport interface TraceRecord<TData = unknown> {\n  readonly traceId: string;\n  readonly stepId: string;\n  readonly operation: string;\n  readonly outcome: TraceOutcome;\n  readonly startedAt: number;\n  readonly completedAt: number;\n  readonly durationMs: number;\n  readonly context: TraceContext;\n  readonly events: readonly OpensteerEvent[];\n  readonly artifacts?: readonly ArtifactReference[];\n  readonly data?: TData;\n  readonly error?: OpensteerError;\n}\n\nexport interface TraceBundle<TData = unknown> {\n  readonly trace: TraceRecord<TData>;\n  readonly artifacts?: readonly OpensteerArtifact[];\n}\n\nexport const traceContextSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n  },\n  {\n    title: \"TraceContext\",\n  },\n);\n\nexport function traceRecordSchema(dataSchema: JsonSchema = {}): JsonSchema {\n  return objectSchema(\n    {\n      traceId: stringSchema(),\n      stepId: stringSchema(),\n      operation: stringSchema(),\n      outcome: enumSchema([\"ok\", \"error\"] as const),\n      startedAt: integerSchema({ minimum: 0 }),\n      completedAt: integerSchema({ minimum: 0 }),\n      durationMs: integerSchema({ minimum: 0 }),\n      context: traceContextSchema,\n      events: arraySchema(opensteerEventSchema),\n      artifacts: arraySchema(artifactReferenceSchema),\n      data: dataSchema,\n      error: opensteerErrorSchema,\n    },\n    {\n      title: \"TraceRecord\",\n      required: [\n        \"traceId\",\n        \"stepId\",\n        \"operation\",\n        \"outcome\",\n        \"startedAt\",\n        \"completedAt\",\n        \"durationMs\",\n        \"context\",\n        \"events\",\n      ],\n    },\n  );\n}\n\nexport function traceBundleSchema(dataSchema: JsonSchema = {}): JsonSchema {\n  return objectSchema(\n    {\n      trace: traceRecordSchema(dataSchema),\n      artifacts: arraySchema(opensteerArtifactSchema),\n    },\n    {\n      title: \"TraceBundle\",\n      required: [\"trace\"],\n    },\n  );\n}\n","import type { DocumentEpoch, DocumentRef, FrameRef, PageRef, SessionRef } from \"./identity.js\";\nimport {\n  documentEpochSchema,\n  documentRefSchema,\n  frameRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n} from \"./identity.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  recordSchema,\n  stringSchema,\n  type JsonSchema,\n  type JsonValue,\n} from \"./json.js\";\n\nexport const observabilityProfiles = [\"off\", \"baseline\", \"diagnostic\"] as const;\nexport type ObservabilityProfile = (typeof observabilityProfiles)[number];\n\nexport interface ObservabilityTraceContext {\n  readonly traceparent?: string;\n  readonly baggage?: string;\n}\n\nexport interface ObservabilityRedactionConfig {\n  readonly sensitiveKeys?: readonly string[];\n  readonly sensitiveValues?: readonly string[];\n}\n\nexport interface ObservabilityConfig {\n  readonly profile: ObservabilityProfile;\n  readonly labels?: Readonly<Record<string, string>>;\n  readonly traceContext?: ObservabilityTraceContext;\n  readonly redaction?: ObservabilityRedactionConfig;\n}\n\nexport interface ObservationContext {\n  readonly sessionRef?: SessionRef;\n  readonly pageRef?: PageRef;\n  readonly frameRef?: FrameRef;\n  readonly documentRef?: DocumentRef;\n  readonly documentEpoch?: DocumentEpoch;\n}\n\nexport const observationEventPhases = [\n  \"started\",\n  \"updated\",\n  \"completed\",\n  \"failed\",\n  \"occurred\",\n] as const;\nexport type ObservationEventPhase = (typeof observationEventPhases)[number];\n\nexport const observationEventKinds = [\n  \"session\",\n  \"operation\",\n  \"page\",\n  \"console\",\n  \"error\",\n  \"network\",\n  \"artifact\",\n  \"annotation\",\n  \"runtime\",\n  \"observability\",\n] as const;\nexport type ObservationEventKind = (typeof observationEventKinds)[number];\n\nexport interface ObservationEventError {\n  readonly code?: string;\n  readonly message: string;\n  readonly retriable?: boolean;\n  readonly details?: JsonValue;\n}\n\nexport interface ObservationEvent {\n  readonly eventId: string;\n  readonly sessionId: string;\n  readonly sequence: number;\n  readonly kind: ObservationEventKind;\n  readonly phase: ObservationEventPhase;\n  readonly createdAt: number;\n  readonly correlationId: string;\n  readonly spanId?: string;\n  readonly parentSpanId?: string;\n  readonly context?: ObservationContext;\n  readonly data?: JsonValue;\n  readonly error?: ObservationEventError;\n  readonly artifactIds?: readonly string[];\n}\n\nexport const observationArtifactKinds = [\n  \"screenshot\",\n  \"dom-snapshot\",\n  \"html-snapshot\",\n  \"trace-bundle\",\n  \"frame-buffer\",\n  \"request-body\",\n  \"response-body\",\n  \"log\",\n  \"other\",\n] as const;\nexport type ObservationArtifactKind = (typeof observationArtifactKinds)[number];\n\nexport interface ObservationArtifact {\n  readonly artifactId: string;\n  readonly sessionId: string;\n  readonly kind: ObservationArtifactKind;\n  readonly createdAt: number;\n  readonly context?: ObservationContext;\n  readonly mediaType?: string;\n  readonly byteLength?: number;\n  readonly sha256?: string;\n  readonly opensteerArtifactId?: string;\n  readonly storageKey?: string;\n  readonly metadata?: JsonValue;\n}\n\nexport interface ObservationSession {\n  readonly sessionId: string;\n  readonly profile: ObservabilityProfile;\n  readonly labels?: Readonly<Record<string, string>>;\n  readonly traceContext?: ObservabilityTraceContext;\n  readonly openedAt: number;\n  readonly updatedAt: number;\n  readonly closedAt?: number;\n  readonly currentSequence: number;\n  readonly eventCount: number;\n  readonly artifactCount: number;\n}\n\nexport interface OpenObservationSessionInput {\n  readonly sessionId: string;\n  readonly openedAt?: number;\n  readonly config?: Partial<ObservabilityConfig>;\n}\n\nexport interface ConfigureObservationSessionInput {\n  readonly updatedAt?: number;\n  readonly config?: Partial<ObservabilityConfig>;\n}\n\nexport interface AppendObservationEventInput {\n  readonly eventId?: string;\n  readonly kind: ObservationEventKind;\n  readonly phase: ObservationEventPhase;\n  readonly createdAt: number;\n  readonly correlationId: string;\n  readonly spanId?: string;\n  readonly parentSpanId?: string;\n  readonly context?: ObservationContext;\n  readonly data?: JsonValue;\n  readonly error?: ObservationEventError;\n  readonly artifactIds?: readonly string[];\n}\n\nexport interface WriteObservationArtifactInput {\n  readonly artifactId: string;\n  readonly kind: ObservationArtifactKind;\n  readonly createdAt: number;\n  readonly context?: ObservationContext;\n  readonly mediaType?: string;\n  readonly byteLength?: number;\n  readonly sha256?: string;\n  readonly opensteerArtifactId?: string;\n  readonly storageKey?: string;\n  readonly metadata?: JsonValue;\n}\n\nexport interface SessionObservationSink {\n  readonly sessionId: string;\n\n  configure?(input: ConfigureObservationSessionInput): Promise<void>;\n  append(input: AppendObservationEventInput): Promise<ObservationEvent>;\n  appendBatch(input: readonly AppendObservationEventInput[]): Promise<readonly ObservationEvent[]>;\n  writeArtifact(input: WriteObservationArtifactInput): Promise<ObservationArtifact>;\n  flush(reason?: string): Promise<void>;\n  close(reason?: string): Promise<void>;\n}\n\nexport interface ObservationSink {\n  openSession(input: OpenObservationSessionInput): Promise<SessionObservationSink>;\n}\n\nexport const observabilityProfileSchema: JsonSchema = enumSchema(observabilityProfiles, {\n  title: \"ObservabilityProfile\",\n});\n\nexport const observabilityTraceContextSchema: JsonSchema = objectSchema(\n  {\n    traceparent: stringSchema(),\n    baggage: stringSchema(),\n  },\n  {\n    title: \"ObservabilityTraceContext\",\n  },\n);\n\nexport const observabilityRedactionConfigSchema: JsonSchema = objectSchema(\n  {\n    sensitiveKeys: arraySchema(stringSchema()),\n    sensitiveValues: arraySchema(stringSchema()),\n  },\n  {\n    title: \"ObservabilityRedactionConfig\",\n  },\n);\n\nexport const observabilityConfigSchema: JsonSchema = objectSchema(\n  {\n    profile: observabilityProfileSchema,\n    labels: recordSchema(stringSchema()),\n    traceContext: observabilityTraceContextSchema,\n    redaction: observabilityRedactionConfigSchema,\n  },\n  {\n    title: \"ObservabilityConfig\",\n    required: [\"profile\"],\n  },\n);\n\nexport const observationContextSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n  },\n  {\n    title: \"ObservationContext\",\n  },\n);\n\nexport const observationEventErrorSchema: JsonSchema = objectSchema(\n  {\n    code: stringSchema(),\n    message: stringSchema(),\n    retriable: {\n      type: \"boolean\",\n    },\n    details: {},\n  },\n  {\n    title: \"ObservationEventError\",\n    required: [\"message\"],\n  },\n);\n\nexport const observationEventSchema: JsonSchema = objectSchema(\n  {\n    eventId: stringSchema(),\n    sessionId: stringSchema(),\n    sequence: integerSchema({ minimum: 1 }),\n    kind: enumSchema(observationEventKinds),\n    phase: enumSchema(observationEventPhases),\n    createdAt: integerSchema({ minimum: 0 }),\n    correlationId: stringSchema(),\n    spanId: stringSchema(),\n    parentSpanId: stringSchema(),\n    context: observationContextSchema,\n    data: {},\n    error: observationEventErrorSchema,\n    artifactIds: arraySchema(stringSchema()),\n  },\n  {\n    title: \"ObservationEvent\",\n    required: [\"eventId\", \"sessionId\", \"sequence\", \"kind\", \"phase\", \"createdAt\", \"correlationId\"],\n  },\n);\n\nexport const observationArtifactSchema: JsonSchema = objectSchema(\n  {\n    artifactId: stringSchema(),\n    sessionId: stringSchema(),\n    kind: enumSchema(observationArtifactKinds),\n    createdAt: integerSchema({ minimum: 0 }),\n    context: observationContextSchema,\n    mediaType: stringSchema(),\n    byteLength: integerSchema({ minimum: 0 }),\n    sha256: stringSchema(),\n    opensteerArtifactId: stringSchema(),\n    storageKey: stringSchema(),\n    metadata: {},\n  },\n  {\n    title: \"ObservationArtifact\",\n    required: [\"artifactId\", \"sessionId\", \"kind\", \"createdAt\"],\n  },\n);\n\nexport const observationSessionSchema: JsonSchema = objectSchema(\n  {\n    sessionId: stringSchema(),\n    profile: observabilityProfileSchema,\n    labels: recordSchema(stringSchema()),\n    traceContext: observabilityTraceContextSchema,\n    openedAt: integerSchema({ minimum: 0 }),\n    updatedAt: integerSchema({ minimum: 0 }),\n    closedAt: integerSchema({ minimum: 0 }),\n    currentSequence: integerSchema({ minimum: 0 }),\n    eventCount: integerSchema({ minimum: 0 }),\n    artifactCount: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"ObservationSession\",\n    required: [\n      \"sessionId\",\n      \"profile\",\n      \"openedAt\",\n      \"updatedAt\",\n      \"currentSequence\",\n      \"eventCount\",\n      \"artifactCount\",\n    ],\n  },\n);\n","import type { OpensteerArtifact } from \"./artifacts.js\";\nimport { opensteerArtifactSchema } from \"./artifacts.js\";\nimport type { OpensteerCapability } from \"./capabilities.js\";\nimport { opensteerCapabilitySetSchema } from \"./capabilities.js\";\nimport type { OpensteerError } from \"./errors.js\";\nimport { opensteerErrorSchema } from \"./errors.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  literalSchema,\n  objectSchema,\n  oneOfSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\nimport type { TraceRecord } from \"./traces.js\";\nimport { traceRecordSchema } from \"./traces.js\";\nimport {\n  OPENSTEER_PROTOCOL_NAME,\n  OPENSTEER_PROTOCOL_VERSION,\n  type OpensteerProtocolVersion,\n} from \"./version.js\";\n\nexport interface OpensteerRequestEnvelope<TInput> {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly requestId: string;\n  readonly operation: string;\n  readonly sentAt: number;\n  readonly input: TInput;\n}\n\nexport interface OpensteerSuccessEnvelope<TOutput> {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly requestId: string;\n  readonly operation: string;\n  readonly status: \"ok\";\n  readonly receivedAt: number;\n  readonly data: TOutput;\n  readonly trace?: TraceRecord<TOutput>;\n  readonly artifacts?: readonly OpensteerArtifact[];\n  readonly capabilities?: readonly OpensteerCapability[];\n}\n\nexport interface OpensteerErrorEnvelope {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly requestId: string;\n  readonly operation: string;\n  readonly status: \"error\";\n  readonly receivedAt: number;\n  readonly error: OpensteerError;\n  readonly trace?: TraceRecord<unknown>;\n  readonly artifacts?: readonly OpensteerArtifact[];\n  readonly capabilities?: readonly OpensteerCapability[];\n}\n\nexport type OpensteerResponseEnvelope<TOutput> =\n  | OpensteerSuccessEnvelope<TOutput>\n  | OpensteerErrorEnvelope;\n\nexport function createRequestEnvelope<TInput>(\n  operation: string,\n  input: TInput,\n  options: {\n    readonly requestId: string;\n    readonly sentAt?: number;\n    readonly version?: OpensteerProtocolVersion;\n  },\n): OpensteerRequestEnvelope<TInput> {\n  return {\n    protocol: OPENSTEER_PROTOCOL_NAME,\n    version: options.version ?? OPENSTEER_PROTOCOL_VERSION,\n    requestId: options.requestId,\n    operation,\n    sentAt: options.sentAt ?? Date.now(),\n    input,\n  };\n}\n\nexport function createSuccessEnvelope<TOutput>(\n  request: Pick<OpensteerRequestEnvelope<unknown>, \"requestId\" | \"operation\" | \"version\">,\n  data: TOutput,\n  options: {\n    readonly receivedAt?: number;\n    readonly trace?: TraceRecord<TOutput>;\n    readonly artifacts?: readonly OpensteerArtifact[];\n    readonly capabilities?: readonly OpensteerCapability[];\n  } = {},\n): OpensteerSuccessEnvelope<TOutput> {\n  return {\n    protocol: OPENSTEER_PROTOCOL_NAME,\n    version: request.version,\n    requestId: request.requestId,\n    operation: request.operation,\n    status: \"ok\",\n    receivedAt: options.receivedAt ?? Date.now(),\n    data,\n    ...(options.trace === undefined ? {} : { trace: options.trace }),\n    ...(options.artifacts === undefined ? {} : { artifacts: options.artifacts }),\n    ...(options.capabilities === undefined ? {} : { capabilities: options.capabilities }),\n  };\n}\n\nexport function createErrorEnvelope(\n  request: Pick<OpensteerRequestEnvelope<unknown>, \"requestId\" | \"operation\" | \"version\">,\n  error: OpensteerError,\n  options: {\n    readonly receivedAt?: number;\n    readonly trace?: TraceRecord<unknown>;\n    readonly artifacts?: readonly OpensteerArtifact[];\n    readonly capabilities?: readonly OpensteerCapability[];\n  } = {},\n): OpensteerErrorEnvelope {\n  return {\n    protocol: OPENSTEER_PROTOCOL_NAME,\n    version: request.version,\n    requestId: request.requestId,\n    operation: request.operation,\n    status: \"error\",\n    receivedAt: options.receivedAt ?? Date.now(),\n    error,\n    ...(options.trace === undefined ? {} : { trace: options.trace }),\n    ...(options.artifacts === undefined ? {} : { artifacts: options.artifacts }),\n    ...(options.capabilities === undefined ? {} : { capabilities: options.capabilities }),\n  };\n}\n\nexport function isErrorEnvelope<TOutput>(\n  envelope: OpensteerResponseEnvelope<TOutput>,\n): envelope is OpensteerErrorEnvelope {\n  return envelope.status === \"error\";\n}\n\nfunction operationFieldSchema(operation: string | undefined): JsonSchema {\n  return operation === undefined ? stringSchema() : literalSchema(operation);\n}\n\nexport function requestEnvelopeSchema(inputSchema: JsonSchema, operation?: string): JsonSchema {\n  return objectSchema(\n    {\n      protocol: literalSchema(OPENSTEER_PROTOCOL_NAME),\n      version: literalSchema(OPENSTEER_PROTOCOL_VERSION),\n      requestId: stringSchema(),\n      operation: operationFieldSchema(operation),\n      sentAt: integerSchema({ minimum: 0 }),\n      input: inputSchema,\n    },\n    {\n      title: \"OpensteerRequestEnvelope\",\n      required: [\"protocol\", \"version\", \"requestId\", \"operation\", \"sentAt\", \"input\"],\n    },\n  );\n}\n\nexport function successEnvelopeSchema(dataSchema: JsonSchema, operation?: string): JsonSchema {\n  return objectSchema(\n    {\n      protocol: literalSchema(OPENSTEER_PROTOCOL_NAME),\n      version: literalSchema(OPENSTEER_PROTOCOL_VERSION),\n      requestId: stringSchema(),\n      operation: operationFieldSchema(operation),\n      status: enumSchema([\"ok\"] as const),\n      receivedAt: integerSchema({ minimum: 0 }),\n      data: dataSchema,\n      trace: traceRecordSchema(dataSchema),\n      artifacts: arraySchema(opensteerArtifactSchema),\n      capabilities: opensteerCapabilitySetSchema,\n    },\n    {\n      title: \"OpensteerSuccessEnvelope\",\n      required: [\"protocol\", \"version\", \"requestId\", \"operation\", \"status\", \"receivedAt\", \"data\"],\n    },\n  );\n}\n\nfunction errorEnvelopeSchema(operation?: string): JsonSchema {\n  return objectSchema(\n    {\n      protocol: literalSchema(OPENSTEER_PROTOCOL_NAME),\n      version: literalSchema(OPENSTEER_PROTOCOL_VERSION),\n      requestId: stringSchema(),\n      operation: operationFieldSchema(operation),\n      status: enumSchema([\"error\"] as const),\n      receivedAt: integerSchema({ minimum: 0 }),\n      error: opensteerErrorSchema,\n      trace: traceRecordSchema(),\n      artifacts: arraySchema(opensteerArtifactSchema),\n      capabilities: opensteerCapabilitySetSchema,\n    },\n    {\n      title: \"OpensteerErrorEnvelope\",\n      required: [\"protocol\", \"version\", \"requestId\", \"operation\", \"status\", \"receivedAt\", \"error\"],\n    },\n  );\n}\n\nexport const opensteerErrorEnvelopeSchema: JsonSchema = errorEnvelopeSchema();\n\nexport function responseEnvelopeSchema(dataSchema: JsonSchema, operation?: string): JsonSchema {\n  return oneOfSchema(\n    [successEnvelopeSchema(dataSchema, operation), errorEnvelopeSchema(operation)],\n    {\n      title: \"OpensteerResponseEnvelope\",\n    },\n  );\n}\n","import type { PageRef } from \"./identity.js\";\nimport type { OpensteerSemanticOperationName } from \"./semantic.js\";\nimport type { OpensteerCapability } from \"./capabilities.js\";\nimport type { OpensteerProtocolVersion } from \"./version.js\";\n\nexport const opensteerSessionGrantKinds = [\"semantic\", \"automation\", \"view\", \"cdp\"] as const;\n\nexport type OpensteerSessionGrantKind = (typeof opensteerSessionGrantKinds)[number];\nexport type OpensteerSessionGrantTransport = \"http\" | \"ws\";\nexport type OpensteerProviderMode = \"local\" | \"cloud\";\nexport type OpensteerSessionOwnership = \"owned\" | \"attached\" | \"managed\";\n\nexport interface OpensteerProviderDescriptor {\n  readonly mode: OpensteerProviderMode;\n  readonly ownership: OpensteerSessionOwnership;\n  readonly engine?: string;\n  readonly baseUrl?: string;\n  readonly region?: string;\n}\n\nexport interface OpensteerSessionCapabilities {\n  readonly semanticOperations: readonly OpensteerSemanticOperationName[];\n  readonly protocolCapabilities?: readonly OpensteerCapability[];\n  readonly sessionGrants?: readonly OpensteerSessionGrantKind[];\n  readonly instrumentation: {\n    readonly route: boolean;\n    readonly interceptScript: boolean;\n    readonly networkStream: boolean;\n  };\n}\n\nexport interface OpensteerSessionGrant {\n  readonly kind: OpensteerSessionGrantKind;\n  readonly transport: OpensteerSessionGrantTransport;\n  readonly url: string;\n  readonly token: string;\n  readonly expiresAt: number;\n}\n\nexport interface OpensteerSessionAccessGrantResponse {\n  readonly sessionId: string;\n  readonly expiresAt: number;\n  readonly grants: Partial<Record<OpensteerSessionGrantKind, OpensteerSessionGrant>>;\n}\n\nexport interface OpensteerRuntimeVersionInfo {\n  readonly protocolVersion: OpensteerProtocolVersion;\n  readonly runtimeCoreVersion?: string;\n  readonly packages?: Readonly<Record<string, string>>;\n}\n\nexport interface OpensteerSessionInfo {\n  readonly provider: OpensteerProviderDescriptor;\n  readonly workspace?: string;\n  readonly sessionId?: string;\n  readonly activePageRef?: PageRef;\n  readonly reconnectable: boolean;\n  readonly capabilities: OpensteerSessionCapabilities;\n  readonly grants?: readonly OpensteerSessionGrant[];\n  readonly runtime?: OpensteerRuntimeVersionInfo;\n}\n","import type { OpensteerSessionOwnership } from \"./session-info.js\";\n\nexport interface OpensteerViewport {\n  readonly width: number;\n  readonly height: number;\n}\n\nexport interface OpensteerViewStreamTab {\n  readonly index: number;\n  readonly targetId?: string;\n  readonly url: string;\n  readonly title: string;\n  readonly active: boolean;\n}\n\nexport type OpensteerViewStreamControlMessage =\n  | {\n      readonly type: \"hello\";\n      readonly sessionId: string;\n      readonly ts: number;\n      readonly mimeType: \"image/jpeg\";\n      readonly fps: number;\n      readonly quality: number;\n      readonly viewport: OpensteerViewport;\n    }\n  | {\n      readonly type: \"tabs\";\n      readonly sessionId: string;\n      readonly ts: number;\n      readonly activeTabIndex: number;\n      readonly tabs: readonly OpensteerViewStreamTab[];\n    }\n  | {\n      readonly type: \"status\";\n      readonly sessionId: string;\n      readonly ts: number;\n      readonly status: string;\n    }\n  | {\n      readonly type: \"error\";\n      readonly sessionId: string;\n      readonly ts: number;\n      readonly error: string;\n    };\n\nexport interface OpensteerViewStreamClientMessage {\n  readonly type: \"stream-config\";\n  readonly renderWidth: number;\n  readonly renderHeight: number;\n}\n\nexport interface OpensteerLocalViewSessionSummary {\n  readonly sessionId: string;\n  readonly label: string;\n  readonly status: \"live\" | \"stale\";\n  readonly workspace?: string;\n  readonly rootPath: string;\n  readonly engine: \"playwright\" | \"abp\";\n  readonly ownership: OpensteerSessionOwnership;\n  readonly pid?: number;\n  readonly startedAt: number;\n  readonly browserName?: string;\n}\n\nexport interface OpensteerLocalViewSessionsResponse {\n  readonly sessions: readonly OpensteerLocalViewSessionSummary[];\n}\n\nexport interface OpensteerLocalViewSessionCloseResponse {\n  readonly sessionId: string;\n  readonly closed: true;\n}\n","import type { OpensteerError } from \"./errors.js\";\nimport type { OpensteerSessionGrantKind, OpensteerSessionInfo } from \"./session-info.js\";\nimport type { OpensteerSemanticOperationName } from \"./semantic.js\";\nimport type { OpensteerProtocolVersion } from \"./version.js\";\nimport { OPENSTEER_PROTOCOL_NAME } from \"./version.js\";\n\nexport const opensteerAutomationOperationNames = [\n  \"route.register\",\n  \"route.unregister\",\n  \"route.resolve\",\n  \"session.info\",\n  \"network.stream.subscribe\",\n  \"network.stream.unsubscribe\",\n] as const;\n\nexport type OpensteerAutomationOperationName =\n  | OpensteerSemanticOperationName\n  | (typeof opensteerAutomationOperationNames)[number];\n\nexport interface OpensteerAutomationHelloMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"hello\";\n  readonly sessionId: string;\n  readonly grantKind: OpensteerSessionGrantKind;\n}\n\nexport interface OpensteerAutomationResumeMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"resume\";\n  readonly sessionId: string;\n}\n\nexport interface OpensteerAutomationInvokeMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"invoke\";\n  readonly requestId: string;\n  readonly operation: OpensteerAutomationOperationName;\n  readonly sentAt: number;\n  readonly input?: unknown;\n}\n\nexport interface OpensteerAutomationCancelMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"cancel\";\n  readonly requestId: string;\n  readonly sentAt: number;\n}\n\nexport interface OpensteerAutomationResultMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"result\";\n  readonly requestId: string;\n  readonly operation: OpensteerAutomationOperationName;\n  readonly receivedAt: number;\n  readonly data: unknown;\n}\n\nexport interface OpensteerAutomationErrorMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"error\";\n  readonly requestId?: string;\n  readonly operation?: OpensteerAutomationOperationName;\n  readonly receivedAt: number;\n  readonly error: OpensteerError;\n}\n\nexport interface OpensteerAutomationEventMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"event\";\n  readonly event: string;\n  readonly emittedAt: number;\n  readonly data: unknown;\n}\n\nexport interface OpensteerAutomationPingMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"ping\";\n  readonly sentAt: number;\n}\n\nexport interface OpensteerAutomationPongMessage {\n  readonly protocol: typeof OPENSTEER_PROTOCOL_NAME;\n  readonly version: OpensteerProtocolVersion;\n  readonly kind: \"pong\";\n  readonly sentAt: number;\n}\n\nexport type OpensteerAutomationClientMessage =\n  | OpensteerAutomationHelloMessage\n  | OpensteerAutomationResumeMessage\n  | OpensteerAutomationInvokeMessage\n  | OpensteerAutomationCancelMessage\n  | OpensteerAutomationPingMessage;\n\nexport type OpensteerAutomationServerMessage =\n  | OpensteerAutomationResultMessage\n  | OpensteerAutomationErrorMessage\n  | OpensteerAutomationEventMessage\n  | OpensteerAutomationPongMessage;\n\nexport interface OpensteerSessionInfoResult {\n  readonly session: OpensteerSessionInfo;\n}\n","import type { OpensteerCapability } from \"./capabilities.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  literalSchema,\n  objectSchema,\n  oneOfSchema,\n  stringSchema,\n  type JsonSchema,\n} from \"./json.js\";\nimport type { CoordinateSpace, Point, Rect, ViewportMetrics } from \"./geometry.js\";\nimport {\n  coordinateSpaceSchema,\n  pointSchema,\n  rectSchema,\n  viewportMetricsSchema,\n} from \"./geometry.js\";\nimport type { DocumentRef, FrameRef, NodeLocator, PageRef, SessionRef } from \"./identity.js\";\nimport {\n  frameRefSchema,\n  nodeLocatorSchema,\n  documentRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n} from \"./identity.js\";\nimport type { FrameInfo, PageInfo } from \"./metadata.js\";\nimport { frameInfoSchema, pageInfoSchema } from \"./metadata.js\";\nimport type { BodyPayload, HeaderEntry, NetworkRecord, NetworkResourceType } from \"./network.js\";\nimport {\n  bodyPayloadSchema,\n  headerEntrySchema,\n  networkRecordSchema,\n  networkResourceTypeSchema,\n} from \"./network.js\";\nimport type { CookieRecord, StorageSnapshot } from \"./storage.js\";\nimport { cookieRecordSchema, storageSnapshotSchema } from \"./storage.js\";\nimport type {\n  DomSnapshot,\n  HitTestResult,\n  HtmlSnapshot,\n  ScreenshotArtifact,\n  ScreenshotFormat,\n} from \"./snapshots.js\";\nimport {\n  domSnapshotSchema,\n  hitTestResultSchema,\n  htmlSnapshotSchema,\n  screenshotArtifactSchema,\n  screenshotFormatSchema,\n} from \"./snapshots.js\";\n\nexport type MouseButton = \"left\" | \"middle\" | \"right\";\nexport type KeyModifier = \"Shift\" | \"Control\" | \"Alt\" | \"Meta\";\n\nexport interface SessionTransportRequest {\n  readonly method: string;\n  readonly url: string;\n  readonly headers?: readonly HeaderEntry[];\n  readonly body?: BodyPayload;\n  readonly timeoutMs?: number;\n  readonly followRedirects?: boolean;\n}\n\nexport interface SessionTransportResponse {\n  readonly url: string;\n  readonly status: number;\n  readonly statusText: string;\n  readonly headers: readonly HeaderEntry[];\n  readonly body?: BodyPayload;\n  readonly redirected: boolean;\n}\n\nexport interface CreateSessionInput {}\nexport interface CreateSessionOutput {\n  readonly sessionRef: SessionRef;\n}\n\nexport interface CloseSessionInput {\n  readonly sessionRef: SessionRef;\n}\n\nexport interface CloseSessionOutput {\n  readonly closed: true;\n  readonly sessionRef: SessionRef;\n}\n\nexport interface CreatePageInput {\n  readonly sessionRef: SessionRef;\n  readonly openerPageRef?: PageRef;\n  readonly url?: string;\n}\n\nexport interface CreatePageOutput {\n  readonly pageInfo: PageInfo;\n  readonly mainFrame: FrameInfo;\n}\n\nexport interface ClosePageInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface ClosePageOutput {\n  readonly closed: true;\n  readonly pageRef: PageRef;\n}\n\nexport interface ActivatePageInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface NavigatePageInput {\n  readonly pageRef: PageRef;\n  readonly url: string;\n  readonly referrer?: string;\n  readonly timeoutMs?: number;\n}\n\nexport interface NavigatePageOutput {\n  readonly pageInfo: PageInfo;\n  readonly mainFrame: FrameInfo;\n}\n\nexport interface ReloadPageInput {\n  readonly pageRef: PageRef;\n  readonly timeoutMs?: number;\n}\n\nexport interface HistoryNavigationInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface HistoryNavigationOutput {\n  readonly navigated: boolean;\n}\n\nexport interface StopLoadingInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface StopLoadingOutput {\n  readonly stopped: true;\n}\n\nexport interface MouseMoveInput {\n  readonly pageRef: PageRef;\n  readonly point: Point;\n  readonly coordinateSpace: CoordinateSpace;\n}\n\nexport interface MouseMoveOutput {\n  readonly moved: true;\n}\n\nexport interface MouseClickInput {\n  readonly pageRef: PageRef;\n  readonly point: Point;\n  readonly coordinateSpace: CoordinateSpace;\n  readonly button?: MouseButton;\n  readonly clickCount?: number;\n  readonly modifiers?: readonly KeyModifier[];\n}\n\nexport interface MouseClickOutput {\n  readonly hitTest?: HitTestResult;\n}\n\nexport interface MouseScrollInput {\n  readonly pageRef: PageRef;\n  readonly point: Point;\n  readonly coordinateSpace: CoordinateSpace;\n  readonly delta: Point;\n}\n\nexport interface MouseScrollOutput {\n  readonly scrolled: true;\n}\n\nexport interface KeyPressInput {\n  readonly pageRef: PageRef;\n  readonly key: string;\n  readonly modifiers?: readonly KeyModifier[];\n}\n\nexport interface KeyPressOutput {\n  readonly pressed: true;\n}\n\nexport interface TextInputInput {\n  readonly pageRef: PageRef;\n  readonly text: string;\n}\n\nexport interface TextInputOutput {\n  readonly typed: true;\n}\n\nexport interface CaptureScreenshotInput {\n  readonly pageRef: PageRef;\n  readonly format?: ScreenshotFormat;\n  readonly clip?: Rect;\n  readonly clipSpace?: CoordinateSpace;\n  readonly fullPage?: boolean;\n  readonly includeCursor?: boolean;\n}\n\nexport interface SetExecutionStateInput {\n  readonly pageRef: PageRef;\n  readonly paused?: boolean;\n  readonly frozen?: boolean;\n}\n\nexport interface SetExecutionStateOutput {\n  readonly paused: boolean;\n  readonly frozen: boolean;\n}\n\nexport interface ListPagesInput {\n  readonly sessionRef: SessionRef;\n}\n\nexport interface ListPagesOutput {\n  readonly pages: readonly PageInfo[];\n}\n\nexport interface ListFramesInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface ListFramesOutput {\n  readonly frames: readonly FrameInfo[];\n}\n\nexport interface GetPageInfoInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface GetFrameInfoInput {\n  readonly frameRef: FrameRef;\n}\n\nexport type DocumentTargetInput =\n  | {\n      readonly frameRef: FrameRef;\n      readonly documentRef?: never;\n    }\n  | {\n      readonly documentRef: DocumentRef;\n      readonly frameRef?: never;\n    };\n\nexport type GetHtmlSnapshotInput = DocumentTargetInput;\n\nexport type GetDomSnapshotInput = DocumentTargetInput;\n\nexport interface ReadTextInput extends NodeLocator {}\n\nexport interface ReadTextOutput {\n  readonly text: string | null;\n}\n\nexport interface ReadAttributesInput extends NodeLocator {}\n\nexport interface AttributeEntry {\n  readonly name: string;\n  readonly value: string;\n}\n\nexport interface ReadAttributesOutput {\n  readonly attributes: readonly AttributeEntry[];\n}\n\nexport interface HitTestInput {\n  readonly pageRef: PageRef;\n  readonly point: Point;\n  readonly coordinateSpace: CoordinateSpace;\n  readonly ignorePointerEventsNone?: boolean;\n  readonly includeUserAgentShadowDom?: boolean;\n}\n\nexport interface GetViewportMetricsInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface GetNetworkRecordsInput {\n  readonly sessionRef: SessionRef;\n  readonly pageRef?: PageRef;\n  readonly requestIds?: readonly string[];\n  readonly url?: string;\n  readonly hostname?: string;\n  readonly path?: string;\n  readonly method?: string;\n  readonly status?: string;\n  readonly resourceType?: NetworkResourceType;\n  readonly includeBodies?: boolean;\n}\n\nexport interface GetNetworkRecordsOutput {\n  readonly records: readonly NetworkRecord[];\n}\n\nexport interface GetCookiesInput {\n  readonly sessionRef: SessionRef;\n  readonly urls?: readonly string[];\n}\n\nexport interface GetCookiesOutput {\n  readonly cookies: readonly CookieRecord[];\n}\n\nexport interface GetStorageSnapshotInput {\n  readonly sessionRef: SessionRef;\n  readonly includeSessionStorage?: boolean;\n  readonly includeIndexedDb?: boolean;\n}\n\nexport interface ExecuteSessionRequestInput {\n  readonly sessionRef: SessionRef;\n  readonly request: SessionTransportRequest;\n}\n\nexport const opensteerOperationNames = [\n  \"session.create\",\n  \"session.close\",\n  \"page.create\",\n  \"page.close\",\n  \"page.activate\",\n  \"page.navigate\",\n  \"page.reload\",\n  \"page.go-back\",\n  \"page.go-forward\",\n  \"page.stop-loading\",\n  \"input.mouse-move\",\n  \"input.mouse-click\",\n  \"input.mouse-scroll\",\n  \"input.key-press\",\n  \"input.text-input\",\n  \"artifact.capture-screenshot\",\n  \"execution.set-state\",\n  \"inspect.list-pages\",\n  \"inspect.list-frames\",\n  \"inspect.get-page-info\",\n  \"inspect.get-frame-info\",\n  \"inspect.get-html-snapshot\",\n  \"inspect.get-dom-snapshot\",\n  \"inspect.read-text\",\n  \"inspect.read-attributes\",\n  \"inspect.hit-test\",\n  \"inspect.get-viewport-metrics\",\n  \"inspect.get-network-records\",\n  \"inspect.get-cookies\",\n  \"inspect.get-storage-snapshot\",\n  \"transport.execute-session-request\",\n] as const;\n\nexport type OpensteerOperationName = (typeof opensteerOperationNames)[number];\n\nexport interface OpensteerOperationSpec<TInput = unknown, TOutput = unknown> {\n  readonly name: OpensteerOperationName;\n  readonly description: string;\n  readonly inputSchema: JsonSchema;\n  readonly outputSchema: JsonSchema;\n  readonly requiredCapabilities: readonly OpensteerCapability[];\n  resolveRequiredCapabilities?(input: TInput): readonly OpensteerCapability[];\n}\n\nfunction defineOperationSpec<TInput, TOutput>(\n  spec: OpensteerOperationSpec<TInput, TOutput>,\n): OpensteerOperationSpec<TInput, TOutput> {\n  return spec;\n}\n\nconst mouseButtonSchema: JsonSchema = enumSchema([\"left\", \"middle\", \"right\"] as const, {\n  title: \"MouseButton\",\n});\n\nconst keyModifierSchema: JsonSchema = enumSchema([\"Shift\", \"Control\", \"Alt\", \"Meta\"] as const, {\n  title: \"KeyModifier\",\n});\n\nconst emptyObjectSchema: JsonSchema = objectSchema(\n  {},\n  {\n    title: \"EmptyObject\",\n    required: [],\n  },\n);\n\nconst sessionTransportRequestSchema: JsonSchema = objectSchema(\n  {\n    method: stringSchema(),\n    url: stringSchema(),\n    headers: arraySchema(headerEntrySchema),\n    body: bodyPayloadSchema,\n    timeoutMs: integerSchema({ minimum: 0 }),\n    followRedirects: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"SessionTransportRequest\",\n    required: [\"method\", \"url\"],\n  },\n);\n\nconst sessionTransportResponseSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    status: integerSchema({ minimum: 0 }),\n    statusText: stringSchema(),\n    headers: arraySchema(headerEntrySchema),\n    body: bodyPayloadSchema,\n    redirected: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"SessionTransportResponse\",\n    required: [\"url\", \"status\", \"statusText\", \"headers\", \"redirected\"],\n  },\n);\n\nconst pageOperationResultSchema: JsonSchema = objectSchema(\n  {\n    pageInfo: pageInfoSchema,\n    mainFrame: frameInfoSchema,\n  },\n  {\n    title: \"PageOperationResult\",\n    required: [\"pageInfo\", \"mainFrame\"],\n  },\n);\n\nconst attributeEntrySchema: JsonSchema = objectSchema(\n  {\n    name: stringSchema(),\n    value: stringSchema(),\n  },\n  {\n    title: \"AttributeEntry\",\n    required: [\"name\", \"value\"],\n  },\n);\n\nconst createSessionInputSchema: JsonSchema = emptyObjectSchema;\nconst createSessionOutputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n  },\n  {\n    title: \"CreateSessionOutput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst closeSessionInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n  },\n  {\n    title: \"CloseSessionInput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst closeSessionOutputSchema: JsonSchema = objectSchema(\n  {\n    closed: literalSchema(true),\n    sessionRef: sessionRefSchema,\n  },\n  {\n    title: \"CloseSessionOutput\",\n    required: [\"closed\", \"sessionRef\"],\n  },\n);\n\nconst createPageInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    openerPageRef: pageRefSchema,\n    url: stringSchema(),\n  },\n  {\n    title: \"CreatePageInput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst closePageInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"ClosePageInput\",\n    required: [\"pageRef\"],\n  },\n);\n\nconst closePageOutputSchema: JsonSchema = objectSchema(\n  {\n    closed: literalSchema(true),\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"ClosePageOutput\",\n    required: [\"closed\", \"pageRef\"],\n  },\n);\n\nconst pageRefInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"PageRefInput\",\n    required: [\"pageRef\"],\n  },\n);\n\nconst navigatePageInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    url: stringSchema(),\n    referrer: stringSchema(),\n    timeoutMs: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"NavigatePageInput\",\n    required: [\"pageRef\", \"url\"],\n  },\n);\n\nconst reloadPageInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    timeoutMs: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"ReloadPageInput\",\n    required: [\"pageRef\"],\n  },\n);\n\nconst historyNavigationOutputSchema: JsonSchema = objectSchema(\n  {\n    navigated: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"HistoryNavigationOutput\",\n    required: [\"navigated\"],\n  },\n);\n\nconst stopLoadingOutputSchema: JsonSchema = objectSchema(\n  {\n    stopped: literalSchema(true),\n  },\n  {\n    title: \"StopLoadingOutput\",\n    required: [\"stopped\"],\n  },\n);\n\nconst mouseMoveInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    point: pointSchema,\n    coordinateSpace: coordinateSpaceSchema,\n  },\n  {\n    title: \"MouseMoveInput\",\n    required: [\"pageRef\", \"point\", \"coordinateSpace\"],\n  },\n);\n\nconst mouseMoveOutputSchema: JsonSchema = objectSchema(\n  {\n    moved: literalSchema(true),\n  },\n  {\n    title: \"MouseMoveOutput\",\n    required: [\"moved\"],\n  },\n);\n\nconst mouseClickInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    point: pointSchema,\n    coordinateSpace: coordinateSpaceSchema,\n    button: mouseButtonSchema,\n    clickCount: integerSchema({ minimum: 1 }),\n    modifiers: arraySchema(keyModifierSchema, { uniqueItems: true }),\n  },\n  {\n    title: \"MouseClickInput\",\n    required: [\"pageRef\", \"point\", \"coordinateSpace\"],\n  },\n);\n\nconst mouseClickOutputSchema: JsonSchema = objectSchema(\n  {\n    hitTest: hitTestResultSchema,\n  },\n  {\n    title: \"MouseClickOutput\",\n  },\n);\n\nconst mouseScrollInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    point: pointSchema,\n    coordinateSpace: coordinateSpaceSchema,\n    delta: pointSchema,\n  },\n  {\n    title: \"MouseScrollInput\",\n    required: [\"pageRef\", \"point\", \"coordinateSpace\", \"delta\"],\n  },\n);\n\nconst mouseScrollOutputSchema: JsonSchema = objectSchema(\n  {\n    scrolled: literalSchema(true),\n  },\n  {\n    title: \"MouseScrollOutput\",\n    required: [\"scrolled\"],\n  },\n);\n\nconst keyPressInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    key: stringSchema(),\n    modifiers: arraySchema(keyModifierSchema, { uniqueItems: true }),\n  },\n  {\n    title: \"KeyPressInput\",\n    required: [\"pageRef\", \"key\"],\n  },\n);\n\nconst keyPressOutputSchema: JsonSchema = objectSchema(\n  {\n    pressed: literalSchema(true),\n  },\n  {\n    title: \"KeyPressOutput\",\n    required: [\"pressed\"],\n  },\n);\n\nconst textInputInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    text: stringSchema(),\n  },\n  {\n    title: \"TextInputInput\",\n    required: [\"pageRef\", \"text\"],\n  },\n);\n\nconst textInputOutputSchema: JsonSchema = objectSchema(\n  {\n    typed: literalSchema(true),\n  },\n  {\n    title: \"TextInputOutput\",\n    required: [\"typed\"],\n  },\n);\n\nconst captureScreenshotInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    format: screenshotFormatSchema,\n    clip: rectSchema,\n    clipSpace: coordinateSpaceSchema,\n    fullPage: {\n      type: \"boolean\",\n    },\n    includeCursor: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"CaptureScreenshotInput\",\n    required: [\"pageRef\"],\n  },\n);\n\nconst setExecutionStateInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    paused: {\n      type: \"boolean\",\n    },\n    frozen: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"SetExecutionStateInput\",\n    required: [\"pageRef\"],\n  },\n);\n\nconst setExecutionStateOutputSchema: JsonSchema = objectSchema(\n  {\n    paused: {\n      type: \"boolean\",\n    },\n    frozen: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"SetExecutionStateOutput\",\n    required: [\"paused\", \"frozen\"],\n  },\n);\n\nconst listPagesInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n  },\n  {\n    title: \"ListPagesInput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst listPagesOutputSchema: JsonSchema = objectSchema(\n  {\n    pages: arraySchema(pageInfoSchema),\n  },\n  {\n    title: \"ListPagesOutput\",\n    required: [\"pages\"],\n  },\n);\n\nconst listFramesOutputSchema: JsonSchema = objectSchema(\n  {\n    frames: arraySchema(frameInfoSchema),\n  },\n  {\n    title: \"ListFramesOutput\",\n    required: [\"frames\"],\n  },\n);\n\nconst frameRefInputSchema: JsonSchema = objectSchema(\n  {\n    frameRef: frameRefSchema,\n  },\n  {\n    title: \"FrameRefInput\",\n    required: [\"frameRef\"],\n  },\n);\n\nconst frameDocumentTargetSchema: JsonSchema = objectSchema(\n  {\n    frameRef: frameRefSchema,\n  },\n  {\n    title: \"FrameDocumentTarget\",\n    required: [\"frameRef\"],\n  },\n);\n\nconst concreteDocumentTargetSchema: JsonSchema = objectSchema(\n  {\n    documentRef: documentRefSchema,\n  },\n  {\n    title: \"ConcreteDocumentTarget\",\n    required: [\"documentRef\"],\n  },\n);\n\nconst documentTargetSchema: JsonSchema = oneOfSchema(\n  [frameDocumentTargetSchema, concreteDocumentTargetSchema],\n  {\n    title: \"DocumentTarget\",\n  },\n);\n\nconst readTextOutputSchema: JsonSchema = objectSchema(\n  {\n    text: {\n      type: [\"string\", \"null\"],\n    },\n  },\n  {\n    title: \"ReadTextOutput\",\n    required: [\"text\"],\n  },\n);\n\nconst readAttributesOutputSchema: JsonSchema = objectSchema(\n  {\n    attributes: arraySchema(attributeEntrySchema),\n  },\n  {\n    title: \"ReadAttributesOutput\",\n    required: [\"attributes\"],\n  },\n);\n\nconst hitTestInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    point: pointSchema,\n    coordinateSpace: coordinateSpaceSchema,\n    ignorePointerEventsNone: {\n      type: \"boolean\",\n    },\n    includeUserAgentShadowDom: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"HitTestInput\",\n    required: [\"pageRef\", \"point\", \"coordinateSpace\"],\n  },\n);\n\nconst getNetworkRecordsInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n    requestIds: arraySchema(stringSchema({ minLength: 1 }), {\n      uniqueItems: true,\n    }),\n    url: stringSchema({ minLength: 1 }),\n    hostname: stringSchema({ minLength: 1 }),\n    path: stringSchema({ minLength: 1 }),\n    method: stringSchema({ minLength: 1 }),\n    status: stringSchema({ minLength: 1 }),\n    resourceType: networkResourceTypeSchema,\n    includeBodies: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"GetNetworkRecordsInput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst getNetworkRecordsOutputSchema: JsonSchema = objectSchema(\n  {\n    records: arraySchema(networkRecordSchema),\n  },\n  {\n    title: \"GetNetworkRecordsOutput\",\n    required: [\"records\"],\n  },\n);\n\nconst getCookiesInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    urls: arraySchema(stringSchema()),\n  },\n  {\n    title: \"GetCookiesInput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst getCookiesOutputSchema: JsonSchema = objectSchema(\n  {\n    cookies: arraySchema(cookieRecordSchema),\n  },\n  {\n    title: \"GetCookiesOutput\",\n    required: [\"cookies\"],\n  },\n);\n\nconst getStorageSnapshotInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    includeSessionStorage: {\n      type: \"boolean\",\n    },\n    includeIndexedDb: {\n      type: \"boolean\",\n    },\n  },\n  {\n    title: \"GetStorageSnapshotInput\",\n    required: [\"sessionRef\"],\n  },\n);\n\nconst executeSessionRequestInputSchema: JsonSchema = objectSchema(\n  {\n    sessionRef: sessionRefSchema,\n    request: sessionTransportRequestSchema,\n  },\n  {\n    title: \"ExecuteSessionRequestInput\",\n    required: [\"sessionRef\", \"request\"],\n  },\n);\n\nexport function resolveRequiredCapabilities<TInput>(\n  spec: Pick<\n    OpensteerOperationSpec<TInput, unknown>,\n    \"requiredCapabilities\" | \"resolveRequiredCapabilities\"\n  >,\n  input: TInput,\n): readonly OpensteerCapability[] {\n  return spec.resolveRequiredCapabilities?.(input) ?? spec.requiredCapabilities;\n}\n\nexport const opensteerOperationSpecifications = [\n  defineOperationSpec<CreateSessionInput, CreateSessionOutput>({\n    name: \"session.create\",\n    description: \"Create a new isolated session boundary.\",\n    inputSchema: createSessionInputSchema,\n    outputSchema: createSessionOutputSchema,\n    requiredCapabilities: [\"sessions.manage\"],\n  }),\n  defineOperationSpec<CloseSessionInput, CloseSessionOutput>({\n    name: \"session.close\",\n    description: \"Close a session and release all associated pages.\",\n    inputSchema: closeSessionInputSchema,\n    outputSchema: closeSessionOutputSchema,\n    requiredCapabilities: [\"sessions.manage\"],\n  }),\n  defineOperationSpec<CreatePageInput, CreatePageOutput>({\n    name: \"page.create\",\n    description: \"Create a top-level browsing context within a session.\",\n    inputSchema: createPageInputSchema,\n    outputSchema: pageOperationResultSchema,\n    requiredCapabilities: [\"pages.manage\"],\n  }),\n  defineOperationSpec<ClosePageInput, ClosePageOutput>({\n    name: \"page.close\",\n    description: \"Close an existing top-level browsing context.\",\n    inputSchema: closePageInputSchema,\n    outputSchema: closePageOutputSchema,\n    requiredCapabilities: [\"pages.manage\"],\n  }),\n  defineOperationSpec<ActivatePageInput, PageInfo>({\n    name: \"page.activate\",\n    description: \"Make a page the active top-level browsing context.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: pageInfoSchema,\n    requiredCapabilities: [\"pages.manage\"],\n  }),\n  defineOperationSpec<NavigatePageInput, NavigatePageOutput>({\n    name: \"page.navigate\",\n    description: \"Navigate a page to a new URL.\",\n    inputSchema: navigatePageInputSchema,\n    outputSchema: pageOperationResultSchema,\n    requiredCapabilities: [\"pages.navigate\"],\n  }),\n  defineOperationSpec<ReloadPageInput, NavigatePageOutput>({\n    name: \"page.reload\",\n    description: \"Reload the current main frame document.\",\n    inputSchema: reloadPageInputSchema,\n    outputSchema: pageOperationResultSchema,\n    requiredCapabilities: [\"pages.navigate\"],\n  }),\n  defineOperationSpec<HistoryNavigationInput, HistoryNavigationOutput>({\n    name: \"page.go-back\",\n    description: \"Navigate backwards in page history.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: historyNavigationOutputSchema,\n    requiredCapabilities: [\"pages.navigate\"],\n  }),\n  defineOperationSpec<HistoryNavigationInput, HistoryNavigationOutput>({\n    name: \"page.go-forward\",\n    description: \"Navigate forwards in page history.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: historyNavigationOutputSchema,\n    requiredCapabilities: [\"pages.navigate\"],\n  }),\n  defineOperationSpec<StopLoadingInput, StopLoadingOutput>({\n    name: \"page.stop-loading\",\n    description: \"Stop the current navigation or resource load.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: stopLoadingOutputSchema,\n    requiredCapabilities: [\"pages.navigate\"],\n  }),\n  defineOperationSpec<MouseMoveInput, MouseMoveOutput>({\n    name: \"input.mouse-move\",\n    description: \"Move the mouse pointer in the requested coordinate space.\",\n    inputSchema: mouseMoveInputSchema,\n    outputSchema: mouseMoveOutputSchema,\n    requiredCapabilities: [\"input.pointer\"],\n  }),\n  defineOperationSpec<MouseClickInput, MouseClickOutput>({\n    name: \"input.mouse-click\",\n    description: \"Dispatch a pointer click and optionally return the resolved target.\",\n    inputSchema: mouseClickInputSchema,\n    outputSchema: mouseClickOutputSchema,\n    requiredCapabilities: [\"input.pointer\"],\n    resolveRequiredCapabilities: (input) =>\n      (input.modifiers?.length ?? 0) > 0 ? [\"input.pointer\", \"input.keyboard\"] : [\"input.pointer\"],\n  }),\n  defineOperationSpec<MouseScrollInput, MouseScrollOutput>({\n    name: \"input.mouse-scroll\",\n    description: \"Dispatch a wheel scroll at the given coordinate.\",\n    inputSchema: mouseScrollInputSchema,\n    outputSchema: mouseScrollOutputSchema,\n    requiredCapabilities: [\"input.pointer\"],\n  }),\n  defineOperationSpec<KeyPressInput, KeyPressOutput>({\n    name: \"input.key-press\",\n    description: \"Dispatch a key press with optional modifier keys.\",\n    inputSchema: keyPressInputSchema,\n    outputSchema: keyPressOutputSchema,\n    requiredCapabilities: [\"input.keyboard\"],\n  }),\n  defineOperationSpec<TextInputInput, TextInputOutput>({\n    name: \"input.text-input\",\n    description: \"Insert raw text into the focused page target.\",\n    inputSchema: textInputInputSchema,\n    outputSchema: textInputOutputSchema,\n    requiredCapabilities: [\"input.keyboard\"],\n  }),\n  defineOperationSpec<CaptureScreenshotInput, ScreenshotArtifact>({\n    name: \"artifact.capture-screenshot\",\n    description: \"Capture a screenshot artifact from the current page view.\",\n    inputSchema: captureScreenshotInputSchema,\n    outputSchema: screenshotArtifactSchema,\n    requiredCapabilities: [\"artifacts.screenshot\"],\n  }),\n  defineOperationSpec<SetExecutionStateInput, SetExecutionStateOutput>({\n    name: \"execution.set-state\",\n    description: \"Pause, resume, or freeze page execution state.\",\n    inputSchema: setExecutionStateInputSchema,\n    outputSchema: setExecutionStateOutputSchema,\n    requiredCapabilities: [],\n    resolveRequiredCapabilities: (input) => {\n      const required: OpensteerCapability[] = [];\n\n      if (input.paused === true) {\n        required.push(\"execution.pause\");\n      } else if (input.paused === false) {\n        required.push(\"execution.resume\");\n      }\n\n      if (input.frozen !== undefined) {\n        required.push(\"execution.freeze\");\n      }\n\n      return required;\n    },\n  }),\n  defineOperationSpec<ListPagesInput, ListPagesOutput>({\n    name: \"inspect.list-pages\",\n    description: \"List all pages in the current session.\",\n    inputSchema: listPagesInputSchema,\n    outputSchema: listPagesOutputSchema,\n    requiredCapabilities: [\"inspect.pages\"],\n  }),\n  defineOperationSpec<ListFramesInput, ListFramesOutput>({\n    name: \"inspect.list-frames\",\n    description: \"List all frames within a page.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: listFramesOutputSchema,\n    requiredCapabilities: [\"inspect.frames\"],\n  }),\n  defineOperationSpec<GetPageInfoInput, PageInfo>({\n    name: \"inspect.get-page-info\",\n    description: \"Read metadata for a specific page.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: pageInfoSchema,\n    requiredCapabilities: [\"inspect.pages\"],\n  }),\n  defineOperationSpec<GetFrameInfoInput, FrameInfo>({\n    name: \"inspect.get-frame-info\",\n    description: \"Read metadata for a specific frame.\",\n    inputSchema: frameRefInputSchema,\n    outputSchema: frameInfoSchema,\n    requiredCapabilities: [\"inspect.frames\"],\n  }),\n  defineOperationSpec<GetHtmlSnapshotInput, HtmlSnapshot>({\n    name: \"inspect.get-html-snapshot\",\n    description: \"Read raw HTML for a frame or concrete document.\",\n    inputSchema: documentTargetSchema,\n    outputSchema: htmlSnapshotSchema,\n    requiredCapabilities: [\"inspect.html\"],\n  }),\n  defineOperationSpec<GetDomSnapshotInput, DomSnapshot>({\n    name: \"inspect.get-dom-snapshot\",\n    description: \"Read a structured DOM snapshot for a frame or concrete document.\",\n    inputSchema: documentTargetSchema,\n    outputSchema: domSnapshotSchema,\n    requiredCapabilities: [\"inspect.domSnapshot\"],\n  }),\n  defineOperationSpec<ReadTextInput, ReadTextOutput>({\n    name: \"inspect.read-text\",\n    description: \"Read text content for a node locator.\",\n    inputSchema: nodeLocatorSchema,\n    outputSchema: readTextOutputSchema,\n    requiredCapabilities: [\"inspect.text\"],\n  }),\n  defineOperationSpec<ReadAttributesInput, ReadAttributesOutput>({\n    name: \"inspect.read-attributes\",\n    description: \"Read ordered attributes for a node locator.\",\n    inputSchema: nodeLocatorSchema,\n    outputSchema: readAttributesOutputSchema,\n    requiredCapabilities: [\"inspect.attributes\"],\n  }),\n  defineOperationSpec<HitTestInput, HitTestResult>({\n    name: \"inspect.hit-test\",\n    description: \"Resolve a point into the current DOM target at that coordinate.\",\n    inputSchema: hitTestInputSchema,\n    outputSchema: hitTestResultSchema,\n    requiredCapabilities: [\"inspect.hitTest\"],\n  }),\n  defineOperationSpec<GetViewportMetricsInput, ViewportMetrics>({\n    name: \"inspect.get-viewport-metrics\",\n    description: \"Read layout, visual viewport, and scroll metrics for a page.\",\n    inputSchema: pageRefInputSchema,\n    outputSchema: viewportMetricsSchema,\n    requiredCapabilities: [\"inspect.viewportMetrics\"],\n  }),\n  defineOperationSpec<GetNetworkRecordsInput, GetNetworkRecordsOutput>({\n    name: \"inspect.get-network-records\",\n    description: \"Read normalized network records for a session or page.\",\n    inputSchema: getNetworkRecordsInputSchema,\n    outputSchema: getNetworkRecordsOutputSchema,\n    requiredCapabilities: [\"inspect.network\"],\n    resolveRequiredCapabilities: (input) =>\n      input.includeBodies === true\n        ? [\"inspect.network\", \"inspect.networkBodies\"]\n        : [\"inspect.network\"],\n  }),\n  defineOperationSpec<GetCookiesInput, GetCookiesOutput>({\n    name: \"inspect.get-cookies\",\n    description: \"Read cookie state filtered by URL semantics when requested.\",\n    inputSchema: getCookiesInputSchema,\n    outputSchema: getCookiesOutputSchema,\n    requiredCapabilities: [\"inspect.cookies\"],\n  }),\n  defineOperationSpec<GetStorageSnapshotInput, StorageSnapshot>({\n    name: \"inspect.get-storage-snapshot\",\n    description: \"Read storage state for origins reachable in the session boundary.\",\n    inputSchema: getStorageSnapshotInputSchema,\n    outputSchema: storageSnapshotSchema,\n    requiredCapabilities: [\"inspect.localStorage\"],\n    resolveRequiredCapabilities: (input) => {\n      const required: OpensteerCapability[] = [\"inspect.localStorage\"];\n\n      if (input.includeSessionStorage ?? true) {\n        required.push(\"inspect.sessionStorage\");\n      }\n      if (input.includeIndexedDb ?? true) {\n        required.push(\"inspect.indexedDb\");\n      }\n\n      return required;\n    },\n  }),\n  defineOperationSpec<ExecuteSessionRequestInput, SessionTransportResponse>({\n    name: \"transport.execute-session-request\",\n    description: \"Execute an HTTP request within the active browser session boundary.\",\n    inputSchema: executeSessionRequestInputSchema,\n    outputSchema: sessionTransportResponseSchema,\n    requiredCapabilities: [\"transport.sessionHttp\"],\n  }),\n] as const satisfies readonly OpensteerOperationSpec[];\n\nexport const opensteerOperationSpecificationMap = Object.fromEntries(\n  opensteerOperationSpecifications.map((spec) => [spec.name, spec]),\n) as Record<OpensteerOperationName, OpensteerOperationSpec>;\n","import type { JsonSchema } from \"./json.js\";\nimport { OPENSTEER_PROTOCOL_MEDIA_TYPE, OPENSTEER_PROTOCOL_REST_BASE_PATH } from \"./version.js\";\nimport { requestEnvelopeSchema, responseEnvelopeSchema } from \"./envelopes.js\";\nimport { opensteerOperationSpecifications, type OpensteerOperationName } from \"./operations.js\";\n\nexport type OpensteerHttpMethod = \"POST\";\n\nexport interface OpensteerRestEndpointDescriptor {\n  readonly name: OpensteerOperationName;\n  readonly method: OpensteerHttpMethod;\n  readonly path: string;\n  readonly description: string;\n  readonly mediaType: string;\n  readonly requestSchema: JsonSchema;\n  readonly responseSchema: JsonSchema;\n}\n\nexport const opensteerRestEndpoints: readonly OpensteerRestEndpointDescriptor[] =\n  opensteerOperationSpecifications.map((spec) => ({\n    name: spec.name,\n    method: \"POST\",\n    path: `${OPENSTEER_PROTOCOL_REST_BASE_PATH}/operations/${spec.name.replaceAll(\".\", \"/\")}`,\n    description: spec.description,\n    mediaType: OPENSTEER_PROTOCOL_MEDIA_TYPE,\n    requestSchema: requestEnvelopeSchema(spec.inputSchema, spec.name),\n    responseSchema: responseEnvelopeSchema(spec.outputSchema, spec.name),\n  }));\n","import type { JsonSchema } from \"./json.js\";\nimport {\n  arraySchema,\n  enumSchema,\n  integerSchema,\n  objectSchema,\n  oneOfSchema,\n  recordSchema,\n  stringSchema,\n} from \"./json.js\";\n\nexport interface OpensteerScriptBeautifyInput {\n  readonly artifactId?: string;\n  readonly content?: string;\n  readonly persist?: boolean;\n}\n\nexport interface OpensteerScriptBeautifyOutput {\n  readonly content: string;\n  readonly artifactId?: string;\n  readonly bytesBefore: number;\n  readonly bytesAfter: number;\n}\n\nexport interface OpensteerScriptDeobfuscateInput {\n  readonly artifactId?: string;\n  readonly content?: string;\n  readonly persist?: boolean;\n}\n\nexport interface OpensteerScriptDeobfuscateOutput {\n  readonly content: string;\n  readonly artifactId?: string;\n  readonly transforms: readonly string[];\n  readonly bytesBefore: number;\n  readonly bytesAfter: number;\n}\n\nexport type SandboxFidelity = \"minimal\" | \"standard\" | \"full\";\nexport type SandboxAjaxMode = \"passthrough\" | \"capture\" | \"mock\";\n\nexport interface SandboxAjaxRoute {\n  readonly urlPattern: string;\n  readonly mode: SandboxAjaxMode;\n  readonly mockResponse?: {\n    readonly status: number;\n    readonly headers?: Readonly<Record<string, string>>;\n    readonly body?: string;\n  };\n}\n\nexport interface OpensteerScriptSandboxInput {\n  readonly artifactId?: string;\n  readonly content?: string;\n  readonly fidelity?: SandboxFidelity;\n  readonly ajaxRoutes?: readonly SandboxAjaxRoute[];\n  readonly cookies?: Readonly<Record<string, string>>;\n  readonly globals?: Readonly<Record<string, unknown>>;\n  readonly timeoutMs?: number;\n  readonly clockMode?: \"real\" | \"manual\";\n}\n\nexport interface SandboxCapturedAjaxCall {\n  readonly method: string;\n  readonly url: string;\n  readonly headers: Readonly<Record<string, string>>;\n  readonly body?: string;\n  readonly timestamp: number;\n}\n\nexport interface OpensteerScriptSandboxOutput {\n  readonly result?: unknown;\n  readonly capturedAjax: readonly SandboxCapturedAjaxCall[];\n  readonly errors: readonly string[];\n  readonly durationMs: number;\n}\n\nconst scriptTransformInputSchema = objectSchema(\n  {\n    artifactId: stringSchema({ minLength: 1 }),\n    content: stringSchema(),\n    persist: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerScriptTransformInput\",\n  },\n);\n\nconst scriptTransformOutputSchema = objectSchema(\n  {\n    content: stringSchema(),\n    artifactId: stringSchema({ minLength: 1 }),\n    bytesBefore: integerSchema({ minimum: 0 }),\n    bytesAfter: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerScriptTransformOutput\",\n    required: [\"content\", \"bytesBefore\", \"bytesAfter\"],\n  },\n);\n\nexport const opensteerScriptBeautifyInputSchema: JsonSchema = scriptTransformInputSchema;\n\nexport const opensteerScriptBeautifyOutputSchema: JsonSchema = scriptTransformOutputSchema;\n\nexport const opensteerScriptDeobfuscateInputSchema: JsonSchema = scriptTransformInputSchema;\n\nexport const opensteerScriptDeobfuscateOutputSchema: JsonSchema = objectSchema(\n  {\n    content: stringSchema(),\n    artifactId: stringSchema({ minLength: 1 }),\n    transforms: arraySchema(stringSchema({ minLength: 1 }), {\n      uniqueItems: true,\n    }),\n    bytesBefore: integerSchema({ minimum: 0 }),\n    bytesAfter: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerScriptDeobfuscateOutput\",\n    required: [\"content\", \"transforms\", \"bytesBefore\", \"bytesAfter\"],\n  },\n);\n\nexport const sandboxFidelitySchema: JsonSchema = enumSchema(\n  [\"minimal\", \"standard\", \"full\"] as const,\n  {\n    title: \"SandboxFidelity\",\n  },\n);\n\nexport const sandboxAjaxModeSchema: JsonSchema = enumSchema(\n  [\"passthrough\", \"capture\", \"mock\"] as const,\n  {\n    title: \"SandboxAjaxMode\",\n  },\n);\n\nexport const sandboxAjaxRouteSchema: JsonSchema = objectSchema(\n  {\n    urlPattern: stringSchema({ minLength: 1 }),\n    mode: sandboxAjaxModeSchema,\n    mockResponse: objectSchema(\n      {\n        status: integerSchema({ minimum: 100, maximum: 599 }),\n        headers: recordSchema(stringSchema(), {\n          title: \"SandboxAjaxMockHeaders\",\n        }),\n        body: stringSchema(),\n      },\n      {\n        title: \"SandboxAjaxMockResponse\",\n        required: [\"status\"],\n      },\n    ),\n  },\n  {\n    title: \"SandboxAjaxRoute\",\n    required: [\"urlPattern\", \"mode\"],\n  },\n);\n\nexport const opensteerScriptSandboxInputSchema: JsonSchema = objectSchema(\n  {\n    artifactId: stringSchema({ minLength: 1 }),\n    content: stringSchema(),\n    fidelity: sandboxFidelitySchema,\n    ajaxRoutes: arraySchema(sandboxAjaxRouteSchema),\n    cookies: recordSchema(stringSchema(), {\n      title: \"SandboxCookies\",\n    }),\n    globals: objectSchema(\n      {},\n      {\n        title: \"SandboxGlobals\",\n        additionalProperties: true,\n      },\n    ),\n    timeoutMs: integerSchema({ minimum: 1 }),\n    clockMode: enumSchema([\"real\", \"manual\"] as const),\n  },\n  {\n    title: \"OpensteerScriptSandboxInput\",\n  },\n);\n\nexport const sandboxCapturedAjaxCallSchema: JsonSchema = objectSchema(\n  {\n    method: stringSchema({ minLength: 1 }),\n    url: stringSchema({ minLength: 1 }),\n    headers: recordSchema(stringSchema(), {\n      title: \"SandboxCapturedAjaxHeaders\",\n    }),\n    body: stringSchema(),\n    timestamp: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"SandboxCapturedAjaxCall\",\n    required: [\"method\", \"url\", \"headers\", \"timestamp\"],\n  },\n);\n\nexport const opensteerScriptSandboxOutputSchema: JsonSchema = objectSchema(\n  {\n    result: oneOfSchema(\n      [\n        objectSchema({}, { additionalProperties: true }),\n        arraySchema({}),\n        stringSchema(),\n        { type: \"number\" },\n        enumSchema([true, false, null] as const),\n      ],\n      {\n        title: \"SandboxResult\",\n      },\n    ),\n    capturedAjax: arraySchema(sandboxCapturedAjaxCallSchema),\n    errors: arraySchema(stringSchema({ minLength: 1 })),\n    durationMs: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerScriptSandboxOutput\",\n    required: [\"capturedAjax\", \"errors\", \"durationMs\"],\n  },\n);\n","import type { JsonSchema } from \"./json.js\";\nimport {\n  arraySchema,\n  defineSchema,\n  integerSchema,\n  objectSchema,\n  stringSchema,\n  enumSchema,\n  oneOfSchema,\n} from \"./json.js\";\nimport { pageRefSchema, type PageRef } from \"./identity.js\";\nimport { opensteerRegistryProvenanceSchema, type OpensteerRegistryProvenance } from \"./requests.js\";\nimport {\n  opensteerStateDeltaSchema,\n  opensteerStateSnapshotSchema,\n  type OpensteerStateDelta,\n  type OpensteerStateSnapshot,\n} from \"./state.js\";\nimport type { JsonValue } from \"./json.js\";\nimport type { OpensteerTargetInput } from \"./semantic.js\";\n\nexport type OpensteerInteractionCaptureStep =\n  | {\n      readonly kind: \"goto\";\n      readonly url: string;\n    }\n  | {\n      readonly kind: \"click\";\n      readonly target: OpensteerTargetInput;\n    }\n  | {\n      readonly kind: \"hover\";\n      readonly target: OpensteerTargetInput;\n    }\n  | {\n      readonly kind: \"input\";\n      readonly target: OpensteerTargetInput;\n      readonly text: string;\n      readonly pressEnter?: boolean;\n    }\n  | {\n      readonly kind: \"scroll\";\n      readonly target: OpensteerTargetInput;\n      readonly direction: \"up\" | \"down\" | \"left\" | \"right\";\n      readonly amount: number;\n    }\n  | {\n      readonly kind: \"wait\";\n      readonly durationMs: number;\n    };\n\nexport interface OpensteerInteractionEventRecord {\n  readonly type: string;\n  readonly timestamp: number;\n  readonly targetPath?: string;\n  readonly properties: Readonly<Record<string, unknown>>;\n}\n\nexport interface OpensteerInteractionTracePayload {\n  readonly mode: \"manual\" | \"automated\";\n  readonly pageRef?: PageRef;\n  readonly url?: string;\n  readonly startedAt: number;\n  readonly completedAt: number;\n  readonly beforeState?: OpensteerStateSnapshot;\n  readonly afterState?: OpensteerStateSnapshot;\n  readonly stateDelta?: OpensteerStateDelta;\n  readonly events: readonly OpensteerInteractionEventRecord[];\n  readonly networkRecordIds: readonly string[];\n  readonly caseId?: string;\n  readonly notes?: string;\n}\n\nexport interface OpensteerInteractionTraceRecord {\n  readonly id: string;\n  readonly key: string;\n  readonly version: string;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly contentHash: string;\n  readonly tags: readonly string[];\n  readonly provenance?: OpensteerRegistryProvenance;\n  readonly payload: OpensteerInteractionTracePayload;\n}\n\nexport interface OpensteerInteractionCaptureInput {\n  readonly key?: string;\n  readonly pageRef?: PageRef;\n  readonly durationMs?: number;\n  readonly script?: string;\n  readonly args?: readonly JsonValue[];\n  readonly steps?: readonly OpensteerInteractionCaptureStep[];\n  readonly includeStorage?: boolean;\n  readonly includeSessionStorage?: boolean;\n  readonly includeIndexedDb?: boolean;\n  readonly globalNames?: readonly string[];\n  readonly caseId?: string;\n  readonly notes?: string;\n  readonly tags?: readonly string[];\n}\n\nexport interface OpensteerInteractionCaptureOutput {\n  readonly trace: OpensteerInteractionTraceRecord;\n}\n\nexport interface OpensteerInteractionGetInput {\n  readonly traceId: string;\n}\n\nexport interface OpensteerInteractionGetOutput {\n  readonly trace: OpensteerInteractionTraceRecord;\n}\n\nexport interface OpensteerInteractionDiffInput {\n  readonly leftTraceId: string;\n  readonly rightTraceId: string;\n}\n\nexport interface OpensteerInteractionDiffOutput {\n  readonly summary: {\n    readonly eventCountDelta: number;\n    readonly propertyMismatchCount: number;\n    readonly stateMismatchCount: number;\n    readonly downstreamRequestMismatchCount: number;\n  };\n  readonly eventSequenceMismatches: readonly string[];\n  readonly eventPropertyMismatches: readonly string[];\n  readonly stateMismatches: readonly string[];\n  readonly downstreamRequestMismatches: readonly string[];\n}\n\nexport interface OpensteerInteractionReplayInput {\n  readonly traceId: string;\n  readonly pageRef?: PageRef;\n}\n\nexport interface OpensteerInteractionReplayOutput {\n  readonly traceId: string;\n  readonly replayedEventCount: number;\n  readonly success: boolean;\n  readonly error?: string;\n}\n\nexport const opensteerInteractionEventRecordSchema: JsonSchema = objectSchema(\n  {\n    type: stringSchema({ minLength: 1 }),\n    timestamp: integerSchema({ minimum: 0 }),\n    targetPath: stringSchema({ minLength: 1 }),\n    properties: objectSchema(\n      {},\n      {\n        title: \"OpensteerInteractionEventProperties\",\n        additionalProperties: true,\n      },\n    ),\n  },\n  {\n    title: \"OpensteerInteractionEventRecord\",\n    required: [\"type\", \"timestamp\", \"properties\"],\n  },\n);\n\nexport const opensteerInteractionTracePayloadSchema: JsonSchema = objectSchema(\n  {\n    mode: stringSchema({ minLength: 1 }),\n    pageRef: pageRefSchema,\n    url: stringSchema({ minLength: 1 }),\n    startedAt: integerSchema({ minimum: 0 }),\n    completedAt: integerSchema({ minimum: 0 }),\n    beforeState: opensteerStateSnapshotSchema,\n    afterState: opensteerStateSnapshotSchema,\n    stateDelta: opensteerStateDeltaSchema,\n    events: arraySchema(opensteerInteractionEventRecordSchema),\n    networkRecordIds: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n    caseId: stringSchema({ minLength: 1 }),\n    notes: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerInteractionTracePayload\",\n    required: [\"mode\", \"startedAt\", \"completedAt\", \"events\", \"networkRecordIds\"],\n  },\n);\n\nexport const opensteerInteractionTraceRecordSchema: JsonSchema = objectSchema(\n  {\n    id: stringSchema({ minLength: 1 }),\n    key: stringSchema({ minLength: 1 }),\n    version: stringSchema({ minLength: 1 }),\n    createdAt: integerSchema({ minimum: 0 }),\n    updatedAt: integerSchema({ minimum: 0 }),\n    contentHash: stringSchema({ minLength: 1 }),\n    tags: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n    provenance: opensteerRegistryProvenanceSchema,\n    payload: opensteerInteractionTracePayloadSchema,\n  },\n  {\n    title: \"OpensteerInteractionTraceRecord\",\n    required: [\"id\", \"key\", \"version\", \"createdAt\", \"updatedAt\", \"contentHash\", \"tags\", \"payload\"],\n  },\n);\n\nconst targetByElementSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"element\"] as const),\n    element: integerSchema({ minimum: 1 }),\n  },\n  {\n    title: \"OpensteerInteractionTargetByElement\",\n    required: [\"kind\", \"element\"],\n  },\n);\n\nconst targetByPersistSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"persist\"] as const),\n    name: stringSchema(),\n  },\n  {\n    title: \"OpensteerInteractionTargetByPersist\",\n    required: [\"kind\", \"name\"],\n  },\n);\n\nconst targetBySelectorSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"selector\"] as const),\n    selector: stringSchema(),\n  },\n  {\n    title: \"OpensteerInteractionTargetBySelector\",\n    required: [\"kind\", \"selector\"],\n  },\n);\n\nconst opensteerInteractionTargetInputSchema: JsonSchema = oneOfSchema(\n  [targetByElementSchema, targetByPersistSchema, targetBySelectorSchema],\n  {\n    title: \"OpensteerInteractionTargetInput\",\n  },\n);\n\nconst opensteerInteractionCaptureStepSchema: JsonSchema = oneOfSchema(\n  [\n    objectSchema(\n      {\n        kind: enumSchema([\"goto\"] as const),\n        url: stringSchema({ minLength: 1 }),\n      },\n      {\n        title: \"OpensteerInteractionCaptureGotoStep\",\n        required: [\"kind\", \"url\"],\n      },\n    ),\n    objectSchema(\n      {\n        kind: enumSchema([\"click\"] as const),\n        target: opensteerInteractionTargetInputSchema,\n      },\n      {\n        title: \"OpensteerInteractionCaptureClickStep\",\n        required: [\"kind\", \"target\"],\n      },\n    ),\n    objectSchema(\n      {\n        kind: enumSchema([\"hover\"] as const),\n        target: opensteerInteractionTargetInputSchema,\n      },\n      {\n        title: \"OpensteerInteractionCaptureHoverStep\",\n        required: [\"kind\", \"target\"],\n      },\n    ),\n    objectSchema(\n      {\n        kind: enumSchema([\"input\"] as const),\n        target: opensteerInteractionTargetInputSchema,\n        text: stringSchema(),\n        pressEnter: { type: \"boolean\" },\n      },\n      {\n        title: \"OpensteerInteractionCaptureInputStep\",\n        required: [\"kind\", \"target\", \"text\"],\n      },\n    ),\n    objectSchema(\n      {\n        kind: enumSchema([\"scroll\"] as const),\n        target: opensteerInteractionTargetInputSchema,\n        direction: enumSchema([\"up\", \"down\", \"left\", \"right\"] as const),\n        amount: integerSchema({ minimum: 1 }),\n      },\n      {\n        title: \"OpensteerInteractionCaptureScrollStep\",\n        required: [\"kind\", \"target\", \"direction\", \"amount\"],\n      },\n    ),\n    objectSchema(\n      {\n        kind: enumSchema([\"wait\"] as const),\n        durationMs: integerSchema({ minimum: 1 }),\n      },\n      {\n        title: \"OpensteerInteractionCaptureWaitStep\",\n        required: [\"kind\", \"durationMs\"],\n      },\n    ),\n  ],\n  {\n    title: \"OpensteerInteractionCaptureStep\",\n  },\n);\n\nexport const opensteerInteractionCaptureInputSchema: JsonSchema = objectSchema(\n  {\n    key: stringSchema({ minLength: 1 }),\n    pageRef: pageRefSchema,\n    durationMs: integerSchema({ minimum: 1 }),\n    script: stringSchema({ minLength: 1 }),\n    args: arraySchema(defineSchema({ title: \"OpensteerInteractionCaptureArg\" })),\n    steps: arraySchema(opensteerInteractionCaptureStepSchema, { minItems: 1 }),\n    includeStorage: { type: \"boolean\" },\n    includeSessionStorage: { type: \"boolean\" },\n    includeIndexedDb: { type: \"boolean\" },\n    globalNames: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n    caseId: stringSchema({ minLength: 1 }),\n    notes: stringSchema({ minLength: 1 }),\n    tags: arraySchema(stringSchema({ minLength: 1 }), { uniqueItems: true }),\n  },\n  {\n    title: \"OpensteerInteractionCaptureInput\",\n  },\n);\n\nexport const opensteerInteractionCaptureOutputSchema: JsonSchema = objectSchema(\n  {\n    trace: opensteerInteractionTraceRecordSchema,\n  },\n  {\n    title: \"OpensteerInteractionCaptureOutput\",\n    required: [\"trace\"],\n  },\n);\n\nexport const opensteerInteractionGetInputSchema: JsonSchema = objectSchema(\n  {\n    traceId: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerInteractionGetInput\",\n    required: [\"traceId\"],\n  },\n);\n\nexport const opensteerInteractionGetOutputSchema: JsonSchema = objectSchema(\n  {\n    trace: opensteerInteractionTraceRecordSchema,\n  },\n  {\n    title: \"OpensteerInteractionGetOutput\",\n    required: [\"trace\"],\n  },\n);\n\nexport const opensteerInteractionDiffInputSchema: JsonSchema = objectSchema(\n  {\n    leftTraceId: stringSchema({ minLength: 1 }),\n    rightTraceId: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerInteractionDiffInput\",\n    required: [\"leftTraceId\", \"rightTraceId\"],\n  },\n);\n\nexport const opensteerInteractionDiffOutputSchema: JsonSchema = objectSchema(\n  {\n    summary: objectSchema(\n      {\n        eventCountDelta: integerSchema({ minimum: 0 }),\n        propertyMismatchCount: integerSchema({ minimum: 0 }),\n        stateMismatchCount: integerSchema({ minimum: 0 }),\n        downstreamRequestMismatchCount: integerSchema({ minimum: 0 }),\n      },\n      {\n        title: \"OpensteerInteractionDiffSummary\",\n        required: [\n          \"eventCountDelta\",\n          \"propertyMismatchCount\",\n          \"stateMismatchCount\",\n          \"downstreamRequestMismatchCount\",\n        ],\n      },\n    ),\n    eventSequenceMismatches: arraySchema(stringSchema({ minLength: 1 })),\n    eventPropertyMismatches: arraySchema(stringSchema({ minLength: 1 })),\n    stateMismatches: arraySchema(stringSchema({ minLength: 1 })),\n    downstreamRequestMismatches: arraySchema(stringSchema({ minLength: 1 })),\n  },\n  {\n    title: \"OpensteerInteractionDiffOutput\",\n    required: [\n      \"summary\",\n      \"eventSequenceMismatches\",\n      \"eventPropertyMismatches\",\n      \"stateMismatches\",\n      \"downstreamRequestMismatches\",\n    ],\n  },\n);\n\nexport const opensteerInteractionReplayInputSchema: JsonSchema = objectSchema(\n  {\n    traceId: stringSchema({ minLength: 1 }),\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerInteractionReplayInput\",\n    required: [\"traceId\"],\n  },\n);\n\nexport const opensteerInteractionReplayOutputSchema: JsonSchema = objectSchema(\n  {\n    traceId: stringSchema({ minLength: 1 }),\n    replayedEventCount: integerSchema({ minimum: 0 }),\n    success: { type: \"boolean\" },\n    error: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerInteractionReplayOutput\",\n    required: [\"traceId\", \"replayedEventCount\", \"success\"],\n  },\n);\n","import type { JsonSchema, JsonValue } from \"./json.js\";\nimport {\n  arraySchema,\n  defineSchema,\n  enumSchema,\n  integerSchema,\n  literalSchema,\n  objectSchema,\n  oneOfSchema,\n  recordSchema,\n  stringSchema,\n  numberSchema,\n} from \"./json.js\";\nimport { OpensteerProtocolError } from \"./errors.js\";\nimport type { OpensteerCapability } from \"./capabilities.js\";\nimport type { ExternalBinaryLocation } from \"./binary-location.js\";\nimport { externalBinaryLocationSchema } from \"./binary-location.js\";\nimport {\n  documentEpochSchema,\n  documentRefSchema,\n  frameRefSchema,\n  nodeRefSchema,\n  pageRefSchema,\n  sessionRefSchema,\n} from \"./identity.js\";\nimport type {\n  DocumentEpoch,\n  DocumentRef,\n  FrameRef,\n  NodeRef,\n  PageRef,\n  SessionRef,\n} from \"./identity.js\";\nimport { coordinateSpaceSchema, pointSchema, rectSchema, sizeSchema } from \"./geometry.js\";\nimport type { CoordinateSpace, Point, Rect, Size } from \"./geometry.js\";\nimport { pageInfoSchema } from \"./metadata.js\";\nimport { requestEnvelopeSchema, responseEnvelopeSchema } from \"./envelopes.js\";\nimport { screenshotFormatSchema, type HitTestResult, type ScreenshotFormat } from \"./snapshots.js\";\nimport type {\n  OpensteerArtifactReadInput,\n  OpensteerArtifactReadOutput,\n  ScriptSourceArtifactData,\n} from \"./artifacts.js\";\nimport {\n  opensteerArtifactReadInputSchema,\n  opensteerArtifactReadOutputSchema,\n} from \"./artifacts.js\";\nimport {\n  opensteerCookieQueryInputSchema,\n  opensteerCookieQueryOutputSchema,\n  opensteerNetworkDetailInputSchema,\n  opensteerNetworkDetailOutputSchema,\n  opensteerNetworkQueryInputSchema,\n  opensteerNetworkQueryOutputSchema,\n  opensteerNetworkReplayInputSchema,\n  opensteerNetworkReplayOutputSchema,\n  opensteerSessionFetchInputSchema,\n  opensteerSessionFetchOutputSchema,\n  opensteerStateQueryInputSchema,\n  opensteerStateQueryOutputSchema,\n  opensteerStorageQueryInputSchema,\n  opensteerStorageQueryOutputSchema,\n  type OpensteerCookieQueryInput,\n  type OpensteerCookieQueryOutput,\n  type OpensteerNetworkDetailInput,\n  type OpensteerNetworkDetailOutput,\n  type OpensteerNetworkQueryInput,\n  type OpensteerNetworkQueryOutput,\n  type OpensteerNetworkReplayInput,\n  type OpensteerNetworkReplayOutput,\n  type OpensteerSessionFetchInput,\n  type OpensteerSessionFetchOutput,\n  type OpensteerStateQueryInput,\n  type OpensteerStateQueryOutput,\n  type OpensteerStorageQueryInput,\n  type OpensteerStorageQueryOutput,\n} from \"./requests.js\";\nimport {\n  opensteerScriptBeautifyInputSchema,\n  opensteerScriptBeautifyOutputSchema,\n  opensteerScriptDeobfuscateInputSchema,\n  opensteerScriptDeobfuscateOutputSchema,\n  opensteerScriptSandboxInputSchema,\n  opensteerScriptSandboxOutputSchema,\n  type OpensteerScriptBeautifyInput,\n  type OpensteerScriptBeautifyOutput,\n  type OpensteerScriptDeobfuscateInput,\n  type OpensteerScriptDeobfuscateOutput,\n  type OpensteerScriptSandboxInput,\n  type OpensteerScriptSandboxOutput,\n} from \"./scripts.js\";\nimport {\n  opensteerCaptchaSolveInputSchema,\n  opensteerCaptchaSolveOutputSchema,\n  type OpensteerCaptchaSolveInput,\n  type OpensteerCaptchaSolveOutput,\n} from \"./captcha.js\";\nimport {\n  opensteerInteractionCaptureInputSchema,\n  opensteerInteractionCaptureOutputSchema,\n  opensteerInteractionDiffInputSchema,\n  opensteerInteractionDiffOutputSchema,\n  opensteerInteractionGetInputSchema,\n  opensteerInteractionGetOutputSchema,\n  opensteerInteractionReplayInputSchema,\n  opensteerInteractionReplayOutputSchema,\n  type OpensteerInteractionCaptureInput,\n  type OpensteerInteractionCaptureOutput,\n  type OpensteerInteractionDiffInput,\n  type OpensteerInteractionDiffOutput,\n  type OpensteerInteractionGetInput,\n  type OpensteerInteractionGetOutput,\n  type OpensteerInteractionReplayInput,\n  type OpensteerInteractionReplayOutput,\n} from \"./interaction.js\";\nimport { validateJsonSchema } from \"./validation.js\";\nimport { OPENSTEER_PROTOCOL_REST_BASE_PATH } from \"./version.js\";\n\nexport type OpensteerSnapshotMode = \"action\" | \"extraction\";\n\nexport interface OpensteerBrowserLaunchOptions {\n  readonly headless?: boolean;\n  readonly executablePath?: string;\n  readonly args?: readonly string[];\n  readonly timeoutMs?: number;\n}\n\nexport interface OpensteerAttachBrowserOptions {\n  readonly mode: \"attach\";\n  readonly endpoint?: string;\n  readonly headers?: Readonly<Record<string, string>>;\n  readonly freshTab?: boolean;\n}\n\nexport type OpensteerBrowserMode = \"temporary\" | \"persistent\";\n\nexport type OpensteerBrowserOptions = OpensteerBrowserMode | OpensteerAttachBrowserOptions;\n\nexport interface OpensteerHumanizeOptions {\n  /** Interpolate mouse paths with curves and jitter before clicks/scrolls. */\n  readonly mouse?: boolean;\n  /** Realistic per-character typing cadence with key hold duration. */\n  readonly keyboard?: boolean;\n  /** Break large scrolls into discrete wheel ticks with delays. */\n  readonly scroll?: boolean;\n}\n\nexport interface OpensteerBrowserContextOptions {\n  readonly ignoreHTTPSErrors?: boolean;\n  readonly locale?: string;\n  readonly timezoneId?: string;\n  readonly userAgent?: string;\n  readonly viewport?: {\n    readonly width: number;\n    readonly height: number;\n  } | null;\n  readonly javaScriptEnabled?: boolean;\n  readonly bypassCSP?: boolean;\n  readonly reducedMotion?: \"reduce\" | \"no-preference\";\n  readonly colorScheme?: \"light\" | \"dark\" | \"no-preference\";\n  readonly stealthProfile?: OpensteerStealthProfileInput;\n  /**\n   * Enable human-like interaction patterns for mouse, keyboard, and scroll\n   * events.  When `true` (the default), all sub-options are enabled.  Pass\n   * `false` to disable, or an object to control individual categories.\n   */\n  readonly humanize?: boolean | OpensteerHumanizeOptions;\n}\n\nexport interface OpensteerStealthProfileInput {\n  readonly id?: string;\n  readonly platform?: \"macos\" | \"windows\" | \"linux\";\n  readonly browserBrand?: \"chrome\" | \"edge\";\n  readonly browserVersion?: string;\n  readonly userAgent?: string;\n  readonly viewport?: {\n    readonly width: number;\n    readonly height: number;\n  };\n  readonly screenResolution?: {\n    readonly width: number;\n    readonly height: number;\n  };\n  readonly devicePixelRatio?: number;\n  readonly maxTouchPoints?: number;\n  readonly webglVendor?: string;\n  readonly webglRenderer?: string;\n  readonly fonts?: readonly string[];\n  readonly canvasNoiseSeed?: number;\n  readonly audioNoiseSeed?: number;\n  readonly locale?: string;\n  readonly timezoneId?: string;\n}\n\nexport interface OpensteerTargetByElement {\n  readonly kind: \"element\";\n  readonly element: number;\n}\n\nexport interface OpensteerTargetByPersist {\n  readonly kind: \"persist\";\n  readonly persist: string;\n}\n\nexport interface OpensteerTargetBySelector {\n  readonly kind: \"selector\";\n  readonly selector: string;\n}\n\nexport type OpensteerTargetInput =\n  | OpensteerTargetByElement\n  | OpensteerTargetByPersist\n  | OpensteerTargetBySelector;\n\nexport interface OpensteerResolvedTarget {\n  readonly pageRef: PageRef;\n  readonly frameRef: FrameRef;\n  readonly documentRef: DocumentRef;\n  readonly documentEpoch: DocumentEpoch;\n  readonly nodeRef: NodeRef;\n  readonly tagName: string;\n  readonly pathHint: string;\n  readonly persist?: string;\n  readonly selectorUsed?: string;\n}\n\nexport interface OpensteerActionResult {\n  readonly tagName: string;\n  readonly persist?: string;\n}\n\nexport interface OpensteerSnapshotCounter {\n  readonly element: number;\n  readonly pageRef: PageRef;\n  readonly frameRef: FrameRef;\n  readonly documentRef: DocumentRef;\n  readonly documentEpoch: DocumentEpoch;\n  readonly nodeRef?: NodeRef;\n  readonly tagName: string;\n  readonly pathHint: string;\n  readonly text?: string;\n  readonly attributes?: readonly {\n    readonly name: string;\n    readonly value: string;\n  }[];\n  readonly iframeDepth: number;\n  readonly shadowDepth: number;\n  readonly interactive: boolean;\n}\n\nexport interface OpensteerNavigationSummary {\n  readonly url: string;\n  readonly title: string;\n}\n\nexport interface OpensteerOpenInput {\n  readonly url?: string;\n  readonly workspace?: string;\n  readonly browser?: OpensteerBrowserOptions;\n  readonly launch?: OpensteerBrowserLaunchOptions;\n  readonly context?: OpensteerBrowserContextOptions;\n}\n\nexport interface OpensteerOpenOutput extends OpensteerNavigationSummary {}\n\nexport interface OpensteerPageListInput {}\n\nexport interface OpensteerPageListOutput {\n  readonly activePageRef?: PageRef;\n  readonly pages: readonly import(\"./metadata.js\").PageInfo[];\n}\n\nexport interface OpensteerPageNewInput {\n  readonly url?: string;\n  readonly openerPageRef?: PageRef;\n}\n\nexport interface OpensteerPageNewOutput extends OpensteerNavigationSummary {\n  readonly pageRef: PageRef;\n}\n\nexport interface OpensteerPageActivateInput {\n  readonly pageRef: PageRef;\n}\n\nexport interface OpensteerPageActivateOutput extends OpensteerNavigationSummary {}\n\nexport interface OpensteerPageCloseInput {\n  readonly pageRef?: PageRef;\n}\n\nexport interface OpensteerPageCloseOutput {\n  readonly closedPageRef: PageRef;\n  readonly activePageRef?: PageRef;\n  readonly pages: readonly import(\"./metadata.js\").PageInfo[];\n}\n\nexport interface OpensteerPageGotoInput {\n  readonly url: string;\n  readonly captureNetwork?: string;\n}\n\nexport interface OpensteerPageGotoOutput extends OpensteerNavigationSummary {}\n\nexport interface OpensteerPageEvaluateInput {\n  readonly script: string;\n  readonly args?: readonly JsonValue[];\n  readonly pageRef?: PageRef;\n}\n\nexport interface OpensteerPageEvaluateOutput {\n  readonly pageRef: PageRef;\n  readonly value: JsonValue;\n}\n\nexport interface OpensteerAddInitScriptInput {\n  readonly script: string;\n  readonly args?: readonly JsonValue[];\n  readonly pageRef?: PageRef;\n}\n\nexport interface OpensteerAddInitScriptOutput {\n  readonly registrationId: string;\n  readonly sessionRef: SessionRef;\n  readonly pageRef?: PageRef;\n}\n\nexport interface OpensteerCaptureScriptsInput {\n  readonly pageRef?: PageRef;\n  readonly includeInline?: boolean;\n  readonly includeExternal?: boolean;\n  readonly includeDynamic?: boolean;\n  readonly includeWorkers?: boolean;\n  readonly urlFilter?: string;\n  readonly persist?: boolean;\n}\n\nexport interface OpensteerCapturedScript extends ScriptSourceArtifactData {\n  readonly artifactId?: string;\n}\n\nexport interface OpensteerCaptureScriptsOutput {\n  readonly pageRef: PageRef;\n  readonly scripts: readonly OpensteerCapturedScript[];\n}\n\nexport interface OpensteerPageSnapshotInput {\n  readonly mode?: OpensteerSnapshotMode;\n}\n\nexport interface OpensteerPageSnapshotOutput {\n  readonly url: string;\n  readonly title: string;\n  readonly mode: OpensteerSnapshotMode;\n  readonly html: string;\n  readonly counters: readonly OpensteerSnapshotCounter[];\n}\n\nexport interface OpensteerInspectCookiesInput {\n  readonly urls?: readonly string[];\n}\n\nexport interface OpensteerInspectStorageInput {\n  readonly includeSessionStorage?: boolean;\n  readonly includeIndexedDb?: boolean;\n}\n\nexport interface OpensteerDomClickInput {\n  readonly target: OpensteerTargetInput;\n  readonly button?: OpensteerComputerMouseButton;\n  readonly clickCount?: number;\n  readonly modifiers?: readonly OpensteerComputerKeyModifier[];\n  readonly persist?: string;\n  readonly captureNetwork?: string;\n}\n\nexport interface OpensteerDomHoverInput {\n  readonly target: OpensteerTargetInput;\n  readonly persist?: string;\n  readonly captureNetwork?: string;\n}\n\nexport interface OpensteerDomInputInput {\n  readonly target: OpensteerTargetInput;\n  readonly text: string;\n  readonly pressEnter?: boolean;\n  readonly persist?: string;\n  readonly captureNetwork?: string;\n}\n\nexport interface OpensteerDomScrollInput {\n  readonly target: OpensteerTargetInput;\n  readonly direction: \"up\" | \"down\" | \"left\" | \"right\";\n  readonly amount: number;\n  readonly persist?: string;\n  readonly captureNetwork?: string;\n}\n\nexport interface OpensteerDomExtractInput {\n  readonly persist?: string;\n  readonly template?: Readonly<Record<string, unknown>>;\n}\n\nexport interface OpensteerDomExtractOutput {\n  readonly data: JsonValue;\n}\n\nexport interface OpensteerSessionCloseInput {}\n\nexport interface OpensteerSessionCloseOutput {\n  readonly closed: true;\n}\n\nexport const opensteerComputerAnnotationNames = [\n  \"clickable\",\n  \"typeable\",\n  \"scrollable\",\n  \"grid\",\n  \"selected\",\n] as const;\n\nexport type OpensteerComputerAnnotation = (typeof opensteerComputerAnnotationNames)[number];\n\nexport type OpensteerComputerMouseButton = \"left\" | \"middle\" | \"right\";\nexport type OpensteerComputerKeyModifier = \"Shift\" | \"Control\" | \"Alt\" | \"Meta\";\n\nexport interface OpensteerComputerClickAction {\n  readonly type: \"click\";\n  readonly x: number;\n  readonly y: number;\n  readonly button?: OpensteerComputerMouseButton;\n  readonly clickCount?: number;\n  readonly modifiers?: readonly OpensteerComputerKeyModifier[];\n}\n\nexport interface OpensteerComputerMoveAction {\n  readonly type: \"move\";\n  readonly x: number;\n  readonly y: number;\n}\n\nexport interface OpensteerComputerScrollAction {\n  readonly type: \"scroll\";\n  readonly x: number;\n  readonly y: number;\n  readonly deltaX: number;\n  readonly deltaY: number;\n}\n\nexport interface OpensteerComputerTypeAction {\n  readonly type: \"type\";\n  readonly text: string;\n}\n\nexport interface OpensteerComputerKeyAction {\n  readonly type: \"key\";\n  readonly key: string;\n  readonly modifiers?: readonly OpensteerComputerKeyModifier[];\n}\n\nexport interface OpensteerComputerDragAction {\n  readonly type: \"drag\";\n  readonly start: Point;\n  readonly end: Point;\n  readonly steps?: number;\n}\n\nexport interface OpensteerComputerScreenshotAction {\n  readonly type: \"screenshot\";\n}\n\nexport interface OpensteerComputerWaitAction {\n  readonly type: \"wait\";\n  readonly durationMs: number;\n}\n\nexport type OpensteerComputerAction =\n  | OpensteerComputerClickAction\n  | OpensteerComputerMoveAction\n  | OpensteerComputerScrollAction\n  | OpensteerComputerTypeAction\n  | OpensteerComputerKeyAction\n  | OpensteerComputerDragAction\n  | OpensteerComputerScreenshotAction\n  | OpensteerComputerWaitAction;\n\nexport interface OpensteerComputerScreenshotOptions {\n  readonly format?: ScreenshotFormat;\n  readonly includeCursor?: boolean;\n  readonly disableAnnotations?: readonly OpensteerComputerAnnotation[];\n}\n\nexport interface OpensteerScreenshotSummary {\n  readonly payload: ExternalBinaryLocation;\n  readonly format: \"png\" | \"jpeg\" | \"webp\";\n  readonly size: Size;\n  readonly coordinateSpace: CoordinateSpace;\n  readonly clip?: Rect;\n}\n\nexport interface OpensteerComputerExecuteInput {\n  readonly action: OpensteerComputerAction;\n  readonly screenshot?: OpensteerComputerScreenshotOptions;\n  readonly captureNetwork?: string;\n}\n\nexport interface OpensteerComputerDisplayScale {\n  readonly x: number;\n  readonly y: number;\n}\n\nexport interface OpensteerComputerTracePoint {\n  readonly role: \"point\" | \"start\" | \"end\";\n  readonly point: Point;\n  readonly hitTest?: HitTestResult;\n  readonly target?: OpensteerResolvedTarget;\n}\n\nexport interface OpensteerComputerTraceEnrichment {\n  readonly points: readonly OpensteerComputerTracePoint[];\n}\n\nexport interface OpensteerComputerExecuteTiming {\n  readonly actionMs: number;\n  readonly waitMs: number;\n  readonly totalMs: number;\n}\n\nexport interface OpensteerComputerExecuteOutput {\n  readonly url: string;\n  readonly title: string;\n  readonly screenshot: OpensteerScreenshotSummary;\n}\n\nexport const opensteerSemanticOperationNames = [\n  \"session.open\",\n  \"page.list\",\n  \"page.new\",\n  \"page.activate\",\n  \"page.close\",\n  \"page.goto\",\n  \"page.evaluate\",\n  \"page.add-init-script\",\n  \"page.snapshot\",\n  \"dom.click\",\n  \"dom.hover\",\n  \"dom.input\",\n  \"dom.scroll\",\n  \"dom.extract\",\n  \"network.query\",\n  \"network.detail\",\n  \"interaction.capture\",\n  \"interaction.get\",\n  \"interaction.diff\",\n  \"interaction.replay\",\n  \"artifact.read\",\n  \"session.cookies\",\n  \"session.storage\",\n  \"session.state\",\n  \"session.fetch\",\n  \"scripts.capture\",\n  \"scripts.beautify\",\n  \"scripts.deobfuscate\",\n  \"scripts.sandbox\",\n  \"captcha.solve\",\n  \"computer.execute\",\n  \"session.close\",\n] as const;\n\nexport type OpensteerSemanticOperationName = (typeof opensteerSemanticOperationNames)[number];\n\nexport const opensteerExposedSemanticOperationNames = [\n  \"session.open\",\n  \"page.list\",\n  \"page.new\",\n  \"page.activate\",\n  \"page.close\",\n  \"page.goto\",\n  \"page.evaluate\",\n  \"page.add-init-script\",\n  \"page.snapshot\",\n  \"dom.click\",\n  \"dom.hover\",\n  \"dom.input\",\n  \"dom.scroll\",\n  \"dom.extract\",\n  \"network.query\",\n  \"network.detail\",\n  \"interaction.capture\",\n  \"interaction.get\",\n  \"interaction.diff\",\n  \"interaction.replay\",\n  \"artifact.read\",\n  \"session.cookies\",\n  \"session.storage\",\n  \"session.state\",\n  \"session.fetch\",\n  \"scripts.capture\",\n  \"scripts.beautify\",\n  \"scripts.deobfuscate\",\n  \"scripts.sandbox\",\n  \"captcha.solve\",\n  \"computer.execute\",\n  \"session.close\",\n] as const satisfies readonly OpensteerSemanticOperationName[];\n\nexport interface OpensteerSemanticOperationSpec<TInput = unknown, TOutput = unknown> {\n  readonly name: OpensteerSemanticOperationName;\n  readonly description: string;\n  readonly inputSchema: JsonSchema;\n  readonly outputSchema: JsonSchema & { readonly __output?: TOutput };\n  readonly requiredCapabilities: readonly OpensteerCapability[];\n  readonly packageRunnable?: boolean;\n  resolveRequiredCapabilities?(input: TInput): readonly OpensteerCapability[];\n}\n\nexport interface OpensteerSemanticRestEndpointDescriptor {\n  readonly name: OpensteerSemanticOperationName;\n  readonly method: \"POST\";\n  readonly path: string;\n  readonly description: string;\n  readonly requestSchema: JsonSchema;\n  readonly responseSchema: JsonSchema;\n}\n\nfunction defineSemanticOperationSpec<TInput, TOutput>(\n  spec: OpensteerSemanticOperationSpec<TInput, TOutput>,\n): OpensteerSemanticOperationSpec<TInput, TOutput> {\n  return spec;\n}\n\nconst opensteerPackageRunnableSemanticOperationNames = new Set<OpensteerSemanticOperationName>([\n  \"page.list\",\n  \"page.new\",\n  \"page.activate\",\n  \"page.close\",\n  \"page.goto\",\n  \"page.evaluate\",\n  \"page.add-init-script\",\n  \"page.snapshot\",\n  \"dom.click\",\n  \"dom.hover\",\n  \"dom.input\",\n  \"dom.scroll\",\n  \"dom.extract\",\n  \"network.query\",\n  \"network.detail\",\n  \"interaction.capture\",\n  \"interaction.get\",\n  \"interaction.diff\",\n  \"interaction.replay\",\n  \"artifact.read\",\n  \"session.cookies\",\n  \"session.storage\",\n  \"session.state\",\n  \"session.fetch\",\n  \"scripts.capture\",\n  \"scripts.beautify\",\n  \"scripts.deobfuscate\",\n  \"scripts.sandbox\",\n  \"captcha.solve\",\n  \"computer.execute\",\n]);\n\nconst snapshotModeSchema: JsonSchema = enumSchema([\"action\", \"extraction\"] as const, {\n  title: \"OpensteerSnapshotMode\",\n});\n\nconst viewportSchema: JsonSchema = oneOfSchema(\n  [\n    objectSchema(\n      {\n        width: integerSchema({ minimum: 1 }),\n        height: integerSchema({ minimum: 1 }),\n      },\n      {\n        title: \"OpensteerViewport\",\n        required: [\"width\", \"height\"],\n      },\n    ),\n    literalSchema(null),\n  ],\n  {\n    title: \"OpensteerViewportOrNull\",\n  },\n);\n\nconst opensteerBrowserLaunchOptionsSchema: JsonSchema = objectSchema(\n  {\n    headless: { type: \"boolean\" },\n    executablePath: stringSchema(),\n    args: arraySchema(stringSchema()),\n    timeoutMs: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerBrowserLaunchOptions\",\n  },\n);\n\nconst attachBrowserOptionsSchema: JsonSchema = objectSchema(\n  {\n    mode: enumSchema([\"attach\"] as const),\n    endpoint: stringSchema(),\n    headers: recordSchema(stringSchema(), {\n      title: \"OpensteerAttachBrowserHeaders\",\n    }),\n    freshTab: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerAttachBrowserOptions\",\n    required: [\"mode\"],\n  },\n);\n\nconst opensteerBrowserOptionsSchema: JsonSchema = oneOfSchema(\n  [enumSchema([\"temporary\", \"persistent\"] as const), attachBrowserOptionsSchema],\n  {\n    title: \"OpensteerBrowserOptions\",\n  },\n);\n\nconst opensteerBrowserContextOptionsSchema: JsonSchema = objectSchema(\n  {\n    ignoreHTTPSErrors: { type: \"boolean\" },\n    locale: stringSchema(),\n    timezoneId: stringSchema(),\n    userAgent: stringSchema(),\n    viewport: viewportSchema,\n    javaScriptEnabled: { type: \"boolean\" },\n    bypassCSP: { type: \"boolean\" },\n    reducedMotion: enumSchema([\"reduce\", \"no-preference\"] as const),\n    colorScheme: enumSchema([\"light\", \"dark\", \"no-preference\"] as const),\n    stealthProfile: objectSchema(\n      {\n        id: stringSchema(),\n        platform: enumSchema([\"macos\", \"windows\", \"linux\"] as const),\n        browserBrand: enumSchema([\"chrome\", \"edge\"] as const),\n        browserVersion: stringSchema(),\n        userAgent: stringSchema(),\n        viewport: viewportSchema,\n        screenResolution: viewportSchema,\n        devicePixelRatio: { type: \"number\", minimum: 0.5 },\n        maxTouchPoints: integerSchema({ minimum: 0 }),\n        webglVendor: stringSchema(),\n        webglRenderer: stringSchema(),\n        fonts: arraySchema(stringSchema()),\n        canvasNoiseSeed: integerSchema({ minimum: 0 }),\n        audioNoiseSeed: integerSchema({ minimum: 0 }),\n        locale: stringSchema(),\n        timezoneId: stringSchema(),\n      },\n      {\n        title: \"OpensteerStealthProfileInput\",\n      },\n    ),\n    humanize: oneOfSchema(\n      [\n        { type: \"boolean\" } as JsonSchema,\n        objectSchema(\n          {\n            mouse: { type: \"boolean\" },\n            keyboard: { type: \"boolean\" },\n            scroll: { type: \"boolean\" },\n          },\n          { title: \"OpensteerHumanizeOptions\" },\n        ),\n      ],\n      { title: \"OpensteerHumanize\" },\n    ),\n  },\n  {\n    title: \"OpensteerBrowserContextOptions\",\n  },\n);\n\nconst targetByElementSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"element\"] as const),\n    element: integerSchema({ minimum: 1 }),\n  },\n  {\n    title: \"OpensteerTargetByElement\",\n    required: [\"kind\", \"element\"],\n  },\n);\n\nconst targetByPersistSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"persist\"] as const),\n    persist: stringSchema(),\n  },\n  {\n    title: \"OpensteerTargetByPersist\",\n    required: [\"kind\", \"persist\"],\n  },\n);\n\nconst targetBySelectorSchema: JsonSchema = objectSchema(\n  {\n    kind: enumSchema([\"selector\"] as const),\n    selector: stringSchema(),\n  },\n  {\n    title: \"OpensteerTargetBySelector\",\n    required: [\"kind\", \"selector\"],\n  },\n);\n\nconst opensteerTargetInputSchema: JsonSchema = oneOfSchema(\n  [targetByElementSchema, targetByPersistSchema, targetBySelectorSchema],\n  {\n    title: \"OpensteerTargetInput\",\n  },\n);\n\nconst opensteerActionResultSchema: JsonSchema = objectSchema(\n  {\n    tagName: stringSchema({ minLength: 1 }),\n    persist: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerActionResult\",\n    required: [\"tagName\"],\n  },\n);\n\nconst opensteerSnapshotCounterSchema: JsonSchema = objectSchema(\n  {\n    element: integerSchema({ minimum: 1 }),\n    pageRef: pageRefSchema,\n    frameRef: frameRefSchema,\n    documentRef: documentRefSchema,\n    documentEpoch: documentEpochSchema,\n    nodeRef: nodeRefSchema,\n    tagName: stringSchema(),\n    pathHint: stringSchema(),\n    text: stringSchema(),\n    attributes: arraySchema(\n      objectSchema(\n        {\n          name: stringSchema(),\n          value: stringSchema(),\n        },\n        {\n          title: \"OpensteerSnapshotCounterAttribute\",\n          required: [\"name\", \"value\"],\n        },\n      ),\n    ),\n    iframeDepth: integerSchema({ minimum: 0 }),\n    shadowDepth: integerSchema({ minimum: 0 }),\n    interactive: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerSnapshotCounter\",\n    required: [\n      \"element\",\n      \"pageRef\",\n      \"frameRef\",\n      \"documentRef\",\n      \"documentEpoch\",\n      \"tagName\",\n      \"pathHint\",\n      \"iframeDepth\",\n      \"shadowDepth\",\n      \"interactive\",\n    ],\n  },\n);\n\nconst opensteerNavigationSummarySchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    title: stringSchema(),\n  },\n  {\n    title: \"OpensteerNavigationSummary\",\n    required: [\"url\", \"title\"],\n  },\n);\n\nconst opensteerOpenInputSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    workspace: stringSchema(),\n    browser: opensteerBrowserOptionsSchema,\n    launch: opensteerBrowserLaunchOptionsSchema,\n    context: opensteerBrowserContextOptionsSchema,\n  },\n  {\n    title: \"OpensteerOpenInput\",\n  },\n);\n\nconst opensteerPageListInputSchema: JsonSchema = objectSchema(\n  {},\n  {\n    title: \"OpensteerPageListInput\",\n  },\n);\n\nconst opensteerPageListOutputSchema: JsonSchema = objectSchema(\n  {\n    activePageRef: pageRefSchema,\n    pages: arraySchema(pageInfoSchema),\n  },\n  {\n    title: \"OpensteerPageListOutput\",\n    required: [\"pages\"],\n  },\n);\n\nconst opensteerPageNewInputSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    openerPageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerPageNewInput\",\n  },\n);\n\nconst opensteerPageActivateInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerPageActivateInput\",\n    required: [\"pageRef\"],\n  },\n);\n\nconst opensteerPageCloseInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerPageCloseInput\",\n  },\n);\n\nconst opensteerPageCloseOutputSchema: JsonSchema = objectSchema(\n  {\n    closedPageRef: pageRefSchema,\n    activePageRef: pageRefSchema,\n    pages: arraySchema(pageInfoSchema),\n  },\n  {\n    title: \"OpensteerPageCloseOutput\",\n    required: [\"closedPageRef\", \"pages\"],\n  },\n);\n\nconst opensteerPageNewOutputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    url: stringSchema(),\n    title: stringSchema(),\n  },\n  {\n    title: \"OpensteerPageNewOutput\",\n    required: [\"pageRef\", \"url\", \"title\"],\n  },\n);\n\nconst opensteerPageGotoInputSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    captureNetwork: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerPageGotoInput\",\n    required: [\"url\"],\n  },\n);\n\nconst opensteerPageEvaluateInputSchema: JsonSchema = objectSchema(\n  {\n    script: stringSchema({ minLength: 1 }),\n    args: arraySchema(\n      defineSchema({\n        title: \"JsonValue\",\n      }),\n    ),\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerPageEvaluateInput\",\n    required: [\"script\"],\n  },\n);\n\nconst opensteerPageEvaluateOutputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    value: oneOfSchema(\n      [\n        defineSchema({\n          title: \"JsonValue\",\n        }),\n        arraySchema({}),\n        stringSchema(),\n        numberSchema(),\n        enumSchema([true, false, null] as const),\n      ],\n      {\n        title: \"OpensteerPageEvaluateValue\",\n      },\n    ),\n  },\n  {\n    title: \"OpensteerPageEvaluateOutput\",\n    required: [\"pageRef\", \"value\"],\n  },\n);\n\nconst opensteerAddInitScriptInputSchema: JsonSchema = objectSchema(\n  {\n    script: stringSchema({ minLength: 1 }),\n    args: arraySchema(defineSchema({ title: \"OpensteerInitScriptArg\" })),\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerAddInitScriptInput\",\n    required: [\"script\"],\n  },\n);\n\nconst opensteerAddInitScriptOutputSchema: JsonSchema = objectSchema(\n  {\n    registrationId: stringSchema({ minLength: 1 }),\n    sessionRef: sessionRefSchema,\n    pageRef: pageRefSchema,\n  },\n  {\n    title: \"OpensteerAddInitScriptOutput\",\n    required: [\"registrationId\", \"sessionRef\"],\n  },\n);\n\nconst opensteerCapturedScriptSchema: JsonSchema = objectSchema(\n  {\n    source: enumSchema([\"inline\", \"external\", \"dynamic\", \"worker\"] as const),\n    url: stringSchema({ minLength: 1 }),\n    type: stringSchema({ minLength: 1 }),\n    hash: stringSchema({ minLength: 1 }),\n    loadOrder: integerSchema({ minimum: 0 }),\n    content: stringSchema(),\n    artifactId: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerCapturedScript\",\n    required: [\"source\", \"hash\", \"loadOrder\", \"content\"],\n  },\n);\n\nconst opensteerCaptureScriptsInputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    includeInline: { type: \"boolean\" },\n    includeExternal: { type: \"boolean\" },\n    includeDynamic: { type: \"boolean\" },\n    includeWorkers: { type: \"boolean\" },\n    urlFilter: stringSchema({ minLength: 1 }),\n    persist: { type: \"boolean\" },\n  },\n  {\n    title: \"OpensteerCaptureScriptsInput\",\n  },\n);\n\nconst opensteerCaptureScriptsOutputSchema: JsonSchema = objectSchema(\n  {\n    pageRef: pageRefSchema,\n    scripts: arraySchema(opensteerCapturedScriptSchema),\n  },\n  {\n    title: \"OpensteerCaptureScriptsOutput\",\n    required: [\"pageRef\", \"scripts\"],\n  },\n);\n\nconst opensteerPageSnapshotInputSchema: JsonSchema = objectSchema(\n  {\n    mode: snapshotModeSchema,\n  },\n  {\n    title: \"OpensteerPageSnapshotInput\",\n  },\n);\n\nconst opensteerPageSnapshotOutputSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    title: stringSchema(),\n    mode: snapshotModeSchema,\n    html: stringSchema(),\n    counters: arraySchema(opensteerSnapshotCounterSchema),\n  },\n  {\n    title: \"OpensteerPageSnapshotOutput\",\n    required: [\"url\", \"title\", \"mode\", \"html\", \"counters\"],\n  },\n);\n\nconst opensteerComputerMouseButtonSchema: JsonSchema = enumSchema(\n  [\"left\", \"middle\", \"right\"] as const,\n  {\n    title: \"OpensteerComputerMouseButton\",\n  },\n);\n\nconst opensteerComputerKeyModifierSchema: JsonSchema = enumSchema(\n  [\"Shift\", \"Control\", \"Alt\", \"Meta\"] as const,\n  {\n    title: \"OpensteerComputerKeyModifier\",\n  },\n);\n\nconst opensteerDomClickInputSchema: JsonSchema = objectSchema(\n  {\n    target: opensteerTargetInputSchema,\n    button: opensteerComputerMouseButtonSchema,\n    clickCount: integerSchema({ minimum: 1 }),\n    modifiers: arraySchema(opensteerComputerKeyModifierSchema, {\n      uniqueItems: true,\n    }),\n    persist: stringSchema(),\n    captureNetwork: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerDomClickInput\",\n    required: [\"target\"],\n  },\n);\n\nconst opensteerDomHoverInputSchema = objectSchema(\n  {\n    target: opensteerTargetInputSchema,\n    persist: stringSchema(),\n    captureNetwork: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerDomHoverInput\",\n    required: [\"target\"],\n  },\n);\n\nconst opensteerDomInputInputSchema: JsonSchema = objectSchema(\n  {\n    target: opensteerTargetInputSchema,\n    text: stringSchema(),\n    pressEnter: { type: \"boolean\" },\n    persist: stringSchema(),\n    captureNetwork: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerDomInputInput\",\n    required: [\"target\", \"text\"],\n  },\n);\n\nconst opensteerDomScrollInputSchema: JsonSchema = objectSchema(\n  {\n    target: opensteerTargetInputSchema,\n    direction: enumSchema([\"up\", \"down\", \"left\", \"right\"] as const),\n    amount: integerSchema({ minimum: 1 }),\n    persist: stringSchema(),\n    captureNetwork: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerDomScrollInput\",\n    required: [\"target\", \"direction\", \"amount\"],\n  },\n);\n\nconst opensteerExtractTemplateSchema: JsonSchema = objectSchema(\n  {},\n  {\n    title: \"OpensteerExtractTemplate\",\n    additionalProperties: true,\n  },\n);\n\nconst opensteerDomExtractInputSchema: JsonSchema = defineSchema({\n  ...objectSchema(\n    {\n      persist: stringSchema(),\n      template: opensteerExtractTemplateSchema,\n    },\n    {\n      title: \"OpensteerDomExtractInput\",\n    },\n  ),\n  anyOf: [defineSchema({ required: [\"persist\"] }), defineSchema({ required: [\"template\"] })],\n});\n\nconst jsonValueSchema: JsonSchema = recordSchema({}, { title: \"JsonValueRecord\" });\n\nconst opensteerDomExtractOutputSchema: JsonSchema = objectSchema(\n  {\n    data: oneOfSchema(\n      [\n        jsonValueSchema,\n        arraySchema({}),\n        stringSchema(),\n        numberSchema(),\n        enumSchema([true, false, null] as const),\n      ],\n      {\n        title: \"OpensteerExtractedJsonValue\",\n      },\n    ),\n  },\n  {\n    title: \"OpensteerDomExtractOutput\",\n    required: [\"data\"],\n  },\n);\n\nconst opensteerSessionCloseInputSchema: JsonSchema = objectSchema(\n  {},\n  {\n    title: \"OpensteerSessionCloseInput\",\n    required: [],\n  },\n);\n\nconst opensteerSessionCloseOutputSchema: JsonSchema = objectSchema(\n  {\n    closed: literalSchema(true),\n  },\n  {\n    title: \"OpensteerSessionCloseOutput\",\n    required: [\"closed\"],\n  },\n);\n\nconst opensteerComputerAnnotationSchema: JsonSchema = enumSchema(opensteerComputerAnnotationNames, {\n  title: \"OpensteerComputerAnnotation\",\n});\n\nconst opensteerComputerClickActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"click\"] as const),\n    x: numberSchema(),\n    y: numberSchema(),\n    button: opensteerComputerMouseButtonSchema,\n    clickCount: integerSchema({ minimum: 1 }),\n    modifiers: arraySchema(opensteerComputerKeyModifierSchema, {\n      uniqueItems: true,\n    }),\n  },\n  {\n    title: \"OpensteerComputerClickAction\",\n    required: [\"type\", \"x\", \"y\"],\n  },\n);\n\nconst opensteerComputerMoveActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"move\"] as const),\n    x: numberSchema(),\n    y: numberSchema(),\n  },\n  {\n    title: \"OpensteerComputerMoveAction\",\n    required: [\"type\", \"x\", \"y\"],\n  },\n);\n\nconst opensteerComputerScrollActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"scroll\"] as const),\n    x: numberSchema(),\n    y: numberSchema(),\n    deltaX: numberSchema(),\n    deltaY: numberSchema(),\n  },\n  {\n    title: \"OpensteerComputerScrollAction\",\n    required: [\"type\", \"x\", \"y\", \"deltaX\", \"deltaY\"],\n  },\n);\n\nconst opensteerComputerTypeActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"type\"] as const),\n    text: stringSchema(),\n  },\n  {\n    title: \"OpensteerComputerTypeAction\",\n    required: [\"type\", \"text\"],\n  },\n);\n\nconst opensteerComputerKeyActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"key\"] as const),\n    key: stringSchema(),\n    modifiers: arraySchema(opensteerComputerKeyModifierSchema, {\n      uniqueItems: true,\n    }),\n  },\n  {\n    title: \"OpensteerComputerKeyAction\",\n    required: [\"type\", \"key\"],\n  },\n);\n\nconst opensteerComputerDragActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"drag\"] as const),\n    start: pointSchema,\n    end: pointSchema,\n    steps: integerSchema({ minimum: 1 }),\n  },\n  {\n    title: \"OpensteerComputerDragAction\",\n    required: [\"type\", \"start\", \"end\"],\n  },\n);\n\nconst opensteerComputerScreenshotActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"screenshot\"] as const),\n  },\n  {\n    title: \"OpensteerComputerScreenshotAction\",\n    required: [\"type\"],\n  },\n);\n\nconst opensteerComputerWaitActionSchema: JsonSchema = objectSchema(\n  {\n    type: enumSchema([\"wait\"] as const),\n    durationMs: integerSchema({ minimum: 0 }),\n  },\n  {\n    title: \"OpensteerComputerWaitAction\",\n    required: [\"type\", \"durationMs\"],\n  },\n);\n\nconst opensteerComputerActionSchema: JsonSchema = oneOfSchema(\n  [\n    opensteerComputerClickActionSchema,\n    opensteerComputerMoveActionSchema,\n    opensteerComputerScrollActionSchema,\n    opensteerComputerTypeActionSchema,\n    opensteerComputerKeyActionSchema,\n    opensteerComputerDragActionSchema,\n    opensteerComputerScreenshotActionSchema,\n    opensteerComputerWaitActionSchema,\n  ],\n  {\n    title: \"OpensteerComputerAction\",\n  },\n);\n\nconst opensteerComputerScreenshotOptionsSchema: JsonSchema = objectSchema(\n  {\n    format: enumSchema([\"png\", \"jpeg\", \"webp\"] as const),\n    includeCursor: { type: \"boolean\" },\n    disableAnnotations: arraySchema(opensteerComputerAnnotationSchema, {\n      uniqueItems: true,\n    }),\n  },\n  {\n    title: \"OpensteerComputerScreenshotOptions\",\n  },\n);\n\nconst opensteerComputerExecuteInputSchema: JsonSchema = objectSchema(\n  {\n    action: opensteerComputerActionSchema,\n    screenshot: opensteerComputerScreenshotOptionsSchema,\n    captureNetwork: stringSchema({ minLength: 1 }),\n  },\n  {\n    title: \"OpensteerComputerExecuteInput\",\n    required: [\"action\"],\n  },\n);\n\nconst opensteerScreenshotSummarySchema: JsonSchema = objectSchema(\n  {\n    payload: externalBinaryLocationSchema,\n    format: screenshotFormatSchema,\n    size: sizeSchema,\n    coordinateSpace: coordinateSpaceSchema,\n    clip: rectSchema,\n  },\n  {\n    title: \"OpensteerScreenshotSummary\",\n    required: [\"payload\", \"format\", \"size\", \"coordinateSpace\"],\n  },\n);\n\nconst opensteerComputerExecuteOutputSchema: JsonSchema = objectSchema(\n  {\n    url: stringSchema(),\n    title: stringSchema(),\n    screenshot: opensteerScreenshotSummarySchema,\n  },\n  {\n    title: \"OpensteerComputerExecuteOutput\",\n    required: [\"url\", \"title\", \"screenshot\"],\n  },\n);\n\nexport function resolveSemanticRequiredCapabilities<TInput>(\n  spec: Pick<\n    OpensteerSemanticOperationSpec<TInput, unknown>,\n    \"requiredCapabilities\" | \"resolveRequiredCapabilities\"\n  >,\n  input: TInput,\n): readonly OpensteerCapability[] {\n  return spec.resolveRequiredCapabilities?.(input) ?? spec.requiredCapabilities;\n}\n\nexport function assertValidSemanticOperationInput(\n  name: OpensteerSemanticOperationName,\n  input: unknown,\n): void {\n  const spec = opensteerSemanticOperationSpecificationMap[name];\n  const issues = validateJsonSchema(spec.inputSchema, input);\n  if (issues.length === 0) {\n    return;\n  }\n\n  const firstIssue = issues[0]!;\n  throw new OpensteerProtocolError(\n    \"invalid-request\",\n    `invalid ${name} input at ${firstIssue.path}: ${firstIssue.message}`,\n    {\n      details: {\n        operation: name,\n        issues,\n      },\n    },\n  );\n}\n\nconst opensteerSemanticOperationSpecificationsBase = [\n  defineSemanticOperationSpec<OpensteerOpenInput, OpensteerOpenOutput>({\n    name: \"session.open\",\n    description: \"Open or resume the current Opensteer session and primary page.\",\n    inputSchema: opensteerOpenInputSchema,\n    outputSchema: opensteerNavigationSummarySchema,\n    requiredCapabilities: [\"sessions.manage\", \"pages.manage\"],\n    resolveRequiredCapabilities: (input) =>\n      input.url === undefined\n        ? [\"sessions.manage\", \"pages.manage\"]\n        : [\"sessions.manage\", \"pages.manage\", \"pages.navigate\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageListInput, OpensteerPageListOutput>({\n    name: \"page.list\",\n    description: \"List top-level pages for the current Opensteer session.\",\n    inputSchema: opensteerPageListInputSchema,\n    outputSchema: opensteerPageListOutputSchema,\n    requiredCapabilities: [\"inspect.pages\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageNewInput, OpensteerPageNewOutput>({\n    name: \"page.new\",\n    description: \"Create and optionally navigate a new top-level page in the current session.\",\n    inputSchema: opensteerPageNewInputSchema,\n    outputSchema: opensteerPageNewOutputSchema,\n    requiredCapabilities: [\"pages.manage\"],\n    resolveRequiredCapabilities: (input) =>\n      input.url === undefined ? [\"pages.manage\"] : [\"pages.manage\", \"pages.navigate\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageActivateInput, OpensteerPageActivateOutput>({\n    name: \"page.activate\",\n    description: \"Activate an existing top-level page in the current session.\",\n    inputSchema: opensteerPageActivateInputSchema,\n    outputSchema: opensteerNavigationSummarySchema,\n    requiredCapabilities: [\"pages.manage\", \"inspect.pages\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageCloseInput, OpensteerPageCloseOutput>({\n    name: \"page.close\",\n    description: \"Close a top-level page in the current session.\",\n    inputSchema: opensteerPageCloseInputSchema,\n    outputSchema: opensteerPageCloseOutputSchema,\n    requiredCapabilities: [\"pages.manage\", \"inspect.pages\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageGotoInput, OpensteerPageGotoOutput>({\n    name: \"page.goto\",\n    description: \"Navigate the current Opensteer page to a new URL.\",\n    inputSchema: opensteerPageGotoInputSchema,\n    outputSchema: opensteerNavigationSummarySchema,\n    requiredCapabilities: [\"pages.navigate\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageEvaluateInput, OpensteerPageEvaluateOutput>({\n    name: \"page.evaluate\",\n    description: \"Execute JavaScript in the live page context and return a structured result.\",\n    inputSchema: opensteerPageEvaluateInputSchema,\n    outputSchema: opensteerPageEvaluateOutputSchema,\n    requiredCapabilities: [\"pages.manage\"],\n  }),\n  defineSemanticOperationSpec<OpensteerAddInitScriptInput, OpensteerAddInitScriptOutput>({\n    name: \"page.add-init-script\",\n    description: \"Register a script that runs before page scripts in the current browser session.\",\n    inputSchema: opensteerAddInitScriptInputSchema,\n    outputSchema: opensteerAddInitScriptOutputSchema,\n    requiredCapabilities: [\"instrumentation.initScripts\"],\n  }),\n  defineSemanticOperationSpec<OpensteerPageSnapshotInput, OpensteerPageSnapshotOutput>({\n    name: \"page.snapshot\",\n    description: \"Compile an HTML-first agent snapshot for the current page.\",\n    inputSchema: opensteerPageSnapshotInputSchema,\n    outputSchema: opensteerPageSnapshotOutputSchema,\n    requiredCapabilities: [\"inspect.pages\", \"inspect.html\", \"inspect.domSnapshot\"],\n  }),\n  defineSemanticOperationSpec<OpensteerDomClickInput, OpensteerActionResult>({\n    name: \"dom.click\",\n    description: \"Resolve and click a DOM target using Opensteer semantics.\",\n    inputSchema: opensteerDomClickInputSchema,\n    outputSchema: opensteerActionResultSchema,\n    requiredCapabilities: [\"input.pointer\", \"inspect.domSnapshot\", \"inspect.hitTest\"],\n  }),\n  defineSemanticOperationSpec<OpensteerDomHoverInput, OpensteerActionResult>({\n    name: \"dom.hover\",\n    description: \"Resolve and hover a DOM target using Opensteer semantics.\",\n    inputSchema: opensteerDomHoverInputSchema,\n    outputSchema: opensteerActionResultSchema,\n    requiredCapabilities: [\"input.pointer\", \"inspect.domSnapshot\", \"inspect.hitTest\"],\n  }),\n  defineSemanticOperationSpec<OpensteerDomInputInput, OpensteerActionResult>({\n    name: \"dom.input\",\n    description: \"Resolve a DOM target, focus it, and type text through Opensteer semantics.\",\n    inputSchema: opensteerDomInputInputSchema,\n    outputSchema: opensteerActionResultSchema,\n    requiredCapabilities: [\n      \"input.pointer\",\n      \"input.keyboard\",\n      \"inspect.domSnapshot\",\n      \"inspect.hitTest\",\n    ],\n  }),\n  defineSemanticOperationSpec<OpensteerDomScrollInput, OpensteerActionResult>({\n    name: \"dom.scroll\",\n    description:\n      \"Resolve a DOM target and dispatch directional scrolling through Opensteer semantics.\",\n    inputSchema: opensteerDomScrollInputSchema,\n    outputSchema: opensteerActionResultSchema,\n    requiredCapabilities: [\"input.pointer\", \"inspect.domSnapshot\", \"inspect.hitTest\"],\n  }),\n  defineSemanticOperationSpec<OpensteerDomExtractInput, OpensteerDomExtractOutput>({\n    name: \"dom.extract\",\n    description:\n      \"Run structured DOM extraction and optionally persist the extraction descriptor for replay.\",\n    inputSchema: opensteerDomExtractInputSchema,\n    outputSchema: opensteerDomExtractOutputSchema,\n    requiredCapabilities: [\"inspect.domSnapshot\", \"inspect.text\", \"inspect.attributes\"],\n  }),\n  defineSemanticOperationSpec<OpensteerNetworkQueryInput, OpensteerNetworkQueryOutput>({\n    name: \"network.query\",\n    description:\n      \"Query captured network traffic with chronological summaries optimized for agent inspection.\",\n    inputSchema: opensteerNetworkQueryInputSchema,\n    outputSchema: opensteerNetworkQueryOutputSchema,\n    requiredCapabilities: [\"inspect.network\"],\n  }),\n  defineSemanticOperationSpec<OpensteerNetworkDetailInput, OpensteerNetworkDetailOutput>({\n    name: \"network.detail\",\n    description:\n      \"Inspect one captured network record with parsed headers, cookies, redirects, and truncated bodies.\",\n    inputSchema: opensteerNetworkDetailInputSchema,\n    outputSchema: opensteerNetworkDetailOutputSchema,\n    requiredCapabilities: [\"inspect.network\", \"inspect.networkBodies\"],\n  }),\n  defineSemanticOperationSpec<OpensteerInteractionCaptureInput, OpensteerInteractionCaptureOutput>({\n    name: \"interaction.capture\",\n    description:\n      \"Capture a guarded interaction window, including event properties, state changes, and downstream network.\",\n    inputSchema: opensteerInteractionCaptureInputSchema,\n    outputSchema: opensteerInteractionCaptureOutputSchema,\n    requiredCapabilities: [\"pages.manage\", \"inspect.cookies\", \"inspect.localStorage\"],\n  }),\n  defineSemanticOperationSpec<OpensteerInteractionGetInput, OpensteerInteractionGetOutput>({\n    name: \"interaction.get\",\n    description:\n      \"Read a captured interaction trace by ID for package inspection, diffing, and replay editing.\",\n    inputSchema: opensteerInteractionGetInputSchema,\n    outputSchema: opensteerInteractionGetOutputSchema,\n    requiredCapabilities: [],\n  }),\n  defineSemanticOperationSpec<OpensteerInteractionDiffInput, OpensteerInteractionDiffOutput>({\n    name: \"interaction.diff\",\n    description:\n      \"Compare two captured interaction traces by event sequence, event properties, state deltas, and downstream network.\",\n    inputSchema: opensteerInteractionDiffInputSchema,\n    outputSchema: opensteerInteractionDiffOutputSchema,\n    requiredCapabilities: [],\n  }),\n  defineSemanticOperationSpec<OpensteerInteractionReplayInput, OpensteerInteractionReplayOutput>({\n    name: \"interaction.replay\",\n    description:\n      \"Replay a captured interaction trace against a live page and report how many events were reproduced.\",\n    inputSchema: opensteerInteractionReplayInputSchema,\n    outputSchema: opensteerInteractionReplayOutputSchema,\n    requiredCapabilities: [\"pages.manage\"],\n  }),\n  defineSemanticOperationSpec<OpensteerArtifactReadInput, OpensteerArtifactReadOutput>({\n    name: \"artifact.read\",\n    description:\n      \"Read a persisted artifact by ID so agents can inspect captured scripts, storage, cookies, or snapshots linked from recorded workflows.\",\n    inputSchema: opensteerArtifactReadInputSchema,\n    outputSchema: opensteerArtifactReadOutputSchema,\n    requiredCapabilities: [],\n  }),\n  defineSemanticOperationSpec<OpensteerCaptureScriptsInput, OpensteerCaptureScriptsOutput>({\n    name: \"scripts.capture\",\n    description: \"Capture inline and external script sources from the current page and run.\",\n    inputSchema: opensteerCaptureScriptsInputSchema,\n    outputSchema: opensteerCaptureScriptsOutputSchema,\n    requiredCapabilities: [\"inspect.html\", \"inspect.network\", \"inspect.networkBodies\"],\n  }),\n  defineSemanticOperationSpec<OpensteerScriptBeautifyInput, OpensteerScriptBeautifyOutput>({\n    name: \"scripts.beautify\",\n    description:\n      \"Beautify captured or inline JavaScript through Prettier and optionally persist the transformed artifact.\",\n    inputSchema: opensteerScriptBeautifyInputSchema,\n    outputSchema: opensteerScriptBeautifyOutputSchema,\n    requiredCapabilities: [],\n  }),\n  defineSemanticOperationSpec<OpensteerScriptDeobfuscateInput, OpensteerScriptDeobfuscateOutput>({\n    name: \"scripts.deobfuscate\",\n    description:\n      \"Deobfuscate captured or inline JavaScript through webcrack and optionally persist the transformed artifact.\",\n    inputSchema: opensteerScriptDeobfuscateInputSchema,\n    outputSchema: opensteerScriptDeobfuscateOutputSchema,\n    requiredCapabilities: [],\n  }),\n  defineSemanticOperationSpec<OpensteerScriptSandboxInput, OpensteerScriptSandboxOutput>({\n    name: \"scripts.sandbox\",\n    description:\n      \"Execute captured or inline JavaScript inside a controlled VM sandbox with browser-style shims and AJAX interception.\",\n    inputSchema: opensteerScriptSandboxInputSchema,\n    outputSchema: opensteerScriptSandboxOutputSchema,\n    requiredCapabilities: [],\n  }),\n  defineSemanticOperationSpec<OpensteerCaptchaSolveInput, OpensteerCaptchaSolveOutput>({\n    name: \"captcha.solve\",\n    description:\n      \"Detect, solve, and inject a supported CAPTCHA token into the current page through a pluggable solver provider.\",\n    inputSchema: opensteerCaptchaSolveInputSchema,\n    outputSchema: opensteerCaptchaSolveOutputSchema,\n    requiredCapabilities: [\"pages.manage\"],\n  }),\n  defineSemanticOperationSpec<OpensteerCookieQueryInput, OpensteerCookieQueryOutput>({\n    name: \"session.cookies\",\n    description:\n      \"Read browser cookies for the active page domain or an explicitly selected domain.\",\n    inputSchema: opensteerCookieQueryInputSchema,\n    outputSchema: opensteerCookieQueryOutputSchema,\n    requiredCapabilities: [\"inspect.cookies\"],\n  }),\n  defineSemanticOperationSpec<OpensteerStorageQueryInput, OpensteerStorageQueryOutput>({\n    name: \"session.storage\",\n    description:\n      \"Read localStorage and sessionStorage grouped by domain for the active browser session.\",\n    inputSchema: opensteerStorageQueryInputSchema,\n    outputSchema: opensteerStorageQueryOutputSchema,\n    requiredCapabilities: [\"inspect.localStorage\", \"inspect.sessionStorage\"],\n  }),\n  defineSemanticOperationSpec<OpensteerStateQueryInput, OpensteerStateQueryOutput>({\n    name: \"session.state\",\n    description:\n      \"Read browser cookies, storage, hidden fields, and selected page globals grouped by domain.\",\n    inputSchema: opensteerStateQueryInputSchema,\n    outputSchema: opensteerStateQueryOutputSchema,\n    requiredCapabilities: [\n      \"inspect.cookies\",\n      \"inspect.localStorage\",\n      \"inspect.sessionStorage\",\n      \"pages.manage\",\n    ],\n  }),\n  defineSemanticOperationSpec<OpensteerSessionFetchInput, OpensteerSessionFetchOutput>({\n    name: \"session.fetch\",\n    description:\n      \"Execute a session-aware HTTP request with browser cookies and automatic transport selection.\",\n    inputSchema: opensteerSessionFetchInputSchema,\n    outputSchema: opensteerSessionFetchOutputSchema,\n    requiredCapabilities: [],\n    resolveRequiredCapabilities: (input) => {\n      switch (input.transport ?? \"auto\") {\n        case \"direct\":\n          return [];\n        case \"matched-tls\":\n        case \"context\":\n          return [\"inspect.cookies\"];\n        case \"page\":\n          return [\"pages.manage\"];\n        case \"auto\":\n          return [\"inspect.cookies\", \"pages.manage\"];\n      }\n    },\n  }),\n  defineSemanticOperationSpec<OpensteerComputerExecuteInput, OpensteerComputerExecuteOutput>({\n    name: \"computer.execute\",\n    description:\n      \"Execute a computer-use action in canonical computer-display-css coordinates and return the post-action screenshot in that same model-visible space.\",\n    inputSchema: opensteerComputerExecuteInputSchema,\n    outputSchema: opensteerComputerExecuteOutputSchema,\n    requiredCapabilities: [\"artifacts.screenshot\", \"inspect.viewportMetrics\"],\n    resolveRequiredCapabilities: (input) => {\n      const base: OpensteerCapability[] = [\"artifacts.screenshot\", \"inspect.viewportMetrics\"];\n      switch (input.action.type) {\n        case \"click\":\n          if ((input.action.modifiers?.length ?? 0) > 0) {\n            base.unshift(\"input.keyboard\");\n          }\n          base.unshift(\"input.pointer\");\n          break;\n        case \"move\":\n        case \"scroll\":\n        case \"drag\":\n          base.unshift(\"input.pointer\");\n          break;\n        case \"type\":\n        case \"key\":\n          base.unshift(\"input.keyboard\");\n          break;\n        case \"screenshot\":\n        case \"wait\":\n          break;\n      }\n      return base;\n    },\n  }),\n  defineSemanticOperationSpec<OpensteerSessionCloseInput, OpensteerSessionCloseOutput>({\n    name: \"session.close\",\n    description: \"Close the current Opensteer session and release browser resources.\",\n    inputSchema: opensteerSessionCloseInputSchema,\n    outputSchema: opensteerSessionCloseOutputSchema,\n    requiredCapabilities: [\"sessions.manage\"],\n  }),\n] as const satisfies readonly OpensteerSemanticOperationSpec[];\n\nconst exposedSemanticOperationNameSet = new Set<OpensteerSemanticOperationName>(\n  opensteerExposedSemanticOperationNames,\n);\n\nconst opensteerSemanticOperationSpecificationsInternal =\n  opensteerSemanticOperationSpecificationsBase.map((spec) => ({\n    ...spec,\n    packageRunnable: opensteerPackageRunnableSemanticOperationNames.has(spec.name),\n  })) as readonly OpensteerSemanticOperationSpec[];\n\nexport const opensteerSemanticOperationSpecifications =\n  opensteerSemanticOperationSpecificationsInternal.filter((spec) =>\n    exposedSemanticOperationNameSet.has(spec.name),\n  ) as readonly OpensteerSemanticOperationSpec[];\n\nexport const opensteerSemanticOperationSpecificationMap = Object.fromEntries(\n  opensteerSemanticOperationSpecificationsInternal.map((spec) => [spec.name, spec]),\n) as Record<OpensteerSemanticOperationName, OpensteerSemanticOperationSpec>;\n\nconst semanticRestBasePath = `${OPENSTEER_PROTOCOL_REST_BASE_PATH}/semantic`;\n\nexport const opensteerSemanticRestEndpoints: readonly OpensteerSemanticRestEndpointDescriptor[] =\n  opensteerSemanticOperationSpecifications.map((spec) => ({\n    name: spec.name,\n    method: \"POST\",\n    path: `${semanticRestBasePath}/operations/${spec.name.replaceAll(\".\", \"/\")}`,\n    description: spec.description,\n    requestSchema: requestEnvelopeSchema(spec.inputSchema, spec.name),\n    responseSchema: responseEnvelopeSchema(spec.outputSchema, spec.name),\n  }));\n","import type { JsonObject, JsonSchema } from \"./json.js\";\nimport {\n  opensteerSemanticOperationSpecifications,\n  type OpensteerSemanticOperationName,\n} from \"./semantic.js\";\n\nexport interface OpensteerMcpToolAnnotations {\n  readonly readOnlyHint?: boolean;\n  readonly destructiveHint?: boolean;\n  readonly idempotentHint?: boolean;\n  readonly openWorldHint?: boolean;\n}\n\nexport interface OpensteerMcpToolDescriptor {\n  readonly name: string;\n  readonly title: string;\n  readonly description: string;\n  readonly operation: OpensteerSemanticOperationName;\n  readonly inputSchema: JsonSchema;\n  readonly outputSchema: JsonSchema;\n  readonly annotations?: OpensteerMcpToolAnnotations;\n}\n\nexport interface OpensteerMcpTextContent {\n  readonly type: \"text\";\n  readonly text: string;\n}\n\nexport interface OpensteerMcpImageContent {\n  readonly type: \"image\";\n  readonly data: string;\n  readonly mimeType: string;\n}\n\nexport type OpensteerMcpContent = OpensteerMcpTextContent | OpensteerMcpImageContent;\n\nexport interface OpensteerMcpToolResult<TStructured extends JsonObject = JsonObject> {\n  readonly structuredContent: TStructured;\n  readonly content?: readonly OpensteerMcpContent[];\n  readonly isError?: boolean;\n}\n\nconst readOnlyOperations = new Set<OpensteerSemanticOperationName>([\n  \"page.snapshot\",\n  \"dom.extract\",\n  \"network.query\",\n  \"network.detail\",\n  \"session.cookies\",\n  \"session.storage\",\n  \"session.state\",\n]);\n\nconst destructiveOperations = new Set<OpensteerSemanticOperationName>([\"session.close\"]);\n\nfunction toolNameFromOperation(operation: OpensteerSemanticOperationName): string {\n  return `opensteer_${operation.replaceAll(\".\", \"_\").replaceAll(\"-\", \"_\")}`;\n}\n\nfunction titleFromOperation(operation: OpensteerSemanticOperationName): string {\n  return operation\n    .split(/[.-]/)\n    .map((segment) => {\n      switch (segment) {\n        case \"dom\":\n          return \"DOM\";\n        case \"html\":\n          return \"HTML\";\n        default:\n          return segment.charAt(0).toUpperCase() + segment.slice(1);\n      }\n    })\n    .join(\" \");\n}\n\nexport const opensteerMcpTools: readonly OpensteerMcpToolDescriptor[] =\n  opensteerSemanticOperationSpecifications.map((spec) => ({\n    name: toolNameFromOperation(spec.name),\n    title: titleFromOperation(spec.name),\n    description: spec.description,\n    operation: spec.name,\n    inputSchema: spec.inputSchema,\n    outputSchema: spec.outputSchema,\n    annotations: {\n      readOnlyHint: readOnlyOperations.has(spec.name),\n      destructiveHint: destructiveOperations.has(spec.name),\n      idempotentHint: readOnlyOperations.has(spec.name),\n      openWorldHint: true,\n    },\n  }));\n\nexport function createStructuredToolResult<TStructured extends JsonObject>(\n  structuredContent: TStructured,\n  options: {\n    readonly text?: string;\n    readonly content?: readonly OpensteerMcpContent[];\n    readonly isError?: boolean;\n  } = {},\n): OpensteerMcpToolResult<TStructured> {\n  const content =\n    options.content ??\n    (options.text === undefined\n      ? undefined\n      : [\n          {\n            type: \"text\",\n            text: options.text,\n          } satisfies OpensteerMcpTextContent,\n        ]);\n\n  return {\n    structuredContent,\n    ...(content === undefined ? {} : { content }),\n    ...(options.isError === undefined ? {} : { isError: options.isError }),\n  };\n}\n","import type {\n  ActionBoundaryOutcome,\n  ActionBoundarySettleTrigger,\n  ActionBoundarySnapshot,\n  BrowserCoreEngine,\n  PageRef,\n  ScreenshotArtifact as BrowserCoreScreenshotArtifact,\n} from \"@opensteer/browser-core\";\n\nimport type {\n  OpensteerComputerAction,\n  OpensteerComputerAnnotation,\n  OpensteerComputerExecuteTiming,\n} from \"./semantic.js\";\nimport type { OpensteerEvent } from \"./events.js\";\nimport type { ViewportMetrics } from \"./geometry.js\";\nimport type { ScreenshotFormat } from \"./snapshots.js\";\n\nexport const OPENSTEER_COMPUTER_USE_BRIDGE_SYMBOL = Symbol.for(\"@opensteer/computer-use-bridge\");\n\nexport interface NormalizedComputerScreenshotOptions {\n  readonly format: ScreenshotFormat;\n  readonly includeCursor: boolean;\n  readonly annotations: readonly OpensteerComputerAnnotation[];\n}\n\nexport interface ComputerUseBridgeInput {\n  readonly pageRef: PageRef;\n  readonly snapshot?: ActionBoundarySnapshot;\n  readonly action: OpensteerComputerAction;\n  readonly screenshot: NormalizedComputerScreenshotOptions;\n  readonly signal: AbortSignal;\n  remainingMs(): number | undefined;\n  policySettle(\n    pageRef: PageRef,\n    trigger: ActionBoundarySettleTrigger,\n    boundary?: ActionBoundaryOutcome,\n  ): Promise<void>;\n}\n\nexport interface ComputerUseBridgeOutput {\n  readonly pageRef: PageRef;\n  readonly screenshot: BrowserCoreScreenshotArtifact;\n  readonly viewport: ViewportMetrics;\n  readonly events: readonly OpensteerEvent[];\n  readonly timing: OpensteerComputerExecuteTiming;\n  readonly boundary?: ActionBoundaryOutcome;\n}\n\nexport interface ComputerUseBridge {\n  execute(input: ComputerUseBridgeInput): Promise<ComputerUseBridgeOutput>;\n}\n\nexport interface ComputerUseBridgeProvider {\n  [OPENSTEER_COMPUTER_USE_BRIDGE_SYMBOL](): ComputerUseBridge;\n}\n\ntype ComputerUseBridgeFactory =\n  ComputerUseBridgeProvider[typeof OPENSTEER_COMPUTER_USE_BRIDGE_SYMBOL];\n\nfunction isComputerUseBridgeFactory(value: unknown): value is ComputerUseBridgeFactory {\n  return typeof value === \"function\";\n}\n\nexport function resolveComputerUseBridge(\n  engine: BrowserCoreEngine | ComputerUseBridgeProvider,\n): ComputerUseBridge | undefined {\n  const candidate = Reflect.get(engine, OPENSTEER_COMPUTER_USE_BRIDGE_SYMBOL);\n  return isComputerUseBridgeFactory(candidate) ? candidate.call(engine) : undefined;\n}\n","export type MatchOperator = \"exact\" | \"startsWith\" | \"contains\";\n\nexport interface AttributeMatchClause {\n  readonly kind: \"attr\";\n  readonly key: string;\n  readonly op?: MatchOperator;\n  readonly value?: string;\n}\n\nexport interface PositionMatchClause {\n  readonly kind: \"position\";\n  readonly axis: \"nthOfType\" | \"nthChild\";\n}\n\nexport interface TextMatchClause {\n  readonly kind: \"text\";\n  readonly value: string;\n}\n\nexport type MatchClause = AttributeMatchClause | PositionMatchClause | TextMatchClause;\n\nexport interface PathNodePosition {\n  readonly nthChild: number;\n  readonly nthOfType: number;\n}\n\nexport interface PathNode {\n  readonly tag: string;\n  readonly attrs: Readonly<Record<string, string>>;\n  readonly position: PathNodePosition;\n  readonly match: readonly MatchClause[];\n}\n\nexport interface ContextHop {\n  readonly kind: \"iframe\" | \"shadow\";\n  readonly host: readonly PathNode[];\n}\n\ninterface ElementRouteBase {\n  readonly context: readonly ContextHop[];\n  readonly nodes: readonly PathNode[];\n}\n\nexport interface StructuralElementAnchor extends ElementRouteBase {\n  readonly resolution: \"structural\";\n}\n\nexport interface ReplayElementPath extends ElementRouteBase {\n  readonly resolution: \"deterministic\";\n}\n","import type {\n  ActionBoundaryOutcome,\n  ActionBoundarySettleTrigger,\n  ActionBoundarySnapshot,\n  BrowserCoreEngine,\n  KeyModifier,\n  NodeLocator,\n  PageRef,\n  Point,\n  Quad,\n  Rect,\n} from \"@opensteer/browser-core\";\nimport type { ReplayElementPath } from \"./dom-path-types.js\";\n\nexport const OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL = Symbol.for(\"@opensteer/dom-action-bridge\");\n\nexport type DomActionScrollAlignment = \"start\" | \"center\" | \"end\" | \"nearest\";\n\nexport interface DomActionTargetInspection {\n  readonly connected: boolean;\n  readonly visible: boolean;\n  readonly enabled: boolean;\n  readonly editable: boolean;\n  readonly pointerEvents: string;\n  readonly bounds?: Rect;\n  readonly contentQuads: readonly Quad[];\n}\n\nexport interface DomActionScrollOptions {\n  readonly block?: DomActionScrollAlignment;\n  readonly inline?: DomActionScrollAlignment;\n}\n\nexport interface DomActionKeyPressInput {\n  readonly key: string;\n  readonly modifiers?: readonly KeyModifier[];\n}\n\nexport interface DomActionSettleOptions {\n  readonly operation: \"dom.click\" | \"dom.hover\" | \"dom.input\" | \"dom.scroll\";\n  readonly snapshot?: ActionBoundarySnapshot;\n  readonly signal: AbortSignal;\n  remainingMs(): number | undefined;\n  policySettle(\n    pageRef: PageRef,\n    trigger: ActionBoundarySettleTrigger,\n    boundary?: ActionBoundaryOutcome,\n  ): Promise<void>;\n}\n\nexport type DomPointerHitRelation =\n  | \"self\"\n  | \"descendant\"\n  | \"ancestor\"\n  | \"same-owner\"\n  | \"outside\"\n  | \"unknown\";\n\nexport interface DomPointerHitAssessment {\n  readonly relation: DomPointerHitRelation;\n  readonly blocking: boolean;\n  readonly ambiguous?: boolean;\n  readonly blockingDescription?: string;\n  readonly canonicalTarget?: NodeLocator;\n  readonly hitOwner?: NodeLocator;\n}\n\nexport interface BuildReplayPathOptions {\n  readonly enableTextMatch?: boolean;\n}\n\nexport interface DomActionBridge {\n  buildReplayPath(\n    locator: NodeLocator,\n    options?: BuildReplayPathOptions,\n  ): Promise<ReplayElementPath>;\n  inspectActionTarget(locator: NodeLocator): Promise<DomActionTargetInspection>;\n  canonicalizePointerTarget(locator: NodeLocator): Promise<NodeLocator>;\n  classifyPointerHit(input: {\n    readonly target: NodeLocator;\n    readonly hit: NodeLocator;\n    readonly point: Point;\n  }): Promise<DomPointerHitAssessment>;\n  scrollNodeIntoView(locator: NodeLocator, options?: DomActionScrollOptions): Promise<void>;\n  focusNode(locator: NodeLocator): Promise<void>;\n  pressKey(locator: NodeLocator, input: DomActionKeyPressInput): Promise<void>;\n  finalizeDomAction(\n    pageRef: PageRef,\n    options: DomActionSettleOptions,\n  ): Promise<ActionBoundaryOutcome>;\n}\n\nexport interface DomActionBridgeProvider {\n  [OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL](): DomActionBridge;\n}\n\ntype DomActionBridgeFactory = DomActionBridgeProvider[typeof OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL];\n\nfunction isDomActionBridgeFactory(value: unknown): value is DomActionBridgeFactory {\n  return typeof value === \"function\";\n}\n\nexport function resolveDomActionBridge(\n  engine: BrowserCoreEngine | DomActionBridgeProvider,\n): DomActionBridge | undefined {\n  const candidate = Reflect.get(engine, OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL);\n  return isDomActionBridgeFactory(candidate) ? candidate.call(engine) : undefined;\n}\n","export * from \"./json.js\";\nexport * from \"./validation.js\";\nexport * from \"./version.js\";\nexport * from \"./binary-location.js\";\nexport * from \"./identity.js\";\nexport * from \"./geometry.js\";\nexport * from \"./metadata.js\";\nexport * from \"./network.js\";\nexport * from \"./requests.js\";\nexport * from \"./storage.js\";\nexport * from \"./state.js\";\nexport * from \"./snapshots.js\";\nexport * from \"./capabilities.js\";\nexport * from \"./cloud.js\";\nexport * from \"./errors.js\";\nexport * from \"./events.js\";\nexport * from \"./artifacts.js\";\nexport * from \"./captcha.js\";\nexport * from \"./traces.js\";\nexport * from \"./observability.js\";\nexport * from \"./envelopes.js\";\nexport * from \"./session-info.js\";\nexport * from \"./local-view.js\";\nexport * from \"./automation.js\";\nexport * from \"./operations.js\";\nexport * from \"./rest.js\";\nexport * from \"./mcp.js\";\nexport * from \"./scripts.js\";\nexport * from \"./interaction.js\";\nexport * from \"./semantic.js\";\nexport * from \"./computer-use-bridge.js\";\nexport * from \"./dom-path-types.js\";\nexport * from \"./dom-action-bridge.js\";\n","import path from \"node:path\";\nimport { randomUUID } from \"node:crypto\";\n\nimport {\n  type OpensteerInteractionTracePayload,\n  type OpensteerRequestPlanFreshness,\n  type OpensteerRequestPlanPayload,\n} from \"@opensteer/protocol\";\n\nimport {\n  encodePathSegment,\n  ensureDirectory,\n  isAlreadyExistsError,\n  listJsonFiles,\n  normalizeNonEmptyString,\n  normalizeTimestamp,\n  pathExists,\n  readJsonFile,\n  sha256Hex,\n  withFilesystemLock,\n  writeJsonFileAtomic,\n  writeJsonFileExclusive,\n} from \"./internal/filesystem.js\";\nimport { canonicalJsonString, type JsonValue } from \"./json.js\";\n\nexport interface RegistryProvenance {\n  readonly source: string;\n  readonly sourceId?: string;\n  readonly capturedAt?: number;\n  readonly notes?: string;\n}\n\nexport interface RegistryRecord<TPayload = JsonValue> {\n  readonly id: string;\n  readonly key: string;\n  readonly version: string;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly contentHash: string;\n  readonly tags: readonly string[];\n  readonly provenance?: RegistryProvenance;\n  readonly payload: TPayload;\n}\n\nexport type DescriptorRecord = RegistryRecord;\nexport type InteractionTraceRecord = RegistryRecord<OpensteerInteractionTracePayload>;\n\nexport type RequestPlanFreshness = OpensteerRequestPlanFreshness;\n\nexport interface RequestPlanRecord extends RegistryRecord<OpensteerRequestPlanPayload> {\n  readonly freshness?: RequestPlanFreshness;\n}\n\nexport interface ResolveRegistryRecordInput {\n  readonly key: string;\n  readonly version?: string;\n}\n\nexport interface WriteDescriptorInput<TPayload = JsonValue> {\n  readonly id?: string;\n  readonly key: string;\n  readonly version: string;\n  readonly createdAt?: number;\n  readonly updatedAt?: number;\n  readonly tags?: readonly string[];\n  readonly provenance?: RegistryProvenance;\n  readonly payload: TPayload;\n}\n\nexport interface WriteRequestPlanInput extends WriteDescriptorInput<OpensteerRequestPlanPayload> {\n  readonly freshness?: RequestPlanFreshness;\n}\nexport interface WriteInteractionTraceInput extends WriteDescriptorInput<OpensteerInteractionTracePayload> {}\n\nexport interface ListRegistryRecordsInput {\n  readonly key?: string;\n}\n\nexport interface UpdateRequestPlanFreshnessInput {\n  readonly id: string;\n  readonly updatedAt?: number;\n  readonly freshness?: RequestPlanFreshness;\n}\n\nexport interface DescriptorRegistryStore {\n  readonly recordsDirectory: string;\n  readonly indexesDirectory: string;\n\n  write(input: WriteDescriptorInput): Promise<DescriptorRecord>;\n  getById(id: string): Promise<DescriptorRecord | undefined>;\n  list(input?: ListRegistryRecordsInput): Promise<readonly DescriptorRecord[]>;\n  resolve(input: ResolveRegistryRecordInput): Promise<DescriptorRecord | undefined>;\n}\n\nexport interface RequestPlanRegistryStore {\n  readonly recordsDirectory: string;\n  readonly indexesDirectory: string;\n\n  write(input: WriteRequestPlanInput): Promise<RequestPlanRecord>;\n  getById(id: string): Promise<RequestPlanRecord | undefined>;\n  list(input?: ListRegistryRecordsInput): Promise<readonly RequestPlanRecord[]>;\n  resolve(input: ResolveRegistryRecordInput): Promise<RequestPlanRecord | undefined>;\n  updateFreshness(input: UpdateRequestPlanFreshnessInput): Promise<RequestPlanRecord>;\n}\n\nexport interface InteractionTraceRegistryStore {\n  readonly recordsDirectory: string;\n  readonly indexesDirectory: string;\n\n  write(input: WriteInteractionTraceInput): Promise<InteractionTraceRecord>;\n  getById(id: string): Promise<InteractionTraceRecord | undefined>;\n  list(input?: ListRegistryRecordsInput): Promise<readonly InteractionTraceRecord[]>;\n  resolve(input: ResolveRegistryRecordInput): Promise<InteractionTraceRecord | undefined>;\n}\n\nfunction normalizeTags(tags: readonly string[] | undefined): readonly string[] {\n  if (tags === undefined) {\n    return [];\n  }\n\n  return Array.from(new Set(tags.map((tag) => normalizeNonEmptyString(\"tag\", tag)))).sort(\n    (left, right) => left.localeCompare(right),\n  );\n}\n\nfunction normalizeProvenance(\n  provenance: RegistryProvenance | undefined,\n): RegistryProvenance | undefined {\n  if (provenance === undefined) {\n    return undefined;\n  }\n\n  return {\n    source: normalizeNonEmptyString(\"provenance.source\", provenance.source),\n    ...(provenance.sourceId === undefined\n      ? {}\n      : { sourceId: normalizeNonEmptyString(\"provenance.sourceId\", provenance.sourceId) }),\n    ...(provenance.capturedAt === undefined\n      ? {}\n      : { capturedAt: normalizeTimestamp(\"provenance.capturedAt\", provenance.capturedAt) }),\n    ...(provenance.notes === undefined\n      ? {}\n      : { notes: normalizeNonEmptyString(\"provenance.notes\", provenance.notes) }),\n  };\n}\n\nfunction normalizeFreshness(\n  freshness: RequestPlanFreshness | undefined,\n): RequestPlanFreshness | undefined {\n  if (freshness === undefined) {\n    return undefined;\n  }\n\n  return {\n    ...(freshness.lastValidatedAt === undefined\n      ? {}\n      : {\n          lastValidatedAt: normalizeTimestamp(\n            \"freshness.lastValidatedAt\",\n            freshness.lastValidatedAt,\n          ),\n        }),\n    ...(freshness.staleAt === undefined\n      ? {}\n      : { staleAt: normalizeTimestamp(\"freshness.staleAt\", freshness.staleAt) }),\n    ...(freshness.expiresAt === undefined\n      ? {}\n      : { expiresAt: normalizeTimestamp(\"freshness.expiresAt\", freshness.expiresAt) }),\n  };\n}\n\nfunction compareByCreatedAtAndId(\n  left: Pick<RegistryRecord<unknown>, \"createdAt\" | \"id\">,\n  right: Pick<RegistryRecord<unknown>, \"createdAt\" | \"id\">,\n): number {\n  if (left.createdAt !== right.createdAt) {\n    return right.createdAt - left.createdAt;\n  }\n\n  return left.id.localeCompare(right.id);\n}\n\nabstract class FilesystemRegistryStore<TRecord extends RegistryRecord<unknown>> {\n  readonly recordsDirectory: string;\n  readonly indexesDirectory: string;\n\n  protected constructor(\n    rootPath: string,\n    private readonly registryRelativePath: readonly string[],\n  ) {\n    const basePath = path.join(rootPath, ...registryRelativePath);\n    this.recordsDirectory = path.join(basePath, \"records\");\n    this.indexesDirectory = path.join(basePath, \"indexes\", \"by-key\");\n  }\n\n  async initialize(): Promise<void> {\n    await ensureDirectory(this.recordsDirectory);\n    await ensureDirectory(this.indexesDirectory);\n  }\n\n  async getById(id: string): Promise<TRecord | undefined> {\n    const recordPath = this.recordPath(id);\n    if (!(await pathExists(recordPath))) {\n      return undefined;\n    }\n\n    return readJsonFile<TRecord>(recordPath);\n  }\n\n  async resolve(input: ResolveRegistryRecordInput): Promise<TRecord | undefined> {\n    const key = normalizeNonEmptyString(\"key\", input.key);\n    if (input.version !== undefined) {\n      return this.resolveIndexedRecord(key, normalizeNonEmptyString(\"version\", input.version));\n    }\n\n    const matches = (await this.readAllRecords()).filter((record) => record.key === key);\n    matches.sort(compareByCreatedAtAndId);\n    return matches[0];\n  }\n\n  protected async writeRecord(record: TRecord): Promise<TRecord> {\n    return withFilesystemLock(this.writeLockPath(), async () => {\n      if ((await this.getById(record.id)) !== undefined) {\n        throw new Error(`registry record ${record.id} already exists`);\n      }\n\n      const indexPath = this.indexPath(record.key, record.version);\n      if (await pathExists(indexPath)) {\n        const indexedRecord = await readJsonFile<{ readonly id: string }>(indexPath);\n        throw new Error(\n          `registry record ${record.key}@${record.version} already exists as ${indexedRecord.id}`,\n        );\n      }\n\n      const exactMatch = await this.findExactRecord(record.key, record.version);\n      if (exactMatch !== undefined) {\n        throw new Error(\n          `registry record ${record.key}@${record.version} already exists as ${exactMatch.id}`,\n        );\n      }\n\n      try {\n        await writeJsonFileExclusive(this.recordPath(record.id), record);\n      } catch (error) {\n        if (isAlreadyExistsError(error)) {\n          throw new Error(`registry record ${record.id} already exists`);\n        }\n\n        throw error;\n      }\n\n      try {\n        await writeJsonFileExclusive(indexPath, {\n          id: record.id,\n        });\n      } catch (error) {\n        if (isAlreadyExistsError(error)) {\n          throw new Error(`registry record ${record.key}@${record.version} already exists`);\n        }\n\n        throw error;\n      }\n\n      return record;\n    });\n  }\n\n  protected readAllRecords(): Promise<readonly TRecord[]> {\n    return this.readRecordsFromDirectory();\n  }\n\n  protected async readRecordsFromDirectory(): Promise<readonly TRecord[]> {\n    const files = await listJsonFiles(this.recordsDirectory);\n    const records = await Promise.all(\n      files.map((fileName) => readJsonFile<TRecord>(path.join(this.recordsDirectory, fileName))),\n    );\n    records.sort(compareByCreatedAtAndId);\n    return records;\n  }\n\n  private async findExactRecord(key: string, version: string): Promise<TRecord | undefined> {\n    const records = await this.readAllRecords();\n    return records.find((record) => record.key === key && record.version === version);\n  }\n\n  private async resolveIndexedRecord(key: string, version: string): Promise<TRecord | undefined> {\n    const indexPath = this.indexPath(key, version);\n    if (!(await pathExists(indexPath))) {\n      const exactMatches = (await this.readAllRecords()).filter(\n        (record) => record.key === key && record.version === version,\n      );\n      if (exactMatches.length <= 1) {\n        return exactMatches[0];\n      }\n\n      throw new Error(\n        `registry contains multiple records for ${key}@${version} without an index entry`,\n      );\n    }\n\n    const indexedRecord = await readJsonFile<{ readonly id: string }>(indexPath);\n    const record = await this.getById(indexedRecord.id);\n    if (record === undefined) {\n      throw new Error(\n        `registry index ${key}@${version} points to missing record ${indexedRecord.id}`,\n      );\n    }\n\n    return record;\n  }\n\n  protected recordPath(id: string): string {\n    return path.join(this.recordsDirectory, `${encodePathSegment(id)}.json`);\n  }\n\n  protected indexPath(key: string, version: string): string {\n    return path.join(\n      this.indexesDirectory,\n      encodePathSegment(key),\n      `${encodePathSegment(version)}.json`,\n    );\n  }\n\n  protected writeLockPath(): string {\n    return path.join(path.dirname(this.recordsDirectory), \".write.lock\");\n  }\n}\n\nexport class FilesystemDescriptorRegistry\n  extends FilesystemRegistryStore<DescriptorRecord>\n  implements DescriptorRegistryStore\n{\n  constructor(rootPath: string) {\n    super(rootPath, [\"registry\", \"descriptors\"]);\n  }\n\n  async write(input: WriteDescriptorInput): Promise<DescriptorRecord> {\n    const id = normalizeNonEmptyString(\"id\", input.id ?? `descriptor:${randomUUID()}`);\n    const key = normalizeNonEmptyString(\"key\", input.key);\n    const version = normalizeNonEmptyString(\"version\", input.version);\n    const createdAt = normalizeTimestamp(\"createdAt\", input.createdAt ?? Date.now());\n    const updatedAt = normalizeTimestamp(\"updatedAt\", input.updatedAt ?? createdAt);\n\n    if (updatedAt < createdAt) {\n      throw new RangeError(\"updatedAt must be greater than or equal to createdAt\");\n    }\n\n    const payload = input.payload;\n    const contentHash = sha256Hex(Buffer.from(canonicalJsonString(payload), \"utf8\"));\n    const provenance = normalizeProvenance(input.provenance);\n    const record: DescriptorRecord = {\n      id,\n      key,\n      version,\n      createdAt,\n      updatedAt,\n      contentHash,\n      tags: normalizeTags(input.tags),\n      ...(provenance === undefined ? {} : { provenance }),\n      payload,\n    };\n\n    return this.writeRecord(record);\n  }\n\n  async list(input: ListRegistryRecordsInput = {}): Promise<readonly DescriptorRecord[]> {\n    const key = input.key === undefined ? undefined : normalizeNonEmptyString(\"key\", input.key);\n    const records = await this.readAllRecords();\n    return key === undefined ? records : records.filter((record) => record.key === key);\n  }\n}\n\nexport class FilesystemRequestPlanRegistry\n  extends FilesystemRegistryStore<RequestPlanRecord>\n  implements RequestPlanRegistryStore\n{\n  constructor(rootPath: string) {\n    super(rootPath, [\"registry\", \"request-plans\"]);\n  }\n\n  async write(input: WriteRequestPlanInput): Promise<RequestPlanRecord> {\n    const id = normalizeNonEmptyString(\"id\", input.id ?? `request-plan:${randomUUID()}`);\n    const key = normalizeNonEmptyString(\"key\", input.key);\n    const version = normalizeNonEmptyString(\"version\", input.version);\n    const createdAt = normalizeTimestamp(\"createdAt\", input.createdAt ?? Date.now());\n    const updatedAt = normalizeTimestamp(\"updatedAt\", input.updatedAt ?? createdAt);\n\n    if (updatedAt < createdAt) {\n      throw new RangeError(\"updatedAt must be greater than or equal to createdAt\");\n    }\n\n    const payload = input.payload;\n    const contentHash = sha256Hex(Buffer.from(canonicalJsonString(payload), \"utf8\"));\n    const provenance = normalizeProvenance(input.provenance);\n    const freshness = normalizeFreshness(input.freshness);\n    const record: RequestPlanRecord = {\n      id,\n      key,\n      version,\n      createdAt,\n      updatedAt,\n      contentHash,\n      tags: normalizeTags(input.tags),\n      ...(provenance === undefined ? {} : { provenance }),\n      payload,\n      ...(freshness === undefined ? {} : { freshness }),\n    };\n\n    return this.writeRecord(record);\n  }\n\n  async list(input: ListRegistryRecordsInput = {}): Promise<readonly RequestPlanRecord[]> {\n    const key = input.key === undefined ? undefined : normalizeNonEmptyString(\"key\", input.key);\n    const records = await this.readAllRecords();\n    return key === undefined ? records : records.filter((record) => record.key === key);\n  }\n\n  async updateFreshness(input: UpdateRequestPlanFreshnessInput): Promise<RequestPlanRecord> {\n    const id = normalizeNonEmptyString(\"id\", input.id);\n\n    return withFilesystemLock(this.writeLockPath(), async () => {\n      const existing = await this.getById(id);\n      if (existing === undefined) {\n        throw new Error(`registry record ${id} was not found`);\n      }\n\n      const nextFreshness = normalizeFreshness(input.freshness ?? existing.freshness);\n      const nextUpdatedAt = normalizeTimestamp(\n        \"updatedAt\",\n        input.updatedAt ?? Math.max(Date.now(), existing.updatedAt),\n      );\n      if (nextUpdatedAt < existing.createdAt) {\n        throw new RangeError(\"updatedAt must be greater than or equal to createdAt\");\n      }\n\n      const nextRecord: RequestPlanRecord = {\n        ...existing,\n        updatedAt: nextUpdatedAt,\n        ...(nextFreshness === undefined ? {} : { freshness: nextFreshness }),\n      };\n\n      await writeJsonFileAtomic(this.recordPath(id), nextRecord);\n      return nextRecord;\n    });\n  }\n}\n\nexport class FilesystemInteractionTraceRegistry\n  extends FilesystemRegistryStore<InteractionTraceRecord>\n  implements InteractionTraceRegistryStore\n{\n  constructor(rootPath: string) {\n    super(rootPath, [\"registry\", \"interaction-traces\"]);\n  }\n\n  async write(input: WriteInteractionTraceInput): Promise<InteractionTraceRecord> {\n    const id = normalizeNonEmptyString(\"id\", input.id ?? `interaction-trace:${randomUUID()}`);\n    const key = normalizeNonEmptyString(\"key\", input.key);\n    const version = normalizeNonEmptyString(\"version\", input.version);\n    const createdAt = normalizeTimestamp(\"createdAt\", input.createdAt ?? Date.now());\n    const updatedAt = normalizeTimestamp(\"updatedAt\", input.updatedAt ?? createdAt);\n\n    if (updatedAt < createdAt) {\n      throw new RangeError(\"updatedAt must be greater than or equal to createdAt\");\n    }\n\n    const payload = input.payload;\n    const contentHash = sha256Hex(Buffer.from(canonicalJsonString(payload), \"utf8\"));\n    const provenance = normalizeProvenance(input.provenance);\n    const record: InteractionTraceRecord = {\n      id,\n      key,\n      version,\n      createdAt,\n      updatedAt,\n      contentHash,\n      tags: normalizeTags(input.tags),\n      ...(provenance === undefined ? {} : { provenance }),\n      payload,\n    };\n\n    return this.writeRecord(record);\n  }\n\n  async list(input: ListRegistryRecordsInput = {}): Promise<readonly InteractionTraceRecord[]> {\n    const key = input.key === undefined ? undefined : normalizeNonEmptyString(\"key\", input.key);\n    const records = await this.readAllRecords();\n    return key === undefined ? records : records.filter((record) => record.key === key);\n  }\n}\n\nexport function createDescriptorRegistry(rootPath: string): FilesystemDescriptorRegistry {\n  return new FilesystemDescriptorRegistry(rootPath);\n}\n\nexport function createRequestPlanRegistry(rootPath: string): FilesystemRequestPlanRegistry {\n  return new FilesystemRequestPlanRegistry(rootPath);\n}\n\nexport function createInteractionTraceRegistry(\n  rootPath: string,\n): FilesystemInteractionTraceRegistry {\n  return new FilesystemInteractionTraceRegistry(rootPath);\n}\n","import path from \"node:path\";\nimport type { DatabaseSync as NodeSqliteDatabaseSync } from \"node:sqlite\";\n\nimport type { NetworkQueryRecord, NetworkResourceType } from \"@opensteer/protocol\";\n\nimport { ensureDirectory } from \"../internal/filesystem.js\";\n\nconst TAG_DELIMITER = \"\\u001f\";\nconst NODE_SQLITE_SPECIFIER = `node:${\"sqlite\"}`;\nconst SAVED_NETWORK_SQLITE_SUPPORT_ERROR =\n  \"Saved-network operations require Node's built-in SQLite support. Use a Node runtime with node:sqlite enabled.\";\n\nexport interface SavedNetworkQueryInput {\n  readonly pageRef?: NetworkQueryRecord[\"record\"][\"pageRef\"];\n  readonly recordId?: string;\n  readonly requestId?: string;\n  readonly capture?: string;\n  readonly tag?: string;\n  readonly url?: string;\n  readonly hostname?: string;\n  readonly path?: string;\n  readonly method?: string;\n  readonly status?: string | number;\n  readonly resourceType?: NetworkResourceType;\n  readonly includeBodies?: boolean;\n  readonly limit?: number;\n}\n\nexport type SavedNetworkBodyWriteMode = \"authoritative\" | \"metadata-only\";\n\nexport interface SavedNetworkSaveOptions {\n  readonly bodyWriteMode: SavedNetworkBodyWriteMode;\n  readonly tag?: string;\n}\n\nexport interface SavedNetworkStore {\n  readonly databasePath: string;\n\n  initialize(): Promise<void>;\n  save(records: readonly NetworkQueryRecord[], options: SavedNetworkSaveOptions): Promise<number>;\n  tagByFilter(filter: SavedNetworkQueryInput, tag: string): Promise<number>;\n  query(input?: SavedNetworkQueryInput): Promise<readonly NetworkQueryRecord[]>;\n  getByRecordId(\n    recordId: string,\n    options?: { readonly includeBodies?: boolean },\n  ): Promise<NetworkQueryRecord | undefined>;\n  clear(input?: { readonly capture?: string; readonly tag?: string }): Promise<number>;\n}\n\nexport interface IterateSavedNetworkRecordBatchesOptions {\n  readonly batchSize?: number;\n  readonly includeBodies?: boolean;\n}\n\ntype SavedNetworkRow = {\n  readonly record_id: string;\n  readonly request_id: string;\n  readonly session_ref: string;\n  readonly page_ref: string | null;\n  readonly frame_ref: string | null;\n  readonly document_ref: string | null;\n  readonly capture: string | null;\n  readonly method: string;\n  readonly url: string;\n  readonly hostname: string;\n  readonly path: string;\n  readonly status: number | null;\n  readonly status_text: string | null;\n  readonly resource_type: string;\n  readonly navigation_request: number;\n  readonly request_headers_json: string;\n  readonly response_headers_json: string;\n  readonly request_body_json: string | null;\n  readonly response_body_json: string | null;\n  readonly initiator_json: string | null;\n  readonly timing_json: string | null;\n  readonly transfer_json: string | null;\n  readonly source_json: string | null;\n  readonly capture_state: string;\n  readonly request_body_state: string;\n  readonly response_body_state: string;\n  readonly request_body_skip_reason: string | null;\n  readonly response_body_skip_reason: string | null;\n  readonly request_body_error: string | null;\n  readonly response_body_error: string | null;\n  readonly redirect_from_request_id: string | null;\n  readonly redirect_to_request_id: string | null;\n  readonly saved_at: number;\n  readonly tags: string | null;\n};\n\nclass SqliteSavedNetworkStore implements SavedNetworkStore {\n  readonly databasePath: string;\n\n  private database: NodeSqliteDatabaseSync | undefined;\n  private directoryInitialization: Promise<void> | undefined;\n  private databaseInitialization: Promise<NodeSqliteDatabaseSync> | undefined;\n\n  constructor(rootPath: string) {\n    this.databasePath = path.join(rootPath, \"registry\", \"saved-network.sqlite\");\n  }\n\n  async initialize(): Promise<void> {\n    await this.ensureDatabaseDirectory();\n  }\n\n  async save(\n    records: readonly NetworkQueryRecord[],\n    options: SavedNetworkSaveOptions,\n  ): Promise<number> {\n    const database = await this.requireDatabase();\n    const upsertRecord = database.prepare(buildSavedNetworkUpsertSql(options.bodyWriteMode));\n    const insertTag = database.prepare(`\n      INSERT OR IGNORE INTO saved_network_tags (record_id, tag)\n      VALUES (@record_id, @tag)\n    `);\n\n    return withSqliteTransaction(database, () => {\n      let savedCount = 0;\n      for (const entry of records) {\n        const url = new URL(entry.record.url);\n        const pageRefKey = entry.record.pageRef ?? \"\";\n        upsertRecord.run({\n          record_id: entry.recordId,\n          request_id: entry.record.requestId,\n          session_ref: entry.record.sessionRef,\n          page_ref: entry.record.pageRef ?? null,\n          page_ref_key: pageRefKey,\n          frame_ref: entry.record.frameRef ?? null,\n          document_ref: entry.record.documentRef ?? null,\n          capture: entry.capture ?? null,\n          method: entry.record.method,\n          method_lc: entry.record.method.toLowerCase(),\n          url: entry.record.url,\n          url_lc: entry.record.url.toLowerCase(),\n          hostname: url.hostname,\n          hostname_lc: url.hostname.toLowerCase(),\n          path: url.pathname,\n          path_lc: url.pathname.toLowerCase(),\n          status: entry.record.status ?? null,\n          status_text: entry.record.statusText ?? null,\n          resource_type: entry.record.resourceType,\n          navigation_request: entry.record.navigationRequest ? 1 : 0,\n          request_headers_json: JSON.stringify(entry.record.requestHeaders),\n          response_headers_json: JSON.stringify(entry.record.responseHeaders),\n          request_body_json: stringifyOptional(entry.record.requestBody),\n          response_body_json: stringifyOptional(entry.record.responseBody),\n          initiator_json: stringifyOptional(entry.record.initiator),\n          timing_json: stringifyOptional(entry.record.timing),\n          transfer_json: stringifyOptional(entry.record.transfer),\n          source_json: stringifyOptional(entry.record.source),\n          capture_state: entry.record.captureState ?? \"complete\",\n          request_body_state:\n            entry.record.requestBodyState ??\n            (entry.record.requestBody === undefined ? \"skipped\" : \"complete\"),\n          response_body_state:\n            entry.record.responseBodyState ??\n            (entry.record.responseBody === undefined ? \"skipped\" : \"complete\"),\n          request_body_skip_reason: entry.record.requestBodySkipReason ?? null,\n          response_body_skip_reason: entry.record.responseBodySkipReason ?? null,\n          request_body_error: entry.record.requestBodyError ?? null,\n          response_body_error: entry.record.responseBodyError ?? null,\n          redirect_from_request_id: entry.record.redirectFromRequestId ?? null,\n          redirect_to_request_id: entry.record.redirectToRequestId ?? null,\n          saved_at: entry.savedAt ?? Date.now(),\n        });\n\n        const tags = new Set<string>(entry.tags ?? []);\n        if (options.tag !== undefined) {\n          tags.add(options.tag);\n        }\n        for (const currentTag of tags) {\n          const result = insertTag.run({\n            record_id: entry.recordId,\n            tag: currentTag,\n          }) as { readonly changes?: number };\n          savedCount += result.changes ?? 0;\n        }\n      }\n      return savedCount;\n    });\n  }\n\n  async tagByFilter(filter: SavedNetworkQueryInput, tag: string): Promise<number> {\n    const database = await this.requireDatabase();\n    const { whereSql, parameters } = buildSavedNetworkWhere(filter);\n    const selectRecords = database.prepare(\n      `\n        SELECT r.record_id\n        FROM saved_network_records r\n        ${whereSql}\n      `,\n    );\n    const insertTag = database.prepare(`\n      INSERT OR IGNORE INTO saved_network_tags (record_id, tag)\n      VALUES (@record_id, @tag)\n    `);\n\n    return withSqliteTransaction(database, () => {\n      let taggedCount = 0;\n      const rows = selectRecords.all(\n        ...(parameters as readonly (string | number | null | Uint8Array)[]),\n      );\n      for (const row of rows) {\n        const recordId = row.record_id;\n        if (typeof recordId !== \"string\") {\n          continue;\n        }\n        const result = insertTag.run({\n          record_id: recordId,\n          tag,\n        }) as { readonly changes?: number };\n        taggedCount += result.changes ?? 0;\n      }\n      return taggedCount;\n    });\n  }\n\n  async query(input: SavedNetworkQueryInput = {}): Promise<readonly NetworkQueryRecord[]> {\n    const database = await this.requireDatabase();\n    const limit = Math.max(1, Math.min(input.limit ?? 50, 1000));\n    const { whereSql, parameters } = buildSavedNetworkWhere(input);\n    const rows = database\n      .prepare(\n        `\n      SELECT\n        r.*,\n        GROUP_CONCAT(t.tag, '${TAG_DELIMITER}') AS tags\n      FROM saved_network_records r\n      LEFT JOIN saved_network_tags t\n        ON t.record_id = r.record_id\n      ${whereSql}\n      GROUP BY r.record_id\n      ORDER BY r.saved_at DESC, r.record_id ASC\n      LIMIT ?\n    `,\n      )\n      .all(\n        ...(parameters as readonly (string | number | null | Uint8Array)[]),\n        limit,\n      ) as SavedNetworkRow[];\n\n    return rows.map((row) => inflateSavedNetworkRow(row, input.includeBodies ?? false));\n  }\n\n  async getByRecordId(\n    recordId: string,\n    options: { readonly includeBodies?: boolean } = {},\n  ): Promise<NetworkQueryRecord | undefined> {\n    const [record] = await this.query({\n      recordId,\n      ...(options.includeBodies === undefined ? {} : { includeBodies: options.includeBodies }),\n      limit: 1,\n    });\n    return record;\n  }\n\n  async clear(input: { readonly capture?: string; readonly tag?: string } = {}): Promise<number> {\n    const database = await this.requireDatabase();\n    const countAll = database.prepare(`SELECT COUNT(*) AS cleared FROM saved_network_records`);\n    const deleteAllRecords = database.prepare(`DELETE FROM saved_network_records`);\n    const { whereSql, parameters } = buildSavedNetworkWhere(input);\n    const countFiltered = database.prepare(`\n      SELECT COUNT(*) AS cleared\n      FROM saved_network_records r\n      ${whereSql}\n    `);\n    const deleteFiltered = database.prepare(`\n      DELETE FROM saved_network_records\n      WHERE record_id IN (\n        SELECT r.record_id\n        FROM saved_network_records r\n        ${whereSql}\n      )\n    `);\n\n    return withSqliteTransaction(database, () => {\n      if (input.capture === undefined && input.tag === undefined) {\n        const cleared = (countAll.get() as { readonly cleared: number }).cleared;\n        deleteAllRecords.run();\n        return cleared;\n      }\n      const args = parameters as readonly (string | number | null | Uint8Array)[];\n      const cleared = (countFiltered.get(...args) as { readonly cleared: number }).cleared;\n      deleteFiltered.run(...args);\n      return cleared;\n    });\n  }\n\n  async *iterateBatches(\n    options: IterateSavedNetworkRecordBatchesOptions = {},\n  ): AsyncGenerator<readonly NetworkQueryRecord[]> {\n    const database = await this.requireDatabase();\n    const batchSize = Math.max(1, Math.min(options.batchSize ?? 500, 1000));\n    let cursor:\n      | {\n          readonly savedAt: number;\n          readonly recordId: string;\n        }\n      | undefined;\n\n    while (true) {\n      const rows = database\n        .prepare(\n          `\n      SELECT\n        r.*,\n        GROUP_CONCAT(t.tag, '${TAG_DELIMITER}') AS tags\n      FROM saved_network_records r\n      LEFT JOIN saved_network_tags t\n        ON t.record_id = r.record_id\n      ${cursor === undefined ? \"\" : \"WHERE r.saved_at > ? OR (r.saved_at = ? AND r.record_id > ?)\"}\n      GROUP BY r.record_id\n      ORDER BY r.saved_at ASC, r.record_id ASC\n      LIMIT ?\n    `,\n        )\n        .all(\n          ...(cursor === undefined ? [] : [cursor.savedAt, cursor.savedAt, cursor.recordId]),\n          batchSize,\n        ) as SavedNetworkRow[];\n\n      if (rows.length === 0) {\n        return;\n      }\n\n      yield rows.map((row) => inflateSavedNetworkRow(row, options.includeBodies ?? true));\n\n      const lastRow = rows.at(-1);\n      if (lastRow === undefined) {\n        return;\n      }\n      cursor = {\n        savedAt: lastRow.saved_at,\n        recordId: lastRow.record_id,\n      };\n    }\n  }\n\n  close(): void {\n    if (this.database !== undefined) {\n      closeSqliteDatabase(this.database);\n      this.database = undefined;\n      this.databaseInitialization = undefined;\n    }\n  }\n\n  private async requireDatabase(): Promise<NodeSqliteDatabaseSync> {\n    if (this.database) {\n      return this.database;\n    }\n    this.databaseInitialization ??= this.openDatabase();\n    try {\n      return await this.databaseInitialization;\n    } catch (error) {\n      this.databaseInitialization = undefined;\n      throw error;\n    }\n  }\n\n  private async openDatabase(): Promise<NodeSqliteDatabaseSync> {\n    await this.ensureDatabaseDirectory();\n\n    let DatabaseSync: typeof import(\"node:sqlite\").DatabaseSync;\n    try {\n      ({ DatabaseSync } = await import(NODE_SQLITE_SPECIFIER));\n    } catch (error) {\n      throw normalizeSqliteImportError(error);\n    }\n\n    const database = new DatabaseSync(this.databasePath);\n    try {\n      this.configureDatabase(database);\n      this.database = database;\n      return database;\n    } catch (error) {\n      closeSqliteDatabase(database);\n      throw error;\n    }\n  }\n\n  private async ensureDatabaseDirectory(): Promise<void> {\n    this.directoryInitialization ??= ensureDirectory(path.dirname(this.databasePath)).catch(\n      (error) => {\n        this.directoryInitialization = undefined;\n        throw error;\n      },\n    );\n    await this.directoryInitialization;\n  }\n\n  private configureDatabase(database: NodeSqliteDatabaseSync): void {\n    database.exec(\"PRAGMA journal_mode = WAL\");\n    database.exec(\"PRAGMA foreign_keys = ON\");\n    database.exec(`\n      CREATE TABLE IF NOT EXISTS saved_network_records (\n        record_id TEXT PRIMARY KEY,\n        request_id TEXT NOT NULL,\n        session_ref TEXT NOT NULL,\n        page_ref TEXT,\n        page_ref_key TEXT NOT NULL,\n        frame_ref TEXT,\n        document_ref TEXT,\n        capture TEXT,\n        method TEXT NOT NULL,\n        method_lc TEXT NOT NULL,\n        url TEXT NOT NULL,\n        url_lc TEXT NOT NULL,\n        hostname TEXT NOT NULL,\n        hostname_lc TEXT NOT NULL,\n        path TEXT NOT NULL,\n        path_lc TEXT NOT NULL,\n        status INTEGER,\n        status_text TEXT,\n        resource_type TEXT NOT NULL,\n        navigation_request INTEGER NOT NULL,\n        request_headers_json TEXT NOT NULL,\n        response_headers_json TEXT NOT NULL,\n        request_body_json TEXT,\n        response_body_json TEXT,\n        initiator_json TEXT,\n        timing_json TEXT,\n        transfer_json TEXT,\n        source_json TEXT,\n        capture_state TEXT NOT NULL,\n        request_body_state TEXT NOT NULL,\n        response_body_state TEXT NOT NULL,\n        request_body_skip_reason TEXT,\n        response_body_skip_reason TEXT,\n        request_body_error TEXT,\n        response_body_error TEXT,\n        redirect_from_request_id TEXT,\n        redirect_to_request_id TEXT,\n        saved_at INTEGER NOT NULL\n      );\n\n      CREATE TABLE IF NOT EXISTS saved_network_tags (\n        record_id TEXT NOT NULL REFERENCES saved_network_records(record_id) ON DELETE CASCADE,\n        tag TEXT NOT NULL,\n        PRIMARY KEY (record_id, tag)\n      );\n\n      CREATE INDEX IF NOT EXISTS saved_network_tags_tag\n        ON saved_network_tags (tag);\n    `);\n    database.exec(`DROP INDEX IF EXISTS saved_network_records_scope_request`);\n    database.exec(`\n      CREATE INDEX IF NOT EXISTS saved_network_records_scope_request\n        ON saved_network_records (session_ref, page_ref_key, request_id)\n    `);\n    database.exec(`\n      CREATE INDEX IF NOT EXISTS saved_network_records_saved_at\n        ON saved_network_records (saved_at DESC)\n    `);\n    database.exec(`\n      CREATE INDEX IF NOT EXISTS saved_network_records_capture\n        ON saved_network_records (capture)\n    `);\n    this.ensureColumn(\n      database,\n      \"saved_network_records\",\n      \"capture_state\",\n      \"TEXT NOT NULL DEFAULT 'complete'\",\n    );\n    this.ensureColumn(database, \"saved_network_records\", \"capture\", \"TEXT\");\n    this.ensureColumn(\n      database,\n      \"saved_network_records\",\n      \"request_body_state\",\n      \"TEXT NOT NULL DEFAULT 'skipped'\",\n    );\n    this.ensureColumn(\n      database,\n      \"saved_network_records\",\n      \"response_body_state\",\n      \"TEXT NOT NULL DEFAULT 'skipped'\",\n    );\n    this.ensureColumn(database, \"saved_network_records\", \"request_body_skip_reason\", \"TEXT\");\n    this.ensureColumn(database, \"saved_network_records\", \"response_body_skip_reason\", \"TEXT\");\n    this.ensureColumn(database, \"saved_network_records\", \"request_body_error\", \"TEXT\");\n    this.ensureColumn(database, \"saved_network_records\", \"response_body_error\", \"TEXT\");\n  }\n\n  private ensureColumn(\n    database: NodeSqliteDatabaseSync,\n    table: string,\n    column: string,\n    definition: string,\n  ): void {\n    const rows = database.prepare(`PRAGMA table_info(${table})`).all() as ReadonlyArray<{\n      readonly name?: string;\n    }>;\n    if (rows.some((row) => row.name === column)) {\n      return;\n    }\n    database.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);\n  }\n}\n\nfunction buildSavedNetworkWhere(input: SavedNetworkQueryInput): {\n  readonly whereSql: string;\n  readonly parameters: readonly unknown[];\n} {\n  const clauses: string[] = [];\n  const parameters: unknown[] = [];\n\n  if (input.pageRef !== undefined) {\n    clauses.push(\"r.page_ref_key = ?\");\n    parameters.push(input.pageRef);\n  }\n  if (input.recordId !== undefined) {\n    clauses.push(\"r.record_id = ?\");\n    parameters.push(input.recordId);\n  }\n  if (input.requestId !== undefined) {\n    clauses.push(\"r.request_id = ?\");\n    parameters.push(input.requestId);\n  }\n  if (input.capture !== undefined) {\n    clauses.push(\"r.capture = ?\");\n    parameters.push(input.capture);\n  }\n  if (input.tag !== undefined) {\n    clauses.push(`\n      EXISTS (\n        SELECT 1\n        FROM saved_network_tags exact_tag\n        WHERE exact_tag.record_id = r.record_id\n          AND exact_tag.tag = ?\n      )\n    `);\n    parameters.push(input.tag);\n  }\n  if (input.url !== undefined) {\n    clauses.push(\"instr(r.url_lc, ?) > 0\");\n    parameters.push(input.url.toLowerCase());\n  }\n  if (input.hostname !== undefined) {\n    clauses.push(\"instr(r.hostname_lc, ?) > 0\");\n    parameters.push(input.hostname.toLowerCase());\n  }\n  if (input.path !== undefined) {\n    clauses.push(\"instr(r.path_lc, ?) > 0\");\n    parameters.push(input.path.toLowerCase());\n  }\n  if (input.method !== undefined) {\n    clauses.push(\"instr(r.method_lc, ?) > 0\");\n    parameters.push(input.method.toLowerCase());\n  }\n  if (input.status !== undefined) {\n    clauses.push(\"instr(lower(COALESCE(CAST(r.status AS TEXT), '')), ?) > 0\");\n    parameters.push(String(input.status).toLowerCase());\n  }\n  if (input.resourceType !== undefined) {\n    clauses.push(\"r.resource_type = ?\");\n    parameters.push(input.resourceType);\n  }\n\n  return {\n    whereSql: clauses.length === 0 ? \"\" : `WHERE ${clauses.join(\" AND \")}`,\n    parameters,\n  };\n}\n\nfunction buildSavedNetworkUpsertSql(bodyWriteMode: SavedNetworkBodyWriteMode): string {\n  const bodyUpdateSql =\n    bodyWriteMode === \"authoritative\"\n      ? `\n        request_body_json = excluded.request_body_json,\n        response_body_json = excluded.response_body_json,\n        request_body_state = excluded.request_body_state,\n        response_body_state = excluded.response_body_state,\n        request_body_skip_reason = excluded.request_body_skip_reason,\n        response_body_skip_reason = excluded.response_body_skip_reason,\n        request_body_error = excluded.request_body_error,\n        response_body_error = excluded.response_body_error,\n`\n      : \"\";\n\n  return `\n      INSERT INTO saved_network_records (\n        record_id,\n        request_id,\n        session_ref,\n        page_ref,\n        page_ref_key,\n        frame_ref,\n        document_ref,\n        capture,\n        method,\n        method_lc,\n        url,\n        url_lc,\n        hostname,\n        hostname_lc,\n        path,\n        path_lc,\n        status,\n        status_text,\n        resource_type,\n        navigation_request,\n        request_headers_json,\n        response_headers_json,\n        request_body_json,\n        response_body_json,\n        initiator_json,\n        timing_json,\n        transfer_json,\n        source_json,\n        capture_state,\n        request_body_state,\n        response_body_state,\n        request_body_skip_reason,\n        response_body_skip_reason,\n        request_body_error,\n        response_body_error,\n        redirect_from_request_id,\n        redirect_to_request_id,\n        saved_at\n      ) VALUES (\n        @record_id,\n        @request_id,\n        @session_ref,\n        @page_ref,\n        @page_ref_key,\n        @frame_ref,\n        @document_ref,\n        @capture,\n        @method,\n        @method_lc,\n        @url,\n        @url_lc,\n        @hostname,\n        @hostname_lc,\n        @path,\n        @path_lc,\n        @status,\n        @status_text,\n        @resource_type,\n        @navigation_request,\n        @request_headers_json,\n        @response_headers_json,\n        @request_body_json,\n        @response_body_json,\n        @initiator_json,\n        @timing_json,\n        @transfer_json,\n        @source_json,\n        @capture_state,\n        @request_body_state,\n        @response_body_state,\n        @request_body_skip_reason,\n        @response_body_skip_reason,\n        @request_body_error,\n        @response_body_error,\n        @redirect_from_request_id,\n        @redirect_to_request_id,\n        @saved_at\n      )\n      ON CONFLICT(record_id) DO UPDATE SET\n        page_ref = excluded.page_ref,\n        page_ref_key = excluded.page_ref_key,\n        frame_ref = excluded.frame_ref,\n        document_ref = excluded.document_ref,\n        capture = excluded.capture,\n        method = excluded.method,\n        method_lc = excluded.method_lc,\n        url = excluded.url,\n        url_lc = excluded.url_lc,\n        hostname = excluded.hostname,\n        hostname_lc = excluded.hostname_lc,\n        path = excluded.path,\n        path_lc = excluded.path_lc,\n        status = excluded.status,\n        status_text = excluded.status_text,\n        resource_type = excluded.resource_type,\n        navigation_request = excluded.navigation_request,\n        request_headers_json = excluded.request_headers_json,\n        response_headers_json = excluded.response_headers_json,\n${bodyUpdateSql}        initiator_json = excluded.initiator_json,\n        timing_json = excluded.timing_json,\n        transfer_json = excluded.transfer_json,\n        source_json = excluded.source_json,\n        capture_state = excluded.capture_state,\n        redirect_from_request_id = excluded.redirect_from_request_id,\n        redirect_to_request_id = excluded.redirect_to_request_id,\n        saved_at = MIN(saved_network_records.saved_at, excluded.saved_at)\n    `;\n}\n\nfunction inflateSavedNetworkRow(row: SavedNetworkRow, includeBodies: boolean): NetworkQueryRecord {\n  const requestBody =\n    includeBodies && row.request_body_json !== null ? JSON.parse(row.request_body_json) : undefined;\n  const responseBody =\n    includeBodies && row.response_body_json !== null\n      ? JSON.parse(row.response_body_json)\n      : undefined;\n\n  const record = {\n    kind: \"http\",\n    requestId: row.request_id as NetworkQueryRecord[\"record\"][\"requestId\"],\n    sessionRef: row.session_ref as NetworkQueryRecord[\"record\"][\"sessionRef\"],\n    method: row.method,\n    url: row.url,\n    requestHeaders: JSON.parse(row.request_headers_json),\n    responseHeaders: JSON.parse(row.response_headers_json),\n    resourceType: row.resource_type as NetworkResourceType,\n    navigationRequest: row.navigation_request === 1,\n    captureState: row.capture_state as NetworkQueryRecord[\"record\"][\"captureState\"],\n    requestBodyState: row.request_body_state as NetworkQueryRecord[\"record\"][\"requestBodyState\"],\n    responseBodyState: row.response_body_state as NetworkQueryRecord[\"record\"][\"responseBodyState\"],\n  } as Mutable<NetworkQueryRecord[\"record\"]>;\n  if (row.page_ref !== null) {\n    record.pageRef = row.page_ref as NonNullable<NetworkQueryRecord[\"record\"][\"pageRef\"]>;\n  }\n  if (row.frame_ref !== null) {\n    record.frameRef = row.frame_ref as NonNullable<NetworkQueryRecord[\"record\"][\"frameRef\"]>;\n  }\n  if (row.document_ref !== null) {\n    record.documentRef = row.document_ref as NonNullable<\n      NetworkQueryRecord[\"record\"][\"documentRef\"]\n    >;\n  }\n  if (row.status !== null) {\n    record.status = row.status;\n  }\n  if (row.status_text !== null) {\n    record.statusText = row.status_text;\n  }\n  if (row.redirect_from_request_id !== null) {\n    record.redirectFromRequestId =\n      row.redirect_from_request_id as NetworkQueryRecord[\"record\"][\"requestId\"];\n  }\n  if (row.redirect_to_request_id !== null) {\n    record.redirectToRequestId =\n      row.redirect_to_request_id as NetworkQueryRecord[\"record\"][\"requestId\"];\n  }\n  if (row.initiator_json !== null) {\n    record.initiator = JSON.parse(row.initiator_json);\n  }\n  if (row.timing_json !== null) {\n    record.timing = JSON.parse(row.timing_json);\n  }\n  if (row.transfer_json !== null) {\n    record.transfer = JSON.parse(row.transfer_json);\n  }\n  if (row.source_json !== null) {\n    record.source = JSON.parse(row.source_json);\n  }\n  if (row.request_body_skip_reason !== null) {\n    record.requestBodySkipReason = row.request_body_skip_reason;\n  }\n  if (row.response_body_skip_reason !== null) {\n    record.responseBodySkipReason = row.response_body_skip_reason;\n  }\n  if (row.request_body_error !== null) {\n    record.requestBodyError = row.request_body_error;\n  }\n  if (row.response_body_error !== null) {\n    record.responseBodyError = row.response_body_error;\n  }\n  if (requestBody !== undefined) {\n    record.requestBody = requestBody;\n  }\n  if (responseBody !== undefined) {\n    record.responseBody = responseBody;\n  }\n\n  return {\n    recordId: row.record_id,\n    ...(row.capture === null ? {} : { capture: row.capture }),\n    ...(row.tags === null || row.tags.length === 0\n      ? {}\n      : { tags: row.tags.split(TAG_DELIMITER).filter((tag) => tag.length > 0) }),\n    savedAt: row.saved_at,\n    record: record as NetworkQueryRecord[\"record\"],\n  };\n}\n\nfunction stringifyOptional(value: unknown): string | null {\n  return value === undefined ? null : JSON.stringify(value);\n}\n\nfunction normalizeSqliteImportError(error: unknown): Error {\n  if (\n    error instanceof Error &&\n    (error as NodeJS.ErrnoException).code === \"ERR_UNKNOWN_BUILTIN_MODULE\" &&\n    error.message.includes(NODE_SQLITE_SPECIFIER)\n  ) {\n    return new Error(SAVED_NETWORK_SQLITE_SUPPORT_ERROR, {\n      cause: error,\n    });\n  }\n\n  return error instanceof Error ? error : new Error(String(error));\n}\n\nfunction closeSqliteDatabase(database: NodeSqliteDatabaseSync): void {\n  try {\n    database.close();\n  } catch {}\n}\n\ntype Mutable<T> = {\n  -readonly [K in keyof T]: T[K];\n};\n\nfunction withSqliteTransaction<T>(database: NodeSqliteDatabaseSync, task: () => T): T {\n  database.exec(\"BEGIN IMMEDIATE\");\n  try {\n    const result = task();\n    database.exec(\"COMMIT\");\n    return result;\n  } catch (error) {\n    database.exec(\"ROLLBACK\");\n    throw error;\n  }\n}\n\nexport function createSavedNetworkStore(rootPath: string): SavedNetworkStore {\n  return new SqliteSavedNetworkStore(rootPath);\n}\n\nexport async function* iterateSavedNetworkRecordBatches(\n  rootPath: string,\n  options: IterateSavedNetworkRecordBatchesOptions = {},\n): AsyncGenerator<readonly NetworkQueryRecord[]> {\n  const store = new SqliteSavedNetworkStore(rootPath);\n  try {\n    yield* store.iterateBatches(options);\n  } finally {\n    store.close();\n  }\n}\n","import type {\n  ObservationContext,\n  ObservationEventError,\n  ObservabilityConfig,\n  ObservabilityTraceContext,\n} from \"@opensteer/protocol\";\n\nimport type { JsonValue } from \"./json.js\";\nimport { toCanonicalJsonValue } from \"./json.js\";\n\nconst REDACTED = \"[REDACTED]\";\n\nconst SENSITIVE_KEY_PATTERN =\n  /(authorization|proxy[_-]?authorization|cookie|set-cookie|api[_-]?key|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|secret|password|passwd|private[_-]?key|database[_-]?url|db[_-]?url|session(?:id)?|csrf(?:token)?)/i;\n\nconst SENSITIVE_VALUE_PATTERNS = [\n  /\\bsk-[A-Za-z0-9_-]{20,}\\b/g,\n  /\\bAIza[0-9A-Za-z_-]{20,}\\b/g,\n  /\\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\\b/g,\n  /\\beyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\b/g,\n  /\\bBearer\\s+[A-Za-z0-9._~+/=-]{16,}\\b/gi,\n];\n\ninterface RedactionState {\n  readonly sensitiveKeys: ReadonlySet<string>;\n  readonly sensitiveValues: readonly string[];\n}\n\nexport interface ObservationRedactor {\n  redactText(value: string): string;\n  redactJson(value: JsonValue | undefined): JsonValue | undefined;\n  redactError(error: ObservationEventError | undefined): ObservationEventError | undefined;\n  redactLabels(\n    labels: Readonly<Record<string, string>> | undefined,\n  ): Record<string, string> | undefined;\n  redactTraceContext(\n    traceContext: ObservabilityTraceContext | undefined,\n  ): ObservabilityTraceContext | undefined;\n}\n\nexport function normalizeObservationContext(\n  context: ObservationContext | undefined,\n): ObservationContext | undefined {\n  if (context === undefined) {\n    return undefined;\n  }\n\n  const normalized = {\n    ...(context.sessionRef === undefined ? {} : { sessionRef: context.sessionRef }),\n    ...(context.pageRef === undefined ? {} : { pageRef: context.pageRef }),\n    ...(context.frameRef === undefined ? {} : { frameRef: context.frameRef }),\n    ...(context.documentRef === undefined ? {} : { documentRef: context.documentRef }),\n    ...(context.documentEpoch === undefined ? {} : { documentEpoch: context.documentEpoch }),\n  } satisfies ObservationContext;\n\n  return Object.keys(normalized).length === 0 ? undefined : normalized;\n}\n\nexport function createObservationRedactor(\n  config: Partial<ObservabilityConfig> | undefined,\n): ObservationRedactor {\n  const state = createRedactionState(config);\n\n  return {\n    redactText(value) {\n      return redactString(value, state);\n    },\n    redactJson(value) {\n      return value === undefined\n        ? undefined\n        : (redactUnknown(value, state, new WeakSet()) as JsonValue);\n    },\n    redactError(error) {\n      if (error === undefined) {\n        return undefined;\n      }\n      return {\n        ...(error.code === undefined ? {} : { code: redactString(error.code, state) }),\n        message: redactString(error.message, state),\n        ...(error.retriable === undefined ? {} : { retriable: error.retriable }),\n        ...(error.details === undefined\n          ? {}\n          : { details: toCanonicalJsonValue(redactUnknown(error.details, state, new WeakSet())) }),\n      };\n    },\n    redactLabels(labels) {\n      if (labels === undefined) {\n        return undefined;\n      }\n\n      const next = Object.entries(labels).reduce<Record<string, string>>(\n        (accumulator, [key, value]) => {\n          accumulator[key] = isSensitiveKey(key, state) ? REDACTED : redactString(value, state);\n          return accumulator;\n        },\n        {},\n      );\n\n      return Object.keys(next).length === 0 ? undefined : next;\n    },\n    redactTraceContext(traceContext) {\n      if (traceContext === undefined) {\n        return undefined;\n      }\n\n      const next = {\n        ...(traceContext.traceparent === undefined\n          ? {}\n          : { traceparent: redactString(traceContext.traceparent, state) }),\n        ...(traceContext.baggage === undefined\n          ? {}\n          : { baggage: redactString(traceContext.baggage, state) }),\n      };\n      return Object.keys(next).length === 0 ? undefined : next;\n    },\n  };\n}\n\nfunction createRedactionState(config: Partial<ObservabilityConfig> | undefined): RedactionState {\n  return {\n    sensitiveKeys: new Set(\n      (config?.redaction?.sensitiveKeys ?? [])\n        .map((value) => value.trim().toLowerCase())\n        .filter((value) => value.length > 0),\n    ),\n    sensitiveValues: [\n      ...new Set(\n        (config?.redaction?.sensitiveValues ?? [])\n          .map((value) => value.trim())\n          .filter((value) => value.length > 0),\n      ),\n    ],\n  };\n}\n\nfunction redactUnknown(value: unknown, state: RedactionState, seen: WeakSet<object>): unknown {\n  if (value === null || value === undefined) {\n    return value;\n  }\n\n  if (typeof value === \"string\") {\n    return redactString(value, state);\n  }\n\n  if (typeof value !== \"object\") {\n    return value;\n  }\n\n  if (seen.has(value)) {\n    return REDACTED;\n  }\n  seen.add(value);\n\n  if (Array.isArray(value)) {\n    return value.map((entry) => redactUnknown(entry, state, seen));\n  }\n\n  const next: Record<string, unknown> = {};\n  for (const [key, nestedValue] of Object.entries(value)) {\n    next[key] = isSensitiveKey(key, state) ? REDACTED : redactUnknown(nestedValue, state, seen);\n  }\n  return next;\n}\n\nfunction redactString(value: string, state: RedactionState): string {\n  let next = value;\n\n  for (const secret of state.sensitiveValues) {\n    next = next.split(secret).join(REDACTED);\n  }\n\n  for (const pattern of SENSITIVE_VALUE_PATTERNS) {\n    next = next.replace(pattern, REDACTED);\n  }\n\n  return redactUrlString(next, state);\n}\n\nfunction redactUrlString(value: string, state: RedactionState): string {\n  let parsed: URL;\n  try {\n    parsed = new URL(value);\n  } catch {\n    return value;\n  }\n\n  let changed = false;\n  if (parsed.username) {\n    parsed.username = REDACTED;\n    changed = true;\n  }\n  if (parsed.password) {\n    parsed.password = REDACTED;\n    changed = true;\n  }\n\n  for (const [key] of parsed.searchParams) {\n    if (!isSensitiveKey(key, state)) {\n      continue;\n    }\n    parsed.searchParams.set(key, REDACTED);\n    changed = true;\n  }\n\n  return changed ? parsed.toString() : value;\n}\n\nfunction isSensitiveKey(key: string, state: RedactionState): boolean {\n  return state.sensitiveKeys.has(key.trim().toLowerCase()) || SENSITIVE_KEY_PATTERN.test(key);\n}\n","import path from \"node:path\";\nimport { randomUUID } from \"node:crypto\";\n\nimport type {\n  AppendObservationEventInput,\n  ConfigureObservationSessionInput,\n  ObservationArtifact,\n  ObservationEvent,\n  ObservationSession,\n  ObservationSink,\n  ObservabilityConfig,\n  ObservabilityProfile,\n  OpenObservationSessionInput,\n  SessionObservationSink,\n  WriteObservationArtifactInput,\n} from \"@opensteer/protocol\";\n\nimport type { ArtifactManifest, OpensteerArtifactStore } from \"./artifacts.js\";\nimport { manifestToExternalBinaryLocation } from \"./artifacts.js\";\nimport {\n  encodePathSegment,\n  ensureDirectory,\n  listJsonFiles,\n  normalizeNonEmptyString,\n  normalizeTimestamp,\n  pathExists,\n  readJsonFile,\n  writeJsonFileAtomic,\n  writeJsonFileExclusive,\n  withFilesystemLock,\n} from \"./internal/filesystem.js\";\nimport type { JsonValue } from \"./json.js\";\nimport { toCanonicalJsonValue } from \"./json.js\";\nimport {\n  createObservationRedactor,\n  normalizeObservationContext,\n  type ObservationRedactor,\n} from \"./observation-utils.js\";\n\nexport interface ListObservationEventsInput {\n  readonly kind?: ObservationEvent[\"kind\"];\n  readonly phase?: ObservationEvent[\"phase\"];\n  readonly correlationId?: string;\n  readonly pageRef?: string;\n  readonly afterSequence?: number;\n  readonly from?: number;\n  readonly to?: number;\n  readonly limit?: number;\n}\n\nexport interface ListObservationArtifactsInput {\n  readonly kind?: ObservationArtifact[\"kind\"];\n  readonly pageRef?: string;\n  readonly limit?: number;\n}\n\nexport interface FilesystemObservationStore extends ObservationSink {\n  readonly sessionsDirectory: string;\n\n  initialize(): Promise<void>;\n  getSession(sessionId: string): Promise<ObservationSession | undefined>;\n  listEvents(\n    sessionId: string,\n    input?: ListObservationEventsInput,\n  ): Promise<readonly ObservationEvent[]>;\n  listArtifacts(\n    sessionId: string,\n    input?: ListObservationArtifactsInput,\n  ): Promise<readonly ObservationArtifact[]>;\n  getArtifact(sessionId: string, artifactId: string): Promise<ObservationArtifact | undefined>;\n}\n\ninterface NormalizedObservabilityConfig extends ObservabilityConfig {\n  readonly profile: ObservabilityProfile;\n}\n\nexport function normalizeObservabilityConfig(\n  input: Partial<ObservabilityConfig> | undefined,\n): NormalizedObservabilityConfig {\n  const profile = input?.profile ?? \"diagnostic\";\n  const labels =\n    input?.labels === undefined\n      ? undefined\n      : Object.entries(input.labels).reduce<Record<string, string>>((accumulator, [key, value]) => {\n          const normalizedKey = key.trim();\n          const normalizedValue = value.trim();\n          if (normalizedKey.length === 0 || normalizedValue.length === 0) {\n            return accumulator;\n          }\n          if (Object.keys(accumulator).length >= 20) {\n            return accumulator;\n          }\n          accumulator[normalizedKey] = normalizedValue;\n          return accumulator;\n        }, {});\n  const redaction =\n    input?.redaction === undefined\n      ? undefined\n      : {\n          ...(input.redaction.sensitiveKeys === undefined\n            ? {}\n            : {\n                sensitiveKeys: input.redaction.sensitiveKeys\n                  .map((value) => value.trim())\n                  .filter((value) => value.length > 0),\n              }),\n          ...(input.redaction.sensitiveValues === undefined\n            ? {}\n            : {\n                sensitiveValues: input.redaction.sensitiveValues\n                  .map((value) => value.trim())\n                  .filter((value) => value.length > 0),\n              }),\n        };\n\n  return {\n    profile,\n    ...(labels === undefined || Object.keys(labels).length === 0 ? {} : { labels }),\n    ...(input?.traceContext === undefined\n      ? {}\n      : {\n          traceContext: {\n            ...(input.traceContext.traceparent === undefined\n              ? {}\n              : { traceparent: input.traceContext.traceparent.trim() }),\n            ...(input.traceContext.baggage === undefined\n              ? {}\n              : { baggage: input.traceContext.baggage.trim() }),\n          },\n        }),\n    ...(redaction === undefined ? {} : { redaction }),\n  };\n}\n\nfunction eventFileName(sequence: number): string {\n  return `${String(sequence).padStart(12, \"0\")}.json`;\n}\n\nclass FilesystemSessionSink implements SessionObservationSink {\n  constructor(\n    private readonly store: FilesystemObservationStoreImpl,\n    readonly sessionId: string,\n  ) {}\n\n  configure(input: ConfigureObservationSessionInput): Promise<void> {\n    return this.store.configureSession(this.sessionId, input);\n  }\n\n  append(input: AppendObservationEventInput): Promise<ObservationEvent> {\n    return this.store.appendEvent(this.sessionId, input);\n  }\n\n  appendBatch(input: readonly AppendObservationEventInput[]): Promise<readonly ObservationEvent[]> {\n    return this.store.appendEvents(this.sessionId, input);\n  }\n\n  writeArtifact(input: WriteObservationArtifactInput): Promise<ObservationArtifact> {\n    return this.store.writeArtifact(this.sessionId, input);\n  }\n\n  async flush(): Promise<void> {}\n\n  close(reason?: string): Promise<void> {\n    return this.store.closeSession(this.sessionId, reason);\n  }\n}\n\nclass FilesystemObservationStoreImpl implements FilesystemObservationStore {\n  readonly sessionsDirectory: string;\n  private readonly redactors = new Map<string, ObservationRedactor>();\n\n  constructor(\n    private readonly rootPath: string,\n    private readonly artifacts: OpensteerArtifactStore,\n  ) {\n    this.sessionsDirectory = path.join(this.rootPath, \"observations\", \"sessions\");\n  }\n\n  async initialize(): Promise<void> {\n    await ensureDirectory(this.sessionsDirectory);\n  }\n\n  async openSession(input: OpenObservationSessionInput): Promise<SessionObservationSink> {\n    const sessionId = normalizeNonEmptyString(\"sessionId\", input.sessionId);\n    const openedAt = normalizeTimestamp(\"openedAt\", input.openedAt ?? Date.now());\n    const config = normalizeObservabilityConfig(input.config);\n    await this.applySessionConfiguration(sessionId, config, openedAt);\n\n    return new FilesystemSessionSink(this, sessionId);\n  }\n\n  async configureSession(\n    sessionId: string,\n    input: ConfigureObservationSessionInput,\n  ): Promise<void> {\n    const updatedAt = normalizeTimestamp(\"updatedAt\", input.updatedAt ?? Date.now());\n    const config = normalizeObservabilityConfig(input.config);\n    await this.applySessionConfiguration(sessionId, config, updatedAt);\n  }\n\n  async getSession(sessionId: string): Promise<ObservationSession | undefined> {\n    const manifestPath = this.sessionManifestPath(sessionId);\n    if (!(await pathExists(manifestPath))) {\n      return undefined;\n    }\n\n    return readJsonFile<ObservationSession>(manifestPath);\n  }\n\n  async appendEvent(\n    sessionId: string,\n    input: AppendObservationEventInput,\n  ): Promise<ObservationEvent> {\n    const [event] = await this.appendEvents(sessionId, [input]);\n    if (event === undefined) {\n      throw new Error(`failed to append observation event for session ${sessionId}`);\n    }\n    return event;\n  }\n\n  async appendEvents(\n    sessionId: string,\n    input: readonly AppendObservationEventInput[],\n  ): Promise<readonly ObservationEvent[]> {\n    if (input.length === 0) {\n      return [];\n    }\n\n    return withFilesystemLock(this.sessionLockPath(sessionId), async () => {\n      const session = await this.reconcileSessionManifest(sessionId);\n      if (session === undefined) {\n        throw new Error(`observation session ${sessionId} was not found`);\n      }\n      const redactor = this.redactors.get(sessionId) ?? createObservationRedactor(undefined);\n\n      const events: ObservationEvent[] = [];\n      let sequence = session.currentSequence;\n      let updatedAt = session.updatedAt;\n\n      for (const raw of input) {\n        sequence += 1;\n        const createdAt = normalizeTimestamp(\"createdAt\", raw.createdAt);\n        const context = normalizeObservationContext(raw.context);\n        const redactedData =\n          raw.data === undefined ? undefined : redactor.redactJson(toCanonicalJsonValue(raw.data));\n        const redactedError = redactor.redactError(raw.error);\n        const event: ObservationEvent = {\n          eventId: normalizeNonEmptyString(\n            \"eventId\",\n            raw.eventId ?? `observation:${sessionId}:${String(sequence).padStart(12, \"0\")}`,\n          ),\n          sessionId,\n          sequence,\n          kind: raw.kind,\n          phase: raw.phase,\n          createdAt,\n          correlationId: normalizeNonEmptyString(\"correlationId\", raw.correlationId),\n          ...(raw.spanId === undefined\n            ? {}\n            : { spanId: normalizeNonEmptyString(\"spanId\", raw.spanId) }),\n          ...(raw.parentSpanId === undefined\n            ? {}\n            : { parentSpanId: normalizeNonEmptyString(\"parentSpanId\", raw.parentSpanId) }),\n          ...(context === undefined ? {} : { context }),\n          ...(redactedData === undefined ? {} : { data: redactedData }),\n          ...(redactedError === undefined ? {} : { error: redactedError }),\n          ...(raw.artifactIds === undefined || raw.artifactIds.length === 0\n            ? {}\n            : { artifactIds: [...raw.artifactIds] }),\n        };\n\n        await writeJsonFileExclusive(\n          path.join(this.sessionEventsDirectory(sessionId), eventFileName(sequence)),\n          event,\n        );\n        updatedAt = Math.max(updatedAt, createdAt);\n        events.push(event);\n      }\n\n      await writeJsonFileAtomic(this.sessionManifestPath(sessionId), {\n        ...session,\n        currentSequence: sequence,\n        eventCount: session.eventCount + events.length,\n        updatedAt,\n      } satisfies ObservationSession);\n\n      return events;\n    });\n  }\n\n  async writeArtifact(\n    sessionId: string,\n    input: WriteObservationArtifactInput,\n  ): Promise<ObservationArtifact> {\n    return withFilesystemLock(this.sessionLockPath(sessionId), async () => {\n      const session = await this.reconcileSessionManifest(sessionId);\n      if (session === undefined) {\n        throw new Error(`observation session ${sessionId} was not found`);\n      }\n      const redactor = this.redactors.get(sessionId) ?? createObservationRedactor(undefined);\n\n      const createdAt = normalizeTimestamp(\"createdAt\", input.createdAt);\n      const context = normalizeObservationContext(input.context);\n      const redactedStorageKey =\n        input.storageKey === undefined ? undefined : redactor.redactText(input.storageKey);\n      const redactedMetadata =\n        input.metadata === undefined\n          ? undefined\n          : redactor.redactJson(toCanonicalJsonValue(input.metadata));\n      const artifact: ObservationArtifact = {\n        artifactId: normalizeNonEmptyString(\"artifactId\", input.artifactId),\n        sessionId,\n        kind: input.kind,\n        createdAt,\n        ...(context === undefined ? {} : { context }),\n        ...(input.mediaType === undefined ? {} : { mediaType: input.mediaType }),\n        ...(input.byteLength === undefined ? {} : { byteLength: input.byteLength }),\n        ...(input.sha256 === undefined ? {} : { sha256: input.sha256 }),\n        ...(input.opensteerArtifactId === undefined\n          ? {}\n          : { opensteerArtifactId: input.opensteerArtifactId }),\n        ...(redactedStorageKey === undefined ? {} : { storageKey: redactedStorageKey }),\n        ...(redactedMetadata === undefined ? {} : { metadata: redactedMetadata }),\n      };\n\n      const artifactPath = this.sessionArtifactPath(sessionId, artifact.artifactId);\n      if (!(await pathExists(artifactPath))) {\n        await writeJsonFileExclusive(artifactPath, artifact);\n        await writeJsonFileAtomic(this.sessionManifestPath(sessionId), {\n          ...session,\n          artifactCount: session.artifactCount + 1,\n          updatedAt: Math.max(session.updatedAt, createdAt),\n        } satisfies ObservationSession);\n      }\n\n      return artifact;\n    });\n  }\n\n  async listEvents(\n    sessionId: string,\n    input: ListObservationEventsInput = {},\n  ): Promise<readonly ObservationEvent[]> {\n    const directoryPath = this.sessionEventsDirectory(sessionId);\n    if (!(await pathExists(directoryPath))) {\n      return [];\n    }\n\n    const files = await listJsonFiles(directoryPath);\n    const events = await Promise.all(\n      files.map((fileName) => readJsonFile<ObservationEvent>(path.join(directoryPath, fileName))),\n    );\n    const filtered = events.filter((event) => {\n      if (input.kind !== undefined && event.kind !== input.kind) return false;\n      if (input.phase !== undefined && event.phase !== input.phase) return false;\n      if (input.correlationId !== undefined && event.correlationId !== input.correlationId) {\n        return false;\n      }\n      if (input.pageRef !== undefined && event.context?.pageRef !== input.pageRef) return false;\n      if (input.afterSequence !== undefined && event.sequence <= input.afterSequence) return false;\n      if (input.from !== undefined && event.createdAt < input.from) return false;\n      if (input.to !== undefined && event.createdAt > input.to) return false;\n      return true;\n    });\n\n    if (input.limit === undefined || filtered.length <= input.limit) {\n      return filtered;\n    }\n    return filtered.slice(-input.limit);\n  }\n\n  async listArtifacts(\n    sessionId: string,\n    input: ListObservationArtifactsInput = {},\n  ): Promise<readonly ObservationArtifact[]> {\n    const directoryPath = this.sessionArtifactsDirectory(sessionId);\n    if (!(await pathExists(directoryPath))) {\n      return [];\n    }\n\n    const files = await listJsonFiles(directoryPath);\n    const artifacts = await Promise.all(\n      files.map((fileName) =>\n        readJsonFile<ObservationArtifact>(path.join(directoryPath, fileName)),\n      ),\n    );\n    const filtered = artifacts.filter((artifact) => {\n      if (input.kind !== undefined && artifact.kind !== input.kind) return false;\n      if (input.pageRef !== undefined && artifact.context?.pageRef !== input.pageRef) return false;\n      return true;\n    });\n    if (input.limit === undefined || filtered.length <= input.limit) {\n      return filtered;\n    }\n    return filtered.slice(-input.limit);\n  }\n\n  async getArtifact(\n    sessionId: string,\n    artifactId: string,\n  ): Promise<ObservationArtifact | undefined> {\n    const artifactPath = this.sessionArtifactPath(sessionId, artifactId);\n    if (!(await pathExists(artifactPath))) {\n      return undefined;\n    }\n    return readJsonFile<ObservationArtifact>(artifactPath);\n  }\n\n  async closeSession(sessionId: string, _reason?: string): Promise<void> {\n    await withFilesystemLock(this.sessionLockPath(sessionId), async () => {\n      const session = await this.reconcileSessionManifest(sessionId);\n      if (session === undefined || session.closedAt !== undefined) {\n        return;\n      }\n\n      const now = Date.now();\n      await writeJsonFileAtomic(this.sessionManifestPath(sessionId), {\n        ...session,\n        updatedAt: Math.max(session.updatedAt, now),\n        closedAt: now,\n      } satisfies ObservationSession);\n    });\n    this.redactors.delete(sessionId);\n  }\n\n  async writeArtifactFromManifest(\n    sessionId: string,\n    manifest: ArtifactManifest,\n    kind: ObservationArtifact[\"kind\"],\n    metadata?: JsonValue,\n  ): Promise<ObservationArtifact> {\n    return this.writeArtifact(sessionId, {\n      artifactId: manifest.artifactId,\n      kind,\n      createdAt: manifest.createdAt,\n      context: manifest.scope,\n      mediaType: manifest.mediaType,\n      byteLength: manifest.byteLength,\n      sha256: manifest.sha256,\n      opensteerArtifactId: manifest.artifactId,\n      storageKey: manifestToExternalBinaryLocation(this.rootPath, manifest).uri,\n      ...(metadata === undefined ? {} : { metadata }),\n    });\n  }\n\n  async ensureArtifactLinked(\n    sessionId: string,\n    manifest: ArtifactManifest,\n  ): Promise<ObservationArtifact> {\n    const existing = await this.getArtifact(sessionId, manifest.artifactId);\n    if (existing !== undefined) {\n      return existing;\n    }\n\n    const kind = toObservationArtifactKind(manifest.kind);\n    return this.writeArtifactFromManifest(sessionId, manifest, kind);\n  }\n\n  async hydrateArtifactManifests(\n    artifactIds: readonly string[],\n  ): Promise<readonly ArtifactManifest[]> {\n    return (\n      await Promise.all(\n        artifactIds.map(async (artifactId) => this.artifacts.getManifest(artifactId)),\n      )\n    ).filter((value): value is ArtifactManifest => value !== undefined);\n  }\n\n  private sessionDirectory(sessionId: string): string {\n    return path.join(this.sessionsDirectory, encodePathSegment(sessionId));\n  }\n\n  private sessionManifestPath(sessionId: string): string {\n    return path.join(this.sessionDirectory(sessionId), \"session.json\");\n  }\n\n  private sessionEventsDirectory(sessionId: string): string {\n    return path.join(this.sessionDirectory(sessionId), \"events\");\n  }\n\n  private sessionArtifactsDirectory(sessionId: string): string {\n    return path.join(this.sessionDirectory(sessionId), \"artifacts\");\n  }\n\n  private sessionArtifactPath(sessionId: string, artifactId: string): string {\n    return path.join(\n      this.sessionArtifactsDirectory(sessionId),\n      `${encodePathSegment(artifactId)}.json`,\n    );\n  }\n\n  private sessionLockPath(sessionId: string): string {\n    return path.join(this.sessionDirectory(sessionId), \".lock\");\n  }\n\n  private async applySessionConfiguration(\n    sessionId: string,\n    config: NormalizedObservabilityConfig,\n    timestamp: number,\n  ): Promise<void> {\n    const redactor = createObservationRedactor(config);\n    this.redactors.set(sessionId, redactor);\n    const redactedLabels = redactor.redactLabels(config.labels);\n    const redactedTraceContext = redactor.redactTraceContext(config.traceContext);\n\n    await withFilesystemLock(this.sessionLockPath(sessionId), async () => {\n      const existing = await this.reconcileSessionManifest(sessionId);\n      if (existing === undefined) {\n        await ensureDirectory(this.sessionEventsDirectory(sessionId));\n        await ensureDirectory(this.sessionArtifactsDirectory(sessionId));\n        const session: ObservationSession = {\n          sessionId,\n          profile: config.profile,\n          ...(redactedLabels === undefined ? {} : { labels: redactedLabels }),\n          ...(redactedTraceContext === undefined ? {} : { traceContext: redactedTraceContext }),\n          openedAt: timestamp,\n          updatedAt: timestamp,\n          currentSequence: 0,\n          eventCount: 0,\n          artifactCount: 0,\n        };\n        await writeJsonFileExclusive(this.sessionManifestPath(sessionId), session);\n        return;\n      }\n\n      const patched: ObservationSession = {\n        ...existing,\n        profile: config.profile,\n        ...(redactedLabels === undefined ? {} : { labels: redactedLabels }),\n        ...(redactedTraceContext === undefined ? {} : { traceContext: redactedTraceContext }),\n        updatedAt: Math.max(existing.updatedAt, timestamp),\n      };\n      await writeJsonFileAtomic(this.sessionManifestPath(sessionId), patched);\n    });\n  }\n\n  private async reconcileSessionManifest(\n    sessionId: string,\n  ): Promise<ObservationSession | undefined> {\n    const session = await this.getSession(sessionId);\n    if (session === undefined) {\n      return undefined;\n    }\n\n    const [hasEventDirectory, hasArtifactDirectory] = await Promise.all([\n      pathExists(this.sessionEventsDirectory(sessionId)),\n      pathExists(this.sessionArtifactsDirectory(sessionId)),\n    ]);\n    const [eventFiles, artifactFiles] = await Promise.all([\n      hasEventDirectory\n        ? listJsonFiles(this.sessionEventsDirectory(sessionId))\n        : Promise.resolve([]),\n      hasArtifactDirectory\n        ? listJsonFiles(this.sessionArtifactsDirectory(sessionId))\n        : Promise.resolve([]),\n    ]);\n\n    const currentSequence = eventFiles.reduce((maxSequence, fileName) => {\n      const parsed = Number.parseInt(fileName.replace(/\\.json$/u, \"\"), 10);\n      return Number.isFinite(parsed) ? Math.max(maxSequence, parsed) : maxSequence;\n    }, 0);\n    const eventCount = eventFiles.length;\n    const artifactCount = artifactFiles.length;\n\n    if (\n      session.currentSequence === currentSequence &&\n      session.eventCount === eventCount &&\n      session.artifactCount === artifactCount\n    ) {\n      return session;\n    }\n\n    const [events, artifacts] = await Promise.all([\n      Promise.all(\n        eventFiles.map((fileName) =>\n          readJsonFile<ObservationEvent>(\n            path.join(this.sessionEventsDirectory(sessionId), fileName),\n          ),\n        ),\n      ),\n      Promise.all(\n        artifactFiles.map((fileName) =>\n          readJsonFile<ObservationArtifact>(\n            path.join(this.sessionArtifactsDirectory(sessionId), fileName),\n          ),\n        ),\n      ),\n    ]);\n\n    const updatedAt = Math.max(\n      session.openedAt,\n      session.closedAt ?? 0,\n      ...events.map((event) => event.createdAt),\n      ...artifacts.map((artifact) => artifact.createdAt),\n    );\n    const reconciled: ObservationSession = {\n      ...session,\n      currentSequence,\n      eventCount,\n      artifactCount,\n      updatedAt,\n    };\n    await writeJsonFileAtomic(this.sessionManifestPath(sessionId), reconciled);\n    return reconciled;\n  }\n}\n\nfunction toObservationArtifactKind(kind: ArtifactManifest[\"kind\"]): ObservationArtifact[\"kind\"] {\n  switch (kind) {\n    case \"screenshot\":\n      return \"screenshot\";\n    case \"dom-snapshot\":\n      return \"dom-snapshot\";\n    case \"html-snapshot\":\n      return \"html-snapshot\";\n    default:\n      return \"other\";\n  }\n}\n\nexport function createObservationStore(\n  rootPath: string,\n  artifacts: OpensteerArtifactStore,\n): FilesystemObservationStore {\n  return new FilesystemObservationStoreImpl(rootPath, artifacts);\n}\n","import path from \"node:path\";\nimport { randomUUID } from \"node:crypto\";\n\nimport type {\n  ArtifactReference,\n  OpensteerError,\n  OpensteerEvent,\n  TraceBundle,\n  TraceContext,\n  TraceOutcome,\n  TraceRecord,\n} from \"@opensteer/protocol\";\n\nimport type { OpensteerArtifactStore, ProtocolArtifactDelivery } from \"./artifacts.js\";\nimport {\n  ensureDirectory,\n  isAlreadyExistsError,\n  listJsonFiles,\n  normalizeNonEmptyString,\n  normalizeTimestamp,\n  pathExists,\n  readJsonFile,\n  writeJsonFileAtomic,\n  writeJsonFileExclusive,\n  withFilesystemLock,\n} from \"./internal/filesystem.js\";\nimport type { JsonValue } from \"./json.js\";\n\nexport interface TraceRunManifest {\n  readonly runId: string;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly entryCount: number;\n}\n\nexport interface CreateTraceRunInput {\n  readonly runId?: string;\n  readonly createdAt?: number;\n}\n\nexport interface AppendTraceEntryInput<TData extends JsonValue = JsonValue> {\n  readonly traceId?: string;\n  readonly stepId?: string;\n  readonly operation: string;\n  readonly outcome: TraceOutcome;\n  readonly startedAt: number;\n  readonly completedAt: number;\n  readonly context?: TraceContext;\n  readonly events?: readonly OpensteerEvent[];\n  readonly artifacts?: readonly ArtifactReference[];\n  readonly data?: TData;\n  readonly error?: OpensteerError;\n}\n\nexport interface TraceEntryRecord<TData extends JsonValue = JsonValue> {\n  readonly runId: string;\n  readonly sequence: number;\n  readonly traceId: string;\n  readonly stepId: string;\n  readonly operation: string;\n  readonly outcome: TraceOutcome;\n  readonly startedAt: number;\n  readonly completedAt: number;\n  readonly durationMs: number;\n  readonly context: TraceContext;\n  readonly events: readonly OpensteerEvent[];\n  readonly artifacts?: readonly ArtifactReference[];\n  readonly data?: TData;\n  readonly error?: OpensteerError;\n}\n\nexport interface OpensteerTraceStore {\n  readonly runsDirectory: string;\n\n  createRun(input?: CreateTraceRunInput): Promise<TraceRunManifest>;\n  getRun(runId: string): Promise<TraceRunManifest | undefined>;\n  append<TData extends JsonValue>(\n    runId: string,\n    input: AppendTraceEntryInput<TData>,\n  ): Promise<TraceEntryRecord<TData>>;\n  listEntries(runId: string): Promise<readonly TraceEntryRecord[]>;\n  getEntry(runId: string, traceId: string): Promise<TraceEntryRecord | undefined>;\n  toProtocolTraceRecord<TData extends JsonValue>(\n    entry: TraceEntryRecord<TData>,\n  ): TraceRecord<TData>;\n  readProtocolTraceBundle(\n    runId: string,\n    traceId: string,\n    options?: {\n      readonly artifactDelivery?: ProtocolArtifactDelivery;\n    },\n  ): Promise<TraceBundle | undefined>;\n}\n\nfunction normalizeContext(context: TraceContext | undefined): TraceContext {\n  return {\n    ...(context?.sessionRef === undefined ? {} : { sessionRef: context.sessionRef }),\n    ...(context?.pageRef === undefined ? {} : { pageRef: context.pageRef }),\n    ...(context?.frameRef === undefined ? {} : { frameRef: context.frameRef }),\n    ...(context?.documentRef === undefined ? {} : { documentRef: context.documentRef }),\n    ...(context?.documentEpoch === undefined ? {} : { documentEpoch: context.documentEpoch }),\n  };\n}\n\nfunction sequenceFileName(sequence: number): string {\n  return `${String(sequence).padStart(12, \"0\")}.json`;\n}\n\nexport class FilesystemTraceStore implements OpensteerTraceStore {\n  readonly runsDirectory: string;\n\n  constructor(\n    private readonly rootPath: string,\n    private readonly artifacts: OpensteerArtifactStore,\n  ) {\n    this.runsDirectory = path.join(this.rootPath, \"traces\", \"runs\");\n  }\n\n  async initialize(): Promise<void> {\n    await ensureDirectory(this.runsDirectory);\n  }\n\n  async createRun(input: CreateTraceRunInput = {}): Promise<TraceRunManifest> {\n    const runId = normalizeNonEmptyString(\"runId\", input.runId ?? `run:${randomUUID()}`);\n    const manifestPath = this.runManifestPath(runId);\n    const createdAt = normalizeTimestamp(\"createdAt\", input.createdAt ?? Date.now());\n    const manifest: TraceRunManifest = {\n      runId,\n      createdAt,\n      updatedAt: createdAt,\n      entryCount: 0,\n    };\n\n    await ensureDirectory(this.runEntriesDirectory(runId));\n    try {\n      await writeJsonFileExclusive(manifestPath, manifest);\n    } catch (error) {\n      if (isAlreadyExistsError(error)) {\n        throw new Error(`trace run ${runId} already exists`);\n      }\n\n      throw error;\n    }\n\n    return manifest;\n  }\n\n  async getRun(runId: string): Promise<TraceRunManifest | undefined> {\n    const manifestPath = this.runManifestPath(runId);\n    if (!(await pathExists(manifestPath))) {\n      return undefined;\n    }\n\n    return readJsonFile<TraceRunManifest>(manifestPath);\n  }\n\n  async append<TData extends JsonValue>(\n    runId: string,\n    input: AppendTraceEntryInput<TData>,\n  ): Promise<TraceEntryRecord<TData>> {\n    const startedAt = normalizeTimestamp(\"startedAt\", input.startedAt);\n    const completedAt = normalizeTimestamp(\"completedAt\", input.completedAt);\n    if (completedAt < startedAt) {\n      throw new RangeError(\"completedAt must be greater than or equal to startedAt\");\n    }\n\n    if (input.outcome === \"error\" && input.error === undefined) {\n      throw new TypeError(\"error traces must include an error payload\");\n    }\n    if (input.outcome === \"ok\" && input.error !== undefined) {\n      throw new TypeError(\"successful traces must not include an error payload\");\n    }\n\n    return withFilesystemLock(this.runWriteLockPath(runId), async () => {\n      const manifest = await this.getRun(runId);\n      if (manifest === undefined) {\n        throw new Error(`trace run ${runId} was not found`);\n      }\n\n      const sequence = manifest.entryCount + 1;\n      const traceId = normalizeNonEmptyString(\n        \"traceId\",\n        input.traceId ?? `trace:${runId}:${String(sequence).padStart(12, \"0\")}`,\n      );\n      const stepId = normalizeNonEmptyString(\n        \"stepId\",\n        input.stepId ?? `step:${runId}:${String(sequence).padStart(12, \"0\")}`,\n      );\n\n      const entry: TraceEntryRecord<TData> = {\n        runId,\n        sequence,\n        traceId,\n        stepId,\n        operation: normalizeNonEmptyString(\"operation\", input.operation),\n        outcome: input.outcome,\n        startedAt,\n        completedAt,\n        durationMs: completedAt - startedAt,\n        context: normalizeContext(input.context),\n        events: [...(input.events ?? [])],\n        ...(input.artifacts === undefined || input.artifacts.length === 0\n          ? {}\n          : { artifacts: [...input.artifacts] }),\n        ...(input.data === undefined ? {} : { data: input.data }),\n        ...(input.error === undefined ? {} : { error: input.error }),\n      };\n\n      await writeJsonFileExclusive(\n        path.join(this.runEntriesDirectory(runId), sequenceFileName(sequence)),\n        entry,\n      );\n      await writeJsonFileAtomic(this.runManifestPath(runId), {\n        ...manifest,\n        updatedAt: Math.max(manifest.updatedAt, completedAt),\n        entryCount: sequence,\n      } satisfies TraceRunManifest);\n\n      return entry;\n    });\n  }\n\n  async listEntries(runId: string): Promise<readonly TraceEntryRecord[]> {\n    const entriesDirectory = this.runEntriesDirectory(runId);\n    if (!(await pathExists(entriesDirectory))) {\n      return [];\n    }\n\n    const files = await listJsonFiles(entriesDirectory);\n    return Promise.all(\n      files.map((fileName) =>\n        readJsonFile<TraceEntryRecord>(path.join(entriesDirectory, fileName)),\n      ),\n    );\n  }\n\n  async getEntry(runId: string, traceId: string): Promise<TraceEntryRecord | undefined> {\n    return (await this.listEntries(runId)).find((entry) => entry.traceId === traceId);\n  }\n\n  toProtocolTraceRecord<TData extends JsonValue>(\n    entry: TraceEntryRecord<TData>,\n  ): TraceRecord<TData> {\n    return {\n      traceId: entry.traceId,\n      stepId: entry.stepId,\n      operation: entry.operation,\n      outcome: entry.outcome,\n      startedAt: entry.startedAt,\n      completedAt: entry.completedAt,\n      durationMs: entry.durationMs,\n      context: entry.context,\n      events: entry.events,\n      ...(entry.artifacts === undefined ? {} : { artifacts: entry.artifacts }),\n      ...(entry.data === undefined ? {} : { data: entry.data }),\n      ...(entry.error === undefined ? {} : { error: entry.error }),\n    };\n  }\n\n  async readProtocolTraceBundle(\n    runId: string,\n    traceId: string,\n    options: {\n      readonly artifactDelivery?: ProtocolArtifactDelivery;\n    } = {},\n  ): Promise<TraceBundle | undefined> {\n    const entry = await this.getEntry(runId, traceId);\n    if (entry === undefined) {\n      return undefined;\n    }\n\n    const trace = this.toProtocolTraceRecord(entry);\n    if (entry.artifacts === undefined || entry.artifacts.length === 0) {\n      return { trace };\n    }\n\n    const artifacts = [];\n    for (const reference of entry.artifacts) {\n      const artifact = await this.artifacts.toProtocolArtifact(\n        reference.artifactId,\n        options.artifactDelivery === undefined ? {} : { delivery: options.artifactDelivery },\n      );\n      if (artifact === undefined) {\n        throw new Error(`trace ${traceId} references missing artifact ${reference.artifactId}`);\n      }\n\n      artifacts.push(artifact);\n    }\n\n    return { trace, artifacts };\n  }\n\n  private runDirectory(runId: string): string {\n    return path.join(this.runsDirectory, encodeURIComponent(runId));\n  }\n\n  private runEntriesDirectory(runId: string): string {\n    return path.join(this.runDirectory(runId), \"entries\");\n  }\n\n  private runManifestPath(runId: string): string {\n    return path.join(this.runDirectory(runId), \"manifest.json\");\n  }\n\n  private runWriteLockPath(runId: string): string {\n    return path.join(this.runDirectory(runId), \".append.lock\");\n  }\n}\n\nexport function createTraceStore(\n  rootPath: string,\n  artifacts: OpensteerArtifactStore,\n): FilesystemTraceStore {\n  return new FilesystemTraceStore(rootPath, artifacts);\n}\n","import path from \"node:path\";\n\nimport { createArtifactStore, type OpensteerArtifactStore } from \"./artifacts.js\";\nimport {\n  encodePathSegment,\n  ensureDirectory,\n  normalizeTimestamp,\n  pathExists,\n  readJsonFile,\n  withFilesystemLock,\n  writeJsonFileAtomic,\n} from \"./internal/filesystem.js\";\nimport {\n  createDescriptorRegistry,\n  createInteractionTraceRegistry,\n  createRequestPlanRegistry,\n  type DescriptorRegistryStore,\n  type InteractionTraceRegistryStore,\n  type RequestPlanRegistryStore,\n} from \"./registry.js\";\nimport { createSavedNetworkStore, type SavedNetworkStore } from \"./network/saved-store.js\";\nimport { createObservationStore, type FilesystemObservationStore } from \"./observations.js\";\nimport { createTraceStore, type OpensteerTraceStore } from \"./traces.js\";\n\nexport const OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT = \"opensteer-workspace\";\nexport const OPENSTEER_FILESYSTEM_WORKSPACE_VERSION = 2;\n\nexport interface OpensteerWorkspaceManifest {\n  readonly layout: typeof OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT;\n  readonly version: typeof OPENSTEER_FILESYSTEM_WORKSPACE_VERSION;\n  readonly scope: \"workspace\" | \"temporary\";\n  readonly workspace?: string;\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly paths: {\n    readonly browser: \"browser\";\n    readonly live: \"live\";\n    readonly artifacts: \"artifacts\";\n    readonly traces: \"traces\";\n    readonly observations: \"observations\";\n    readonly registry: \"registry\";\n  };\n}\n\nexport interface CreateFilesystemOpensteerWorkspaceOptions {\n  readonly rootPath: string;\n  readonly workspace?: string;\n  readonly scope?: \"workspace\" | \"temporary\";\n  readonly createdAt?: number;\n}\n\nexport interface FilesystemOpensteerWorkspace {\n  readonly rootPath: string;\n  readonly manifestPath: string;\n  readonly manifest: OpensteerWorkspaceManifest;\n  readonly browserPath: string;\n  readonly browserManifestPath: string;\n  readonly browserUserDataDir: string;\n  readonly livePath: string;\n  readonly liveLocalPath: string;\n  readonly liveCloudPath: string;\n  readonly artifactsPath: string;\n  readonly tracesPath: string;\n  readonly observationsPath: string;\n  readonly registryPath: string;\n  readonly lockPath: string;\n  readonly artifacts: OpensteerArtifactStore;\n  readonly traces: OpensteerTraceStore;\n  readonly observations: FilesystemObservationStore;\n  readonly registry: {\n    readonly descriptors: DescriptorRegistryStore;\n    readonly requestPlans: RequestPlanRegistryStore;\n    readonly savedNetwork: SavedNetworkStore;\n    readonly interactionTraces: InteractionTraceRegistryStore;\n  };\n  lock<T>(task: () => Promise<T>): Promise<T>;\n}\n\nexport function normalizeWorkspaceId(workspace: string): string {\n  return encodePathSegment(workspace);\n}\n\nexport function resolveFilesystemWorkspacePath(input: {\n  readonly rootDir: string;\n  readonly workspace: string;\n}): string {\n  return path.join(\n    input.rootDir,\n    \".opensteer\",\n    \"workspaces\",\n    normalizeWorkspaceId(input.workspace),\n  );\n}\n\nexport async function createFilesystemOpensteerWorkspace(\n  options: CreateFilesystemOpensteerWorkspaceOptions,\n): Promise<FilesystemOpensteerWorkspace> {\n  await ensureDirectory(options.rootPath);\n\n  const manifestPath = path.join(options.rootPath, \"workspace.json\");\n  const browserPath = path.join(options.rootPath, \"browser\");\n  const browserManifestPath = path.join(browserPath, \"manifest.json\");\n  const browserUserDataDir = path.join(browserPath, \"user-data\");\n  const livePath = path.join(options.rootPath, \"live\");\n  const liveLocalPath = path.join(livePath, \"local.json\");\n  const liveCloudPath = path.join(livePath, \"cloud.json\");\n  const artifactsPath = path.join(options.rootPath, \"artifacts\");\n  const tracesPath = path.join(options.rootPath, \"traces\");\n  const observationsPath = path.join(options.rootPath, \"observations\");\n  const registryPath = path.join(options.rootPath, \"registry\");\n  const lockPath = path.join(options.rootPath, \".lock\");\n\n  let manifest: OpensteerWorkspaceManifest;\n  if (await pathExists(manifestPath)) {\n    manifest = await readJsonFile<OpensteerWorkspaceManifest>(manifestPath);\n    if (manifest.layout !== OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT) {\n      throw new Error(\n        `workspace ${options.rootPath} is not an ${OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT} layout`,\n      );\n    }\n    if (manifest.version !== OPENSTEER_FILESYSTEM_WORKSPACE_VERSION) {\n      throw new Error(\n        `workspace ${options.rootPath} uses unsupported version ${String(manifest.version)}`,\n      );\n    }\n    if (manifest.paths.observations === undefined) {\n      manifest = {\n        ...manifest,\n        updatedAt: Date.now(),\n        paths: {\n          ...manifest.paths,\n          observations: \"observations\",\n        },\n      };\n      await writeJsonFileAtomic(manifestPath, manifest);\n    }\n  } else {\n    const createdAt = normalizeTimestamp(\"createdAt\", options.createdAt ?? Date.now());\n    manifest = {\n      layout: OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT,\n      version: OPENSTEER_FILESYSTEM_WORKSPACE_VERSION,\n      scope: options.scope ?? (options.workspace === undefined ? \"temporary\" : \"workspace\"),\n      ...(options.workspace === undefined ? {} : { workspace: options.workspace }),\n      createdAt,\n      updatedAt: createdAt,\n      paths: {\n        browser: \"browser\",\n        live: \"live\",\n        artifacts: \"artifacts\",\n        traces: \"traces\",\n        observations: \"observations\",\n        registry: \"registry\",\n      },\n    };\n    await writeJsonFileAtomic(manifestPath, manifest);\n  }\n\n  await Promise.all([\n    ensureDirectory(browserPath),\n    ensureDirectory(browserUserDataDir),\n    ensureDirectory(livePath),\n    ensureDirectory(artifactsPath),\n    ensureDirectory(tracesPath),\n    ensureDirectory(observationsPath),\n    ensureDirectory(registryPath),\n  ]);\n\n  const artifacts = createArtifactStore(options.rootPath);\n  await artifacts.initialize();\n\n  const descriptors = createDescriptorRegistry(options.rootPath);\n  await descriptors.initialize();\n\n  const requestPlans = createRequestPlanRegistry(options.rootPath);\n  await requestPlans.initialize();\n\n  const savedNetwork = createSavedNetworkStore(options.rootPath);\n  await savedNetwork.initialize();\n\n  const interactionTraces = createInteractionTraceRegistry(options.rootPath);\n  await interactionTraces.initialize();\n\n  const traces = createTraceStore(options.rootPath, artifacts);\n  await traces.initialize();\n\n  const observations = createObservationStore(options.rootPath, artifacts);\n  await observations.initialize();\n\n  return {\n    rootPath: options.rootPath,\n    manifestPath,\n    manifest,\n    browserPath,\n    browserManifestPath,\n    browserUserDataDir,\n    livePath,\n    liveLocalPath,\n    liveCloudPath,\n    artifactsPath,\n    tracesPath,\n    observationsPath,\n    registryPath,\n    lockPath,\n    artifacts,\n    traces,\n    observations,\n    registry: {\n      descriptors,\n      requestPlans,\n      savedNetwork,\n      interactionTraces,\n    },\n    lock<T>(task: () => Promise<T>): Promise<T> {\n      return withFilesystemLock(lockPath, task);\n    },\n  };\n}\n","export * from \"../../runtime-core/src/root.js\";\n","import { pathExists, readJsonFile, writeJsonFileAtomic } from \"../internal/filesystem.js\";\nimport { resolveLocalViewPreferencesPath } from \"./runtime-dir.js\";\n\nexport const OPENSTEER_LOCAL_VIEW_PREFERENCES_LAYOUT = \"opensteer-local-view-preferences\";\nexport const OPENSTEER_LOCAL_VIEW_PREFERENCES_VERSION = 1;\n\nexport type OpensteerLocalViewMode = \"auto\" | \"manual\";\n\nexport interface PersistedLocalViewPreferences {\n  readonly layout: typeof OPENSTEER_LOCAL_VIEW_PREFERENCES_LAYOUT;\n  readonly version: typeof OPENSTEER_LOCAL_VIEW_PREFERENCES_VERSION;\n  readonly mode: OpensteerLocalViewMode;\n  readonly updatedAt: number;\n}\n\nexport async function resolveLocalViewMode(): Promise<OpensteerLocalViewMode> {\n  const preferences = await readLocalViewPreferences();\n  return preferences?.mode ?? \"auto\";\n}\n\nexport async function setLocalViewMode(\n  mode: OpensteerLocalViewMode,\n): Promise<PersistedLocalViewPreferences> {\n  return writeLocalViewPreferences(mode);\n}\n\nexport async function readLocalViewPreferences(): Promise<\n  PersistedLocalViewPreferences | undefined\n> {\n  const preferencesPath = resolveLocalViewPreferencesPath();\n  if (!(await pathExists(preferencesPath))) {\n    return undefined;\n  }\n\n  const parsed = await readJsonFile<Partial<PersistedLocalViewPreferences>>(preferencesPath);\n  return isPersistedLocalViewPreferences(parsed) ? parsed : undefined;\n}\n\nasync function writeLocalViewPreferences(\n  mode: OpensteerLocalViewMode,\n): Promise<PersistedLocalViewPreferences> {\n  const preferences: PersistedLocalViewPreferences = {\n    layout: OPENSTEER_LOCAL_VIEW_PREFERENCES_LAYOUT,\n    version: OPENSTEER_LOCAL_VIEW_PREFERENCES_VERSION,\n    mode,\n    updatedAt: Date.now(),\n  };\n  await writeJsonFileAtomic(resolveLocalViewPreferencesPath(), preferences);\n  return preferences;\n}\n\nfunction isPersistedLocalViewPreferences(\n  value: Partial<PersistedLocalViewPreferences> | null | undefined,\n): value is PersistedLocalViewPreferences {\n  return (\n    value?.layout === OPENSTEER_LOCAL_VIEW_PREFERENCES_LAYOUT &&\n    value.version === OPENSTEER_LOCAL_VIEW_PREFERENCES_VERSION &&\n    (value.mode === \"auto\" || value.mode === \"manual\") &&\n    typeof value.updatedAt === \"number\" &&\n    Number.isFinite(value.updatedAt)\n  );\n}\n","import { randomUUID } from \"node:crypto\";\nimport { existsSync } from \"node:fs\";\nimport { mkdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\n\nimport {\n  CURRENT_PROCESS_OWNER,\n  getProcessLiveness,\n  parseProcessOwner,\n  processOwnersEqual,\n  type ProcessOwner,\n} from \"./process-owner.js\";\n\nconst LOCK_OWNER_FILE = \"owner.json\";\nconst LOCK_RECLAIMER_DIR = \"reclaimer\";\nconst LOCK_RETRY_DELAY_MS = 50;\n\ninterface ProcessParticipantRecord {\n  readonly exists: boolean;\n  readonly owner: ProcessOwner | null;\n}\n\nexport type LockRelease = () => Promise<void>;\n\nexport async function withDirLock<T>(lockDirPath: string, action: () => Promise<T>): Promise<T> {\n  const releaseLock = await acquireDirLock(lockDirPath);\n\n  try {\n    return await action();\n  } finally {\n    await releaseLock();\n  }\n}\n\nexport async function acquireDirLock(lockDirPath: string): Promise<LockRelease> {\n  while (true) {\n    const releaseLock = await tryAcquireDirLock(lockDirPath);\n    if (releaseLock) {\n      return releaseLock;\n    }\n\n    await sleep(LOCK_RETRY_DELAY_MS);\n  }\n}\n\nexport async function tryAcquireDirLock(lockDirPath: string): Promise<LockRelease | null> {\n  await mkdir(dirname(lockDirPath), { recursive: true });\n\n  while (true) {\n    const tempLockDirPath = `${lockDirPath}-${String(process.pid)}-${String(CURRENT_PROCESS_OWNER.processStartedAtMs)}-${randomUUID()}`;\n\n    try {\n      await mkdir(tempLockDirPath);\n      await writeLockOwner(tempLockDirPath, CURRENT_PROCESS_OWNER);\n\n      try {\n        await rename(tempLockDirPath, lockDirPath);\n        break;\n      } catch (error) {\n        if (!wasDirPublishedByAnotherProcess(error, lockDirPath)) {\n          throw error;\n        }\n      }\n    } finally {\n      await rm(tempLockDirPath, {\n        recursive: true,\n        force: true,\n      }).catch(() => undefined);\n    }\n\n    const owner = await readLockOwner(lockDirPath);\n    if (\n      (!owner || (await getProcessLiveness(owner)) === \"dead\") &&\n      (await tryReclaimStaleLock(lockDirPath, owner))\n    ) {\n      continue;\n    }\n\n    return null;\n  }\n\n  return async () => {\n    await rm(lockDirPath, {\n      recursive: true,\n      force: true,\n    }).catch(() => undefined);\n  };\n}\n\nexport async function isDirLockHeld(lockDirPath: string): Promise<boolean> {\n  if (!existsSync(lockDirPath)) {\n    return false;\n  }\n\n  const owner = await readLockOwner(lockDirPath);\n  if (\n    (!owner || (await getProcessLiveness(owner)) === \"dead\") &&\n    (await tryReclaimStaleLock(lockDirPath, owner))\n  ) {\n    return false;\n  }\n\n  return existsSync(lockDirPath);\n}\n\nfunction getErrorCode(error: unknown): string | undefined {\n  return typeof error === \"object\" &&\n    error !== null &&\n    \"code\" in error &&\n    typeof error.code === \"string\"\n    ? error.code\n    : undefined;\n}\n\nfunction wasDirPublishedByAnotherProcess(error: unknown, targetDirPath: string): boolean {\n  const code = getErrorCode(error);\n  return (\n    existsSync(targetDirPath) && (code === \"EEXIST\" || code === \"ENOTEMPTY\" || code === \"EPERM\")\n  );\n}\n\nasync function writeLockOwner(lockDirPath: string, owner: ProcessOwner): Promise<void> {\n  await writeFile(join(lockDirPath, LOCK_OWNER_FILE), JSON.stringify(owner));\n}\n\nasync function readLockOwner(lockDirPath: string): Promise<ProcessOwner | null> {\n  return readLockParticipant(join(lockDirPath, LOCK_OWNER_FILE));\n}\n\nasync function readLockParticipant(filePath: string): Promise<ProcessOwner | null> {\n  return (await readLockParticipantRecord(filePath)).owner;\n}\n\nasync function readLockParticipantRecord(filePath: string): Promise<ProcessParticipantRecord> {\n  try {\n    const raw = await readFile(filePath, \"utf8\");\n    return {\n      exists: true,\n      owner: parseProcessOwner(JSON.parse(raw)),\n    };\n  } catch (error) {\n    return {\n      exists: getErrorCode(error) !== \"ENOENT\",\n      owner: null,\n    };\n  }\n}\n\nasync function readLockReclaimerRecord(lockDirPath: string): Promise<ProcessParticipantRecord> {\n  return readLockParticipantRecord(join(buildLockReclaimerDirPath(lockDirPath), LOCK_OWNER_FILE));\n}\n\nasync function tryReclaimStaleLock(\n  lockDirPath: string,\n  expectedOwner: ProcessOwner | null,\n): Promise<boolean> {\n  if (!(await tryAcquireLockReclaimer(lockDirPath))) {\n    return false;\n  }\n\n  let reclaimed = false;\n  try {\n    const owner = await readLockOwner(lockDirPath);\n    if (!processOwnersEqual(owner, expectedOwner)) {\n      return false;\n    }\n    if (owner && (await getProcessLiveness(owner)) !== \"dead\") {\n      return false;\n    }\n\n    await rm(lockDirPath, {\n      recursive: true,\n      force: true,\n    }).catch(() => undefined);\n    reclaimed = !existsSync(lockDirPath);\n    return reclaimed;\n  } finally {\n    if (!reclaimed) {\n      await rm(buildLockReclaimerDirPath(lockDirPath), {\n        recursive: true,\n        force: true,\n      }).catch(() => undefined);\n    }\n  }\n}\n\nasync function tryAcquireLockReclaimer(lockDirPath: string): Promise<boolean> {\n  const reclaimerDirPath = buildLockReclaimerDirPath(lockDirPath);\n\n  while (true) {\n    const tempReclaimerDirPath = `${reclaimerDirPath}-${String(process.pid)}-${String(CURRENT_PROCESS_OWNER.processStartedAtMs)}-${randomUUID()}`;\n\n    try {\n      await mkdir(tempReclaimerDirPath);\n      await writeLockOwner(tempReclaimerDirPath, CURRENT_PROCESS_OWNER);\n\n      try {\n        await rename(tempReclaimerDirPath, reclaimerDirPath);\n        return true;\n      } catch (error) {\n        if (getErrorCode(error) === \"ENOENT\") {\n          return false;\n        }\n        if (!wasDirPublishedByAnotherProcess(error, reclaimerDirPath)) {\n          throw error;\n        }\n      }\n    } catch (error) {\n      if (getErrorCode(error) === \"ENOENT\") {\n        return false;\n      }\n      throw error;\n    } finally {\n      await rm(tempReclaimerDirPath, {\n        recursive: true,\n        force: true,\n      }).catch(() => undefined);\n    }\n\n    const reclaimerRecord = await readLockReclaimerRecord(lockDirPath);\n    if (!reclaimerRecord.exists || !reclaimerRecord.owner) {\n      return false;\n    }\n    if ((await getProcessLiveness(reclaimerRecord.owner)) !== \"dead\") {\n      return false;\n    }\n\n    await rm(reclaimerDirPath, {\n      recursive: true,\n      force: true,\n    }).catch(() => undefined);\n  }\n}\n\nfunction buildLockReclaimerDirPath(lockDirPath: string): string {\n  return join(lockDirPath, LOCK_RECLAIMER_DIR);\n}\n\nasync function sleep(ms: number): Promise<void> {\n  await new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import { spawn } from \"node:child_process\";\nimport { randomBytes } from \"node:crypto\";\nimport { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { acquireDirLock } from \"../local-browser/dir-lock.js\";\nimport {\n  clearLocalViewServiceState,\n  getLocalViewServiceStateLiveness,\n  isLocalViewServiceStateLive,\n  readLocalViewServiceState,\n  type PersistedLocalViewServiceState,\n} from \"./service-state.js\";\nimport { resolveLocalViewServiceLockDir } from \"./runtime-dir.js\";\n\nconst LOCAL_VIEW_STARTUP_TIMEOUT_MS = 10_000;\nconst LOCAL_VIEW_STARTUP_POLL_MS = 100;\nconst LOCAL_VIEW_STOP_TIMEOUT_MS = 10_000;\n\nexport async function ensureLocalViewServiceRunning(): Promise<{\n  readonly url: string;\n  readonly token: string;\n}> {\n  const current = await readReachableLocalViewServiceState();\n  if (current !== undefined) {\n    return current;\n  }\n\n  const releaseLock = await acquireDirLock(resolveLocalViewServiceLockDir());\n  try {\n    const lockedState = await readReachableLocalViewServiceState();\n    if (lockedState !== undefined) {\n      return lockedState;\n    }\n\n    await spawnLocalViewService();\n    const started = await waitForLocalViewService();\n    if (!started) {\n      throw new Error(\"Timed out while starting the local view service.\");\n    }\n    return started;\n  } finally {\n    await releaseLock();\n  }\n}\n\nexport async function stopLocalViewService(): Promise<boolean> {\n  const state = await readLocalViewServiceState();\n  if (state === undefined || !(await isLocalViewServiceStateLive(state))) {\n    await clearLocalViewServiceState(\n      state === undefined ? undefined : { pid: state.pid, token: state.token },\n    );\n    return false;\n  }\n\n  const liveState = state;\n  const stopRequested = await requestLocalViewServiceStop(liveState).catch(() => false);\n  if (!stopRequested && (await getLocalViewServiceStateLiveness(liveState)) !== \"dead\") {\n    process.kill(liveState.pid);\n  }\n\n  await waitForLocalViewServiceStop(liveState);\n  await clearLocalViewServiceState({ pid: liveState.pid, token: liveState.token });\n  return true;\n}\n\nexport async function readLocalViewDashboardUrl(): Promise<string | undefined> {\n  return (await readReachableLocalViewServiceState())?.url;\n}\n\nexport function buildLocalViewSessionUrl(args: {\n  readonly baseUrl: string;\n  readonly sessionId?: string;\n}): string {\n  if (!args.sessionId) {\n    return args.baseUrl;\n  }\n  return `${args.baseUrl}#session=${encodeURIComponent(args.sessionId)}`;\n}\n\nasync function requestLocalViewServiceStop(\n  state: PersistedLocalViewServiceState,\n): Promise<boolean> {\n  const response = await fetch(new URL(\"/api/service/stop\", state.url), {\n    method: \"POST\",\n    headers: {\n      \"x-opensteer-local-token\": state.token,\n    },\n  });\n  return response.ok;\n}\n\nasync function waitForLocalViewServiceStop(state: PersistedLocalViewServiceState): Promise<void> {\n  const deadline = Date.now() + LOCAL_VIEW_STOP_TIMEOUT_MS;\n  while (Date.now() < deadline) {\n    if ((await getLocalViewServiceStateLiveness(state)) === \"dead\") {\n      return;\n    }\n    await delay(LOCAL_VIEW_STARTUP_POLL_MS);\n  }\n\n  throw new Error(\"Timed out while stopping the local view service.\");\n}\n\nfunction spawnLocalViewService(): void {\n  const command = resolveLocalViewSpawnCommand();\n  const child = spawn(command.executable, command.args, {\n    cwd: process.cwd(),\n    env: {\n      ...process.env,\n      ...(command.env ?? {}),\n      OPENSTEER_LOCAL_VIEW_BOOT_TOKEN:\n        process.env.OPENSTEER_LOCAL_VIEW_BOOT_TOKEN ?? randomBytes(24).toString(\"hex\"),\n    },\n    detached: process.platform !== \"win32\",\n    stdio: \"ignore\",\n  });\n  child.unref();\n}\n\nasync function waitForLocalViewService(): Promise<\n  | {\n      readonly url: string;\n      readonly token: string;\n    }\n  | undefined\n> {\n  const deadline = Date.now() + LOCAL_VIEW_STARTUP_TIMEOUT_MS;\n  while (Date.now() < deadline) {\n    const state = await readReachableLocalViewServiceState();\n    if (state !== undefined) {\n      return state;\n    }\n    await delay(LOCAL_VIEW_STARTUP_POLL_MS);\n  }\n  return undefined;\n}\n\nasync function readReachableLocalViewServiceState(): Promise<\n  PersistedLocalViewServiceState | undefined\n> {\n  const state = await readLocalViewServiceState();\n  if (state === undefined || !(await isLocalViewServiceStateLive(state))) {\n    return undefined;\n  }\n  return (await isLocalViewServiceReachable(state.url, state.token)) ? state : undefined;\n}\n\nasync function isLocalViewServiceReachable(baseUrl: string, token: string): Promise<boolean> {\n  try {\n    const response = await fetch(new URL(\"/api/health\", baseUrl), {\n      headers: {\n        \"x-opensteer-local-token\": token,\n      },\n    });\n    return response.ok;\n  } catch {\n    return false;\n  }\n}\n\nfunction resolveLocalViewSpawnCommand(): {\n  readonly executable: string;\n  readonly args: readonly string[];\n  readonly env?: Readonly<Record<string, string>>;\n} {\n  const moduleDir = path.dirname(fileURLToPath(import.meta.url));\n  const distServicePath = findExistingPath([\n    path.join(moduleDir, \"local-view\", \"serve-entry.js\"),\n    path.join(moduleDir, \"serve-entry.js\"),\n    path.join(moduleDir, \"..\", \"local-view\", \"serve-entry.js\"),\n  ]);\n  if (distServicePath) {\n    return {\n      executable: process.execPath,\n      args: [distServicePath],\n    };\n  }\n\n  const distCliPath = findExistingPath([\n    path.join(moduleDir, \"cli\", \"bin.js\"),\n    path.join(moduleDir, \"..\", \"cli\", \"bin.js\"),\n  ]);\n  if (distCliPath) {\n    return {\n      executable: process.execPath,\n      args: [distCliPath, \"view\", \"serve\"],\n    };\n  }\n\n  const srcServicePath = findExistingPath([\n    path.join(moduleDir, \"serve-entry.ts\"),\n    path.join(moduleDir, \"..\", \"local-view\", \"serve-entry.ts\"),\n    path.join(moduleDir, \"..\", \"src\", \"local-view\", \"serve-entry.ts\"),\n  ]);\n  if (srcServicePath) {\n    const require = createRequire(import.meta.url);\n    const tsxLoaderPath = require.resolve(\"tsx\");\n    const tsconfigPath = findNearestTsconfig(path.resolve(moduleDir, \"..\", \"..\", \"..\"));\n    return {\n      executable: process.execPath,\n      args: [\"--import\", tsxLoaderPath, srcServicePath],\n      ...(tsconfigPath ? { env: { TSX_TSCONFIG_PATH: tsconfigPath } } : {}),\n    };\n  }\n\n  const srcCliPath = findExistingPath([\n    path.join(moduleDir, \"..\", \"cli\", \"bin.ts\"),\n    path.join(moduleDir, \"..\", \"src\", \"cli\", \"bin.ts\"),\n  ]);\n  if (srcCliPath) {\n    const require = createRequire(import.meta.url);\n    const tsxLoaderPath = require.resolve(\"tsx\");\n    const tsconfigPath = findNearestTsconfig(path.resolve(moduleDir, \"..\", \"..\", \"..\"));\n    return {\n      executable: process.execPath,\n      args: [\"--import\", tsxLoaderPath, srcCliPath, \"view\", \"serve\"],\n      ...(tsconfigPath ? { env: { TSX_TSCONFIG_PATH: tsconfigPath } } : {}),\n    };\n  }\n\n  throw new Error(`Could not resolve the Opensteer CLI entrypoint from ${moduleDir}.`);\n}\n\nfunction findExistingPath(candidates: readonly string[]): string | undefined {\n  return candidates.find((candidate) => existsSync(candidate));\n}\n\nfunction findNearestTsconfig(startDir: string): string | undefined {\n  let currentDir = startDir;\n  while (true) {\n    const candidate = path.join(currentDir, \"tsconfig.json\");\n    if (existsSync(candidate)) {\n      return candidate;\n    }\n    const parentDir = path.dirname(currentDir);\n    if (parentDir === currentDir) {\n      return undefined;\n    }\n    currentDir = parentDir;\n  }\n}\n\nfunction delay(ms: number): Promise<void> {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms);\n  });\n}\n","import type { PersistedLocalBrowserSessionRecord } from \"../live-session.js\";\nimport { resolveLocalViewMode } from \"./preferences.js\";\nimport { ensureLocalViewServiceRunning } from \"./service.js\";\nimport {\n  createLocalViewSessionManifest,\n  deleteLocalViewSessionManifest,\n  type PersistedLocalViewSessionManifest,\n  writeLocalViewSessionManifest,\n} from \"./session-manifest.js\";\n\nexport async function bestEffortRegisterLocalViewSession(input: {\n  readonly rootPath: string;\n  readonly workspace?: string;\n  readonly live: PersistedLocalBrowserSessionRecord;\n  readonly ownership: \"owned\" | \"attached\" | \"managed\";\n}): Promise<PersistedLocalViewSessionManifest | undefined> {\n  try {\n    const manifest = createLocalViewSessionManifest(input);\n    await writeLocalViewSessionManifest(manifest);\n    if ((await resolveLocalViewMode()) === \"auto\") {\n      void ensureLocalViewServiceRunning().catch(() => undefined);\n    }\n    return manifest;\n  } catch {\n    return undefined;\n  }\n}\n\nexport async function bestEffortUnregisterLocalViewSession(\n  sessionId: string | undefined,\n): Promise<void> {\n  if (!sessionId) {\n    return;\n  }\n  await deleteLocalViewSessionManifest(sessionId).catch(() => undefined);\n}\n","import {\n  OpensteerProtocolError,\n  type OpensteerBrowserContextOptions,\n  type OpensteerBrowserLaunchOptions,\n  type OpensteerBrowserOptions,\n} from \"@opensteer/protocol\";\n\nexport const OPENSTEER_ENGINE_NAMES = [\"playwright\", \"abp\"] as const;\nexport type OpensteerEngineName = (typeof OPENSTEER_ENGINE_NAMES)[number];\n\nexport const DEFAULT_OPENSTEER_ENGINE: OpensteerEngineName = \"playwright\";\n\nexport interface ResolvedAbpLaunchOptions {\n  readonly headless?: boolean;\n  readonly args?: readonly string[];\n  readonly browserExecutablePath?: string;\n  readonly userDataDir?: string;\n  readonly sessionDir?: string;\n}\n\nexport function resolveOpensteerEngineName(\n  input: {\n    readonly requested?: string;\n    readonly environment?: string;\n  } = {},\n): OpensteerEngineName {\n  if (input.requested !== undefined) {\n    return normalizeOpensteerEngineName(input.requested, \"--engine\");\n  }\n\n  if (input.environment !== undefined) {\n    return normalizeOpensteerEngineName(input.environment, \"OPENSTEER_ENGINE\");\n  }\n\n  return DEFAULT_OPENSTEER_ENGINE;\n}\n\nexport function normalizeOpensteerEngineName(\n  value: string,\n  source = \"engine\",\n): OpensteerEngineName {\n  const normalized = value.trim().toLowerCase();\n  if (normalized === \"playwright\" || normalized === \"abp\") {\n    return normalized;\n  }\n\n  throw new OpensteerProtocolError(\n    \"invalid-argument\",\n    `${source} must be one of ${OPENSTEER_ENGINE_NAMES.join(\", \")}; received \"${value}\".`,\n  );\n}\n\nexport function assertSupportedEngineOptions(input: {\n  readonly engineName: OpensteerEngineName;\n  readonly browser?: OpensteerBrowserOptions;\n  readonly context?: OpensteerBrowserContextOptions;\n}): void {\n  if (input.engineName !== \"abp\") {\n    return;\n  }\n\n  if (\n    typeof input.browser === \"object\" &&\n    input.browser !== null &&\n    input.browser.mode === \"attach\"\n  ) {\n    throw new OpensteerProtocolError(\n      \"invalid-argument\",\n      'ABP engine does not support browser.mode=\"attach\". Use the Playwright engine for attach flows.',\n    );\n  }\n\n  const unsupportedContextOptionNames = listUnsupportedContextOptionNames(input.context);\n  if (unsupportedContextOptionNames.length === 0) {\n    return;\n  }\n\n  throw new OpensteerProtocolError(\n    \"invalid-argument\",\n    `ABP engine does not support ${unsupportedContextOptionNames.join(\", \")}. Supported ABP context options: context.viewport.`,\n  );\n}\n\nexport function toAbpLaunchOptions(input: {\n  readonly launch?: OpensteerBrowserLaunchOptions;\n  readonly context?: OpensteerBrowserContextOptions;\n  readonly userDataDir?: string;\n  readonly sessionDir?: string;\n}): ResolvedAbpLaunchOptions | undefined {\n  const mapped: {\n    headless?: boolean;\n    args?: readonly string[];\n    browserExecutablePath?: string;\n    userDataDir?: string;\n    sessionDir?: string;\n  } = {};\n\n  if (input.launch?.headless !== undefined) {\n    mapped.headless = input.launch.headless;\n  }\n\n  const args = mergeManagedLaunchArgs(input.launch?.args, input.context?.viewport);\n  if (args !== undefined) {\n    mapped.args = args;\n  }\n\n  if (input.launch?.executablePath !== undefined) {\n    mapped.browserExecutablePath = input.launch.executablePath;\n  }\n\n  if (input.userDataDir !== undefined) {\n    mapped.userDataDir = input.userDataDir;\n  }\n\n  if (input.sessionDir !== undefined) {\n    mapped.sessionDir = input.sessionDir;\n  }\n\n  return Object.keys(mapped).length === 0 ? undefined : mapped;\n}\n\nfunction listUnsupportedContextOptionNames(\n  options: OpensteerBrowserContextOptions | undefined,\n): readonly string[] {\n  if (options === undefined) {\n    return [];\n  }\n\n  return Object.entries(options)\n    .filter(([key, value]) => value !== undefined && key !== \"viewport\")\n    .map(([key]) => `context.${key}`);\n}\n\nfunction mergeManagedLaunchArgs(\n  args: readonly string[] | undefined,\n  viewport:\n    | {\n        readonly width: number;\n        readonly height: number;\n      }\n    | null\n    | undefined,\n): readonly string[] | undefined {\n  const filtered = stripWindowSizeArgs(args);\n  if (viewport === undefined || viewport === null) {\n    return filtered.length === 0 ? undefined : filtered;\n  }\n\n  return [...filtered, `--window-size=${viewport.width},${viewport.height}`];\n}\n\nfunction stripWindowSizeArgs(args: readonly string[] | undefined): readonly string[] {\n  if (args === undefined) {\n    return [];\n  }\n\n  const filtered: string[] = [];\n  for (let index = 0; index < args.length; index += 1) {\n    const argument = args[index]!;\n    if (argument === \"--window-size\") {\n      index += 1;\n      continue;\n    }\n    if (argument.startsWith(\"--window-size=\")) {\n      continue;\n    }\n    filtered.push(argument);\n  }\n\n  return filtered;\n}\n","export * from \"../../../runtime-core/src/internal/engine-selection.js\";\n","import { spawn } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { mkdtemp, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\n\nimport type { BrowserCoreEngine } from \"@opensteer/browser-core\";\nimport {\n  connectPlaywrightChromiumBrowser,\n  createPlaywrightBrowserCoreEngine,\n  disconnectPlaywrightChromiumBrowser,\n} from \"@opensteer/engine-playwright\";\nimport type {\n  OpensteerAttachBrowserOptions,\n  OpensteerBrowserContextOptions,\n  OpensteerBrowserLaunchOptions,\n  OpensteerBrowserOptions,\n} from \"@opensteer/protocol\";\n\nimport { isProcessRunning } from \"./local-browser/process-owner.js\";\nimport {\n  clearChromeSingletonEntries,\n  sanitizeChromeProfile,\n} from \"./local-browser/chrome-singletons.js\";\nimport {\n  readDevToolsActivePort,\n  resolveChromeExecutablePath,\n} from \"./local-browser/chrome-discovery.js\";\nimport { inspectCdpEndpoint, selectAttachBrowserCandidate } from \"./local-browser/cdp-discovery.js\";\nimport { createBrowserProfileSnapshot } from \"./local-browser/profile-clone.js\";\nimport { injectBrowserStealthScripts } from \"./local-browser/stealth.js\";\nimport type { ConnectedCdpPage } from \"./local-browser/types.js\";\nimport { generateStealthProfile, type StealthProfile } from \"./local-browser/stealth-profiles.js\";\nimport {\n  createFilesystemOpensteerWorkspace,\n  resolveFilesystemWorkspacePath,\n  type FilesystemOpensteerWorkspace,\n} from \"./root.js\";\nimport {\n  clearPersistedSessionRecord,\n  getPersistedLocalBrowserSessionOwnership,\n  isAttachedLocalBrowserSessionReachable,\n  readPersistedLocalBrowserSessionRecord,\n  writePersistedSessionRecord,\n  type PersistedLocalBrowserSessionRecord,\n} from \"./live-session.js\";\nimport type { OpensteerEnvironment } from \"./env.js\";\nimport {\n  bestEffortRegisterLocalViewSession,\n  bestEffortUnregisterLocalViewSession,\n} from \"./local-view/registration.js\";\nimport { buildLocalViewSessionId } from \"./local-view/session-manifest.js\";\nimport {\n  ensureDirectory,\n  pathExists,\n  readJsonFile,\n  writeJsonFileAtomic,\n} from \"./internal/filesystem.js\";\nimport {\n  assertSupportedEngineOptions,\n  DEFAULT_OPENSTEER_ENGINE,\n  toAbpLaunchOptions,\n  type OpensteerEngineName,\n} from \"./internal/engine-selection.js\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\nconst DEVTOOLS_POLL_INTERVAL_MS = 50;\nconst TEMPORARY_WORKSPACE_PREFIX = \"opensteer-temporary-workspace-\";\nconst BROWSER_CLOSE_TIMEOUT_MS = 5_000;\n\ntype DisposableBrowserCoreEngine = BrowserCoreEngine & {\n  dispose?: () => Promise<void>;\n  [Symbol.asyncDispose]?: () => Promise<void>;\n};\n\nexport interface WorkspaceBrowserBootstrap {\n  readonly kind: \"empty\" | \"cloneLocalProfile\";\n  readonly sourceUserDataDir?: string;\n  readonly sourceProfileDirectory?: string;\n}\n\nexport interface WorkspaceBrowserManifest {\n  readonly mode: \"persistent\";\n  readonly createdAt: number;\n  readonly updatedAt: number;\n  readonly userDataDir: \"browser/user-data\";\n  readonly bootstrap: WorkspaceBrowserBootstrap;\n}\n\nexport interface WorkspaceLiveBrowserRecord {\n  readonly mode: \"persistent\";\n  readonly ownership: \"owned\" | \"attached\";\n  readonly engine: OpensteerEngineName;\n  readonly endpoint?: string;\n  readonly baseUrl?: string;\n  readonly remoteDebuggingUrl?: string;\n  readonly sessionDir?: string;\n  readonly pid: number;\n  readonly startedAt: number;\n  readonly executablePath?: string;\n  readonly userDataDir: string;\n}\n\nexport interface OpensteerBrowserStatus {\n  readonly mode: \"temporary\" | \"persistent\" | \"attach\";\n  readonly engine: OpensteerEngineName;\n  readonly workspace?: string;\n  readonly live: boolean;\n}\n\nexport interface OpensteerBrowserManagerOptions {\n  readonly rootDir?: string;\n  readonly rootPath?: string;\n  readonly workspace?: string;\n  readonly engineName?: OpensteerEngineName;\n  readonly environment?: OpensteerEnvironment;\n  readonly browser?: OpensteerBrowserOptions;\n  readonly launch?: OpensteerBrowserLaunchOptions;\n  readonly context?: OpensteerBrowserContextOptions;\n}\n\nexport class OpensteerBrowserManager {\n  readonly mode: \"temporary\" | \"persistent\" | \"attach\";\n  readonly engineName: OpensteerEngineName;\n  readonly rootPath: string;\n  readonly workspace: string | undefined;\n  readonly cleanupRootOnDisconnect: boolean;\n\n  private readonly browserOptions: OpensteerAttachBrowserOptions | undefined;\n  private readonly launchOptions: OpensteerBrowserLaunchOptions | undefined;\n  private readonly contextOptions: OpensteerBrowserContextOptions | undefined;\n  private workspaceStore: FilesystemOpensteerWorkspace | undefined;\n\n  constructor(options: OpensteerBrowserManagerOptions = {}) {\n    this.workspace = normalizeWorkspace(options.workspace);\n    this.mode = resolveBrowserMode(this.workspace, options.browser);\n    this.browserOptions = isAttachBrowserOptions(options.browser) ? options.browser : undefined;\n    this.launchOptions = resolveLaunchOptions(options.launch, options.environment ?? process.env);\n    this.engineName = options.engineName ?? DEFAULT_OPENSTEER_ENGINE;\n    this.contextOptions = normalizeBrowserContextOptions(\n      options.context,\n      options.environment ?? process.env,\n      this.engineName,\n    );\n    assertSupportedEngineOptions({\n      engineName: this.engineName,\n      ...(options.browser === undefined ? {} : { browser: options.browser }),\n      ...(this.contextOptions === undefined ? {} : { context: this.contextOptions }),\n    });\n    this.rootPath =\n      options.rootPath ??\n      (this.workspace === undefined\n        ? path.join(tmpdir(), `${TEMPORARY_WORKSPACE_PREFIX}${randomUUID()}`)\n        : resolveFilesystemWorkspacePath({\n            rootDir: path.resolve(options.rootDir ?? process.cwd()),\n            workspace: this.workspace,\n          }));\n    this.cleanupRootOnDisconnect = this.workspace === undefined;\n  }\n\n  async createEngine(): Promise<DisposableBrowserCoreEngine> {\n    if (this.mode === \"persistent\") {\n      const effectiveEngine = (await this.resolveLivePersistentEngineName()) ?? this.engineName;\n      if (effectiveEngine === \"abp\") {\n        return this.createAbpEngine();\n      }\n      return this.createPersistentEngine();\n    }\n\n    if (this.engineName === \"abp\") {\n      return this.createAbpEngine();\n    }\n    if (this.mode === \"temporary\") {\n      return this.createTemporaryEngine();\n    }\n    if (this.mode === \"attach\") {\n      return this.createAttachEngine();\n    }\n    return this.createPersistentEngine();\n  }\n\n  async status(): Promise<OpensteerBrowserStatus> {\n    if (this.mode === \"temporary\") {\n      return {\n        mode: \"temporary\",\n        engine: this.engineName,\n        live: false,\n      };\n    }\n\n    const liveRecord = await this.readLivePersistentBrowser(await this.ensureWorkspaceStore());\n    return {\n      mode: liveRecord?.ownership === \"attached\" ? \"attach\" : this.mode,\n      engine: liveRecord?.engine ?? this.engineName,\n      ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n      live: liveRecord !== undefined,\n    };\n  }\n\n  async clonePersistentBrowser(input: {\n    readonly sourceUserDataDir: string;\n    readonly sourceProfileDirectory?: string;\n  }): Promise<WorkspaceBrowserManifest> {\n    this.requirePersistentMode(\"clone\");\n    const workspace = await this.ensureWorkspaceStore();\n    return workspace.lock(async () => {\n      await this.assertPersistentBrowserClosed(workspace);\n      await rm(workspace.browserPath, { recursive: true, force: true });\n      await ensureDirectory(workspace.browserUserDataDir);\n      await clearChromeSingletonEntries(workspace.browserUserDataDir);\n      await createBrowserProfileSnapshot({\n        sourceUserDataDir: input.sourceUserDataDir,\n        targetUserDataDir: workspace.browserUserDataDir,\n        ...(input.sourceProfileDirectory === undefined\n          ? {}\n          : { profileDirectory: input.sourceProfileDirectory }),\n        copyMode: \"full\",\n      });\n      const manifest: WorkspaceBrowserManifest = {\n        mode: \"persistent\",\n        createdAt: Date.now(),\n        updatedAt: Date.now(),\n        userDataDir: \"browser/user-data\",\n        bootstrap: {\n          kind: \"cloneLocalProfile\",\n          sourceUserDataDir: path.resolve(input.sourceUserDataDir),\n          ...(input.sourceProfileDirectory === undefined\n            ? {}\n            : { sourceProfileDirectory: input.sourceProfileDirectory }),\n        },\n      };\n      await writeJsonFileAtomic(workspace.browserManifestPath, manifest);\n      return manifest;\n    });\n  }\n\n  async reset(): Promise<void> {\n    this.requirePersistentMode(\"reset\");\n    const workspace = await this.ensureWorkspaceStore();\n    await workspace.lock(async () => {\n      await this.closePersistentBrowser(workspace);\n      await rm(resolveAbpSessionDir(workspace), { recursive: true, force: true });\n      await rm(workspace.browserPath, { recursive: true, force: true });\n      await clearPersistedSessionRecord(workspace.rootPath, \"local\");\n      await ensureDirectory(workspace.browserUserDataDir);\n    });\n  }\n\n  async delete(): Promise<void> {\n    this.requirePersistentMode(\"delete\");\n    const workspace = await this.ensureWorkspaceStore();\n    await workspace.lock(async () => {\n      await this.closePersistentBrowser(workspace);\n      await rm(resolveAbpSessionDir(workspace), { recursive: true, force: true });\n      await rm(workspace.browserPath, { recursive: true, force: true });\n      await clearPersistedSessionRecord(workspace.rootPath, \"local\");\n    });\n  }\n\n  async close(): Promise<void> {\n    if (this.mode !== \"persistent\") {\n      return;\n    }\n\n    const workspace = await this.ensureWorkspaceStore();\n    await workspace.lock(async () => {\n      await this.closePersistentBrowser(workspace);\n    });\n  }\n\n  private async createAbpEngine(): Promise<DisposableBrowserCoreEngine> {\n    if (this.mode === \"attach\") {\n      throw new Error(\n        'ABP engine does not support browser.mode=\"attach\". Use the Playwright engine for attach flows.',\n      );\n    }\n    if (this.mode === \"temporary\") {\n      return this.createTemporaryAbpEngine();\n    }\n    return this.createPersistentAbpEngine();\n  }\n\n  private async createTemporaryAbpEngine(): Promise<DisposableBrowserCoreEngine> {\n    const workspace = await this.ensureWorkspaceStore();\n    await clearChromeSingletonEntries(workspace.browserUserDataDir);\n    const { createAbpBrowserCoreEngine } = await loadAbpModule();\n    const launch = toAbpLaunchOptions({\n      ...(this.launchOptions === undefined ? {} : { launch: this.launchOptions }),\n      ...(this.contextOptions === undefined ? {} : { context: this.contextOptions }),\n      userDataDir: workspace.browserUserDataDir,\n      sessionDir: resolveAbpSessionDir(workspace),\n    });\n    return (await createAbpBrowserCoreEngine(\n      launch === undefined ? {} : { launch },\n    )) as DisposableBrowserCoreEngine;\n  }\n\n  private async createPersistentAbpEngine(): Promise<DisposableBrowserCoreEngine> {\n    const workspace = await this.ensureWorkspaceStore();\n    return workspace.lock(async () => {\n      const live = await this.readLivePersistentBrowser(workspace);\n      if (live !== undefined) {\n        if (live.engine !== \"abp\") {\n          throw new Error(\n            `workspace \"${this.workspace}\" already has a live ${live.engine} browser. Close it before reopening with engine \"abp\".`,\n          );\n        }\n        await bestEffortRegisterLocalViewSession({\n          rootPath: workspace.rootPath,\n          ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n          live: toPersistedLocalBrowserSessionRecord(this.workspace, live),\n          ownership: \"owned\",\n        });\n        return this.createAdoptedAbpEngine(live);\n      }\n\n      await this.ensurePersistentBrowserManifest(workspace);\n      await clearChromeSingletonEntries(workspace.browserUserDataDir);\n      const { launchAbpProcess } = await loadAbpModule();\n      const launch = toAbpLaunchOptions({\n        ...(this.launchOptions === undefined ? {} : { launch: this.launchOptions }),\n        ...(this.contextOptions === undefined ? {} : { context: this.contextOptions }),\n        userDataDir: workspace.browserUserDataDir,\n        sessionDir: resolveAbpSessionDir(workspace),\n      });\n      const launched = await launchAbpProcess({\n        port: await allocateEphemeralPort(),\n        userDataDir: workspace.browserUserDataDir,\n        sessionDir: resolveAbpSessionDir(workspace),\n        headless: launch?.headless ?? true,\n        args: launch?.args ?? [],\n        verbose: false,\n        ...(launch?.browserExecutablePath === undefined\n          ? {}\n          : { browserExecutablePath: launch.browserExecutablePath }),\n      });\n      const liveRecord: WorkspaceLiveBrowserRecord = {\n        mode: \"persistent\",\n        ownership: \"owned\",\n        engine: \"abp\",\n        baseUrl: launched.baseUrl,\n        remoteDebuggingUrl: launched.remoteDebuggingUrl,\n        pid: launched.process.pid ?? 0,\n        startedAt: Date.now(),\n        userDataDir: workspace.browserUserDataDir,\n        sessionDir: resolveAbpSessionDir(workspace),\n        ...(launch?.browserExecutablePath === undefined\n          ? {}\n          : { executablePath: launch.browserExecutablePath }),\n      };\n      await this.writeLivePersistentBrowser(workspace, liveRecord);\n      const persistedLiveRecord = toPersistedLocalBrowserSessionRecord(this.workspace, liveRecord);\n      await bestEffortRegisterLocalViewSession({\n        rootPath: workspace.rootPath,\n        ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n        live: persistedLiveRecord,\n        ownership: \"owned\",\n      });\n\n      try {\n        return await this.createAdoptedAbpEngine(liveRecord);\n      } catch (error) {\n        await this.unregisterLocalViewSessionForRecord(workspace.rootPath, persistedLiveRecord);\n        await terminateProcess(launched.process.pid ?? 0).catch(() => undefined);\n        await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n        throw error;\n      }\n    });\n  }\n\n  private async createAdoptedAbpEngine(\n    live: WorkspaceLiveBrowserRecord,\n  ): Promise<DisposableBrowserCoreEngine> {\n    if (live.baseUrl === undefined || live.remoteDebuggingUrl === undefined) {\n      throw new Error(\"workspace live browser record is missing ABP connection metadata.\");\n    }\n\n    const { createAbpBrowserCoreEngine } = await loadAbpModule();\n    return (await createAbpBrowserCoreEngine({\n      browser: {\n        baseUrl: live.baseUrl,\n        remoteDebuggingUrl: live.remoteDebuggingUrl,\n      },\n    })) as DisposableBrowserCoreEngine;\n  }\n\n  private async createTemporaryEngine(): Promise<DisposableBrowserCoreEngine> {\n    const userDataDir = await mkdtemp(path.join(tmpdir(), \"opensteer-temporary-browser-\"));\n    await clearChromeSingletonEntries(userDataDir);\n    const launched = await launchOwnedBrowser({\n      userDataDir,\n      cleanupUserDataDir: userDataDir,\n      ...(this.launchOptions === undefined ? {} : { launch: this.launchOptions }),\n      ...(this.contextOptions?.viewport === undefined\n        ? {}\n        : { viewport: this.contextOptions.viewport }),\n    });\n    const temporaryLiveRecord: PersistedLocalBrowserSessionRecord = {\n      layout: \"opensteer-session\",\n      version: 1,\n      provider: \"local\",\n      engine: \"playwright\",\n      endpoint: launched.endpoint,\n      pid: launched.pid,\n      startedAt: Date.now(),\n      updatedAt: Date.now(),\n      executablePath: launched.executablePath,\n      userDataDir,\n    };\n    await writePersistedSessionRecord(this.rootPath, temporaryLiveRecord);\n    const localViewManifest = await bestEffortRegisterLocalViewSession({\n      rootPath: this.rootPath,\n      live: temporaryLiveRecord,\n      ownership: \"owned\",\n    });\n    try {\n      return await this.createAttachedEngine({\n        endpoint: launched.endpoint,\n        freshTab: false,\n        onDispose: async () => {\n          await bestEffortUnregisterLocalViewSession(localViewManifest?.sessionId);\n          await clearPersistedSessionRecord(this.rootPath, \"local\").catch(() => undefined);\n          await terminateProcess(launched.pid).catch(() => undefined);\n          await rm(userDataDir, { recursive: true, force: true }).catch(() => undefined);\n        },\n      });\n    } catch (error) {\n      await bestEffortUnregisterLocalViewSession(localViewManifest?.sessionId);\n      await clearPersistedSessionRecord(this.rootPath, \"local\").catch(() => undefined);\n      await terminateProcess(launched.pid).catch(() => undefined);\n      await rm(userDataDir, { recursive: true, force: true }).catch(() => undefined);\n      throw error;\n    }\n  }\n\n  private async createAttachEngine(): Promise<DisposableBrowserCoreEngine> {\n    const endpoint = await resolveAttachEndpoint(this.browserOptions);\n    if (this.workspace === undefined) {\n      return this.createAttachedEngine({\n        endpoint,\n        ...(this.browserOptions?.headers === undefined\n          ? {}\n          : { headers: this.browserOptions.headers }),\n        freshTab: this.browserOptions?.freshTab ?? true,\n        onDispose: async () => undefined,\n      });\n    }\n\n    const workspace = await this.ensureWorkspaceStore();\n    return workspace.lock(async () => {\n      const live = await this.readLivePersistentBrowser(workspace);\n      if (live) {\n        if (live.engine !== \"playwright\") {\n          throw new Error(\n            `workspace \"${this.workspace}\" already has a live ${live.engine} browser. Close it before attaching a Playwright browser.`,\n          );\n        }\n        if (live.ownership !== \"attached\") {\n          throw new Error(\n            `workspace \"${this.workspace}\" already has a live Opensteer-owned browser. Close it before attaching another browser.`,\n          );\n        }\n        if (live.endpoint === undefined) {\n          throw new Error(\"workspace live browser record is missing a DevTools endpoint.\");\n        }\n        if (live.endpoint !== endpoint) {\n          throw new Error(\n            `workspace \"${this.workspace}\" is already attached to a different browser endpoint. Close it before reattaching.`,\n          );\n        }\n        await bestEffortRegisterLocalViewSession({\n          rootPath: workspace.rootPath,\n          ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n          live: toPersistedLocalBrowserSessionRecord(this.workspace, live),\n          ownership: \"attached\",\n        });\n        return this.createAttachedEngine({\n          endpoint: live.endpoint,\n          ...(this.browserOptions?.headers === undefined\n            ? {}\n            : { headers: this.browserOptions.headers }),\n          freshTab: this.browserOptions?.freshTab ?? true,\n          onDispose: async () => undefined,\n        });\n      }\n\n      const liveRecord: WorkspaceLiveBrowserRecord = {\n        mode: \"persistent\",\n        ownership: \"attached\",\n        engine: \"playwright\",\n        endpoint,\n        pid: 0,\n        startedAt: Date.now(),\n        userDataDir: workspace.browserUserDataDir,\n      };\n      await this.writeLivePersistentBrowser(workspace, liveRecord);\n      const persistedLiveRecord = toPersistedLocalBrowserSessionRecord(this.workspace, liveRecord);\n      await bestEffortRegisterLocalViewSession({\n        rootPath: workspace.rootPath,\n        ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n        live: persistedLiveRecord,\n        ownership: \"attached\",\n      });\n\n      try {\n        return await this.createAttachedEngine({\n          endpoint,\n          ...(this.browserOptions?.headers === undefined\n            ? {}\n            : { headers: this.browserOptions.headers }),\n          freshTab: this.browserOptions?.freshTab ?? true,\n          onDispose: async () => undefined,\n        });\n      } catch (error) {\n        await this.unregisterLocalViewSessionForRecord(workspace.rootPath, persistedLiveRecord);\n        await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n        throw error;\n      }\n    });\n  }\n\n  private async createPersistentEngine(): Promise<DisposableBrowserCoreEngine> {\n    const workspace = await this.ensureWorkspaceStore();\n    return workspace.lock(async () => {\n      const live = await this.readLivePersistentBrowser(workspace);\n      if (live) {\n        if (live.engine !== \"playwright\") {\n          throw new Error(\n            `workspace \"${this.workspace}\" already has a live ${live.engine} browser. Close it before reopening with engine \"playwright\".`,\n          );\n        }\n        if (live.endpoint === undefined) {\n          throw new Error(\"workspace live browser record is missing a DevTools endpoint.\");\n        }\n        await bestEffortRegisterLocalViewSession({\n          rootPath: workspace.rootPath,\n          ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n          live: toPersistedLocalBrowserSessionRecord(this.workspace, live),\n          ownership: live.ownership,\n        });\n        return this.createAttachedEngine({\n          endpoint: live.endpoint,\n          freshTab: false,\n          onDispose: async () => undefined,\n        });\n      }\n\n      await this.ensurePersistentBrowserManifest(workspace);\n      const launched = await launchOwnedBrowser({\n        userDataDir: workspace.browserUserDataDir,\n        ...(this.launchOptions === undefined ? {} : { launch: this.launchOptions }),\n        ...(this.contextOptions?.viewport === undefined\n          ? {}\n          : { viewport: this.contextOptions.viewport }),\n      });\n      const liveRecord: WorkspaceLiveBrowserRecord = {\n        mode: \"persistent\",\n        ownership: \"owned\",\n        engine: \"playwright\",\n        endpoint: launched.endpoint,\n        pid: launched.pid,\n        startedAt: Date.now(),\n        executablePath: launched.executablePath,\n        userDataDir: workspace.browserUserDataDir,\n      };\n      await this.writeLivePersistentBrowser(workspace, liveRecord);\n      const persistedLiveRecord = toPersistedLocalBrowserSessionRecord(this.workspace, liveRecord);\n      await bestEffortRegisterLocalViewSession({\n        rootPath: workspace.rootPath,\n        ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n        live: persistedLiveRecord,\n        ownership: \"owned\",\n      });\n\n      try {\n        return await this.createAttachedEngine({\n          endpoint: launched.endpoint,\n          freshTab: false,\n          onDispose: async () => undefined,\n        });\n      } catch (error) {\n        await this.unregisterLocalViewSessionForRecord(workspace.rootPath, persistedLiveRecord);\n        await terminateProcess(launched.pid).catch(() => undefined);\n        await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n        throw error;\n      }\n    });\n  }\n\n  private async createAttachedEngine(input: {\n    readonly endpoint: string;\n    readonly headers?: Readonly<Record<string, string>>;\n    readonly freshTab: boolean;\n    readonly onDispose: () => Promise<void>;\n  }): Promise<DisposableBrowserCoreEngine> {\n    const browser = await connectPlaywrightChromiumBrowser({\n      url: input.endpoint,\n      ...(input.headers === undefined ? {} : { headers: input.headers }),\n    });\n    try {\n      const context = browser.contexts()[0];\n      if (!context) {\n        throw new Error(\"Connected browser did not expose a Chromium browser context.\");\n      }\n\n      const page =\n        input.freshTab || context.pages()[0] === undefined\n          ? await context.newPage()\n          : context.pages()[0]!;\n      await page.bringToFront?.();\n\n      const stealthProfile = resolveStealthProfile(this.contextOptions?.stealthProfile);\n      await injectBrowserStealthScripts(\n        context as Parameters<typeof injectBrowserStealthScripts>[0],\n        stealthProfile === undefined\n          ? {}\n          : {\n              profile: stealthProfile,\n              page: page as ConnectedCdpPage,\n            },\n      );\n\n      const engine = (await createPlaywrightBrowserCoreEngine({\n        browser: browser as never,\n        attachedContext: context,\n        attachedPage: page,\n        closeAttachedContextOnSessionClose: false,\n        closeBrowserOnDispose: false,\n        ...(this.contextOptions === undefined\n          ? {}\n          : { context: toEngineBrowserContextOptions(this.contextOptions) }),\n      })) as DisposableBrowserCoreEngine;\n\n      const originalDispose = engine.dispose?.bind(engine);\n      const originalAsyncDispose = engine[Symbol.asyncDispose]?.bind(engine);\n      let disposed = false;\n      const disposeConnection = async () => {\n        if (disposed) {\n          return;\n        }\n        disposed = true;\n        try {\n          await originalDispose?.();\n        } finally {\n          await disconnectPlaywrightChromiumBrowser(browser).catch(() => undefined);\n          await input.onDispose().catch(() => undefined);\n        }\n      };\n\n      engine.dispose = disposeConnection;\n      engine[Symbol.asyncDispose] = async () => {\n        if (disposed) {\n          return;\n        }\n        disposed = true;\n        try {\n          await originalAsyncDispose?.();\n        } finally {\n          await disconnectPlaywrightChromiumBrowser(browser).catch(() => undefined);\n          await input.onDispose().catch(() => undefined);\n        }\n      };\n      return engine;\n    } catch (error) {\n      await disconnectPlaywrightChromiumBrowser(browser).catch(() => undefined);\n      throw error;\n    }\n  }\n\n  private async ensureWorkspaceStore(): Promise<FilesystemOpensteerWorkspace> {\n    this.workspaceStore ??= await createFilesystemOpensteerWorkspace({\n      rootPath: this.rootPath,\n      ...(this.workspace === undefined ? {} : { workspace: this.workspace }),\n      scope: this.workspace === undefined ? \"temporary\" : \"workspace\",\n    });\n    return this.workspaceStore;\n  }\n\n  private async ensurePersistentBrowserManifest(\n    workspace: FilesystemOpensteerWorkspace,\n  ): Promise<WorkspaceBrowserManifest> {\n    const existing = await this.readBrowserManifest(workspace);\n    if (existing) {\n      return existing;\n    }\n\n    const now = Date.now();\n    const manifest: WorkspaceBrowserManifest = {\n      mode: \"persistent\",\n      createdAt: now,\n      updatedAt: now,\n      userDataDir: \"browser/user-data\",\n      bootstrap: {\n        kind: \"empty\",\n      },\n    };\n    await ensureDirectory(workspace.browserUserDataDir);\n    await writeJsonFileAtomic(workspace.browserManifestPath, manifest);\n    return manifest;\n  }\n\n  private async readBrowserManifest(\n    workspace: FilesystemOpensteerWorkspace,\n  ): Promise<WorkspaceBrowserManifest | undefined> {\n    if (!(await pathExists(workspace.browserManifestPath))) {\n      return undefined;\n    }\n    return readJsonFile<WorkspaceBrowserManifest>(workspace.browserManifestPath);\n  }\n\n  private async readLivePersistentBrowser(\n    workspace: FilesystemOpensteerWorkspace,\n  ): Promise<WorkspaceLiveBrowserRecord | undefined> {\n    const live = await this.readStoredLiveBrowser(workspace);\n    if (live === undefined) {\n      return undefined;\n    }\n    if (live.ownership === \"attached\") {\n      const attachedRecord = toPersistedLocalBrowserSessionRecord(this.workspace, live);\n      if (!(await isAttachedLocalBrowserSessionReachable(attachedRecord))) {\n        await this.unregisterLocalViewSessionForRecord(workspace.rootPath, attachedRecord);\n        await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n        return undefined;\n      }\n      return live;\n    }\n    if (!isProcessRunning(live.pid)) {\n      await this.unregisterLocalViewSessionForRecord(\n        workspace.rootPath,\n        toPersistedLocalBrowserSessionRecord(this.workspace, live),\n      );\n      await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n      return undefined;\n    }\n    if (live.engine === \"playwright\") {\n      if (live.endpoint === undefined || !(await isEndpointReachable(live.endpoint))) {\n        throw new Error(\n          `workspace \"${this.workspace}\" browser process ${String(live.pid)} is still running, but its DevTools endpoint is unavailable`,\n        );\n      }\n      return live;\n    }\n\n    if (live.baseUrl === undefined || !(await isAbpBaseUrlReachable(live.baseUrl))) {\n      throw new Error(\n        `workspace \"${this.workspace}\" browser process ${String(live.pid)} is still running, but its ABP endpoint is unavailable`,\n      );\n    }\n    return live;\n  }\n\n  private async readStoredLiveBrowser(\n    workspace: FilesystemOpensteerWorkspace,\n  ): Promise<WorkspaceLiveBrowserRecord | undefined> {\n    const live = await readPersistedLocalBrowserSessionRecord(workspace.rootPath);\n    return live === undefined ? undefined : toWorkspaceLiveBrowserRecord(live);\n  }\n\n  private async resolveLivePersistentEngineName(): Promise<OpensteerEngineName | undefined> {\n    if (this.mode !== \"persistent\") {\n      return undefined;\n    }\n\n    const workspace = await this.ensureWorkspaceStore();\n    const live = await this.readStoredLiveBrowser(workspace);\n    return live?.engine;\n  }\n\n  private async assertPersistentBrowserClosed(\n    workspace: FilesystemOpensteerWorkspace,\n  ): Promise<void> {\n    if ((await this.readLivePersistentBrowser(workspace)) !== undefined) {\n      throw new Error(\n        `workspace \"${this.workspace}\" already has a live browser. Close it before changing the saved profile.`,\n      );\n    }\n  }\n\n  private async closePersistentBrowser(workspace: FilesystemOpensteerWorkspace): Promise<void> {\n    const live = await this.readStoredLiveBrowser(workspace);\n    if (!live) {\n      await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n      return;\n    }\n    await this.unregisterLocalViewSessionForRecord(\n      workspace.rootPath,\n      toPersistedLocalBrowserSessionRecord(this.workspace, live),\n    );\n\n    if (live.ownership === \"attached\") {\n      await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n      return;\n    }\n\n    if (live.engine === \"playwright\") {\n      if (live.endpoint !== undefined) {\n        await requestBrowserClose(live.endpoint).catch(() => undefined);\n      }\n      if (await waitForProcessExit(live.pid, BROWSER_CLOSE_TIMEOUT_MS)) {\n        await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n        return;\n      }\n      await terminateProcess(live.pid).catch(() => undefined);\n      await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n      return;\n    }\n\n    await terminateProcess(live.pid).catch(() => undefined);\n    await clearPersistedSessionRecord(workspace.rootPath, \"local\").catch(() => undefined);\n  }\n\n  private async writeLivePersistentBrowser(\n    workspace: FilesystemOpensteerWorkspace,\n    live: WorkspaceLiveBrowserRecord,\n  ): Promise<void> {\n    await writePersistedSessionRecord(\n      workspace.rootPath,\n      toPersistedLocalBrowserSessionRecord(this.workspace, live),\n    );\n  }\n\n  private requirePersistentMode(method: \"clone\" | \"reset\" | \"delete\"): void {\n    if (this.mode !== \"persistent\" || this.workspace === undefined) {\n      throw new Error(`browser.${method}() requires a persistent workspace browser.`);\n    }\n  }\n\n  private async unregisterLocalViewSessionForRecord(\n    rootPath: string,\n    record: PersistedLocalBrowserSessionRecord,\n  ): Promise<void> {\n    await bestEffortUnregisterLocalViewSession(\n      getPersistedLocalBrowserSessionOwnership(record) === \"attached\"\n        ? buildLocalViewSessionId({\n            rootPath,\n            startedAt: record.startedAt,\n            ownership: \"attached\",\n            ...(record.endpoint === undefined ? {} : { endpoint: record.endpoint }),\n            ...(record.baseUrl === undefined ? {} : { baseUrl: record.baseUrl }),\n            ...(record.remoteDebuggingUrl === undefined\n              ? {}\n              : { remoteDebuggingUrl: record.remoteDebuggingUrl }),\n          })\n        : buildLocalViewSessionId({\n            rootPath,\n            startedAt: record.startedAt,\n            ownership: \"owned\",\n            pid: record.pid,\n          }),\n    );\n  }\n}\n\nfunction normalizeWorkspace(workspace: string | undefined): string | undefined {\n  const normalized = workspace?.trim();\n  return normalized === undefined || normalized.length === 0 ? undefined : normalized;\n}\n\nfunction resolveLaunchOptions(\n  launch: OpensteerBrowserLaunchOptions | undefined,\n  environment: OpensteerEnvironment,\n): OpensteerBrowserLaunchOptions | undefined {\n  if (launch?.executablePath !== undefined) {\n    return launch;\n  }\n\n  const executablePath = normalizeConfiguredExecutablePath(environment.OPENSTEER_EXECUTABLE_PATH);\n  if (executablePath === undefined) {\n    return launch;\n  }\n\n  return {\n    ...(launch ?? {}),\n    executablePath,\n  };\n}\n\nfunction normalizeConfiguredExecutablePath(value: string | undefined): string | undefined {\n  if (value === undefined) {\n    return undefined;\n  }\n  const trimmed = value.trim();\n  return trimmed.length === 0 ? undefined : trimmed;\n}\n\nfunction toPersistedLocalBrowserSessionRecord(\n  workspace: string | undefined,\n  live: WorkspaceLiveBrowserRecord,\n): PersistedLocalBrowserSessionRecord {\n  return {\n    layout: \"opensteer-session\",\n    version: 1,\n    provider: \"local\",\n    ...(workspace === undefined ? {} : { workspace }),\n    ownership: live.ownership,\n    engine: live.engine,\n    ...(live.endpoint === undefined ? {} : { endpoint: live.endpoint }),\n    ...(live.baseUrl === undefined ? {} : { baseUrl: live.baseUrl }),\n    ...(live.remoteDebuggingUrl === undefined\n      ? {}\n      : { remoteDebuggingUrl: live.remoteDebuggingUrl }),\n    ...(live.sessionDir === undefined ? {} : { sessionDir: live.sessionDir }),\n    pid: live.pid,\n    startedAt: live.startedAt,\n    updatedAt: Date.now(),\n    ...(live.executablePath === undefined ? {} : { executablePath: live.executablePath }),\n    userDataDir: live.userDataDir,\n  };\n}\n\nfunction toWorkspaceLiveBrowserRecord(\n  record: PersistedLocalBrowserSessionRecord,\n): WorkspaceLiveBrowserRecord {\n  return {\n    mode: \"persistent\",\n    ownership: getPersistedLocalBrowserSessionOwnership(record),\n    engine: record.engine,\n    ...(record.endpoint === undefined ? {} : { endpoint: record.endpoint }),\n    ...(record.baseUrl === undefined ? {} : { baseUrl: record.baseUrl }),\n    ...(record.remoteDebuggingUrl === undefined\n      ? {}\n      : { remoteDebuggingUrl: record.remoteDebuggingUrl }),\n    ...(record.sessionDir === undefined ? {} : { sessionDir: record.sessionDir }),\n    pid: record.pid,\n    startedAt: record.startedAt,\n    ...(record.executablePath === undefined ? {} : { executablePath: record.executablePath }),\n    userDataDir: record.userDataDir,\n  };\n}\n\nfunction resolveBrowserMode(\n  workspace: string | undefined,\n  browser: OpensteerBrowserOptions | undefined,\n): \"temporary\" | \"persistent\" | \"attach\" {\n  if (browser === undefined) {\n    return workspace === undefined ? \"temporary\" : \"persistent\";\n  }\n  if (browser === \"temporary\" || browser === \"persistent\") {\n    return browser;\n  }\n  return \"attach\";\n}\n\nfunction isAttachBrowserOptions(\n  browser: OpensteerBrowserOptions | undefined,\n): browser is OpensteerAttachBrowserOptions {\n  return typeof browser === \"object\" && browser !== null && browser.mode === \"attach\";\n}\n\nasync function resolveAttachEndpoint(\n  browser: OpensteerAttachBrowserOptions | undefined,\n): Promise<string> {\n  const endpoint = browser?.endpoint?.trim();\n  if (endpoint && endpoint.length > 0) {\n    const inspected = await inspectCdpEndpoint({\n      endpoint,\n      ...(browser?.headers === undefined ? {} : { headers: browser.headers }),\n      timeoutMs: DEFAULT_TIMEOUT_MS,\n    });\n    return inspected.endpoint;\n  }\n  const selection = await selectAttachBrowserCandidate({\n    timeoutMs: DEFAULT_TIMEOUT_MS,\n  });\n  return selection.endpoint;\n}\n\nasync function launchOwnedBrowser(input: {\n  readonly userDataDir: string;\n  readonly cleanupUserDataDir?: string;\n  readonly launch?: OpensteerBrowserLaunchOptions;\n  readonly viewport?: { readonly width: number; readonly height: number } | null;\n}): Promise<{\n  readonly endpoint: string;\n  readonly pid: number;\n  readonly executablePath: string;\n}> {\n  await ensureDirectory(input.userDataDir);\n  await clearChromeSingletonEntries(input.userDataDir);\n  await sanitizeChromeProfile(input.userDataDir);\n\n  const requestedRemoteDebuggingPort = readRequestedRemoteDebuggingPort(input.launch?.args);\n  const executablePath = resolveChromeExecutablePath(input.launch?.executablePath);\n  const args = buildChromeArgs(\n    input.userDataDir,\n    input.launch,\n    input.viewport,\n    requestedRemoteDebuggingPort,\n  );\n  const child = spawn(executablePath, args, {\n    stdio: [\"ignore\", \"ignore\", \"pipe\"],\n    detached: process.platform !== \"win32\",\n  });\n\n  child.unref();\n  const stderrLines: string[] = [];\n  child.stderr?.setEncoding(\"utf8\");\n  child.stderr?.on(\"data\", (chunk) => {\n    stderrLines.push(String(chunk));\n  });\n  (\n    child.stderr as\n      | (NodeJS.ReadableStream & {\n          unref?: () => void;\n        })\n      | undefined\n  )?.unref?.();\n\n  const endpoint = await waitForDevToolsEndpoint({\n    userDataDir: input.userDataDir,\n    timeoutMs: input.launch?.timeoutMs ?? DEFAULT_TIMEOUT_MS,\n    childExited: async () => child.exitCode,\n    stderrLines,\n    ...(requestedRemoteDebuggingPort !== undefined && requestedRemoteDebuggingPort > 0\n      ? { requestedRemoteDebuggingPort }\n      : {}),\n  }).catch(async (error) => {\n    child.kill(\"SIGKILL\");\n    throw error;\n  });\n\n  return {\n    endpoint,\n    pid: child.pid ?? 0,\n    executablePath,\n  };\n}\n\nfunction buildChromeArgs(\n  userDataDir: string,\n  launch: OpensteerBrowserLaunchOptions | undefined,\n  viewport?: { readonly width: number; readonly height: number } | null,\n  requestedRemoteDebuggingPort?: number,\n): readonly string[] {\n  const isHeadless = launch?.headless ?? true;\n\n  // Headful mode: minimal flags to avoid creating detectable behavioral\n  // differences vs. a normal user-launched Chrome.  Every extra --disable-*\n  // flag changes Chrome's runtime behaviour in ways bot-detection systems\n  // can fingerprint (missing SafeBrowsing requests, popups never blocked,\n  // background networking absent, etc.).\n  //\n  // Headless mode: keep the full convenience set because the browser is not\n  // visible to the user and the extra flags improve stability.\n  const args = isHeadless\n    ? [\n        ...(requestedRemoteDebuggingPort === undefined ? [\"--remote-debugging-port=0\"] : []),\n        \"--no-first-run\",\n        \"--no-default-browser-check\",\n        \"--disable-blink-features=AutomationControlled\",\n        \"--disable-background-networking\",\n        \"--disable-backgrounding-occluded-windows\",\n        \"--disable-component-update\",\n        \"--disable-default-apps\",\n        \"--disable-hang-monitor\",\n        \"--disable-popup-blocking\",\n        \"--disable-prompt-on-repost\",\n        \"--disable-sync\",\n        \"--disable-infobars\",\n        \"--disable-features=Translate\",\n        \"--enable-features=NetworkService,NetworkServiceInProcess\",\n        \"--password-store=basic\",\n        \"--use-mock-keychain\",\n        `--user-data-dir=${userDataDir}`,\n      ]\n    : [\n        ...(requestedRemoteDebuggingPort === undefined ? [\"--remote-debugging-port=0\"] : []),\n        \"--no-first-run\",\n        \"--no-default-browser-check\",\n        \"--disable-blink-features=AutomationControlled\",\n        `--user-data-dir=${userDataDir}`,\n      ];\n\n  if (isHeadless) {\n    args.push(\"--headless=new\");\n  }\n\n  // Always set --window-size to match the intended viewport so Chrome starts\n  // with correct dimensions.  In headful mode add padding for Chrome UI\n  // (title bar + tab strip + toolbar ≈ 150 px).\n  const hasUserWindowSize = (launch?.args ?? []).some((entry) => entry.startsWith(\"--window-size\"));\n  if (!hasUserWindowSize) {\n    const width = viewport?.width ?? 1440;\n    const height = viewport?.height ?? 900;\n    args.push(\n      isHeadless\n        ? `--window-size=${String(width)},${String(height)}`\n        : `--window-size=${String(width)},${String(height + 150)}`,\n    );\n  }\n\n  args.push(...(launch?.args ?? []));\n  if (!(launch?.args ?? []).some((entry) => !entry.startsWith(\"-\"))) {\n    args.push(\"about:blank\");\n  }\n  return args;\n}\n\nasync function waitForDevToolsEndpoint(input: {\n  readonly userDataDir: string;\n  readonly timeoutMs: number;\n  readonly childExited: () => Promise<number | null>;\n  readonly stderrLines: readonly string[];\n  readonly requestedRemoteDebuggingPort?: number;\n}): Promise<string> {\n  const deadline = Date.now() + input.timeoutMs;\n  while (Date.now() < deadline) {\n    const activePort = readDevToolsActivePort(input.userDataDir);\n    if (activePort) {\n      try {\n        const inspected = await inspectCdpEndpoint({\n          endpoint: `http://127.0.0.1:${String(activePort.port)}`,\n          timeoutMs: Math.min(2_000, input.timeoutMs),\n        });\n        return inspected.endpoint;\n      } catch {\n        return `ws://127.0.0.1:${String(activePort.port)}${activePort.webSocketPath}`;\n      }\n    }\n\n    if (input.requestedRemoteDebuggingPort !== undefined) {\n      const endpoint = await tryInspectRemoteDebuggingPort(\n        input.requestedRemoteDebuggingPort,\n        input.timeoutMs,\n      );\n      if (endpoint !== undefined) {\n        return endpoint;\n      }\n    }\n\n    const exitCode = await input.childExited();\n    if (exitCode !== null) {\n      throw new Error(formatChromeLaunchError(input.stderrLines));\n    }\n\n    await sleep(DEVTOOLS_POLL_INTERVAL_MS);\n  }\n\n  throw new Error(formatChromeLaunchError(input.stderrLines));\n}\n\nfunction readRequestedRemoteDebuggingPort(args: readonly string[] | undefined): number | undefined {\n  if (args === undefined || args.length === 0) {\n    return undefined;\n  }\n\n  let explicitFlagFound = false;\n  let port: number | undefined;\n  for (let index = 0; index < args.length; index += 1) {\n    const entry = args[index]!;\n    if (entry === \"--remote-debugging-port\") {\n      explicitFlagFound = true;\n      const next = args[index + 1];\n      if (next !== undefined) {\n        port = parseRemoteDebuggingPort(next);\n        index += 1;\n      }\n      continue;\n    }\n\n    if (entry.startsWith(\"--remote-debugging-port=\")) {\n      explicitFlagFound = true;\n      port = parseRemoteDebuggingPort(entry.slice(\"--remote-debugging-port=\".length));\n    }\n  }\n\n  return explicitFlagFound ? port : undefined;\n}\n\nfunction parseRemoteDebuggingPort(value: string): number | undefined {\n  const trimmed = value.trim();\n  if (!/^\\d+$/.test(trimmed)) {\n    return undefined;\n  }\n\n  const parsed = Number.parseInt(trimmed, 10);\n  if (!Number.isInteger(parsed) || parsed < 0) {\n    return undefined;\n  }\n  return parsed;\n}\n\nasync function tryInspectRemoteDebuggingPort(\n  port: number,\n  timeoutMs: number,\n): Promise<string | undefined> {\n  try {\n    const inspected = await inspectCdpEndpoint({\n      endpoint: `http://127.0.0.1:${String(port)}`,\n      timeoutMs: Math.min(2_000, timeoutMs),\n    });\n    return inspected.endpoint;\n  } catch {\n    return undefined;\n  }\n}\n\nfunction formatChromeLaunchError(stderrLines: readonly string[]): string {\n  const collapsed = stderrLines\n    .join(\"\")\n    .split(/\\r?\\n/)\n    .map((line) => line.trim())\n    .filter((line) => line.length > 0);\n  if (collapsed.length === 0) {\n    return \"Chrome failed to launch before exposing a DevTools endpoint.\";\n  }\n  return `Chrome failed to launch before exposing a DevTools endpoint.\\n${collapsed.slice(-5).join(\"\\n\")}`;\n}\n\nasync function isEndpointReachable(endpoint: string): Promise<boolean> {\n  try {\n    await inspectCdpEndpoint({\n      endpoint,\n      timeoutMs: 1_500,\n    });\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nasync function isAbpBaseUrlReachable(baseUrl: string): Promise<boolean> {\n  try {\n    const response = await fetch(`${baseUrl}/browser/status`, {\n      signal: AbortSignal.timeout(1_500),\n    });\n    return response.ok;\n  } catch {\n    return false;\n  }\n}\n\nasync function terminateProcess(pid: number): Promise<void> {\n  if (!Number.isInteger(pid) || pid <= 0) {\n    return;\n  }\n\n  try {\n    process.kill(pid, \"SIGTERM\");\n  } catch {\n    return;\n  }\n\n  if (await waitForProcessExit(pid, BROWSER_CLOSE_TIMEOUT_MS)) {\n    return;\n  }\n\n  try {\n    process.kill(pid, \"SIGKILL\");\n  } catch {\n    return;\n  }\n}\n\nasync function requestBrowserClose(endpoint: string): Promise<void> {\n  await new Promise<void>((resolve, reject) => {\n    const socket = new WebSocket(endpoint);\n    const timeout = setTimeout(() => {\n      socket.close();\n      reject(new Error(\"Timed out waiting for Browser.close.\"));\n    }, BROWSER_CLOSE_TIMEOUT_MS);\n    let settled = false;\n\n    const finish = (error?: Error) => {\n      if (settled) {\n        return;\n      }\n      settled = true;\n      clearTimeout(timeout);\n      if (error) {\n        reject(error);\n        return;\n      }\n      resolve();\n    };\n\n    socket.addEventListener(\"open\", () => {\n      socket.send(JSON.stringify({ id: 1, method: \"Browser.close\" }));\n    });\n\n    socket.addEventListener(\"message\", (event) => {\n      try {\n        const message = JSON.parse(String(event.data)) as {\n          readonly id?: number;\n          readonly error?: { readonly message?: string };\n        };\n        if (message.id !== 1) {\n          return;\n        }\n        finish(message.error?.message === undefined ? undefined : new Error(message.error.message));\n      } catch (error) {\n        finish(error instanceof Error ? error : new Error(String(error)));\n      }\n    });\n\n    socket.addEventListener(\"close\", () => {\n      finish();\n    });\n\n    socket.addEventListener(\"error\", () => {\n      finish(new Error(\"Failed to send Browser.close.\"));\n    });\n  });\n}\n\nasync function waitForProcessExit(pid: number, timeoutMs: number): Promise<boolean> {\n  if (!Number.isInteger(pid) || pid <= 0) {\n    return true;\n  }\n\n  const deadline = Date.now() + timeoutMs;\n  while (Date.now() < deadline) {\n    if (!isProcessRunning(pid)) {\n      return true;\n    }\n    await sleep(50);\n  }\n\n  return !isProcessRunning(pid);\n}\n\nfunction resolveAbpSessionDir(workspace: FilesystemOpensteerWorkspace): string {\n  return path.join(workspace.livePath, \"abp-session\");\n}\n\nasync function allocateEphemeralPort(): Promise<number> {\n  const { allocatePort } = await loadAbpModule();\n  return allocatePort();\n}\n\nasync function loadAbpModule() {\n  try {\n    return await import(\"@opensteer/engine-abp\");\n  } catch (error) {\n    if (isMissingPackageError(error, \"@opensteer/engine-abp\")) {\n      throw new Error(\n        'ABP engine selected but \"@opensteer/engine-abp\" is not installed. Install it to use --engine abp or OPENSTEER_ENGINE=abp.',\n      );\n    }\n    throw error;\n  }\n}\n\nfunction isMissingPackageError(error: unknown, packageName: string): boolean {\n  if (!(error instanceof Error)) {\n    return false;\n  }\n\n  return (\n    error.message.includes(`Cannot find package '${packageName}'`) ||\n    error.message.includes(`Cannot find module '${packageName}'`) ||\n    error.message.includes(`Cannot find module \"${packageName}\"`)\n  );\n}\n\nfunction normalizeBrowserContextOptions(\n  context: OpensteerBrowserContextOptions | undefined,\n  environment?: OpensteerEnvironment,\n  engineName: OpensteerEngineName = DEFAULT_OPENSTEER_ENGINE,\n): OpensteerBrowserContextOptions | undefined {\n  const stealthProfile = resolveStealthProfile(context?.stealthProfile);\n  const locale = context?.locale ?? stealthProfile?.locale;\n  const timezoneId = context?.timezoneId ?? stealthProfile?.timezoneId;\n  const userAgent = context?.userAgent ?? stealthProfile?.userAgent;\n  const humanize =\n    engineName === \"abp\" && context?.humanize === undefined\n      ? undefined\n      : resolveHumanizeOption(context?.humanize, environment);\n  return {\n    ...(context ?? {}),\n    ...(stealthProfile === undefined ? {} : { stealthProfile }),\n    ...(locale === undefined ? {} : { locale }),\n    ...(timezoneId === undefined ? {} : { timezoneId }),\n    ...(userAgent === undefined ? {} : { userAgent }),\n    ...(humanize === undefined ? {} : { humanize }),\n    viewport: context?.viewport ??\n      stealthProfile?.viewport ?? {\n        width: 1440,\n        height: 900,\n      },\n  };\n}\n\nfunction resolveHumanizeOption(\n  explicit: OpensteerBrowserContextOptions[\"humanize\"],\n  environment?: OpensteerEnvironment,\n): boolean | import(\"@opensteer/protocol\").OpensteerHumanizeOptions | undefined {\n  if (explicit !== undefined) {\n    return explicit;\n  }\n  const envValue = environment?.OPENSTEER_HUMANIZE;\n  if (envValue !== undefined) {\n    const normalized = envValue.trim().toLowerCase();\n    return normalized !== \"false\" && normalized !== \"0\";\n  }\n  return undefined;\n}\n\nfunction toEngineBrowserContextOptions(\n  context: OpensteerBrowserContextOptions,\n): Omit<OpensteerBrowserContextOptions, \"stealthProfile\"> {\n  const { stealthProfile: _stealthProfile, ...engineContext } = context;\n  return engineContext;\n}\n\nfunction resolveStealthProfile(\n  input: OpensteerBrowserContextOptions[\"stealthProfile\"] | undefined,\n): StealthProfile | undefined {\n  if (input === undefined) {\n    return undefined;\n  }\n  if (isStealthProfile(input)) {\n    return input;\n  }\n  return generateStealthProfile(input);\n}\n\nfunction isStealthProfile(\n  input: NonNullable<OpensteerBrowserContextOptions[\"stealthProfile\"]>,\n): input is StealthProfile {\n  return (\n    input.id !== undefined &&\n    input.platform !== undefined &&\n    input.browserBrand !== undefined &&\n    input.browserVersion !== undefined &&\n    input.userAgent !== undefined &&\n    input.viewport !== undefined &&\n    input.screenResolution !== undefined &&\n    input.devicePixelRatio !== undefined &&\n    input.maxTouchPoints !== undefined &&\n    input.webglVendor !== undefined &&\n    input.webglRenderer !== undefined &&\n    input.fonts !== undefined &&\n    input.canvasNoiseSeed !== undefined &&\n    input.audioNoiseSeed !== undefined &&\n    input.locale !== undefined &&\n    input.timezoneId !== undefined\n  );\n}\n\nasync function sleep(ms: number): Promise<void> {\n  await new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import { readPersistedLocalBrowserSessionRecord } from \"../live-session.js\";\nimport { OpensteerBrowserManager } from \"../browser-manager.js\";\nimport {\n  deleteLocalViewSessionManifest,\n  readLocalViewSessionManifest,\n} from \"./session-manifest.js\";\n\nexport class LocalViewSessionCloseError extends Error {\n  constructor(\n    message: string,\n    readonly statusCode: 404 | 409,\n  ) {\n    super(message);\n    this.name = \"LocalViewSessionCloseError\";\n  }\n}\n\nexport async function closeLocalViewSessionBrowser(sessionId: string): Promise<void> {\n  const manifest = await readLocalViewSessionManifest(sessionId);\n  if (!manifest) {\n    throw new LocalViewSessionCloseError(\"Session not found.\", 404);\n  }\n\n  if (manifest.ownership !== \"owned\") {\n    throw new LocalViewSessionCloseError(\n      \"Only Opensteer-owned local browsers can be closed from the local view.\",\n      409,\n    );\n  }\n\n  const record = await readPersistedLocalBrowserSessionRecord(manifest.rootPath);\n  if (\n    !record ||\n    record.pid !== manifest.pid ||\n    record.startedAt !== manifest.startedAt ||\n    record.engine !== manifest.engine\n  ) {\n    await deleteLocalViewSessionManifest(sessionId).catch(() => undefined);\n    throw new LocalViewSessionCloseError(\"Session not found.\", 404);\n  }\n\n  const manager = new OpensteerBrowserManager({\n    rootPath: manifest.rootPath,\n    ...(manifest.workspace === undefined ? {} : { workspace: manifest.workspace }),\n    engineName: record.engine,\n    browser: \"persistent\",\n  });\n  await manager.close();\n}\n","import path from \"node:path\";\n\nimport type { OpensteerLocalViewSessionSummary } from \"@opensteer/protocol\";\n\nimport { pathExists } from \"../internal/filesystem.js\";\nimport {\n  getPersistedLocalBrowserSessionOwnership,\n  isAttachedLocalBrowserSessionReachable,\n  readPersistedLocalBrowserSessionRecord,\n  type PersistedLocalBrowserSessionRecord,\n} from \"../live-session.js\";\nimport { isProcessRunning } from \"../local-browser/process-owner.js\";\nimport {\n  deleteLocalViewSessionManifest,\n  listLocalViewSessionManifests,\n  readLocalViewSessionManifest,\n  buildLocalViewSessionIdForRecord,\n  type PersistedLocalViewSessionManifest,\n} from \"./session-manifest.js\";\nimport { resolveBrowserWebSocketUrl } from \"./resolve-browser-websocket.js\";\n\nexport interface ResolvedLocalViewSession {\n  readonly manifest: PersistedLocalViewSessionManifest;\n  readonly record: PersistedLocalBrowserSessionRecord;\n  readonly browserWebSocketUrl: string;\n}\n\nexport async function listResolvedLocalViewSessions(): Promise<\n  readonly OpensteerLocalViewSessionSummary[]\n> {\n  const manifests = await listLocalViewSessionManifests();\n  const resolved = await Promise.all(manifests.map((manifest) => resolveSessionSummary(manifest)));\n  return resolved\n    .filter((session): session is OpensteerLocalViewSessionSummary => session !== undefined)\n    .sort(\n      (left, right) => right.startedAt - left.startedAt || left.label.localeCompare(right.label),\n    );\n}\n\nexport async function resolveLocalViewSession(\n  sessionId: string,\n): Promise<ResolvedLocalViewSession | undefined> {\n  const manifest = await readLocalViewSessionManifest(sessionId);\n  if (!manifest) {\n    return undefined;\n  }\n\n  return readResolvedLocalViewSession(manifest);\n}\n\nasync function resolveSessionSummary(\n  manifest: PersistedLocalViewSessionManifest,\n): Promise<OpensteerLocalViewSessionSummary | undefined> {\n  const record = await readLiveRecord(manifest);\n  if (!record) {\n    await deleteLocalViewSessionManifest(manifest.sessionId);\n    return undefined;\n  }\n\n  const browserName = record.executablePath\n    ? path.basename(record.executablePath).replace(/\\.[A-Za-z0-9]+$/u, \"\")\n    : undefined;\n\n  return {\n    sessionId: manifest.sessionId,\n    label: manifest.workspace ?? (path.basename(manifest.rootPath) || manifest.sessionId),\n    status:\n      getPersistedLocalBrowserSessionOwnership(record) === \"attached\" ||\n      isProcessRunning(record.pid)\n        ? \"live\"\n        : \"stale\",\n    ...(manifest.workspace === undefined ? {} : { workspace: manifest.workspace }),\n    rootPath: manifest.rootPath,\n    engine: record.engine,\n    ownership: manifest.ownership,\n    startedAt: record.startedAt,\n    ...(record.pid > 0 ? { pid: record.pid } : {}),\n    ...(browserName === undefined ? {} : { browserName }),\n  };\n}\n\nasync function readResolvedLocalViewSession(\n  manifest: PersistedLocalViewSessionManifest,\n): Promise<ResolvedLocalViewSession | undefined> {\n  const record = await readLiveRecord(manifest);\n  if (!record) {\n    await deleteLocalViewSessionManifest(manifest.sessionId);\n    return undefined;\n  }\n\n  const browserWebSocketUrl = await resolveBrowserWebSocketUrl(record).catch(() => undefined);\n  if (!browserWebSocketUrl) {\n    return undefined;\n  }\n\n  return {\n    manifest,\n    record,\n    browserWebSocketUrl,\n  };\n}\n\nasync function readLiveRecord(\n  manifest: PersistedLocalViewSessionManifest,\n): Promise<PersistedLocalBrowserSessionRecord | undefined> {\n  if (!(await pathExists(manifest.rootPath))) {\n    return undefined;\n  }\n\n  const record = await readPersistedLocalBrowserSessionRecord(manifest.rootPath);\n  if (!record) {\n    return undefined;\n  }\n\n  if (\n    buildLocalViewSessionIdForRecord({\n      rootPath: manifest.rootPath,\n      live: record,\n    }) !== manifest.sessionId ||\n    record.startedAt !== manifest.startedAt ||\n    record.engine !== manifest.engine ||\n    getPersistedLocalBrowserSessionOwnership(record) !== manifest.ownership\n  ) {\n    return undefined;\n  }\n\n  if (getPersistedLocalBrowserSessionOwnership(record) === \"attached\") {\n    return (await isAttachedLocalBrowserSessionReachable(record)) ? record : undefined;\n  }\n\n  if (record.pid !== manifest.pid || !isProcessRunning(record.pid)) {\n    return undefined;\n  }\n  return record;\n}\n","import { inspectCdpEndpoint } from \"../local-browser/cdp-discovery.js\";\nimport type { PersistedLocalBrowserSessionRecord } from \"../live-session.js\";\n\nexport async function resolveBrowserWebSocketUrl(\n  record: PersistedLocalBrowserSessionRecord,\n): Promise<string> {\n  if (record.engine === \"playwright\") {\n    if (!record.endpoint) {\n      throw new Error(\"Local Playwright session is missing a browser WebSocket endpoint.\");\n    }\n    return record.endpoint;\n  }\n\n  if (!record.remoteDebuggingUrl) {\n    throw new Error(\"Local ABP session is missing a remote debugging URL.\");\n  }\n\n  const inspected = await inspectCdpEndpoint({\n    endpoint: record.remoteDebuggingUrl,\n    timeoutMs: 5_000,\n  });\n  return inspected.endpoint;\n}\n","export interface PageActivationIntent {\n  readonly targetId: string;\n  readonly ts: number;\n}\n\nexport class LocalViewRuntimeState {\n  private readonly activationIntentBySessionId = new Map<string, PageActivationIntent>();\n\n  setPageActivationIntent(sessionId: string, targetId: string): void {\n    this.activationIntentBySessionId.set(sessionId, {\n      targetId,\n      ts: Date.now(),\n    });\n  }\n\n  getPageActivationIntent(sessionId: string): PageActivationIntent | undefined {\n    return this.activationIntentBySessionId.get(sessionId);\n  }\n\n  clearPageActivationIntent(sessionId: string, targetId?: string): void {\n    const current = this.activationIntentBySessionId.get(sessionId);\n    if (!current) {\n      return;\n    }\n    if (targetId !== undefined && current.targetId !== targetId) {\n      return;\n    }\n    this.activationIntentBySessionId.delete(sessionId);\n  }\n}\n","import type { IncomingMessage } from \"node:http\";\nimport type { Duplex } from \"node:stream\";\n\nimport * as wsModule from \"ws\";\nimport WebSocket from \"ws\";\n\nexport interface LocalViewSocket {\n  readonly readyState: number;\n  readonly bufferedAmount: number;\n  on(event: \"open\" | \"close\", listener: () => void): this;\n  on(event: \"message\", listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;\n  on(event: \"error\", listener: (error: Error) => void): this;\n  off(event: \"close\", listener: () => void): this;\n  off(event: \"message\", listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;\n  send(\n    data: WebSocket.RawData,\n    options?: {\n      readonly binary?: boolean;\n    },\n    callback?: (error?: Error) => void,\n  ): void;\n  close(code?: number, data?: string | Buffer): void;\n}\n\nexport interface LocalViewSocketServer {\n  readonly clients: Set<LocalViewSocket>;\n  on(\n    event: \"connection\",\n    listener: (socket: LocalViewSocket, request: IncomingMessage) => void,\n  ): this;\n  handleUpgrade(\n    request: IncomingMessage,\n    socket: Duplex,\n    head: Buffer,\n    callback: (socket: LocalViewSocket) => void,\n  ): void;\n  emit(event: \"connection\", socket: LocalViewSocket, request: IncomingMessage): boolean;\n  close(callback?: () => void): void;\n}\n\ninterface LocalViewSocketServerConstructor {\n  new (options?: { readonly noServer?: boolean }): LocalViewSocketServer;\n}\n\nexport const LocalViewWebSocketServer = (\n  wsModule as unknown as {\n    readonly WebSocketServer: LocalViewSocketServerConstructor;\n  }\n).WebSocketServer;\n","import type { IncomingMessage } from \"node:http\";\nimport type { Duplex } from \"node:stream\";\n\nimport WebSocket from \"ws\";\n\nimport { resolveLocalViewSession } from \"./discovery.js\";\nimport { LocalViewRuntimeState } from \"./runtime-state.js\";\nimport {\n  LocalViewWebSocketServer,\n  type LocalViewSocket,\n  type LocalViewSocketServer,\n} from \"./ws-types.js\";\n\nconst DEFAULT_MAX_PENDING_CLIENT_BUFFER_BYTES = 1_000_000;\nconst DEFAULT_UPSTREAM_OPEN_TIMEOUT_MS = 10_000;\n\nexport interface LocalViewCdpProxyDeps {\n  readonly runtimeState: LocalViewRuntimeState;\n  readonly createUpstreamSocket?: (url: string) => LocalViewSocket;\n  readonly maxPendingClientBufferBytes?: number;\n  readonly upstreamOpenTimeoutMs?: number;\n}\n\nexport class LocalViewCdpProxy {\n  private readonly wss: LocalViewSocketServer;\n  private readonly createUpstreamSocket: (url: string) => LocalViewSocket;\n  private readonly maxPendingClientBufferBytes: number;\n  private readonly upstreamOpenTimeoutMs: number;\n\n  constructor(private readonly deps: LocalViewCdpProxyDeps) {\n    this.wss = new LocalViewWebSocketServer({ noServer: true });\n    this.createUpstreamSocket =\n      deps.createUpstreamSocket ?? ((url) => new WebSocket(url) as unknown as LocalViewSocket);\n    this.maxPendingClientBufferBytes =\n      deps.maxPendingClientBufferBytes ?? DEFAULT_MAX_PENDING_CLIENT_BUFFER_BYTES;\n    this.upstreamOpenTimeoutMs = deps.upstreamOpenTimeoutMs ?? DEFAULT_UPSTREAM_OPEN_TIMEOUT_MS;\n  }\n\n  handleUpgrade(req: IncomingMessage, socket: Duplex, head: Buffer): void {\n    const url = new URL(req.url || \"/\", \"http://localhost\");\n    const parts = url.pathname.split(\"/\").filter(Boolean);\n    const isCdpPath = parts.length === 3 && parts[0] === \"ws\" && parts[1] === \"cdp\";\n    if (!isCdpPath) {\n      socket.destroy();\n      return;\n    }\n\n    const sessionId = parts[2]!;\n    this.wss.handleUpgrade(req, socket, head, (clientSocket) => {\n      void this.bindProxy(clientSocket, sessionId).catch(() => {\n        safeCloseSocket(clientSocket);\n      });\n    });\n  }\n\n  close(): void {\n    for (const client of this.wss.clients) {\n      safeCloseSocket(client);\n    }\n    this.wss.close();\n  }\n\n  private async bindProxy(clientSocket: LocalViewSocket, sessionId: string): Promise<void> {\n    const resolved = await resolveLocalViewSession(sessionId);\n    if (!resolved) {\n      safeCloseSocket(clientSocket);\n      return;\n    }\n\n    const upstream = this.createUpstreamSocket(resolved.browserWebSocketUrl);\n    const pendingCreateTargetCommandIds = new Set<number>();\n    const pendingAttachTargetCommandTargetIds = new Map<number, string>();\n    const targetIdByAttachedSessionId = new Map<string, string>();\n    const pendingClientMessages: Array<{\n      readonly data: WebSocket.RawData;\n      readonly isBinary: boolean;\n    }> = [];\n    let pendingClientBufferBytes = 0;\n    let closed = false;\n    let upstreamOpenTimeout: NodeJS.Timeout | null = null;\n\n    const closeConnection = () => {\n      if (closed) {\n        return;\n      }\n      closed = true;\n      if (upstreamOpenTimeout) {\n        clearTimeout(upstreamOpenTimeout);\n        upstreamOpenTimeout = null;\n      }\n      pendingClientMessages.length = 0;\n      pendingClientBufferBytes = 0;\n      safeCloseSocket(upstream);\n      safeCloseSocket(clientSocket);\n    };\n\n    upstreamOpenTimeout = setTimeout(() => {\n      if (upstream.readyState === WebSocket.OPEN) {\n        return;\n      }\n      closeConnection();\n    }, this.upstreamOpenTimeoutMs);\n\n    clientSocket.on(\"message\", (data: WebSocket.RawData, isBinary: boolean) => {\n      const outboundData = data;\n\n      if (!isBinary) {\n        const message = parseCdpProtocolMessage(data);\n        if (message) {\n          const activatedTargetId = readActivateTargetCommandTargetId(message);\n          if (activatedTargetId) {\n            this.deps.runtimeState.setPageActivationIntent(sessionId, activatedTargetId);\n          }\n\n          const createTargetCommandId = readCreateTargetCommandId(message);\n          if (createTargetCommandId !== null) {\n            pendingCreateTargetCommandIds.add(createTargetCommandId);\n          }\n\n          const attachTargetCommand = readAttachTargetCommand(message);\n          if (attachTargetCommand) {\n            pendingAttachTargetCommandTargetIds.set(\n              attachTargetCommand.id,\n              attachTargetCommand.targetId,\n            );\n          }\n\n          const interactionTargetId = readInteractionTargetId(message, targetIdByAttachedSessionId);\n          if (interactionTargetId) {\n            this.deps.runtimeState.setPageActivationIntent(sessionId, interactionTargetId);\n          }\n        }\n      }\n\n      if (upstream.readyState === WebSocket.OPEN) {\n        upstream.send(outboundData, { binary: isBinary });\n        return;\n      }\n      if (upstream.readyState !== WebSocket.CONNECTING) {\n        closeConnection();\n        return;\n      }\n\n      const sizeBytes = rawDataSizeBytes(outboundData);\n      if (pendingClientBufferBytes + sizeBytes > this.maxPendingClientBufferBytes) {\n        closeConnection();\n        return;\n      }\n      pendingClientMessages.push({ data: outboundData, isBinary });\n      pendingClientBufferBytes += sizeBytes;\n    });\n\n    upstream.on(\"open\", () => {\n      if (upstreamOpenTimeout) {\n        clearTimeout(upstreamOpenTimeout);\n        upstreamOpenTimeout = null;\n      }\n      for (const pendingMessage of pendingClientMessages.splice(0)) {\n        upstream.send(pendingMessage.data, { binary: pendingMessage.isBinary });\n      }\n      pendingClientBufferBytes = 0;\n    });\n\n    upstream.on(\"message\", (data: WebSocket.RawData, isBinary: boolean) => {\n      if (!isBinary) {\n        const message = parseCdpProtocolMessage(data);\n        if (message) {\n          const createdTargetId = readCreateTargetResultTargetId(\n            message,\n            pendingCreateTargetCommandIds,\n          );\n          if (createdTargetId) {\n            this.deps.runtimeState.setPageActivationIntent(sessionId, createdTargetId);\n          }\n\n          const attachedTarget = readAttachTargetResult(\n            message,\n            pendingAttachTargetCommandTargetIds,\n          );\n          if (attachedTarget) {\n            targetIdByAttachedSessionId.set(attachedTarget.sessionId, attachedTarget.targetId);\n          }\n\n          const detachedSessionId = readDetachedTargetSessionId(message);\n          if (detachedSessionId) {\n            targetIdByAttachedSessionId.delete(detachedSessionId);\n          }\n        }\n      }\n\n      if (clientSocket.readyState === WebSocket.OPEN) {\n        clientSocket.send(data, { binary: isBinary });\n      }\n    });\n\n    clientSocket.on(\"close\", closeConnection);\n    clientSocket.on(\"error\", closeConnection);\n    upstream.on(\"close\", closeConnection);\n    upstream.on(\"error\", closeConnection);\n  }\n}\n\ninterface ParsedCdpProtocolMessage {\n  readonly id?: number;\n  readonly method?: string;\n  readonly sessionId?: string;\n  readonly params?: Record<string, unknown>;\n  readonly result?: Record<string, unknown>;\n}\n\nfunction parseCdpProtocolMessage(data: WebSocket.RawData): ParsedCdpProtocolMessage | null {\n  try {\n    const parsed = JSON.parse(rawDataToString(data)) as ParsedCdpProtocolMessage | null;\n    return parsed && typeof parsed === \"object\" ? parsed : null;\n  } catch {\n    return null;\n  }\n}\n\nfunction readCreateTargetCommandId(message: ParsedCdpProtocolMessage): number | null {\n  return message.method === \"Target.createTarget\" && typeof message.id === \"number\"\n    ? message.id\n    : null;\n}\n\nfunction readCreateTargetResultTargetId(\n  message: ParsedCdpProtocolMessage,\n  pendingCommandIds: Set<number>,\n): string | null {\n  if (typeof message.id !== \"number\" || !pendingCommandIds.has(message.id)) {\n    return null;\n  }\n  pendingCommandIds.delete(message.id);\n  const targetId = message.result?.targetId;\n  return typeof targetId === \"string\" && targetId.length > 0 ? targetId : null;\n}\n\nfunction readActivateTargetCommandTargetId(message: ParsedCdpProtocolMessage): string | null {\n  const targetId =\n    message.method === \"Target.activateTarget\" ? message.params?.targetId : undefined;\n  return typeof targetId === \"string\" && targetId.length > 0 ? targetId : null;\n}\n\nfunction readAttachTargetCommand(message: ParsedCdpProtocolMessage): {\n  readonly id: number;\n  readonly targetId: string;\n} | null {\n  if (message.method !== \"Target.attachToTarget\" || typeof message.id !== \"number\") {\n    return null;\n  }\n  const targetId = message.params?.targetId;\n  if (typeof targetId !== \"string\" || targetId.length === 0) {\n    return null;\n  }\n  return {\n    id: message.id,\n    targetId,\n  };\n}\n\nfunction readAttachTargetResult(\n  message: ParsedCdpProtocolMessage,\n  pendingTargetIds: Map<number, string>,\n): {\n  readonly sessionId: string;\n  readonly targetId: string;\n} | null {\n  if (typeof message.id !== \"number\") {\n    return null;\n  }\n  const targetId = pendingTargetIds.get(message.id);\n  if (!targetId) {\n    return null;\n  }\n  pendingTargetIds.delete(message.id);\n  const sessionId = message.result?.sessionId;\n  if (typeof sessionId !== \"string\" || sessionId.length === 0) {\n    return null;\n  }\n  return {\n    sessionId,\n    targetId,\n  };\n}\n\nfunction readInteractionTargetId(\n  message: ParsedCdpProtocolMessage,\n  targetIdByAttachedSessionId: Map<string, string>,\n): string | null {\n  const sessionId = message.sessionId;\n  if (typeof sessionId !== \"string\" || sessionId.length === 0) {\n    return null;\n  }\n  if (\n    !message.method ||\n    (!message.method.startsWith(\"Input.\") && !message.method.startsWith(\"Page.\"))\n  ) {\n    return null;\n  }\n  return targetIdByAttachedSessionId.get(sessionId) ?? null;\n}\n\nfunction readDetachedTargetSessionId(message: ParsedCdpProtocolMessage): string | null {\n  if (message.method !== \"Target.detachedFromTarget\") {\n    return null;\n  }\n  const sessionId = message.params?.sessionId;\n  return typeof sessionId === \"string\" && sessionId.length > 0 ? sessionId : null;\n}\n\nfunction rawDataToString(data: WebSocket.RawData): string {\n  if (typeof data === \"string\") {\n    return data;\n  }\n  if (data instanceof ArrayBuffer) {\n    return Buffer.from(data).toString(\"utf8\");\n  }\n  if (Array.isArray(data)) {\n    return Buffer.concat(data).toString(\"utf8\");\n  }\n  return data.toString(\"utf8\");\n}\n\nfunction rawDataSizeBytes(data: WebSocket.RawData): number {\n  if (typeof data === \"string\") {\n    return Buffer.byteLength(data);\n  }\n  if (data instanceof ArrayBuffer) {\n    return data.byteLength;\n  }\n  if (Array.isArray(data)) {\n    return data.reduce((total, entry) => total + entry.byteLength, 0);\n  }\n  return data.byteLength;\n}\n\nfunction safeCloseSocket(socket: LocalViewSocket): void {\n  try {\n    socket.close();\n  } catch {}\n}\n","import { randomBytes } from \"node:crypto\";\nimport { createServer, type IncomingMessage, type ServerResponse } from \"node:http\";\nimport { readFile } from \"node:fs/promises\";\nimport { existsSync } from \"node:fs\";\nimport { once } from \"node:events\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type {\n  OpensteerLocalViewSessionCloseResponse,\n  OpensteerLocalViewSessionsResponse,\n  OpensteerSessionAccessGrantResponse,\n} from \"@opensteer/protocol\";\n\nimport { listResolvedLocalViewSessions, resolveLocalViewSession } from \"./discovery.js\";\nimport { LocalViewCdpProxy } from \"./cdp-proxy.js\";\nimport { CURRENT_PROCESS_OWNER } from \"../local-browser/process-owner.js\";\nimport { LocalViewRuntimeState } from \"./runtime-state.js\";\nimport { clearLocalViewServiceState } from \"./service-state.js\";\nimport {\n  OPENSTEER_LOCAL_VIEW_SERVICE_LAYOUT,\n  OPENSTEER_LOCAL_VIEW_SERVICE_VERSION,\n  writeLocalViewServiceState,\n} from \"./service-state.js\";\nimport { LocalViewStreamHub } from \"./view-stream.js\";\nimport { LocalViewWebSocketServer } from \"./ws-types.js\";\n\nconst DEFAULT_MAX_FPS = 12;\nconst DEFAULT_QUALITY = 75;\nconst DEFAULT_MAX_CLIENT_BUFFER_BYTES = 512 * 1024;\nconst LOCAL_VIEW_ACCESS_EXPIRES_AT = Number.MAX_SAFE_INTEGER;\n\nexport interface LocalViewServer {\n  readonly url: string;\n  readonly token: string;\n  close(): Promise<void>;\n}\n\nexport async function startLocalViewServer(\n  input: {\n    readonly port?: number;\n    readonly token?: string;\n    readonly onClosed?: () => void | Promise<void>;\n  } = {},\n): Promise<LocalViewServer> {\n  const token = input.token ?? randomBytes(24).toString(\"hex\");\n  const runtimeState = new LocalViewRuntimeState();\n  const viewStreamHub = new LocalViewStreamHub({\n    runtimeState,\n    maxFps: DEFAULT_MAX_FPS,\n    quality: DEFAULT_QUALITY,\n    maxClientBufferBytes: DEFAULT_MAX_CLIENT_BUFFER_BYTES,\n  });\n  const cdpProxy = new LocalViewCdpProxy({\n    runtimeState,\n  });\n\n  const httpServer = createServer((request, response) => {\n    void handleHttpRequest({ request, response, token, shutdown: closeServer }).catch(() => {\n      if (!response.headersSent && !response.writableEnded) {\n        writeJson(response, 500, { error: \"Internal server error.\" });\n        return;\n      }\n      response.destroy();\n    });\n  });\n\n  const viewWss = new LocalViewWebSocketServer({ noServer: true });\n  viewWss.on(\"connection\", (ws, request: IncomingMessage) => {\n    const url = new URL(request.url ?? \"/\", \"http://localhost\");\n    const parts = url.pathname.split(\"/\").filter(Boolean);\n    const sessionId = parts[2];\n    if (!sessionId) {\n      ws.close(1008, \"Session id is required.\");\n      return;\n    }\n    viewStreamHub.attachClient(sessionId, ws);\n  });\n\n  httpServer.on(\"upgrade\", (request, socket, head) => {\n    const url = new URL(request.url ?? \"/\", \"http://localhost\");\n    const tokenParam = url.searchParams.get(\"token\");\n    if (tokenParam !== token || !isAllowedOrigin(request.headers.origin)) {\n      socket.destroy();\n      return;\n    }\n\n    const parts = url.pathname.split(\"/\").filter(Boolean);\n    if (parts[0] !== \"ws\" || parts.length !== 3) {\n      socket.destroy();\n      return;\n    }\n\n    if (parts[1] === \"view\") {\n      viewWss.handleUpgrade(request, socket, head, (ws) => {\n        viewWss.emit(\"connection\", ws, request);\n      });\n      return;\n    }\n\n    if (parts[1] === \"cdp\") {\n      cdpProxy.handleUpgrade(request, socket, head);\n      return;\n    }\n\n    socket.destroy();\n  });\n\n  let closePromise: Promise<void> | undefined;\n  async function closeServer(): Promise<void> {\n    closePromise ??= (async () => {\n      viewWss.clients.forEach((client) => {\n        try {\n          client.close();\n        } catch {}\n      });\n      viewWss.close();\n      cdpProxy.close();\n      httpServer.close();\n      await once(httpServer, \"close\");\n      await clearLocalViewServiceState({ pid: process.pid, token });\n      await input.onClosed?.();\n    })();\n    await closePromise;\n  }\n\n  httpServer.listen(input.port ?? 0, \"127.0.0.1\");\n  await once(httpServer, \"listening\");\n  const address = httpServer.address();\n  if (!address || typeof address === \"string\") {\n    throw new Error(\"Failed to resolve the local view server address.\");\n  }\n\n  const url = `http://127.0.0.1:${String(address.port)}`;\n  await writeLocalViewServiceState({\n    layout: OPENSTEER_LOCAL_VIEW_SERVICE_LAYOUT,\n    version: OPENSTEER_LOCAL_VIEW_SERVICE_VERSION,\n    pid: process.pid,\n    processStartedAtMs: CURRENT_PROCESS_OWNER.processStartedAtMs,\n    startedAt: Date.now(),\n    port: address.port,\n    token,\n    url,\n  });\n\n  return {\n    url,\n    token,\n    close: closeServer,\n  };\n}\n\nasync function handleHttpRequest(args: {\n  readonly request: IncomingMessage;\n  readonly response: ServerResponse;\n  readonly token: string;\n  readonly shutdown: () => Promise<void>;\n}): Promise<void> {\n  const url = new URL(args.request.url ?? \"/\", \"http://localhost\");\n\n  if (url.pathname === \"/api/health\") {\n    if (!isAuthorizedApiRequest(args.request, args.token)) {\n      writeJson(args.response, 401, { error: \"Unauthorized.\" });\n      return;\n    }\n    writeJson(args.response, 200, { ok: true });\n    return;\n  }\n\n  if (url.pathname === \"/api/sessions\") {\n    if (!isAuthorizedApiRequest(args.request, args.token)) {\n      writeJson(args.response, 401, { error: \"Unauthorized.\" });\n      return;\n    }\n    const sessions = await listResolvedLocalViewSessions();\n    const payload: OpensteerLocalViewSessionsResponse = { sessions };\n    writeJson(args.response, 200, payload);\n    return;\n  }\n\n  if (url.pathname === \"/api/service/stop\") {\n    if (!isAuthorizedApiRequest(args.request, args.token)) {\n      writeJson(args.response, 401, { error: \"Unauthorized.\" });\n      return;\n    }\n    if (args.request.method !== \"POST\") {\n      writeJson(args.response, 405, { error: \"Method not allowed.\" });\n      return;\n    }\n\n    args.response.once(\"finish\", () => {\n      void args.shutdown();\n    });\n    writeJson(args.response, 200, { stopped: true });\n    return;\n  }\n\n  const accessMatch = url.pathname.match(/^\\/api\\/sessions\\/([^/]+)\\/access$/u);\n  if (accessMatch) {\n    if (!isAuthorizedApiRequest(args.request, args.token)) {\n      writeJson(args.response, 401, { error: \"Unauthorized.\" });\n      return;\n    }\n    const sessionId = decodeURIComponent(accessMatch[1]!);\n    if (!(await resolveLocalViewSession(sessionId))) {\n      writeJson(args.response, 404, { error: \"Session not found.\" });\n      return;\n    }\n    const payload: OpensteerSessionAccessGrantResponse = {\n      sessionId,\n      expiresAt: LOCAL_VIEW_ACCESS_EXPIRES_AT,\n      grants: {\n        view: {\n          kind: \"view\",\n          transport: \"ws\",\n          url: `${resolveWsBaseUrl(args.request)}/ws/view/${encodeURIComponent(sessionId)}`,\n          token: args.token,\n          expiresAt: LOCAL_VIEW_ACCESS_EXPIRES_AT,\n        },\n        cdp: {\n          kind: \"cdp\",\n          transport: \"ws\",\n          url: `${resolveWsBaseUrl(args.request)}/ws/cdp/${encodeURIComponent(sessionId)}`,\n          token: args.token,\n          expiresAt: LOCAL_VIEW_ACCESS_EXPIRES_AT,\n        },\n      },\n    };\n    writeJson(args.response, 200, payload);\n    return;\n  }\n\n  const closeMatch = url.pathname.match(/^\\/api\\/sessions\\/([^/]+)\\/close$/u);\n  if (closeMatch) {\n    if (!isAuthorizedApiRequest(args.request, args.token)) {\n      writeJson(args.response, 401, { error: \"Unauthorized.\" });\n      return;\n    }\n    if (args.request.method !== \"POST\") {\n      writeJson(args.response, 405, { error: \"Method not allowed.\" });\n      return;\n    }\n\n    const sessionId = decodeURIComponent(closeMatch[1]!);\n    const { closeLocalViewSessionBrowser, LocalViewSessionCloseError } =\n      await import(\"./session-control.js\");\n    try {\n      await closeLocalViewSessionBrowser(sessionId);\n    } catch (error) {\n      if (error instanceof LocalViewSessionCloseError) {\n        writeJson(args.response, error.statusCode, { error: error.message });\n        return;\n      }\n      throw error;\n    }\n\n    const payload: OpensteerLocalViewSessionCloseResponse = {\n      sessionId,\n      closed: true,\n    };\n    writeJson(args.response, 200, payload);\n    return;\n  }\n\n  if (url.pathname === \"/favicon.ico\") {\n    args.response.statusCode = 204;\n    args.response.end();\n    return;\n  }\n\n  if (\n    url.pathname === \"/\" ||\n    url.pathname.startsWith(\"/assets/\") ||\n    url.pathname.startsWith(\"/images/\")\n  ) {\n    await serveStaticAsset(args.response, url.pathname, args.token);\n    return;\n  }\n\n  args.response.statusCode = 404;\n  args.response.end(\"not found\");\n}\n\nasync function serveStaticAsset(\n  response: ServerResponse,\n  pathname: string,\n  token: string,\n): Promise<void> {\n  const publicDir = resolveLocalViewPublicDir();\n  const relativePath = pathname === \"/\" ? \"index.html\" : pathname.slice(1);\n  const assetPath = path.resolve(publicDir, relativePath);\n  const relativeAssetPath = path.relative(publicDir, assetPath);\n  if (\n    relativeAssetPath.startsWith(\"..\") ||\n    path.isAbsolute(relativeAssetPath) ||\n    !existsSync(assetPath)\n  ) {\n    response.statusCode = 404;\n    response.end(\"not found\");\n    return;\n  }\n\n  if (relativePath === \"index.html\") {\n    const html = await readFile(assetPath, \"utf8\");\n    response.setHeader(\"content-type\", \"text/html; charset=utf-8\");\n    response.setHeader(\"cache-control\", \"no-store\");\n    response.end(\n      html.replace(\n        \"__OPENSTEER_LOCAL_BOOTSTRAP_JSON__\",\n        JSON.stringify({\n          apiBasePath: \"/api\",\n          token,\n        }),\n      ),\n    );\n    return;\n  }\n\n  response.setHeader(\"content-type\", guessContentType(assetPath));\n  response.setHeader(\"cache-control\", \"no-store\");\n  response.end(await readFile(assetPath));\n}\n\nfunction resolveLocalViewPublicDir(): string {\n  const moduleDir = path.dirname(fileURLToPath(import.meta.url));\n  const candidates = [\n    path.resolve(moduleDir, \"local-view\", \"public\"),\n    path.resolve(moduleDir, \"public\"),\n    path.resolve(moduleDir, \"..\", \"local-view\", \"public\"),\n  ];\n  for (const candidate of candidates) {\n    if (existsSync(candidate)) {\n      return candidate;\n    }\n  }\n  throw new Error(`Could not resolve local view public assets from ${moduleDir}.`);\n}\n\nfunction isAuthorizedApiRequest(request: IncomingMessage, token: string): boolean {\n  return (\n    request.headers[\"x-opensteer-local-token\"] === token && isAllowedOrigin(request.headers.origin)\n  );\n}\n\nfunction isAllowedOrigin(origin: string | undefined): boolean {\n  if (origin === undefined) {\n    return true;\n  }\n  try {\n    const url = new URL(origin);\n    const host = url.hostname;\n    return host === \"localhost\" || host === \"127.0.0.1\" || host === \"::1\" || host === \"[::1]\";\n  } catch {\n    return false;\n  }\n}\n\nfunction resolveWsBaseUrl(request: IncomingMessage): string {\n  const host = request.headers.host ?? \"127.0.0.1\";\n  return `ws://${host}`;\n}\n\nfunction writeJson(response: ServerResponse, statusCode: number, value: unknown): void {\n  response.statusCode = statusCode;\n  response.setHeader(\"content-type\", \"application/json; charset=utf-8\");\n  response.end(JSON.stringify(value));\n}\n\nfunction guessContentType(assetPath: string): string {\n  if (assetPath.endsWith(\".css\")) {\n    return \"text/css; charset=utf-8\";\n  }\n  if (assetPath.endsWith(\".js\")) {\n    return \"application/javascript; charset=utf-8\";\n  }\n  if (assetPath.endsWith(\".svg\")) {\n    return \"image/svg+xml\";\n  }\n  if (assetPath.endsWith(\".json\")) {\n    return \"application/json; charset=utf-8\";\n  }\n  if (assetPath.endsWith(\".png\")) {\n    return \"image/png\";\n  }\n  if (assetPath.endsWith(\".ico\")) {\n    return \"image/x-icon\";\n  }\n  return \"application/octet-stream\";\n}\n","import type { Browser, BrowserContext, Page } from \"playwright\";\n\ninterface BrowserTargetInfo {\n  readonly targetId?: unknown;\n  readonly type?: unknown;\n  readonly openerId?: unknown;\n}\n\ninterface NormalizedPageTargetInfo {\n  readonly targetId: string;\n  readonly openerId: string | undefined;\n}\n\nexport async function readPageTargetId(page: Page): Promise<string | null> {\n  const cdp = await page.context().newCDPSession(page);\n  try {\n    const result = (await cdp.send(\"Target.getTargetInfo\")) as {\n      readonly targetInfo?: {\n        readonly targetId?: unknown;\n      };\n    } | null;\n    const targetId = result?.targetInfo?.targetId;\n    return typeof targetId === \"string\" && targetId.length > 0 ? targetId : null;\n  } finally {\n    await cdp.detach().catch(() => undefined);\n  }\n}\n\nexport async function readBrowserPageTargetOrder(\n  browserContext: BrowserContext,\n): Promise<readonly string[]> {\n  const browser = browserContext.browser();\n  if (!browser || !hasBrowserCdpSession(browser)) {\n    return [];\n  }\n\n  const cdp = await browser.newBrowserCDPSession();\n  try {\n    const result = (await cdp.send(\"Target.getTargets\")) as {\n      readonly targetInfos?: readonly BrowserTargetInfo[];\n    } | null;\n    return normalizeBrowserPageTargetOrder(result?.targetInfos ?? []);\n  } catch {\n    return [];\n  } finally {\n    await cdp.detach().catch(() => undefined);\n  }\n}\n\nexport async function orderPagesByBrowserTargetOrder(\n  browserContext: BrowserContext,\n  pages: readonly Page[],\n): Promise<readonly Page[]> {\n  if (pages.length < 2) {\n    return pages;\n  }\n\n  const orderedTargetIds = await readBrowserPageTargetOrder(browserContext);\n  if (orderedTargetIds.length === 0) {\n    return pages;\n  }\n\n  const rankByTargetId = new Map(orderedTargetIds.map((targetId, index) => [targetId, index]));\n  const targetIds = await Promise.all(\n    pages.map((page) => readPageTargetId(page).catch(() => null)),\n  );\n\n  return pages\n    .map((page, index) => {\n      const targetId = targetIds[index] ?? undefined;\n      return {\n        page,\n        index,\n        rank: targetId === undefined ? undefined : rankByTargetId.get(targetId),\n      };\n    })\n    .sort((left, right) => {\n      if (left.rank !== undefined && right.rank !== undefined) {\n        return left.rank - right.rank;\n      }\n      if (left.rank !== undefined) {\n        return -1;\n      }\n      if (right.rank !== undefined) {\n        return 1;\n      }\n      return left.index - right.index;\n    })\n    .map((entry) => entry.page);\n}\n\nfunction hasBrowserCdpSession(browser: Browser): browser is Browser & {\n  newBrowserCDPSession(): Promise<{\n    send(method: string, params?: object): Promise<unknown>;\n    detach(): Promise<void>;\n  }>;\n} {\n  return (\n    typeof (browser as Browser & { newBrowserCDPSession?: unknown }).newBrowserCDPSession ===\n    \"function\"\n  );\n}\n\nfunction normalizeBrowserPageTargetOrder(\n  targetInfos: readonly BrowserTargetInfo[],\n): readonly string[] {\n  const reversedPageInfos: NormalizedPageTargetInfo[] = [];\n  for (const targetInfo of targetInfos) {\n    if (targetInfo.type !== \"page\") {\n      continue;\n    }\n    const targetId =\n      typeof targetInfo.targetId === \"string\" && targetInfo.targetId.length > 0\n        ? targetInfo.targetId\n        : undefined;\n    if (targetId === undefined) {\n      continue;\n    }\n    reversedPageInfos.push({\n      targetId,\n      openerId:\n        typeof targetInfo.openerId === \"string\" && targetInfo.openerId.length > 0\n          ? targetInfo.openerId\n          : undefined,\n    });\n  }\n  reversedPageInfos.reverse();\n\n  const rawTargetInfoById = new Map(\n    reversedPageInfos.map((targetInfo) => [targetInfo.targetId, targetInfo] as const),\n  );\n  const targetInfoById = new Map(\n    reversedPageInfos.map(\n      (targetInfo) =>\n        [\n          targetInfo.targetId,\n          {\n            ...targetInfo,\n            openerId: resolveAcyclicOpenerId(targetInfo.targetId, rawTargetInfoById),\n          } satisfies NormalizedPageTargetInfo,\n        ] as const,\n    ),\n  );\n  const orderedTargetIds: string[] = [];\n  const placed = new Set<string>();\n\n  const placeTarget = (targetId: string): void => {\n    if (placed.has(targetId)) {\n      return;\n    }\n\n    const targetInfo = targetInfoById.get(targetId);\n    if (!targetInfo) {\n      return;\n    }\n\n    const openerId = targetInfo.openerId;\n    if (openerId === undefined) {\n      orderedTargetIds.push(targetId);\n      placed.add(targetId);\n      return;\n    }\n\n    placeTarget(openerId);\n    const openerIndex = orderedTargetIds.indexOf(openerId);\n    const insertionIndex =\n      openerIndex === -1\n        ? orderedTargetIds.length\n        : findPopupInsertionIndex(orderedTargetIds, openerIndex, openerId, targetInfoById);\n    orderedTargetIds.splice(insertionIndex, 0, targetId);\n    placed.add(targetId);\n  };\n\n  for (const targetInfo of reversedPageInfos) {\n    placeTarget(targetInfo.targetId);\n  }\n\n  return orderedTargetIds;\n}\n\nfunction resolveAcyclicOpenerId(\n  targetId: string,\n  targetInfoById: ReadonlyMap<string, NormalizedPageTargetInfo>,\n): string | undefined {\n  const openerId = targetInfoById.get(targetId)?.openerId;\n  if (openerId === undefined || !targetInfoById.has(openerId)) {\n    return undefined;\n  }\n\n  const visitedTargetIds = new Set<string>([targetId]);\n  let currentTargetId: string | undefined = openerId;\n  while (currentTargetId !== undefined) {\n    if (visitedTargetIds.has(currentTargetId)) {\n      return undefined;\n    }\n    visitedTargetIds.add(currentTargetId);\n    currentTargetId = targetInfoById.get(currentTargetId)?.openerId;\n  }\n\n  return openerId;\n}\n\nfunction findPopupInsertionIndex(\n  orderedTargetIds: readonly string[],\n  openerIndex: number,\n  openerTargetId: string,\n  targetInfoById: ReadonlyMap<string, NormalizedPageTargetInfo>,\n): number {\n  let index = openerIndex + 1;\n  while (index < orderedTargetIds.length) {\n    const candidateTargetId = orderedTargetIds[index];\n    if (\n      !candidateTargetId ||\n      !isDescendantTarget(candidateTargetId, openerTargetId, targetInfoById)\n    ) {\n      break;\n    }\n    index += 1;\n  }\n  return index;\n}\n\nfunction isDescendantTarget(\n  targetId: string,\n  ancestorTargetId: string,\n  targetInfoById: ReadonlyMap<string, NormalizedPageTargetInfo>,\n): boolean {\n  const visitedTargetIds = new Set<string>();\n  let currentTargetId: string | undefined = targetId;\n  while (currentTargetId !== undefined) {\n    if (visitedTargetIds.has(currentTargetId)) {\n      return false;\n    }\n    visitedTargetIds.add(currentTargetId);\n    const currentTargetInfo = targetInfoById.get(currentTargetId);\n    const openerId = currentTargetInfo?.openerId;\n    if (openerId === undefined) {\n      return false;\n    }\n    if (openerId === ancestorTargetId) {\n      return true;\n    }\n    currentTargetId = openerId;\n  }\n  return false;\n}\n","import type { BrowserContext, Page } from \"playwright\";\n\nimport type { OpensteerViewStreamTab } from \"@opensteer/protocol\";\n\nimport { readBrowserPageTargetOrder, readPageTargetId } from \"./browser-target-order.js\";\nimport { LocalViewRuntimeState } from \"./runtime-state.js\";\n\ninterface CachedPageMetadata {\n  readonly title: string;\n  readonly targetId: string | undefined;\n}\n\nconst ACTIVATION_INTENT_DISCOVERY_GRACE_MS = 2_000;\n\nexport interface TabStateTrackerDeps {\n  readonly browserContext: BrowserContext;\n  readonly sessionId: string;\n  readonly pollMs: number;\n  readonly runtimeState: LocalViewRuntimeState;\n  readonly initialActivePage?: Page;\n  readonly onTabsChanged: (payload: {\n    readonly tabs: readonly OpensteerViewStreamTab[];\n    readonly activeTabIndex: number;\n  }) => void;\n  readonly onActivePageChanged: (page: Page) => void;\n}\n\nexport class TabStateTracker {\n  private readonly deps: TabStateTrackerDeps;\n  private timer: NodeJS.Timeout | null = null;\n  private running = false;\n  private lastActivePage: Page | null = null;\n  private lastTabsSignature = \"\";\n  private tickInFlight = false;\n  private readonly metadataByPage = new Map<Page, CachedPageMetadata>();\n  private readonly targetIdByPage = new WeakMap<Page, string>();\n  private readonly pageCleanupByPage = new Map<Page, () => void>();\n  private boundContextCleanup: (() => void) | null = null;\n\n  constructor(deps: TabStateTrackerDeps) {\n    this.deps = deps;\n    this.lastActivePage = deps.initialActivePage ?? null;\n  }\n\n  start(): void {\n    if (this.running) {\n      return;\n    }\n    this.running = true;\n    this.bindContextEvents();\n    void this.reconcile({\n      includeFocus: true,\n      refreshMetadata: true,\n    });\n  }\n\n  stop(): void {\n    this.running = false;\n    if (this.timer) {\n      clearInterval(this.timer);\n      this.timer = null;\n    }\n    this.boundContextCleanup?.();\n    this.boundContextCleanup = null;\n    for (const cleanup of this.pageCleanupByPage.values()) {\n      cleanup();\n    }\n    this.pageCleanupByPage.clear();\n    this.metadataByPage.clear();\n  }\n\n  private bindContextEvents(): void {\n    if (this.boundContextCleanup) {\n      this.syncTrackedPages(this.deps.browserContext.pages());\n      this.updatePolling(this.deps.browserContext.pages().length);\n      return;\n    }\n\n    const onPage = (page: Page) => {\n      this.syncTrackedPages(this.deps.browserContext.pages());\n      this.updatePolling(this.deps.browserContext.pages().length);\n      this.attachPageListeners(page);\n      void this.reconcile({\n        includeFocus: true,\n        refreshMetadata: true,\n      });\n    };\n\n    this.deps.browserContext.on(\"page\", onPage);\n    this.boundContextCleanup = () => {\n      this.deps.browserContext.off(\"page\", onPage);\n    };\n\n    this.syncTrackedPages(this.deps.browserContext.pages());\n    this.updatePolling(this.deps.browserContext.pages().length);\n  }\n\n  private syncTrackedPages(pages: readonly Page[]): void {\n    const nextPages = new Set(pages);\n\n    for (const [page, cleanup] of this.pageCleanupByPage.entries()) {\n      if (nextPages.has(page)) {\n        continue;\n      }\n      cleanup();\n      this.pageCleanupByPage.delete(page);\n      this.metadataByPage.delete(page);\n    }\n\n    for (const page of pages) {\n      this.attachPageListeners(page);\n    }\n  }\n\n  private attachPageListeners(page: Page): void {\n    if (this.pageCleanupByPage.has(page)) {\n      return;\n    }\n\n    const refreshMetadata = () => {\n      void this.reconcile({\n        includeFocus: false,\n        refreshMetadata: true,\n      });\n    };\n    const handleClose = () => {\n      this.pageCleanupByPage.get(page)?.();\n      this.pageCleanupByPage.delete(page);\n      this.metadataByPage.delete(page);\n      void this.reconcile({\n        includeFocus: true,\n        refreshMetadata: true,\n      });\n    };\n\n    page.on(\"close\", handleClose);\n    page.on(\"domcontentloaded\", refreshMetadata);\n    page.on(\"load\", refreshMetadata);\n    page.on(\"framenavigated\", refreshMetadata);\n\n    this.pageCleanupByPage.set(page, () => {\n      page.off(\"close\", handleClose);\n      page.off(\"domcontentloaded\", refreshMetadata);\n      page.off(\"load\", refreshMetadata);\n      page.off(\"framenavigated\", refreshMetadata);\n    });\n  }\n\n  private updatePolling(pageCount: number): void {\n    const shouldPoll = this.running && pageCount > 0;\n    if (!shouldPoll) {\n      if (this.timer) {\n        clearInterval(this.timer);\n        this.timer = null;\n      }\n      return;\n    }\n\n    if (this.timer) {\n      return;\n    }\n\n    this.timer = setInterval(() => {\n      const trackedPageCount = this.deps.browserContext.pages().length;\n      void this.reconcile({\n        includeFocus: trackedPageCount > 1,\n        refreshMetadata: true,\n      });\n    }, this.deps.pollMs);\n  }\n\n  private async reconcile(args: {\n    readonly includeFocus: boolean;\n    readonly refreshMetadata: boolean;\n  }): Promise<void> {\n    if (!this.running || this.tickInFlight) {\n      return;\n    }\n    this.tickInFlight = true;\n\n    try {\n      this.bindContextEvents();\n      const pages = this.deps.browserContext.pages();\n      this.syncTrackedPages(pages);\n      this.updatePolling(pages.length);\n      const preferredActivePage = this.lastActivePage ?? pages[0] ?? null;\n\n      const pageStates = await Promise.all(\n        pages.map(async (page, originalIndex) => {\n          const metadata = await this.readPageMetadata(page, {\n            refresh: args.refreshMetadata,\n          });\n          const focusState = args.includeFocus\n            ? await this.readFocusState(page)\n            : {\n                isVisible: page === preferredActivePage,\n                hasFocus: page === preferredActivePage,\n              };\n\n          return {\n            page,\n            originalIndex,\n            targetId: metadata.targetId,\n            url: page.url(),\n            title: metadata.title,\n            isVisible: focusState.isVisible,\n            hasFocus: focusState.hasFocus,\n          };\n        }),\n      );\n      const orderedPageStates = await this.orderPageStates(pageStates);\n\n      const activePage = this.pickActivePage(\n        orderedPageStates,\n        this.lastActivePage,\n        preferredActivePage,\n        this.resolveIntentPage(orderedPageStates),\n      );\n      if (activePage && activePage !== this.lastActivePage) {\n        this.lastActivePage = activePage;\n        this.deps.onActivePageChanged(activePage);\n      }\n\n      const tabs = orderedPageStates.map((state) => ({\n        index: state.index,\n        ...(state.targetId === undefined ? {} : { targetId: state.targetId }),\n        url: state.url,\n        title: state.title,\n        active: activePage ? state.page === activePage : false,\n      })) satisfies OpensteerViewStreamTab[];\n      const activeTabIndex = tabs.findIndex((tab) => tab.active);\n      const signature = JSON.stringify({\n        activeTabIndex,\n        tabs: tabs.map((tab) => ({\n          index: tab.index,\n          targetId: tab.targetId,\n          url: tab.url,\n          title: tab.title,\n          active: tab.active,\n        })),\n      });\n\n      if (signature !== this.lastTabsSignature) {\n        this.lastTabsSignature = signature;\n        this.deps.onTabsChanged({\n          tabs,\n          activeTabIndex,\n        });\n      }\n    } finally {\n      this.tickInFlight = false;\n    }\n  }\n\n  private async readPageMetadata(\n    page: Page,\n    options: {\n      readonly refresh: boolean;\n    },\n  ): Promise<CachedPageMetadata> {\n    const cached = this.metadataByPage.get(page);\n    if (cached && !options.refresh) {\n      return cached;\n    }\n\n    const [title, targetId] = await Promise.all([\n      page.title().catch(() => cached?.title ?? \"\"),\n      this.resolveTargetId(page).catch(() => cached?.targetId),\n    ]);\n    const nextMetadata = {\n      title,\n      targetId: targetId ?? undefined,\n    } satisfies CachedPageMetadata;\n    this.metadataByPage.set(page, nextMetadata);\n    return nextMetadata;\n  }\n\n  private async resolveTargetId(page: Page): Promise<string | null> {\n    const cached = this.targetIdByPage.get(page);\n    if (cached) {\n      return cached;\n    }\n\n    const targetId = await readPageTargetId(page);\n    if (targetId) {\n      this.targetIdByPage.set(page, targetId);\n    }\n    return targetId;\n  }\n\n  private async readFocusState(page: Page): Promise<{\n    readonly isVisible: boolean;\n    readonly hasFocus: boolean;\n  }> {\n    try {\n      const result = (await page.evaluate(() => ({\n        visibilityState: (\n          globalThis as {\n            readonly document?: {\n              readonly visibilityState?: unknown;\n            };\n          }\n        ).document?.visibilityState,\n        hasFocus:\n          (\n            globalThis as {\n              readonly document?: {\n                readonly hasFocus?: (() => boolean) | undefined;\n              };\n            }\n          ).document?.hasFocus?.() ?? false,\n      }))) as {\n        readonly visibilityState?: unknown;\n        readonly hasFocus?: unknown;\n      };\n      return {\n        isVisible: result.visibilityState === \"visible\",\n        hasFocus: result.hasFocus === true,\n      };\n    } catch {\n      return {\n        isVisible: false,\n        hasFocus: false,\n      };\n    }\n  }\n\n  private pickActivePage(\n    pageStates: Array<{\n      readonly page: Page;\n      readonly targetId: string | undefined;\n      readonly isVisible: boolean;\n      readonly hasFocus: boolean;\n    }>,\n    lastActivePage: Page | null,\n    fallbackPage: Page | null,\n    intent: { readonly page: Page } | null,\n  ): Page | null {\n    if (intent) {\n      return intent.page;\n    }\n\n    const focusedVisiblePages = pageStates.filter((state) => state.isVisible && state.hasFocus);\n    if (focusedVisiblePages.length === 1) {\n      return focusedVisiblePages[0]?.page ?? null;\n    }\n\n    const visiblePages = pageStates.filter((state) => state.isVisible);\n    if (visiblePages.length === 1) {\n      return visiblePages[0]?.page ?? null;\n    }\n\n    const lastActivePageState = lastActivePage\n      ? (pageStates.find((state) => state.page === lastActivePage) ?? null)\n      : null;\n    if (\n      lastActivePageState &&\n      ((focusedVisiblePages.length > 1 &&\n        lastActivePageState.isVisible &&\n        lastActivePageState.hasFocus) ||\n        (visiblePages.length > 1 && lastActivePageState.isVisible) ||\n        visiblePages.length === 0)\n    ) {\n      return lastActivePage;\n    }\n\n    const fallbackPageState = fallbackPage\n      ? (pageStates.find((state) => state.page === fallbackPage) ?? null)\n      : null;\n    if (\n      fallbackPageState &&\n      ((focusedVisiblePages.length > 1 &&\n        fallbackPageState.isVisible &&\n        fallbackPageState.hasFocus) ||\n        (visiblePages.length > 1 && fallbackPageState.isVisible))\n    ) {\n      return fallbackPage;\n    }\n\n    if (focusedVisiblePages.length > 0) {\n      return focusedVisiblePages[0]?.page ?? null;\n    }\n\n    if (visiblePages.length > 0) {\n      return visiblePages[0]?.page ?? null;\n    }\n\n    if (lastActivePageState) {\n      return lastActivePageState.page;\n    }\n\n    if (fallbackPageState) {\n      return fallbackPageState.page;\n    }\n\n    return pageStates[0]?.page ?? null;\n  }\n\n  private resolveIntentPage(\n    pageStates: Array<{\n      readonly page: Page;\n      readonly targetId: string | undefined;\n    }>,\n  ): { readonly page: Page } | null {\n    const intent = this.deps.runtimeState.getPageActivationIntent(this.deps.sessionId);\n    if (!intent) {\n      return null;\n    }\n\n    const matched = pageStates.find((state) => state.targetId === intent.targetId);\n    if (!matched) {\n      if (Date.now() - intent.ts > ACTIVATION_INTENT_DISCOVERY_GRACE_MS) {\n        this.deps.runtimeState.clearPageActivationIntent(this.deps.sessionId, intent.targetId);\n      }\n      return null;\n    }\n\n    this.deps.runtimeState.clearPageActivationIntent(this.deps.sessionId, intent.targetId);\n    return { page: matched.page };\n  }\n\n  private async orderPageStates<\n    T extends {\n      readonly page: Page;\n      readonly originalIndex: number;\n      readonly targetId: string | undefined;\n    },\n  >(\n    pageStates: readonly T[],\n  ): Promise<Array<Omit<T, \"originalIndex\"> & { readonly index: number }>> {\n    if (pageStates.length < 2) {\n      return pageStates.map(({ originalIndex: _originalIndex, ...state }, index) => ({\n        ...state,\n        index,\n      }));\n    }\n\n    const orderedTargetIds = await readBrowserPageTargetOrder(this.deps.browserContext);\n    const rankByTargetId = new Map(orderedTargetIds.map((targetId, index) => [targetId, index]));\n\n    return [...pageStates]\n      .sort((left, right) => {\n        const leftRank =\n          left.targetId === undefined ? undefined : rankByTargetId.get(left.targetId);\n        const rightRank =\n          right.targetId === undefined ? undefined : rankByTargetId.get(right.targetId);\n        if (leftRank !== undefined && rightRank !== undefined) {\n          return leftRank - rightRank;\n        }\n        if (leftRank !== undefined) {\n          return -1;\n        }\n        if (rightRank !== undefined) {\n          return 1;\n        }\n        return left.originalIndex - right.originalIndex;\n      })\n      .map(({ originalIndex: _originalIndex, ...state }, index) => ({\n        ...state,\n        index,\n      }));\n  }\n}\n","import type { OpensteerViewport } from \"@opensteer/protocol\";\n\nexport interface RequestedStreamSize {\n  readonly width: number;\n  readonly height: number;\n}\n\nconst MIN_CAPTURE_DIMENSION_PX = 100;\nconst MAX_CAPTURE_DIMENSION_PX = 8_192;\nconst CAPTURE_BUCKET_PX = 64;\n\nexport function selectScreencastSize(args: {\n  readonly viewport: OpensteerViewport;\n  readonly requestedSizes: readonly RequestedStreamSize[];\n}): RequestedStreamSize | null {\n  const viewport = normalizeViewport(args.viewport);\n  if (!viewport) {\n    return null;\n  }\n\n  let maxRequestedWidth = 0;\n  let maxRequestedHeight = 0;\n  for (const requestedSize of args.requestedSizes) {\n    const normalized = normalizeRequestedSize(requestedSize);\n    if (!normalized) {\n      return null;\n    }\n    maxRequestedWidth = Math.max(maxRequestedWidth, normalized.width);\n    maxRequestedHeight = Math.max(maxRequestedHeight, normalized.height);\n  }\n\n  if (\n    maxRequestedWidth < MIN_CAPTURE_DIMENSION_PX ||\n    maxRequestedHeight < MIN_CAPTURE_DIMENSION_PX\n  ) {\n    return null;\n  }\n\n  const desiredScale = Math.max(\n    maxRequestedWidth / viewport.width,\n    maxRequestedHeight / viewport.height,\n  );\n  if (desiredScale >= 1) {\n    return viewport;\n  }\n\n  const landscape = viewport.width >= viewport.height;\n  const sourcePrimary = landscape ? viewport.width : viewport.height;\n  const sourceSecondary = landscape ? viewport.height : viewport.width;\n  const nextPrimary = bucketDimension(sourcePrimary * desiredScale);\n  const nextSecondary = clampDimension(Math.round((nextPrimary / sourcePrimary) * sourceSecondary));\n  if (!nextSecondary) {\n    return null;\n  }\n\n  return landscape\n    ? { width: nextPrimary, height: nextSecondary }\n    : { width: nextSecondary, height: nextPrimary };\n}\n\nfunction normalizeViewport(viewport: OpensteerViewport): RequestedStreamSize | null {\n  const width = clampDimension(viewport.width);\n  const height = clampDimension(viewport.height);\n  return width && height ? { width, height } : null;\n}\n\nfunction normalizeRequestedSize(requestedSize: RequestedStreamSize): RequestedStreamSize | null {\n  const width = clampDimension(requestedSize.width);\n  const height = clampDimension(requestedSize.height);\n  return width && height ? { width, height } : null;\n}\n\nfunction clampDimension(value: number): number | null {\n  if (!Number.isFinite(value)) {\n    return null;\n  }\n\n  const normalized = Math.floor(value);\n  if (normalized < MIN_CAPTURE_DIMENSION_PX) {\n    return null;\n  }\n\n  return Math.min(MAX_CAPTURE_DIMENSION_PX, normalized);\n}\n\nfunction bucketDimension(value: number): number {\n  const bucketed =\n    Math.ceil(Math.max(MIN_CAPTURE_DIMENSION_PX, value) / CAPTURE_BUCKET_PX) * CAPTURE_BUCKET_PX;\n  return Math.min(MAX_CAPTURE_DIMENSION_PX, bucketed);\n}\n","import type {\n  OpensteerViewStreamClientMessage,\n  OpensteerViewStreamControlMessage,\n  OpensteerViewStreamTab,\n} from \"@opensteer/protocol\";\nimport WebSocket from \"ws\";\n\nimport type { LocalViewSocket } from \"./ws-types.js\";\n\nexport function buildHelloMessage(args: {\n  readonly sessionId: string;\n  readonly fps: number;\n  readonly quality: number;\n  readonly viewport: {\n    readonly width: number;\n    readonly height: number;\n  };\n}): OpensteerViewStreamControlMessage {\n  return {\n    type: \"hello\",\n    sessionId: args.sessionId,\n    ts: Date.now(),\n    mimeType: \"image/jpeg\",\n    fps: args.fps,\n    quality: args.quality,\n    viewport: args.viewport,\n  };\n}\n\nexport function buildTabsMessage(args: {\n  readonly sessionId: string;\n  readonly tabs: readonly OpensteerViewStreamTab[];\n  readonly activeTabIndex: number;\n}): OpensteerViewStreamControlMessage {\n  return {\n    type: \"tabs\",\n    sessionId: args.sessionId,\n    ts: Date.now(),\n    tabs: args.tabs,\n    activeTabIndex: args.activeTabIndex,\n  };\n}\n\nexport function buildStatusMessage(args: {\n  readonly sessionId: string;\n  readonly status: string;\n}): OpensteerViewStreamControlMessage {\n  return {\n    type: \"status\",\n    sessionId: args.sessionId,\n    ts: Date.now(),\n    status: args.status,\n  };\n}\n\nexport function buildErrorMessage(args: {\n  readonly sessionId: string;\n  readonly error: string;\n}): OpensteerViewStreamControlMessage {\n  return {\n    type: \"error\",\n    sessionId: args.sessionId,\n    ts: Date.now(),\n    error: args.error,\n  };\n}\n\nexport function sendControlMessage(\n  ws: LocalViewSocket,\n  message: OpensteerViewStreamControlMessage,\n): void {\n  if (ws.readyState !== WebSocket.OPEN) {\n    return;\n  }\n  try {\n    ws.send(JSON.stringify(message), { binary: false });\n  } catch {}\n}\n\nexport function parseViewClientMessage(raw: string): OpensteerViewStreamClientMessage | null {\n  try {\n    const parsed = JSON.parse(raw) as Partial<OpensteerViewStreamClientMessage> | null;\n    if (parsed?.type !== \"stream-config\") {\n      return null;\n    }\n\n    const renderWidth = normalizeRenderDimension(parsed.renderWidth);\n    const renderHeight = normalizeRenderDimension(parsed.renderHeight);\n    if (renderWidth === null || renderHeight === null) {\n      return null;\n    }\n\n    return {\n      type: \"stream-config\",\n      renderWidth,\n      renderHeight,\n    };\n  } catch {\n    return null;\n  }\n}\n\nfunction normalizeRenderDimension(value: unknown): number | null {\n  if (typeof value !== \"number\" || !Number.isFinite(value)) {\n    return null;\n  }\n\n  const normalized = Math.floor(value);\n  if (normalized < 100) {\n    return null;\n  }\n\n  return Math.min(8_192, normalized);\n}\n","import type { Page, Browser, BrowserContext, CDPSession } from \"playwright\";\nimport WebSocket, { type RawData } from \"ws\";\n\nimport type { OpensteerViewport, OpensteerViewStreamTab } from \"@opensteer/protocol\";\n\nimport { orderPagesByBrowserTargetOrder } from \"./browser-target-order.js\";\nimport { resolveLocalViewSession } from \"./discovery.js\";\nimport { LocalViewRuntimeState } from \"./runtime-state.js\";\nimport { TabStateTracker } from \"./tab-state-tracker.js\";\nimport { selectScreencastSize, type RequestedStreamSize } from \"./view-stream-capture-policy.js\";\nimport {\n  buildErrorMessage,\n  buildHelloMessage,\n  buildStatusMessage,\n  buildTabsMessage,\n  parseViewClientMessage,\n  sendControlMessage,\n} from \"./view-stream-protocol.js\";\nimport type { LocalViewSocket } from \"./ws-types.js\";\n\nconst INITIAL_FRAME_CAPTURE_ATTEMPTS = 3;\nconst INITIAL_FRAME_CAPTURE_RETRY_DELAY_MS = 150;\nconst TAB_STATE_POLL_MS = 1_000;\nconst CLIENT_FRAME_FLUSH_RETRY_MS = 16;\n\ninterface ClientStreamState {\n  requestedRenderSize: RequestedStreamSize | null;\n  frameSendInFlight: boolean;\n  pendingFrameBuffer: Buffer | null;\n  pendingFlushTimer: NodeJS.Timeout | null;\n}\n\nexport interface LocalViewStreamHubDeps {\n  readonly runtimeState: LocalViewRuntimeState;\n  readonly maxFps: number;\n  readonly quality: number;\n  readonly maxClientBufferBytes: number;\n}\n\nexport class LocalViewStreamHub {\n  private readonly deps: LocalViewStreamHubDeps;\n  private readonly producers = new Map<string, SessionViewStreamProducer>();\n\n  constructor(deps: LocalViewStreamHubDeps) {\n    this.deps = deps;\n  }\n\n  attachClient(sessionId: string, ws: LocalViewSocket): void {\n    let producer = this.producers.get(sessionId);\n    if (!producer) {\n      producer = new SessionViewStreamProducer({\n        sessionId,\n        runtimeState: this.deps.runtimeState,\n        maxFps: this.deps.maxFps,\n        quality: this.deps.quality,\n        maxClientBufferBytes: this.deps.maxClientBufferBytes,\n        onDrained: () => {\n          this.producers.delete(sessionId);\n        },\n      });\n      this.producers.set(sessionId, producer);\n    }\n\n    producer.addClient(ws);\n  }\n}\n\ninterface SessionViewStreamProducerDeps {\n  readonly sessionId: string;\n  readonly runtimeState: LocalViewRuntimeState;\n  readonly maxFps: number;\n  readonly quality: number;\n  readonly maxClientBufferBytes: number;\n  readonly onDrained: () => void;\n}\n\nclass SessionViewStreamProducer {\n  private readonly deps: SessionViewStreamProducerDeps;\n  private readonly clients = new Set<LocalViewSocket>();\n  private readonly clientStateBySocket = new Map<LocalViewSocket, ClientStreamState>();\n  private readonly frameIntervalMs: number;\n  private tracker: TabStateTracker | null = null;\n  private browser: Browser | null = null;\n  private browserDisconnectedHandler: ((browser: Browser) => void) | null = null;\n  private context: BrowserContext | null = null;\n  private cdpSession: CDPSession | null = null;\n  private screencastHandler:\n    | ((event: { readonly data: string; readonly sessionId: number }) => void)\n    | null = null;\n  private pageLifecycleCleanup: (() => void) | null = null;\n  private activePage: Page | null = null;\n  private activeViewport: OpensteerViewport | null = null;\n  private activeScreencastSizeKey: string | null = null;\n  private pendingFrameAckTimer: NodeJS.Timeout | null = null;\n  private starting: Promise<void> | null = null;\n  private started = false;\n  private rebinding: Promise<void> = Promise.resolve();\n  private stopped = false;\n  private lastFrameSentAt = 0;\n  private lastFrameBuffer: Buffer | null = null;\n  private lastTabsPayload: {\n    readonly tabs: readonly OpensteerViewStreamTab[];\n    readonly activeTabIndex: number;\n  } | null = null;\n\n  constructor(deps: SessionViewStreamProducerDeps) {\n    this.deps = deps;\n    this.frameIntervalMs = Math.max(1, Math.floor(1000 / Math.max(1, deps.maxFps)));\n  }\n\n  addClient(ws: LocalViewSocket): void {\n    if (this.stopped) {\n      ws.close(1011, \"View stream is unavailable.\");\n      return;\n    }\n\n    this.clients.add(ws);\n    this.clientStateBySocket.set(ws, {\n      requestedRenderSize: null,\n      frameSendInFlight: false,\n      pendingFrameBuffer: null,\n      pendingFlushTimer: null,\n    });\n\n    if (this.activeViewport) {\n      sendControlMessage(\n        ws,\n        buildHelloMessage({\n          sessionId: this.deps.sessionId,\n          fps: this.deps.maxFps,\n          quality: this.deps.quality,\n          viewport: this.activeViewport,\n        }),\n      );\n    }\n    if (this.lastTabsPayload) {\n      sendControlMessage(\n        ws,\n        buildTabsMessage({\n          sessionId: this.deps.sessionId,\n          tabs: this.lastTabsPayload.tabs,\n          activeTabIndex: this.lastTabsPayload.activeTabIndex,\n        }),\n      );\n    }\n    if (this.lastFrameBuffer) {\n      const queued = this.enqueueFrameForClient(ws, this.lastFrameBuffer);\n      if (!queued) {\n        this.removeClient(ws);\n        return;\n      }\n    }\n\n    ws.on(\"close\", () => {\n      this.removeClient(ws);\n    });\n    ws.on(\"error\", () => {\n      this.removeClient(ws);\n    });\n    ws.on(\"message\", (raw: RawData, isBinary: boolean) => {\n      if (isBinary) {\n        return;\n      }\n      const message = parseViewClientMessage(readTextFrame(raw));\n      if (message?.type !== \"stream-config\") {\n        return;\n      }\n\n      const nextSize = {\n        width: message.renderWidth,\n        height: message.renderHeight,\n      };\n      const clientState = this.clientStateBySocket.get(ws);\n      if (!clientState) {\n        return;\n      }\n      const priorSize = clientState.requestedRenderSize;\n      if (priorSize?.width === nextSize.width && priorSize?.height === nextSize.height) {\n        return;\n      }\n      clientState.requestedRenderSize = nextSize;\n      this.maybeRebindForStreamConfigChange();\n    });\n\n    void this.ensureStarted();\n  }\n\n  private maybeRebindForStreamConfigChange(): void {\n    if (!this.activePage || !this.started || this.stopped) {\n      return;\n    }\n\n    const nextSizeKey = this.getRequestedScreencastSizeKey();\n    if (nextSizeKey === this.activeScreencastSizeKey) {\n      return;\n    }\n\n    void this.queueBindToPage(this.activePage, { force: true }).catch(() => undefined);\n  }\n\n  private removeClient(ws: LocalViewSocket): void {\n    this.clients.delete(ws);\n    const clientState = this.clientStateBySocket.get(ws);\n    if (clientState?.pendingFlushTimer) {\n      clearTimeout(clientState.pendingFlushTimer);\n    }\n    this.clientStateBySocket.delete(ws);\n    if (this.clients.size === 0) {\n      void this.stop();\n      return;\n    }\n    this.maybeRebindForStreamConfigChange();\n  }\n\n  private async ensureStarted(): Promise<void> {\n    if (this.stopped || this.started) {\n      return;\n    }\n    if (this.starting) {\n      return this.starting;\n    }\n\n    this.starting = this.start()\n      .then(() => {\n        if (!this.stopped) {\n          this.started = true;\n        }\n      })\n      .finally(() => {\n        this.starting = null;\n      });\n\n    try {\n      await this.starting;\n    } catch {\n      this.broadcastControl(\n        buildErrorMessage({\n          sessionId: this.deps.sessionId,\n          error: \"Failed to start live browser stream.\",\n        }),\n      );\n      this.closeAllClients(1011, \"View stream failed\");\n      await this.stop();\n    }\n  }\n\n  private async start(): Promise<void> {\n    const session = await this.connectSession();\n    this.broadcastControl(\n      buildStatusMessage({\n        sessionId: this.deps.sessionId,\n        status: \"starting\",\n      }),\n    );\n\n    this.browser = session.browser;\n    this.browserDisconnectedHandler = () => {\n      if (this.stopped) {\n        return;\n      }\n      this.browserDisconnectedHandler = null;\n      this.broadcastControl(\n        buildErrorMessage({\n          sessionId: this.deps.sessionId,\n          error: \"Live browser stream disconnected.\",\n        }),\n      );\n      this.closeAllClients(1011, \"View stream failed\");\n      void this.stop();\n    };\n    this.browser.once(\"disconnected\", this.browserDisconnectedHandler);\n\n    this.context = session.context;\n    this.activePage = session.page;\n    this.activeViewport = await readViewportForPage(session.page);\n    if (this.stopped) {\n      return;\n    }\n    if (this.activeViewport) {\n      this.broadcastControl(\n        buildHelloMessage({\n          sessionId: this.deps.sessionId,\n          fps: this.deps.maxFps,\n          quality: this.deps.quality,\n          viewport: this.activeViewport,\n        }),\n      );\n    }\n\n    this.tracker = new TabStateTracker({\n      browserContext: session.context,\n      sessionId: this.deps.sessionId,\n      pollMs: TAB_STATE_POLL_MS,\n      runtimeState: this.deps.runtimeState,\n      initialActivePage: session.page,\n      onActivePageChanged: (page) => {\n        this.activePage = page;\n        void this.queueBindToPage(page).catch(() => undefined);\n      },\n      onTabsChanged: ({ tabs, activeTabIndex }) => {\n        this.lastTabsPayload = { tabs, activeTabIndex };\n        this.broadcastControl(\n          buildTabsMessage({\n            sessionId: this.deps.sessionId,\n            tabs,\n            activeTabIndex,\n          }),\n        );\n      },\n    });\n    this.tracker.start();\n\n    await this.queueBindToPage(session.page);\n    if (this.stopped) {\n      return;\n    }\n    this.broadcastControl(\n      buildStatusMessage({\n        sessionId: this.deps.sessionId,\n        status: \"live\",\n      }),\n    );\n  }\n\n  private queueBindToPage(\n    page: Page,\n    options: {\n      readonly force?: boolean;\n    } = {},\n  ): Promise<void> {\n    this.rebinding = this.rebinding\n      .catch(() => undefined)\n      .then(() => this.bindToPage(page, options));\n    return this.rebinding;\n  }\n\n  private async bindToPage(\n    page: Page,\n    options: {\n      readonly force?: boolean;\n    } = {},\n  ): Promise<void> {\n    if (this.stopped) {\n      return;\n    }\n    const requestedSizeKey = this.getRequestedScreencastSizeKey();\n    if (\n      !options.force &&\n      this.activePage === page &&\n      this.cdpSession &&\n      this.activeScreencastSizeKey === requestedSizeKey\n    ) {\n      return;\n    }\n\n    await this.stopScreencast();\n    if (this.stopped) {\n      return;\n    }\n\n    const context = this.context;\n    if (!context) {\n      throw new Error(\"Browser context is unavailable.\");\n    }\n    const requestedSize = this.getRequestedScreencastSize();\n    this.activePage = page;\n    this.activeScreencastSizeKey = requestedSizeKey;\n    this.activeViewport = await readViewportForPage(page);\n    if (this.activeViewport) {\n      this.broadcastControl(\n        buildHelloMessage({\n          sessionId: this.deps.sessionId,\n          fps: this.deps.maxFps,\n          quality: this.deps.quality,\n          viewport: this.activeViewport,\n        }),\n      );\n    }\n\n    const cdpSession = await context.newCDPSession(page);\n    if (this.stopped) {\n      await cdpSession.detach().catch(() => undefined);\n      return;\n    }\n    this.cdpSession = cdpSession;\n\n    const onFrame = (event: { readonly data: string; readonly sessionId: number }) => {\n      void this.handleScreencastFrame(event);\n    };\n    this.screencastHandler = onFrame;\n\n    cdpSession.on(\"Page.screencastFrame\", onFrame);\n    await cdpSession.send(\"Page.enable\");\n    await cdpSession.send(\"Page.startScreencast\", {\n      format: \"jpeg\",\n      quality: this.deps.quality,\n      everyNthFrame: 1,\n      ...(requestedSize\n        ? {\n            maxWidth: requestedSize.width,\n            maxHeight: requestedSize.height,\n          }\n        : {}),\n    });\n    this.bindPageLifecycleFrameRefresh(page, cdpSession);\n    void this.seedInitialFrame(cdpSession).catch(() => undefined);\n  }\n\n  private async connectSession(): Promise<{\n    readonly browser: Browser;\n    readonly context: BrowserContext;\n    readonly page: Page;\n  }> {\n    const resolved = await resolveLocalViewSession(this.deps.sessionId);\n    if (!resolved) {\n      throw new Error(`Local view session ${this.deps.sessionId} is unavailable.`);\n    }\n\n    const browser = await connectPlaywrightChromiumBrowser({\n      url: resolved.browserWebSocketUrl,\n    });\n    try {\n      const context = browser.contexts()[0];\n      if (!context) {\n        throw new Error(\"Connected browser did not expose a Chromium browser context.\");\n      }\n\n      const existingPages = context.pages();\n      if (existingPages.length === 0) {\n        const page = await context.newPage();\n        return {\n          browser,\n          context,\n          page,\n        };\n      }\n\n      const orderedPages = await orderPagesByBrowserTargetOrder(context, existingPages);\n      const page =\n        (await resolvePersistedActivePage(orderedPages, {\n          ...(resolved.record.activePageUrl === undefined\n            ? {}\n            : { activePageUrl: resolved.record.activePageUrl }),\n          ...(resolved.record.activePageTitle === undefined\n            ? {}\n            : { activePageTitle: resolved.record.activePageTitle }),\n        })) ?? orderedPages[0]!;\n      return {\n        browser,\n        context,\n        page,\n      };\n    } catch (error) {\n      await disconnectPlaywrightChromiumBrowser(browser).catch(() => undefined);\n      throw error;\n    }\n  }\n\n  private async handleScreencastFrame(event: {\n    readonly data: string;\n    readonly sessionId: number;\n  }): Promise<void> {\n    const cdpSession = this.cdpSession;\n    if (!cdpSession || this.stopped) {\n      return;\n    }\n\n    const frameBuffer = Buffer.from(event.data, \"base64\");\n    this.lastFrameBuffer = frameBuffer;\n\n    const now = Date.now();\n    const delayMs = Math.max(0, this.frameIntervalMs - (now - this.lastFrameSentAt));\n    if (delayMs === 0) {\n      this.flushScreencastFrame({\n        cdpSession,\n        sessionId: event.sessionId,\n        frameBuffer,\n      });\n      return;\n    }\n\n    if (this.pendingFrameAckTimer !== null) {\n      return;\n    }\n\n    this.pendingFrameAckTimer = setTimeout(() => {\n      this.pendingFrameAckTimer = null;\n      if (this.stopped || this.cdpSession !== cdpSession) {\n        return;\n      }\n      this.flushScreencastFrame({\n        cdpSession,\n        sessionId: event.sessionId,\n        frameBuffer,\n      });\n    }, delayMs);\n  }\n\n  private flushScreencastFrame(args: {\n    readonly cdpSession: CDPSession;\n    readonly sessionId: number;\n    readonly frameBuffer: Buffer;\n  }): void {\n    this.lastFrameSentAt = Date.now();\n    this.broadcastFrame(args.frameBuffer);\n    void args.cdpSession\n      .send(\"Page.screencastFrameAck\", { sessionId: args.sessionId })\n      .catch(() => undefined);\n  }\n\n  private broadcastFrame(frameBuffer: Buffer): void {\n    for (const client of this.clients) {\n      if (!this.enqueueFrameForClient(client, frameBuffer)) {\n        this.removeClient(client);\n      }\n    }\n\n    if (this.clients.size === 0) {\n      void this.stop();\n    }\n  }\n\n  private enqueueFrameForClient(client: LocalViewSocket, frameBuffer: Buffer): boolean {\n    if (client.readyState !== WebSocket.OPEN) {\n      return false;\n    }\n\n    const clientState = this.clientStateBySocket.get(client);\n    if (!clientState) {\n      return false;\n    }\n\n    clientState.pendingFrameBuffer = frameBuffer;\n    this.flushQueuedFrameToClient(client);\n    return true;\n  }\n\n  private flushQueuedFrameToClient(client: LocalViewSocket): void {\n    if (client.readyState !== WebSocket.OPEN) {\n      this.removeClient(client);\n      return;\n    }\n\n    const clientState = this.clientStateBySocket.get(client);\n    if (!clientState || clientState.frameSendInFlight || !clientState.pendingFrameBuffer) {\n      return;\n    }\n\n    if (clientState.pendingFlushTimer) {\n      clearTimeout(clientState.pendingFlushTimer);\n      clientState.pendingFlushTimer = null;\n    }\n\n    if (client.bufferedAmount > this.deps.maxClientBufferBytes) {\n      clientState.pendingFlushTimer = setTimeout(() => {\n        clientState.pendingFlushTimer = null;\n        this.flushQueuedFrameToClient(client);\n      }, CLIENT_FRAME_FLUSH_RETRY_MS);\n      return;\n    }\n\n    const frameBuffer = clientState.pendingFrameBuffer;\n    clientState.pendingFrameBuffer = null;\n    clientState.frameSendInFlight = true;\n\n    try {\n      client.send(frameBuffer, { binary: true }, (error?: Error) => {\n        const latestClientState = this.clientStateBySocket.get(client);\n        if (latestClientState) {\n          latestClientState.frameSendInFlight = false;\n        }\n        if (error) {\n          this.removeClient(client);\n          return;\n        }\n        this.flushQueuedFrameToClient(client);\n      });\n    } catch {\n      clientState.frameSendInFlight = false;\n      this.removeClient(client);\n    }\n  }\n\n  private broadcastControl(message: Parameters<typeof sendControlMessage>[1]): void {\n    for (const client of this.clients) {\n      sendControlMessage(client, message);\n    }\n  }\n\n  private closeAllClients(code: number, reason: string): void {\n    for (const client of this.clients) {\n      try {\n        client.close(code, reason);\n      } catch {}\n    }\n    this.clients.clear();\n    for (const clientState of this.clientStateBySocket.values()) {\n      if (clientState.pendingFlushTimer) {\n        clearTimeout(clientState.pendingFlushTimer);\n      }\n    }\n    this.clientStateBySocket.clear();\n  }\n\n  private async stop(): Promise<void> {\n    if (this.stopped) {\n      return;\n    }\n    this.stopped = true;\n    this.started = false;\n\n    if (this.tracker) {\n      this.tracker.stop();\n      this.tracker = null;\n    }\n    await this.rebinding.catch(() => undefined);\n    await this.stopScreencast();\n    const browser = this.browser;\n    const browserDisconnectedHandler = this.browserDisconnectedHandler;\n    this.browser = null;\n    this.browserDisconnectedHandler = null;\n    this.context = null;\n    this.activePage = null;\n    if (browser) {\n      if (browserDisconnectedHandler) {\n        browser.off(\"disconnected\", browserDisconnectedHandler);\n      }\n      await disconnectPlaywrightChromiumBrowser(browser).catch(() => undefined);\n    }\n    this.deps.onDrained();\n  }\n\n  private async stopScreencast(): Promise<void> {\n    const cdpSession = this.cdpSession;\n    const handler = this.screencastHandler;\n    const pageLifecycleCleanup = this.pageLifecycleCleanup;\n\n    this.cdpSession = null;\n    this.screencastHandler = null;\n    this.pageLifecycleCleanup = null;\n    this.activeScreencastSizeKey = null;\n    if (this.pendingFrameAckTimer !== null) {\n      clearTimeout(this.pendingFrameAckTimer);\n      this.pendingFrameAckTimer = null;\n    }\n\n    pageLifecycleCleanup?.();\n\n    if (!cdpSession) {\n      return;\n    }\n\n    if (handler) {\n      cdpSession.off(\"Page.screencastFrame\", handler);\n    }\n\n    await cdpSession.send(\"Page.stopScreencast\").catch(() => undefined);\n    await cdpSession.detach().catch(() => undefined);\n  }\n\n  private bindPageLifecycleFrameRefresh(page: Page, cdpSession: CDPSession): void {\n    this.pageLifecycleCleanup?.();\n\n    const refresh = () => {\n      void this.refreshPageFrame(page, cdpSession).catch(() => undefined);\n    };\n\n    page.on(\"domcontentloaded\", refresh);\n    page.on(\"load\", refresh);\n    page.on(\"framenavigated\", refresh);\n    this.pageLifecycleCleanup = () => {\n      page.off(\"domcontentloaded\", refresh);\n      page.off(\"load\", refresh);\n      page.off(\"framenavigated\", refresh);\n    };\n  }\n\n  private async refreshPageFrame(page: Page, cdpSession: CDPSession): Promise<void> {\n    if (this.stopped || this.cdpSession !== cdpSession || this.activePage !== page) {\n      return;\n    }\n\n    const viewport = await readViewportForPage(page);\n    if (viewport && this.cdpSession === cdpSession && this.activePage === page) {\n      this.activeViewport = viewport;\n      this.broadcastControl(\n        buildHelloMessage({\n          sessionId: this.deps.sessionId,\n          fps: this.deps.maxFps,\n          quality: this.deps.quality,\n          viewport,\n        }),\n      );\n    }\n\n    if (this.stopped || this.cdpSession !== cdpSession || this.activePage !== page) {\n      return;\n    }\n    await this.seedInitialFrame(cdpSession);\n  }\n\n  private async seedInitialFrame(cdpSession: CDPSession): Promise<void> {\n    let lastError: unknown = null;\n\n    for (let attempt = 1; attempt <= INITIAL_FRAME_CAPTURE_ATTEMPTS; attempt += 1) {\n      if (this.stopped || this.cdpSession !== cdpSession) {\n        return;\n      }\n\n      try {\n        const screenshotData = await this.captureCurrentFrame(cdpSession);\n        if (this.stopped || this.cdpSession !== cdpSession) {\n          return;\n        }\n\n        const frameBuffer = Buffer.from(screenshotData, \"base64\");\n        this.lastFrameBuffer = frameBuffer;\n        this.lastFrameSentAt = Date.now();\n        this.broadcastFrame(frameBuffer);\n        return;\n      } catch (error) {\n        lastError = error;\n      }\n\n      if (attempt < INITIAL_FRAME_CAPTURE_ATTEMPTS) {\n        await new Promise((resolve) => setTimeout(resolve, INITIAL_FRAME_CAPTURE_RETRY_DELAY_MS));\n      }\n    }\n\n    if (lastError instanceof Error) {\n      throw lastError;\n    }\n\n    throw new Error(\"Failed to capture initial stream screenshot.\");\n  }\n\n  private async captureCurrentFrame(cdpSession: CDPSession): Promise<string> {\n    const primaryParams = {\n      format: \"jpeg\" as const,\n      quality: this.deps.quality,\n      optimizeForSpeed: true as const,\n    };\n    try {\n      const result = (await cdpSession.send(\"Page.captureScreenshot\", primaryParams)) as {\n        readonly data?: unknown;\n      } | null;\n      if (result && typeof result.data === \"string\" && result.data.length > 0) {\n        return result.data;\n      }\n    } catch {}\n\n    const fallbackResult = (await cdpSession.send(\"Page.captureScreenshot\", {\n      format: \"jpeg\",\n      quality: this.deps.quality,\n    })) as {\n      readonly data?: unknown;\n    } | null;\n    if (\n      !fallbackResult ||\n      typeof fallbackResult.data !== \"string\" ||\n      fallbackResult.data.length === 0\n    ) {\n      throw new Error(\"Failed to capture initial stream screenshot.\");\n    }\n\n    return fallbackResult.data;\n  }\n\n  private getRequestedScreencastSize(): RequestedStreamSize | null {\n    if (this.clients.size === 0 || !this.activeViewport) {\n      return null;\n    }\n\n    const requestedSizes: RequestedStreamSize[] = [];\n    for (const client of this.clients) {\n      const requestedSize = this.clientStateBySocket.get(client)?.requestedRenderSize ?? null;\n      if (!requestedSize) {\n        return null;\n      }\n      requestedSizes.push(requestedSize);\n    }\n\n    return selectScreencastSize({\n      viewport: this.activeViewport,\n      requestedSizes,\n    });\n  }\n\n  private getRequestedScreencastSizeKey(): string | null {\n    const size = this.getRequestedScreencastSize();\n    return size ? `${size.width}x${size.height}` : null;\n  }\n}\n\nasync function readViewportForPage(page: Page): Promise<OpensteerViewport | null> {\n  const cdp = await page.context().newCDPSession(page);\n  try {\n    const result = (await cdp.send(\"Page.getLayoutMetrics\")) as {\n      readonly cssVisualViewport?: {\n        readonly clientWidth?: unknown;\n        readonly clientHeight?: unknown;\n      };\n      readonly cssLayoutViewport?: {\n        readonly clientWidth?: unknown;\n        readonly clientHeight?: unknown;\n      };\n      readonly visualViewport?: {\n        readonly clientWidth?: unknown;\n        readonly clientHeight?: unknown;\n      };\n      readonly layoutViewport?: {\n        readonly clientWidth?: unknown;\n        readonly clientHeight?: unknown;\n      };\n    } | null;\n    const candidates = [\n      result?.cssVisualViewport,\n      result?.cssLayoutViewport,\n      result?.visualViewport,\n      result?.layoutViewport,\n    ];\n\n    for (const candidate of candidates) {\n      const width = normalizeViewportDimension(candidate?.clientWidth);\n      const height = normalizeViewportDimension(candidate?.clientHeight);\n      if (width !== null && height !== null) {\n        return { width, height };\n      }\n    }\n    return null;\n  } catch {\n    const viewportSize = page.viewportSize();\n    if (!viewportSize) {\n      return null;\n    }\n    const width = normalizeViewportDimension(viewportSize.width);\n    const height = normalizeViewportDimension(viewportSize.height);\n    return width !== null && height !== null ? { width, height } : null;\n  } finally {\n    await cdp.detach().catch(() => undefined);\n  }\n}\n\nfunction normalizeViewportDimension(value: unknown): number | null {\n  if (typeof value !== \"number\" || !Number.isFinite(value)) {\n    return null;\n  }\n\n  const normalized = Math.floor(value);\n  if (normalized < 100) {\n    return null;\n  }\n  return Math.min(8_192, normalized);\n}\n\nfunction readTextFrame(raw: RawData): string {\n  if (typeof raw === \"string\") {\n    return raw;\n  }\n  if (raw instanceof ArrayBuffer) {\n    return Buffer.from(raw).toString(\"utf8\");\n  }\n  if (Array.isArray(raw)) {\n    return Buffer.concat(raw).toString(\"utf8\");\n  }\n  return raw.toString(\"utf8\");\n}\n\nasync function connectPlaywrightChromiumBrowser(input: { readonly url: string }): Promise<Browser> {\n  const { connectPlaywrightChromiumBrowser: connect } =\n    await import(\"@opensteer/engine-playwright\");\n  return connect(input);\n}\n\nasync function disconnectPlaywrightChromiumBrowser(browser: Browser): Promise<void> {\n  const { disconnectPlaywrightChromiumBrowser: disconnect } =\n    await import(\"@opensteer/engine-playwright\");\n  await disconnect(browser);\n}\n\nasync function resolvePersistedActivePage(\n  pages: readonly Page[],\n  input: {\n    readonly activePageUrl?: string;\n    readonly activePageTitle?: string;\n  },\n): Promise<Page | null> {\n  if (pages.length === 0) {\n    return null;\n  }\n  if (input.activePageUrl === undefined && input.activePageTitle === undefined) {\n    return null;\n  }\n\n  const matchesByUrl =\n    input.activePageUrl === undefined\n      ? pages\n      : pages.filter((page) => page.url() === input.activePageUrl);\n  if (matchesByUrl.length === 0) {\n    return null;\n  }\n  if (input.activePageTitle === undefined) {\n    return matchesByUrl[0] ?? null;\n  }\n\n  for (const page of matchesByUrl) {\n    const title = await page.title().catch(() => \"\");\n    if (title === input.activePageTitle) {\n      return page;\n    }\n  }\n\n  return matchesByUrl[0] ?? null;\n}\n","import { randomBytes } from \"node:crypto\";\n\nimport { startLocalViewServer } from \"./server.js\";\n\nexport async function runLocalViewService(): Promise<void> {\n  const server = await startLocalViewServer({\n    token: process.env.OPENSTEER_LOCAL_VIEW_BOOT_TOKEN ?? randomBytes(24).toString(\"hex\"),\n    onClosed: () => {\n      process.exit(0);\n    },\n  });\n\n  const handleShutdownSignal = () => {\n    void server.close();\n  };\n  process.once(\"SIGINT\", handleShutdownSignal);\n  process.once(\"SIGTERM\", handleShutdownSignal);\n\n  await new Promise<void>(() => undefined);\n}\n","#!/usr/bin/env node\n\nimport { runLocalViewService } from \"./serve.js\";\n\nrunLocalViewService().catch((error) => {\n  const payload =\n    error instanceof Error\n      ? {\n          error: {\n            name: error.name,\n            message: error.message,\n          },\n        }\n      : {\n          error: {\n            name: \"Error\",\n            message: String(error),\n          },\n        };\n  process.stderr.write(`${JSON.stringify(payload)}\\n`);\n  process.exitCode = 1;\n});\n"]}