SDK Reference
Errors and Diagnostics
Result/error typing and practical debugging guidance for OpenSteer SDK usage.
Result Types
interface ActionResult {
method: string
namespace: string
persisted: boolean
pathFile: string | null
selectorUsed?: string | null
}
interface StateResult {
url: string
title: string
html: string
}
interface ExtractionRunResult<T = unknown> {
namespace: string
persisted: boolean
pathFile: string | null
data: T
paths: Record<string, ElementPath>
}
interface TabInfo {
index: number
url: string
title: string
active: boolean
}
interface BoundingBox {
x: number
y: number
width: number
height: number
}
interface CookieParam {
name: string
value: string
url?: string
domain?: string
path?: string
expires?: number
httpOnly?: boolean
secure?: boolean
sameSite?: 'Strict' | 'Lax' | 'None'
}
Error Types
class OpensteerActionError extends Error {
readonly action: string
readonly code: ActionFailureCode
readonly failure: ActionFailure
readonly selectorUsed: string | null
}
type ActionFailureCode =
| 'TARGET_NOT_FOUND'
| 'TARGET_UNAVAILABLE'
| 'TARGET_STALE'
| 'TARGET_AMBIGUOUS'
| 'BLOCKED_BY_INTERCEPTOR'
| 'NOT_VISIBLE'
| 'NOT_ENABLED'
| 'NOT_EDITABLE'
| 'INVALID_TARGET'
| 'INVALID_OPTIONS'
| 'ACTION_TIMEOUT'
| 'UNKNOWN'
interface ActionFailure {
code: ActionFailureCode
message: string
retryable: boolean
classificationSource: ActionFailureClassificationSource
details?: ActionFailureDetails
}
type ActionFailureClassificationSource =
| 'typed_error'
| 'playwright_call_log'
| 'dom_probe'
| 'message_heuristic'
| 'unknown'
interface ActionFailureDetails {
blocker?: ActionFailureBlocker
observation?: string
}
interface ActionFailureBlocker {
tag: string
id: string | null
classes: string[]
role: string | null
text: string | null
}
AI Helpers
Exported for advanced integration:
createResolveCallback(model: string, options?: { temperature?: number; maxTokens?: number | null; env?: Record<string, string | undefined> })-- create a standalone resolve callbackcreateExtractCallback(model: string, options?: { temperature?: number; maxTokens?: number | null; env?: Record<string, string | undefined> })-- create a standalone extract callbackgetModelProvider(model: string, options?: { env?: Record<string, string | undefined> })-- resolve an AI SDK model provider
Covered Features
env:OPENSTEER_DEBUGsdk:state
