opensteer 0.8.9 → 0.8.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sdk/opensteer.ts"],"names":[],"mappings":";;;;AA2OO,IAAM,YAAN,MAAgB;AAAA,EACJ,OAAA;AAAA,EACA,cAAA;AAAA,EACR,OAAA;AAAA,EAET,WAAA,CAAY,OAAA,GAA4B,EAAC,EAAG;AAC1C,IAAA,MAAM,WAAA,GAAc,2BAAA,CAA4B,OAAA,CAAQ,OAAO,CAAA;AAC/D,IAAA,MAAM,EAAE,QAAA,EAAU,UAAA,EAAY,GAAG,gBAAe,GAAI,OAAA;AACpD,IAAA,MAAM,gBAAgB,6BAAA,CAA8B;AAAA,MAClD,GAAI,QAAA,KAAa,MAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAS;AAAA,MAC7C;AAAA,KACD,CAAA;AAED,IAAA,IAAI,aAAA,CAAc,QAAA,CAAS,IAAA,KAAS,OAAA,EAAS;AAC3C,MAAA,IAAA,CAAK,cAAA,GAAiB,MAAA;AACtB,MAAA,IAAA,CAAK,UAAU,8BAAA,CAA+B;AAAA,QAC5C,GAAI,QAAA,KAAa,MAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAS;AAAA,QAC7C,GAAI,UAAA,KAAe,MAAA,GAAY,EAAC,GAAI,EAAE,QAAQ,UAAA,EAAW;AAAA,QACzD,WAAA;AAAA,QACA,cAAA,EAAgB;AAAA,UACd,GAAG;AAAA;AACL,OACD,CAAA;AACD,MAAA,IAAA,CAAK,UAAU,kCAAA,EAAmC;AAClD,MAAA;AAAA,IACF;AAEA,IAAA,IAAA,CAAK,cAAA,GAAiB,IAAI,uBAAA,CAAwB;AAAA,MAChD,GAAI,eAAe,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,cAAA,CAAe,OAAA,EAAQ;AAAA,MA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,GAAI,EAAE,oBAAA,EAAsB,KAAA,CAAM,WAAA,EAAY;AAAA,MACrF,GAAI,MAAM,cAAA,KAAmB,MAAA,GAAY,EAAC,GAAI,EAAE,cAAA,EAAgB,KAAA,CAAM,cAAA;AAAe,KACvF;AAAA,EACF;AAEA,EAAA,IAAI,WAAA,EAAa;AACf,IAAA,OAAO;AAAA,MACL,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM,UAAA;AAAA,QACN,UAAU,KAAA,CAAM;AAAA,OAClB;AAAA,MACA,GAAI,MAAM,WAAA,KAAgB,MAAA,GAAY,EAAC,GAAI,EAAE,oBAAA,EAAsB,KAAA,CAAM,WAAA,EAAY;AAAA,MACrF,GAAI,MAAM,cAAA,KAAmB,MAAA,GAAY,EAAC,GAAI,EAAE,cAAA,EAAgB,KAAA,CAAM,cAAA;AAAe,KACvF;AAAA,EACF;AAEA,EAAA,IAAI,KAAA,CAAM,gBAAgB,MAAA,EAAW;AACnC,IAAA,MAAM,IAAI,MAAM,2DAA2D,CAAA;AAAA,EAC7E;AAEA,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,aAAA;AAAA,MACN,aAAa,KAAA,CAAM;AAAA,KACrB;AAAA,IACA,GAAI,MAAM,cAAA,KAAmB,MAAA,GAAY,EAAC,GAAI,EAAE,cAAA,EAAgB,KAAA,CAAM,cAAA;AAAe,GACvF;AACF;AAEA,SAAS,MAAM,EAAA,EAA2B;AACxC,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,YAAY,UAAA,CAAW,OAAA,EAAS,EAAE,CAAC,CAAA;AACzD","file":"index.js","sourcesContent":["import type {\n OpensteerArtifactReadInput,\n OpensteerArtifactReadOutput,\n CookieRecord,\n OpensteerAddInitScriptInput,\n OpensteerAddInitScriptOutput,\n OpensteerCaptchaSolveInput,\n OpensteerCaptchaSolveOutput,\n OpensteerCaptureScriptsInput,\n OpensteerCaptureScriptsOutput,\n OpensteerGetRecipeInput,\n OpensteerGetAuthRecipeInput,\n OpensteerActionResult,\n OpensteerComputerExecuteInput,\n OpensteerComputerExecuteOutput,\n OpensteerDomExtractOutput,\n OpensteerGetRequestPlanInput,\n OpensteerInferRequestPlanInput,\n OpensteerListRecipesInput,\n OpensteerListRecipesOutput,\n OpensteerListAuthRecipesInput,\n OpensteerListAuthRecipesOutput,\n OpensteerNetworkClearInput,\n OpensteerNetworkClearOutput,\n OpensteerNetworkDiffInput,\n OpensteerNetworkDiffOutput,\n OpensteerNetworkMinimizeInput,\n OpensteerNetworkMinimizeOutput,\n OpensteerNetworkQueryInput,\n OpensteerNetworkQueryOutput,\n OpensteerNetworkTagInput,\n OpensteerNetworkTagOutput,\n OpensteerInteractionCaptureInput,\n OpensteerInteractionCaptureOutput,\n OpensteerInteractionDiffInput,\n OpensteerInteractionDiffOutput,\n OpensteerInteractionGetInput,\n OpensteerInteractionGetOutput,\n OpensteerInteractionReplayInput,\n OpensteerInteractionReplayOutput,\n OpensteerPageActivateInput,\n OpensteerPageActivateOutput,\n OpensteerPageCloseInput,\n OpensteerPageCloseOutput,\n OpensteerPageEvaluateInput,\n OpensteerPageEvaluateOutput,\n OpensteerPageGotoInput,\n OpensteerPageGotoOutput,\n OpensteerPageListInput,\n OpensteerPageListOutput,\n OpensteerPageNewInput,\n OpensteerPageNewOutput,\n OpensteerPageSnapshotInput,\n OpensteerPageSnapshotOutput,\n OpensteerListRequestPlansInput,\n OpensteerListRequestPlansOutput,\n OpensteerRawRequestInput,\n OpensteerRawRequestOutput,\n OpensteerRequestExecuteInput,\n OpensteerRequestExecuteOutput,\n OpensteerRunRecipeInput,\n OpensteerRunRecipeOutput,\n OpensteerRunAuthRecipeInput,\n OpensteerRunAuthRecipeOutput,\n OpensteerSessionInfo,\n OpensteerScriptBeautifyInput,\n OpensteerScriptBeautifyOutput,\n OpensteerScriptDeobfuscateInput,\n OpensteerScriptDeobfuscateOutput,\n OpensteerScriptSandboxInput,\n OpensteerScriptSandboxOutput,\n OpensteerReverseExportInput,\n OpensteerReverseExportOutput,\n OpensteerReverseDiscoverInput,\n OpensteerReverseDiscoverOutput,\n OpensteerReverseQueryInput,\n OpensteerReverseQueryOutput,\n OpensteerReversePackageCreateInput,\n OpensteerReversePackageCreateOutput,\n OpensteerReversePackageGetInput,\n OpensteerReversePackageGetOutput,\n OpensteerReversePackageListInput,\n OpensteerReversePackageListOutput,\n OpensteerReversePackagePatchInput,\n OpensteerReversePackagePatchOutput,\n OpensteerReversePackageRunInput,\n OpensteerReversePackageRunOutput,\n OpensteerReverseReportInput,\n OpensteerReverseReportOutput,\n OpensteerSessionCloseOutput,\n OpensteerOpenInput,\n OpensteerOpenOutput,\n OpensteerSnapshotMode,\n OpensteerTargetInput,\n OpensteerTransportProbeInput,\n OpensteerTransportProbeOutput,\n OpensteerWriteRecipeInput,\n OpensteerWriteAuthRecipeInput,\n OpensteerWriteRequestPlanInput,\n StorageSnapshot,\n} from \"@opensteer/protocol\";\n\nimport type { AuthRecipeRecord, RecipeRecord, RequestPlanRecord } from \"../registry.js\";\nimport {\n OpensteerBrowserManager,\n type OpensteerBrowserStatus,\n type WorkspaceBrowserManifest,\n} from \"../browser-manager.js\";\nimport { resolveOpensteerEnvironment } from \"../env.js\";\nimport { OpensteerRuntime, type OpensteerRuntimeOptions } from \"./runtime.js\";\nimport {\n createOpensteerSemanticRuntime,\n resolveOpensteerRuntimeConfig,\n} from \"./runtime-resolution.js\";\nimport type { OpensteerProviderOptions } from \"../provider/config.js\";\nimport type {\n OpensteerInterceptScriptOptions,\n OpensteerInstrumentableRuntime,\n OpensteerRouteOptions,\n OpensteerRouteRegistration,\n} from \"./instrumentation.js\";\nimport type { OpensteerDisconnectableRuntime } from \"./semantic-runtime.js\";\n\nexport interface OpensteerTargetOptions {\n readonly element?: number;\n readonly selector?: string;\n readonly description?: string;\n readonly captureNetwork?: string;\n}\n\nexport interface OpensteerInputOptions extends OpensteerTargetOptions {\n readonly text: string;\n readonly pressEnter?: boolean;\n}\n\nexport interface OpensteerScrollOptions extends OpensteerTargetOptions {\n readonly direction: \"up\" | \"down\" | \"left\" | \"right\";\n readonly amount: number;\n}\n\nexport interface OpensteerExtractOptions {\n readonly description: string;\n readonly schema?: Record<string, unknown>;\n}\n\nexport interface OpensteerWaitForNetworkOptions extends OpensteerNetworkQueryInput {\n readonly timeoutMs?: number;\n readonly pollIntervalMs?: number;\n}\n\nexport interface OpensteerWaitForPageOptions {\n readonly openerPageRef?: string;\n readonly urlIncludes?: string;\n readonly timeoutMs?: number;\n readonly pollIntervalMs?: number;\n}\n\nexport type OpensteerGotoOptions = OpensteerPageGotoInput;\nexport type OpensteerSnapshotOptions = OpensteerSnapshotMode | OpensteerPageSnapshotInput;\nexport type OpensteerSnapshotResult = OpensteerPageSnapshotOutput;\n\nexport type OpensteerComputerExecuteOptions = OpensteerComputerExecuteInput;\nexport type OpensteerComputerExecuteResult = OpensteerComputerExecuteOutput;\nexport type OpensteerNetworkQueryOptions = OpensteerNetworkQueryInput;\nexport type OpensteerNetworkQueryResult = OpensteerNetworkQueryOutput;\nexport type OpensteerNetworkTagOptions = OpensteerNetworkTagInput;\nexport type OpensteerNetworkTagResult = OpensteerNetworkTagOutput;\nexport type OpensteerNetworkMinimizeOptions = OpensteerNetworkMinimizeInput;\nexport type OpensteerNetworkMinimizeResult = OpensteerNetworkMinimizeOutput;\nexport type OpensteerNetworkDiffOptions = OpensteerNetworkDiffInput;\nexport type OpensteerNetworkDiffResult = OpensteerNetworkDiffOutput;\nexport type OpensteerNetworkProbeOptions = OpensteerTransportProbeInput;\nexport type OpensteerNetworkProbeResult = OpensteerTransportProbeOutput;\nexport type OpensteerReverseDiscoverOptions = OpensteerReverseDiscoverInput;\nexport type OpensteerReverseDiscoverResult = OpensteerReverseDiscoverOutput;\nexport type OpensteerReverseQueryOptions = OpensteerReverseQueryInput;\nexport type OpensteerReverseQueryResult = OpensteerReverseQueryOutput;\nexport type OpensteerReversePackageCreateOptions = OpensteerReversePackageCreateInput;\nexport type OpensteerReversePackageCreateResult = OpensteerReversePackageCreateOutput;\nexport type OpensteerReversePackageRunOptions = OpensteerReversePackageRunInput;\nexport type OpensteerReversePackageRunResult = OpensteerReversePackageRunOutput;\nexport type OpensteerReverseExportOptions = OpensteerReverseExportInput;\nexport type OpensteerReverseExportResult = OpensteerReverseExportOutput;\nexport type OpensteerReverseReportOptions = OpensteerReverseReportInput;\nexport type OpensteerReverseReportResult = OpensteerReverseReportOutput;\nexport type OpensteerReversePackageGetOptions = OpensteerReversePackageGetInput;\nexport type OpensteerReversePackageGetResult = OpensteerReversePackageGetOutput;\nexport type OpensteerReversePackageListOptions = OpensteerReversePackageListInput;\nexport type OpensteerReversePackageListResult = OpensteerReversePackageListOutput;\nexport type OpensteerReversePackagePatchOptions = OpensteerReversePackagePatchInput;\nexport type OpensteerReversePackagePatchResult = OpensteerReversePackagePatchOutput;\nexport type OpensteerInteractionCaptureOptions = OpensteerInteractionCaptureInput;\nexport type OpensteerInteractionCaptureResult = OpensteerInteractionCaptureOutput;\nexport type OpensteerInteractionGetOptions = OpensteerInteractionGetInput;\nexport type OpensteerInteractionGetResult = OpensteerInteractionGetOutput;\nexport type OpensteerInteractionDiffOptions = OpensteerInteractionDiffInput;\nexport type OpensteerInteractionDiffResult = OpensteerInteractionDiffOutput;\nexport type OpensteerInteractionReplayOptions = OpensteerInteractionReplayInput;\nexport type OpensteerInteractionReplayResult = OpensteerInteractionReplayOutput;\nexport type OpensteerNetworkClearOptions = OpensteerNetworkClearInput;\nexport type OpensteerNetworkClearResult = OpensteerNetworkClearOutput;\nexport type OpensteerRawRequestOptions = OpensteerRawRequestInput;\nexport type OpensteerRawRequestResult = OpensteerRawRequestOutput;\nexport type OpensteerRequestOptions = Omit<OpensteerRequestExecuteInput, \"key\">;\nexport type OpensteerRequestResult = OpensteerRequestExecuteOutput;\nexport type OpensteerCaptureScriptsOptions = OpensteerCaptureScriptsInput;\nexport type OpensteerCaptureScriptsResult = OpensteerCaptureScriptsOutput;\nexport type OpensteerScriptBeautifyOptions = OpensteerScriptBeautifyInput;\nexport type OpensteerScriptBeautifyResult = OpensteerScriptBeautifyOutput;\nexport type OpensteerScriptDeobfuscateOptions = OpensteerScriptDeobfuscateInput;\nexport type OpensteerScriptDeobfuscateResult = OpensteerScriptDeobfuscateOutput;\nexport type OpensteerScriptSandboxOptions = OpensteerScriptSandboxInput;\nexport type OpensteerScriptSandboxResult = OpensteerScriptSandboxOutput;\nexport type OpensteerArtifactReadOptions = OpensteerArtifactReadInput;\nexport type OpensteerArtifactReadResult = OpensteerArtifactReadOutput;\nexport type OpensteerCaptchaSolveOptions = OpensteerCaptchaSolveInput;\nexport type OpensteerCaptchaSolveResult = OpensteerCaptchaSolveOutput;\nexport type OpensteerAddInitScriptOptions = OpensteerAddInitScriptInput;\n\nexport interface OpensteerOptions extends OpensteerRuntimeOptions {\n readonly provider?: OpensteerProviderOptions;\n}\n\nexport interface OpensteerBrowserCloneOptions {\n readonly sourceUserDataDir: string;\n readonly sourceProfileDirectory?: string;\n}\n\nexport interface OpensteerBrowserController {\n status(): Promise<OpensteerBrowserStatus>;\n clone(input: OpensteerBrowserCloneOptions): Promise<WorkspaceBrowserManifest>;\n reset(): Promise<void>;\n delete(): Promise<void>;\n}\n\nexport class Opensteer {\n private readonly runtime: OpensteerDisconnectableRuntime;\n private readonly browserManager: OpensteerBrowserManager | undefined;\n readonly browser: OpensteerBrowserController;\n\n constructor(options: OpensteerOptions = {}) {\n const environment = resolveOpensteerEnvironment(options.rootDir);\n const { provider, engineName, ...runtimeOptions } = options;\n const runtimeConfig = resolveOpensteerRuntimeConfig({\n ...(provider === undefined ? {} : { provider }),\n environment,\n });\n\n if (runtimeConfig.provider.mode === \"cloud\") {\n this.browserManager = undefined;\n this.runtime = createOpensteerSemanticRuntime({\n ...(provider === undefined ? {} : { provider }),\n ...(engineName === undefined ? {} : { engine: engineName }),\n environment,\n runtimeOptions: {\n ...runtimeOptions,\n },\n });\n this.browser = createUnsupportedBrowserController();\n return;\n }\n\n this.browserManager = new OpensteerBrowserManager({\n ...(runtimeOptions.rootDir === undefined ? {} : { rootDir: runtimeOptions.rootDir }),\n ...(runtimeOptions.rootPath === undefined ? {} : { rootPath: runtimeOptions.rootPath }),\n ...(runtimeOptions.workspace === undefined ? {} : { workspace: runtimeOptions.workspace }),\n ...(engineName === undefined ? {} : { engineName }),\n ...(runtimeOptions.browser === undefined ? {} : { browser: runtimeOptions.browser }),\n ...(runtimeOptions.launch === undefined ? {} : { launch: runtimeOptions.launch }),\n ...(runtimeOptions.context === undefined ? {} : { context: runtimeOptions.context }),\n });\n this.runtime = createOpensteerSemanticRuntime({\n ...(provider === undefined ? {} : { provider }),\n ...(engineName === undefined ? {} : { engine: engineName }),\n environment,\n runtimeOptions: {\n ...runtimeOptions,\n rootPath: this.browserManager.rootPath,\n cleanupRootOnClose: this.browserManager.cleanupRootOnDisconnect,\n },\n });\n this.browser = {\n status: () => this.browserManager!.status(),\n clone: (input) => this.browserManager!.clonePersistentBrowser(input),\n reset: () => this.browserManager!.reset(),\n delete: () => this.browserManager!.delete(),\n };\n }\n\n async open(input: string | OpensteerOpenInput = {}): Promise<OpensteerOpenOutput> {\n return this.runtime.open(typeof input === \"string\" ? { url: input } : input);\n }\n\n async info(): Promise<OpensteerSessionInfo> {\n return this.runtime.info();\n }\n\n async listPages(input: OpensteerPageListInput = {}): Promise<OpensteerPageListOutput> {\n return this.runtime.listPages(input);\n }\n\n async newPage(input: OpensteerPageNewInput = {}): Promise<OpensteerPageNewOutput> {\n return this.runtime.newPage(input);\n }\n\n async activatePage(input: OpensteerPageActivateInput): Promise<OpensteerPageActivateOutput> {\n return this.runtime.activatePage(input);\n }\n\n async closePage(input: OpensteerPageCloseInput = {}): Promise<OpensteerPageCloseOutput> {\n return this.runtime.closePage(input);\n }\n\n async goto(input: string | OpensteerGotoOptions): Promise<OpensteerPageGotoOutput> {\n return this.runtime.goto(typeof input === \"string\" ? { url: input } : input);\n }\n\n async evaluate(\n input: string | OpensteerPageEvaluateInput,\n ): Promise<OpensteerPageEvaluateOutput[\"value\"]> {\n const normalized =\n typeof input === \"string\"\n ? {\n script: input,\n }\n : input;\n const result = await this.runtime.evaluate(normalized);\n return result.value;\n }\n\n async evaluateJson(\n input: string | OpensteerPageEvaluateInput,\n ): Promise<OpensteerPageEvaluateOutput[\"value\"]> {\n return this.evaluate(input);\n }\n\n async addInitScript(\n input: string | OpensteerAddInitScriptInput,\n ): Promise<OpensteerAddInitScriptOutput> {\n const normalized =\n typeof input === \"string\"\n ? {\n script: input,\n }\n : input;\n return this.runtime.addInitScript(normalized);\n }\n\n async click(input: OpensteerTargetOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.click(normalized);\n }\n\n async hover(input: OpensteerTargetOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.hover(normalized);\n }\n\n async input(input: OpensteerInputOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.input({\n ...normalized,\n text: input.text,\n ...(input.pressEnter === undefined ? {} : { pressEnter: input.pressEnter }),\n });\n }\n\n async scroll(input: OpensteerScrollOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.scroll({\n ...normalized,\n direction: input.direction,\n amount: input.amount,\n });\n }\n\n async extract(input: OpensteerExtractOptions): Promise<OpensteerDomExtractOutput[\"data\"]> {\n const result = await this.runtime.extract(input);\n return result.data;\n }\n\n async queryNetwork(\n input: OpensteerNetworkQueryOptions = {},\n ): Promise<OpensteerNetworkQueryResult> {\n return this.runtime.queryNetwork(input);\n }\n\n async waitForNetwork(\n input: OpensteerWaitForNetworkOptions,\n ): Promise<OpensteerNetworkQueryResult[\"records\"][number]> {\n const { timeoutMs, pollIntervalMs, ...query } = input;\n const timeoutAt = Date.now() + (timeoutMs ?? 30_000);\n const pollInterval = pollIntervalMs ?? 100;\n const baseline = new Set(\n (\n await this.runtime.queryNetwork({\n ...query,\n limit: 200,\n })\n ).records.map((record) => record.recordId),\n );\n\n while (true) {\n const { records } = await this.runtime.queryNetwork({\n ...query,\n limit: 200,\n });\n const next = records.find((record) => !baseline.has(record.recordId));\n if (next !== undefined) {\n return next;\n }\n if (Date.now() >= timeoutAt) {\n throw new Error(\"waitForNetwork timed out\");\n }\n await delay(pollInterval);\n }\n }\n\n async waitForResponse(\n input: OpensteerWaitForNetworkOptions,\n ): Promise<OpensteerNetworkQueryResult[\"records\"][number]> {\n return this.waitForNetwork(input);\n }\n\n async waitForPage(\n input: OpensteerWaitForPageOptions = {},\n ): Promise<OpensteerPageListOutput[\"pages\"][number]> {\n const baseline = new Set((await this.runtime.listPages()).pages.map((page) => page.pageRef));\n const timeoutAt = Date.now() + (input.timeoutMs ?? 30_000);\n const pollIntervalMs = input.pollIntervalMs ?? 100;\n\n while (true) {\n const { pages } = await this.runtime.listPages();\n const match = pages.find((page) => {\n if (baseline.has(page.pageRef)) {\n return false;\n }\n if (input.openerPageRef !== undefined && page.openerPageRef !== input.openerPageRef) {\n return false;\n }\n if (input.urlIncludes !== undefined && !page.url.includes(input.urlIncludes)) {\n return false;\n }\n return true;\n });\n if (match !== undefined) {\n return match;\n }\n if (Date.now() >= timeoutAt) {\n throw new Error(\"waitForPage timed out\");\n }\n await delay(pollIntervalMs);\n }\n }\n\n async snapshot(input: OpensteerSnapshotOptions = {}): Promise<OpensteerSnapshotResult> {\n return this.runtime.snapshot(typeof input === \"string\" ? { mode: input } : input);\n }\n\n async tagNetwork(input: OpensteerNetworkTagOptions): Promise<OpensteerNetworkTagResult> {\n return this.runtime.tagNetwork(input);\n }\n\n async minimizeNetwork(\n input: OpensteerNetworkMinimizeOptions,\n ): Promise<OpensteerNetworkMinimizeResult> {\n return this.runtime.minimizeNetwork(input);\n }\n\n async diffNetwork(input: OpensteerNetworkDiffOptions): Promise<OpensteerNetworkDiffResult> {\n return this.runtime.diffNetwork(input);\n }\n\n async probeNetwork(input: OpensteerNetworkProbeOptions): Promise<OpensteerNetworkProbeResult> {\n return this.runtime.probeNetwork(input);\n }\n\n async reverseDiscover(\n input: OpensteerReverseDiscoverOptions = {},\n ): Promise<OpensteerReverseDiscoverResult> {\n return this.runtime.discoverReverse(input);\n }\n\n async reverseQuery(input: OpensteerReverseQueryOptions): Promise<OpensteerReverseQueryResult> {\n return this.runtime.queryReverse(input);\n }\n\n async createReversePackage(\n input: OpensteerReversePackageCreateOptions,\n ): Promise<OpensteerReversePackageCreateResult> {\n return this.runtime.createReversePackage(input);\n }\n\n async runReversePackage(\n input: OpensteerReversePackageRunOptions,\n ): Promise<OpensteerReversePackageRunResult> {\n return this.runtime.runReversePackage(input);\n }\n\n async reverseExport(input: OpensteerReverseExportOptions): Promise<OpensteerReverseExportResult> {\n return this.runtime.exportReverse(input);\n }\n\n async reverseReport(input: OpensteerReverseReportOptions): Promise<OpensteerReverseReportResult> {\n return this.runtime.getReverseReport(input);\n }\n\n async getReversePackage(\n input: OpensteerReversePackageGetOptions,\n ): Promise<OpensteerReversePackageGetResult> {\n return this.runtime.getReversePackage(input);\n }\n\n async listReversePackages(\n input: OpensteerReversePackageListOptions = {},\n ): Promise<OpensteerReversePackageListResult> {\n return this.runtime.listReversePackages(input);\n }\n\n async patchReversePackage(\n input: OpensteerReversePackagePatchOptions,\n ): Promise<OpensteerReversePackagePatchResult> {\n return this.runtime.patchReversePackage(input);\n }\n\n async interactionCapture(\n input: OpensteerInteractionCaptureOptions,\n ): Promise<OpensteerInteractionCaptureResult> {\n return this.runtime.captureInteraction(input);\n }\n\n async getInteraction(\n input: OpensteerInteractionGetOptions,\n ): Promise<OpensteerInteractionGetResult> {\n return this.runtime.getInteraction(input);\n }\n\n async interactionDiff(\n input: OpensteerInteractionDiffOptions,\n ): Promise<OpensteerInteractionDiffResult> {\n return this.runtime.diffInteraction(input);\n }\n\n async interactionReplay(\n input: OpensteerInteractionReplayOptions,\n ): Promise<OpensteerInteractionReplayResult> {\n return this.runtime.replayInteraction(input);\n }\n\n async clearNetwork(\n input: OpensteerNetworkClearOptions = {},\n ): Promise<OpensteerNetworkClearResult> {\n return this.runtime.clearNetwork(input);\n }\n\n async captureScripts(\n input: OpensteerCaptureScriptsOptions = {},\n ): Promise<OpensteerCaptureScriptsResult> {\n return this.runtime.captureScripts(input);\n }\n\n async readArtifact(input: OpensteerArtifactReadOptions): Promise<OpensteerArtifactReadResult> {\n return this.runtime.readArtifact(input);\n }\n\n async beautifyScript(\n input: OpensteerScriptBeautifyOptions,\n ): Promise<OpensteerScriptBeautifyResult> {\n return this.runtime.beautifyScript(input);\n }\n\n async deobfuscateScript(\n input: OpensteerScriptDeobfuscateOptions,\n ): Promise<OpensteerScriptDeobfuscateResult> {\n return this.runtime.deobfuscateScript(input);\n }\n\n async sandboxScript(input: OpensteerScriptSandboxOptions): Promise<OpensteerScriptSandboxResult> {\n return this.runtime.sandboxScript(input);\n }\n\n async solveCaptcha(input: OpensteerCaptchaSolveOptions): Promise<OpensteerCaptchaSolveResult> {\n return this.runtime.solveCaptcha(input);\n }\n\n async getCookies(\n input: { readonly urls?: readonly string[] } = {},\n ): Promise<readonly CookieRecord[]> {\n return this.runtime.getCookies(input);\n }\n\n async getStorageSnapshot(\n input: {\n readonly includeSessionStorage?: boolean;\n readonly includeIndexedDb?: boolean;\n } = {},\n ): Promise<StorageSnapshot> {\n return this.runtime.getStorageSnapshot(input);\n }\n\n async writeRequestPlan(input: OpensteerWriteRequestPlanInput): Promise<RequestPlanRecord> {\n return this.runtime.writeRequestPlan(input);\n }\n\n async inferRequestPlan(input: OpensteerInferRequestPlanInput): Promise<RequestPlanRecord> {\n return this.runtime.inferRequestPlan(input);\n }\n\n async getRequestPlan(input: OpensteerGetRequestPlanInput): Promise<RequestPlanRecord> {\n return this.runtime.getRequestPlan(input);\n }\n\n async listRequestPlans(\n input: OpensteerListRequestPlansInput = {},\n ): Promise<OpensteerListRequestPlansOutput> {\n return this.runtime.listRequestPlans(input);\n }\n\n async writeAuthRecipe(input: OpensteerWriteAuthRecipeInput): Promise<AuthRecipeRecord> {\n return this.runtime.writeAuthRecipe(input);\n }\n\n async writeRecipe(input: OpensteerWriteRecipeInput): Promise<RecipeRecord> {\n return this.runtime.writeRecipe(input);\n }\n\n async getAuthRecipe(input: OpensteerGetAuthRecipeInput): Promise<AuthRecipeRecord> {\n return this.runtime.getAuthRecipe(input);\n }\n\n async getRecipe(input: OpensteerGetRecipeInput): Promise<RecipeRecord> {\n return this.runtime.getRecipe(input);\n }\n\n async listAuthRecipes(\n input: OpensteerListAuthRecipesInput = {},\n ): Promise<OpensteerListAuthRecipesOutput> {\n return this.runtime.listAuthRecipes(input);\n }\n\n async listRecipes(input: OpensteerListRecipesInput = {}): Promise<OpensteerListRecipesOutput> {\n return this.runtime.listRecipes(input);\n }\n\n async runAuthRecipe(input: OpensteerRunAuthRecipeInput): Promise<OpensteerRunAuthRecipeOutput> {\n return this.runtime.runAuthRecipe(input);\n }\n\n async runRecipe(input: OpensteerRunRecipeInput): Promise<OpensteerRunRecipeOutput> {\n return this.runtime.runRecipe(input);\n }\n\n async request(key: string, input: OpensteerRequestOptions = {}): Promise<OpensteerRequestResult> {\n return this.runtime.request({\n key,\n ...input,\n });\n }\n\n async rawRequest(input: OpensteerRawRequestOptions): Promise<OpensteerRawRequestResult> {\n return this.runtime.rawRequest(input);\n }\n\n async route(input: OpensteerRouteOptions): Promise<OpensteerRouteRegistration> {\n return this.requireOwnedInstrumentationRuntime(\"route\").route(input);\n }\n\n async interceptScript(\n input: OpensteerInterceptScriptOptions,\n ): Promise<OpensteerRouteRegistration> {\n return this.requireOwnedInstrumentationRuntime(\"interceptScript\").interceptScript(input);\n }\n\n async computerExecute(\n input: OpensteerComputerExecuteOptions,\n ): Promise<OpensteerComputerExecuteResult> {\n return this.runtime.computerExecute(input);\n }\n\n async close(): Promise<OpensteerSessionCloseOutput> {\n if (this.browserManager === undefined || this.browserManager.mode === \"temporary\") {\n return this.runtime.close();\n }\n\n const output = await this.runtime.close();\n await this.browserManager.close();\n return output;\n }\n\n async disconnect(): Promise<void> {\n await this.runtime.disconnect();\n }\n\n private requireOwnedInstrumentationRuntime(\n method: \"route\" | \"interceptScript\",\n ): OpensteerInstrumentableRuntime {\n if (isInstrumentableRuntime(this.runtime)) {\n return this.runtime;\n }\n throw new Error(`${method}() is not available for this session runtime.`);\n }\n}\n\nfunction isInstrumentableRuntime(\n runtime: OpensteerDisconnectableRuntime,\n): runtime is OpensteerDisconnectableRuntime & OpensteerInstrumentableRuntime {\n return (\n typeof (runtime as Partial<OpensteerInstrumentableRuntime>).route === \"function\" &&\n typeof (runtime as Partial<OpensteerInstrumentableRuntime>).interceptScript === \"function\"\n );\n}\n\nfunction createUnsupportedBrowserController(): OpensteerBrowserController {\n const fail = async (): Promise<never> => {\n throw new Error(\"browser.* helpers are only available in local mode.\");\n };\n\n return {\n status: fail,\n clone: fail,\n reset: fail,\n delete: fail,\n };\n}\n\nfunction normalizeTargetOptions(input: OpensteerTargetOptions): {\n readonly target: OpensteerTargetInput;\n readonly persistAsDescription?: string;\n readonly captureNetwork?: string;\n} {\n const hasElement = input.element !== undefined;\n const hasSelector = input.selector !== undefined;\n if (hasElement && hasSelector) {\n throw new Error(\"Specify exactly one of element, selector, or description.\");\n }\n\n if (hasElement) {\n return {\n target: {\n kind: \"element\",\n element: input.element!,\n },\n ...(input.description === undefined ? {} : { persistAsDescription: input.description }),\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n }\n\n if (hasSelector) {\n return {\n target: {\n kind: \"selector\",\n selector: input.selector!,\n },\n ...(input.description === undefined ? {} : { persistAsDescription: input.description }),\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n }\n\n if (input.description === undefined) {\n throw new Error(\"Specify exactly one of element, selector, or description.\");\n }\n\n return {\n target: {\n kind: \"description\",\n description: input.description,\n },\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n}\n\nfunction delay(ms: number): Promise<void> {\n return new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js","sourcesContent":["import type {\n OpensteerArtifactReadInput,\n OpensteerArtifactReadOutput,\n CookieRecord,\n OpensteerAddInitScriptInput,\n OpensteerAddInitScriptOutput,\n OpensteerCaptchaSolveInput,\n OpensteerCaptchaSolveOutput,\n OpensteerCaptureScriptsInput,\n OpensteerCaptureScriptsOutput,\n OpensteerGetRecipeInput,\n OpensteerGetAuthRecipeInput,\n OpensteerActionResult,\n OpensteerComputerExecuteInput,\n OpensteerComputerExecuteOutput,\n OpensteerComputerKeyModifier,\n OpensteerComputerMouseButton,\n OpensteerDomExtractOutput,\n OpensteerGetRequestPlanInput,\n OpensteerInferRequestPlanInput,\n OpensteerListRecipesInput,\n OpensteerListRecipesOutput,\n OpensteerListAuthRecipesInput,\n OpensteerListAuthRecipesOutput,\n OpensteerNetworkClearInput,\n OpensteerNetworkClearOutput,\n OpensteerNetworkDiffInput,\n OpensteerNetworkDiffOutput,\n OpensteerNetworkMinimizeInput,\n OpensteerNetworkMinimizeOutput,\n OpensteerNetworkQueryInput,\n OpensteerNetworkQueryOutput,\n OpensteerNetworkTagInput,\n OpensteerNetworkTagOutput,\n OpensteerInteractionCaptureInput,\n OpensteerInteractionCaptureOutput,\n OpensteerInteractionDiffInput,\n OpensteerInteractionDiffOutput,\n OpensteerInteractionGetInput,\n OpensteerInteractionGetOutput,\n OpensteerInteractionReplayInput,\n OpensteerInteractionReplayOutput,\n OpensteerPageActivateInput,\n OpensteerPageActivateOutput,\n OpensteerPageCloseInput,\n OpensteerPageCloseOutput,\n OpensteerPageEvaluateInput,\n OpensteerPageEvaluateOutput,\n OpensteerPageGotoInput,\n OpensteerPageGotoOutput,\n OpensteerPageListInput,\n OpensteerPageListOutput,\n OpensteerPageNewInput,\n OpensteerPageNewOutput,\n OpensteerPageSnapshotInput,\n OpensteerPageSnapshotOutput,\n OpensteerListRequestPlansInput,\n OpensteerListRequestPlansOutput,\n OpensteerRawRequestInput,\n OpensteerRawRequestOutput,\n OpensteerRequestExecuteInput,\n OpensteerRequestExecuteOutput,\n OpensteerRunRecipeInput,\n OpensteerRunRecipeOutput,\n OpensteerRunAuthRecipeInput,\n OpensteerRunAuthRecipeOutput,\n OpensteerSessionInfo,\n OpensteerScriptBeautifyInput,\n OpensteerScriptBeautifyOutput,\n OpensteerScriptDeobfuscateInput,\n OpensteerScriptDeobfuscateOutput,\n OpensteerScriptSandboxInput,\n OpensteerScriptSandboxOutput,\n OpensteerReverseExportInput,\n OpensteerReverseExportOutput,\n OpensteerReverseDiscoverInput,\n OpensteerReverseDiscoverOutput,\n OpensteerReverseQueryInput,\n OpensteerReverseQueryOutput,\n OpensteerReversePackageCreateInput,\n OpensteerReversePackageCreateOutput,\n OpensteerReversePackageGetInput,\n OpensteerReversePackageGetOutput,\n OpensteerReversePackageListInput,\n OpensteerReversePackageListOutput,\n OpensteerReversePackagePatchInput,\n OpensteerReversePackagePatchOutput,\n OpensteerReversePackageRunInput,\n OpensteerReversePackageRunOutput,\n OpensteerReverseReportInput,\n OpensteerReverseReportOutput,\n OpensteerSessionCloseOutput,\n OpensteerOpenInput,\n OpensteerOpenOutput,\n OpensteerSnapshotMode,\n OpensteerTargetInput,\n OpensteerTransportProbeInput,\n OpensteerTransportProbeOutput,\n OpensteerWriteRecipeInput,\n OpensteerWriteAuthRecipeInput,\n OpensteerWriteRequestPlanInput,\n StorageSnapshot,\n} from \"@opensteer/protocol\";\n\nimport type { AuthRecipeRecord, RecipeRecord, RequestPlanRecord } from \"../registry.js\";\nimport {\n OpensteerBrowserManager,\n type OpensteerBrowserStatus,\n type WorkspaceBrowserManifest,\n} from \"../browser-manager.js\";\nimport { resolveOpensteerEnvironment } from \"../env.js\";\nimport { OpensteerRuntime, type OpensteerRuntimeOptions } from \"./runtime.js\";\nimport {\n createOpensteerSemanticRuntime,\n resolveOpensteerRuntimeConfig,\n} from \"./runtime-resolution.js\";\nimport type { OpensteerProviderOptions } from \"../provider/config.js\";\nimport type {\n OpensteerInterceptScriptOptions,\n OpensteerInstrumentableRuntime,\n OpensteerRouteOptions,\n OpensteerRouteRegistration,\n} from \"./instrumentation.js\";\nimport type { OpensteerDisconnectableRuntime } from \"./semantic-runtime.js\";\n\nexport interface OpensteerTargetOptions {\n readonly element?: number;\n readonly selector?: string;\n readonly description?: string;\n readonly captureNetwork?: string;\n}\n\nexport interface OpensteerClickOptions extends OpensteerTargetOptions {\n readonly button?: OpensteerComputerMouseButton;\n readonly clickCount?: number;\n readonly modifiers?: readonly OpensteerComputerKeyModifier[];\n}\n\nexport interface OpensteerInputOptions extends OpensteerTargetOptions {\n readonly text: string;\n readonly pressEnter?: boolean;\n}\n\nexport interface OpensteerScrollOptions extends OpensteerTargetOptions {\n readonly direction: \"up\" | \"down\" | \"left\" | \"right\";\n readonly amount: number;\n}\n\nexport interface OpensteerExtractOptions {\n readonly description: string;\n readonly schema?: Record<string, unknown>;\n}\n\nexport interface OpensteerWaitForNetworkOptions extends OpensteerNetworkQueryInput {\n readonly timeoutMs?: number;\n readonly pollIntervalMs?: number;\n}\n\nexport interface OpensteerWaitForPageOptions {\n readonly openerPageRef?: string;\n readonly urlIncludes?: string;\n readonly timeoutMs?: number;\n readonly pollIntervalMs?: number;\n}\n\nexport type OpensteerGotoOptions = OpensteerPageGotoInput;\nexport type OpensteerSnapshotOptions = OpensteerSnapshotMode | OpensteerPageSnapshotInput;\nexport type OpensteerSnapshotResult = OpensteerPageSnapshotOutput;\n\nexport type OpensteerComputerExecuteOptions = OpensteerComputerExecuteInput;\nexport type OpensteerComputerExecuteResult = OpensteerComputerExecuteOutput;\nexport type OpensteerNetworkQueryOptions = OpensteerNetworkQueryInput;\nexport type OpensteerNetworkQueryResult = OpensteerNetworkQueryOutput;\nexport type OpensteerNetworkTagOptions = OpensteerNetworkTagInput;\nexport type OpensteerNetworkTagResult = OpensteerNetworkTagOutput;\nexport type OpensteerNetworkMinimizeOptions = OpensteerNetworkMinimizeInput;\nexport type OpensteerNetworkMinimizeResult = OpensteerNetworkMinimizeOutput;\nexport type OpensteerNetworkDiffOptions = OpensteerNetworkDiffInput;\nexport type OpensteerNetworkDiffResult = OpensteerNetworkDiffOutput;\nexport type OpensteerNetworkProbeOptions = OpensteerTransportProbeInput;\nexport type OpensteerNetworkProbeResult = OpensteerTransportProbeOutput;\nexport type OpensteerReverseDiscoverOptions = OpensteerReverseDiscoverInput;\nexport type OpensteerReverseDiscoverResult = OpensteerReverseDiscoverOutput;\nexport type OpensteerReverseQueryOptions = OpensteerReverseQueryInput;\nexport type OpensteerReverseQueryResult = OpensteerReverseQueryOutput;\nexport type OpensteerReversePackageCreateOptions = OpensteerReversePackageCreateInput;\nexport type OpensteerReversePackageCreateResult = OpensteerReversePackageCreateOutput;\nexport type OpensteerReversePackageRunOptions = OpensteerReversePackageRunInput;\nexport type OpensteerReversePackageRunResult = OpensteerReversePackageRunOutput;\nexport type OpensteerReverseExportOptions = OpensteerReverseExportInput;\nexport type OpensteerReverseExportResult = OpensteerReverseExportOutput;\nexport type OpensteerReverseReportOptions = OpensteerReverseReportInput;\nexport type OpensteerReverseReportResult = OpensteerReverseReportOutput;\nexport type OpensteerReversePackageGetOptions = OpensteerReversePackageGetInput;\nexport type OpensteerReversePackageGetResult = OpensteerReversePackageGetOutput;\nexport type OpensteerReversePackageListOptions = OpensteerReversePackageListInput;\nexport type OpensteerReversePackageListResult = OpensteerReversePackageListOutput;\nexport type OpensteerReversePackagePatchOptions = OpensteerReversePackagePatchInput;\nexport type OpensteerReversePackagePatchResult = OpensteerReversePackagePatchOutput;\nexport type OpensteerInteractionCaptureOptions = OpensteerInteractionCaptureInput;\nexport type OpensteerInteractionCaptureResult = OpensteerInteractionCaptureOutput;\nexport type OpensteerInteractionGetOptions = OpensteerInteractionGetInput;\nexport type OpensteerInteractionGetResult = OpensteerInteractionGetOutput;\nexport type OpensteerInteractionDiffOptions = OpensteerInteractionDiffInput;\nexport type OpensteerInteractionDiffResult = OpensteerInteractionDiffOutput;\nexport type OpensteerInteractionReplayOptions = OpensteerInteractionReplayInput;\nexport type OpensteerInteractionReplayResult = OpensteerInteractionReplayOutput;\nexport type OpensteerNetworkClearOptions = OpensteerNetworkClearInput;\nexport type OpensteerNetworkClearResult = OpensteerNetworkClearOutput;\nexport type OpensteerRawRequestOptions = OpensteerRawRequestInput;\nexport type OpensteerRawRequestResult = OpensteerRawRequestOutput;\nexport type OpensteerRequestOptions = Omit<OpensteerRequestExecuteInput, \"key\">;\nexport type OpensteerRequestResult = OpensteerRequestExecuteOutput;\nexport type OpensteerCaptureScriptsOptions = OpensteerCaptureScriptsInput;\nexport type OpensteerCaptureScriptsResult = OpensteerCaptureScriptsOutput;\nexport type OpensteerScriptBeautifyOptions = OpensteerScriptBeautifyInput;\nexport type OpensteerScriptBeautifyResult = OpensteerScriptBeautifyOutput;\nexport type OpensteerScriptDeobfuscateOptions = OpensteerScriptDeobfuscateInput;\nexport type OpensteerScriptDeobfuscateResult = OpensteerScriptDeobfuscateOutput;\nexport type OpensteerScriptSandboxOptions = OpensteerScriptSandboxInput;\nexport type OpensteerScriptSandboxResult = OpensteerScriptSandboxOutput;\nexport type OpensteerArtifactReadOptions = OpensteerArtifactReadInput;\nexport type OpensteerArtifactReadResult = OpensteerArtifactReadOutput;\nexport type OpensteerCaptchaSolveOptions = OpensteerCaptchaSolveInput;\nexport type OpensteerCaptchaSolveResult = OpensteerCaptchaSolveOutput;\nexport type OpensteerAddInitScriptOptions = OpensteerAddInitScriptInput;\n\nexport interface OpensteerOptions extends OpensteerRuntimeOptions {\n readonly provider?: OpensteerProviderOptions;\n}\n\nexport interface OpensteerBrowserCloneOptions {\n readonly sourceUserDataDir: string;\n readonly sourceProfileDirectory?: string;\n}\n\nexport interface OpensteerBrowserController {\n status(): Promise<OpensteerBrowserStatus>;\n clone(input: OpensteerBrowserCloneOptions): Promise<WorkspaceBrowserManifest>;\n reset(): Promise<void>;\n delete(): Promise<void>;\n}\n\nexport class Opensteer {\n private readonly runtime: OpensteerDisconnectableRuntime;\n private readonly browserManager: OpensteerBrowserManager | undefined;\n readonly browser: OpensteerBrowserController;\n\n constructor(options: OpensteerOptions = {}) {\n const environment = resolveOpensteerEnvironment(options.rootDir);\n const { provider, engineName, ...runtimeOptions } = options;\n const runtimeConfig = resolveOpensteerRuntimeConfig({\n ...(provider === undefined ? {} : { provider }),\n environment,\n });\n\n if (runtimeConfig.provider.mode === \"cloud\") {\n this.browserManager = undefined;\n this.runtime = createOpensteerSemanticRuntime({\n ...(provider === undefined ? {} : { provider }),\n ...(engineName === undefined ? {} : { engine: engineName }),\n environment,\n runtimeOptions: {\n ...runtimeOptions,\n },\n });\n this.browser = createUnsupportedBrowserController();\n return;\n }\n\n this.browserManager = new OpensteerBrowserManager({\n ...(runtimeOptions.rootDir === undefined ? {} : { rootDir: runtimeOptions.rootDir }),\n ...(runtimeOptions.rootPath === undefined ? {} : { rootPath: runtimeOptions.rootPath }),\n ...(runtimeOptions.workspace === undefined ? {} : { workspace: runtimeOptions.workspace }),\n ...(engineName === undefined ? {} : { engineName }),\n ...(runtimeOptions.browser === undefined ? {} : { browser: runtimeOptions.browser }),\n ...(runtimeOptions.launch === undefined ? {} : { launch: runtimeOptions.launch }),\n ...(runtimeOptions.context === undefined ? {} : { context: runtimeOptions.context }),\n });\n this.runtime = createOpensteerSemanticRuntime({\n ...(provider === undefined ? {} : { provider }),\n ...(engineName === undefined ? {} : { engine: engineName }),\n environment,\n runtimeOptions: {\n ...runtimeOptions,\n rootPath: this.browserManager.rootPath,\n cleanupRootOnClose: this.browserManager.cleanupRootOnDisconnect,\n },\n });\n this.browser = {\n status: () => this.browserManager!.status(),\n clone: (input) => this.browserManager!.clonePersistentBrowser(input),\n reset: () => this.browserManager!.reset(),\n delete: () => this.browserManager!.delete(),\n };\n }\n\n async open(input: string | OpensteerOpenInput = {}): Promise<OpensteerOpenOutput> {\n return this.runtime.open(typeof input === \"string\" ? { url: input } : input);\n }\n\n async info(): Promise<OpensteerSessionInfo> {\n return this.runtime.info();\n }\n\n async listPages(input: OpensteerPageListInput = {}): Promise<OpensteerPageListOutput> {\n return this.runtime.listPages(input);\n }\n\n async newPage(input: OpensteerPageNewInput = {}): Promise<OpensteerPageNewOutput> {\n return this.runtime.newPage(input);\n }\n\n async activatePage(input: OpensteerPageActivateInput): Promise<OpensteerPageActivateOutput> {\n return this.runtime.activatePage(input);\n }\n\n async closePage(input: OpensteerPageCloseInput = {}): Promise<OpensteerPageCloseOutput> {\n return this.runtime.closePage(input);\n }\n\n async goto(input: string | OpensteerGotoOptions): Promise<OpensteerPageGotoOutput> {\n return this.runtime.goto(typeof input === \"string\" ? { url: input } : input);\n }\n\n async evaluate(\n input: string | OpensteerPageEvaluateInput,\n ): Promise<OpensteerPageEvaluateOutput[\"value\"]> {\n const normalized =\n typeof input === \"string\"\n ? {\n script: input,\n }\n : input;\n const result = await this.runtime.evaluate(normalized);\n return result.value;\n }\n\n async evaluateJson(\n input: string | OpensteerPageEvaluateInput,\n ): Promise<OpensteerPageEvaluateOutput[\"value\"]> {\n return this.evaluate(input);\n }\n\n async addInitScript(\n input: string | OpensteerAddInitScriptInput,\n ): Promise<OpensteerAddInitScriptOutput> {\n const normalized =\n typeof input === \"string\"\n ? {\n script: input,\n }\n : input;\n return this.runtime.addInitScript(normalized);\n }\n\n async click(input: OpensteerClickOptions): Promise<OpensteerActionResult> {\n const { button, clickCount, modifiers, ...target } = input;\n const normalized = {\n ...normalizeTargetOptions(target),\n ...(button === undefined ? {} : { button }),\n ...(clickCount === undefined ? {} : { clickCount }),\n ...(modifiers === undefined ? {} : { modifiers }),\n };\n return this.runtime.click(normalized);\n }\n\n async hover(input: OpensteerTargetOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.hover(normalized);\n }\n\n async input(input: OpensteerInputOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.input({\n ...normalized,\n text: input.text,\n ...(input.pressEnter === undefined ? {} : { pressEnter: input.pressEnter }),\n });\n }\n\n async scroll(input: OpensteerScrollOptions): Promise<OpensteerActionResult> {\n const normalized = normalizeTargetOptions(input);\n return this.runtime.scroll({\n ...normalized,\n direction: input.direction,\n amount: input.amount,\n });\n }\n\n async extract(input: OpensteerExtractOptions): Promise<OpensteerDomExtractOutput[\"data\"]> {\n const result = await this.runtime.extract(input);\n return result.data;\n }\n\n async queryNetwork(\n input: OpensteerNetworkQueryOptions = {},\n ): Promise<OpensteerNetworkQueryResult> {\n return this.runtime.queryNetwork(input);\n }\n\n async waitForNetwork(\n input: OpensteerWaitForNetworkOptions,\n ): Promise<OpensteerNetworkQueryResult[\"records\"][number]> {\n const { timeoutMs, pollIntervalMs, ...query } = input;\n const timeoutAt = Date.now() + (timeoutMs ?? 30_000);\n const pollInterval = pollIntervalMs ?? 100;\n const baseline = new Set(\n (\n await this.runtime.queryNetwork({\n ...query,\n limit: 200,\n })\n ).records.map((record) => record.recordId),\n );\n\n while (true) {\n const { records } = await this.runtime.queryNetwork({\n ...query,\n limit: 200,\n });\n const next = records.find((record) => !baseline.has(record.recordId));\n if (next !== undefined) {\n return next;\n }\n if (Date.now() >= timeoutAt) {\n throw new Error(\"waitForNetwork timed out\");\n }\n await delay(pollInterval);\n }\n }\n\n async waitForResponse(\n input: OpensteerWaitForNetworkOptions,\n ): Promise<OpensteerNetworkQueryResult[\"records\"][number]> {\n return this.waitForNetwork(input);\n }\n\n async waitForPage(\n input: OpensteerWaitForPageOptions = {},\n ): Promise<OpensteerPageListOutput[\"pages\"][number]> {\n const baseline = new Set((await this.runtime.listPages()).pages.map((page) => page.pageRef));\n const timeoutAt = Date.now() + (input.timeoutMs ?? 30_000);\n const pollIntervalMs = input.pollIntervalMs ?? 100;\n\n while (true) {\n const { pages } = await this.runtime.listPages();\n const match = pages.find((page) => {\n if (baseline.has(page.pageRef)) {\n return false;\n }\n if (input.openerPageRef !== undefined && page.openerPageRef !== input.openerPageRef) {\n return false;\n }\n if (input.urlIncludes !== undefined && !page.url.includes(input.urlIncludes)) {\n return false;\n }\n return true;\n });\n if (match !== undefined) {\n return match;\n }\n if (Date.now() >= timeoutAt) {\n throw new Error(\"waitForPage timed out\");\n }\n await delay(pollIntervalMs);\n }\n }\n\n async snapshot(input: OpensteerSnapshotOptions = {}): Promise<OpensteerSnapshotResult> {\n return this.runtime.snapshot(typeof input === \"string\" ? { mode: input } : input);\n }\n\n async tagNetwork(input: OpensteerNetworkTagOptions): Promise<OpensteerNetworkTagResult> {\n return this.runtime.tagNetwork(input);\n }\n\n async minimizeNetwork(\n input: OpensteerNetworkMinimizeOptions,\n ): Promise<OpensteerNetworkMinimizeResult> {\n return this.runtime.minimizeNetwork(input);\n }\n\n async diffNetwork(input: OpensteerNetworkDiffOptions): Promise<OpensteerNetworkDiffResult> {\n return this.runtime.diffNetwork(input);\n }\n\n async probeNetwork(input: OpensteerNetworkProbeOptions): Promise<OpensteerNetworkProbeResult> {\n return this.runtime.probeNetwork(input);\n }\n\n async reverseDiscover(\n input: OpensteerReverseDiscoverOptions = {},\n ): Promise<OpensteerReverseDiscoverResult> {\n return this.runtime.discoverReverse(input);\n }\n\n async reverseQuery(input: OpensteerReverseQueryOptions): Promise<OpensteerReverseQueryResult> {\n return this.runtime.queryReverse(input);\n }\n\n async createReversePackage(\n input: OpensteerReversePackageCreateOptions,\n ): Promise<OpensteerReversePackageCreateResult> {\n return this.runtime.createReversePackage(input);\n }\n\n async runReversePackage(\n input: OpensteerReversePackageRunOptions,\n ): Promise<OpensteerReversePackageRunResult> {\n return this.runtime.runReversePackage(input);\n }\n\n async reverseExport(input: OpensteerReverseExportOptions): Promise<OpensteerReverseExportResult> {\n return this.runtime.exportReverse(input);\n }\n\n async reverseReport(input: OpensteerReverseReportOptions): Promise<OpensteerReverseReportResult> {\n return this.runtime.getReverseReport(input);\n }\n\n async getReversePackage(\n input: OpensteerReversePackageGetOptions,\n ): Promise<OpensteerReversePackageGetResult> {\n return this.runtime.getReversePackage(input);\n }\n\n async listReversePackages(\n input: OpensteerReversePackageListOptions = {},\n ): Promise<OpensteerReversePackageListResult> {\n return this.runtime.listReversePackages(input);\n }\n\n async patchReversePackage(\n input: OpensteerReversePackagePatchOptions,\n ): Promise<OpensteerReversePackagePatchResult> {\n return this.runtime.patchReversePackage(input);\n }\n\n async interactionCapture(\n input: OpensteerInteractionCaptureOptions,\n ): Promise<OpensteerInteractionCaptureResult> {\n return this.runtime.captureInteraction(input);\n }\n\n async getInteraction(\n input: OpensteerInteractionGetOptions,\n ): Promise<OpensteerInteractionGetResult> {\n return this.runtime.getInteraction(input);\n }\n\n async interactionDiff(\n input: OpensteerInteractionDiffOptions,\n ): Promise<OpensteerInteractionDiffResult> {\n return this.runtime.diffInteraction(input);\n }\n\n async interactionReplay(\n input: OpensteerInteractionReplayOptions,\n ): Promise<OpensteerInteractionReplayResult> {\n return this.runtime.replayInteraction(input);\n }\n\n async clearNetwork(\n input: OpensteerNetworkClearOptions = {},\n ): Promise<OpensteerNetworkClearResult> {\n return this.runtime.clearNetwork(input);\n }\n\n async captureScripts(\n input: OpensteerCaptureScriptsOptions = {},\n ): Promise<OpensteerCaptureScriptsResult> {\n return this.runtime.captureScripts(input);\n }\n\n async readArtifact(input: OpensteerArtifactReadOptions): Promise<OpensteerArtifactReadResult> {\n return this.runtime.readArtifact(input);\n }\n\n async beautifyScript(\n input: OpensteerScriptBeautifyOptions,\n ): Promise<OpensteerScriptBeautifyResult> {\n return this.runtime.beautifyScript(input);\n }\n\n async deobfuscateScript(\n input: OpensteerScriptDeobfuscateOptions,\n ): Promise<OpensteerScriptDeobfuscateResult> {\n return this.runtime.deobfuscateScript(input);\n }\n\n async sandboxScript(input: OpensteerScriptSandboxOptions): Promise<OpensteerScriptSandboxResult> {\n return this.runtime.sandboxScript(input);\n }\n\n async solveCaptcha(input: OpensteerCaptchaSolveOptions): Promise<OpensteerCaptchaSolveResult> {\n return this.runtime.solveCaptcha(input);\n }\n\n async getCookies(\n input: { readonly urls?: readonly string[] } = {},\n ): Promise<readonly CookieRecord[]> {\n return this.runtime.getCookies(input);\n }\n\n async getStorageSnapshot(\n input: {\n readonly includeSessionStorage?: boolean;\n readonly includeIndexedDb?: boolean;\n } = {},\n ): Promise<StorageSnapshot> {\n return this.runtime.getStorageSnapshot(input);\n }\n\n async writeRequestPlan(input: OpensteerWriteRequestPlanInput): Promise<RequestPlanRecord> {\n return this.runtime.writeRequestPlan(input);\n }\n\n async inferRequestPlan(input: OpensteerInferRequestPlanInput): Promise<RequestPlanRecord> {\n return this.runtime.inferRequestPlan(input);\n }\n\n async getRequestPlan(input: OpensteerGetRequestPlanInput): Promise<RequestPlanRecord> {\n return this.runtime.getRequestPlan(input);\n }\n\n async listRequestPlans(\n input: OpensteerListRequestPlansInput = {},\n ): Promise<OpensteerListRequestPlansOutput> {\n return this.runtime.listRequestPlans(input);\n }\n\n async writeAuthRecipe(input: OpensteerWriteAuthRecipeInput): Promise<AuthRecipeRecord> {\n return this.runtime.writeAuthRecipe(input);\n }\n\n async writeRecipe(input: OpensteerWriteRecipeInput): Promise<RecipeRecord> {\n return this.runtime.writeRecipe(input);\n }\n\n async getAuthRecipe(input: OpensteerGetAuthRecipeInput): Promise<AuthRecipeRecord> {\n return this.runtime.getAuthRecipe(input);\n }\n\n async getRecipe(input: OpensteerGetRecipeInput): Promise<RecipeRecord> {\n return this.runtime.getRecipe(input);\n }\n\n async listAuthRecipes(\n input: OpensteerListAuthRecipesInput = {},\n ): Promise<OpensteerListAuthRecipesOutput> {\n return this.runtime.listAuthRecipes(input);\n }\n\n async listRecipes(input: OpensteerListRecipesInput = {}): Promise<OpensteerListRecipesOutput> {\n return this.runtime.listRecipes(input);\n }\n\n async runAuthRecipe(input: OpensteerRunAuthRecipeInput): Promise<OpensteerRunAuthRecipeOutput> {\n return this.runtime.runAuthRecipe(input);\n }\n\n async runRecipe(input: OpensteerRunRecipeInput): Promise<OpensteerRunRecipeOutput> {\n return this.runtime.runRecipe(input);\n }\n\n async request(key: string, input: OpensteerRequestOptions = {}): Promise<OpensteerRequestResult> {\n return this.runtime.request({\n key,\n ...input,\n });\n }\n\n async rawRequest(input: OpensteerRawRequestOptions): Promise<OpensteerRawRequestResult> {\n return this.runtime.rawRequest(input);\n }\n\n async route(input: OpensteerRouteOptions): Promise<OpensteerRouteRegistration> {\n return this.requireOwnedInstrumentationRuntime(\"route\").route(input);\n }\n\n async interceptScript(\n input: OpensteerInterceptScriptOptions,\n ): Promise<OpensteerRouteRegistration> {\n return this.requireOwnedInstrumentationRuntime(\"interceptScript\").interceptScript(input);\n }\n\n async computerExecute(\n input: OpensteerComputerExecuteOptions,\n ): Promise<OpensteerComputerExecuteResult> {\n return this.runtime.computerExecute(input);\n }\n\n async close(): Promise<OpensteerSessionCloseOutput> {\n if (this.browserManager === undefined || this.browserManager.mode === \"temporary\") {\n return this.runtime.close();\n }\n\n const output = await this.runtime.close();\n await this.browserManager.close();\n return output;\n }\n\n async disconnect(): Promise<void> {\n await this.runtime.disconnect();\n }\n\n private requireOwnedInstrumentationRuntime(\n method: \"route\" | \"interceptScript\",\n ): OpensteerInstrumentableRuntime {\n if (isInstrumentableRuntime(this.runtime)) {\n return this.runtime;\n }\n throw new Error(`${method}() is not available for this session runtime.`);\n }\n}\n\nfunction isInstrumentableRuntime(\n runtime: OpensteerDisconnectableRuntime,\n): runtime is OpensteerDisconnectableRuntime & OpensteerInstrumentableRuntime {\n return (\n typeof (runtime as Partial<OpensteerInstrumentableRuntime>).route === \"function\" &&\n typeof (runtime as Partial<OpensteerInstrumentableRuntime>).interceptScript === \"function\"\n );\n}\n\nfunction createUnsupportedBrowserController(): OpensteerBrowserController {\n const fail = async (): Promise<never> => {\n throw new Error(\"browser.* helpers are only available in local mode.\");\n };\n\n return {\n status: fail,\n clone: fail,\n reset: fail,\n delete: fail,\n };\n}\n\nfunction normalizeTargetOptions(input: OpensteerTargetOptions): {\n readonly target: OpensteerTargetInput;\n readonly persistAsDescription?: string;\n readonly captureNetwork?: string;\n} {\n const hasElement = input.element !== undefined;\n const hasSelector = input.selector !== undefined;\n if (hasElement && hasSelector) {\n throw new Error(\"Specify exactly one of element, selector, or description.\");\n }\n\n if (hasElement) {\n return {\n target: {\n kind: \"element\",\n element: input.element!,\n },\n ...(input.description === undefined ? {} : { persistAsDescription: input.description }),\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n }\n\n if (hasSelector) {\n return {\n target: {\n kind: \"selector\",\n selector: input.selector!,\n },\n ...(input.description === undefined ? {} : { persistAsDescription: input.description }),\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n }\n\n if (input.description === undefined) {\n throw new Error(\"Specify exactly one of element, selector, or description.\");\n }\n\n return {\n target: {\n kind: \"description\",\n description: input.description,\n },\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n}\n\nfunction delay(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opensteer",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
4
4
  "description": "Opensteer browser automation, replay, and reverse-engineering toolkit.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -56,14 +56,14 @@
56
56
  "sharp": "^0.34.5",
57
57
  "skills": "^1.4.6",
58
58
  "ws": "^8.18.0",
59
- "@opensteer/runtime-core": "0.1.2",
60
- "@opensteer/engine-playwright": "0.8.2"
59
+ "@opensteer/engine-playwright": "0.8.3",
60
+ "@opensteer/runtime-core": "0.1.3"
61
61
  },
62
62
  "optionalDependencies": {
63
63
  "webcrack": "^2.15.1"
64
64
  },
65
65
  "peerDependencies": {
66
- "@opensteer/engine-abp": "0.8.3"
66
+ "@opensteer/engine-abp": "0.8.4"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@opensteer/engine-abp": {
@@ -71,9 +71,9 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "@opensteer/browser-core": "0.7.2",
75
- "@opensteer/protocol": "0.7.2",
76
- "@opensteer/engine-abp": "0.8.3"
74
+ "@opensteer/browser-core": "0.7.3",
75
+ "@opensteer/engine-abp": "0.8.4",
76
+ "@opensteer/protocol": "0.7.3"
77
77
  },
78
78
  "scripts": {
79
79
  "build": "tsup && node ../../scripts/sync-package-skills.mjs",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: opensteer
3
- description: "Handles Opensteer browser automation, structured DOM extraction, and browser-backed request replay with the Opensteer CLI and SDK. Use when the user mentions Opensteer, browser automation, real Chromium sessions, persistent workspace browser state, descriptor-backed DOM actions or extraction, request plans, recipes, or browser-backed API replay."
3
+ description: "Handles Opensteer browser automation, structured DOM extraction, and browser-backed request replay with the Opensteer CLI and SDK. Use when the user mentions Opensteer, browser automation, real Chromium sessions, persistent workspace browser state, descriptor-backed DOM actions or extraction, request plans, recipes, or browser-backed API replay. Do NOT use for: generic HTTP client calls (curl/fetch), Playwright without Opensteer, or static file downloads."
4
4
  argument-hint: "[goal]"
5
5
  ---
6
6
 
@@ -10,15 +10,31 @@ Opensteer controls a real Chromium browser through persistent workspaces. It has
10
10
 
11
11
  ## Task Triage
12
12
 
13
- If invoked directly, treat `$ARGUMENTS` as the goal. **Before taking any action, classify the task:**
13
+ If invoked directly, treat `$ARGUMENTS` as the goal. **Before taking any action, walk through these gates in order:**
14
14
 
15
- **Request capture / API reverse-engineering.** Signals: the user mentions API, endpoint, request, network traffic, reverse-engineer, replay, or the deliverable is a replayable request rather than page content. Load the [Request Workflow](references/request-workflow.md) reference. Start by opening the page with `captureNetwork` on navigation, then query captured traffic with `queryNetwork()`. Do NOT start with a DOM snapshot.
15
+ **GATE 1:** Is the deliverable a replayable request plan, custom API endpoint, or lower-overhead API call?
16
+ Signals: the user mentions API, endpoint, request, network traffic, reverse-engineer, replay, or the deliverable is a replayable request rather than page content.
17
+ **YES** → Load [Request Plan Pipeline](references/request-workflow.md). Start by opening the page with `captureNetwork` on navigation, then query captured traffic. Do NOT start with a DOM snapshot.
16
18
 
17
- **DOM automation / data extraction.** Signals: the user mentions scraping page content, filling forms, clicking through a flow, extracting visible data, or the deliverable is structured data from the rendered page. Load the [CLI Reference](references/cli-reference.md). Start with `snapshot action` or `snapshot extraction` to understand the page structure before acting.
19
+ **GATE 2:** Is the deliverable structured data from a rendered page, or a browser automation flow?
20
+ Signals: the user mentions scraping page content, filling forms, clicking through a flow, extracting visible data, or the deliverable is structured data from the rendered page.
21
+ **YES** → Load [CLI Reference](references/cli-reference.md). Start with `snapshot action` or `snapshot extraction`.
18
22
 
19
- **Browser / workspace administration.** Signals: the user mentions cloning a profile, managing browser state, attaching to a running browser, checking workspace status. Load the [CLI Reference](references/cli-reference.md) (Browser Lifecycle section) or the [SDK Reference](references/sdk-reference.md) (Browser Admin section).
23
+ **GATE 3:** Is the task browser or workspace administration?
24
+ Signals: the user mentions cloning a profile, managing browser state, attaching to a running browser, checking workspace status.
25
+ **YES** → Load [CLI Reference](references/cli-reference.md) (Browser Lifecycle) or [SDK Reference](references/sdk-reference.md) (Browser Admin).
20
26
 
21
- **When unsure:** Open the page with `captureNetwork` on the `goto` action. Check `queryNetwork()`. If relevant JSON APIs appear, follow the request capture path. If the data is server-rendered HTML with no backing API, follow the DOM extraction path.
27
+ **GATE 4:** Unsure. Open the page with `captureNetwork` on `goto`. Query traffic with `queryNetwork()`.
28
+ - If relevant JSON APIs appear → go to GATE 1 (request plan path).
29
+ - If the data is server-rendered HTML with no backing API → go to GATE 2 (DOM path).
30
+
31
+ ## Deliverables
32
+
33
+ Each workflow has a specific deliverable. Verify you have produced it before closing the browser.
34
+
35
+ - **Request Plan Pipeline:** A persisted request plan (`key` + `version`) that returns valid data via `request.execute`. `rawRequest()` is a diagnostic probe used during the pipeline — it is never the deliverable.
36
+ - **DOM Extraction:** A persisted extraction descriptor replayable via `extract --description`.
37
+ - **Administration:** Confirmation of the browser/workspace state change.
22
38
 
23
39
  ## References
24
40
 
@@ -26,7 +42,7 @@ If invoked directly, treat `$ARGUMENTS` as the goal. **Before taking any action,
26
42
 
27
43
  - [CLI Reference](references/cli-reference.md) — DOM exploration, snapshots, extraction, browser lifecycle, profile cloning
28
44
  - [SDK Reference](references/sdk-reference.md) — TypeScript code for DOM automation, request capture, and browser admin. Use when the task requires a reusable script.
29
- - [Request Workflow](references/request-workflow.md) — `captureNetwork`, `queryNetwork`, transport probing, request plans, auth tokens, recipes
45
+ - [Request Plan Pipeline](references/request-workflow.md) — Gated phases: capture, discover, probe, infer plan, validate auth, annotate parameters, test plan, auth recipes
30
46
 
31
47
  ## Startup Checks
32
48
 
@@ -39,24 +55,27 @@ If invoked directly, treat `$ARGUMENTS` as the goal. **Before taking any action,
39
55
  Always explore with the CLI before writing automation scripts. Exploration looks different depending on the task:
40
56
 
41
57
  - **DOM tasks:** use `snapshot action` / `snapshot extraction` to understand the page structure. Read the `html` field — it contains a filtered DOM with inline `c="N"` attributes marking every element. Use those `c` values as `element` numbers in commands and schemas.
42
- - **Request tasks:** use `captureNetwork` on navigation/actions, then `queryNetwork()` to inspect the captured traffic. Probe discovered APIs with `rawRequest()`.
58
+ - **Request tasks:** use `captureNetwork` on navigation/actions, then `queryNetwork()` to inspect the captured traffic. Probe discovered APIs with `rawRequest()` (diagnostic only), then infer and test plans.
43
59
  - Only write a reusable SDK script if the user asks for one. CLI exploration is often the entire task.
44
60
  - Always close the browser when done: `opensteer close --workspace <id>`.
45
61
 
46
- ## Key Constraints
62
+ ## Request Constraints
63
+
64
+ - `captureNetwork` is opt-in and is NOT supported on `open()`. Use `open()` to launch the browser, then `goto({ url, captureNetwork })` to navigate with capture.
65
+ - `rawRequest` headers must be `[{name, value}]` arrays, not `{key: value}` objects.
66
+ - `rawRequest` body must be `{json: {...}}`, `{text: "..."}`, or `{base64: "..."}` — not raw strings.
67
+ - After inferring a plan, always validate the auth classification (Phase 5 in the pipeline). Inferred auth metadata is often wrong for public APIs.
68
+
69
+ ## DOM Constraints
47
70
 
48
71
  - `persistAsDescription` requires the verbose `opensteer run dom.*` syntax. The short CLI commands (`click`, `input`, etc.) do NOT support it.
49
72
  - Extraction schemas are **literal**: N template rows in → exactly N rows back. Replay with `description` alone (no schema) to get ALL matching rows via the saved generalized selector.
50
- - `captureNetwork` is opt-in and is NOT supported on `open()`. Use `open()` to launch the browser, then `goto({ url, captureNetwork })` to navigate with capture.
51
73
  - Prefer Opensteer surfaces (`extract()`, descriptors, `captureNetwork`) over raw Playwright / `page.evaluate()` so data stays in the workspace.
52
- - Do not use removed surfaces: `--name`, `Opensteer.attach()`, cloud/profile-sync helpers, `local-profile`, legacy snapshot browser modes, `@opensteer/engine-abp`.
53
74
 
54
75
  ## Common Mistakes
55
76
 
56
77
  - Parsing the `counters` array instead of reading the `html` string from snapshots. Read the HTML — find `c="N"` values.
57
78
  - Using `page.evaluate()` or CSS selectors when `extract()` can express the output.
58
79
  - Forgetting to re-snapshot after navigation. Always re-snapshot before targeting new elements.
59
- - Skipping transport probing — always test `direct-http` before assuming browser session is needed.
60
- - `rawRequest` headers must be `[{name, value}]` arrays, not `{key: value}` objects.
61
- - `rawRequest` body must be `{json: {...}}`, `{text: "..."}`, or `{base64: "..."}` — not raw strings.
62
80
  - Leaving the browser running after task completion. Always run `opensteer close` when done.
81
+ - Do not use removed surfaces: `--name`, `Opensteer.attach()`, cloud/profile-sync helpers, `local-profile`, legacy snapshot browser modes, `@opensteer/engine-abp`.