New Host-connected plugins default to view runtime v2, including the single-page scaffold. Read SDK VIEW_AUTHORING_POLICY through context.viewRuntime.authoring; Vibe, CLI and both MCP servers use the same policy. Use local page actions, small page caches, ready bounded view data and stable-key collections. See architecture defaults and the bundled view-list reference for calendar windows, page eviction, frame restoration and validation. Existing legacy packages and native offline page decks remain supported.
VIEW_AUTHORING_POLICY
context.viewRuntime.authoring
view-list
The SDK's PLUGIN_OPTIMIZATION_POLICY is the shared source for developer tools. It is exposed through standalone API/MCP plugin_read.context.optimizationPolicy, Studio MCP plugin_context, and Vibe. CLI check/package and both MCP check paths return:
PLUGIN_OPTIMIZATION_POLICY
plugin_read.context.optimizationPolicy
plugin_context
{"verification":{"mode":"fixture","liveVerified":false,"optimizationReview":"required","policyVersion":3,"requiredLiveChecks":["Live checks for the declared capabilities"]}}
ok: true means package, defaults, sandbox startup and sample controls passed. It does not statically prove every asynchronous path, complete optimization review or test real disks under load. Report the checks actually performed and the remaining work.
ok: true
activate
setInterval
ctx.signal
Aim for 50 ms from a local navigation click to a changed frame. This is a performance target, not a guarantee for network operations or all hardware. Update local state and await ctx.publish(state) inside the input handler, then persist preferences and fetch data in bounded cancellable background work. An event receipt alone does not publish.
ctx.publish(state)
Updated hosts grant one input-feedback publication per current event within RUNTIME_LIMITS.inputFeedbackMs (250 ms), separately capped at RUNTIME_LIMITS.interactivePublishPerSecond (20/second). Credit expires when the handler returns, is cancelled or reaches the deadline. Holding a handler open cannot replenish credit. Background publications remain capped at four/second. Keep one serialized publisher, let input bypass its background timer and coalesce pending background state. Do not await storage or network requests before showing navigation/loading feedback. Older hosts retain the four/second combined ceiling: update the host for this path, and coalesce/retry only the newest state on overload.
RUNTIME_LIMITS.inputFeedbackMs
RUNTIME_LIMITS.interactivePublishPerSecond
Studio receives native pixels and input immediately instead of adding a 33 ms renderer poll. The simulator forwards commands immediately and refreshes host projection state at its 60 Hz frame cadence instead of the old 150 ms idle interval. Input validation and native hit testing remain enforced. Measure through changed pixels, not just event acceptance; report Preview, simulator and physical Dock results separately.
For Dev Cockpit, run apps/desktop/scripts/test-plugin-navigation-latency.mjs from apps/desktop, with PEXARBOLT_NAVIGATION_SOURCE set to its checked source directory. The isolated Studio harness alternates Home/Linear twenty times and measures release to changed native pixels painted in Preview; it never connects to a real Dock. PEXARBOLT_NAVIGATION_MAX_MS optionally enforces the p95 budget. This measures canvas painting, not the operating system's display scanout or physical-device latency.
apps/desktop/scripts/test-plugin-navigation-latency.mjs
apps/desktop
PEXARBOLT_NAVIGATION_SOURCE
PEXARBOLT_NAVIGATION_MAX_MS
Enabled plugins do not run in the background. The Desktop host starts a plugin's runtime when the Dock or the Desktop simulator opens it and stops it after RUNTIME_LIFECYCLE.idleStopMs (60 seconds) hidden; reopening within that window reuses it. Native-execution projections never start one. Each hidden sandbox previously cost roughly 45–70 MB of host memory, so this keeps the App's footprint proportional to what the user is looking at.
RUNTIME_LIFECYCLE.idleStopMs
ctx.store
store
ctx.view.visible
ctx.view.subscribe(listener)
ctx.frames.present/submit
accepted: false
present
ctx.view?.visible ?? true
ctx.view?.subscribe(...)
This section is the single reference for reconnect behavior; the contract's Runtime Lifecycle section summarizes the plugin rules.
A Dock disconnect retires the device view and hides the plugin; its host runtime keeps running for the 60-second idle window and then stops. Updated App and firmware automatically restore the currently selected host plugin after reconnecting or losing the five-second lease, resending its latest state and cached frame without Idle → Enable; if the idle window has passed, the selected plugin's runtime starts again on demand. Catalog/view reconciliation runs every five seconds with 1–30 second failure backoff; capability negotiation has a separate backoff. Back, disabled plugins and revoked grants take precedence, and control/HID actions are never replayed. Full recovery, including lost open requests and device-only disconnection, needs the updated App and firmware; older devices still resynchronize the catalog after lease failure.
Do not implement Idle/Enable or repeated open_on_device loops as recovery. Plugin network sources still need cancellable, bounded retries to their own services. Verify live and paused frames plus controls on real hardware; fixture checks cannot prove reconnect recovery.
open_on_device
Camera and snapshot plugins read frames through ctx.http.readBytes from an authorized HTTPS origin or localhost gateway and present them with ctx.frames (see plugin media).
ctx.http.readBytes
ctx.frames
Refresh camera metadata independently from frame polling, with at most one outstanding request, without blocking frames. On brief frame failures, retain the same camera's last good frame for a bounded grace period, show Buffering with the original timestamp and retry with capped backoff. Clear old frames on confirmed offline/access denial, camera changes or grace-period expiry. Metadata or discovery failure must not clear known cameras or tear down healthy video sessions. A gateway's idle timeout must exceed the client request timeout plus retry interval. Clear latched player errors when playback returns to playing. Test brief and sustained outages, slow discovery and camera switching against a real source.
The API itself is described in the filesystem guide. Use one ctx.fs.watchExternal() subscription per plugin for all external volumes. Do not create per-volume/directory/file watchers, rescan on every notification or poll snapshots instead of subscribing. The host owns native watchers: one recursive watcher per volume on macOS/Windows avoids blocking the App while hundreds of FSEvents handles close.
ctx.fs.watchExternal()
Callbacks execute serially and must finish within ten seconds. Update bounded state and schedule background work. Recover snapshots only on reset/revision gaps, paging at least 20 ms apart. Check mountId, epoch and revision after awaits. Transfer-only views do not need index snapshots. Name/extension filters select returned files without reducing traversal budgets. Show unavailable, not an empty disk, when indexing exceeds quota. Metadata status and transfer-status are independent: an index quota failure does not establish transfer failure.
Non-running speed and ETA are null. Percentage may retain the last observation but never proves terminal state. Optional reason fields extend state; handle state even when an older host omits reason. Late running/completed events cannot overwrite host terminal states. Bursts and short tasks may be coalesced, so intermediate states are not guaranteed. Missing snapshot tasks may simply have expired or been evicted. On transfer-reset, replace the current view with transferSnapshot; mark missing active tasks unknown without inventing completion events.
These APIs only observe other applications' transfers. They cannot pause, cancel or resume Finder tasks. watcher.close/signal abort stop observation; watcher.eject is an explicitly requested safe removal of the entire disk, not transfer cancellation.
For unavailable/runtime_fault, read plugin_runtime status/logs first. heartbeat_timeout, startup_timeout, activation_failed, event_timeout and renderer_* identify different paths. Do not classify every error as a disk permission problem or mask host failures with polling, raised quotas or disabled watchdogs.
plugin_runtime status/logs
Package verification or a Studio local bridge can also fail before sandbox startup. These failures mark the installation as faulted and record their cause in the runtime logs. After resolving the cause, enable/run the plugin again; existing configuration and permission grants are retained.
Run live for at least 60 seconds and exercise bursts, response latency, stop/restart, revocation, preview close and host sleep recovery. For external storage, also test empty disks, large/deep directories, quota failures, hot unplug/remount, scan failure, pause/resume, cancellation, publisher exit and backend failure. Completion/cancellation does not prove content verification or durable persistence. Windows and applications that do not publish NSProgress must show unsupported/unknown.
Host regressions cover watcher limits, heartbeat recovery after main-thread stalls, terminal retention and mount isolation. node apps/desktop/scripts/test-plugin-file-progress.mjs verifies cross-process completion, cancellation, pause/resume and publisher exit in an isolated directory. Record actual Finder, external-disk, Windows hardware and sleep-recovery results separately.
node apps/desktop/scripts/test-plugin-file-progress.mjs
Large views should declare ui: {version: 1, cachePages: 1} and pages. A button can use action: {type: "navigate", page: "issues"} without an emit. This applies immediately on the renderer. Optional emitted events are read-only observations without permissions; Host handlers retain business writes and their confirmed outcomes. Firmware must advertise ui.actions.v1 and pages.lifecycle.v1. Unsupported firmware reports an upgrade requirement instead of silently changing behavior.
ui: {version: 1, cachePages: 1}
pages
action: {type: "navigate", page: "issues"}
emit
ui.actions.v1
pages.lifecycle.v1
ui.page and the read-only ui.isPage.<id> visibility flags belong to the renderer. ui.initial declares up to 32 scalar fields (4 KiB total). Use action: {type: "set", key: "filter"} to take a validated control value, an explicit value to set a scalar, or action: {type: "toggle", key: "expanded"}. Bind to ui.filter or ui.expanded. Host publications cannot overwrite this state. A fresh view starts from its defaults; layout hot updates preserve valid UI fields, the page and scroll positions. Local UI cannot grant permissions or fabricate business success.
ui.page
ui.isPage.<id>
ui.initial
action: {type: "set", key: "filter"}
value
action: {type: "toggle", key: "expanded"}
ui.filter
ui.expanded
Only the active page and up to cachePages resident page trees are mounted (1–3 pages). Eviction saves scroll and UI state. Keep shared chrome small. Page-local node IDs remain globally unique. A page transition may temporarily mount both pages. Cold mounting and warm navigation are separate performance measurements.
cachePages
Repeated read-only row content uses a collection:
collection
{"id":"issues","type":"collection","page":"issues","x":24,"y":104,"w":806,"h":320, "bind":"issues","itemKey":"id","rowHeight":64,"overscan":1,"emit":"issue.open", "children":[{"id":"issue-title","type":"text","x":16,"y":12,"w":770,"h":40,"bind":"item.title"}]}
Items are objects with unique stable string keys, at most 2,048 per bounded view. Row height is fixed at 40–408 pixels; overscan is 0–2. Templates contain containers, text, rectangles, icons, packaged images, progress or determinate arcs. They cannot contain nested interactive controls, fullscreen media or image animation. Loading arcs are allowed; every resident row instance counts against the 16-animation budget. The collection emits {id,value,context} with the stable item key in value. Resolve that key against current business data; never use a recycled row position. A changed/recycled row invalidates an in-progress press. The row pool counts against the mounted node budget. Large remote datasets must be reduced to a bounded view/window by Host code; the collection does not fetch data or make an unbounded model fit the state quota.
{id,value,context}
ctx.publish(state) remains the authoring API. Updated hosts negotiate state.delta.v1 through stateDelta, send acknowledged snapshots or atomic set/delete patches, coalesce against the last confirmed revision and resynchronize after a baseline mismatch or timeout. Firmware carries deltas over its private renderer IPC as well. Arrays are replaced as a unit; bound their size. Legacy peers retain full snapshot delivery. State patches do not reset local UI. Renderer bindings update only dependencies affected by changed fields.
state.delta.v1
stateDelta
plugin_check / CLI check return verification.renderer: authored nodes, estimated resident nodes per page, collection pool bounds, binding count and migration warnings. This is a static authored-node estimate, not the number of LVGL objects or a measured frame time. CLI read, standalone MCP plugin_read, desktop MCP plugin_context and Studio context expose viewRuntime. Test source/fixture behavior, page eviction, scrolling, hot updates and physical Dock performance independently. A browser screenshot does not certify the Dock's ≤50 ms p95 navigation target.
plugin_check
check
verification.renderer
read
plugin_read
viewRuntime
Lists now support scrollTo, ensureVisible, relative scrollBy and followEnd, executed on the renderer. Widget.scrollTo accepts a literal initial request or a binding to an explicit increasing {revision,...operation} intent. ui.knob declares local rotary actions. Stable keys and viewport state stay separate from business selection; stale publications do not reset scrolling. Static collection.value, local ui.* state and declared device-source bindings can run independently with widgets.native.v1; Host bindings/events/permissions/streams still require Host. Requires the new list/knob firmware capabilities. See list control and the bundled native-list reference.
scrollTo
ensureVisible
scrollBy
followEnd
Widget.scrollTo
{revision,...operation}
ui.knob
collection.value
ui.*
widgets.native.v1
native-list