opensteer 0.8.13 → 0.8.15

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":";;;;AAmPO,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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xC,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 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"]}
1
+ {"version":3,"sources":["../src/sdk/opensteer.ts"],"names":[],"mappings":";;;;AA6JA,IAAM,mBAAN,MAAqD;AAAA,EAC1C,MAAA;AAAA,EACQ,OAAA;AAAA,EAEjB,YAAY,MAAA,EAAoC;AAC9C,IAAA,IAAI,MAAA,CAAO,WAAW,MAAA,EAAW;AAC/B,MAAA,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA;AAAA,IACvB;AACA,IAAA,IAAA,CAAK,UAAU,MAAA,CAAO,OAAA;AAAA,EACxB;AAAA,EAEA,IAAI,IAAA,EAAuB;AACzB,IAAA,OAAO,KAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,MAAA,KAAW,MAAA,CAAO,SAAS,IAAI,CAAA;AAAA,EAC3D;AAAA,EAEA,IAAI,IAAA,EAAkC;AACpC,IAAA,OAAO,IAAA,CAAK,QAAQ,IAAA,CAAK,CAAC,WAAW,MAAA,CAAO,IAAA,KAAS,IAAI,CAAA,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,SAAS,MAAA,EAAW;AAC/B,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,UAAA,CAAW,KAAK,MAAA,CAAO,IAAA,CAAK,SAAS,IAAA,CAAK,IAAA,EAAM,QAAQ,CAAC,CAAA;AAClE;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 CookieRecord,\n OpensteerCookieQueryOutput,\n OpensteerActionResult,\n OpensteerAddInitScriptInput,\n OpensteerAddInitScriptOutput,\n OpensteerComputerExecuteInput,\n OpensteerComputerExecuteOutput,\n OpensteerComputerKeyModifier,\n OpensteerComputerMouseButton,\n OpensteerNetworkDetailOutput,\n OpensteerNetworkQueryInput,\n OpensteerNetworkQueryOutput,\n OpensteerNetworkReplayInput,\n OpensteerNetworkReplayOutput,\n OpensteerOpenInput,\n OpensteerOpenOutput,\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 OpensteerRequestResponseResult,\n OpensteerSessionCloseOutput,\n OpensteerSessionFetchInput,\n OpensteerSessionInfo,\n OpensteerSnapshotMode,\n OpensteerStateQueryOutput,\n OpensteerStorageArea,\n OpensteerStorageDomainSnapshot,\n OpensteerTargetInput,\n} from \"@opensteer/protocol\";\n\nimport {\n OpensteerBrowserManager,\n type OpensteerBrowserStatus,\n type WorkspaceBrowserManifest,\n} from \"../browser-manager.js\";\nimport { resolveOpensteerEnvironment } from \"../env.js\";\nimport type { OpensteerProviderOptions } from \"../provider/config.js\";\nimport type {\n OpensteerInterceptScriptOptions,\n OpensteerInstrumentableRuntime,\n OpensteerRouteOptions,\n OpensteerRouteRegistration,\n} from \"./instrumentation.js\";\nimport type { OpensteerRuntimeOptions } from \"./runtime.js\";\nimport {\n createOpensteerSemanticRuntime,\n resolveOpensteerRuntimeConfig,\n} from \"./runtime-resolution.js\";\nimport type { OpensteerDisconnectableRuntime } from \"./semantic-runtime.js\";\n\nexport interface OpensteerTargetOptions {\n readonly element?: number;\n readonly selector?: string;\n readonly persist?: 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 type OpensteerExtractOptions =\n | {\n readonly persist: string;\n readonly schema?: Record<string, unknown>;\n }\n | {\n readonly persist?: 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 OpensteerAddInitScriptOptions = OpensteerAddInitScriptInput;\nexport type OpensteerGotoOptions = Omit<OpensteerPageGotoInput, \"url\">;\nexport type OpensteerNetworkQueryOptions = OpensteerNetworkQueryInput;\nexport type OpensteerNetworkQueryResult = OpensteerNetworkQueryOutput;\nexport type OpensteerNetworkDetailResult = OpensteerNetworkDetailOutput;\nexport type OpensteerNetworkReplayOptions = Omit<OpensteerNetworkReplayInput, \"recordId\">;\nexport type OpensteerNetworkReplayResult = OpensteerNetworkReplayOutput;\nexport type OpensteerFetchOptions = Omit<OpensteerSessionFetchInput, \"url\">;\nexport type OpensteerComputerExecuteOptions = OpensteerComputerExecuteInput;\nexport type OpensteerStorageMap = Readonly<Record<string, string>>;\nexport type OpensteerBrowserState = OpensteerStateQueryOutput;\n\nexport interface OpensteerCookieJar {\n readonly domain?: string;\n has(name: string): boolean;\n get(name: string): string | undefined;\n getAll(): readonly CookieRecord[];\n serialize(): string;\n}\n\nexport interface OpensteerDomController {\n click(input: OpensteerClickOptions): Promise<OpensteerActionResult>;\n hover(input: OpensteerTargetOptions): Promise<OpensteerActionResult>;\n input(input: OpensteerInputOptions): Promise<OpensteerActionResult>;\n scroll(input: OpensteerScrollOptions): Promise<OpensteerActionResult>;\n}\n\nexport interface OpensteerNetworkController {\n query(input?: OpensteerNetworkQueryOptions): Promise<OpensteerNetworkQueryResult>;\n detail(recordId: string): Promise<OpensteerNetworkDetailResult>;\n replay(\n recordId: string,\n overrides?: OpensteerNetworkReplayOptions,\n ): Promise<OpensteerNetworkReplayResult>;\n}\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\nclass SessionCookieJar implements OpensteerCookieJar {\n readonly domain?: string;\n private readonly cookies: readonly CookieRecord[];\n\n constructor(output: OpensteerCookieQueryOutput) {\n if (output.domain !== undefined) {\n this.domain = output.domain;\n }\n this.cookies = output.cookies;\n }\n\n has(name: string): boolean {\n return this.cookies.some((cookie) => cookie.name === name);\n }\n\n get(name: string): string | undefined {\n return this.cookies.find((cookie) => cookie.name === name)?.value;\n }\n\n getAll(): readonly CookieRecord[] {\n return this.cookies;\n }\n\n serialize(): string {\n return this.cookies.map((cookie) => `${cookie.name}=${cookie.value}`).join(\"; \");\n }\n}\n\nexport class Opensteer {\n private readonly runtime: OpensteerDisconnectableRuntime;\n private readonly browserManager: OpensteerBrowserManager | undefined;\n readonly browser: OpensteerBrowserController;\n readonly dom: OpensteerDomController;\n readonly network: OpensteerNetworkController;\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 });\n this.browser = createUnsupportedBrowserController();\n } else {\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 this.dom = {\n click: (input) => this.click(input),\n hover: (input) => this.hover(input),\n input: (input) => this.input(input),\n scroll: (input) => this.scroll(input),\n };\n\n this.network = {\n query: (input = {}) => this.queryNetwork(input),\n detail: (recordId) => this.runtime.getNetworkDetail({ recordId }),\n replay: (recordId, overrides = {}) =>\n this.runtime.replayNetwork({\n recordId,\n ...overrides,\n }),\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(url: string, options: OpensteerGotoOptions = {}): Promise<OpensteerPageGotoOutput> {\n return this.runtime.goto({\n url,\n ...options,\n });\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 return (await this.runtime.evaluate(normalized)).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 return this.runtime.addInitScript(\n typeof input === \"string\"\n ? {\n script: input,\n }\n : input,\n );\n }\n\n async click(input: OpensteerClickOptions): Promise<OpensteerActionResult> {\n const { button, clickCount, modifiers, ...target } = input;\n return this.runtime.click({\n ...normalizeTargetOptions(target),\n ...(button === undefined ? {} : { button }),\n ...(clickCount === undefined ? {} : { clickCount }),\n ...(modifiers === undefined ? {} : { modifiers }),\n });\n }\n\n async hover(input: OpensteerTargetOptions): Promise<OpensteerActionResult> {\n return this.runtime.hover(normalizeTargetOptions(input));\n }\n\n async input(input: OpensteerInputOptions): Promise<OpensteerActionResult> {\n return this.runtime.input({\n ...normalizeTargetOptions(input),\n text: input.text,\n ...(input.pressEnter === undefined ? {} : { pressEnter: input.pressEnter }),\n });\n }\n\n async scroll(input: OpensteerScrollOptions): Promise<OpensteerActionResult> {\n return this.runtime.scroll({\n ...normalizeTargetOptions(input),\n direction: input.direction,\n amount: input.amount,\n });\n }\n\n async extract(input: OpensteerExtractOptions): Promise<unknown> {\n return (await this.runtime.extract(input)).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 (await this.runtime.queryNetwork({ ...query, limit: 200 })).records.map(\n (record) => record.recordId,\n ),\n );\n\n while (true) {\n const next = (await this.runtime.queryNetwork({ ...query, limit: 200 })).records.find(\n (record) => !baseline.has(record.recordId),\n );\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 match = (await this.runtime.listPages()).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(mode: OpensteerSnapshotMode = \"action\"): Promise<string> {\n return (await this.runtime.snapshot({ mode })).html;\n }\n\n async cookies(domain?: string): Promise<OpensteerCookieJar> {\n return new SessionCookieJar(\n await this.runtime.getCookies(domain === undefined ? {} : { domain }),\n );\n }\n\n async storage(\n domain?: string,\n type: OpensteerStorageArea = \"local\",\n ): Promise<OpensteerStorageMap> {\n const snapshot = await this.runtime.getStorageSnapshot(domain === undefined ? {} : { domain });\n const domainSnapshot = pickStorageDomainSnapshot(snapshot, domain);\n if (domainSnapshot === undefined) {\n return {};\n }\n const entries = type === \"local\" ? domainSnapshot.localStorage : domainSnapshot.sessionStorage;\n return Object.fromEntries(entries.map((entry) => [entry.key, entry.value]));\n }\n\n async state(domain?: string): Promise<OpensteerBrowserState> {\n return this.runtime.getBrowserState(domain === undefined ? {} : { domain });\n }\n\n async fetch(url: string, options: OpensteerFetchOptions = {}): Promise<Response> {\n const result = await this.runtime.fetch({\n url,\n ...options,\n });\n if (result.response === undefined) {\n throw new Error(result.note ?? `session.fetch did not produce a response for ${url}`);\n }\n return toResponse(result.response);\n }\n\n async computerExecute(\n input: OpensteerComputerExecuteOptions,\n ): Promise<OpensteerComputerExecuteOutput> {\n return this.runtime.computerExecute(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 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 (\n typeof (this.runtime as Partial<OpensteerInstrumentableRuntime>).route === \"function\" &&\n typeof (this.runtime as Partial<OpensteerInstrumentableRuntime>).interceptScript ===\n \"function\"\n ) {\n return this.runtime as OpensteerDisconnectableRuntime & OpensteerInstrumentableRuntime;\n }\n throw new Error(`${method}() is not available for this session runtime.`);\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 persist?: 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 persist.\");\n }\n\n if (hasElement) {\n return {\n target: {\n kind: \"element\",\n element: input.element,\n },\n ...(input.persist === undefined ? {} : { persist: input.persist }),\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.persist === undefined ? {} : { persist: input.persist }),\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n }\n\n if (input.persist === undefined) {\n throw new Error(\"Specify exactly one of element, selector, or persist.\");\n }\n\n return {\n target: {\n kind: \"persist\",\n persist: input.persist,\n },\n ...(input.captureNetwork === undefined ? {} : { captureNetwork: input.captureNetwork }),\n };\n}\n\nfunction pickStorageDomainSnapshot(\n snapshot: {\n readonly domains: readonly OpensteerStorageDomainSnapshot[];\n },\n domain: string | undefined,\n): OpensteerStorageDomainSnapshot | undefined {\n if (snapshot.domains.length === 0) {\n return undefined;\n }\n if (domain === undefined) {\n return snapshot.domains[0];\n }\n return snapshot.domains.find((entry) => entry.domain === domain);\n}\n\nfunction toResponse(response: OpensteerRequestResponseResult): Response {\n return new Response(decodeBody(response), {\n status: response.status,\n statusText: response.statusText,\n headers: Object.fromEntries(response.headers.map((header) => [header.name, header.value])),\n });\n}\n\nfunction decodeBody(response: OpensteerRequestResponseResult): Uint8Array | undefined {\n if (response.body === undefined) {\n return undefined;\n }\n return Uint8Array.from(Buffer.from(response.body.data, \"base64\"));\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.13",
3
+ "version": "0.8.15",
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/engine-playwright": "0.8.5",
60
- "@opensteer/runtime-core": "0.1.5"
59
+ "@opensteer/engine-playwright": "0.8.6",
60
+ "@opensteer/runtime-core": "0.1.6"
61
61
  },
62
62
  "optionalDependencies": {
63
63
  "webcrack": "^2.15.1"
64
64
  },
65
65
  "peerDependencies": {
66
- "@opensteer/engine-abp": "0.8.6"
66
+ "@opensteer/engine-abp": "0.8.7"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@opensteer/engine-abp": {
@@ -71,9 +71,9 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "@opensteer/protocol": "0.7.5",
75
- "@opensteer/engine-abp": "0.8.6",
76
- "@opensteer/browser-core": "0.7.5"
74
+ "@opensteer/protocol": "0.7.6",
75
+ "@opensteer/browser-core": "0.7.6",
76
+ "@opensteer/engine-abp": "0.8.7"
77
77
  },
78
78
  "scripts": {
79
79
  "build": "tsup && node ../../scripts/sync-package-skills.mjs",
@@ -1,81 +1,347 @@
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. Do NOT use for: generic HTTP client calls (curl/fetch), Playwright without Opensteer, or static file downloads."
3
+ description: "Handles Opensteer browser automation, structured DOM extraction, and browser-backed API reverse engineering. Use when the user mentions Opensteer, browser automation, real Chromium sessions, DOM extraction, network capture, replay, cookies, reverse-engineering a site API, or browser-grade fetch."
4
4
  argument-hint: "[goal]"
5
5
  ---
6
6
 
7
7
  # Opensteer
8
8
 
9
- Opensteer controls a real Chromium browser through persistent workspaces. It has three capabilities: (1) DOM automation and structured data extraction from rendered pages, (2) network request capture and replay for reverse-engineering APIs, and (3) browser and workspace administration. Workspaces persist browser state, DOM/extraction descriptors, network history, request plans, recipes, and artifacts under `.opensteer/workspaces/<id>`.
9
+ Opensteer gives agents a real Chromium browser for two jobs normal code cannot do:
10
10
 
11
- ## Task Triage
11
+ 1. **DOM automation** — interact with pages and extract structured data via snapshot-based element targeting.
12
+ 2. **API reverse engineering** — capture real browser traffic, identify APIs, test transport portability, and write replay code.
12
13
 
13
- If invoked directly, treat `$ARGUMENTS` as the goal. **Before taking any action, walk through these gates in order:**
14
+ The workflow is always: **explore with CLI, then write reusable code with SDK.**
14
15
 
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
+ ## When To Use
18
17
 
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
+ - Task involves a website's API, network traffic, auth headers, or replay **API workflow**
19
+ - Task involves page content, forms, clicking, typing, or extracting visible data **DOM workflow**
20
+ - Task involves browser profiles, attaching to Chrome, or workspace setup → **Browser management**
21
+ - Unsure → Start with the API workflow. Capture traffic first, then decide.
22
22
 
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).
23
+ ## Rules
26
24
 
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).
25
+ 1. Set `--workspace <id>` on every command, or export `OPENSTEER_WORKSPACE`.
26
+ 2. Re-snapshot after every navigation before using element numbers.
27
+ 3. Import as `import { Opensteer } from "opensteer"` never a relative path.
28
+ 4. SDK constructor needs only two fields:
29
+ ```ts
30
+ const opensteer = new Opensteer({ workspace: "demo", rootDir: process.cwd() });
31
+ ```
32
+ 5. `persist` is the only naming mechanism for reusable targets and extractions.
33
+ 6. `--capture-network <label>` is opt-in. Add it to any action when you need traffic.
34
+ 7. `opensteer.fetch()` works without a page open — it uses the session cookie jar and transport stack directly.
35
+ 8. Element numbers come from `c="N"` attributes in snapshot HTML. Always snapshot first, then act.
30
36
 
31
- ## Deliverables
37
+ ---
38
+
39
+ ## DOM Automation
40
+
41
+ ### Step 1: Open and snapshot
42
+
43
+ ```bash
44
+ opensteer open https://example.com --workspace demo
45
+ opensteer snapshot action --workspace demo
46
+ ```
47
+
48
+ Read the `html` output. Find `c="N"` markers — these are your element IDs.
49
+
50
+ ### Step 2: Interact
51
+
52
+ ```bash
53
+ opensteer click 7 --workspace demo --persist "search button"
54
+ opensteer input 5 "laptop" --workspace demo --press-enter --persist "search input"
55
+ opensteer hover 3 --workspace demo --persist "menu trigger"
56
+ opensteer scroll down 400 --workspace demo
57
+ ```
58
+
59
+ `--persist <key>` saves the element's structural DOM path for deterministic SDK replay. Element number is always required on CLI — persist is save-only, not a targeting mode.
60
+
61
+ ### Step 3: Extract
62
+
63
+ Re-snapshot, then extract with a JSON schema referencing element numbers:
64
+
65
+ ```bash
66
+ opensteer snapshot extraction --workspace demo
67
+ opensteer extract '{"items":[{"name":{"element":13},"price":{"element":14}}]}' \
68
+ --persist "search results" --workspace demo
69
+ ```
70
+
71
+ The positional argument is the JSON schema. `--persist` names it for SDK replay.
72
+
73
+ ### Step 4: Close
74
+
75
+ ```bash
76
+ opensteer close --workspace demo
77
+ ```
78
+
79
+ ### SDK Replay
80
+
81
+ ```ts
82
+ import { Opensteer } from "opensteer";
83
+ const opensteer = new Opensteer({ workspace: "demo", rootDir: process.cwd() });
84
+
85
+ try {
86
+ await opensteer.open("https://example.com");
87
+
88
+ // Replay by persist key — no element numbers or snapshots needed
89
+ await opensteer.input({ persist: "search input", text: "laptop", pressEnter: true });
90
+ await opensteer.click({ persist: "search button" });
32
91
 
33
- Each workflow has a specific deliverable. Verify you have produced it before closing the browser.
92
+ // Extract using cached schema
93
+ const data = await opensteer.extract({ persist: "search results" });
94
+ console.log(data);
95
+ } finally {
96
+ await opensteer.close();
97
+ }
98
+ ```
34
99
 
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.
100
+ When `persist` is used with `element`, it **saves** the path. When used alone, it **resolves** from cache.
38
101
 
39
- ## References
102
+ ---
103
+
104
+ ## API Reverse Engineering
105
+
106
+ ### Step 1: Capture traffic
107
+
108
+ Open the site and trigger the real browser action with `--capture-network`:
109
+
110
+ ```bash
111
+ opensteer open https://example.com --workspace demo
112
+ opensteer goto https://example.com/search --workspace demo --capture-network page-load
113
+ opensteer input 5 "laptop" --workspace demo --press-enter --capture-network search
114
+ ```
115
+
116
+ ### Step 2: Find the API
117
+
118
+ ```bash
119
+ opensteer network query --workspace demo --capture search
120
+ opensteer network query --workspace demo --capture search --hostname api.example.com --json
121
+ ```
122
+
123
+ `--json` filters to JSON and GraphQL responses only. Other filters: `--url`, `--path`, `--method`, `--status`, `--type`, `--before`, `--after`, `--limit`.
124
+
125
+ ### Step 3: Inspect
40
126
 
41
- **Load the relevant reference(s) for your task before taking action.**
127
+ ```bash
128
+ opensteer network detail rec_123 --workspace demo
129
+ ```
42
130
 
43
- - [CLI Reference](references/cli-reference.md) DOM exploration, snapshots, extraction, browser lifecycle, profile cloning
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.
45
- - [Request Plan Pipeline](references/request-workflow.md) — Gated phases: capture, discover, probe, infer plan, validate auth, annotate parameters, test plan, auth recipes
131
+ Shows: URL, method, request headers, cookies sent, request/response body preview, GraphQL metadata, redirect chain.
46
132
 
47
- ## Startup Checks
133
+ ### Step 4: Test replay
48
134
 
49
- - Verify `opensteer` is available in the repo or on `PATH` before planning the workflow.
50
- - If Chromium binaries are missing, install them through Playwright before debugging page behavior.
51
- - Reuse an existing workspace id for the same site or feature when one already exists.
135
+ ```bash
136
+ opensteer replay rec_123 --workspace demo
137
+ opensteer replay rec_123 --workspace demo --query keyword=headphones --query count=10
138
+ ```
52
139
 
53
- ## Exploration First
140
+ Replay tries transports automatically and reports which succeeded:
54
141
 
55
- Always explore with the CLI before writing automation scripts. Exploration looks different depending on the task:
142
+ | Transport | Meaning | SDK usage |
143
+ |---|---|---|
144
+ | `direct-http` | Plain HTTP works | `opensteer.fetch(url)` (default) |
145
+ | `matched-tls` | Needs TLS fingerprint matching | `opensteer.fetch(url, { transport: "matched-tls" })` |
146
+ | `page-http` | Needs a live browser page | `opensteer.fetch(url, { transport: "page" })` |
56
147
 
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.
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.
59
- - Only write a reusable SDK script if the user asks for one. CLI exploration is often the entire task.
60
- - Always close the browser when done: `opensteer close --workspace <id>`.
148
+ ### Step 5: Check browser state (if replay returns 401/403)
61
149
 
62
- ## Request Constraints
150
+ ```bash
151
+ opensteer cookies example.com --workspace demo
152
+ opensteer storage example.com --workspace demo
153
+ opensteer state example.com --workspace demo
154
+ ```
63
155
 
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.
156
+ Look for session cookies, CSRF tokens, or storage-backed auth that the request depends on.
68
157
 
69
- ## DOM Constraints
158
+ ### Step 6: Write SDK code
159
+
160
+ ```bash
161
+ opensteer close --workspace demo
162
+ ```
163
+
164
+ ```ts
165
+ import { Opensteer } from "opensteer";
166
+ const opensteer = new Opensteer({ workspace: "demo", rootDir: process.cwd() });
167
+
168
+ async function ensureSession() {
169
+ const cookies = await opensteer.cookies("example.com");
170
+ if (cookies.has("session")) return;
171
+ await opensteer.goto("https://example.com");
172
+ }
173
+
174
+ export async function search(keyword: string) {
175
+ await ensureSession();
176
+ const response = await opensteer.fetch("https://api.example.com/search", {
177
+ query: { keyword, count: 24 },
178
+ });
179
+ return response.json();
180
+ }
181
+ ```
182
+
183
+ If replay showed a required transport, carry it into `fetch()`:
184
+
185
+ ```ts
186
+ const response = await opensteer.fetch("https://api.example.com/search", {
187
+ query: { keyword: "laptop" },
188
+ transport: "matched-tls",
189
+ });
190
+ ```
191
+
192
+ IMPORTANT: `opensteer.fetch()` does not require opening a browser page. It works directly with the session's cookies and transport stack. Only call `opensteer.open()` or `opensteer.goto()` if you need to establish session cookies first.
193
+
194
+ ---
70
195
 
71
- - `persistAsDescription` requires the verbose `opensteer run dom.*` syntax. The short CLI commands (`click`, `input`, etc.) do NOT support it.
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.
73
- - Prefer Opensteer surfaces (`extract()`, descriptors, `captureNetwork`) over raw Playwright / `page.evaluate()` so data stays in the workspace.
196
+ ## Browser Management
197
+
198
+ ### Import a Chrome profile
199
+
200
+ Copy cookies, localStorage, and session state from an existing Chrome installation:
201
+
202
+ ```bash
203
+ opensteer browser clone --workspace my-site \
204
+ --source-user-data-dir "$HOME/Library/Application Support/Google/Chrome" \
205
+ --source-profile-directory Default
206
+ ```
207
+
208
+ ### Attach to a running browser
209
+
210
+ Start Chrome with remote debugging, then connect Opensteer:
211
+
212
+ ```bash
213
+ # Terminal 1: launch Chrome
214
+ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
215
+
216
+ # Terminal 2: attach Opensteer
217
+ opensteer open https://example.com --workspace demo --attach-endpoint http://localhost:9222
218
+ ```
219
+
220
+ ### Headful mode
221
+
222
+ ```bash
223
+ opensteer open https://example.com --workspace demo --headless false
224
+ ```
225
+
226
+ ### Workspace lifecycle
227
+
228
+ ```bash
229
+ opensteer browser status --workspace demo
230
+ opensteer browser reset --workspace demo # reset browser data, keep workspace
231
+ opensteer browser delete --workspace demo # delete workspace entirely
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Tabs
237
+
238
+ ```bash
239
+ opensteer tab list --workspace demo
240
+ opensteer tab new https://other-page.com --workspace demo
241
+ opensteer tab 2 --workspace demo # switch to tab 2
242
+ opensteer tab close 2 --workspace demo
243
+ ```
244
+
245
+ ## Run JavaScript
246
+
247
+ ```bash
248
+ opensteer evaluate "document.title" --workspace demo
249
+ ```
250
+
251
+ ## Computer-Use (Coordinate-Based)
252
+
253
+ For canvas, WebGL, or complex iframes where DOM element targeting fails:
254
+
255
+ ```bash
256
+ opensteer computer click 245 380 --workspace demo --capture-network action
257
+ opensteer computer type "search query" --workspace demo
258
+ opensteer computer key Enter --workspace demo
259
+ opensteer computer scroll 400 300 --dx 0 --dy -200 --workspace demo
260
+ opensteer computer screenshot --workspace demo
261
+ ```
262
+
263
+ ---
264
+
265
+ ## CLI Quick Reference
266
+
267
+ | Command | Positional args | Key flags |
268
+ |---|---|---|
269
+ | `open <url>` | url | `--headless`, `--provider`, `--attach-endpoint`, `--attach-header` |
270
+ | `close` | — | — |
271
+ | `status` | — | — |
272
+ | `goto <url>` | url | `--capture-network` |
273
+ | `snapshot [mode]` | action \| extraction | — |
274
+ | `click <element>` | element number | `--persist`, `--capture-network`, `--button` |
275
+ | `hover <element>` | element number | `--persist`, `--capture-network` |
276
+ | `input <element> <text>` | element, text | `--persist`, `--press-enter`, `--capture-network` |
277
+ | `scroll <dir> <amount>` | direction, amount | `--element`, `--persist`, `--capture-network` |
278
+ | `extract <schema>` | JSON schema | `--persist` |
279
+ | `evaluate <script>` | JS expression | — |
280
+ | `network query` | — | `--capture`, `--url`, `--hostname`, `--json`, `--limit`, +6 filters |
281
+ | `network detail <id>` | recordId | — |
282
+ | `replay <id>` | recordId | `--query`, `--header`, `--body`, `--variables` |
283
+ | `fetch <url>` | url | `--method`, `--header`, `--query`, `--body`, `--transport`, `--cookies` |
284
+ | `cookies [domain]` | domain (optional) | — |
285
+ | `storage [domain]` | domain (optional) | — |
286
+ | `state [domain]` | domain (optional) | — |
287
+ | `tab list / new / <n> / close` | varies | — |
288
+ | `computer click/type/key/scroll/move/drag/screenshot/wait` | varies | `--capture-network` |
289
+
290
+ ## SDK Quick Reference
291
+
292
+ ```ts
293
+ // Browser lifecycle
294
+ await opensteer.open(url);
295
+ await opensteer.goto(url, { captureNetwork?: "label" });
296
+ await opensteer.close();
297
+
298
+ // DOM actions — save to cache
299
+ await opensteer.click({ element: 7, persist: "name" });
300
+ await opensteer.input({ element: 5, text: "...", persist: "name", pressEnter: true });
301
+ await opensteer.hover({ element: 3, persist: "name" });
302
+ await opensteer.scroll({ direction: "down", amount: 400 });
303
+
304
+ // DOM actions — resolve from cache
305
+ await opensteer.click({ persist: "name" });
306
+ await opensteer.input({ persist: "name", text: "..." });
307
+
308
+ // Extraction
309
+ await opensteer.extract({ persist: "name" }); // cached schema
310
+ await opensteer.extract({ persist: "name", schema: { ... } }); // inline schema
311
+
312
+ // Network discovery
313
+ const records = await opensteer.network.query({ capture: "label", limit: 20 });
314
+ const detail = await opensteer.network.detail(recordId);
315
+ const replay = await opensteer.network.replay(recordId, { query: { k: "v" } });
316
+
317
+ // Fetch — works without a page open
318
+ const response = await opensteer.fetch(url, {
319
+ query?: { key: "value" },
320
+ method?: "POST",
321
+ headers?: { Authorization: "Bearer ..." },
322
+ body?: { ... },
323
+ transport?: "auto" | "direct" | "matched-tls" | "page",
324
+ });
325
+
326
+ // Browser state
327
+ const cookies = await opensteer.cookies("domain.com"); // .has(), .get(), .serialize()
328
+ const storage = await opensteer.storage("domain.com", "local");
329
+ const state = await opensteer.state("domain.com");
330
+
331
+ // Snapshots
332
+ const html = await opensteer.snapshot("action");
333
+ const html = await opensteer.snapshot("extraction");
334
+ ```
335
+
336
+ ---
74
337
 
75
- ## Common Mistakes
338
+ ## Common Issues
76
339
 
77
- - Parsing the `counters` array instead of reading the `html` string from snapshots. Read the HTML — find `c="N"` values.
78
- - Using `page.evaluate()` or CSS selectors when `extract()` can express the output.
79
- - Forgetting to re-snapshot after navigation. Always re-snapshot before targeting new elements.
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`.
340
+ | Symptom | Fix |
341
+ |---|---|
342
+ | Element numbers wrong after navigation | Re-snapshot before using element numbers |
343
+ | `replay` returns 401/403 | Check `cookies`, `storage`, `state` request depends on session tokens |
344
+ | `replay` works but `fetch()` fails | Use the transport replay discovered: `transport: "matched-tls"` or `"page"` |
345
+ | Direct HTTP blocked, browser transport works | Site uses TLS fingerprinting — use `transport: "matched-tls"` |
346
+ | Extract returns empty data | Element numbers changed — re-snapshot and rebuild the schema |
347
+ | `fetch()` fails with no session | Call `opensteer.goto(url)` first to establish cookies, then `fetch()` |