opensteer 0.8.15 → 0.8.17

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":";;;;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,EAAG,KAAA;AAAA,EAC9D;AAAA,EAEA,MAAA,GAAkC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EACd;AAAA,EAEA,SAAA,GAAoB;AAClB,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,GAAA,CAAI,CAAC,WAAW,CAAA,EAAG,MAAA,CAAO,IAAI,CAAA,CAAA,EAAI,MAAA,CAAO,KAAK,CAAA,CAAE,CAAA,CAAE,KAAK,IAAI,CAAA;AAAA,EACjF;AACF,CAAA;AAEO,IAAM,YAAN,MAAgB;AAAA,EACJ,OAAA;AAAA,EACA,cAAA;AAAA,EACR,OAAA;AAAA,EACA,GAAA;AAAA,EACA,OAAA;AAAA,EAET,WAAA,CAAY,OAAA,GAA4B,EAAC,EAAG;AAC1C,IAAA,MAAM,WA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MAAA,EAC4C;AAC5C,EAAA,IAAI,QAAA,CAAS,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACjC,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,IAAI,WAAW,MAAA,EAAW;AACxB,IAAA,OAAO,QAAA,CAAS,QAAQ,CAAC,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,SAAS,OAAA,CAAQ,IAAA,CAAK,CAAC,KAAA,KAAU,KAAA,CAAM,WAAW,MAAM,CAAA;AACjE;AAEA,SAAS,WAAW,QAAA,EAAoD;AACtE,EAAA,OAAO,IAAI,QAAA,CAAS,UAAA,CAAW,QAAQ,CAAA,EAAG;AAAA,IACxC,QAAQ,QAAA,CAAS,MAAA;AAAA,IACjB,YAAY,QAAA,CAAS,UAAA;AAAA,IACrB,OAAA,EAAS,MAAA,CAAO,WAAA,CAAY,QAAA,CAAS,QAAQ,GAAA,CAAI,CAAC,MAAA,KAAW,CAAC,MAAA,CAAO,IAAA,EAAM,MAAA,CAAO,KAAK,CAAC,CAAC;AAAA,GAC1F,CAAA;AACH;AAEA,SAAS,WAAW,QAAA,EAAkE;AACpF,EAAA,IAAI,QAAA,CAAS,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"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ export { Opensteer } from './chunk-Y3ULLNOS.js';
2
+ import './chunk-KBO7DDPF.js';
3
+ //# sourceMappingURL=opensteer-3Q3LR5XM.js.map
4
+ //# sourceMappingURL=opensteer-3Q3LR5XM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"opensteer-3Q3LR5XM.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opensteer",
3
- "version": "0.8.15",
3
+ "version": "0.8.17",
4
4
  "description": "Opensteer browser automation, replay, and reverse-engineering toolkit.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,21 +49,21 @@
49
49
  ],
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.27.1",
52
+ "@opensteer/engine-playwright": "workspace:*",
53
+ "@opensteer/runtime-core": "workspace:*",
52
54
  "cheerio": "^1.1.2",
53
55
  "css-select": "^6.0.0",
54
56
  "domhandler": "^5.0.3",
55
57
  "prettier": "^3.8.1",
56
58
  "sharp": "^0.34.5",
57
59
  "skills": "^1.4.6",
58
- "ws": "^8.18.0",
59
- "@opensteer/engine-playwright": "0.8.6",
60
- "@opensteer/runtime-core": "0.1.6"
60
+ "ws": "^8.18.0"
61
61
  },
62
62
  "optionalDependencies": {
63
63
  "webcrack": "^2.15.1"
64
64
  },
65
65
  "peerDependencies": {
66
- "@opensteer/engine-abp": "0.8.7"
66
+ "@opensteer/engine-abp": "workspace:*"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@opensteer/engine-abp": {
@@ -71,13 +71,14 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "@opensteer/protocol": "0.7.6",
75
- "@opensteer/browser-core": "0.7.6",
76
- "@opensteer/engine-abp": "0.8.7"
74
+ "@opensteer/browser-core": "workspace:*",
75
+ "@opensteer/engine-abp": "workspace:*",
76
+ "@opensteer/protocol": "workspace:*"
77
77
  },
78
78
  "scripts": {
79
79
  "build": "tsup && node ../../scripts/sync-package-skills.mjs",
80
80
  "clean": "rimraf dist skills",
81
+ "prepack": "node ../../scripts/sync-package-skills.mjs",
81
82
  "typecheck": "tsc --noEmit -p tsconfig.json"
82
83
  }
83
- }
84
+ }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: opensteer
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."
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, reverse-engineering a site API, or browser-grade fetch."
4
4
  argument-hint: "[goal]"
5
5
  ---
6
6
 
@@ -9,7 +9,7 @@ argument-hint: "[goal]"
9
9
  Opensteer gives agents a real Chromium browser for two jobs normal code cannot do:
10
10
 
11
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
+ 2. **API reverse engineering** — capture real browser traffic, identify APIs, test transport portability, and write reusable code.
13
13
 
14
14
  The workflow is always: **explore with CLI, then write reusable code with SDK.**
15
15
 
@@ -122,40 +122,51 @@ opensteer network query --workspace demo --capture search --hostname api.example
122
122
 
123
123
  `--json` filters to JSON and GraphQL responses only. Other filters: `--url`, `--path`, `--method`, `--status`, `--type`, `--before`, `--after`, `--limit`.
124
124
 
125
- ### Step 3: Inspect
125
+ ### Step 3: Inspect and probe transport
126
126
 
127
127
  ```bash
128
128
  opensteer network detail rec_123 --workspace demo
129
+ opensteer network detail rec_123 --probe --workspace demo
129
130
  ```
130
131
 
131
- Shows: URL, method, request headers, cookies sent, request/response body preview, GraphQL metadata, redirect chain.
132
+ The first command shows: URL, method, request headers, cookies sent, request/response body preview, GraphQL metadata, redirect chain.
132
133
 
133
- ### Step 4: Test replay
134
+ Add `--probe` to also test which transport works for this API:
135
+
136
+ | Transport | Meaning | SDK usage |
137
+ | ------------- | ------------------------------ | ----------------------------------------------- |
138
+ | `direct-http` | Plain HTTP works | `this.fetch(url)` (default) |
139
+ | `matched-tls` | Needs TLS fingerprint matching | `this.fetch(url, { transport: "matched-tls" })` |
140
+ | `page-http` | Needs a live browser page | `this.fetch(url, { transport: "page" })` |
141
+
142
+ ### Step 4: Check browser state (if 401/403)
134
143
 
135
144
  ```bash
136
- opensteer replay rec_123 --workspace demo
137
- opensteer replay rec_123 --workspace demo --query keyword=headphones --query count=10
145
+ opensteer state example.com --workspace demo
138
146
  ```
139
147
 
140
- Replay tries transports automatically and reports which succeeded:
148
+ Look for session cookies, CSRF tokens, or storage-backed auth that the request depends on.
141
149
 
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" })` |
150
+ ### Step 5: Test and write code with exec
147
151
 
148
- ### Step 5: Check browser state (if replay returns 401/403)
152
+ Use `exec` to test the API call with the SDK. The code you write here is the same code that goes in your final script:
149
153
 
150
154
  ```bash
151
- opensteer cookies example.com --workspace demo
152
- opensteer storage example.com --workspace demo
153
- opensteer state example.com --workspace demo
155
+ opensteer exec "
156
+ const r = await this.fetch('https://api.example.com/search', {
157
+ method: 'POST',
158
+ headers: { 'content-type': 'application/json' },
159
+ body: JSON.stringify({ keyword: 'laptop', count: 24 }),
160
+ });
161
+ return { status: r.status, data: await r.json() };
162
+ " --workspace demo
154
163
  ```
155
164
 
156
- Look for session cookies, CSRF tokens, or storage-backed auth that the request depends on.
165
+ `exec` runs JavaScript with the Opensteer SDK bound as `this`. It supports `await` and has access to `this.fetch()`, `this.cookies()`, `this.evaluate()`, and all other SDK methods.
166
+
167
+ IMPORTANT: Use `exec` instead of `evaluate` for API calls. `evaluate` runs inside the browser page where anti-bot scripts can detect and block programmatic requests. `exec` runs through the framework's transport stack which automatically finds the least detectable path.
157
168
 
158
- ### Step 6: Write SDK code
169
+ ### Step 6: Write the final SDK script
159
170
 
160
171
  ```bash
161
172
  opensteer close --workspace demo
@@ -165,31 +176,17 @@ opensteer close --workspace demo
165
176
  import { Opensteer } from "opensteer";
166
177
  const opensteer = new Opensteer({ workspace: "demo", rootDir: process.cwd() });
167
178
 
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
179
  export async function search(keyword: string) {
175
- await ensureSession();
176
180
  const response = await opensteer.fetch("https://api.example.com/search", {
177
- query: { keyword, count: 24 },
181
+ method: "POST",
182
+ headers: { "content-type": "application/json" },
183
+ body: JSON.stringify({ keyword, count: 24 }),
178
184
  });
179
185
  return response.json();
180
186
  }
181
187
  ```
182
188
 
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.
189
+ `opensteer.fetch()` accepts standard Web Fetch API syntax (`body` as string, `headers` as `Record<string, string>`). It auto-selects the best transport and includes browser cookies by default.
193
190
 
194
191
  ---
195
192
 
@@ -244,6 +241,14 @@ opensteer tab close 2 --workspace demo
244
241
 
245
242
  ## Run JavaScript
246
243
 
244
+ Use `exec` for API calls and SDK operations (runs in Node.js, avoids bot detection):
245
+
246
+ ```bash
247
+ opensteer exec "await this.fetch('https://api.example.com/data').then(r => r.json())" --workspace demo
248
+ ```
249
+
250
+ Use `evaluate` only for DOM inspection (runs inside the browser page):
251
+
247
252
  ```bash
248
253
  opensteer evaluate "document.title" --workspace demo
249
254
  ```
@@ -264,28 +269,26 @@ opensteer computer screenshot --workspace demo
264
269
 
265
270
  ## CLI Quick Reference
266
271
 
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` |
272
+ | Command | Positional args | Key flags |
273
+ | ---------------------------------------------------------- | -------------------- | ----------------------------------------------------------------------- |
274
+ | `open <url>` | url | `--headless`, `--provider`, `--attach-endpoint`, `--attach-header` |
275
+ | `close` | — | — |
276
+ | `status` | — | — |
277
+ | `goto <url>` | url | `--capture-network` |
278
+ | `snapshot [mode]` | action \| extraction | — |
279
+ | `click <element>` | element number | `--persist`, `--capture-network`, `--button` |
280
+ | `hover <element>` | element number | `--persist`, `--capture-network` |
281
+ | `input <element> <text>` | element, text | `--persist`, `--press-enter`, `--capture-network` |
282
+ | `scroll <dir> <amount>` | direction, amount | `--element`, `--persist`, `--capture-network` |
283
+ | `extract <schema>` | JSON schema | `--persist` |
284
+ | `evaluate <script>` | JS expression | — |
285
+ | `network query` | — | `--capture`, `--url`, `--hostname`, `--json`, `--limit`, +6 filters |
286
+ | `network detail <id>` | recordId | `--probe` |
287
+ | `fetch <url>` | url | `--method`, `--header`, `--query`, `--body`, `--transport`, `--cookies` |
288
+ | `state [domain]` | domain (optional) | |
289
+ | `exec <expression>` | JS expression | — |
290
+ | `tab list / new / <n> / close` | varies | |
291
+ | `computer click/type/key/scroll/move/drag/screenshot/wait` | varies | `--capture-network` |
289
292
 
290
293
  ## SDK Quick Reference
291
294
 
@@ -312,20 +315,16 @@ await opensteer.extract({ persist: "name", schema: { ... } }); // inline schem
312
315
  // Network discovery
313
316
  const records = await opensteer.network.query({ capture: "label", limit: 20 });
314
317
  const detail = await opensteer.network.detail(recordId);
315
- const replay = await opensteer.network.replay(recordId, { query: { k: "v" } });
316
318
 
317
- // Fetch — works without a page open
319
+ // Fetch — standard Web Fetch API syntax, auto-selects transport
318
320
  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",
321
+ method: "POST",
322
+ headers: { "content-type": "application/json" },
323
+ body: JSON.stringify({ keyword: "laptop" }),
324
324
  });
325
325
 
326
326
  // Browser state
327
327
  const cookies = await opensteer.cookies("domain.com"); // .has(), .get(), .serialize()
328
- const storage = await opensteer.storage("domain.com", "local");
329
328
  const state = await opensteer.state("domain.com");
330
329
 
331
330
  // Snapshots
@@ -337,11 +336,11 @@ const html = await opensteer.snapshot("extraction");
337
336
 
338
337
  ## Common Issues
339
338
 
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()` |
339
+ | Symptom | Fix |
340
+ | -------------------------------------------- | -------------------------------------------------------------------------------------------------- |
341
+ | Element numbers wrong after navigation | Re-snapshot before using element numbers |
342
+ | `fetch()` returns 401/403 | Check `state` — request depends on session cookies or tokens |
343
+ | Direct HTTP blocked, browser transport works | Site uses TLS fingerprinting use `transport: "matched-tls"` |
344
+ | Extract returns empty data | Element numbers changedre-snapshot and rebuild the schema |
345
+ | `fetch()` fails with no session | Call `opensteer.goto(url)` first to establish cookies, then `fetch()` |
346
+ | Using `evaluate` for API calls | Use `exec` instead `evaluate` runs inside the page where anti-bot scripts can intercept requests |
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 TrendUp AI, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.