Liking cljdoc? Tell your friends :D
Clojure only.

com.blockether.spel.sci-env

SCI (Small Clojure Interpreter) environment for native-image REPL.

Registers all spel functions as SCI namespaces so they can be evaluated in a native-image compiled REPL without JVM startup.

The SCI context wraps a stateful Playwright session with managed atoms for the Playwright, Browser, BrowserContext, and Page instances.

Namespaces available in eval-sci mode: spel/ - Simplified API (implicit page/context from atoms) snapshot/ - Accessibility snapshot capture annotate/ - Screenshot annotation input/ - Keyboard, Mouse, Touchscreen (raw pass-throughs) frame/ - Frame and FrameLocator operations (raw pass-throughs) net/ - Network request/response/route (raw pass-throughs) loc/ - Locator operations (raw pass-throughs, explicit Locator arg) assert/ - Assertion functions (raw pass-throughs, explicit assertion obj) core/ - Lifecycle stubs + utility pass-throughs

Usage: (def ctx (create-sci-ctx)) (eval-string ctx "(spel/start!)") (eval-string ctx "(spel/navigate "https://example.org")") (eval-string ctx "(spel/capture-snapshot)") (eval-string ctx "(spel/stop!)")

SCI (Small Clojure Interpreter) environment for native-image REPL.

Registers all spel functions as SCI namespaces so they
can be evaluated in a native-image compiled REPL without JVM startup.

The SCI context wraps a stateful Playwright session with managed
atoms for the Playwright, Browser, BrowserContext, and Page instances.

 Namespaces available in eval-sci mode:
   spel/     - Simplified API (implicit page/context from atoms)
  snapshot/ - Accessibility snapshot capture
  annotate/ - Screenshot annotation
  input/    - Keyboard, Mouse, Touchscreen (raw pass-throughs)
  frame/    - Frame and FrameLocator operations (raw pass-throughs)
  net/      - Network request/response/route (raw pass-throughs)
  loc/      - Locator operations (raw pass-throughs, explicit Locator arg)
  assert/   - Assertion functions (raw pass-throughs, explicit assertion obj)
  core/     - Lifecycle stubs + utility pass-throughs

Usage:
  (def ctx (create-sci-ctx))
   (eval-string ctx "(spel/start!)")
   (eval-string ctx "(spel/navigate \"https://example.org\")")
   (eval-string ctx "(spel/capture-snapshot)")
   (eval-string ctx "(spel/stop!)")
raw docstring

!action-counterclj


!action-logclj


!action-log-startclj


!backendclj


!browserclj


!cdp-disconnect-handlerclj


!cdp-idle-timeout-msclj


!cdp-lock-wait-sclj


!cdp-reconnect-handlerclj


!contextclj


!daemon-mode?clj


!default-timeoutclj


!deviceclj


!ios-sessionclj


!pageclj


!pwclj


!session-idle-timeout-msclj


!set-cdp-idle-timeout-handlerclj


!set-cdp-lock-wait-handlerclj


!set-device-handlerclj


!set-session-idle-timeout-handlerclj


!throw-on-errorclj


create-sci-ctxclj

(create-sci-ctx)

Creates a SCI context with all spel functions registered.

The context includes:

  • pw namespace: All REPL functions (start!, stop!, goto, click, etc.)
  • snapshot namespace: Snapshot capture and ref resolution
  • annotate namespace: Screenshot annotation
  • input namespace: Keyboard, Mouse, Touchscreen operations
  • frame namespace: Frame and FrameLocator operations
  • net namespace: Network request/response/route operations
  • loc namespace: Raw locator operations (explicit Locator arg)
  • assert namespace: Raw assertion operations (explicit assertion obj)
  • core namespace: Lifecycle stubs + utility pass-throughs

All Playwright Java classes are registered for interop.

Returns: SCI context ready for evaluation.

Creates a SCI context with all spel functions registered.

The context includes:
- `pw` namespace: All REPL functions (start!, stop!, goto, click, etc.)
- `snapshot` namespace: Snapshot capture and ref resolution
- `annotate` namespace: Screenshot annotation
- `input` namespace: Keyboard, Mouse, Touchscreen operations
- `frame` namespace: Frame and FrameLocator operations
- `net` namespace: Network request/response/route operations
- `loc` namespace: Raw locator operations (explicit Locator arg)
- `assert` namespace: Raw assertion operations (explicit assertion obj)
- `core` namespace: Lifecycle stubs + utility pass-throughs

All Playwright Java classes are registered for interop.

Returns:
SCI context ready for evaluation.
raw docstring

eval-stringclj

(eval-string ctx code)

Evaluates a Clojure string in the SCI context.

Binds SCI's out/err/in to the JVM equivalents so that println, prn, etc. work correctly in eval-sci mode.

Params: ctx - SCI context from create-sci-ctx. code - String. Clojure code to evaluate.

Returns: Result of evaluation.

When SCI cannot resolve a symbol, appends a 'did you mean?' hint: the same name with a trailing ! (spel's mutator convention) when that resolves, so set-viewport-size points at set-viewport-size!, otherwise the namespace that really binds the name, so spel/with-retry points at core/with-retry.

Evaluates a Clojure string in the SCI context.

Binds SCI's *out*/*err*/*in* to the JVM equivalents so that
`println`, `prn`, etc. work correctly in eval-sci mode.

Params:
`ctx`  - SCI context from create-sci-ctx.
`code` - String. Clojure code to evaluate.

Returns:
Result of evaluation.

When SCI cannot resolve a symbol, appends a 'did you mean?' hint: the same
name with a trailing `!` (spel's mutator convention) when that resolves, so
`set-viewport-size` points at `set-viewport-size!`, otherwise the namespace
that really binds the name, so `spel/with-retry` points at
`core/with-retry`.
raw docstring

sci-$clj

(sci-$ sel-or-loc)

sci-$$clj

(sci-$$ sel)

sci-$alt-textclj

(sci-$alt-text text)

sci-$labelclj

(sci-$label text)

sci-$placeholderclj

(sci-$placeholder text)

sci-$refclj

(sci-$ref ref-id)

Locates an element by its snapshot ref ID (e.g. "@e2yrjz", "@e9mter").

Locates an element by its snapshot ref ID (e.g. "@e2yrjz", "@e9mter").
raw docstring

sci-$roleclj

(sci-$role role)
(sci-$role role opts)

sci-$test-idclj

(sci-$test-id id)

sci-$textclj

(sci-$text text)

sci-$title-attrclj

(sci-$title-attr text)

sci-action-logclj

(sci-action-log)

Returns the current action log entries. Each entry is a map with :idx, :timestamp, :action, :target, :args.

Returns the current action log entries.
Each entry is a map with :idx, :timestamp, :action, :target, :args.
raw docstring

sci-add-init-script!clj

(sci-add-init-script! script)

Registers a JavaScript string to run on every navigation of the current page. Returns the page for threading.

Registers a JavaScript string to run on every navigation of the
current page. Returns the page for threading.
raw docstring

sci-add-init-script-file!clj

(sci-add-init-script-file! path)

Registers a JavaScript file to run on every navigation of the current page. Returns the page for threading.

Registers a JavaScript file to run on every navigation of the
current page. Returns the page for threading.
raw docstring

sci-add-script-tagclj

(sci-add-script-tag opts)

sci-add-style-tagclj

(sci-add-style-tag opts)

sci-all-inner-textsclj

(sci-all-inner-texts sel)

sci-all-text-contentsclj

(sci-all-text-contents sel)

sci-annotateclj

(sci-annotate refs)
(sci-annotate refs opts)

Injects annotation overlays into the current page for visible elements. Takes refs from snapshot and optional display opts.

Injects annotation overlays into the current page for visible elements.
Takes refs from snapshot and optional display opts.
raw docstring

sci-annotated-screenshotclj

(sci-annotated-screenshot refs)
(sci-annotated-screenshot refs opts)

sci-anti-detection-headersclj

(sci-anti-detection-headers ua)

Returns anti-detection HTTP headers matched to a user-agent string.

Returns anti-detection HTTP headers matched to a user-agent string.
raw docstring

sci-assert-accessible-descriptionclj

(sci-assert-accessible-description sel desc)

sci-assert-accessible-error-messageclj

(sci-assert-accessible-error-message sel msg)

sci-assert-accessible-nameclj

(sci-assert-accessible-name sel name-val)

sci-assert-attachedclj

(sci-assert-attached sel)
(sci-assert-attached sel opts)

sci-assert-attrclj

(sci-assert-attr sel attr-name value)
(sci-assert-attr sel attr-name value opts)

sci-assert-checkedclj

(sci-assert-checked sel)
(sci-assert-checked sel opts)

sci-assert-classclj

(sci-assert-class sel class-val)
(sci-assert-class sel class-val opts)

sci-assert-contains-classclj

(sci-assert-contains-class sel class-val)
(sci-assert-contains-class sel class-val opts)

sci-assert-contains-textclj

(sci-assert-contains-text sel expected)
(sci-assert-contains-text sel expected opts)

sci-assert-countclj

(sci-assert-count sel n)
(sci-assert-count sel n opts)

sci-assert-cssclj

(sci-assert-css sel css-name value)
(sci-assert-css sel css-name value opts)

sci-assert-disabledclj

(sci-assert-disabled sel)
(sci-assert-disabled sel opts)

sci-assert-editableclj

(sci-assert-editable sel)
(sci-assert-editable sel opts)

sci-assert-emptyclj

(sci-assert-empty sel)

sci-assert-enabledclj

(sci-assert-enabled sel)
(sci-assert-enabled sel opts)

sci-assert-focusedclj

(sci-assert-focused sel)
(sci-assert-focused sel opts)

sci-assert-hiddenclj

(sci-assert-hidden sel)
(sci-assert-hidden sel opts)

sci-assert-idclj

(sci-assert-id sel id)
(sci-assert-id sel id opts)

sci-assert-in-viewportclj

(sci-assert-in-viewport sel)
(sci-assert-in-viewport sel opts)

sci-assert-js-propertyclj

(sci-assert-js-property sel prop-name value)

sci-assert-matches-aria-snapshotclj

(sci-assert-matches-aria-snapshot sel snapshot-str)

sci-assert-notclj

(sci-assert-not sel)

sci-assert-page-notclj

(sci-assert-page-not)

sci-assert-roleclj

(sci-assert-role sel role)

sci-assert-textclj

(sci-assert-text sel expected)
(sci-assert-text sel expected opts)

sci-assert-thatclj

(sci-assert-that target)

sci-assert-titleclj

(sci-assert-title expected)
(sci-assert-title expected opts)

sci-assert-urlclj

(sci-assert-url expected)
(sci-assert-url expected opts)

sci-assert-valueclj

(sci-assert-value sel value)
(sci-assert-value sel value opts)

sci-assert-valuesclj

(sci-assert-values sel values)
(sci-assert-values sel values opts)

sci-assert-visibleclj

(sci-assert-visible sel)
(sci-assert-visible sel opts)

sci-attrclj

(sci-attr sel name)

sci-audit-screenshotclj

(sci-audit-screenshot caption)
(sci-audit-screenshot caption opts)

Takes a screenshot with a caption bar at the bottom.

Takes a screenshot with a caption bar at the bottom.
raw docstring

sci-auto-accept-dialogs!clj

(sci-auto-accept-dialogs!)
(sci-auto-accept-dialogs! prompt-text)

Registers a persistent dialog handler that auto-accepts all dialogs. Optional prompt-text for prompt dialogs. Removes any previous handler first. Returns nil.

Registers a persistent dialog handler that auto-accepts all dialogs.
Optional prompt-text for prompt dialogs. Removes any previous handler first.
Returns nil.
raw docstring

sci-auto-dismiss-dialogs!clj

(sci-auto-dismiss-dialogs!)

Registers a persistent dialog handler that auto-dismisses all dialogs. Removes any previous handler first. Returns nil.

Registers a persistent dialog handler that auto-dismisses all dialogs.
Removes any previous handler first.
Returns nil.
raw docstring

sci-backclj

(sci-back)

Goes back in browser history (backend-aware).

Goes back in browser history (backend-aware).
raw docstring

sci-bboxclj

(sci-bbox sel)

sci-blurclj

(sci-blur sel)

sci-bring-to-frontclj

(sci-bring-to-front)

sci-browserclj

(sci-browser)

Returns the current Browser instance.

Returns the current Browser instance.
raw docstring

sci-browser-connected?clj

(sci-browser-connected?)

sci-browser-versionclj

(sci-browser-version)

sci-cdp-connectclj

(sci-cdp-connect)
(sci-cdp-connect url)

Connects to a Chrome/Edge browser via CDP (Chrome DevTools Protocol).

With a URL argument, connects to that specific endpoint: (spel/cdp-connect "http://192.168.1.50:9222")

Without arguments, auto-discovers the best endpoint:

  • On WSL: probes both 127.0.0.1 and the Windows host gateway IP (from /proc/net/route), uses whichever answers /json/version
  • On native Linux/macOS: probes 127.0.0.1 on ports 9222, 9229
  • Throws with clear instructions if no browser is found

This is the recommended entry point for CDP connections — it handles WSL networking, host resolution, and Chrome discovery automatically.

Examples: (spel/cdp-connect) ;; auto-discover (spel/cdp-connect "http://10.1.0.1:9222") ;; explicit host (spel/cdp-connect "ws://localhost:9222/devtools/browser/abc") ;; WS

Returns: Map with :connected URL, :url current page URL.

Connects to a Chrome/Edge browser via CDP (Chrome DevTools Protocol).

With a URL argument, connects to that specific endpoint:
  (spel/cdp-connect "http://192.168.1.50:9222")

Without arguments, auto-discovers the best endpoint:
- On WSL: probes both 127.0.0.1 and the Windows host gateway IP
  (from /proc/net/route), uses whichever answers /json/version
- On native Linux/macOS: probes 127.0.0.1 on ports 9222, 9229
- Throws with clear instructions if no browser is found

This is the recommended entry point for CDP connections — it
handles WSL networking, host resolution, and Chrome discovery
automatically.

Examples:
  (spel/cdp-connect)                           ;; auto-discover
  (spel/cdp-connect "http://10.1.0.1:9222")  ;; explicit host
  (spel/cdp-connect "ws://localhost:9222/devtools/browser/abc") ;; WS

Returns:
Map with :connected URL, :url current page URL.
raw docstring

sci-cdp-disconnectclj

(sci-cdp-disconnect)

Temporarily disconnects from the CDP endpoint.

Used in anti-detection scripts to evade CDP watchers. The Chrome process keeps running; only the debugging protocol link is dropped. Call cdp-reconnect to reattach.

Returns: Map with :disconnected boolean and :cdp URL string.

Example: (spel/cdp-disconnect) (spel/sleep 3000) ; browser runs unmonitored (spel/cdp-reconnect)

Temporarily disconnects from the CDP endpoint.

Used in anti-detection scripts to evade CDP watchers.
The Chrome process keeps running; only the debugging protocol
link is dropped. Call cdp-reconnect to reattach.

Returns:
Map with :disconnected boolean and :cdp URL string.

Example:
  (spel/cdp-disconnect)
  (spel/sleep 3000)         ; browser runs unmonitored
  (spel/cdp-reconnect)
raw docstring

sci-cdp-idle-timeoutclj

(sci-cdp-idle-timeout)

Returns the current CDP idle timeout in milliseconds.

After CDP disconnect, the daemon auto-shuts down if no reconnect occurs within this window. 0 means disabled. Default: 1800000 (30 min). Set SPEL_CDP_IDLE_TIMEOUT env var or call (spel/set-cdp-idle-timeout! ms).

Returns the current CDP idle timeout in milliseconds.

After CDP disconnect, the daemon auto-shuts down if no reconnect occurs
within this window. 0 means disabled. Default: 1800000 (30 min).
Set SPEL_CDP_IDLE_TIMEOUT env var or call (spel/set-cdp-idle-timeout! ms).
raw docstring

sci-cdp-lock-waitclj

(sci-cdp-lock-wait)

Returns the current CDP route lock wait timeout in seconds.

When another session holds the CDP route lock, the daemon waits up to this many seconds for the lock to be released before failing. 0 means fail immediately. Default: 120 (2 minutes). Set SPEL_CDP_LOCK_WAIT env var or call (spel/set-cdp-lock-wait! s).

Returns the current CDP route lock wait timeout in seconds.

When another session holds the CDP route lock, the daemon waits up to
this many seconds for the lock to be released before failing.
0 means fail immediately. Default: 120 (2 minutes).
Set SPEL_CDP_LOCK_WAIT env var or call (spel/set-cdp-lock-wait! s).
raw docstring

sci-cdp-reconnectclj

(sci-cdp-reconnect)
(sci-cdp-reconnect url)

Reconnects to the CDP endpoint after a disconnect.

No arguments needed — the daemon remembers the CDP URL from the original connection. An explicit URL override is accepted but almost never required.

Returns: Map with :connected URL, :url current page URL, :reconnected true.

Example: (spel/cdp-disconnect) (spel/sleep 3000) (spel/cdp-reconnect) ; just works — daemon knows the URL (spel/cdp-reconnect "ws://localhost:9222") ; explicit override

Reconnects to the CDP endpoint after a disconnect.

No arguments needed — the daemon remembers the CDP URL from
the original connection. An explicit URL override is accepted
but almost never required.

Returns:
Map with :connected URL, :url current page URL, :reconnected true.

Example:
  (spel/cdp-disconnect)
  (spel/sleep 3000)
  (spel/cdp-reconnect)          ; just works — daemon knows the URL
  (spel/cdp-reconnect "ws://localhost:9222")  ; explicit override
raw docstring

sci-checkclj

(sci-check sel)
(sci-check sel opts)

sci-checked?clj

(sci-checked? sel)

sci-clearclj

(sci-clear sel)

Clears an input (backend-aware).

Clears an input (backend-aware).
raw docstring

sci-clear-action-log!clj

(sci-clear-action-log!)

Clears the action log, resetting the counter and start time.

Clears the action log, resetting the counter and start time.
raw docstring

sci-clear-dialog-handler!clj

(sci-clear-dialog-handler!)

Removes the current auto-accept/auto-dismiss dialog handler. Returns nil.

Removes the current auto-accept/auto-dismiss dialog handler.
Returns nil.
raw docstring

sci-clear-refs!clj

(sci-clear-refs!)

sci-clickclj

(sci-click sel)
(sci-click sel opts)

sci-clipboard-copyclj

(sci-clipboard-copy text)

Writes text to the browser clipboard.

Writes text to the browser clipboard.
raw docstring

sci-clipboard-pasteclj

(sci-clipboard-paste)

Pastes clipboard contents into the currently focused element.

Pastes clipboard contents into the currently focused element.
raw docstring

sci-clipboard-readclj

(sci-clipboard-read)

Reads text from the browser clipboard.

Reads text from the browser clipboard.
raw docstring

sci-command-line-args-varclj


sci-compare-pagesclj

(sci-compare-pages baseline-page current-page)
(sci-compare-pages baseline-page current-page opts)

Compare two live pages: screenshot + snapshot + diff with semantic enrichment. Returns enriched regions with element labels.

Compare two live pages: screenshot + snapshot + diff with semantic enrichment.
Returns enriched regions with element labels.
raw docstring

sci-compare-screenshot-filesclj

(sci-compare-screenshot-files baseline-path current-path)
(sci-compare-screenshot-files baseline-path current-path opts)

Compare two PNG files pixel-by-pixel. See compare-screenshots for details.

Compare two PNG files pixel-by-pixel. See compare-screenshots for details.
raw docstring

sci-compare-screenshotsclj

(sci-compare-screenshots baseline-bytes current-bytes)
(sci-compare-screenshots baseline-bytes current-bytes opts)

Compare two PNG screenshots pixel-by-pixel using pixelmatch. Returns {:matched :diff-count :diff-percent :diff-image ...}.

Compare two PNG screenshots pixel-by-pixel using pixelmatch.
Returns {:matched :diff-count :diff-percent :diff-image ...}.
raw docstring

sci-contextclj

(sci-context)

Returns the current BrowserContext instance.

Returns the current BrowserContext instance.
raw docstring

sci-context-clear-cookies!clj

(sci-context-clear-cookies!)

Clears all cookies (Playwright only — the iOS backend exposes read-only cookie access).

Clears all cookies (Playwright only — the iOS backend exposes read-only
cookie access).
raw docstring

sci-context-clear-permissions!clj

(sci-context-clear-permissions!)

sci-context-cookiesclj

(sci-context-cookies)

Returns the cookie list. Backend-aware: reads Safari's cookies through WebDriver on the iOS backend, the BrowserContext on Playwright.

Returns the cookie list. Backend-aware: reads Safari's cookies through
WebDriver on the iOS backend, the BrowserContext on Playwright.
raw docstring

sci-context-grant-permissions!clj

(sci-context-grant-permissions! perms)

sci-context-route-from-har!clj

(sci-context-route-from-har! har)
(sci-context-route-from-har! har opts)

sci-context-route-web-socket!clj

(sci-context-route-web-socket! pattern handler)

sci-context-save-storage-state!clj

(sci-context-save-storage-state! path)

sci-context-set-extra-http-headers!clj

(sci-context-set-extra-http-headers! headers)

sci-context-set-offline!clj

(sci-context-set-offline! offline)

sci-context-storage-stateclj

(sci-context-storage-state)

sci-count-ofclj

(sci-count-of sel)

sci-dblclickclj

(sci-dblclick sel)
(sci-dblclick sel opts)

sci-ddg-search!clj

(sci-ddg-search! query)

Searches DuckDuckGo and returns structured results.

Searches DuckDuckGo and returns structured results.
raw docstring

sci-debugclj

(sci-debug)

Collects page diagnostics: performance timing, failed resources, DOM stats, dimensions. Returns map with :url :title :ready-state :timing :failed-resources :dom :dimensions.

Collects page diagnostics: performance timing, failed resources, DOM stats, dimensions.
Returns map with :url :title :ready-state :timing :failed-resources :dom :dimensions.
raw docstring

sci-dialog-accept!clj

(sci-dialog-accept! dialog)
(sci-dialog-accept! dialog prompt-text)

Accepts the dialog. Optional prompt-text for prompt dialogs.

Accepts the dialog. Optional prompt-text for prompt dialogs.
raw docstring

sci-dialog-default-valueclj

(sci-dialog-default-value dialog)

Returns the default value for prompt dialogs.

Returns the default value for prompt dialogs.
raw docstring

sci-dialog-dismiss!clj

(sci-dialog-dismiss! dialog)

Dismisses the dialog.

Dismisses the dialog.
raw docstring

sci-dialog-messageclj

(sci-dialog-message dialog)

Returns the dialog message text.

Returns the dialog message text.
raw docstring

sci-dialog-typeclj

(sci-dialog-type dialog)

Returns the dialog type (alert, confirm, prompt, beforeunload).

Returns the dialog type (alert, confirm, prompt, beforeunload).
raw docstring

sci-disabled?clj

(sci-disabled? sel)

sci-dispatch-eventclj

(sci-dispatch-event sel type)

sci-drag-byclj

(sci-drag-by sel dx dy)
(sci-drag-by sel dx dy opts)

Drags an element by pixel offset using mouse events. Resolves selector to locator, gets bounding box center, then performs: move → mousedown → mousemove(+dx,+dy) → mouseup.

Drags an element by pixel offset using mouse events.
Resolves selector to locator, gets bounding box center, then
performs: move → mousedown → mousemove(+dx,+dy) → mouseup.
raw docstring

sci-drag-toclj

(sci-drag-to sel target-sel)
(sci-drag-to sel target-sel opts)

Drags an element to another element. Resolves both selectors to locators via the current page.

Drags an element to another element.
Resolves both selectors to locators via the current page.
raw docstring

sci-duckduckgo-urlclj

(sci-duckduckgo-url query)

Builds a DuckDuckGo search URL from a query string.

Builds a DuckDuckGo search URL from a query string.
raw docstring

sci-editable?clj

(sci-editable? sel)

sci-emulate-media!clj

(sci-emulate-media! opts)

sci-enabled?clj

(sci-enabled? sel)

sci-eval-jsclj

(sci-eval-js expr)
(sci-eval-js expr arg)

sci-evaluate-all-locsclj

(sci-evaluate-all-locs sel expr)
(sci-evaluate-all-locs sel expr arg)

sci-evaluate-fileclj

(sci-evaluate-file path)
(sci-evaluate-file path arg)

Loads JavaScript from a file and evaluates it in the current page. Returns the evaluation result converted to Clojure data.

Loads JavaScript from a file and evaluates it in the current page.
Returns the evaluation result converted to Clojure data.
raw docstring

sci-evaluate-handleclj

(sci-evaluate-handle expr)
(sci-evaluate-handle expr arg)

sci-evaluate-locatorclj

(sci-evaluate-locator sel expr)
(sci-evaluate-locator sel expr arg)

sci-export-srtclj

(sci-export-srt)
(sci-export-srt opts)

Exports the current action log as an SRT subtitle string. Options: :min-duration-ms Minimum cue duration (default: 1000) :max-duration-ms Maximum cue duration (default: 5000)

Exports the current action log as an SRT subtitle string.
Options:
  :min-duration-ms  Minimum cue duration (default: 1000)
  :max-duration-ms  Maximum cue duration (default: 5000)
raw docstring

sci-expose-binding!clj

(sci-expose-binding! binding-name f)

sci-expose-function!clj

(sci-expose-function! fn-name f)

sci-extract-image-resultsclj

(sci-extract-image-results)

sci-extract-news-resultsclj

(sci-extract-news-results)

sci-extract-people-also-askclj

(sci-extract-people-also-ask)

(sci-extract-related-searches)

sci-extract-result-statsclj

(sci-extract-result-stats)

sci-extract-web-resultsclj

(sci-extract-web-results)

sci-fillclj

(sci-fill sel value)
(sci-fill sel value opts)

sci-find-free-portclj

(sci-find-free-port)

Returns an available local TCP port (integer).

Delegates to core/find-free-port and throws on anomaly.

Returns an available local TCP port (integer).

Delegates to core/find-free-port and throws on anomaly.
raw docstring

sci-finish-video-recordingclj

(sci-finish-video-recording)
(sci-finish-video-recording opts)

Stops video recording by closing the context to finalize the video. Returns the video file path. Creates a new context/page without video.

Opts: :save-as - String. Copy video to this path after finalization.

Stops video recording by closing the context to finalize the video.
Returns the video file path. Creates a new context/page without video.

Opts:
:save-as - String. Copy video to this path after finalization.
raw docstring

sci-firstclj

(sci-first sel)

sci-focusclj

(sci-focus sel)

sci-format-results-as-markdownclj

(sci-format-results-as-markdown search-type results)

Formats search results as a markdown table based on search type.

Formats search results as a markdown table based on search type.
raw docstring

sci-forwardclj

(sci-forward)

Goes forward in browser history (backend-aware).

Goes forward in browser history (backend-aware).
raw docstring

sci-frame-by-nameclj

(sci-frame-by-name name)

sci-frame-by-urlclj

(sci-frame-by-url pattern)

sci-framesclj

(sci-frames)

sci-full-snapshotclj

(sci-full-snapshot)
(sci-full-snapshot page)

sci-get-stylesclj

(sci-get-styles sel)
(sci-get-styles sel opts)

Returns computed CSS styles for an element. Pass {:full true} for all properties.

Returns computed CSS styles for an element. Pass {:full true} for all properties.
raw docstring

sci-gotoclj

(sci-goto url)
(sci-goto url opts)

Navigates the current page to a URL. Validates the URL before navigation — throws on invalid URLs. Dispatches through the active backend when one is installed (iOS).

Navigates the current page to a URL.
Validates the URL before navigation — throws on invalid URLs.
Dispatches through the active backend when one is installed (iOS).
raw docstring

sci-has-next-page?clj

(sci-has-next-page?)

sci-helpclj

(sci-help)
(sci-help query)

Lists all available SCI eval functions with arglists and descriptions. Call with no args to see all namespaces summary. Call with a namespace name to see all functions in that namespace. Call with a search string to find matching functions.

Lists all available SCI eval functions with arglists and descriptions.
Call with no args to see all namespaces summary.
Call with a namespace name to see all functions in that namespace.
Call with a search string to find matching functions.
raw docstring

sci-hidden?clj

(sci-hidden? sel)

sci-highlightclj

(sci-highlight sel)

sci-hoverclj

(sci-hover sel)
(sci-hover sel opts)

sci-htmlclj

(sci-html)

Returns the current page HTML source (backend-aware).

Returns the current page HTML source (backend-aware).
raw docstring

sci-human-pauseclj

(sci-human-pause)
(sci-human-pause min-ms max-ms)

Pauses for a random duration between min-ms and max-ms (default: 300-700ms). Simulates natural human pacing for smoother video recordings.

Usage: (spel/human-pause) ;; 300-700ms (spel/human-pause 500 1000) ;; 500-1000ms

Pauses for a random duration between min-ms and max-ms (default: 300-700ms).
Simulates natural human pacing for smoother video recordings.

Usage:
  (spel/human-pause)          ;; 300-700ms
  (spel/human-pause 500 1000) ;; 500-1000ms
raw docstring

sci-infoclj

(sci-info)

Returns a map with current page :url, :title, :viewport, and :closed? state.

Returns a map with current page :url, :title, :viewport, and :closed? state.
raw docstring

sci-inner-htmlclj

(sci-inner-html sel)

sci-inner-textclj

(sci-inner-text sel)

sci-inspectclj

(sci-inspect)
(sci-inspect opts)

Takes interactive snapshot with styles - the 'agent view'. Returns snapshot map with :tree :refs :counter :viewport.

Takes interactive snapshot with styles - the 'agent view'.
Returns snapshot map with :tree :refs :counter :viewport.
raw docstring

sci-ios-activate-app!clj

(sci-ios-activate-app!)
(sci-ios-activate-app! bundle-id)

Activates the bound or requested installed iOS application.

Activates the bound or requested installed iOS application.
raw docstring

sci-ios-app-installed?clj

(sci-ios-app-installed? bundle-id)

Returns true when an iOS application is installed.

Returns true when an iOS application is installed.
raw docstring

sci-ios-app-stateclj

(sci-ios-app-state bundle-id)

Returns the state of an installed iOS application as a keyword.

Returns the state of an installed iOS application as a keyword.
raw docstring

sci-ios-background-app!clj

(sci-ios-background-app!)
(sci-ios-background-app! seconds)

Moves the active iOS application to the background for N seconds.

Moves the active iOS application to the background for N seconds.
raw docstring

sci-ios-context-detailsclj

(sci-ios-context-details)

Returns detailed context records, including webview URL/title metadata when available.

Returns detailed context records, including webview URL/title metadata
when available.
raw docstring

sci-ios-contextsclj

(sci-ios-contexts)

Returns available iOS automation contexts (NATIVE_APP and inspectable WEBVIEW_* contexts).

Returns available iOS automation contexts (NATIVE_APP and inspectable
WEBVIEW_* contexts).
raw docstring

sci-ios-current-contextclj

(sci-ios-current-context)

Returns the active iOS automation context name.

Returns the active iOS automation context name.
raw docstring

sci-ios-devicesclj

(sci-ios-devices)

Lists available iOS Simulators without requiring an active session.

Lists available iOS Simulators without requiring an active session.
raw docstring

sci-ios-doctorclj

(sci-ios-doctor)

Runs iOS provider prerequisite diagnostics without installing software.

Runs iOS provider prerequisite diagnostics without installing software.
raw docstring

sci-ios-hide-keyboard!clj

(sci-ios-hide-keyboard!)

Dismisses the iOS software keyboard.

Dismisses the iOS software keyboard.
raw docstring

sci-ios-install-app!clj

(sci-ios-install-app! path)

Installs a simulator-compatible .app.

Installs a simulator-compatible .app.
raw docstring

sci-ios-launch-app!clj

(sci-ios-launch-app!)
(sci-ios-launch-app! bundle-id)

Launches the bound or requested installed iOS application.

Launches the bound or requested installed iOS application.
raw docstring

sci-ios-open-url!clj

(sci-ios-open-url! url)
(sci-ios-open-url! url bundle-id)

Opens a deep or universal URL.

Opens a deep or universal URL.
raw docstring

sci-ios-orientationclj

(sci-ios-orientation)

Returns the current iOS device orientation as :portrait or :landscape.

Returns the current iOS device orientation as :portrait or :landscape.
raw docstring

sci-ios-permissionclj

(sci-ios-permission service)
(sci-ios-permission bundle-id service)

Returns an iOS application permission value.

Returns an iOS application permission value.
raw docstring

sci-ios-set-orientation!clj

(sci-ios-set-orientation! requested)

Rotates the iOS device to :portrait or :landscape.

Rotates the iOS device to :portrait or :landscape.
raw docstring

sci-ios-set-permission!clj

(sci-ios-set-permission! service access)
(sci-ios-set-permission! bundle-id service access)

Sets an app permission. Access accepts :grant, :revoke, or :reset.

Sets an app permission. Access accepts :grant, :revoke, or :reset.
raw docstring

sci-ios-start!clj

(sci-ios-start! opts)

Starts an Appium/XCUITest application session in an iOS Simulator and installs it as the active backend. Called by (spel/start! {:provider :ios :bundle-id "com.example.app"}).

Opts: :device, :udid, :platform-version, :bundle-id, :app, :extra-capabilities, :appium-url, :session.

Starts an Appium/XCUITest application session in an iOS Simulator and
installs it as the active backend. Called by
(spel/start! {:provider :ios :bundle-id "com.example.app"}).

Opts: :device, :udid, :platform-version, :bundle-id, :app,
:extra-capabilities, :appium-url, :session.
raw docstring

sci-ios-tap-dom!clj

(sci-ios-tap-dom! x y)

Taps a WEB-VIEWPORT coordinate (CSS pixels) as a native XCUITest gesture.

Taps a WEB-VIEWPORT coordinate (CSS pixels) as a native XCUITest gesture.
raw docstring

sci-ios-tap-element!clj

(sci-ios-tap-element! css)

Taps the element matching a CSS selector inside the app's WebView, natively.

Taps the element matching a CSS selector inside the app's WebView, natively.
raw docstring

sci-ios-terminate-app!clj

(sci-ios-terminate-app!)
(sci-ios-terminate-app! bundle-id)

Terminates the bound or requested iOS application.

Terminates the bound or requested iOS application.
raw docstring

sci-ios-type-keys!clj

(sci-ios-type-keys! text)
(sci-ios-type-keys! selector text)

Types through XCTest keyboard events so native iOS IME/autocorrection runs.

Types through XCTest keyboard events so native iOS IME/autocorrection runs.
raw docstring

sci-ios-uninstall-app!clj

(sci-ios-uninstall-app! bundle-id)

Uninstalls an iOS application by bundle identifier.

Uninstalls an iOS application by bundle identifier.
raw docstring

sci-ios-viewport-offsetclj

(sci-ios-viewport-offset)

Returns the native-point offset of the app's web viewport on the screen.

Returns the native-point offset of the app's web viewport on the screen.
raw docstring

sci-json-write-strclj

(sci-json-write-str data)

Serializes Clojure data to a JSON string for eval-sci scripts.

Serializes Clojure data to a JSON string for eval-sci scripts.
raw docstring

sci-keyboardclj

(sci-keyboard)

sci-keyboard-pressclj

(sci-keyboard-press key)

Presses a key on the focused page/native element.

Presses a key on the focused page/native element.
raw docstring

sci-lastclj

(sci-last sel)

sci-last-responseclj

(sci-last-response url)

Navigates to URL and returns response info map with :status, :ok?, :url, :headers.

Navigates to URL and returns response info map with :status, :ok?, :url, :headers.
raw docstring

sci-launch-chromiumclj

(sci-launch-chromium _pw & _opts)

In daemon mode, returns the daemon's existing browser instance.

In daemon mode, returns the daemon's existing browser instance.
raw docstring

sci-launch-firefoxclj

(sci-launch-firefox _pw & _opts)

In daemon mode, returns the daemon's existing browser instance.

In daemon mode, returns the daemon's existing browser instance.
raw docstring

sci-launch-webkitclj

(sci-launch-webkit _pw & _opts)

In daemon mode, returns the daemon's existing browser instance.

In daemon mode, returns the daemon's existing browser instance.
raw docstring

sci-loc-filterclj

(sci-loc-filter sel opts)

sci-loc-get-by-labelclj

(sci-loc-get-by-label sel text)

sci-loc-get-by-roleclj

(sci-loc-get-by-role sel role)

sci-loc-get-by-test-idclj

(sci-loc-get-by-test-id sel id)

sci-loc-get-by-textclj

(sci-loc-get-by-text sel text)

sci-loc-locatorclj

(sci-loc-locator sel sub-sel)

sci-loc-wait-forclj

(sci-loc-wait-for sel)
(sci-loc-wait-for sel opts)

sci-locator-screenshotclj

(sci-locator-screenshot sel)
(sci-locator-screenshot sel opts)

sci-main-frameclj

(sci-main-frame)

sci-markclj

(sci-mark & refs)

Highlights specific snapshot refs with prominent pre-action markers (e.g. "@e2yrjz").

Highlights specific snapshot refs with prominent pre-action markers (e.g. "@e2yrjz").
raw docstring

sci-markdownifyclj

(sci-markdownify)
(sci-markdownify html)

Converts the current page HTML into Markdown.

Converts the current page HTML into Markdown.
raw docstring

sci-mouseclj

(sci-mouse)

sci-net-requestsclj

(sci-net-requests)

Returns the daemon-tracked network request summaries when available. In standalone SCI contexts without the daemon request ring buffer, returns [].

Returns the daemon-tracked network request summaries when available.
In standalone SCI contexts without the daemon request ring buffer, returns [].
raw docstring

sci-new-cdp-sessionclj

(sci-new-cdp-session)

Opens a new Chrome DevTools Protocol session bound to the current page. Pair with cdp-send, cdp-on, cdp-detach!.

Opens a new Chrome DevTools Protocol session bound to the current
page. Pair with `cdp-send`, `cdp-on`, `cdp-detach!`.
raw docstring

sci-new-contextclj

(sci-new-context _browser & _opts)

In daemon mode, returns the daemon's existing browser context.

In daemon mode, returns the daemon's existing browser context.
raw docstring

sci-new-pageclj

(sci-new-page _browser)

In daemon mode, returns the daemon's existing page.

In daemon mode, returns the daemon's existing page.
raw docstring

sci-new-page-from-contextclj

(sci-new-page-from-context _ctx)

In daemon mode, returns the daemon's existing page.

In daemon mode, returns the daemon's existing page.
raw docstring

sci-new-tab!clj

(sci-new-tab!)

Opens a new tab in the current context and switches to it.

Opens a new tab in the current context and switches to it.
raw docstring

sci-nthclj

(sci-nth sel n)

sci-off-dialogclj

(sci-off-dialog listener)

Removes a dialog handler, taking the listener on-dialog returned.

Playwright unregisters by object identity, so the handler function itself removes nothing — pass back what (spel/on-dialog ...) answered.

Removes a dialog handler, taking the listener `on-dialog` returned.

Playwright unregisters by object identity, so the handler function itself
removes nothing — pass back what `(spel/on-dialog ...)` answered.
raw docstring

sci-on-closeclj

(sci-on-close handler)

sci-on-consoleclj

(sci-on-console handler)

sci-on-dialogclj

(sci-on-dialog handler)

sci-on-downloadclj

(sci-on-download handler)

sci-on-page-errorclj

(sci-on-page-error handler)

sci-on-popupclj

(sci-on-popup handler)

sci-on-requestclj

(sci-on-request handler)

sci-on-responseclj

(sci-on-response handler)

sci-once-dialogclj

(sci-once-dialog handler)

sci-overviewclj

(sci-overview)
(sci-overview opts)

Takes an annotated full-page screenshot by default. Pass :full-page false for the current viewport. Opts: :path :full-page :show-badges :show-dimensions :show-boxes :scope :all-frames?. Returns {:bytes :annotated} or {:path :size :annotated}.

Takes an annotated full-page screenshot by default. Pass :full-page false for the current viewport.
Opts: :path :full-page :show-badges :show-dimensions :show-boxes :scope :all-frames?.
Returns {:bytes :annotated} or {:path :size :annotated}.
raw docstring

sci-pageclj

(sci-page)

Returns the current Page instance.

Returns the current Page instance.
raw docstring

sci-page-contextclj

(sci-page-context)

sci-pdfclj

(sci-pdf)
(sci-pdf path-or-opts)

sci-pressclj

(sci-press key)
(sci-press sel key)
(sci-press sel key opts)

Presses a key. Single-arg form targets the focused element. Two-arg form targets a selector or snapshot ref.

Presses a key. Single-arg form targets the focused element. Two-arg form
targets a selector or snapshot ref.
raw docstring

sci-pw-createclj

(sci-pw-create)

No-op in daemon mode — Playwright instance is managed by the daemon.

No-op in daemon mode — Playwright instance is managed by the daemon.
raw docstring

sci-reload!clj

(sci-reload!)

Reloads the current page (backend-aware).

Reloads the current page (backend-aware).
raw docstring

sci-report->htmlclj

(sci-report->html entries)
(sci-report->html entries opts)

Builds a rich HTML report from typed entries. No page needed.

Builds a rich HTML report from typed entries. No page needed.
raw docstring

sci-report->pdfclj

(sci-report->pdf entries)
(sci-report->pdf entries opts)

Renders a rich HTML report to PDF via Playwright's page.pdf().

Renders a rich HTML report to PDF via Playwright's page.pdf().
raw docstring

sci-resolve-refclj

(sci-resolve-ref ref-id)

Resolves a snapshot ref (e.g. "@e2yrjz") to a Playwright Locator.

Resolves a snapshot ref (e.g. "@e2yrjz") to a Playwright Locator.
raw docstring

sci-restart!clj

(sci-restart!)
(sci-restart! opts)

Stops the current session and starts a new one with the given options.

Stops the current session and starts a new one with the given options.
raw docstring

sci-route!clj

(sci-route! pattern handler)

sci-route-from-har!clj

(sci-route-from-har! har)
(sci-route-from-har! har opts)

sci-route-web-socket!clj

(sci-route-web-socket! pattern handler)

sci-routesclj

(sci-routes)
(sci-routes opts)

Extracts all links from the page. Returns map with :url :count :links.

Extracts all links from the page. Returns map with :url :count :links.
raw docstring

sci-run-with-webview-contextclj

(sci-run-with-webview-context opts callback)

Runs a deferred body in an inspectable iOS WebView and restores the exact prior context. Options accept :timeout-ms and an exact :context name.

Runs a deferred body in an inspectable iOS WebView and restores the exact
prior context. Options accept :timeout-ms and an exact :context name.
raw docstring

sci-save-annotated-screenshot!clj

(sci-save-annotated-screenshot! refs path)
(sci-save-annotated-screenshot! refs path opts)

sci-save-audit-screenshot!clj

(sci-save-audit-screenshot! caption path)
(sci-save-audit-screenshot! caption path opts)

Takes an audit screenshot and saves it to a file.

Takes an audit screenshot and saves it to a file.
raw docstring

sci-screenshotclj

(sci-screenshot)
(sci-screenshot path-or-opts)

sci-scrollclj

(sci-scroll)
(sci-scroll direction)
(sci-scroll direction opts)

Scrolls the page or a specific element. direction - :up :down :left :right (default :down) opts map keys: :amount - pixels to scroll (default 500) :smooth? - true for smooth animated scroll (default false) :selector - element ref or CSS selector to scroll within

Scrolls the page or a specific element.
direction - :up :down :left :right (default :down)
opts map keys:
  :amount   - pixels to scroll (default 500)
  :smooth?  - true for smooth animated scroll (default false)
  :selector - element ref or CSS selector to scroll within
raw docstring

sci-scroll-into-viewclj

(sci-scroll-into-view sel)

sci-scroll-positionclj

(sci-scroll-position)

Returns the current scroll position of the page as {:x N :y N}.

Returns the current scroll position of the page as {:x N :y N}.
raw docstring

sci-scrollableclj

(sci-scrollable)

Finds all scrollable elements on the current page. Returns a vector of maps with scroll metadata (tag, id, scroll dimensions, overflow).

Finds all scrollable elements on the current page.
Returns a vector of maps with scroll metadata (tag, id, scroll dimensions, overflow).
raw docstring

sci-search!clj

(sci-search! query)
(sci-search! query opts)

sci-search-and-collect!clj

(sci-search-and-collect! query)
(sci-search-and-collect! query opts)

sci-search-go-to-page!clj

(sci-search-go-to-page! query page-num)
(sci-search-go-to-page! query page-num opts)

sci-search-next-page!clj

(sci-search-next-page!)

sci-search-pagesclj

(sci-search-pages query)
(sci-search-pages query opts)

sci-search-urlclj

(sci-search-url query)
(sci-search-url query opts)

sci-selectclj

(sci-select sel values)

sci-session-idle-timeoutclj

(sci-session-idle-timeout)

Returns the current session idle timeout in milliseconds.

The daemon auto-shuts down if no commands are received within this window. 0 means disabled. Default: 1800000 (30 min) — long enough to survive the thinking pauses of an agent workflow, which a 5-minute window did not. Set SPEL_SESSION_IDLE_TIMEOUT env var or call (spel/set-session-idle-timeout! ms).

Returns the current session idle timeout in milliseconds.

The daemon auto-shuts down if no commands are received within this window.
0 means disabled. Default: 1800000 (30 min) — long enough to survive the
thinking pauses of an agent workflow, which a 5-minute window did not.
Set SPEL_SESSION_IDLE_TIMEOUT env var or call (spel/set-session-idle-timeout! ms).
raw docstring

sci-set-assertion-timeout!clj

(sci-set-assertion-timeout! ms)

sci-set-cdp-idle-timeout!clj

(sci-set-cdp-idle-timeout! ms)

Sets the CDP idle timeout in milliseconds.

0 disables auto-shutdown. Takes effect on the next CDP disconnect.

Example: (spel/set-cdp-idle-timeout! 60000) ; 1 minute (spel/set-cdp-idle-timeout! 0) ; disable

Sets the CDP idle timeout in milliseconds.

0 disables auto-shutdown. Takes effect on the next CDP disconnect.

Example:
  (spel/set-cdp-idle-timeout! 60000)   ; 1 minute
  (spel/set-cdp-idle-timeout! 0)       ; disable
raw docstring

sci-set-cdp-lock-wait!clj

(sci-set-cdp-lock-wait! s)

Sets the CDP route lock wait timeout in seconds.

0 disables waiting (fail-fast). Takes effect on the next lock conflict.

Example: (spel/set-cdp-lock-wait! 60) ; wait up to 1 minute (spel/set-cdp-lock-wait! 0) ; fail immediately

Sets the CDP route lock wait timeout in seconds.

0 disables waiting (fail-fast). Takes effect on the next lock conflict.

Example:
  (spel/set-cdp-lock-wait! 60)    ; wait up to 1 minute
  (spel/set-cdp-lock-wait! 0)     ; fail immediately
raw docstring

sci-set-content!clj

(sci-set-content! html)
(sci-set-content! html opts)

sci-set-default-navigation-timeout!clj

(sci-set-default-navigation-timeout! ms)

sci-set-device!clj

(sci-set-device! device)

Switch the current session to a device preset programmatically.

Unlike set-viewport-size!, this reproduces a full device: viewport + device-scale-factor + mobile flag + touch + user agent.

Accepts:

  • A keyword: :iphone-14, :pixel-7, :ipad-mini, etc.
  • A string device name: "iPhone 14", "iphone-14", "iphone_14" (matching is loose — case/separator/punctuation insensitive).

Behavior in daemon mode: delegates to the daemon handler, which saves the current URL, closes the context, creates a fresh one with the preset options, and re-navigates. Console/error/response listeners are re-registered automatically.

Behavior in standalone SCI (no daemon): recreates the context on the existing browser and opens a new page.

Throws when the device name is unknown — the error carries the list of available presets.

Returns: {:device <name> :preset <preset-map>}.

Examples: (spel/set-device! :iphone-14) (spel/set-device! "Pixel 7") (spel/navigate "https://example.org") (spel/screenshot {:path "/tmp/mobile.png"})

Switch the current session to a device preset programmatically.

Unlike `set-viewport-size!`, this reproduces a full device:
viewport + device-scale-factor + mobile flag + touch + user agent.

Accepts:
- A keyword: `:iphone-14`, `:pixel-7`, `:ipad-mini`, etc.
- A string device name: `"iPhone 14"`, `"iphone-14"`, `"iphone_14"`
  (matching is loose — case/separator/punctuation insensitive).

Behavior in daemon mode: delegates to the daemon handler, which saves
the current URL, closes the context, creates a fresh one with the
preset options, and re-navigates. Console/error/response listeners
are re-registered automatically.

Behavior in standalone SCI (no daemon): recreates the context on the
existing browser and opens a new page.

Throws when the device name is unknown — the error carries the list
of available presets.

Returns: `{:device <name> :preset <preset-map>}`.

Examples:
  (spel/set-device! :iphone-14)
  (spel/set-device! "Pixel 7")
  (spel/navigate "https://example.org")
  (spel/screenshot {:path "/tmp/mobile.png"})
raw docstring

sci-set-extra-http-headers!clj

(sci-set-extra-http-headers! headers)

sci-set-input-files!clj

(sci-set-input-files! sel files)

sci-set-page-default-timeout!clj

(sci-set-page-default-timeout! ms)

sci-set-session-idle-timeout!clj

(sci-set-session-idle-timeout! ms)

Sets the session idle timeout in milliseconds.

0 disables auto-shutdown. Takes effect immediately (resets the timer).

Example: (spel/set-session-idle-timeout! 1800000) ; 30 minutes (the default) (spel/set-session-idle-timeout! 0) ; disable

Sets the session idle timeout in milliseconds.

0 disables auto-shutdown. Takes effect immediately (resets the timer).

Example:
  (spel/set-session-idle-timeout! 1800000)  ; 30 minutes (the default)
  (spel/set-session-idle-timeout! 0)        ; disable
raw docstring

sci-set-viewport-size!clj

(sci-set-viewport-size! width height)

sci-sleepclj

(sci-sleep ms)

sci-smooth-scrollclj

(sci-smooth-scroll y-or-opts)

Smooth-scrolls the page to the given Y position (or by a delta). Uses CSS smooth scroll behavior for natural-looking video recordings.

Usage: (spel/smooth-scroll 500) ;; scroll to Y=500 (spel/smooth-scroll {:top 500}) ;; same (spel/smooth-scroll {:delta-y 300}) ;; scroll down by 300px

Smooth-scrolls the page to the given Y position (or by a delta).
Uses CSS smooth scroll behavior for natural-looking video recordings.

Usage:
  (spel/smooth-scroll 500)        ;; scroll to Y=500
  (spel/smooth-scroll {:top 500})  ;; same
  (spel/smooth-scroll {:delta-y 300}) ;; scroll down by 300px
raw docstring

sci-smooth-scroll-byclj

(sci-smooth-scroll-by delta-y)

Smoothly scrolls the page by a relative delta (positive=down, negative=up). Waits for the scroll animation to complete.

Smoothly scrolls the page by a relative delta (positive=down, negative=up).
Waits for the scroll animation to complete.
raw docstring

sci-smooth-scroll-toclj

(sci-smooth-scroll-to y)

Smoothly scrolls the page to an absolute Y position. Waits for the scroll animation to complete.

Smoothly scrolls the page to an absolute Y position.
Waits for the scroll animation to complete.
raw docstring

sci-snapshotclj

(sci-snapshot)
(sci-snapshot page-or-opts)
(sci-snapshot page opts)

sci-sourceclj

(sci-source query)

Shows the source code of a SCI eval function. Accepts 'ns/fn' format (e.g. 'spel/click') or bare function name to search.

Shows the source code of a SCI eval function.
Accepts 'ns/fn' format (e.g. 'spel/click') or bare function name to search.
raw docstring

sci-start!clj

(sci-start!)
(sci-start! opts)

sci-start-video-recordingclj

(sci-start-video-recording)
(sci-start-video-recording opts)

Starts video recording by creating a new context with video recording enabled. Closes the current context/page and creates new ones with video.

Opts: :video-dir - String. Directory for video files (default: "videos"). :video-size - Map with :width :height (default: 1280x720).

Starts video recording by creating a new context with video recording enabled.
Closes the current context/page and creates new ones with video.

Opts:
:video-dir  - String. Directory for video files (default: "videos").
:video-size - Map with :width :height (default: 1280x720).
raw docstring

sci-stop!clj

(sci-stop!)

Stops the active session (Playwright or iOS backend), closing the browser and cleaning up resources.

Stops the active session (Playwright or iOS backend), closing the
browser and cleaning up resources.
raw docstring

sci-surveyclj

(sci-survey)
(sci-survey opts)

Scrolls through the page taking a screenshot at each viewport position. Returns vector of {:path :y :index :viewport} maps.

Scrolls through the page taking a screenshot at each viewport position.
Returns vector of {:path :y :index :viewport} maps.
raw docstring

sci-swipeclj

(sci-swipe direction-or-opts)
(sci-swipe direction-or-opts distance)

Performs a native touch swipe (iOS backend only).

Forms: (spel/swipe :up) ;; default distance 300 (spel/swipe :up 500) (spel/swipe {:from [200 600] :to [200 100] :duration 800})

Performs a native touch swipe (iOS backend only).

Forms:
  (spel/swipe :up)            ;; default distance 300
  (spel/swipe :up 500)
  (spel/swipe {:from [200 600] :to [200 100] :duration 800})
raw docstring

sci-switch-tab!clj

(sci-switch-tab! idx)

Switches to the tab at the given index.

Switches to the tab at the given index.
raw docstring

sci-tabsclj

(sci-tabs)

Returns a list of all open tabs with their index, url, title, and active status.

Returns a list of all open tabs with their index, url, title, and active status.
raw docstring

sci-tapclj

(sci-tap sel)

Taps an element. On the iOS backend this is a native touch pointer action; on Playwright it delegates to locator tap emulation. Also accepts [x y] coordinates on the iOS backend.

Taps an element. On the iOS backend this is a native touch pointer
action; on Playwright it delegates to locator tap emulation.
Also accepts [x y] coordinates on the iOS backend.
raw docstring

sci-textclj

(sci-text sel)

sci-thread-sleepclj

(sci-thread-sleep ms)

Plain JVM thread sleep (ms). Does NOT interact with browser event loop. Prefer page waits (wait-for-selector, wait-for-url, etc.) for browser sync. Use only for non-browser delays (file I/O timing, external process waits).

Plain JVM thread sleep (ms). Does NOT interact with browser event loop.
Prefer page waits (wait-for-selector, wait-for-url, etc.) for browser sync.
Use only for non-browser delays (file I/O timing, external process waits).
raw docstring

sci-titleclj

(sci-title)

Returns the current page title (backend-aware).

Returns the current page title (backend-aware).
raw docstring

sci-touchscreenclj

(sci-touchscreen)

sci-trace-groupclj

(sci-trace-group name)

Opens a named group in the trace. Groups nest actions visually in Trace Viewer.

Opens a named group in the trace. Groups nest actions visually in Trace Viewer.
raw docstring

sci-trace-group-endclj

(sci-trace-group-end)

Closes the current trace group.

Closes the current trace group.
raw docstring

sci-trace-start!clj

(sci-trace-start!)
(sci-trace-start! opts)

Starts Playwright tracing on the current context.

Opts: :name - String. Trace name (appears in Trace Viewer). :screenshots - Boolean. Capture screenshots (default: false). :snapshots - Boolean. Capture DOM snapshots (default: false). :sources - Boolean. Include source files (default: false).

Starts Playwright tracing on the current context.

Opts:
:name        - String. Trace name (appears in Trace Viewer).
:screenshots - Boolean. Capture screenshots (default: false).
:snapshots   - Boolean. Capture DOM snapshots (default: false).
:sources     - Boolean. Include source files (default: false).
raw docstring

sci-trace-stop!clj

(sci-trace-stop!)
(sci-trace-stop! opts)

Stops Playwright tracing and saves to a file.

Opts: :path - String. Output path (default: "trace.zip").

Stops Playwright tracing and saves to a file.

Opts:
:path - String. Output path (default: "trace.zip").
raw docstring

sci-type-textclj

(sci-type-text sel text)
(sci-type-text sel text opts)

sci-unannotateclj

(sci-unannotate)

Removes all annotation overlays from the current page.

Removes all annotation overlays from the current page.
raw docstring

sci-uncheckclj

(sci-uncheck sel)
(sci-uncheck sel opts)

sci-unmarkclj

(sci-unmark)

Removes all pre-action markers from the current page.

Removes all pre-action markers from the current page.
raw docstring

sci-unroute!clj

(sci-unroute! pattern)

sci-urlclj

(sci-url)

Returns the current URL (backend-aware).

Returns the current URL (backend-aware).
raw docstring

sci-url-decodeclj

(sci-url-decode s)

Decodes URL-encoded text using UTF-8.

Delegates to core/url-decode.

Decodes URL-encoded text using UTF-8.

Delegates to core/url-decode.
raw docstring

sci-url-encodeclj

(sci-url-encode s)

Encodes text for use in URL query strings using UTF-8.

Delegates to core/url-encode.

Encodes text for use in URL query strings using UTF-8.

Delegates to core/url-encode.
raw docstring

sci-valueclj

(sci-value sel)

sci-video-pathclj

(sci-video-path)

Returns the video file path for the current page, or nil if not recording.

Returns the video file path for the current page, or nil if not recording.
raw docstring

sci-viewport-sizeclj

(sci-viewport-size)

Returns the current viewport size of the active page as {:width N :height N}.

Returns the current viewport size of the active page as {:width N :height N}.
raw docstring

sci-visible?clj

(sci-visible? sel)

sci-wait-forclj

(sci-wait-for sel)
(sci-wait-for sel opts)

sci-wait-for-downloadclj

(sci-wait-for-download action)
(sci-wait-for-download action opts)

sci-wait-for-file-chooserclj

(sci-wait-for-file-chooser action)
(sci-wait-for-file-chooser action opts)

sci-wait-for-functionclj

(sci-wait-for-function expr)
(sci-wait-for-function expr opts)

sci-wait-for-loadclj

(sci-wait-for-load)
(sci-wait-for-load state)

sci-wait-for-popupclj

(sci-wait-for-popup action)
(sci-wait-for-popup action opts)

sci-wait-for-urlclj

(sci-wait-for-url url)
(sci-wait-for-url url opts)

sci-with-webview-context-macroclj

(sci-with-webview-context-macro _form _env first-form & remaining-forms)

Defers body until an inspectable iOS WebView is active and restores the exact prior context. Restoration occurs after success or failure.

Defers body until an inspectable iOS WebView is active and restores the exact prior context.
Restoration occurs after success or failure.
raw docstring

sci-wsl-default-gateway-ipclj

(sci-wsl-default-gateway-ip)

Returns the Windows host IP from /proc/net/route when inside WSL, nil otherwise. Under classic NAT networking this is the IP spel uses to reach a Windows-side Chrome via CDP.

Returns the Windows host IP from /proc/net/route when inside WSL,
nil otherwise. Under classic NAT networking this is the IP spel
uses to reach a Windows-side Chrome via CDP.
raw docstring

sci-wsl?clj

(sci-wsl?)

Returns true when running inside Windows Subsystem for Linux. Detects via /proc/version markers and WSL_DISTRO_NAME env var.

Returns true when running inside Windows Subsystem for Linux.
Detects via /proc/version markers and WSL_DISTRO_NAME env var.
raw docstring

set-default-timeout!clj

(set-default-timeout! ms)

Sets the default Playwright action timeout (ms) for new pages. Called from eval-sci mode when --timeout flag is provided.

Sets the default Playwright action timeout (ms) for new pages.
Called from eval-sci mode when --timeout flag is provided.
raw docstring

set-throw-on-error!clj

(set-throw-on-error! v)

When true, Playwright operations throw on error instead of returning anomaly maps. Called from eval-sci mode so errors short-circuit (do ...) forms.

When true, Playwright operations throw on error instead of returning anomaly maps.
Called from eval-sci mode so errors short-circuit (do ...) forms.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close