This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index at /llms.txt, or add .md to any page's URL.

Open the same development URL on Apple hosts

Start bun host/web/dev.mjs and open a printed URL in your browser. Its build outputs belong to that app's loop and target. test web, verify web and automatic builds for agent web each use a temporary directory of their own, removed when the command exits; they can run beside the loop.
Build and launch the app's native client with that same address:
Terminal
bun host/apple/build.mjs --run --url http://127.0.0.1:8765/
bun host/apple/build.mjs --ios --run --url http://127.0.0.1:8765/
bun host/apple/build.mjs --device --run --url http://192.168.1.20:8765/
For a phone, replace the example with the server's reachable LAN or HTTPS URL. Device builds require a connected, provisioned phone. --url overrides EXACT_DEV_PLAN for this launch; it does not change the app's production origin. An external app uses these commands with EXACT_APP_DIR set as usual. Plans and assets reload through the native URL loader. Admitted TypeScript module clients reload logic on web/macOS/iOS/Linux/Android (bun exact.mjs android --run --url <url>); declared Rust modules reload on web/macOS/iOS/Linux using the executor selected below. Once built, an agent can drive the same URL with bun scripts/agent.mjs macos --url http://127.0.0.1:8765/ tree state logs (also web, ios, and linux; Linux polls the same URL after first pixel). The Go/custom-client sequence is in LLP 1030.000 §7.
An Apple client pins the native program the server names for its baked cohort and target: the binary of that target's build receipt while its inputs are unchanged. A web-only rebuild keeps the connection and carried state. Changed native binary inputs, or no receipt for the client's cohort, keep the last good generation on screen until the host is rebuilt and relaunched.
A native client finds a generation through its envelope, exact.json: a pointer card of at most 64 KiB that names the plan, and names the asset cards' file, assets.json, by URL, SHA-256, byte length and card count. The asset index holds one card per asset (name, URL, SHA-256, length) and the entry plans' plans map, at most 4 MiB, about 20,000 cards; its card URLs resolve against the index's own URL. The web build prints both sizes against their bounds with the asset count (exact.json 0.6 KiB of 64.0 KiB, assets.json 101.2 KiB of 4096.0 KiB for 537 assets). When publishing a stream, an oversized envelope reports its size, limit and largest field. An oversized asset index reports its size, limit and asset count. Every client checks the index against the envelope's card before it reads a card, and a signed head covers the index through its digest. A signed stream head also names the frozen cohort receipt by URL, SHA-256 and byte length.
Agent replies carry generation, epoch, incarnation and clock (LLP 1029.000.002 D10). generation starts at 1 and advances once for each committed replacement or reboot, including a return to an earlier plan. A refused candidate leaves it unchanged. The JS target carries it through its development document reload. epoch counts commits that change the kernel and continues across replacements. incarnation counts resets of one kernel; a replacement creates another kernel, so its incarnation can repeat. Use generation to wait for a replacement. The terminal's JSON inspection replies (layout, plan, runner-tree and node) carry these tags too.
state.replacement is null before a replacement while none waits. Afterwards it reports at, the replacement's clock in milliseconds, and dropped, the root slots that could not carry. pending names what a waiting replacement waits for (such as "composition", "pointer", "gesture", "module" or "requests"), or is null. Each entry has what: "state", name, and why: "no place" when the slot is gone, or "type changed" when its value does not fit the new declaration. The replacement's first journal line gives the same report.
A component outside a conditional, loop, or lazy tab panel keeps its state when a use of a different component is inserted above it. Uses of the same component under one parent are matched in source order. A parent element with a unique literal id keeps its place when reordered. Moving the component under a new parent starts fresh state.
When a native plan reloads, a virtualized list at the same source place opens at the row key and offset the reader last saw. If that key is gone, the list uses the next surviving key from the old window, then the previous one. It returns to the start if none survive. A reader at the start stays there, and a list following its end stays at the end.
The JS development reload restores reading anchors and focus, including a field's selection range and direction when its text matches. A field may regain focus after its resource answers; reader focus cancels pending focus and selection. Scrolling caused by reader input cancels only the axes that move, including an ancestor when scrolling chains into it. Records match by tree path and type, so structural edits can prevent a match. Pending records cross another reload with their remaining time. Restoration ends when every record has applied or been cancelled, when the page leaves, or after ten seconds. Autofocus stays suppressed until then, and the browser's history scroll-restoration setting returns to its prior value. Browser Undo history is lost when the document reloads.
Agent sessions use exactTime() launch facts seed: 1 (LLP 1069.007), locale: "en-US", timeZone: "UTC" and epochAtZero 2026-01-01T00:00:00Z (LLP 1027.000.000 D3, with the zone's utcOffset at that instant, answered again when the virtual date crosses a DST change) on every host. Override them at session setup with bun scripts/agent.mjs web --seed 42 --locale fr-CA --time-zone America/Toronto --epoch 2026-09-21T14:13:20Z tree (--format-locale en-KR gives formatLocale a Region of its own; unsaid, it is the locale) or open({host, seed: 42, locale: "fr-CA", timeZone: "America/Toronto", epoch: "2026-09-21T14:13:20Z"}); a test file writes them as launch lines (epoch "2026-09-21T14:13:20Z", time-zone "America/Toronto", authored tests), which override the flags.

Enlarge an iframe on macOS

On macOS, scale enlarges an iframe after WebKit lays out the guest. Use it to keep line breaks during a transform. Size the parent to reserve the space. A composited layer grows soft. In a window with 2× backing scale, the inner edge of a fixed outline had two intermediate pixels at 2× enlargement and four at 4×.
text
box width=(320 * z) height=(200 * z) overflow="hidden"
iframe "https://example.com/" width=320 height=200 scale=z transform-origin="0% 0%" border="none"
Use iframe "https://example.com/" width=320 height=200 zoom=z for sharp page zoom. The frame's own lengths grow by z. In a 320z × 200z point box on macOS 27.0.1, the layout viewport reported 320 CSS px at 1×, 2×, 2.74× and 4×. The outline had a one-device-pixel edge at every factor. WebKit lays text out again. A fluid paragraph took four lines at 1× and 2×, with a different last word on the first line at 2×. It took three lines at 2.74× and 4×. In the reporter's card the first line ended at “from” at 1× and “127.0.0.1.” at 2.74×. Reproduction
Use apple.magnification=z for a sharp view of a fixed-width page, or to inspect detail in a WebKit-backed frame. It applies WebKit's pinch scale from the top left. PDFKit handles local PDFs separately. A sandboxed remote frame keeps its sandbox wrapper, and magnification applies to that wrapper. A directly loaded page stays top-level and lays out at the width of the box. At 1×, 2× and 4×, the layout viewport of a 320z-point box was 320, 640 and 1280 CSS px wide. The visual viewport stayed 320 CSS px wide. The fluid paragraph took four, two and one lines. The guest can read visualViewport.scale.
To keep a page's 1× line breaks and draw its composited layers sharply, load an app-owned wrapper. The child below always lays out at 1440 × 900 CSS px.
text
iframe "https://example.com/wrapper.html" width=(1440 * z) height=(900 * z) apple.magnification=z border="none"
html
<!doctype html>
<style>
html, body { margin: 0; width: 1440px; height: 900px; overflow: hidden; scrollbar-width: none }
iframe { display: block; width: 1440px; height: 900px; border: 0 }
</style>
<iframe src="/page.html"></iframe>
<script>addEventListener("scroll", () => scrollTo(0, 0))</script>
The wrapper sizes html and body to the child's 1440 × 900 box so the document covers the frame at apple.magnification below 1, hides its own legacy scrollbars and returns to the origin if focusing content scrolls it. The child can see window !== window.top and must allow framing. In a Mac window the child kept all four lines and their endings at 1×, 2× and 4×. The fixed outline went from solid to white in one device pixel at 2× and 4×. The reporter measured a ceiling of 8192 device pixels across one composited layer. On a 2× display a 1440 CSS-pixel-wide layer reaches that ceiling near 2.84× enlargement. Canvas measurements
The Mac reapplies the authored factor after each main-frame load (including navigation and reload), each resize and each change of value. If apple.allowsMagnification=true, the person's pinch lasts until one of those events. Removing the value restores 1. The accepted range is 0.001 through 256 inclusive. A bad literal fails to build. A bad binding logs the refusal and leaves the view's last accepted factor in force. iOS and other hosts ignore the word.
On macOS the first displayed frame after a resize or zoom remains unknown to Exact. A WebKit snapshot completes when its image is ready, even in a hidden window. Apple’s snapshot API

Drive and attach to a running app

On the web (same-origin frames), macOS and iOS, tap live at 40 80 presses 40 points right and 80 down from the top left of the iframe named live. The driver converts that point to the guest viewport at its current scale. Use tap live {"x":20,"y":40} for guest viewport CSS pixels, or tap live {"selector":"#save"} to press an element. These taps report delivery: "synthetic". Guest listeners see event.isTrusted === false.
A drive can fail fetches by URL prefix (LLP 1103): --fail-fetch <prefix> (repeatable) arms one before the first data load, fail fetch <prefix> [times <n>] and pass fetch <prefix> arm and clear one mid-drive (a form of prefer: {"op":"prefer","faults":{"fail":…,"times":…}} or {…{"pass":…}}), and state.faults lists each prefix's times, left, hits and armed. Native carriers pass the launch table as EXACT_AGENT_FAIL_FETCH, one <prefix>[\t<times>] line a fault. Web carriers put only the marker ?failFetch=1 in the URL and install the table before page code, only in the top-level document on the original app origin. Child frames and pages on other origins receive no table. Carriers also send it as a base64 X-Exact-Faults header on the app origin's top-level document requests, so development render servers can apply it before fetching data. A marked render with a missing or invalid table returns 400 without fetching data. Fixture renders preserve unrelated answers and route statuses, and are not shared between requests. Production builds ignore these inputs. --fail-fetch with --test arms every test. A Mac agent drive never takes the focus: the app is an accessory, never activated (a type makes its window key without activating it), so AppKit draws its controls as in an inactive app. On the agent's clock its window, and a picture-in-picture panel it opens, sit one level below every other app's windows, so they never show over them; --timing platform and --live order them in front, since a covered window presents no frames and its page reads as hidden. --display <name|index> (EXACT_AGENT_DISPLAY, beside EXACT_AGENT=live, for a launch by hand) opens the window centred on one display, named as NSScreen.localizedName or by its index in NSScreen.screens; on a Mac someone is working at, name a display they are not using. A name no display has, or two have, is refused with the list. EXACT_AGENT_ACTIVATE=1, which only scripts/measure-controls.mjs sets (never a default), activates that one run, and the app that was in front is put back when it exits, however it exits (LLP 1121 stage 9 F2). A data module's crypto.getRandomValues() and crypto.randomUUID() draw from the seed too, so every drive with the same seed repeats the same identifiers: against a live backend that deduplicates on one, give each drive a seed of its own. A Rust data crate asks whether its draws are seeded with exact_data::crypto::seeded(&store); code that makes a key refuses while they are. The hosts keep a production bake out of agent mode; a development build, a release build under another trust, a terminal entry and an embedded session honour EXACT_AGENT=1. Seeds are whole numbers from 0 through 2^32 − 1, the range every host draws (LLP 1116.005 D5); an epoch is an ISO date, Unix milliseconds, or now: the machine's clock, read once by the driver at launch, for a drive against a live backend on real time (snapback4 dev). Native carriers pass EXACT_AGENT_SEED, EXACT_AGENT_LOCALE, EXACT_AGENT_TIME_ZONE and EXACT_AGENT_EPOCH (milliseconds), and EXACT_AGENT_FORMAT_LOCALE when given; direct agent launches can set these too. Web agent pages accept ?agent=1&seed=42&locale=fr-CA&timeZone=America/Toronto&epoch=1790000000000 (and &formatLocale=). agent alone, or agent= with its empty value, asks for agent mode as agent=1 does; any other value, agent=0 among them, asks for none, and a production build ignores the parameter (LLP 1069.007 D2). The driver supplies its own defaults unless an option (or open({env: ...})) overrides them. clock +N moves the date (epochAtZero + performanceNow()); state.time reports all five facts. Before the first host report, the runner also supplies usable en-US/UTC and seed 0. Ordinary launches draw their seed from secure platform entropy. A development reload retains that launch's seed. Linux takes its locale from the first nonempty LC_ALL, LC_MESSAGES, or LANG, and formatLocale from LC_TIME by POSIX's precedence (LC_ALL, then LC_TIME, then LANG; with none set, formatLocale is the locale), normalizes POSIX names to BCP 47 (C/POSIX use en-US), and reads the zone from TZ when it names a zoneinfo entry, otherwise the system's IANA zone (UTC fallback). Windows takes locale from the first preferred UI language and formatLocale from the user's regional format. A 12/24-hour choice that differs from that region's default adds -u-hc-h12 or -u-hc-h23 to formatLocale. It reads the system's IANA zone unless TZ names one. Windows settings and time-change notifications refresh these facts without changing the launch seed. Agent launches keep the drive's supplied facts.
A drive changes visibility with the prefer name/value pair visibility-state hidden ("prefer visibility-state hidden"), and returns with "prefer visibility-state visible". The hidden step commits page visibility and the runner's background fact. prefer frozen true separately commits exactPage().frozen and its defined transitions, such as stopping a transport sequence. Neither preference suspends the driven process. A later clock step still fires due timers, hatch frames and after callbacks, and replies and native-topic announcements keep the host's ordinary pumping. Use these facts to test authored reactions; qualify process suspension, coalesced delivery and waking on a real host outside the drive (LLP 1012 §1).
bun scripts/agent.mjs trace --pid <pid> --out snapshot.json asks a running development Mac or simulator app to save its trace without taking ownership of the process. The file includes tree, state, layout and observation. Tree and state read the runner directly, without guest DOM inspection or the carrier's drain; layout reads mounted host geometry. Each read is labelled passive. The frame ring ends before these observations, and their wall-clock bounds, clock mode, scheduling and substitutions are recorded. This path never seeks or settles the app.
A drive the driver launches starts in the app's first window, main. session <label> sends the ops after it to another window, by its name (a link's target, or window-<n> for one without a name), and session main comes back: "type root key Meta+," "session settings" tree "screenshot settings.png window". Each window has its own clock and journal, which the driver keeps apart. A label no window has is refused, naming the windows there are. The Mac routes by name and the sample hosts by their sessions' labels; a host with one window takes only main, and the web driver reads one tab.
bun scripts/agent.mjs macos --app <app> --attach [pid] tree state logs layout "screenshot now.png" reads the development Mac app a person already has open, with its own window, store and wall clock (LLP 1012.000). Nothing is built or launched. The person chooses Develop ▸ Enable Agent Attach in the app, then Allow in the sheet the driver's first connection raises; the window shows Agent Attached while the driver is connected. Detach Agent ends the connection and closes the listener until it is enabled again; quitting the app or closing the window ends it too. Each new connection asks again. One driver attaches at a time, to one window: --session <label> names the window when several are open, and a PID chooses among several running copies. The connection only reads: tree, state (masked, as the tree shows a password field), logs, layout, perf and screenshot (the window server's picture of the window, which is not brought forward). The app's clock is never taken, seeked, settled or landed: clock is refused with live-clock, except the waits, which watch the app's own wall clock through masked state reads while its timers go on. clock until state <path> == <literal> within <ms> refuses a value a password field masks; clock held [<target>…] [<n>s|<n>ms] waits for one reply to each held request; clock replies [<n>s|<n>ms] reports {clock, settled, pending, waitedMs} at the first read with no data request in flight (held, timer and device entries aside), or after 20 s. A read still out at a wait's deadline ends the connection. The driver refuses launch flags such as --storage, --live and --url.
Input needs a second grant: Develop ▸ Allow Agent Input on the Mac, or the developer menu's Allow Agent Input in the simulator, which the person chooses while the agent is attached (the indicator then reads Agent Attached · Input Allowed); choosing it again revokes input and leaves the reads. Until then tap, type and call are refused input-not-granted, and the driver says it is waiting for the grant, for up to 60 s. Granted, tap <target> is a plain tap at a test ID or #<id>, type <target> <text> a whole text entry, and call <tool> <json> a declared tool's call through the app's own agent door (--door is refused). On the Mac the app clicks and sets the text itself, only in its key window while it is the active app; in the simulator the touch runner plays a real touch the app aims and checks, and the text is typed where the tap left the caret. Input is refused background when the app is not in front, person-input while a person's finger, mouse button or modifier key is down, and unsupported for anything else: a point, a held contact, a key, a gesture, prefer, pick, a toolbar or sidebar item, or a web view's content. A request whose reply is lost is reported as of unknown outcome and never sent again.
bun scripts/agent.mjs ios --app <app> --attach [--sim <udid|name>] tree state logs layout "screenshot now.png" reads the development app open in an iOS simulator the same way. The simulator is the one --sim or EXACT_SIM names, else the one a drive would choose; nothing is booted. The person opens the developer menu (four fingers, or ⌘D) and chooses Enable Agent Attach, then Allow in the alert the driver's connection raises; Agent Attached shows at the top of the screen while the driver is connected. Detach Agent in the same menu ends it, and so does sending the app to the background. The picture is UIKit's snapshot of the app's window, without the indicator. The driver names a simulator that runs the app when the selected one does not.
bun scripts/agent.mjs web --app <app> --attach tree state logs layout reads a tab of the app's running JS-target dev loop (bun exact.mjs web) the same way, in the person's own browser. The person presses ⌥⇧A in the tab, which shows a pairing code that works once, for two minutes; the driver asks for it on a terminal, or reads the first line of stdin (… --attach tree < code.txt, or piped), and presents it on the loop's attach channel; then the tab asks the person to Allow. Agent Attached shows in the tab's corner while the driver is connected; Detach, ⌥⇧A again, a reload, loading another page or closing the tab ends it, and a code from before a reload is refused. The channel takes only a connection from this machine naming the loop by a loopback name, and no browser page. A tab is only read: it cannot take its own picture, and nothing a page does is a person's input, so screenshot, tap, type and call are refused unsupported. A tab the driver opened (?agent), a game's wasm loop and a release build have no attach.
Only a Mac app or an iOS simulator app that host/apple/build.mjs builds to run carries the listener; a release, archive, embedded, physical-device or Apple TV build has none of it, and the driver refuses Android, Windows, Linux, tvOS, watchOS and a physical iPhone before it runs any platform tool.

Inspect work and native presentation

On macOS, iOS and tvOS, sample <x> <y> [<x> <y>…] settles the page at the current clock and reads the backing pixel under each viewport point. It returns unpremultiplied, extended linear sRGB. A GPU canvas contributes its presented frame. An iframe or a snapshot-capable native view supplies its guest picture. Other Metal and OpenGL layers need a snapshot from their owner. Video contributes the displayed frame when the player makes it readable. Playing or protected video can withhold its frame, and a live camera preview exposes no displayed buffer. On macOS, native glass (NSGlassEffectView) has no CPU pixels, so its content composites over an unavailable backdrop: opaque content samples normally while bare or translucent glass pixels refuse. Inside a glass group (NSGlassEffectContainerView), direct glass members composite above ordinary group siblings and potential merge bridges within spacing refuse conservatively. If a point needs missing pixels, the reply names the node and the reason. An opaque cover can still be sampled. On iOS, where Core Animation's layer renderer clips a gradient's extended-range colors and leaves box shadows out, the host draws both itself, so a sample reads them as the screen shows them.
On iOS and the JS web target, check and verify count the part of -exact-hit-slop that accepts a press. A clip cuts that region, and a front control takes the overlap. A target finding gives both the tap area and the drawn box.
perf <target> during "<operation>" reports the work that operation caused in the named subtree. Development measurements include virtual-row construction, rebinding and retirement; Apple also counts kernel layout API calls and native host work. Read the reported scope and measurement start: process-wide native counts can include other sessions, and a reset makes a delta unavailable. Missing coverage is not a zero.
On Apple, "perf frames live 500" observes display-link callbacks for 500 ms without advancing or changing the current clock. Its reply identifies scheduling, substitutions and dropped records. An ordinary launch on the wall clock is available on macOS and iOS with bun scripts/agent.mjs macos --live --storage latency "tap change-station" "type station-search Palo" state (use ios --live on a simulator or ios --device --live on a phone). The driver launches and closes this process and keeps input available. --live uses normal scheduling and the wall clock: performanceNow() and timers advance in real time between operations, and perf frames records real frames. On macOS the window opens in front without taking the focus; --display puts it on a display other than the one being worked at. On iOS, --touch platform sends the gesture through XCTest so UIKit delivers the scroll callbacks. For example, bun exact.mjs agent ios --device --live --touch platform "tap s drag 0 -300 over 100" "perf frames health scroll" drags the scroll view named s on a phone. Unlock the paired phone, enable Developer Mode and UI Automation, and allow local network access if prompted. The Mac needs an Apple Development identity and a provisioning profile covering the phone and com.exact.touches.xctrunner. On the wall clock use perf frames live <ms> to observe an interval. --storage chooses the drive's scratch store. Set EXACT_STORE=real in the launch environment to use the app's real secret and preference stores and secret presence. App files still follow the drive's scratch-store setting (--storage) and are unavailable when no scratch store is configured. state.storage and the observation's store describe those app files. state.observation reports clock mode, scheduling and substitutions. --timing platform alone keeps agent execution substitutions. A substituted run does not establish production-equivalent performance, and callback timing does not prove compositor presentation. layout distinguishes target and presented geometry; an unavailable presentation remains explicit.
On Android, bun scripts/agent.mjs android --live drives the reader APK on platform time with layer playback enabled. clock and screenshot … over … every … are refused. See Driving the reader for the recording command.
Is this helpful
Last updated November 30, 2026
Exact Docs