Skip to main content

preview

Lets an agent see and drive the app running in the user's Preview pane. Use it after a build, when the user says something is broken, or to walk a UI flow end to end.

Which "preview" is which?​

"Preview" names five unrelated things in Digitorn. They each have their own "type/kind" values, and the same words (html, web, snapshot) mean different things in each — this table is the one place that pins them down. Pick by what you are doing, never by the word alone:

You want to…UseIts type/kind values
Show a template's gallery thumbnailpreview_path in templates.yaml — Templatesnone — chosen by file extension: raster image (<img>) or .html (<iframe>)
Have an app's build auto-appear in the native Preview tab (no SDK)enable ui.workspace preview + build dist/index.html — Auto-served Preview panedaemon auto-detects the build (static; also dev-server, local only)
Render the workspace panel for an appui.workspace.render_mode — Client manifestreact | html | markdown | slides | code | latex | builder | auto
Show the agent's live build inside a custom viewusePreviewAttach() — SDKstatic | devserver | web
See / drive the running Preview pane (this module)preview.inspect / preview.snapshot—
Screenshot a built preview URL to a thumbnailpreviewshot (internal)kind: html | pdf | embed, format: jpeg | png

If a task ever makes you reach for a "preview type," find your row here first: a template thumbnail is an image or .html file (no field), the workspace panel is a render_mode, the SDK live build is a usePreviewAttach kind — they are never interchangeable.

PropertyValue
Module idpreview
Version2.0.0
Toolsinspect, snapshot (LLM-visible)

Built preview assets are served by the daemon over HTTP under the session preview surface in the Digitorn UI. This module talks to the live iframe directly (agent shim + runtime endpoint).

Tools​

preview.inspect​

Look at the running preview and optionally run UI actions first.

Useful returns: whether the page rendered or came up blank, the route on screen, runtime failures (crashes, rejected promises, console errors with file/line), failed network calls, console logs, viewport size, visible text, and actionable elements with refs.

ParamNotes
actionsOptional ordered interactions (navigate, click, type, press, hover, check, select, scroll, viewport, wait_for, detail, wait). Prefer match (visible label) over stale refs inside a sequence.
fullReturn everything (default false).
textInclude visible text (default true).

Requires an open Preview pane for the session. If the pane is still loading after a build, inspect waits briefly for it to come live.

preview.snapshot​

Pixel / layout capture for visual checks (positions, overlaps, polish). Use together with inspect when console/DOM alone is not enough.

  • Gallery thumbs: previewshot
  • External / headless browser (not the app preview pane): browser