New Host-connected plugins use view runtime v2 by default, including the single-page starter: ui: {version: 1, cachePages: 1}, declared pages, initialPage and root page tags. Read SDK VIEW_AUTHORING_POLICY, exposed as context.viewRuntime.authoring in standalone API/MCP, Studio MCP and Vibe. VIEW_RUNTIME_GUIDANCE and optimization policy version 5 derive from that single source. CLI --help, scaffolding and both MCP discovery surfaces follow it. Existing packages remain accepted; native offline/device-source examples may retain native execution when local UI actions are unnecessary.
ui: {version: 1, cachePages: 1}
pages
initialPage
page
VIEW_AUTHORING_POLICY
context.viewRuntime.authoring
VIEW_RUNTIME_GUIDANCE
--help
For a multi-page implementation, copy the bundled view-list reference: separate business model, bounded view model and projection; prepare all locally reachable page data before a tap; use local navigate/set/toggle actions. Optional navigation events observe an already completed transition. Host must not echo them as new redirects or publish ui.*. New {revision,page} intents are reserved for deliberate business/dial navigation.
view-list
ui.*
{revision,page}
Use stable-key collections for repeated rows and resolve selected keys against current business data. Reject removed keys; do not identify recycled rows by position. Keep both the mounted pool and published data bounded. For calendars/timelines, use one time window for all columns, retain overlapping/all-day events and build only visible cells/time markers. Do not preallocate every full-day cell or a marker for each possible current-time position. Collection templates remain read-only; use a collection per independently selectable column or a bounded native grid.
Page eviction releases its view resources. Test scroll/selection restoration and replay page-owned frame pixels on remount/resume even when the underlying quote/image has not changed. A Host-side frame signature is not proof that a recreated viewport has pixels.
Check verification.renderer: new diagnostics identify large shared trees, pages over 256 estimated nodes, legacy multi-page views and resident estimates over 512. These are authoring recommendations, not new package rejection limits or measured LVGL memory. Resolve or explain warnings before delivery. Test navigation without a Host reply, stale data, row reorder/removal and page eviction/revisit. Physical cold/warm Dock latency remains a separate measurement.
verification.renderer
Projection JSON (device.projection.json) is limited to 512 KiB (524288 UTF-8 bytes, LIMITS.projection), with up to 2048 combined render nodes and the existing depth limits. Manifest and host state remain separately bounded to 64 KiB. Updated Dock firmware accepts 64 KiB of host state; older devices advertise maxState: 32768 and must be updated and reconnected for larger state. Preview/check success does not bypass that negotiated device ceiling. This applies to SDK validation, CLI/MCP checks, package import, Preview and the simulator. Update the Desktop/Studio and Dock firmware together for larger layouts, then reconnect to renegotiate limits. Wire JSON frames allow up to 2 MiB to cover escaping and presentation metadata; hosts still respect the smaller negotiated ceiling of older firmware. The 2048-node and parsing-depth limits are unchanged.
device.projection.json
LIMITS.projection
maxState: 32768
Resource errors retain their machine-readable code (for example quota_exceeded) and carry a readable explanation of the resource, measured usage, limit and recovery action through Studio/Desktop, runtime and CLI/MCP bridges. Read and show that explanation; do not display only the code or silently enlarge unrelated quotas. Diagnostics never include JSON payload contents or secrets.
quota_exceeded
SDK 1.0.0, device contract 1.0.0, projection format 1. The helper generates a complete minimal counter plugin from the same starter used in Vibe. The SDK source and validators supplied with your tools are authoritative if their versions differ from this reference.
1.0.0
1
Design in 854×480 device pixels. The system owns the top 72 pixels; plugin content is 854×408 at (0,72). Root projection nodes use device coordinates; children of containers use parent-local coordinates. The 427×240 screenshot is a 50% preview, not the authoring resolution. Do not halve coordinates/fonts or use Retina backing dimensions. ctx.frames.createCanvas() uses a separate 854×408 content-local canvas, starting at (0,0); place its stream image below the header.
(0,72)
ctx.frames.createCanvas()
(0,0)
Read SDK PLUGIN_DISPLAY_TARGET / PLUGIN_DISPLAY_GUIDANCE and DOCK_CONTROL_STYLE / DOCK_CONTROL_GUIDANCE. Studio MCP returns displayTarget and controlStyle from plugin_context (overview/sdk/all); standalone MCP and the JavaScript API return them in plugin_read.context / session.read().context. Vibe and copied Integration prompts use the same guidance. bolt-plugin --help includes it too.
PLUGIN_DISPLAY_TARGET
PLUGIN_DISPLAY_GUIDANCE
DOCK_CONTROL_STYLE
DOCK_CONTROL_GUIDANCE
displayTarget
controlStyle
plugin_context
plugin_read.context
session.read().context
bolt-plugin --help
Prefer native JSON widgets with unset styles: 26px labels, medium button captions, 64px recommended button height, 81×44 switches, 40px slider thumbs and 8px gaps. Explicit author styles take precedence. Legacy top-level radius remains 0–8; custom native controls use style.radius (0–2048), with widgets.style.v1 firmware. See Native Control Styles below. Keep text/controls in bounds and recommend 24px below the bottommost control/feedback (y+h<=456 for roots); backgrounds/media may reach the edge. These layout recommendations do not add firmware capabilities. Inspect initial, active, disabled and long-value fixture screenshots; report live device behavior separately.
radius
style.radius
widgets.style.v1
y+h<=456
Host runtimes run on demand. Enabling a plugin makes it available on the Dock (summary runtime: 'standby'); it does not start JavaScript. The Desktop host starts the runtime when the Dock opens the plugin (or when the Desktop simulator attaches to it) and completes the Dock activation once activate returns. When the plugin is hidden, meaning the Dock shows another plugin, the user pressed Back or the Dock disconnected, the runtime keeps running for RUNTIME_LIFECYCLE.idleStopMs (60 seconds) and is then stopped; reopening within that window reuses it. Native-execution projections (deviceExecution(...) === 'native') never start a host runtime. Page previews, Vibe and Agent-service previews and the standalone toolkit are separate fixture runtimes and are always visible.
runtime: 'standby'
activate
RUNTIME_LIFECYCLE.idleStopMs
deviceExecution(...) === 'native'
Do not rely on in-memory state surviving between openings. Persist what users expect to resume (timer deadlines as wall-clock times, current positions, scores, selections) with ctx.store (store permission) and restore it in activate before the first publish. Recompute elapsed time from the wall clock rather than counting ticks. Opaque photo/video IDs are not persisted; refresh them after a restart.
ctx.store
store
ctx.view.visible is true while the Dock or the simulator shows the plugin. ctx.view.subscribe(listener) calls the listener with each change (not the current value), returns an unsubscribe function and is cleared when ctx.signal aborts. While hidden, pause timers, polling, slideshows and render loops, stop pulling network frames and skip publications that nobody sees; when visible again refresh once and clamp elapsed simulation time so a game does not jump. After activate returns, frames.present/frames.submit wait while hidden: the newest submission is held until the plugin is shown again, older waiting submissions resolve {accepted:false}, so a loop that awaits present pauses naturally. Frames presented during activate are never held, so awaiting a first frame cannot stall startup. Previews report always visible. Older hosts lack ctx.view (and never stop hidden runtimes); use ctx.view?.visible ?? true and ctx.view?.subscribe(...) in portable plugins.
ctx.view.visible
ctx.view.subscribe(listener)
ctx.signal
frames.present
frames.submit
{accepted:false}
present
ctx.view
ctx.view?.visible ?? true
ctx.view?.subscribe(...)
Closing the Desktop main window hides it to the system tray and preserves host runtimes, previews and the App MCP service. Click the tray icon to restore the window; Quit PexarBolt stops services. Window visibility does not change the host/native execution requirements or ctx.view.
A Dock disconnect retires the device view; the host runtime stays Running only for the idle window, and the next open restarts it if it has stopped. Updated App/firmware automatically restore the currently selected host plugin, latest state and cached frame after reconnecting or losing the five-second lease. Recovery uses bounded backoff and respects Back, disabled plugins and revoked grants; it never replays control/HID actions. Do not implement Idle/Enable or repeated open_on_device loops as recovery. Plugin network sources still need cancellable, bounded retries. Verify live and paused frames plus controls on real hardware; fixture checks cannot prove reconnect recovery. The "Dock reconnection" section of the plugin reliability guide (plugin-optimization.md) records the host recovery schedule.
plugin-optimization.md
Follow exported PLUGIN_OPTIMIZATION_POLICY / context.optimizationPolicy: prompt activation (5s startup deadline), one serialized publisher coalescing latest background state at least 300ms apart including startup, with immediate input feedback before slow work and before the handler returns, bounded queues/concurrency/caches, and complete abort cleanup. Prefer subscriptions; never overlap async polling loops. Per-plugin limits are 4 background publishes/s plus one immediate feedback publish per current input within 250ms (separately capped at 20/s), 10 logs/s, 20 HID calls/s, 4 concurrent HTTP and 16 outstanding/100-per-second SDK data requests. They are ceilings, not target rates. Use one external-volume collection subscription; native watcher allocation belongs to the host (one recursive watcher per volume on macOS/Windows). Avoid full rescan per event and snapshot polling. Names/extensions do not shrink traversal quotas. Transfer-only UIs need no metadata snapshot. Keep serialized callbacks under 10s, pace snapshot pages by 20ms and validate mountId/epoch/revision after awaits.
PLUGIN_OPTIMIZATION_POLICY
CLI/MCP/Vibe checks return verification:{mode:'fixture',liveVerified:false,optimizationReview:'required',policyVersion:3,requiredLiveChecks:[...]}. This is an explicit pending review, not an automated performance audit. Test actual bursts, large/deep/over-quota volumes, disconnect/remount, stop/revoke, sleep/resume and interrupted transfers before claiming live verification. For unavailable/runtime_fault inspect status/logs: heartbeat_timeout, startup_timeout, activation_failed, event_timeout and renderer_* are separate causes. Fix/update a stalled host instead of increasing plugin polling/quotas or disabling watchdogs.
verification:{mode:'fixture',liveVerified:false,optimizationReview:'required',policyVersion:3,requiredLiveChecks:[...]}
Transfer lifecycle: running may pause/resume or end as completed/cancelled/unknown. Cancellation takes precedence over finished in the same publisher observation, even at 100%. Unpublication/publisher loss without an explicit terminal outcome is unknown; no timeout or silence heuristic proves cancellation or completion. Terminal observations do not resume; a new observation has a new id. Optional reason is publisher_cancelled, observation_ended (including directory subscription removal), volume_unmounted or backend_unavailable. Non-running bytesPerSecond/estimatedSecondsRemaining are null. Maintain compatibility when reason is absent.
reason
Unmount emits unknown for remaining active observations before the volume event and preserves queued explicit terminal outcomes. Backend loss keeps previously confirmed results and marks active observations unknown. closed/abort stops monitoring; consumers must mark any still-active local tasks unknown and suppress late work. Neither close nor these read-only APIs can cancel/pause/resume Finder transfers. Ejection is a distinct, deliberate whole-device action. Retain bounded terminal notices keyed by volumeId+mountId+id; remount invalidates old work, while snapshot expiry/eviction and coalesced events never imply completion. On transfer-reset replace current tasks with transferSnapshot and mark missing active observations unknown. Provide paused, cancelled and interrupted fixture scenarios.
Capacity and overload: running plugins, previews and simulators have no fixed concurrent-instance limit (LIMITS.instances and capacity.limit are null; counts describe activity). Sandbox isolation, per-plugin traffic limits, operation queues and watchdogs still apply. A simulator attached to an enabled plugin starts its runtime on demand and keeps it visible; closing the simulator hides it, and it stops after the idle window unless the Dock is showing it. An older App/toolkit may still report a four-instance limit; update and restart that host instead of changing the plugin. overloaded keeps its code and carries a reason and recovery guidance: for busy controls wait for pending work (at most 16 queued controls per instance); for recurring SDK traffic reduce publication, polling or concurrency. Preserve source on resource errors, stop automatic code repair and retry the check after resolving the actual resource or queue problem. Never automatically replay a mutation whose outcome is unknown.
LIMITS.instances
capacity.limit
null
overloaded
plugin.json host.mjs config.schema.json state.schema.json events.schema.json fixtures/default.json device.projection.json assets/*.png optional, declared in assetHashes
The manifest includes id, name, version (x.y.z), contract, host: {entry,sdk,permissions}, the three schema paths, layout: {}, and knob: {label,ccw?,cw?,press?}. Each dial action is {label,emit} and must name a declared event. Dial first: a function the dial performs needs no on-screen button. Show the value or state it changes, and keep touch controls for actions the dial does not cover. By default, do not describe dial functions on screen (no "turn to adjust" or "press to start" hints); the manifest knob labels name them for the system. The id starts with a lowercase letter and contains lowercase letters, numbers, dots or hyphens (maximum 80 characters). Keep ids stable across versions and distinct from bundled plugins.
id
name
version
contract
host: {entry,sdk,permissions}
layout: {}
knob: {label,ccw?,cw?,press?}
{label,emit}
Optional icon names a package-local square PNG up to 256x256, for example "icon": "assets/icon.png". Studio's Create designs one for new plugins by default. Include this file in projection assetHashes even if no primitive references it. Use a real PNG, not an SVG, external URL or placeholder string. Keep an existing user-selected icon unless the user requests a change. Vibe's image picker saves the image into the current draft; read current files before editing so later turns retain it. The icon appears in the client, SDL and compatible physical Dock catalogs, separately from the Dock projection; it does not replace artwork inside the plugin. The App automatically transfers a thumbnail at the negotiated catalogIcons v1 size: 72x72 on current firmware, 48x48 on earlier firmware. No extra permission, Base64 source edit or runtime SDK call is needed. If only the physical catalog lacks custom icons, update both App and firmware. Packages without an icon remain valid; Music Lyrics shares the App's bundled fallback image, while other packages use the device's default icon.
icon
"icon": "assets/icon.png"
assetHashes
catalogIcons
host.mjs exports async function activate(ctx) and may return cleanup. Use browser ESM and relative package-local imports. Node, process, shell, filesystem, arbitrary network, eval and remote dependencies are unavailable. Stop timers and subscriptions when ctx.signal aborts. Await ctx.publish(state); handle aborted timer callbacks without unhandled rejections. Publication returns a host revision, not a device acknowledgment; the host retains the latest complete state and reconciles the device through leases (default device cadence 1 Hz). Startup must finish within five seconds and event handlers within ten.
host.mjs
async function activate(ctx)
ctx.publish(state)
await ctx.publish(completeState)
ctx.on(name, async ({eventId,context,signal}) => result)
ctx.http.request({method,path,json?,credential?,idempotencyKey?,signal?})
network
ctx.http.readBytes({path,credential?,signal?})
ctx.frames.start
.createCanvas
.font
.drawIcon
.present
.submit
.status
.stop
ctx.store.get(key)
.set(key,value)
.delete(key)
ctx.media.read()
.subscribe(listener)
media.read
ctx.dock.read()
.subscribe(listener, onError?)
dock.read
ctx.images.choose()
.show({id}, {fit,signal?})
.clear()
images.read
host.imageFolders
ctx.images.list(folderId, {recursive?,cursor?,limit?,signal?})
ctx.media.control(command,value?)
media.control
ctx.hid.consumer(command, {signal?})
hid.consumer
ctx.hid.keyboard({key,modifiers?}, {signal?})
hid.keyboard
ctx.hid.mouse(command, {signal?})
hid.mouse
ctx.log.info/warn/error(message,fields?)
Playback commands: previous, next, playpause, seek, shuffle, repeat. Availability depends on the host platform and player. Do not claim universal player or operating-system support.
previous
next
playpause
seek
shuffle
repeat
Run on simulator for a saved plugin uses production configuration, grants and services. It reports missing setup instead of falling back to samples. Native projections run without host JavaScript and use the firmware's HTTP/WebSocket source service, cache, budgets and network policy. The simulator and Dock share the LVGL projection/frame adapter. Source-directory and embedded previews, CLI and both MCP fixture tools remain isolated simulations. Plugin details lets the user allow or revoke the package's Access without a Dock; tools cannot approve consent on their behalf.
Studio Preview adds a dial bar below the device screen for the manifest's knob.ccw, knob.press and knob.cw actions. Each button dispatches its declared event with null context; unassigned actions and busy previews are disabled. The screen remains 854x480 and has no product-photo background. Preview, Vibe, CLI and MCP fixture events remain simulated and never control the computer.
knob.ccw
knob.press
knob.cw
On macOS, the native simulator attached to an enabled, permission-granted plugin sends HID events to the local computer without requiring a physical Dock. The same ctx.hid API, manifest grants, writable event permissions and rate limits apply. Only live simulator events use this backend; physical Dock events retain the USB route. Closing the session or revoking grants prevents new input, and uncertain results are never replayed.
ctx.hid
With macOS Accessibility access, volume up/down and mute send paired system media keys through the login session, allowing macOS to display its normal volume HUD like a physical Dock. Without Accessibility access, volume uses a CoreAudio fallback on the default output (1/16 steps and mute toggle), which changes volume without the system HUD; fixed-volume outputs return unsupported on this fallback. Playback media keys, keyboard shortcuts and mouse input require macOS Accessibility access for Studio in System Settings > Privacy & Security > Accessibility. Keyboard input affects current focus; mouse clicks use the current pointer. stop and unmapped physical keys return unsupported. Other platforms currently return unsupported for local simulator input. Success reports submission, not confirmation that the receiving app acted. This is local OS input emulation, not an emulated USB peripheral or a firmware compatibility test.
unsupported
stop
HID consumer commands: volumeUp, volumeDown, mute, playPause, nextTrack, previousTrack, stop, brightnessUp, brightnessDown. These send a real USB HID key press and release from the connected Dock to its USB host. They do not use the player's volume API. Declare hid.consumer in both host.permissions and each HID event's permissions; use write: true. The plugin must be installed and open on the connected physical Dock, with firmware advertising hidConsumer.version: 1, and the client must be running. SDK/contract remain compatible with 1.0.0; old conversations claiming that volume control is unavailable are outdated.
volumeUp
volumeDown
mute
playPause
nextTrack
previousTrack
brightnessUp
brightnessDown
host.permissions
write: true
hidConsumer.version: 1
For a volume knob, merge these handlers into the existing activation and map knob.ccw.emit to volume.down, knob.cw.emit to volume.up. Keep the user's existing press behavior unless asked to change it:
knob.ccw.emit
volume.down
knob.cw.emit
volume.up
ctx.on('volume.down', async ({signal}) => ctx.hid.consumer('volumeDown', {signal})); ctx.on('volume.up', async ({signal}) => ctx.hid.consumer('volumeUp', {signal}));
Each event definition is { "context": { "type": "null" }, "write": true, "permissions": ["hid.consumer"] }. A call sends one step; media, keyboard and mouse share a total of 20 calls/second. Always return/check the EventResult; do not show an invented absolute volume or claim the OS changed it. Success means HID reports were written, not that the receiving OS/app applied them. Handle offline, unsupported (old firmware or unsupported action), unavailable (plugin not open or HID not ready), and permission_denied. On overloaded, stop repeated dispatch and reduce event frequency. Never retry an outcome: 'unknown' result: the input may already have been applied. Use the event signal to prevent canceled actions. Vibe, CLI and MCP fixture previews simulate all HID and never change system volume, send keys or move/click the pointer; no manual fixture branch is needed.
{ "context": { "type": "null" }, "write": true, "permissions": ["hid.consumer"] }
EventResult
offline
unavailable
permission_denied
outcome: 'unknown'
Network requests use a relative path. host.network.originConfig names the configuration property containing the HTTPS origin (explicit localhost HTTP is supported for local services). Declare secrets as host.secrets: [{id,label}] and reference them with credential. Credentials are kept by the host; plugins never receive their values. Writes use the provided eventId as idempotencyKey; unknown write outcomes must not be automatically replayed.
path
host.network.originConfig
host.secrets: [{id,label}]
credential
eventId
idempotencyKey
Studio-only local bridges: a locally edited and installed draft may include studio.service.json with {"version":1,"entry":"connector/server.mjs","healthPath":"/"}. Declare the existing host network origin setting with a localhost HTTP origin. Studio asks separately for local Node.js execution, checks readiness before live activation, watches code, and stops the bridge on runtime stop or Studio quit/crash. Restarting Studio restores approval, not an idle service; reopening the enabled plugin starts it on demand. Existing local connector/server.mjs, bridge/server.mjs and service/server.mjs are discovered automatically. Preserve the actual working directory and .local data; do not launch duplicate detached services or install login jobs. Fixture previews, CLI/MCP checks and registry installation do not launch services. This adds no sandbox process API or SDK permission; see docs/plugin-local-bridges.md for lifecycle and migration limits.
studio.service.json
{"version":1,"entry":"connector/server.mjs","healthPath":"/"}
connector/server.mjs
bridge/server.mjs
service/server.mjs
.local
docs/plugin-local-bridges.md
A plugin reaches the network in one of two ways. NETWORK_ACCESS_CAPABILITY in the SDK describes both; MCP plugin_context and tool contexts return it as networkAccess.
NETWORK_ACCESS_CAPABILITY
networkAccess
ctx.http
sources
readBytes
dataSources.hostMixed
localhost
http
https
ws
wss
allowPrivateNetwork: true
host.secrets
To show a LAN device's status on the Dock without the App, use sources. To change something from a control, use ctx.http: a LAN service without HTTPS needs a small HTTPS or localhost gateway on the computer.
Events schema is an object keyed by event name. Each value contains context JSON Schema, optional result JSON Schema, write: boolean, optional permissions. Handlers return {ok:true,result?} or {ok:false,reason,outcome?}. A hit with no context sends null, so its schema must accept null. Dial actions send no custom context. Mark external mutations as writes and declare the corresponding permission.
context
result
write: boolean
permissions
{ok:true,result?}
{ok:false,reason,outcome?}
Schemas use strict Ajv with explicit types/properties. No $ref, $dynamicRef, pattern, patternProperties or format. Provide defaults for required config properties. Fixture JSON must match the state schema exactly. Schema traversal is limited to 256 objects and depth 16; configuration must be an object and state may be any bounded JSON value. The host injects config.fixture (true only in fixture sessions); omit it from user-facing settings. On package upgrade, rollback and App restore, saved top-level settings forbidden by the current schema's additionalProperties: false are removed and missing defaults are filled; declared values are kept, including invalid ones that the user must correct.
$ref
$dynamicRef
pattern
patternProperties
format
config.fixture
additionalProperties: false
Keyboard and mouse require separate hid.keyboard and hid.mouse grants. Firmware must advertise hidKeyboard.version: 1 and/or hidMouse.version: 1; older firmware remains compatible with existing APIs but returns unsupported for these calls. Both use the Dock's USB HID interface, with the plugin installed and open and the desktop client running. The SDK/contract remains 1.0.0 with additive APIs.
hidKeyboard.version: 1
hidMouse.version: 1
export async function activate(ctx) { // Merge with state publication and other handlers for the plugin. ctx.on('copy', async ({signal}) => ctx.hid.keyboard({key: 'KeyC', modifiers: ['Primary']}, {signal})); ctx.on('palette', async ({signal}) => ctx.hid.keyboard({key: 'KeyP', modifiers: ['Primary', 'Shift']}, {signal})); ctx.on('click', async ({signal}) => ctx.hid.mouse({action: 'click', button: 'left'}, {signal})); ctx.on('right', async ({signal}) => ctx.hid.mouse({action: 'move', dx: 12, dy: 0}, {signal})); ctx.on('scroll.down', async ({signal}) => ctx.hid.mouse({action: 'scroll', delta: -1}, {signal})); }
In plugin.json, include "hid.keyboard" and "hid.mouse" in host.permissions only when needed. For example, events.schema.json declares "copy": {"context":{"type":"null"},"write":true,"permissions":["hid.keyboard"]} and "click": {"context":{"type":"null"},"write":true,"permissions":["hid.mouse"]}. Declare the other handlers similarly and map projection hits/dial actions to their event names. Do not call HID during activation, preview setup or autonomous background loops.
plugin.json
"hid.keyboard"
"hid.mouse"
events.schema.json
"copy": {"context":{"type":"null"},"write":true,"permissions":["hid.keyboard"]}
"click": {"context":{"type":"null"},"write":true,"permissions":["hid.mouse"]}
key
HID_KEYS
KeyA
KeyZ
Digit0
Digit9
F1
F12
Enter
Escape
Tab
Space
KeyC
C
modifiers
Control
Shift
Alt
Meta
Primary
{action:'click', button:'left'|'right'|'middle'}
{action:'move', dx, dy}
{action:'scroll', delta}
Return/check each result before subsequent actions. Cancellation cannot retract reports already sent. The firmware deduplicates sequences across all HID types and queues release reports after a partial/blocked send; an unknown result must not be replayed. A shortcut affects the receiving computer's current focus, and a click uses its current pointer position. These APIs do not select an application or window, read screen coordinates, register global shortcuts, access clipboard contents or grant arbitrary OS automation.
Declare "dock.read" in host.permissions. await ctx.dock.read() returns a DockStatusSnapshot from the host's shared physical-port cache. ctx.dock.subscribe(async snapshot => ..., onError?) emits the initial snapshot and changes; all subscribers in one plugin share a non-overlapping poll, at most once/second. Async listeners are awaited, so slow publication does not accumulate work. It returns an unsubscribe function and stops automatically on ctx.signal abort. read() returns immediately and starts a background refresh when needed; if a one-shot read returns loading, subscribe or read again later. Handle errors such as permission_denied with onError; declare the permission before using the API. Read-only status needs no event permission unless an event explicitly declares one.
"dock.read"
await ctx.dock.read()
DockStatusSnapshot
ctx.dock.subscribe(async snapshot => ..., onError?)
read()
loading
onError
Snapshot fields:
status
disconnected
ready
ports: []
updatedAt: null
updatedAt
dock.dashboard.live
ports
portId
connected
disabled
error
class
storage
display
tb_host
other
audio
available: false
unavailableReason
DockPortState
desktopStatus
online
temperature
level
normal
high
critical
fanMode
off
low
medium
Port identifiers on the current Dock: tb5_host, tb5_downstream_1, tb5_downstream_2, ethernet_10g, nvme_gen4x2, cfexpress_b, sd_uhs_ii, microsd_uhs_ii, displayport, hdmi, usb_c_pd_1, usb_c_pd_2, usb_c_10g_1, usb_c_10g_2, usb_c_10g_3, usb_a_10g_1, usb_a_10g_2, usb_a_480m_1, usb_a_480m_2, audio_in, audio_out, audio_combo.
tb5_host
tb5_downstream_1
tb5_downstream_2
ethernet_10g
nvme_gen4x2
cfexpress_b
sd_uhs_ii
microsd_uhs_ii
displayport
hdmi
usb_c_pd_1
usb_c_pd_2
usb_c_10g_1
usb_c_10g_2
usb_c_10g_3
usb_a_10g_1
usb_a_10g_2
usb_a_480m_1
usb_a_480m_2
audio_in
audio_out
audio_combo
export async function activate(ctx) { const publish = async snapshot => { await ctx.publish({ status: snapshot.status, connected: snapshot.ports.filter(port => port.status === 'connected').length, total: snapshot.ports.length, networkRate: snapshot.ports.find(port => port.portId === 'ethernet_10g')?.network?.negotiatedRate ?? '--', }); }; await publish(await ctx.dock.read()); return ctx.dock.subscribe(publish, error => ctx.log.warn(error.message)); }
Define those four fields in the state schema and fixture, and bind formatted values to the projection. Display the non-ready status clearly. This API exposes connection/negotiation status, not live throughput, watts, metric history, filesystem access, port power control or device ejection. It excludes mount paths, volume identities, Thunderbolt identifiers, raw serial paths and arbitrary protocol calls. A live plugin requires an updated runtime host and Dock firmware supporting dock.dashboard.query/live; standalone authoring needs no App.
dock.dashboard.query/live
Vibe and standalone fixture previews return a fixed sample with 22 ports, four connected (Thunderbolt host, Ethernet, NVMe and HDMI), plus normal temperature and low fan mode. They never read physical hardware. No fixture branch is needed for the default demo; use explicit config.fixture sample states to visually test offline, error or long-value cases. A fixture pass does not prove real hardware behavior.
Interface authoring guidance: build beautiful, polished, product-quality interfaces with clear hierarchy, refined typography, consistent alignment/spacing and purposeful controls. Finish empty/loading/error states and verify rendered screenshots for legibility, clipping and balanced composition. SDK DOCK_CONTROL_GUIDANCE shares this guidance with CLI, MCP and Vibe; it does not expand supported widgets or styling fields.
{ "version": 1, "manifestHash": "BUILD", "assetHashes": {}, "width": 854, "height": 480, "header": { "height": 72, "type": "pexar-device-top-nav" }, "primitives": [], "hits": [] }
The top 72 pixels belong to the device navigation header. Every primitive/hit has positive w,h, with x>=0, y>=72, x+w<=854, y+h<=480. The preview is displayed at half scale, 427x240. For ordinary plugin layouts, keep controls, hit targets, feedback text and selection indicators at least 24 device pixels above the bottom edge (y+h<=456, or 12 preview pixels). This is authoring guidance; full-bleed backgrounds and media may still use the entire content rectangle. Preserve touch-target sizes and leave space between the footer and adjacent content.
w
h
x>=0
y>=72
x+w<=854
y+h<=480
Primitives are a flat array of rect, text, image, progress, arc, icon. Optional widgets add interactive JSON layouts (see below). No HTML/CSS/JS runs on the device. Unknown fields are rejected. Use the exact Primitive interface in the current SDK. Color/fill/stroke arrays are [r,g,b,alpha], each 0..255. Text font is 8..48, alignment is left/start/center/right, wrap is boolean. Rect radius is 0..8. border is four side widths 0..8, with color in stroke. Progress binds a number and divides by max (default 1).
rect
text
image
progress
arc
widgets
Primitive
[r,g,b,alpha]
border
stroke
max
New Studio previews and matching simulator/Dock firmware use the Dock settings/dialog control defaults, exported as DOCK_CONTROL_STYLE and widgetAppearance in the SDK: 26px control text, system-medium button captions, borderless #48484A buttons with #EBEBEB text, #383A3B pressed state, and a pill radius capped at 32px or half the authored height. Ordinary text uses system. Studio Preview uses the bundled simulator’s native LVGL renderer and font files when available, including native wrapping and clipping; browser-only previews use the shared browser renderer. Native builds retain the verified Dock Alibaba PuHuiTi text weights and exact digit/icon/fallback asset profile; substitute-font components are rejected during packaging. Browser-only previews use their existing OFL font profile, so use native verification for exact Dock typography. Switches reuse the Dock's 81x44 settings artwork, and sliders use an 8px #505054 track, #53FFAF fill and a 40px white thumb. Prefer 64px-high controls, 8px gaps and enough width for the longest label; stepper side buttons use up to 64px each. Select captions are centered with a 14px system down icon inset 32px and symmetric 56px text insets. Expanded options form one rounded surface with dividers and theme-green selected-row fill: 64px rows, at most 256px high, scrollable and clamped inside the content area. The popup uses authored radius or an 8px default; individual rows have no rounded card styling. These defaults are in device pixels, so a 26px label appears at 13px in the half-scale preview.
widgetAppearance
system-medium
system
Explicit font, fontFace, color, button fill and radius take precedence, including zero radius and the regular face. Positions and sizes are never enlarged automatically; compact switches fit their authored bounds. The optional authored radius remains 0-8 and font 8-48; omitting radius selects the renderer's native pill shape without adding a projection field. Containers, option rows and the 40px tab content offset keep their geometry. Existing custom layouts and flat primitives are not rewritten. This is a visual default, not a new permission, widget type or firmware capability. Older Studio/firmware keep their previous defaults until updated; check both the Web preview and native simulator when migrating a compact layout.
font
fontFace
color
fill
bind, selected, assetBind and hit disabled use dotted state paths, never expressions. Publish computed values and formatted strings in state. Images reference real PNG files through asset, optionally variants keyed by bound state. All files must be declared in assetHashes. Use appearance: "overlay" for a hit over an existing visual. Other hits show their label. A hit includes x,y,w,h,emit,label,context?; context must pass the event schema. React and SDL previews also accept an image assetBind pointing to bounded inline PNG artwork (at most 160x160); physical-device dynamic artwork transfer is not implemented.
bind
selected
assetBind
asset
variants
appearance: "overlay"
x,y,w,h,emit,label,context?
The trusted packaging helper calculates SHA-256 from the exact manifest bytes and PNG contents in its private snapshot. BUILD markers are accepted in author sources by development validation, but not in an installable release package.
Authoring image input is a local file: plugin_write({files:[{path:"assets/cover.png",source:"/absolute/cover.jpg"}], ...revisionArguments}), PluginSession.importImage(source, destination, revision?), or bolt-plugin image DIRECTORY SOURCE_IMAGE assets/cover.png. PNG, JPEG, WebP, GIF, BMP, AVIF and SVG are converted to static PNG files. Images preserve aspect ratio without upscaling, fit referenced projection bounds up to 854x480 (including fullscreen), and icons are padded to a transparent square up to 256x256. Aggregate image budgets below are enforced by compression and additional downscaling. Include new projection/manifest references in the same write; returned images contains final paths, dimensions and byte sizes. Image references and hashes update automatically. Animated input becomes one static frame, not playback.
plugin_write({files:[{path:"assets/cover.png",source:"/absolute/cover.jpg"}], ...revisionArguments})
PluginSession.importImage(source, destination, revision?)
bolt-plugin image DIRECTORY SOURCE_IMAGE assets/cover.png
images
All image formats use this file workflow by default, including PNG. plugin_read.files contains text; assets contains image byte sizes and dimensions. Binary bytes are omitted unless includeBinary:true is explicitly requested. Base64 and image Data URLs are legacy input options, not the recommended workflow. The local source file must exist on the machine running the authoring service; it is never a runtime dependency. Inputs are bounded to 10 MiB, 8192 pixels/side and 16 megapixels/image, with 10 MiB and 32 megapixels/write. Standalone check/package also normalize source-directory images in a private snapshot, keeping the originals editable. The release contract still requires actual PNG entries with finalized hashes; URLs, Base64 strings and original JPEG/WebP/SVG files are not projection assets.
plugin_read.files
assets
includeBinary:true
Package: 10 MiB total, 2 MiB/file, 512 entries; state and manifest 64 KiB; at most 2048 projection nodes and depth 16. Vibe drafts use the same 10 MiB/512-file author budget. PNG assets: dimensions at most 854x480, 1 MiB compressed and 4 MiB decoded combined. Store: 1 MiB. Close unused previews to release resources; instance capacity is described under Optimization And Transfer Recovery.
Preview uses the actual Electron sandbox with fake brokers. HTTP/media reads return fixture data, external controls are simulated, and storage is private to the preview. Branch on config.fixture to publish realistic sample states. A passed preview proves package acceptance and the exercised sample behavior, not live service credentials, real player control or device compatibility.
Prioritize system resources in new plugins and AI edits. fontFace accepts system (device regular face; ordinary text default), system-medium, system-bold, or digits (42dot Sans Digits/Units). font is the size in device pixels, 8-48. Arbitrary font names, URLs and font files are rejected. Use digits for numeric readouts, system faces for general text.
system-bold
digits
Text is UTF-8 and may contain Chinese in primitives, bindings, widget labels and options. Native SDL and updated Dock firmware attach a same-size Chinese fallback to all four text faces, including Chinese units in digits. Studio bundles OFL Noto Sans SC; the Dock reuses its Chinese UI subset, so rare-character coverage can differ. Use text nodes and system faces for Chinese; do not rasterize ordinary text or use the icon font for it. This is glyph support, not automatic translation of the interface.
Plugin text and Canvas font helpers automatically fall back to the bundled Noto Sans 2.015 phonetic subset (Regular, Medium and Bold), including all 96 IPA Extensions characters and common stress/length marks. Existing system, system-medium, system-bold and digits font IDs are unchanged; no custom font or permission is needed. Use current Studio and Dock App builds together. Complex combining-mark positioning is not guaranteed by the native renderer; verify narrow diacritics on the target display. Symbol icons continue to use the icon font.
Example icon: { "type":"icon", "icon":"volume", "x":16, "y":88, "w":40, "h":40, "font":24 }. Buttons also accept icon; omit label for icon-only buttons, whose id supplies the accessible name. A label displays icon and text. Names, not Unicode code points, are the API; the same glyph subset is bundled in the client and firmware.
{ "type":"icon", "icon":"volume", "x":16, "y":88, "w":40, "h":40, "font":24 }
label
Names: home, back, forward, up, down, play, pause, stop, previous, next, volume, mute, plus, minus, check, close, settings, refresh, power, save, download, upload, folder, file, image, video, music, wifi, bluetooth, usb, battery, search, info, warning, trash, edit, lock, unlock, eye, fullscreen, menu. SYSTEM_ICONS is authoritative. Use packaged PNGs for artwork or icons absent from the catalog.
home
back
forward
up
down
play
pause
volume
plus
minus
check
close
settings
refresh
power
save
download
upload
folder
file
video
music
wifi
bluetooth
usb
battery
search
info
warning
trash
edit
lock
unlock
eye
fullscreen
menu
SYSTEM_ICONS
Every node has a unique id (ASCII letter followed by letters/digits/underscore/hyphen, maximum 64), type, integer w/h, optional integer x/y. Roots default to x=0,y=72 and stay inside the content area. Child coordinates are parent-relative. container.layout is absolute (default), row or column; flow layouts ignore child x/y, preserve explicit sizes, and use padding and gap (0-64). Absolute coordinates include padding. Overflow clips unless scroll is x, y or both. Children may reach 4096 pixels to allow scrolling. Tabs reserve a 40-pixel strip.
type
w/h
x/y
x=0,y=72
container.layout
absolute
row
column
padding
gap
scroll
x
y
both
button
switch
checkbox
slider
stepper
min
step
pagination
radio
list
select
options
optionsBind
tabs
container
children
layout
Options are {label, value: string|number, disabled?: boolean} with unique values, maximum 64. optionsBind reads a state array; invalid arrays render empty and reject selection. Labels are at most 160 characters, string values 128. Numeric bounds are finite within +/-1,000,000, max > min, step >= 0.001. Publish new state after input: host state owns selection/toggles. disabled and visible are dotted state paths, inherited by children. Hidden/disabled nodes and inactive tab children cannot emit. Bindings are paths, not expressions.
{label, value: string|number, disabled?: boolean}
max > min
step >= 0.001
visible
Interactive nodes declare emit. Their context is always {id, value, context}, where the last field is the static node context or null. Declare this object in the event schema. Existing hits and dial events keep their original context (usually null); use separate events or anyOf when sharing handlers. Values are validated again against current state on input.
emit
{id, value, context}
anyOf
{ "id":"level", "type":"slider", "x":16, "y":120, "w":300, "h":40, "bind":"level", "min":0, "max":100, "step":1, "emit":"level.change" }
ctx.on('level.change', async ({context}) => { state.level = context.value; await ctx.publish(state); return {ok:true}; });
Event schema: { "context": { "type":"object", "required":["id","value","context"], "additionalProperties":false, "properties": { "id":{"type":"string"}, "value":{"type":"number","minimum":0,"maximum":100}, "context":{"type":"null"} } }, "write":false, "permissions":[] }. This changes plugin state only. Physical volume uses ctx.hid.consumer, not an invented absolute-volume API.
{ "context": { "type":"object", "required":["id","value","context"], "additionalProperties":false, "properties": { "id":{"type":"string"}, "value":{"type":"number","minimum":0,"maximum":100}, "context":{"type":"null"} } }, "write":false, "permissions":[] }
ctx.hid.consumer
Combined primitives, hits, widgets and options are limited to 2048 nodes; each dynamic options source reserves its maximum 64 options. Widget nesting is limited to 8 levels, also subject to existing overall JSON byte/depth limits. Devices advertise widgets.v1, system.icons.v1, system.fonts.v1, image.animation.v1, media.fullscreen.v1. Packages needing unavailable features are incompatible on older firmware; legacy packages continue working.
widgets.v1
system.icons.v1
system.fonts.v1
image.animation.v1
media.fullscreen.v1
type:"arc" is a read-only primitive or widget, requiring firmware component arc. It renders a native circular progress bar with a square w/h box (minimum 2px). bind reads a numeric value, or primitives can use numeric value; progress clamps value / max to 0..1 (max defaults to 1, positive up to 1,000,000). Missing/nonnumeric/nonfinite values display empty progress. color is the foreground and fill the track, as RGBA; defaults are mint and dark gray. thickness is 1..w/2 device pixels (default min(8,w/2)); rounded defaults to true. startAngle is clockwise from the right (0..359, default 270/top); sweepAngle is 1..360 (default 360).
type:"arc"
value
value / max
thickness
rounded
startAngle
sweepAngle
For the small continuously rotating loading ring use indeterminate:true: no percentage or Host timer is required. duration optionally sets one clockwise revolution in 100..10000 ms (default 1000); sweepAngle defaults to 90. Bound progress/value is ignored in this mode. At most 16 loading rings/image animations combined. Hidden loading rings pause and closed views release their animation. Loading rings add no permission. Primitive loading rings introduce no host dependency; widgets retain the existing host execution requirements. Use a widget's visible binding for loading state; do not animate by publishing JSON or streaming frames. No events are emitted by arc.
indeterminate:true
duration
{"id":"completion","type":"arc","x":40,"y":120,"w":160,"h":160,"bind":"percent","max":100,"thickness":12,"color":[83,255,175,255]}
{"id":"loading","type":"arc","x":240,"y":170,"w":32,"h":32,"indeterminate":true,"duration":1000,"thickness":3,"visible":"loading"}
See circular progress examples. Older firmware is incompatible only for packages using the new features; no contract version bump is required.
Images accept animation: {type:"fade"|"slide"|"zoom"|"rotate", duration:1000, delay:0, repeat:false, easing:"linear"|"easeInOut", from?, to?, axis?:"x"|"y"}. Duration: 100-10000 ms; delay: 0-60000 ms. Fade uses opacity 0-1 (default 0 to 1), slide uses pixel offsets -854 to 854 (default -32 to 0 on x), zoom uses scale 0.25-4 (default 0.85 to 1). Rotate uses clockwise degrees -360..360 (default 0 to 360); use to:-360 for counterclockwise. It requires both image.animation.v1 and image.rotate.v1. At most 16 animations, shared with loading rings. They restart when a photo source changes, clip to the viewport, and do not restart on continuous video frames. GIF/APNG are not projection assets; decode authorized GIF bytes on the host and publish frames through ctx.frames.
animation: {type:"fade"|"slide"|"zoom"|"rotate", duration:1000, delay:0, repeat:false, easing:"linear"|"easeInOut", from?, to?, axis?:"x"|"y"}
to:-360
image.rotate.v1
ctx.frames
fullscreen: true is valid only for images, including the single streaming image used for video. Tapping opens an 854x480 black surface with only the media, fitted without cropping by default. Set fullscreenFit: "cover" alongside fullscreen: true to fill the whole screen with centered cropping and preserved aspect ratio; "contain" keeps the complete image. Any explicit fullscreenFit value (including contain) requires media.fullscreen.cover.v1; omit the field for older firmware. Update the Desktop host and device App when older firmware reports incompatible. Normal viewport layout and stream dimensions do not change. Ordinary media exits on any tap, including the former header area, without emitting a plugin event. A single streaming image primitive may opt in with fullscreenTouch:"tap" (a declared event name), requiring media.fullscreen.touch.v1. Fullscreen taps then emit {x,y,width,height,fullscreen:true} in original viewport pixels; contain black bars ignore taps and cover maps cropped coordinates. No exit button overlays the image. Hold for at least one second and release to exit without a plugin event; browser previews also support Esc. Do not combine interactive fullscreen with image animation. Native Simulator, Dock and preview share this behavior. Text, controls, containers and custom navigation cannot enter fullscreen; do not build a fullscreen container, hide the system header yourself or overlay controls. It resets on plugin closure/disconnection.
fullscreen: true
fullscreenFit: "cover"
"contain"
fullscreenFit
contain
media.fullscreen.cover.v1
fullscreenTouch:"tap"
media.fullscreen.touch.v1
{x,y,width,height,fullscreen:true}
Streaming photos with a non-repeating fade from 0 to 1 crossfade the previous and replacement images in both normal and fullscreen views. Keep calling images.show directly for the next photo: loading and transfer retain the current image, and the old frame is released when the transition finishes. Do not insert images.clear between slideshow photos.
images.show
images.clear
ctx.images.show(source, {animate:false}) disables the animation for this photo replacement, including fullscreen. animate:true or omitting the option uses the stream primitive's configured animation; it does not create an animation if none is declared. The choice is per call and does not change the projection or subsequent calls. Keep the current photo until the replacement is ready. Use animate:false for rapid navigation and animate:true for deliberate slideshow transitions. Updated previews and SDL support this flag; physical devices require firmware advertising imageStream.animationControl:true. Older firmware may ignore the flag and retain the configured animation.
ctx.images.show(source, {animate:false})
animate:true
animate:false
imageStream.animationControl:true
After showing a photo, call ctx.images.prefetch([previousSource, nextSource], {fit, signal}) to predecode up to two adjacent photos without displaying or transferring them. Use the same fit as show. The host retains at most three decoded photos, rechecks authorization and file identity/size/modification times before reuse, and cancels obsolete speculative work when a new show arrives. Catch prefetch failures separately from visible-photo failures. Clear, rescan, selection changes and runtime stop invalidate the cache. Do not await prefetch on the navigation path or prefetch an entire album.
ctx.images.prefetch([previousSource, nextSource], {fit, signal})
show
Use one image primitive with stream: true, an ordinary PNG fallback in asset, and integer w/h inside the 854x408 content area. Do not combine stream with assetBind or variants. Declare images.read and its permission on photo events. ctx.images.choose() opens a native picker only in live mode, returning opaque {id,name}[]; invoke it in a user event, never activation. Keep the IDs in runtime memory, not persisted settings/store. Selection is limited to 200 PNG/JPEG files, 20 MiB and 32 million pixels each. Canceled selection returns []; retain the prior album when canceled.
stream: true
stream
{id,name}[]
[]
Call await ctx.images.show({id: photos[index].id}, {fit:'contain', signal}) when navigating; cover crops to fill. A newer show supersedes unfinished work. ctx.images.clear() clears the current photo. Photos stay on the computer and the device uses a separate RAM-only stream, not package assets or JSON state. Do not publish photo bytes/data URLs or save photos to store. Captions, index and controls remain normal state. In fixture mode choose returns []; call ctx.images.show({asset:'assets/sample.png'}) with an explicitly packaged sample so both Preview and SDL exercise the image renderer. This API prepares a host frame; it does not promise that a disconnected device displayed it. Physical display requires firmware advertising the volatile imageStream capability and a connected running client.
await ctx.images.show({id: photos[index].id}, {fit:'contain', signal})
cover
ctx.images.clear()
ctx.images.show({asset:'assets/sample.png'})
imageStream
For persistent albums, declare host.imageFolders: [{id:'album',label:'Photo folder'}] in plugin.json (up to four) and images.read. This adds the native folder picker to the plugin's Settings. Do not simulate it with a folder-path text field or ask for arbitrary filesystem access. The client saves a read-only grant for the installation, restores it after restart and restarts a running runtime on folder changes. Removing a binding or revoking permissions retires its access. Paths and bookmarks are host-only; no store permission is needed to remember the folder.
host.imageFolders: [{id:'album',label:'Photo folder'}]
Merge this fragment into the existing plugin.json, keeping its other host fields and permissions:
{ "host": { "entry": "host.mjs", "sdk": "1.0.0", "permissions": ["images.read"], "imageFolders": [{ "id": "album", "label": "Photo folder" }] } }
There is no folder-picker field in config.schema.json. The client shows the picker in the installed plugin's Settings from host.imageFolders. Use ordinary configuration fields for slideshow preferences, for example:
config.schema.json
{ "type": "object", "properties": { "includeSubfolders": { "type": "boolean", "default": false }, "intervalSeconds": { "type": "integer", "minimum": 5, "default": 5 } }, "additionalProperties": false }
Read all pages before starting a slideshow:
async function readAlbum(ctx) { const photos = []; let cursor; do { const page = await ctx.images.list('album', { recursive: ctx.config.includeSubfolders === true, limit: 200, ...(cursor ? { cursor } : {}), signal: ctx.signal, }); photos.push(...page.photos); cursor = page.nextCursor; } while (cursor); return photos; }
In live activation call ctx.images.list('album', {recursive: ctx.config.includeSubfolders === true, limit:200, signal:ctx.signal}). It returns {photos:[{id,name}],nextCursor?}; follow cursors with the same recursive flag until absent. show({id}) accepts these IDs. No cursor starts a new scan and retires old IDs; refresh between slideshow cycles to include added files. Keep snapshots and IDs in runtime memory. Handle no grant (permission_denied), missing/inaccessible/replaced directory (unavailable), empty list and invalid photos gracefully. A moved folder requires reselection. Scans skip hidden entries/symlinks and only include nonempty PNG/JPEG files up to 20 MiB, with limits of 5,000 photos/20,000 examined entries and 16 directory levels; exceeding them fails with quota_exceeded. Fixture list returns an empty page and never reads saved grants; use packaged sample images. Use a serialized timer loop for autoplay, normally at least five seconds between slides, pause it while ctx.view.visible is false, and clear timers when ctx.signal aborts. Persist the current position (not photo IDs) with ctx.store if a restart should resume there. Refresh the list before reusing IDs after restart.
ctx.images.list('album', {recursive: ctx.config.includeSubfolders === true, limit:200, signal:ctx.signal})
{photos:[{id,name}],nextCursor?}
show({id})
Large plugin data uses the host's prefer-bulk policy: negotiated USB Bulk OUT first, CDC fallback when unavailable. Use ctx.images.show for albums, ctx.video for local video, ctx.frames.present/submit for generated or network-decoded frames, and packaged PNG assets for static artwork. No new permission, manifest field or per-call USB option is required. Do not implement direct endpoint access or encode images in JSON state/store. Controls, leases and acknowledgements remain on CDC. Keep SDK size, frame-rate, cancellation and backpressure limits; bulk is not a guaranteed frame rate. Failed writes are not replayed automatically.
prefer-bulk
ctx.images.show
ctx.video
ctx.frames.present/submit
With bulkTransport.imageFrameMaxBytes, photos use one binary BGRA frame, without Base64 or per-chunk acknowledgements; one CDC reply confirms validation and commit. Old firmware and unavailable Bulk retain the compatible chunked transport. Preview encodings are generated only when a preview requests them.
bulkTransport.imageFrameMaxBytes
The Agent service's installed plugin summaries (plugin_list, plugin_runtime status) include dataTransfer: {preference:'prefer-bulk', channel:'bulk-out'|'cdc'|'offline', maxFrame, bulkBytesSent}. bulkBytesSent measures the current shared physical link, not one plugin or confirmed display, and resets when that bulk connection changes. A preview does not claim physical bulk support. Verify a live album by opening it, advancing photos, checking the screen and observing the bulk counter increase. Preserve the current photo through loading/transfer; never clear between slides.
plugin_list
plugin_runtime status
dataTransfer: {preference:'prefer-bulk', channel:'bulk-out'|'cdc'|'offline', maxFrame, bulkBytesSent}
bulkBytesSent
Native SDL is an additional renderer check. Existing source-build mode depends on a firmware checkout and native libraries; it is not a prerequisite for the in-app Dock preview or the skill's sandbox validation. Report SDL or physical-device verification only when it actually ran.
Declare video.read in host.permissions and in write events that operate playback. Add one image primitive with stream: true, a PNG fallback asset and dimensions inside the content area. ctx.video.choose() returns {id,name}[] from the native local file picker; paths are never exposed. ctx.video.play({id}, {fit:'contain',loop:false,fps:10,signal}) decodes on the computer and streams MJPEG to the Dock. fit may be cover; fps must be an integer 1-55 and is a requested ceiling. Firmware limits still apply. Keep controls outside the video rectangle for direct video-layer acceleration; overlapping content uses software composition. Use pause(), resume(), seek(seconds), stop() and status(); status returns {state,position,duration,error?} with state stopped/playing/paused/ended/error. Pausing retains the current frame; stopping restores the fallback. The source file stays on the computer. Playback is silent, with no URL, RTSP/HLS, audio or DRM support. Selection IDs live only in the current runtime and must not be persisted. Firmware must advertise videoStream; V821 supports JPEG/MJPEG decoding, not H.264/H.265 decoding. For ctx.config.fixture, render sample state and do not choose or play local files. Do not claim guaranteed 55 fps, H.264/H.265 device decoding, audio or RTSP/HLS support. The bundled video-player is a complete example.
video.read
ctx.video.choose()
ctx.video.play({id}, {fit:'contain',loop:false,fps:10,signal})
fit
pause()
resume()
seek(seconds)
stop()
status()
{state,position,duration,error?}
videoStream
ctx.config.fixture
video-player
Selected-window capture can use an explicitly approved external native companion with the existing network/frame APIs. Window capture is outside the sandbox; require native window selection and separate local-code execution approval. Consumer/registry installation does not start local code. Companion implementations are maintained separately from Studio and are not bundled development templates.
Use the same single stream: true image primitive for arbitrary rendered content. await ctx.frames.start({format:'mjpeg',fps:30}) returns {id,width,height,format,fps,maxBytes}. ctx.frames.createCanvas() creates a viewport-sized OffscreenCanvas; regular HTML Canvas also works. Draw with the standard 2D context and call await ctx.frames.present(canvas,{signal}). The client encodes and publishes the frame for preview, SDL and the Dock. No Canvas or JavaScript runs in firmware.
await ctx.frames.start({format:'mjpeg',fps:30})
{id,width,height,format,fps,maxBytes}
await ctx.frames.present(canvas,{signal})
For pre-encoded data call await ctx.frames.submit(bytes,{signal}), with a Uint8Array or ArrayBuffer. In bgra8888 mode it is tightly packed top-to-bottom B/G/R/A, straight alpha, exactly widthheight4 bytes; the host composites onto black. In mjpeg mode it is one complete JPEG of matching dimensions, at most maxBytes returned by frames.start (up to 131072 after explicit new-firmware negotiation, 32768 with legacy firmware/no physical capability). It is not JSON/base64 state, multipart MJPEG, a GIF file or an MP4 container. Width/height are fixed by the projection. start supports fps 1-50; BGRA is capped at 10 and connected firmware may lower the rate. present prioritizes quality at native viewport dimensions; completed device transfers dynamically lower production fps and recover gradually. An unencodable frame returns {sequence:0,accepted:false} and leaves the previous image visible; oversized pre-encoded submit still rejects. frames.status().effectiveFps is the host pacing ceiling, not a physical display measurement. Neither the requested ceiling nor a successful submission guarantees that the device displayed that frame.
await ctx.frames.submit(bytes,{signal})
Uint8Array
ArrayBuffer
bgra8888
mjpeg
maxBytes
frames.start
start
{sequence:0,accepted:false}
submit
frames.status().effectiveFps
The submission result is {sequence,accepted}: false means a newer waiting frame replaced this one; true means the host prepared it. Only one frame is encoded and one newest frame waits. The device completes its current transfer and then takes the latest frame. Always await submission; do not start an unbounded interval or stuff pixels into ctx.publish. While the plugin is hidden the awaited submission waits until it is shown again (see Runtime Lifecycle); stop decoding or fetching new source frames while ctx.view.visible is false instead of queuing work. status() returns {stream,submitted,dropped}. stop() cancels and clears. Stop timers on abort, and await any in-flight render before starting a new drawing loop. Images, local video and custom frames share the viewport; starting one replaces the others.
{sequence,accepted}
ctx.publish
{stream,submitted,dropped}
All 4 system fonts load during frames.start. Prefer g.font = ctx.frames.font('system-medium',24) and ctx.frames.drawIcon(g,'volume',x,y,24) over imported fonts or rasterized UI icons. The icon helper uses the current fill style and a text baseline at y. createCanvas starts with the system font; font helper sizes remain 8-48.
g.font = ctx.frames.font('system-medium',24)
ctx.frames.drawIcon(g,'volume',x,y,24)
createCanvas
const {width,height} = await ctx.frames.start({format:'mjpeg',fps:30}); const canvas = ctx.frames.createCanvas(); const g = canvas.getContext('2d'); g.fillStyle = '#101713'; g.fillRect(0,0,width,height); g.strokeStyle = '#53d99a'; g.beginPath(); g.moveTo(16,height/2); g.lineTo(width-16,32); g.stroke(); g.font = ctx.frames.font('system',18); g.fillStyle = '#ffffff'; g.fillText('Signal',16,24); await ctx.frames.present(canvas,{signal:ctx.signal});
Drawing needs no permission. Network sources still require network: ctx.http.readBytes({path,credential?,signal?}) performs a bounded GET at the configured origin and returns {status,bytes,contentType}. It shares existing origin restrictions, redirect denial, credentials, 5-second timeout and 1 MiB response cap. Decode images with createImageBitmap(new Blob([bytes],{type:contentType})), draw them and close the bitmap. Chromium ImageDecoder can decode authorized GIF bytes frame by frame; close decoded VideoFrames and the decoder. Package assets remain PNG; small fixture bytes can be provided by a package-local ESM module.
{status,bytes,contentType}
createImageBitmap(new Blob([bytes],{type:contentType}))
ImageDecoder
Camera snapshot endpoints need an authorized HTTPS origin or localhost gateway. This supports rendering supplied frames; it does not grant camera/microphone capture, arbitrary fetch, direct RTSP/HLS or multipart-MJPEG ingestion. Do not claim those sources work without a gateway. apps/desktop/examples/sdk-showcase demonstrates every current widget, fonts/icons, animations, Canvas/raw BGRA/raw JPEG/GIF, photos/video and all current broker capabilities with isolated sample behavior.
apps/desktop/examples/sdk-showcase
Camera snapshot sources: refresh metadata independently from frame polling with at most one pending request; on transient errors keep the same source's last good frame for a bounded grace period, show buffering with its original timestamp and retry with capped backoff; clear frames on confirmed offline/access denial, source change or expiry. Gateway timeouts, player-error recovery and real-source tests are in the "Cameras and snapshot streams" section of the plugin reliability guide (plugin-optimization.md in the repository's docs/ or the tools distribution's dist/context).
docs/
dist/context
Continuous image/video/Canvas streams require an updated Desktop host that releases completed native USB transfers. Verify stable host memory during extended live playback and after stopping. Fixture checks and short previews cannot establish endurance; no new plugin permission, API call or automatic restart loop is required.
Use a package-local browser ESM engine; no CDN, eval, worker, external runtime download or device JavaScript is available. frames.createCanvas() owns a 2D context; create a separate WebGL canvas, render the scene and copy to the SDK canvas before await frames.present(). A custom JPEG encoder may instead await frames.submit(bytes,{signal}), respecting actual dimensions and maxBytes from frames.start. Keep a single serialized loop, bounded geometry and particles, and cancellable initialization. Dispose scenes, textures, engines and GPU contexts after pending work settles. Verify WebGL context loss/recovery and long-running memory in the real sandbox; a fixture image is not a physical frame-rate guarantee.
frames.createCanvas()
await frames.present()
await frames.submit(bytes,{signal})
Use ctx.fs.watchExternal(options, listener) with fs.watch. host.externalStorage optionally declares {scope: 'external', recursive: true}; omitted fields have these defaults. Users authorize current and future external storage in Permissions. This requires the updated Desktop App and a running host plugin; it cannot run as device-native logic. The runtime, and therefore the subscription, only exists while the plugin is open on the Dock or simulator and during the idle window; each restart subscribes again and starts from fresh initial events. Supported live discovery: macOS external physical volumes and Windows USB storage with drive letters. No Linux or Windows non-USB discovery yet.
ctx.fs.watchExternal(options, listener)
fs.watch
host.externalStorage
{scope: 'external', recursive: true}
Options: recursive may narrow the declaration; extensions (max 16, such as .json) and names (max 32 exact relative paths, case-sensitive) intersect for files; directories are included. debounceMs is 100..2000, default 250, plus optional signal and transfers (default false). No absolute paths, hidden paths, traversal or globs. Metadata is {path,kind:'file'|'directory',size:number|null,modifiedAt:number|null}; paths use /. fs.watch alone never exposes contents. No mutation APIs. ctx.fs.watch, manual directories, Dock-only scope and volume allowlists are not implemented.
recursive
extensions
.json
names
debounceMs
signal
transfers
{path,kind:'file'|'directory',size:number|null,modifiedAt:number|null}
/
ctx.fs.watch
The Promise resolves before callbacks begin. volume events carry action: mounted|unmounted, volume:{volumeId,name}, and a per-mount mountId. volume-event carries volumeId/mountId and a nested event: reset:{epoch,reason}, changes:{epoch,fromRevision,revision,observedAt,changes}, or status:{status:'unavailable',reason}. A change is {type:'upsert',entry} or {type:'remove',path,kind}. Unmount invalidates that mount without individual removals. Remount creates a new mountId. Reset reasons are initial/overflow/reconnect; unavailable reasons root_missing/access_denied/quota_exceeded/backend_error.
action: mounted|unmounted
volume:{volumeId,name}
mountId
volume-event
reset:{epoch,reason}
changes:{epoch,fromRevision,revision,observedAt,changes}
status:{status:'unavailable',reason}
{type:'upsert',entry}
{type:'remove',path,kind}
On reset, call watcher.snapshot(volumeId,mountId,{cursor?,limit?,signal?}), page through {epoch,revision,entries,nextCursor?}, then apply only later same-epoch changes with matching fromRevision. Discard older revisions; resnapshot on gaps. Pages freeze one index version, up to 200 entries/48 KiB each; cursors are one-use, expire after 60s and are invalidated by a new snapshot or epoch. stale_event means resynchronize; unavailable means await recovery. Pace pages by 20ms to respect the shared SDK request limit. Remove directories and their descendants together. Changes describe final state, not an audit log or a guarantee of completed writes.
watcher.snapshot(volumeId,mountId,{cursor?,limit?,signal?})
{epoch,revision,entries,nextCursor?}
stale_event
Callbacks run serially; throwing or exceeding 10s closes the subscription. Always observe watcher.closed.catch(error => ctx.log.warn(String(error))); discovery/transport/consumer errors reject it. Do not await closed during activation. Return cleanup calling watcher.close() (idempotent), which suppresses new callbacks; entered callbacks cannot be forcibly canceled. Abort/stop/revoke release resources. At most one collection per plugin, eight volumes, 64 collections per App; discovery failure or too many volumes rejects closed. Each root is bounded to 20,000 scanned entries, 1,024 directories, depth 16, 8s and an estimated 8 MiB index. Global committed indices: 100,000 entries/32 MiB. Queue: 256 events/128 KiB, overflow resets epochs; batches: 128 changes/48 KiB and four events/second. Exclude hidden paths, links/junctions and cross-filesystem submounts. Inaccessible roots retry every 60s.
watcher.closed.catch(error => ctx.log.warn(String(error)))
watcher.close()
Files use native directory notifications plus a 60s reconciliation scan; volume discovery reconciles every 5s. Sandboxed clients wait on event RPC, not a polling timer. CLI, standalone MCP and App previews expose a virtual external volume containing Documents, status.json, and Documents/report.csv, honoring filters and recursion without touching real disks. Preview does not prove live OS access. Read the exported Fs types and FILESYSTEM_WATCH_CAPABILITY for the current contract.
Documents
status.json
Documents/report.csv
Declare both fs.watch and fs.transfers, obtain user consent, and opt in with watchExternal({transfers:true}, listener). macOS observes public NSProgress published by Finder/cooperating applications; Windows reports unsupported. Coverage is always published-only, never universal copy monitoring. Subscription covers validated discovered directories; newly created, short-lived or over-quota directories/tasks may be missed. No events does not prove no transfers. Changes in file size or quiet time are not progress/completion evidence.
fs.transfers
watchExternal({transfers:true}, listener)
published-only
Events are {type:'transfer',volumeId,mountId,transfer}, {type:'transfer-status',volumeId,mountId,status}, and {type:'transfer-reset',volumeId,mountId}. A transfer has id,path,source:'macos-nsprogress'|'fixture',operation:'copy'|'move'|'download'|'upload'|'other',state:'running'|'paused'|'completed'|'cancelled'|'unknown',completedUnits,totalUnits,fractionCompleted,bytesPerSecond,estimatedSecondsRemaining,observedAt. Numeric fields except observedAt may be null. Units belong to the publisher and are NOT necessarily bytes; fraction is a publisher-reported 0..1 value. Rates/ETA only appear when explicitly published. Completed requires publisher finished, cancelled takes precedence, and unpublication/process loss without finished is unknown. Completed is not a checksum, durability or safe-ejection guarantee. Folder tasks need not publish per-file completion.
{type:'transfer',volumeId,mountId,transfer}
{type:'transfer-status',volumeId,mountId,status}
{type:'transfer-reset',volumeId,mountId}
id,path,source:'macos-nsprogress'|'fixture',operation:'copy'|'move'|'download'|'upload'|'other',state:'running'|'paused'|'completed'|'cancelled'|'unknown',completedUnits,totalUnits,fractionCompleted,bytesPerSecond,estimatedSecondsRemaining,observedAt
Status is {state:'starting'|'available'|'unsupported'|'unavailable',coverage:'published-only',reason?}; reasons are platform/helper_missing/backend_error/quota_exceeded/root_unavailable. Available means backend ready, not exhaustive coverage. Backend failure marks active tasks unknown; resubscribe to restart. On transfer-reset call watcher.transferSnapshot(volumeId,mountId,{signal?}) for {status,transfers} and replace local state. At most 128 tasks per volume; terminal records last at most 60s and may be evicted earlier for capacity. Updates coalesce within the existing 4 events/sec budget, with native sampling every 250ms; this is not an audit log. Unmount invalidates the mount and its cache. CLI/MCP opt-in fixtures simulate a copy of status.json and completion.
{state:'starting'|'available'|'unsupported'|'unavailable',coverage:'published-only',reason?}
watcher.transferSnapshot(volumeId,mountId,{signal?})
{status,transfers}
Declare fs.watch and separate fs.read, with user consent. watcher.readBytes(volumeId,mountId,path,{maxBytes?,signal?}) returns {bytes:Uint8Array,entry:FsEntry} containing the entire file in one call; callers do not need to split or concatenate it. readText returns strict UTF-8; readJson parses and validates SDK JSON (depth 16/nodes 8192, no dangerous keys or non-finite numbers). Invalid text/JSON returns invalid_config. There is no SDK file-size cap; optional maxBytes is a positive safe integer chosen by the caller, with quota_exceeded if the entire file is larger. readChunks(volumeId,mountId,path,{chunkSize?,maxBytes?,signal?}) asynchronously yields {bytes,entry,offset,eof,version}; omitting chunkSize enables automatic 4–16 MiB blocks (grow below 250 ms per read, shrink above 1000 ms); an explicit chunkSize fixes the block size, from 1 byte to 16 MiB. These are IPC block sizes, not file-size limits. One verified file descriptor is reused per iterator. Use it for bounded-memory complete-file processing, in a cancellable background task rather than inside the 10-second event callback. Await processing before requesting another chunk. Reads share a rolling 64 requests/second budget across all watchers in a plugin; wait only when exhausted. Do not add per-chunk sleep. EOF, error, break, cancellation, stop and unmount release the retained handle; ejection waits for release. A stream idle for 30 seconds expires and subsequent reads fail stale_event. Process each block promptly or cancel and restart. Chunks are provisional: discard partial verification on error and mark success only after EOF. File versions are checked across chunks. Only visible relative regular files inside the active mount and subscription recursion/name/extension filters are allowed. Links, hardlinks, directories and cross-filesystem submounts are rejected. File identity/size/timestamps changing during reading fail stale_event; whole-file helpers discard partial results; streaming consumers must discard their partial verification on error. Reading does not guarantee another process finished writing. Old mounts fail stale_event; OS access failures are permission_denied/unavailable. Two reads per subscription and eight globally, with a 5s checked budget per chunk, not for the entire stream; underlying filesystem calls may return later. Stop/revoke/abort prevent results from being delivered. No writes or shell access. Network-authorized plugins can transmit read content to their authorized origin, disclosed in Permissions.
fs.read
watcher.readBytes(volumeId,mountId,path,{maxBytes?,signal?})
{bytes:Uint8Array,entry:FsEntry}
readText
readJson
Fixtures provide status.json as {"message":"Sample external storage","value":42} and Documents/report.csv as name,value\nsample,42\n. Real content access is never used by previews. Capability discovery adds filesystemWatch.transfers and .contentRead; metadataOnly:true still describes the fs.watch-only permission.
{"message":"Sample external storage","value":42}
name,value\nsample,42\n
filesystemWatch.transfers
.contentRead
metadataOnly:true
Declare fs.watch and separate fs.eject, with explicit user authorization. watcher.eject(volumeId,mountId,{signal?}) safely removes the whole physical storage device, including its other mounted partitions. File filters/recursion do not narrow physical removal. Prefer a user control event marked write:true with permissions:['fs.eject']; do not eject automatically because one transfer completed. No force option, arbitrary path/device ID, elevation, process termination or file writes are exposed.
fs.eject
watcher.eject(volumeId,mountId,{signal?})
write:true
permissions:['fs.eject']
Result: {status:'ejected',simulated:boolean}; {status:'failed',reason:'busy'|'permission_denied'|'unsupported'}; or {status:'unknown',reason:'disconnected'|'timeout'|'backend_error'}. Only ejected confirms OS success; unmounted alone could mean physical unplugging. The host revalidates volume identity/mount generation and resolves one physical disk, pausing this filesystem subsystem across plugins on that device before removal. At most one live request per App, no queue/retries; concurrent requests get overloaded. macOS uses non-forced diskutil eject; ambiguous multi-device APFS targets are unsupported. Windows USB storage uses CM_Request_Device_EjectW and respects vetoes; system/boot disks are excluded. Windows hardware validation remains required.
{status:'ejected',simulated:boolean}
{status:'failed',reason:'busy'|'permission_denied'|'unsupported'}
{status:'unknown',reason:'disconnected'|'timeout'|'backend_error'}
OS commands time out after 30s plus bounded discovery and up to 5s of handle draining. Stop/revoke/abort before submission prevents the request; after submission cancellation cannot undo it and may surface stopped/unknown. Never automatically retry unknown outcomes. Success emits unmounted and invalidates old mount IDs across plugin subscriptions; failure rebuilds metadata via reset and resumes watching. Other apps or image/video readers can still cause busy. Preview ejection returns simulated:true, emits unmounted and invalidates the virtual mount without OS commands. filesystemWatch.eject describes permission/platforms/physical-device scope/force:false/fixture preview. No standalone CLI/MCP command directly ejects a developer's real disk.
filesystemWatch.eject
Declare fs.watch, then call watcher.subscribeIo(volumeId, mountId, listener, { signal?, onError? }). It returns an unsubscribe function. Obtain target IDs from volume/mounted events; do not pass disk names, absolute paths or OS disk numbers. Matching names do not establish volume identity. Use the new mountId after remounting.
watcher.subscribeIo(volumeId, mountId, listener, { signal?, onError? })
volume/mounted
let watcher; watcher = await ctx.fs.watchExternal({ fileChanges: false, signal: ctx.signal }, event => { if (event.type !== 'volume' || event.action !== 'mounted') return; watcher.subscribeIo(event.volume.volumeId, event.mountId, sample => { // Update local state and use the shared coalescing publisher (at least 300 ms between starts). // Read both rates when sample.status === 'ready'; show an em dash for unavailable, never zero. updateIoState(sample); }, { signal: ctx.signal, onError: error => ctx.log.warn(String(error)) }); }); void watcher.closed.catch(error => ctx.log.warn(String(error))); // Await watcher.close() on shutdown, or call the returned function to unsubscribe individually.
FsIoSample includes volumeId, mountId, status, scope, readBytesPerSecond, writeBytesPerSecond, sampledAt, intervalMs and simulated. Ready rates are nonnegative bytes/s: divide by 1,000,000 for MB/s or 1,048,576 for MiB/s. Idle is zero. Unavailable rates, scope, timestamp and interval are null; reason distinguishes warming_up, unsupported, stale, backend_error, root_unavailable and unmounted. Transport, permission or consumer failures invoke onError and terminate that subscription. Temporary unavailability keeps the subscription alive for recovery. Unplugging ends subscriptions for that mount; subscribe again after the next mounted event.
FsIoSample
Shared OS counters are sampled about every two seconds; intervalMs is the actual difference window and sampledAt is the sample time. Cached samples older than ten seconds are stale. The first measurement establishes a baseline; cold startup normally takes 4–6 seconds for a valid sample, and existing baselines can be faster. macOS prefers APFS volume counters and falls back to the physical disk when volume counters are absent, such as ExFAT. Windows prefers LogicalDisk and falls back to PhysicalDisk, with a one-second counter window and SDK updates about every two seconds, subject to performance counter availability. A physical-device scope includes other partitions on the same disk; never sum these samples across partitions. Disks that cannot be mapped safely report unavailable.
This is window-averaged actual system I/O, including other applications. It is not rated bandwidth, a benchmark, SDK file-read speed, a Finder task rate or transfer completion. Cached file reads may produce no disk I/O. No fs.read or fs.transfers permission is required; the API neither reads file contents nor writes benchmark files. Name and extension filters do not filter volume or physical-disk counters.
The SDK reuses one timer per watcher and shares non-overlapping requests for the same target, with at most eight targets and 32 listeners. Busy asynchronous listeners skip intermediate samples; exceeding ten seconds terminates that listener with consumer_error without affecting others. Unsubscribe, signal cancellation, watcher.close and plugin stop clean up subscriptions. The host releases idle sampling leases within 6.5 seconds of the last query, or immediately on watcher close or unplug. Desktop must run; a USB/Dock connection is not required. An offline device cannot invoke this host API independently.
The CLI, both MCP servers, SDK types and developer context share the filesystemWatch.io contract. Previews return simulated=true with fixed read/write rates of 24 MB/s and 8 MB/s. They do not measure hardware. Older Apps lack subscribeIo; prompt users to update. This capability adds no CLI benchmark or real disk-writing command.
Plugins that only need volume lifecycle, I/O or published transfers should use ctx.fs.watchExternal({ fileChanges: false, transfers: true }, listener); omit transfers when unnecessary. fileChanges defaults to true for compatibility. With false, the host does not traverse directories, build file indexes, create native file watchers or emit volume-event, and snapshot() returns unsupported. Volume discovery/lifecycle, subscribeIo, transferSnapshot, readChunks/readBytes/readText/readJson for known relative paths, and eject remain available with unchanged permissions. recursive still constrains authorized read/transfer paths; recursive:false does not disable indexing.
ctx.fs.watchExternal({ fileChanges: false, transfers: true }, listener)
Without indexing, macOS transfer observation subscribes only at mount roots. It no longer discovers subdirectory NSProgress subscriptions by scanning, so some subdirectory-published tasks may be absent; this is not whole-disk transfer coverage. The SDK, CLI and both MCPs advertise filesystemWatch.fileChanges; previews also omit indexes and reset events. I/O-only plugins should not display indexing state or scan the entire disk themselves; do not hide index errors while leaving indexing enabled. Older Apps must be updated; do not silently fall back to recursive scanning.
macOS associates physical disks, APFSPhysicalStores and APFSVolumes from disk listings without the slower diskutil apfs list or file scans. After a transient OS error or timeout, the watcher stays open and retries discovery every five seconds without overlapping calls. It emits {type:'discovery-status',status:'retrying',reason:'backend_error'}, then {type:'discovery-status',status:'available'} on recovery. Do not interpret failure as an empty volume list, reopen the watcher or add scanning/retry timers.
diskutil apfs list
{type:'discovery-status',status:'retrying',reason:'backend_error'}
{type:'discovery-status',status:'available'}
During failure, retain known volume names, but file reads, snapshots, I/O queries and ejection are temporarily unavailable. Cancel active reads, release I/O leases and mark unfinished transfers unknown. Show Retrying, clear stale rates and stop pending verification. Recovery preserves IDs for unchanged mounts and resumes existing I/O subscriptions. Disappeared or replaced mounts emit unmounted/mounted and require the new mountId. Only unrecoverable permission/quota failures or explicit close end the watcher; still handle watcher.closed. Close, stop and permission revocation cancel further retries.
Projection pages declares 1-16 unique {id,left?,right?,up?,down?} entries. Direction names describe the finger; targets must refer to another declared page. initialPage defaults to the first page. Optional page on primitives, hits and root widgets selects a page; omitted means a shared stationary node. Children inherit their root's page. IDs are ASCII letter plus letters/digits/underscore/hyphen, maximum 64 characters. Node, animation, asset and size budgets remain package-wide. The system header stays fixed.
{id,left?,right?,up?,down?}
The Dock owns gesture recognition, current page, following the finger, 48px commit threshold (dominant axis ratio 1.25) and 180ms settle/cancel animation. Sliders/scrolling controls own input; dialogs and fullscreen media suspend navigation. Swipes suppress release taps. State refreshes preserve the selected page; a new view starts at the initial page. Firmware must advertise pages.swipe.v1; older devices are incompatible. Native primitive/data-source pages need no Host. Pages do not enable offline scripts, Host bindings or widgets.
pages.swipe.v1
Optional pageChange names a declared write:false event with no permissions and context {from,to,direction}. The context schema must accept every declared edge. A committed local transition notifies the connected Host without waiting for its response. This option requires Host execution; it is suppressed offline, including on mixed source plugins. No initial/failed/cancelled notification; view-scoped, bounded notifications may be dropped and are never replayed. It is observational, not authorization to perform external writes or a way to drive page selection. Ordinary control contexts stay unchanged. See the page guide and page-deck example.
pageChange
write:false
{from,to,direction}
page-deck
Install on device persists the entry and icon independently of host Enable. A connected Dock advertising residentCatalog.version: 1 is required to install/uninstall. A catalog entry is available when the plugin is enabled and its permissions, settings, secrets and platform requirements are satisfied; opening it starts the host runtime on demand (up to the Dock's 30-second activation wait). With residentCatalog.hostWaitDialog support, every Host-dependent plugin shows a cancellable connection dialog until valid Host activation, without saved layouts or placeholders. Older hostLayouts firmware may display placeholder layouts. Stop, revoke, host disconnection and Dock restart preserve entries. Native-only projections run immediately offline after installation. Leaving a plugin on the Dock (Back or switching) releases its device view, decoder, animation and image resources and cancels pending projection transfers and view events; the host runtime becomes hidden and stops after the idle window, and reopening creates a new view.
residentCatalog.version: 1
Use SDK deviceExecution(manifest, projection) to inspect the mode. native requires no Host permissions, manifest knob emits, hits, pageChange notifications, streams or Host data/page-request bindings. Local pages, restricted actions and ui.knob mappings are allowed. Opted-in widgets (ui.version: 1) use static values, declared sources.<id> data or ui.* state; item.* is scoped to collection templates. Independent widgets require widgets.native.v1, and local rotary input requires ui.knob.v1. Static text/shapes/icons/packaged PNGs, native image animations and fullscreen viewing are supported. Firmware stores actual PNG files plus the projection. Games, timers, slideshow selection, Canvas and all host SDK behavior remain host; no device JavaScript or cached fixture execution is provided. Do not remove bindings/permissions merely to claim offline support. The negotiated resident storage budget is 2 MiB including metadata, images and 64 KiB reserved per data-source plugin for cache.
deviceExecution(manifest, projection)
native
ui.knob
ui.version: 1
sources.<id>
item.*
widgets.native.v1
ui.knob.v1
host
The Dock itself fetches JSON from LAN hosts and public HTTPS/WSS services, without a runtime host, the Desktop App or USB (updated firmware required). Sources are read-only and cannot be triggered by controls; compare them with ctx.http under Choose A Network Path. Declare 1-4 sources on device.projection.json:
{ "sources": [ { "id": "weather", "kind": "http", "originConfig": "weatherOrigin", "path": "/now", "intervalMs": 60000, "maxBytes": 4096 }, { "id": "live", "kind": "websocket", "originConfig": "liveOrigin", "path": "/stream", "maxBytes": 4096 } ] }
Each originConfig names a string property in the configuration schema. Users choose an origin (for example https://data.example.com or wss://data.example.com), without credentials/path/query/fragment. Paths begin with a single /; percent-encode non-ASCII characters. HTTP is GET only. WebSocket accepts UTF-8 JSON text messages, supports fragmentation and ping/pong, and reconnects with backoff. It sends no application messages: authentication headers, subscription commands, Socket.IO and arbitrary binary messages are not supported.
originConfig
https://data.example.com
wss://data.example.com
Optional pathConfig names a string setting that replaces path. Optional queryConfig maps up to 16 query parameter names to top-level string, number/integer or boolean settings. All setting references and query names use the same identifier rules as originConfig. Referenced settings must exist; null, arrays, objects, non-finite numbers and invalid Unicode are rejected with invalid_config. Values are converted to strings and percent-encoded, then appended to the path's existing query (including empty strings, 0 and false). The final path must satisfy the same path rules and 2048-character limit. For example, "pathConfig":"requestPath","queryConfig":{"city":"city","units":"units"} with requestPath="/weather", city="New York" and units="metric" requests /weather?city=New%20York&units=metric. Both HTTP and WebSocket handshake URLs support these settings.
pathConfig
queryConfig
invalid_config
0
false
"pathConfig":"requestPath","queryConfig":{"city":"city","units":"units"}
requestPath="/weather"
city="New York"
units="metric"
/weather?city=New%20York&units=metric
The App compiles only the referenced settings into the installed native presentation; it does not copy the full configuration, host store or secrets. The Dock persists the resulting origin/path/query and uses them after USB disconnection and restart. Changing a referenced setting invalidates device consent and requires approval and catalog synchronization; edits made while disconnected take effect on the next connection. Parameter changes also change the presentation hash and isolate the response cache. This works with existing data-source firmware and adds no device JavaScript, custom headers or WebSocket application messages. Treat these as ordinary non-secret settings: request URLs and their values are stored on the Dock and visible to the target service. Host-held secret references cannot be used here. Older SDK/App/tooling must be updated to accept the new declaration fields.
HTTP requires intervalMs (5000-86400000) and waits this long after completion. WebSocket omits it and submits valid JSON immediately, coalescing pending updates to the latest value before rendering. Legacy WebSocket intervals are accepted but ignored. WebSocket requires the negotiated dataSources.websocketImmediate: true capability; minIntervalMs applies only to HTTP. Independent source workers prevent slow HTTP requests from blocking live sockets. Each source accepts at most maxBytes (1-65536), 512 JSON nodes and depth 16. The device source state and cache must fit 64 KiB; host state has a separate negotiated maxState budget (64 KiB on updated Dock firmware; 32 KiB on older devices). Responses replace state.sources[id]; bind text/progress/selected/packaged-image variants using existing point paths such as sources.weather.temperature. No expressions, scripts or downloaded artwork. Cache writes are coalesced to at most once per five seconds after the first write, with a final flush on network loss, view exit or normal shutdown; abrupt power loss can lose the latest unwritten updates.
intervalMs
dataSources.websocketImmediate: true
minIntervalMs
maxState
state.sources[id]
sources.weather.temperature
Use allowPrivateNetwork: true only when the service needs local-network access. This is an additional item in the App's consent screen. Private addresses are otherwise denied; plaintext http/ws requires this consent and an actual private destination. Public destinations require HTTPS/WSS with valid certificates. Redirects, proxies and third-party credentials are unavailable. Keep secrets out of the package and source URLs.
Every declared source needs a schema-valid sample at fixtures/default.json -> sources.<id>. For native execution, keep host.permissions: [], no secrets, no knob actions, and empty hits/widgets. Mixed host plugins may combine sources with host bindings, widgets and actions when dataSources.hostMixed and residentCatalog.hostLayouts are advertised. A minimal preview activate(ctx) can publish fixture samples when ctx.config.fixture is true, and {sources:{}} otherwise if the state schema allows it. The device never uses fixture data as live data.
fixtures/default.json
host.permissions: []
residentCatalog.hostLayouts
activate(ctx)
{sources:{}}
The App resolves origins only after permission review and includes them in the native presentation and consent fingerprint. Changing the package or origins invalidates consent. Install on device and open it; no host runtime is started. Offline permission/configuration changes reach the Dock on the next App connection. Firmware advertises data.sources.v1 and the dataSources capability with supported kinds and budgets; older firmware must be updated. See apps/desktop/examples/device-data-card for a complete example.
data.sources.v1
dataSources
apps/desktop/examples/device-data-card
For an event declared with context: {"type":"null"}, invoke plugin_event with the actual JSON value null, never the string "null" or {}. An invalid_event caused by a mismatched test payload is not a reason to change the event schema or plugin behavior. Correct the call and recheck if needed.
context: {"type":"null"}
plugin_event
"null"
{}
invalid_event
Vibe supports Codex and the official local Claude Code CLI. Both use the same plugin tool schemas, validation, fixture previews, screenshots and installation pipeline. Claude may show an MCP prefix on tool names. Native provider authentication and authoring permissions are separate from installed-plugin permissions; plugins cannot read subscription credentials or invoke an AI provider through a new runtime API. External Desktop/standalone MCP contracts and CLI commands are unchanged.
The plugin runtime contract remains unchanged. Distribution metadata uses registry protocol version 1, with types exported from the SDK registry module. The App and website share the preview renderer and package validator. The website accepts an editable-source .boltplugin package. Legacy private archive ZIPs (.boltsubmission), which the website rejects, contain submission.json (format pexarbolt-submission/1, MIT license and runtime checksum), plugin.boltplugin, and editable source/. Platform submission requires author confirmation of MIT publication rights; local export does not publish. CLI submission and both MCP plugin_submission tools export these artifacts. CLI upload can upload a draft with an explicitly configured token. Source, screenshots of private data, secrets and user configuration must not be confused with distributable runtime state. Documentation: docs/plugin-publishing.md, bundled as dist/context/plugin-publishing.md.
.boltplugin
.boltsubmission
submission.json
pexarbolt-submission/1
plugin.boltplugin
source/
submission
plugin_submission
docs/plugin-publishing.md
dist/context/plugin-publishing.md
Submission exporters also capture the checked fixture runtime state and optional PNG/JPEG media frame in submission.json.preview. The website validates the state schema and bounded frame format/dimensions, then uses the shared renderer. No manual screenshots are required. The snapshot is never taken from an authorized live installation. A submission without this optional metadata uses its default fixture.
submission.json.preview
ctx.backup requires Desktop App 0.3.0. Declare backup.read for summaries and backup.control for native setup and commands. This is an App-owned background service, separate from read-only ctx.fs; it does not grant arbitrary filesystem writes. Methods: snapshot(), subscribe(listener,onError?), configure(eventId), command({action,eventId,jobId?,ruleId?}). Actions: start, pause, resume, cancel, disable-auto, open-folder, report. Native configuration separately authorizes external source/target folders and optional insertion automation. Jobs continue when the plugin closes, but require the App. Read plugin-backup.md for grants, identity, limits, reports, pause/recovery and platform scope. CLI/MCP/web checks simulate jobs and perform no real copying.
ctx.backup
backup.read
backup.control
ctx.fs
plugin.json supports optional author: a non-empty display name of at most 80 characters, without control characters. Use the author supplied by the user; do not invent a person or organization. This is package attribution, not verified publisher identity. Existing packages without it remain valid. Studio shows the name on project cards and details; an omitted name is shown as unspecified.
author
Platform uploads set plugin.json.author to the publishing account display name. The portable AUTHORS.json file uses format pexarbolt-authors/1 with originalAuthors and contributors arrays of display names and a publisher display name. Preserve that file, original attribution, licenses and third-party notices when editing or forking. The server retains original authors and adds the current publisher without storing email addresses in the package. Studio keeps original attribution through editing checks and exports. This metadata uses ordinary JSON files and the existing author field; runtime SDK, CLI and MCP method schemas do not change.
plugin.json.author
AUTHORS.json
pexarbolt-authors/1
originalAuthors
contributors
publisher
Publication categories are Photo & Video, Productivity, Developer Tools, AI Workflows, Media, Lifestyle, Health & Fitness, Education, Finance, Weather, Monitoring, Utilities and Games. Website submission validates this list; runtime SDK listing metadata remains compatible with existing strings.
Optional listing.json contains summary (short description, max 180 characters), description (max 16000) and changelog (release notes, max 8000). These are publishing metadata, never runtime permissions or verified ownership. Package attribution uses optional plugin.json.author (non-empty, max 80, no control characters). Removing attribution omits that property. Source-bearing .boltplugin exports retain this information; website upload imports it for user review. Studio metadata saves validate all four string fields, require the observed package revision, preserve unrelated listing fields and reject stale edits.
listing.json
summary
description
changelog
An interactive sample preview retains its independent page/simulator lifetime when a real Dock starts the same installation. Fixture controls never operate the physical instance. Stop page previews explicitly when leaving their UI; live host visibility and idle shutdown remain separate. Source Tree reads verified installed package files only with an expected revision; it is read-only and omits private configuration, credentials and runtime stores. Native SDL displays the 854×480 canvas at 100% backing-pixel scale, including Retina screens; outer control chrome is separate from device coordinates.
Firmware advertising residentCatalog.hostWaitDialog: true shows a cancellable Connect Host dialog for every Host-dependent plugin, including mixed-source plugins, until a valid Host activation. This applies while disconnected, disabled, preparing, timed out or after restart. No saved layout, placeholder controls, fixture values or stale Host data is displayed. Cancel returns to the plugin list. Connect the Dock to a computer, open PexarBolt or Plugin Studio and enable the plugin: it opens automatically when ready. Disconnect, stop or lease expiry returns to the dialog and clears Host state, frames and grants.
residentCatalog.hostWaitDialog: true
On firmware advertising residentCatalog.hostWaitDialog, pure Host plugins persist only their catalog entry and thumbnail; the interface and required images are transferred into memory when opened. Mixed-source plugins retain the definitions and caches needed for device-owned fetching, and native plugins retain their independent interface. Only images reachable from the interface, including all pages, variants and stream fallbacks, are sent. assetBind can choose arbitrary declared paths, so those plugins retain the full image map. Identical image hashes are uploaded once per activation. Older residentCatalog.hostLayouts firmware keeps its saved Host presentation. Persistence does not enable offline Host execution or display. Native projections continue independently with their declared device sources and normal source-status behavior. Older firmware advertising only hostLayouts may display placeholder layouts; update firmware for connection dialogs. Existing installations need one connection to an updated App/Studio to synchronize definitions. Component and 2 MiB resident-storage budgets remain unchanged. Browser and fixture previews do not certify this device lifecycle; verify cancellation, activation, disconnect, reboot and reconnect on the Dock. SDK RESIDENT_DISPLAY_CAPABILITY and CLI/MCP context.residentDisplay expose this guidance.
residentCatalog.hostWaitDialog
hostLayouts
RESIDENT_DISPLAY_CAPABILITY
context.residentDisplay
Firmware advertising dataSources.hostMixed: true and residentCatalog.hostLayouts: true allows declared device sources alongside host bindings, widgets, streams, page notifications and dial actions. The plugin remains deviceExecution: host; older firmware is incompatible with this combination.
dataSources.hostMixed: true
residentCatalog.hostLayouts: true
deviceExecution: host
The Dock owns the entire sources namespace. It merges device values with the other fields of the host's published object state; host publications cannot replace device source values. Source updates do not advance the host revision or run a host event. The host runtime does not receive device source values through ctx.publish or read-back. Declare a source sample for preview, but publish {sources:{}, hostValue: ...} (or omit sources if the schema allows it) in live host code.
{sources:{}, hostValue: ...}
When the Host disconnects, stops or loses its lease, device requests and source caching continue in the background without restarting. Host fields, streams and grants are cleared. On residentCatalog.hostWaitDialog firmware, the entire mixed-source plugin UI shows the connection dialog until Host activation; no source display, placeholder controls or local pages are shown. Device sources still need Dock Wi-Fi and authorization; errors retain their last successful cached values. After a Dock restart, cached source values load and requests restart in the background. Native source-only plugins continue to display independently.
Resolved request settings and only approved device origins are stored with the resident host layout. Activation must match these saved source declarations. Changing requests requires new consent and synchronization; removing consent stops fetching and removes the stored source cache on the next sync. Reconnect the updated App/Studio once to refresh existing installations. The mixed-data-card example combines a device weather card with a host counter and button.
mixed-data-card
Widgets accept an optional style object. It overrides matching legacy top-level visual fields, applies only to that widget, and never changes its position, size, bindings, events, access or child widgets. Omit it to keep existing system control defaults/assets. The system-owned navigation header cannot be styled by a plugin.
style
[r,g,b,a]
borderWidth
borderColor
pressedFill
accentColor
selectedFill
selectedColor
trackColor
thumbColor
All colors are RGBA arrays. Fonts, fills, borders and corner radii work on native JSON controls; use normal widgets instead of drawing replacement controls as bitmaps. Switches retain the system 81×44 metrics and scale to fit the declared box. A styled switch uses native vector track/thumb parts so colors remain editable. Layout gap/padding remain top-level properties; no CSS, HTML, URLs, arbitrary fonts or scripts are accepted in style.
{ "id": "confirm", "type": "button", "x": 24, "y": 96, "w": 240, "h": 64, "label": "Confirm", "emit": "confirm", "style": { "fill": [24, 32, 64, 255], "color": [255, 255, 255, 255], "font": 24, "fontFace": "system-bold", "radius": 32, "borderWidth": 2, "borderColor": [80, 100, 240, 255], "pressedFill": [48, 64, 128, 255] } }
Compatibility: any style object requires widgets.style.v1 firmware. More than 256 combined primitives, hits, widgets and option slots requires projection.nodes2048.v1. Updated SDK/Studio/CLI/MCP validate up to 2048 combined nodes within 512 KiB of projection JSON; dynamic options still reserve 64 slots each, widget nesting stays at 8 and JSON depth at 16. Projection JSON has a separate 131072-value parsing budget so ordinary 2048-node layouts can pass; state/manifest retain their existing 8192-value and 64 KiB limits. A style-less package with at most 256 nodes requires neither new feature. Update Studio, consumer Desktop and firmware together; previews do not prove compatibility with an older physical Dock.
projection.nodes2048.v1
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.
action: {type: "navigate", page: "issues"}
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"}
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
read
plugin_read
viewRuntime
Explicit Host navigation may opt into ui.pageRequest: "navigation" with Host state navigation: {revision: 1, page: "issues"}. Increment the positive safe integer revision only for a new intent (such as a legacy knob or confirmed business flow), never for local navigation observations or routine data publications. Unchanged/stale intents do not reset local UI.
ui.pageRequest: "navigation"
navigation: {revision: 1, page: "issues"}
ctx.url.open(url, {signal?}) requires url.open in the manifest and a writable event. Only absolute HTTP/HTTPS URLs up to 2048 characters are allowed, without whitespace, control characters or credentials. Invalid URLs return invalid_url; cancelled requests return cancelled; unavailable OS browser handlers return unavailable. Calls are limited per installation to one per second and ten per rolling minute (overloaded); nothing is queued or retried. Only open a URL after an explicit user input. Preview/check validates and simulates without opening a browser. No Accessibility permission is required.
ctx.url.open(url, {signal?})
url.open
invalid_url
cancelled
ctx.hid.consumer('brightnessUp' | 'brightnessDown', {signal}) controls a compatible computer display, not the Dock backlight. Firmware must advertise each exact command. Steps follow the operating system; there is no percentage readback, fixed percent step, target-display selection or guarantee for external monitors. Use the event signal, handle unsupported/unknown results and never auto-retry an unknown outcome. Physical-Dock HID needs no macOS software input injection.
ctx.hid.consumer('brightnessUp' | 'brightnessDown', {signal})
ctx.desktop.open('screenSaver' | 'applications' | 'maps' | 'siri', {signal?}) opens a fixed macOS destination through a host-owned path; screenSaver starts the system ScreenSaverEngine. Declare desktop.open on the manifest and triggering event (write: true), and obtain a user grant. Only invoke after explicit user input. No plugin-supplied paths, arguments, custom schemes, scripts or shell commands are accepted. Other platforms return unsupported; invalid targets return invalid_target, unavailable destinations unavailable, rate limits overloaded, and aborted requests cancelled. Limits are one open per second and ten per rolling minute per installation, preserved across broker restarts; never retry automatically. Preview/check simulates success without launching. Success means OS acceptance, not completed UI loading. No Accessibility/Input Monitoring grant is needed. Starting a screen saver may engage the existing lock policy without changing it. CLI and both MCP servers share this SDK, sandbox and contract; no separate native-launch command is added.
ctx.desktop.open('screenSaver' | 'applications' | 'maps' | 'siri', {signal?})
screenSaver
desktop.open
invalid_target
applications opens /Applications, the compatible alternative to Launchpad on newer macOS.
applications
/Applications
maps opens Apple Maps at /System/Applications/Maps.app.
maps
/System/Applications/Maps.app
ctx.system.sleep({signal?}) requests computer sleep using the host's fixed system sleep command. Declare system.sleep in the manifest and the triggering event (write: true), and obtain its separate user grant; desktop.open does not authorize sleep. Call only after explicit user input. No arguments, paths, shell commands, power-setting changes, sudo, Accessibility or Input Monitoring grants are needed. Other platforms/hosts without an adapter return unsupported. If macOS denies sleep and read-only power settings confirm SleepDisabled = 1, the result is sleep_disabled; show guidance to check system/remote-control sleep settings, never change them for the plugin. Other rejected system requests return unavailable, a call within 30 seconds of the previous dispatch returns overloaded (per installation, across runtime restarts), and cancellation before dispatch returns cancelled. Once sent, cancellation cannot undo the request; a lost or timed-out outcome may be unknown. Never retry automatically. Success means the OS accepted the request, not proof of a completed sleep/wake cycle. Preview/check only simulates success. Keep a running Studio/Desktop host for live execution; CLI and both MCP servers expose this same SDK and simulated preview contract, without a new native system-control tool.
ctx.system.sleep({signal?})
system.sleep
SleepDisabled = 1
sleep_disabled
unknown
siri opens the system Siri launcher at /System/Applications/Siri.app with the existing desktop.open grant. Siri must already be enabled and available on the Mac. This does not enable Siri, change shortcuts, send a request, or guarantee that Siri is ready to listen. OS acceptance is not confirmation that its UI opened; show setup guidance if unavailable and never retry automatically. Preview/check simulates. Older hosts reject the new target as invalid_target; update the host before using it.
siri
/System/Applications/Siri.app
list and virtual collection widgets share device-side scroll operations. Local buttons and ui.knob execute without a Host round trip. A Host or a declared device data source can issue the same operation through Widget.scrollTo. No new permissions or Dock JavaScript are involved.
Widget.scrollTo
scrollTo
index
offset
edge: "start" / "end"
ensureVisible
scrollBy
items
followEnd
enabled: true / false
Item alignment is start, center, end, or nearest. Defaults are start for scrollTo and nearest for ensureVisible. Pixel offsets are logical device pixels, including virtual rows; do not use the renderer's compressed physical scrollbar travel. Numbers are integers bounded to ±1,000,000,000 (negative only for relative movement). Keys are stable string IDs for collections and string/number option values for ordinary lists; request string keys fit 512 UTF-8 bytes.
center
end
nearest
User scrolling away pauses following; returning to the end resumes it while following remains enabled. Selecting a row and moving the viewport are separate operations. Data updates do not imply selection or an automatic jump.
Declare ui: {version: 1, cachePages: 1} and put an action on a native button:
{"id":"today","type":"button","x":24,"y":384,"w":240,"h":64,"label":"Current item", "action":{"type":"ensureVisible","target":"agenda","key":"current","align":"center"}}
target must name a declared list or collection, including one on an unmounted page. An offscreen target retains only its latest local command and applies it when shown; it does not switch pages. Hidden/disabled controls cannot dispatch actions. Optional Host event notifications remain read-only and make the plugin Host-dependent.
target
Native rotary mapping lives in the projection, separately from manifest Host events:
{"ui":{"version":1,"cachePages":1,"knob":{ "ccw":{"type":"scrollBy","target":"agenda","items":-1}, "cw":{"type":"scrollBy","target":"agenda","items":1}, "press":{"type":"ensureVisible","target":"agenda","key":"current","align":"center"} }}}
Local mapping takes precedence for its direction. Existing manifest knob.*.emit events retain their Host behavior when there is no local mapping. Studio, CLI and website interactive previews use the same local mapping. plugin_event still dispatches declared Host events; a fixture check alone does not certify local rotary, gesture or standalone behavior.
knob.*.emit
Set scrollTo: "view.jump" on the list, then publish a complete schema-valid state containing an explicit request:
scrollTo: "view.jump"
await ctx.publish({ rows, view: { jump: { revision: ++jumpRevision, type: 'scrollTo', key: issueId, align: 'center' } } });
Increment a positive safe-integer revision only for a new intent. Ordinary publications retain the same request and never replay it. Malformed/stale requests are ignored. A valid request for a missing key is consumed as a no-op; issue a new revision after the item becomes available. Requests do not replay uncertain business writes or grant additional access.
revision
A literal request sets the initial position, for example scrollTo: {revision: 1, type: "followEnd", enabled: true}. It runs once per view, including before the first data arrives for following. Revisions, follow mode and positions survive page eviction and editor view checkpoints. Collections retain their stable-key anchor across reordering; ordinary lists retain their pixel offset. A fresh reopened view starts a new baseline; this is not durable storage across device restart.
scrollTo: {revision: 1, type: "followEnd", enabled: true}
A container with scroll: "y" accepts the same revisioned scrollTo binding or literal request. It supports scrollTo with logical pixel offset or edge, scrollBy with pixel offset, and followEnd; item keys, indexes, items and ensureVisible remain list/collection operations. Children retain their normal interactive controls and one continuous vertical scroll.
scroll: "y"
edge
For a calendar, publish {revision: 1, offset: Math.max(0, Math.round(nowLineY - viewportHeight / 2))} and bind the container's scrollTo to that object. Retain revision 1 during ordinary refreshes so manual scrolling and Back preserve the reading position. Increment only for an explicit return-to-now intent. A fresh view applies the initial intent again; the renderer clamps offsets at the content edges. This requires list.scroll.v1 firmware.
{revision: 1, offset: Math.max(0, Math.round(nowLineY - viewportHeight / 2))}
list.scroll.v1
A collection accepts exactly one data source: bind or static value. For example:
{"id":"agenda","type":"collection","x":24,"y":160,"w":806,"h":272, "value":[{"id":"current","title":"Current item"}],"itemKey":"id","rowHeight":72,"overscan":0, "children":[{"id":"title","type":"text","x":16,"y":16,"w":774,"h":40,"bind":"item.title"}]}
An opted-in local UI can run independently when all widget bindings use ui.*, declared sources.*, or item.* inside a collection template, and there are no Host events, permissions, streams or Host business-data bindings. Native execution never starts host.mjs. Static values must be actual packaged content, not fixture substitutes for unavailable live services.
sources.*
For device-fed lists use bind: "sources.feed.data.rows" and optionally scrollTo: "sources.feed.data.jump". Existing source consent, size/frequency limits and network restrictions still apply. A mixed Host plugin continues to require Host activation and its connection dialog; saved layouts do not change that boundary.
bind: "sources.feed.data.rows"
scrollTo: "sources.feed.data.jump"
Firmware must advertise list.scroll.v1, ui.knob.v1 when a local knob is declared, and widgets.native.v1 for independent widgets, in addition to existing UI/collection capabilities. Older firmware must report incompatible instead of dropping operations. See the bundled native-list example.
native-list
Test key/index/offset/edge alignment, a visible ensureVisible no-op, missing keys followed by later data, unchanged/stale requests, manual scroll followed by publication, page eviction, data reorder/append, follow pause/resume, large virtual lists, ordinary lists, rotary input and Host disconnection. Preserve a bounded row pool. Browser fallback screenshots apply the initial list position; interactive and native SDL checks remain separate from physical Dock latency and endurance tests.
Text primitives and text/button/select/list/radio/tabs/switch/checkbox/stepper/pagination widgets accept textAlign (left/center/right) and textVerticalAlign (top/center/bottom). widget.style overrides matching fields locally. select.optionTextStyle independently aligns popup captions, inheriting omitted fields. Existing defaults and primitive align remain compatible; explicit new fields require text.align.v1. Multiline text is measured inside existing caption bounds; overflow clips and oversized blocks start at the top. No added permissions or per-label container nodes. Use the documented fields instead of spaces, blank lines, line-height tricks or text bitmaps. See native text alignment.
textAlign
textVerticalAlign
widget.style
select.optionTextStyle
align
text.align.v1
Studio checks the connected Dock before installing, updating or opening a plugin. Diagnostics name missing capabilities (for example native text alignment, text.align.v1), unsupported data sources/streams and mismatched plugin contract or projection format. These are capability/protocol checks, not guesses based on the base-system firmware version. Update the component named in the message, reconnect, and retry. Known incompatibility stops the Studio run workflow before consent or runtime enablement; saving a checked draft locally remains available. A failed first-time installation is not marked installed; errors do not delete plugin settings or permissions.
plugin_list and plugin_runtime status expose optional deviceIssue: {code,message,details?} for each installation. details.missingFeatures retains identifiers for automation. Studio keeps the reason visible in the plugin page and marks its library entry incompatible or needing attention, including failures reported after an open acknowledgement. Reconnecting, replacing the package, or successfully retrying refreshes these diagnostics. A saved/uploaded plugin is not proof that the Dock opened it successfully. The Dock itself shows a cannot-run dialog for incompatible catalog entries instead of an indefinite Host-connection spinner.
deviceIssue: {code,message,details?}
details.missingFeatures
Preserve explicit device messages and measured resource limits. Do not blindly retry installation, change plugin permissions or rewrite working source to hide missing firmware capabilities. Desktop MCP reports the same reason in nextSteps. Standalone CLI/MCP check packages and fixtures locally; they do not install on a physical Dock and their tool arguments and permissions are unchanged.
nextSteps
Fixture checks enforce the same declared permissions, operation arguments, event permissions and event result schemas as live execution. Declare every capability used by activation and handlers even when sample data is available. Fixture adapters simulate side effects; passing a fixture check does not grant live access or verify hardware, third-party services or live rate budgets. No manifest, SDK signature, CLI command or MCP tool schema changes are required for these checks.
Package schemas use the bounded synchronous draft-07 dialect. The same strict admission policy runs before Node compilation and Workers interpretation; asynchronous validators are unsupported. Keep property types and required fields explicit, and use bounded tuples or ordinary arrays. Existing valid synchronous schemas and package identities remain compatible.
A full fork is an ordinary package with a distinct plugin ID. Optional PROVENANCE.json has format pexarbolt-provenance/1 and parent: {pluginId, name, version, packageHash, author?}. packageHash is the canonical source package-tree SHA-256 snapshot identity, not an archive checksum. The source ID must differ from the fork ID. Preserve this file, AUTHORS.json and license notices across checks and exports. Studio protects the fork identity and provenance in editing drafts. Fork creation copies package source/assets only; configurations, credentials, grants and private storage remain installation-owned. No runtime API or firmware capability is added.
PROVENANCE.json
pexarbolt-provenance/1
parent: {pluginId, name, version, packageHash, author?}
packageHash
Studio publishing identities scope local editing projects, including guest copies. Use Desktop plugin_edit_installed again after switching accounts; saving rechecks identity. Unpublished uploads remain account-owned. Identity stamps stay outside packages, runtime SDK capabilities and authoring MCP replies. Standalone CLI/MCP directory workflows remain account-independent.
plugin_edit_installed
Review submission requires at least one saved screenshot in Studio or on the website. Checks list every missing required listing field, screenshot and rights confirmation. Local package/export and screenshot tool contracts do not require a publishing account.
Stream image primitives can opt into fullscreenOnStream:true together with stream:true and fullscreen:true. Requires media.fullscreen.auto.v1. The first valid frame opens fullscreen once, covering navigation and controls; pause retains it. Hold for one second to exit, or press Escape in the browser preview. Taps do not exit. Manual exit lasts until the stream clears; clearing restores controls and rearms the next session. Static fallback artwork never triggers entry. No new permission or SDK method is added.
fullscreenOnStream:true
stream:true
fullscreen:true
media.fullscreen.auto.v1
Set streamSize:"fullscreen" on a fullscreen stream primitive to produce native display-sized frames (854x480 on the current Dock). Requires media.fullscreen.native.v1 and updated Studio/Simulator/Dock builds. The normal node stays inside the 854x408 content area; frames.start() returns full-display dimensions and createCanvas() follows them. Prepared native MJPEG supports a 55 fps ceiling, baseline JPEG 4:2:0, header validation and binary Bulk without software decoding or Base64. Device checksum/decoder checks remain in force; previews and explicit BGRA fallback decode on demand. The Host negotiates imageMaxBytes:1639680; omitted requests retain the legacy 1393728-byte image/binary limit. Native pacing follows completed acknowledgements without extra headroom; one transfer and one newest pending frame remain bounded. Frame submissions have a separate 60-per-second admission bucket; other SDK data requests retain 100 per second. There is no automatic source-resolution downgrade. Preserve window aspect ratio and prepare letterboxing on the Host.
streamSize:"fullscreen"
media.fullscreen.native.v1
frames.start()
createCanvas()
imageMaxBytes:1639680
Prepared binary MJPEG can negotiate videoStream.binaryChecksum:"crc32"; its metadata sets checksum:"crc32" and an eight-character lowercase hash. The Dock verifies CRC32 over the complete encoded frame before JPEG validation/decoding. SHA-256 remains the default for legacy paths and BGRA. Token, identity, epoch, active-view lease, sequence, dimension and allocation checks are unchanged. The checksum detects frame corruption; it is not an authentication credential.
videoStream.binaryChecksum:"crc32"
checksum:"crc32"
hash
For accelerated touch and pointer gestures use streamPointer with a declared event and media.pointer.v1. It emits bounded down/move/up/cancel source-pixel contexts in normal and fullscreen modes, preserving DMA; do not combine it with fullscreenTouch or animation. Native app control remains a separately enabled, OS-authorized local companion capability, never a sandbox input API. Use only the selected window, exclude letterbox hits, and release input on cancel/visibility/pause/lock/stop. Test on owned fixtures, not private applications.
Optional host.companion declares a separately installed Developer ID-signed, notarized macOS app, with exact bundle/team identity, protocol, minimum versions, architecture, numeric-loopback origin and optional enabled lifetime. See trusted native applications for the protocol, consent and lifecycle rules. This adds no shell/process API to ctx. User approval of the native component is separate from plugin network access and macOS recording/Accessibility permission. The host injects bootstrap authorization into matching ctx.http calls without exposing the credential to plugin code. Fixtures, CLI check and standalone MCP never execute native components; inspect/read report the declaration. Desktop MCP plugin_runtime component_status reads component readiness; prepare_component opens real trusted installation/consent UI. Studio local source remains a separate, explicitly approved development workflow with the original working directory.
host.companion
Advanced bindings require host.sdk: "1.1.0" and Dock capability knob.gestures.v1. Updated hosts continue to accept SDK 1.0 packages. Older hosts reject the new SDK version; updated hosts report incompatible firmware instead of silently dropping advanced input. No new permission is granted.
host.sdk: "1.1.0"
knob.gestures.v1
Use optional knob.doublePress, triplePress, longPress, heldCw and heldCcw beside existing press, cw, ccw. Each Host binding has {label, emit} and references a declared event. The same action keys are available in projection.ui.knob for restricted local actions. A local mapping takes precedence for that action; local-only bindings preserve native execution.
knob.doublePress
triplePress
longPress
heldCw
heldCcw
press
cw
ccw
{label, emit}
projection.ui.knob
{ "knob": { "label": "Adjust", "press": {"label": "Select", "emit": "select"}, "doublePress": {"label": "Next", "emit": "next"}, "longPress": {"label": "Reset", "emit": "reset"}, "heldCw": {"label": "Fine adjustment", "emit": "adjust"} } }
doublePress
{phase, delta, heldMs}
Held phases are start, update, end, cancel. The start includes the first detents; updates contain subsequent signed detents (positive clockwise, negative counterclockwise, magnitude at most 64). End/cancel contain zero. heldMs is an integer from 0 to 13000. Direction changes end the old action and start the new one. Every held event schema must accept all four phases. Perform adjustment only on start/update; termination releases held input without another adjustment. Local actions apply once per detent and consume end/cancel without applying the action.
update
cancel
heldMs
Only the active, interactable foreground plugin owns ordinary gestures. Declaring longPress or starting a declared held rotation captures the ordinary 3-second system menu for that press. The 5-second shutdown countdown, 8-second power-off arm and 13-second reset confirmation remain reserved. System modals and lock take priority. A plugin without a longPress binding retains the system default.
Rotation discards pending clicks. Long presses never also click. Leaving the plugin, changing its bindings, modal/system takeover, lock, disconnect or stop cancels active input; the current physical press must be released before a new owner accepts input. Do not replay gestures on reconnect. Existing three-action plugins retain their immediate release-click behavior. Plugins that drive authorized external input must also release it on view hide, abort and teardown: a transport disconnect cannot guarantee delivery of the final cancel event.
The editable fixture is packages/plugin-tools/test-fixtures/knob-gestures. It changes fixture state only. Import it into a source build of Studio, or use the built standalone tools:
packages/plugin-tools/test-fixtures/knob-gestures
bolt-plugin inspect packages/plugin-tools/test-fixtures/knob-gestures bolt-plugin check packages/plugin-tools/test-fixtures/knob-gestures bolt-plugin events packages/plugin-tools/test-fixtures/knob-gestures events.json
events.json is an ordered array, for example:
events.json
[ {"name":"doublePress","context":null}, {"name":"heldCw","context":{"phase":"start","delta":1,"heldMs":0}}, {"name":"heldCw","context":{"phase":"update","delta":2,"heldMs":100}}, {"name":"heldCw","context":{"phase":"cancel","delta":0,"heldMs":200}} ]
Standalone and Studio MCP use plugin_event with the same declared event name and context. Read knobGestures from plugin_read.context (standalone/API) or plugin_context (Studio/Codex). CLI help and both MCP instruction sets include the same SDK rules. Semantic preview buttons exercise handlers; physical recognition is tested by the shared native recognizer. The standalone native simulator accepts Return down/up, Left/Right while held, and pressing/dragging its product dial.
knobGestures
PEXAR_FIRMWARE_ROOT=/absolute/firmware-checkout node scripts/test-knob-gestures-native.mjs
This owned, headless fixture verifies raw timing, direction changes, system-reserved cancellation and rendered pixels without connecting a Dock or controlling another application. Real firmware input, lock/suspend and reconnect validation remain hardware checks. This source change does not deploy firmware, Studio or website artifacts.
Updated hosts support up to 128 installed Dock entries, negotiated against the device’s catalogCapacity. Older firmware can still be limited to 15. Existing wire, state, resident-storage and runtime limits remain separate. The computer library has no fixed plugin count. Use an updated host and native Simulator/Dock firmware together; a plugin update alone cannot raise the device capacity. See plugin-catalog-capacity.md in the packaged developer context.
catalogCapacity
plugin-catalog-capacity.md