Artifacts browser
The shared browser page, agent operations, restrictions and the app preview.
Artifacts is the browser panel of a thread. In the desktop app it is a real browser page that you and the agent share: the agent drives it with the
pi_browser tool while you watch, click and inspect. Each thread has its own page and in-memory session.Open a page#
- Start your project's dev server. For a worktree thread, start it from the worktree, on a free port.
- Open Artifacts from the side-panel buttons. Narrow windows show a Preview button instead.
- Enter the address, for example
http://localhost:3000, and choose Go.
Drag the separator to resize the page. Expand fills the window; Shrink docks it again. The page and its session survive both.
Video walkthrough · English captions
Inspect a web project
Open the fictional Orbit Board in Artifacts, inspect its Science filter, attach a screenshot to an unsent draft, and test the filter in the same browser.
Let the agent use it#
pi_browser can:- navigate, go back and forward, reload and close the page;
- take an accessibility snapshot with references to elements;
- click, fill inputs, press keys and scroll;
- inspect an element, including its computed styles;
- take viewport, full-page and element screenshots;
- read and clear console messages and runtime errors;
- run JavaScript in the page.
Open localhost:3000 in Artifacts. Go to Settings and submit the empty form. Check the validation messages, take a screenshot and report console errors.
Element references belong to the latest snapshot; after navigation the agent takes a new one. Screenshots need a model that accepts images. Agent calls do not open the panel by themselves.
Page lifetime#
- Closing the panel keeps the page. Close page releases it.
- Sessions live in memory for as long as the window is open. They are not saved browser profiles.
- Up to eight pages stay open. When the limit is reached, an idle hidden page can be closed, and its unsaved state is lost.
Restrictions#
- Only
http:andhttps:pages. pi-kit's own origins and schemes such asfile:are blocked, including through redirects. - Pages have no Node.js and no access to pi-kit. Permission requests and downloads are denied; pop-ups open in the same page.
- Self-signed certificates on a local server need Options → Allow invalid HTTPS certificates on localhost. It covers
localhost,127.0.0.0/8and::1only, and changing it closes all pages.
Page text, DOM and console output are untrusted input for the agent. The browser's isolation does not limit the agent's other tools.
In a browser or on a phone#
When you use pi-kit in a browser (
pi-kit open --browser) or on a paired phone, Artifacts shows an app preview in an iframe instead. It is your own session on that device; the agent cannot drive it.| Control | Does |
|---|---|
| Address, Reload | Load and reload the preview. |
| Open externally | Open the address in a new tab. Use it when the app forbids framing or its sign-in fails in a frame. |
| Unload preview | Release the frame and its state. |
| Upload screenshot | Add an image you captured to the unsent draft. |
Only exact origins listed in
PI_KIT_PREVIEW_ORIGINS can be framed. Set it in the service host's environment and restart the host; the default is none.PI_KIT_PREVIEW_ORIGINS=https://preview.example.com pi-kit serve
pi-kit does not proxy dev servers:
localhost on a phone is the phone. Use an HTTPS deployment or a tunnel. The agent can publish a preview link with the pi_preview tool; the first time, pi-kit asks whether previews should open automatically (Always open, Not now, Never). Change it later with Open previews automatically at the bottom of the panel.Attach page context#
Inspect, Screenshot and Console add context to your draft without sending it. See Screenshots, inspection and logs.