Use Pi terminal UI in xterm.js with browser-local model and tools
Browse filesFiles changed (41)
- README.md+1-1
- SPACE_README.md+1-1
- app/README.md+11-3
- app/index.html+3-10
- app/package-lock.json+95-5
- app/package.json+7-1
- app/scripts/licenses.mjs+1
- app/scripts/pi-browser.mjsAdded+31
- app/src/main.mjs+20-42
- app/src/pi/browser-host.mjsAdded+8
- app/src/pi/capabilities.mjsAdded+25
- app/src/pi/entry.mjsAdded+17
- app/src/pi/terminal-ui.mjsAdded+216
- app/src/pi/theme.mjsAdded+31
- app/src/pi/xterm-terminal.mjsAdded+31
- app/src/style.css+11-36
- app/tests/browser.mjs+15-5
- app/tests/space-embedded.mjs+2-1
- app/tests/terminal.mjsAdded+104
- app/vendor/pi-coding-agent/LICENSEAdded+21
- app/vendor/pi-coding-agent/README.mdAdded+21
- app/vendor/pi-coding-agent/components/assistant-message.jsAdded+158
- app/vendor/pi-coding-agent/components/custom-editor.jsAdded+115
- app/vendor/pi-coding-agent/components/markdown-transform.jsAdded+19
- app/vendor/pi-coding-agent/components/user-message.jsAdded+49
- app/vendor/pi-coding-agent/provenance.jsonAdded+12
- app/vendor/pi-coding-agent/theme/light.jsonAdded+90
- app/vite.config.mjs+3-1
- assets/index-BRKUEVCq.jsAdded
- assets/index-Cfkr7NLu.cssDeleted-1
- assets/index-DL-Ot0hN.cssAdded+1
- assets/index-LA8xezhP.jsDeleted
- deployment-manifest.json+118-38
- index.html+5-12
- licenses/dependencies.txt+342-1
- licenses/pi-components.jsonAdded+12
- research/browser-agent/REPORT.md+20-1
- scripts/prepare_space.py+2-1
- validation/agent-terminal-dev.jsonAdded+157
- validation/agent-terminal-model.jsonAdded+1885
- validation/agent-terminal.jsonAdded+39
32 unmodified lines3334353637383932 unmodified linesTry: **Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.**Pi has `bash`, `read`, `write`, and `edit` tools. just-bash supports shell scripts, pipes, redirects, `awk`, `jq`, `sed`, `grep`, and other text commands. Node.js, Python, npm, native binaries, SQLite, and network commands are unavailable. This embeds Pi's Agent with browser tools; it does not run Pi's Node-based terminal CLI. Files are virtual and remain on your device. Export work you want to keep.Source and run instructions: [app/README.md](app/README.md). Architecture and primary-source research: [investigation](research/browser-agent/REPORT.md).32 unmodified lines3334353637383932 unmodified linesTry: **Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.**Pi has `bash`, `read`, `write`, and `edit` tools. just-bash supports shell scripts, pipes, redirects, `awk`, `jq`, `sed`, `grep`, and other text commands. Node.js, Python, npm, native binaries, SQLite, and network commands are unavailable. The left column uses xterm.js with Pi's actual terminal renderer, editor, and message components. MiniCPM and the tools run in the browser worker. This reuses Pi's TUI; the full Node CLI and its extensions are not included. Files are virtual and remain on your device. Export work you want to keep.Source and run instructions: [app/README.md](app/README.md). Architecture and primary-source research: [investigation](research/browser-agent/REPORT.md).
32 unmodified lines3334353637383932 unmodified linesTry: **Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.**Pi has `bash`, `read`, `write`, and `edit` tools. just-bash supports shell scripts, pipes, redirects, `awk`, `jq`, `sed`, `grep`, and other text commands. Node.js, Python, npm, native binaries, SQLite, and network commands are unavailable. This embeds Pi's Agent with browser tools; it does not run Pi's Node-based terminal CLI. Files are virtual and remain on your device. Export work you want to keep.Source and run instructions: [app/README.md](app/README.md). Architecture and primary-source research: [investigation](research/browser-agent/REPORT.md).32 unmodified lines3334353637383932 unmodified linesTry: **Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.**Pi has `bash`, `read`, `write`, and `edit` tools. just-bash supports shell scripts, pipes, redirects, `awk`, `jq`, `sed`, `grep`, and other text commands. Node.js, Python, npm, native binaries, SQLite, and network commands are unavailable. The left column uses xterm.js with Pi's actual terminal renderer, editor, and message components. MiniCPM and the tools run in the browser worker. This reuses Pi's TUI; the full Node CLI and its extensions are not included. Files are virtual and remain on your device. Export work you want to keep.Source and run instructions: [app/README.md](app/README.md). Architecture and primary-source research: [investigation](research/browser-agent/REPORT.md).
1234568 unmodified lines1516171819206 unmodified lines272829303132336 unmodified lines404142434445464748495027 unmodified lines787980818283# Pi in the browserA static web app running **the real Pi Agent**, **just-bash**, and **our verified MiniCPM5-2B q4f16 conversion** in the browser. A dedicated worker owns the agent loop, WebGPU inference, and virtual shell. No inference API, API key, shell server, or Pi RPC server is involved.```shcd app8 unmodified lines## Features- Streaming conversation with genuine `@earendil-works/pi-agent-core` tool execution and automatic follow-up turns.- `bash`, `read`, `write`, and exact-match `edit` tools connected to the same just-bash filesystem.- File editor, text-file import, workspace export, and an interactive command entry.6 unmodified lines## Runtime boundariesThis uses Pi's actual agent core with a custom local inference stream and browser tools. Pi's Node-based terminal CLI, host filesystem, OAuth providers, extensions, package installation, and RPC server are not included. The agent runs locally in a browser worker, rather than controlling a remote Pi process.just-bash is a simulated shell, not a Linux VM. Shell scripts, pipes, redirects, `awk`, `jq`, `sed`, `grep`, `find`, and other supported text commands execute in JavaScript. Node.js, Python, npm, native executables, SQLite, and network commands are unavailable. The installed browser bundle also excludes working gzip/zlib commands. Shell cwd and variables reset between commands; filesystem changes persist. Commands have a 10-second deadline, 3,000-command cap, 16 MiB filesystem budget, and 256 KiB output budget. Tool output passed to the model is capped at 6,000 characters.6 unmodified lines```shnpm testnpm run build# Start npm run preview -- --port 4173 and the root static model server first:npm run test:browser```The browser suite uses real Chromium, the actual model, and the production bundle. It disables networking while Pi reads a random value from an unseen file, calculates CSV revenue, writes and verifies a report, creates and executes a shell script, edits it, and recovers from a missing-file tool error. It also checks stopping generation, file import/edit/save, manual shell execution, workspace persistence, cached reloads, and a 390 px layout.To exercise the public Hugging Face download in a separate browser profile:27 unmodified lines| Component | Version / revision ||---|---|| Pi agent core and Pi AI types/event stream | `@earendil-works/*` 0.85.1 || just-bash | 3.4.2, explicit `just-bash/browser` import || Transformers.js | 4.2.0 || Model | `Mike0021/MiniCPM5-2B-ONNX` at `04a6c49fcba3a65a0351c92644c3a7e9d4343059` |1234568 unmodified lines15161718192021226 unmodified lines2930313233343536376 unmodified lines4445464748495051525354555627 unmodified lines8485868788899091# Pi in the browserA static web app running **Piβs actual terminal UI in xterm.js**, **the real Pi Agent**, **just-bash**, and **our verified MiniCPM5-2B q4f16 conversion** in the browser. A dedicated worker owns the agent loop, WebGPU inference, and virtual shell. No inference API, API key, shell server, or Pi RPC server is involved.```shcd app8 unmodified lines## Features- Piβs upstream fullscreen renderer, multiline editor, user/assistant message components, Markdown, prompt history, and autocomplete. xterm.js renders their ANSI output.- `/load`, `/help`, `/new`, and `!command` browser commands. Enter sends, Shift+Enter inserts a newline, Escape/Ctrl+C stops, Ctrl+O expands tools. Ctrl+P/N recalls prompts; Ctrl+Shift+F searches the transcript. The Send and Newline buttons also support touch input.- Streaming conversation with genuine `@earendil-works/pi-agent-core` tool execution and automatic follow-up turns.- `bash`, `read`, `write`, and exact-match `edit` tools connected to the same just-bash filesystem.- File editor, text-file import, workspace export, and an interactive command entry.6 unmodified lines## Runtime boundariesThis uses Pi's actual TUI and agent core with browser host adapters. The npm `pi-tui` package supplies the renderer, editor, input parser, layout, Markdown, search, and keybindings. Unmodified CLI presentation components are in [vendor/pi-coding-agent](vendor/pi-coding-agent/README.md), with provenance checksums and the upstream light palette. [The build adapter](scripts/pi-browser.mjs) replaces terminal host services; [the terminal adapter](src/pi/xterm-terminal.mjs) connects xterm input/output/resize to Pi. Browser command dispatch and just-bash tool cards are app code.The full Node CLI, host filesystem, OAuth providers, extensions, package installation, and RPC server are not included. xterm.js is the terminal emulator; it does not add Node.js or a native shell. Model inference and tool execution remain in the browser worker. Terminal control sequences from model/file output are stripped before rendering, and Markdown images do not trigger downloads.just-bash is a simulated shell, not a Linux VM. Shell scripts, pipes, redirects, `awk`, `jq`, `sed`, `grep`, `find`, and other supported text commands execute in JavaScript. Node.js, Python, npm, native executables, SQLite, and network commands are unavailable. The installed browser bundle also excludes working gzip/zlib commands. Shell cwd and variables reset between commands; filesystem changes persist. Commands have a 10-second deadline, 3,000-command cap, 16 MiB filesystem budget, and 256 KiB output budget. Tool output passed to the model is capped at 6,000 characters.6 unmodified lines```shnpm testnpm run build# Start npm run preview, then run the terminal checks (no model needed):node tests/terminal.mjs# Start npm run preview -- --port 4173 and the root static model server first:npm run test:browser```The terminal suite checks real keyboard events, multiline editing, autocomplete, history, Unicode and large clipboard pastes, shell execution, and live resize. The browser suite uses real Chromium, the actual model, and the production bundle; prompts are submitted through xterm and Piβs editor. It disables networking while Pi reads a random value from an unseen file, calculates CSV revenue, writes and verifies a report, creates and executes a shell script, edits it, and recovers from a missing-file tool error. It also checks stopping generation, file import/edit/save, manual shell execution, workspace persistence, cached reloads, and a 390 px layout.To exercise the public Hugging Face download in a separate browser profile:27 unmodified lines| Component | Version / revision ||---|---|| Pi agent core and Pi AI types/event stream | `@earendil-works/*` 0.85.1 || Pi TUI / CLI presentation components | 0.85.1 || xterm.js / fit addon | 6.0.0 / 0.11.0 || just-bash | 3.4.2, explicit `just-bash/browser` import || Transformers.js | 4.2.0 || Model | `Mike0021/MiniCPM5-2B-ONNX` at `04a6c49fcba3a65a0351c92644c3a7e9d4343059` |
19 unmodified lines202122232425262728293031323334353619 unmodified lines<div id="load-detail" class="muted"></div><a id="open-tab" class="button" target="_blank" rel="noopener noreferrer" hidden>Open workspace in a new tab β</a></div><div id="messages" role="log" aria-label="Messages" aria-live="polite"><div id="welcome"><div class="eyebrow">A small agent. A real workspace.</div><h1>What shall we work on?</h1><p>Chat with Pi, work with files, and run shell commands.<br>The model and every tool run here, in your browser.</p><div class="suggestions"><button data-prompt="Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.">Analyze the sample data <span>β</span></button><button data-prompt="Create a bash script called hello.sh that prints Hello from the browser, run it, and report the output.">Write and run a script <span>β</span></button></div></div></div><div id="notice" role="status" hidden></div><form id="chat-form"><label class="sr-only" for="prompt">Message Pi</label><textarea id="prompt" rows="3" placeholder="Ask Pi to work on somethingβ¦"></textarea><div class="composer-footer"><span id="activity">Files and chat are saved on this device.</span><button id="stop" type="button" hidden>Stop</button><button id="send" class="primary" disabled>Send β</button></div></form><footer>Pi agent core Β· just-bash Β· Transformers.js <span>4,096 token context</span></footer></section><aside class="workspace" aria-label="Workspace"><div class="workspace-heading"><h2>Workspace</h2><div><button id="add-file" class="quiet">+ File</button><label class="button quiet" for="upload">Import</label><input id="upload" type="file" multiple hidden><button id="export" class="quiet">Export</button></div></div>19 unmodified lines2021222324252627282919 unmodified lines<div id="load-detail" class="muted"></div><a id="open-tab" class="button" target="_blank" rel="noopener noreferrer" hidden>Open workspace in a new tab β</a></div><div id="pi-terminal" aria-label="Pi terminal"></div><div id="notice" role="status" hidden></div><div class="terminal-controls"><span id="activity" role="status">Files and chat are saved on this device.</span><button id="newline" type="button" title="Insert a newline (Shift+Enter)">β΅ Newline</button><button id="stop" type="button" hidden>Stop</button><button id="send" class="primary">Send β</button></div><footer>Pi TUI Β· xterm.js <span>Model and tools run in your browser</span></footer></section><aside class="workspace" aria-label="Workspace"><div class="workspace-heading"><h2>Workspace</h2><div><button id="add-file" class="quiet">+ File</button><label class="button quiet" for="upload">Import</label><input id="upload" type="file" multiple hidden><button id="export" class="quiet">Export</button></div></div>
9 unmodified lines1011121314151617538 unmodified lines5565575585595605611579 unmodified lines21412142214321442145214690 unmodified lines22372238223922402241224220 unmodified lines2263226422652266226722682269227022719 unmodified lines2281228222832284228522862287228822892290236 unmodified lines252725282529253025312532182 unmodified lines271527162717271827192720588 unmodified lines3309331033113312331333149 unmodified lines"dependencies": {"@earendil-works/pi-agent-core": "0.85.1","@earendil-works/pi-ai": "0.85.1","@huggingface/transformers": "4.2.0","@xmldom/xmldom": "0.9.12","hash-wasm": "4.12.0","just-bash": "3.4.2","markdown-it": "15.0.2"538 unmodified lines"node": ">=22.19.0"}},"node_modules/@emnapi/runtime": {"version": "1.11.3","resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",1579 unmodified lines"node": ">=14.6"}},"node_modules/adm-zip": {"version": "0.5.18","resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.18.tgz",90 unmodified lines"readable-stream": "^3.4.0"}},"node_modules/boolean": {"version": "3.2.0","resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",20 unmodified lines}},"node_modules/buffer": {"version": "5.7.1","resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz","integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==","funding": [{"type": "github",9 unmodified lines}],"license": "MIT","optional": true,"dependencies": {"base64-js": "^1.3.1","ieee754": "^1.1.13"}},"node_modules/buffer-equal-constant-time": {236 unmodified lines"url": "https://github.com/sponsors/sindresorhus"}},"node_modules/expand-template": {"version": "2.0.3","resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",182 unmodified lines"node": ">=18"}},"node_modules/github-from-package": {"version": "0.0.0","resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",588 unmodified lines"markdown-it": "bin/markdown-it.mjs"}},"node_modules/matcher": {"version": "3.0.0","resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",9 unmodified lines10111213141516171819202122538 unmodified lines5615625635645655665675685695705715725735745755765775785791579 unmodified lines21592160216121622163216421652166216721682169217021712172217321742175217621772178217990 unmodified lines227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230020 unmodified lines2321232223232324232523262327232823299 unmodified lines233923402341234223432344234523462347236 unmodified lines258425852586258725882589259025912592259325942595259625972598182 unmodified lines278127822783278427852786278727882789279027912792279327942795279627972798588 unmodified lines3387338833893390339133923393339433953396339733983399340034013402340334049 unmodified lines"dependencies": {"@earendil-works/pi-agent-core": "0.85.1","@earendil-works/pi-ai": "0.85.1","@earendil-works/pi-tui": "0.85.1","@huggingface/transformers": "4.2.0","@xmldom/xmldom": "0.9.12","@xterm/addon-fit": "0.11.0","@xterm/xterm": "6.0.0","buffer": "6.0.3","events": "3.3.0","hash-wasm": "4.12.0","just-bash": "3.4.2","markdown-it": "15.0.2"538 unmodified lines"node": ">=22.19.0"}},"node_modules/@earendil-works/pi-tui": {"version": "0.85.1","resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.85.1.tgz","integrity": "sha512-OIzw9efInmO4WOBnD4TxcTdBjmzvYJpzslkgoUro946nEGoYWg5rwv1p4fDt3/JvMx9QybryUCUwlm7j8Dreig==","license": "MIT","dependencies": {"get-east-asian-width": "1.6.0","marked": "18.0.5"},"engines": {"node": ">=22.19.0"}},"node_modules/@emnapi/runtime": {"version": "1.11.3","resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",1579 unmodified lines"node": ">=14.6"}},"node_modules/@xterm/addon-fit": {"version": "0.11.0","resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz","integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==","license": "MIT"},"node_modules/@xterm/xterm": {"version": "6.0.0","resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz","integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==","license": "MIT","workspaces": ["addons/*"]},"node_modules/adm-zip": {"version": "0.5.18","resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.18.tgz",90 unmodified lines"readable-stream": "^3.4.0"}},"node_modules/bl/node_modules/buffer": {"version": "5.7.1","resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz","integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==","funding": [{"type": "github","url": "https://github.com/sponsors/feross"},{"type": "patreon","url": "https://www.patreon.com/feross"},{"type": "consulting","url": "https://feross.org/support"}],"license": "MIT","optional": true,"dependencies": {"base64-js": "^1.3.1","ieee754": "^1.1.13"}},"node_modules/boolean": {"version": "3.2.0","resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",20 unmodified lines}},"node_modules/buffer": {"version": "6.0.3","resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz","integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==","funding": [{"type": "github",9 unmodified lines}],"license": "MIT","dependencies": {"base64-js": "^1.3.1","ieee754": "^1.2.1"}},"node_modules/buffer-equal-constant-time": {236 unmodified lines"url": "https://github.com/sponsors/sindresorhus"}},"node_modules/events": {"version": "3.3.0","resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz","integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==","license": "MIT","engines": {"node": ">=0.8.x"}},"node_modules/expand-template": {"version": "2.0.3","resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",182 unmodified lines"node": ">=18"}},"node_modules/get-east-asian-width": {"version": "1.6.0","resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz","integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==","license": "MIT","engines": {"node": ">=18"},"funding": {"url": "https://github.com/sponsors/sindresorhus"}},"node_modules/github-from-package": {"version": "0.0.0","resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",588 unmodified lines"markdown-it": "bin/markdown-it.mjs"}},"node_modules/marked": {"version": "18.0.5","resolved": "https://registry.npmjs.org/marked/-/marked-18.0.5.tgz","integrity": "sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w==","license": "MIT","bin": {"marked": "bin/marked.js"},"engines": {"node": ">= 20"}},"node_modules/matcher": {"version": "3.0.0","resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
7 unmodified lines8910111213141516171819207 unmodified lines"build": "vite build","preview": "vite preview --host 127.0.0.1","test": "node --test tests/*.test.mjs","test:browser": "node tests/browser.mjs"},"dependencies": {"@earendil-works/pi-agent-core": "0.85.1","@earendil-works/pi-ai": "0.85.1","@huggingface/transformers": "4.2.0","@xmldom/xmldom": "0.9.12","hash-wasm": "4.12.0","just-bash": "3.4.2","markdown-it": "15.0.2"7 unmodified lines8910111213141516171819202122232425267 unmodified lines"build": "vite build","preview": "vite preview --host 127.0.0.1","test": "node --test tests/*.test.mjs","test:browser": "node tests/browser.mjs","test:terminal": "node tests/terminal.mjs"},"dependencies": {"@earendil-works/pi-agent-core": "0.85.1","@earendil-works/pi-ai": "0.85.1","@earendil-works/pi-tui": "0.85.1","@huggingface/transformers": "4.2.0","@xmldom/xmldom": "0.9.12","@xterm/addon-fit": "0.11.0","@xterm/xterm": "6.0.0","buffer": "6.0.3","events": "3.3.0","hash-wasm": "4.12.0","just-bash": "3.4.2","markdown-it": "15.0.2"
22 unmodified lines2324252622 unmodified linesawait scan('node_modules');await mkdir('dist/licenses', { recursive: true });await writeFile('dist/licenses/dependencies.txt', notices.sort().join('\n----------------------------------------\n\n'));}22 unmodified lines232425262722 unmodified linesawait scan('node_modules');await mkdir('dist/licenses', { recursive: true });await writeFile('dist/licenses/dependencies.txt', notices.sort().join('\n----------------------------------------\n\n'));await writeFile('dist/licenses/pi-components.json', await readFile('vendor/pi-coding-agent/provenance.json'));}
12345678910111213141516171819202122232425262728293031import { resolve } from 'node:path';import { readFileSync } from 'node:fs';import { createHash } from 'node:crypto';
// Adapt host services at build time; never edit installed or vendored Pi code.// Exact package pin + component checksums make this boundary reviewable.export function piBrowser() { const sourceRoot = resolve('vendor/pi-coding-agent'); const provenance = JSON.parse(readFileSync(resolve(sourceRoot, 'provenance.json'), 'utf8')); for (const [file, expected] of Object.entries(provenance.files)) { const actual = createHash('sha256').update(readFileSync(resolve(sourceRoot, file))).digest('hex'); if (actual !== expected) throw Error(`Vendored Pi component differs from its upstream checksum: ${file}`); } const host = resolve('src/pi/browser-host.mjs'); return { name: 'pi-browser-host', enforce: 'pre', resolveId(source, importer = '') { if (source === '@earendil-works/pi-tui') return resolve('src/pi/entry.mjs'); if (importer.includes('/@earendil-works/pi-tui/')) { if (source.endsWith('/terminal-image.js')) return resolve('src/pi/capabilities.mjs'); if (source === 'node:perf_hooks') return host; } if (importer.includes('/vendor/pi-coding-agent/') && source === '../theme/theme.js') return resolve('src/pi/theme.mjs'); }, transform(code, id) { if (!id.includes('/@earendil-works/pi-tui/') || !id.split('?')[0].endsWith('.js')) return; if (!/\b(?:process|Buffer)\./.test(code)) return; return { code: `import { browserProcess as process, Buffer } from ${JSON.stringify(host)};\n${code}`, map: null }; }, };}1234561 unmodified line8910111213148 unmodified lines232425262728293031323334357 unmodified lines43444546474849505152535455565758596061626364656667686970717273747576777879808128 unmodified lines11011111211311411519 unmodified lines13513613713813914014114214314414529 unmodified lines175176177178179import './style.css';import { textContent } from './protocol.mjs';import { renderMarkdown } from './markdown.mjs';const $ = selector => document.querySelector(selector);const worker = new Worker(new URL('./agent.worker.mjs', import.meta.url), { type: 'module' });1 unmodified linelet nextId = 1, busy = false, loaded = false, selected, dirty = false, files = {}, messages = [], readyResolve;const ready = new Promise(resolve => { readyResolve = resolve; });const diagnostics = { events: [], generations: [], device: null };const welcome = $('#welcome').cloneNode(true);function rpc(action, args) {return new Promise((resolve, reject) => {const id = nextId++; pending.set(id, { resolve, reject }); worker.postMessage({ id, action, args });8 unmodified lines}function controls() {$('#load').disabled = busy || loaded;$('#send').disabled = busy || !loaded;$('#stop').hidden = !busy;for (const id of ['#new-chat', '#shell-run', '#add-file', '#upload']) $(id).disabled = busy;$('#save').disabled = busy || !selected || !dirty;$('#editor').disabled = busy || !selected;}function renderFiles() {$('#files').replaceChildren();for (const file of Object.keys(files).sort()) {const button = document.createElement('button'); button.textContent = file.replace(/^\/workspace\//, '');7 unmodified linesselected = file; $('#filename').textContent = file; $('#editor').value = files[file] ?? '';renderFiles(); controls();}function renderMessages() {const log = $('#messages');const nearBottom = log.scrollHeight - log.scrollTop - log.clientHeight < 90;const opened = new Set([...log.querySelectorAll('details[open]')].map(d => d.dataset.id));log.replaceChildren();if (!messages.length) log.append(welcome.cloneNode(true));const results = new Map(messages.filter(m => m.role === 'toolResult').map(m => [m.toolCallId, m]));for (const m of messages) {if (m.role === 'toolResult') continue;const item = document.createElement('article'); item.className = 'message ' + m.role;const label = document.createElement('div'); label.className = 'message-label'; label.textContent = m.role === 'user' ? 'You' : 'Pi'; item.append(label);const content = typeof m.content === 'string' ? [{ type: 'text', text: m.content }] : m.content;for (const block of content) {if (block.type === 'text') {const body = document.createElement('div'); body.className = 'message-body';if (m.role === 'assistant') { body.classList.add('markdown'); body.innerHTML = renderMarkdown(block.text); }else body.textContent = block.text;item.append(body);} else if (block.type === 'toolCall') {const result = results.get(block.id), details = document.createElement('details');details.className = 'tool'; details.dataset.id = block.id; details.open = opened.has(block.id) || !result;const summary = document.createElement('summary');summary.textContent = `${result ? result.isError ? 'Γ' : 'β' : 'Β·'} ${block.name} ${block.arguments.path ?? (block.arguments.command ?? '').slice(0, 65)}`;const pre = document.createElement('pre'); pre.textContent = JSON.stringify(block.arguments, null, 2) + '\n\n' + (result ? textContent(result.content) : 'Runningβ¦');details.append(summary, pre); item.append(details);}}if (m.errorMessage) { const error = document.createElement('div'); error.className = 'error'; error.textContent = m.errorMessage; item.append(error); }if (m.stopReason === 'length') { const note = document.createElement('div'); note.className = 'message-stats'; note.textContent = 'Output limit reached. Ask Pi to continue.'; item.append(note); }log.append(item);}if (nearBottom) log.scrollTop = log.scrollHeight;}worker.onmessage = ({ data }) => {if (data.type === 'reply') {const request = pending.get(data.id); pending.delete(data.id);28 unmodified lines}if (event.type === 'tool_execution_start') $('#activity').textContent = `Running ${event.toolName}β¦`;if (event.type === 'turn_start') $('#activity').textContent = 'Pi is thinkingβ¦';} else if (data.type === 'generation') { diagnostics.generations.push(data); if (diagnostics.generations.length > 100) diagnostics.generations.shift(); }else if (data.type === 'context_trim') notice('Older turns were left out of the model context. Your full chat remains saved.');else if (data.type === 'notice') notice(data.text);19 unmodified linesnotice(''); const result = await rpc('prompt', { text }); messages = result.messages; renderMessages(); return result;}$('#load').onclick = guarded(load);$('#chat-form').onsubmit = guarded(async () => { const text = $('#prompt').value; $('#prompt').value = ''; await prompt(text); });$('#prompt').onkeydown = event => { if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) $('#chat-form').requestSubmit(); };$('#messages').onclick = event => { const button = event.target.closest('[data-prompt]'); if (button) { $('#prompt').value = button.dataset.prompt; $('#prompt').focus(); } };$('#stop').onclick = guarded(() => rpc('stop'));$('#new-chat').onclick = guarded(async () => { const state = await rpc('new_chat'); messages = state.messages; renderMessages(); notice(''); });$('#editor').oninput = () => { dirty = true; controls(); };$('#save').onclick = guarded(async () => { await rpc('write', { path: selected, content: $('#editor').value }); dirty = false; renderFiles(); controls(); notice(''); });$('#add-file').onclick = guarded(async () => {29 unmodified lines$('#terminal-output').scrollTop = $('#terminal-output').scrollHeight;});// Browser verification exercises the same worker and real Pi / WebGPU paths as the UI.window.browserPi = { ready, load, prompt, rpc, diagnostics, get loaded() { return loaded; }, get busy() { return busy; } };controls();123451 unmodified line78910111213141516178 unmodified lines262728293031323334353637383940417 unmodified lines4950515253545528 unmodified lines8485868788899019 unmodified lines11011111211311411511611711811912012112212329 unmodified lines153154155156157import './style.css';import { createTerminalUI } from './pi/terminal-ui.mjs';const $ = selector => document.querySelector(selector);const worker = new Worker(new URL('./agent.worker.mjs', import.meta.url), { type: 'module' });1 unmodified linelet nextId = 1, busy = false, loaded = false, selected, dirty = false, files = {}, messages = [], readyResolve;const ready = new Promise(resolve => { readyResolve = resolve; });const diagnostics = { events: [], generations: [], device: null };const terminalUI = createTerminalUI($('#pi-terminal'), {load: () => ready.then(load), prompt: text => ready.then(() => prompt(text)),newChat: () => ready.then(newChat), stop: () => rpc('stop'),shell: command => { if (dirty) throw Error('Save your file edits before running commands.'); return rpc('shell', { command }); },});function rpc(action, args) {return new Promise((resolve, reject) => {const id = nextId++; pending.set(id, { resolve, reject }); worker.postMessage({ id, action, args });8 unmodified lines}function controls() {$('#load').disabled = busy || loaded;$('#send').disabled = busy;$('#newline').disabled = busy;terminalUI.setState({ busy, loaded, activity: $('#activity').textContent });$('#stop').hidden = !busy;for (const id of ['#new-chat', '#shell-run', '#add-file', '#upload']) $(id).disabled = busy;$('#save').disabled = busy || !selected || !dirty;$('#editor').disabled = busy || !selected;}function renderFiles() {terminalUI.setFiles(files);$('#files').replaceChildren();for (const file of Object.keys(files).sort()) {const button = document.createElement('button'); button.textContent = file.replace(/^\/workspace\//, '');7 unmodified linesselected = file; $('#filename').textContent = file; $('#editor').value = files[file] ?? '';renderFiles(); controls();}function renderMessages() { terminalUI.setMessages(messages); }worker.onmessage = ({ data }) => {if (data.type === 'reply') {const request = pending.get(data.id); pending.delete(data.id);28 unmodified lines}if (event.type === 'tool_execution_start') $('#activity').textContent = `Running ${event.toolName}β¦`;if (event.type === 'turn_start') $('#activity').textContent = 'Pi is thinkingβ¦';terminalUI.setState({ activity: $('#activity').textContent });} else if (data.type === 'generation') { diagnostics.generations.push(data); if (diagnostics.generations.length > 100) diagnostics.generations.shift(); }else if (data.type === 'context_trim') notice('Older turns were left out of the model context. Your full chat remains saved.');else if (data.type === 'notice') notice(data.text);19 unmodified linesnotice(''); const result = await rpc('prompt', { text }); messages = result.messages; renderMessages(); return result;}$('#load').onclick = guarded(load);$('#send').onclick = () => { terminalUI.submit(); terminalUI.focus(); };$('#newline').onclick = () => terminalUI.newline();$('#stop').onclick = guarded(() => rpc('stop'));async function newChat() {const state = await rpc('new_chat'); messages = state.messages;terminalUI.setMessages(messages, { reset: true }); notice('');}$('#new-chat').onclick = guarded(newChat);$('#editor').oninput = () => { dirty = true; controls(); };$('#save').onclick = guarded(async () => { await rpc('write', { path: selected, content: $('#editor').value }); dirty = false; renderFiles(); controls(); notice(''); });$('#add-file').onclick = guarded(async () => {29 unmodified lines$('#terminal-output').scrollTop = $('#terminal-output').scrollHeight;});// Browser verification exercises the same worker and real Pi / WebGPU paths as the UI.window.browserPi = { ready, load, prompt, rpc, diagnostics, terminal: terminalUI, get loaded() { return loaded; }, get busy() { return busy; } };controls();
12345678// Only Pi's terminal modules import this host adapter. No global Node shim.export { Buffer } from 'buffer';export const performance = globalThis.performance;export const browserProcess = { env: { TERM: 'xterm-256color', TERM_PROGRAM: 'xtermjs' }, platform: 'browser', nextTick: callback => queueMicrotask(callback),};12345678910111213141516171819202122232425// xterm.js renders text/ANSI; this app does not install Kitty/iTerm image addons.// Pi's native image module also probes tmux via child_process. Keep that host// dependency out of the browser and advertise only capabilities we implement.let capabilities = { images: null, trueColor: true, hyperlinks: true };let dimensions = { widthPx: 8, heightPx: 16 };export const getCapabilities = () => capabilities;export const setCapabilities = value => { capabilities = { ...value, images: null }; };export const getCellDimensions = () => dimensions;export const setCellDimensions = value => { dimensions = value; };export const isImageLine = () => false;export const getKittyImagePlacement = () => undefined;export const getKittyImageMetadata = () => undefined;export const cropKittyImageLine = line => line;export const deleteKittyImage = () => '';export const deleteAllKittyImages = () => '';export const deleteAllKittyPlacements = () => '';export function hyperlink(text, url) { // Generated text may contain arbitrary URLs. Only explicit user clicks open // HTTP(S) links, and no terminal control bytes may enter their OSC envelope. try { const parsed = new URL(url); if (!['https:', 'http:'].includes(parsed.protocol) || /[\x00-\x20\x7f-\x9f]/.test(url)) return text; return `\x1b]8;;${parsed.href}\x07${text}\x1b]8;;\x07`; } catch { return text; }}1234567891011121314151617// Import the real upstream components directly, excluding ProcessTerminal and// native filesystem autocomplete from pi-tui's Node-oriented barrel export.export { TuiAltScreen } from '@earendil-works/pi-tui/dist/tui-alt-screen.js';export { Container } from '@earendil-works/pi-tui/dist/tui.js';export { Editor } from '@earendil-works/pi-tui/dist/components/editor.js';export { Text } from '@earendil-works/pi-tui/dist/components/text.js';export { TruncatedText } from '@earendil-works/pi-tui/dist/components/truncated-text.js';export { Markdown } from '@earendil-works/pi-tui/dist/components/markdown.js';export { Box } from '@earendil-works/pi-tui/dist/components/box.js';export { Spacer } from '@earendil-works/pi-tui/dist/components/spacer.js';export { MouseRegion } from '@earendil-works/pi-tui/dist/components/mouse-region.js';export { ScrollView } from '@earendil-works/pi-tui/dist/components/scroll-view.js';export { VStack } from '@earendil-works/pi-tui/dist/components/v-stack.js';export { KeybindingsManager, TUI_KEYBINDINGS, setKeybindings } from '@earendil-works/pi-tui/dist/keybindings.js';export { matchesKey } from '@earendil-works/pi-tui/dist/keys.js';export { StdinBuffer } from '@earendil-works/pi-tui/dist/stdin-buffer.js';export { visibleWidth, stripTerminalSequences } from '@earendil-works/pi-tui/dist/utils.js';123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216import { Terminal } from '@xterm/xterm';import { FitAddon } from '@xterm/addon-fit';import '@xterm/xterm/css/xterm.css';import { TuiAltScreen, Container, Text, TruncatedText, Box, Spacer, ScrollView, VStack, KeybindingsManager, TUI_KEYBINDINGS, setKeybindings, stripTerminalSequences } from './entry.mjs';import { CustomEditor } from '../../vendor/pi-coding-agent/components/custom-editor.js';import { UserMessageComponent } from '../../vendor/pi-coding-agent/components/user-message.js';import { AssistantMessageComponent } from '../../vendor/pi-coding-agent/components/assistant-message.js';import { getEditorTheme, theme } from './theme.mjs';import { XtermTerminal } from './xterm-terminal.mjs';import { textContent } from '../protocol.mjs';
// Model output and workspace files are text, never terminal instructions.export const terminalText = value => stripTerminalSequences(String(value ?? '')) .replace(/\r\n?/g, '\n').replace(/[\x00-\x08\x0b-\x1f\x7f-\x9f]/g, '');
const commands = [ { value: '/help', label: '/help', description: 'Browser terminal commands' }, { value: '/load', label: '/load', description: 'Load MiniCPM on this device' }, { value: '/new', label: '/new', description: 'Start a new conversation; keep files' }, { value: '/clear', label: '/clear', description: 'Same as /new' },];
export function createTerminalUI(element, actions) { const xterm = new Terminal({ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace', fontSize: 13, lineHeight: 1.3, theme: { background: '#ffffff', foreground: '#1f2328', cursor: '#5a8080', selectionBackground: '#d0d0e0' }, cursorBlink: false, scrollback: 2000, screenReaderMode: true, allowProposedApi: false, }); const mount = document.createElement('div'); mount.className = 'pi-terminal-mount'; element.append(mount); const fitAddon = new FitAddon(); xterm.loadAddon(fitAddon); xterm.open(mount); const terminal = new XtermTerminal(xterm); const ui = new TuiAltScreen(terminal, true, undefined, { copyOnSelect: false, copySelection: async text => { try { await navigator.clipboard.writeText(text); return true; } catch { return false; } }, openUrl: url => { if (/^https?:\/\//i.test(url)) window.open(url, '_blank', 'noopener,noreferrer'); }, scrollToEndIndicator: () => theme.fg('accent', ' β Latest '), }); const keybindings = new KeybindingsManager({ ...TUI_KEYBINDINGS, 'app.interrupt': { defaultKeys: ['escape', 'ctrl+c'] }, 'app.exit': { defaultKeys: 'ctrl+d' }, 'app.tools.expand': { defaultKeys: 'ctrl+o' }, 'tui.editor.historyPrevious': { defaultKeys: 'ctrl+p' }, 'tui.editor.historyNext': { defaultKeys: 'ctrl+n' }, }); setKeybindings(keybindings); const editor = new CustomEditor(ui, getEditorTheme(), keybindings, { paddingX: 1 }); const transcript = new Container(); const scroll = new ScrollView(transcript, { follow: 'end', primary: true, scrollbar: 'auto', scrollbarTrackStyle: text => theme.fg('borderMuted', text), scrollbarThumbStyle: text => theme.fg('muted', text) }); const status = new TruncatedText('', 1, 0); const footer = new TruncatedText(theme.fg('dim', '/workspace Β· MiniCPM5-2B Β· 4,096 context'), 1, 0); ui.setLayoutRoot(new VStack([ { component: scroll, basis: 0, grow: 1, minSize: 2 }, { component: new VStack([status, editor, footer]), basis: 'auto', shrink: 0 }, ])); ui.setFocus(editor); let state = { loaded: false, busy: false, activity: '' }, files = [], messages = [], expanded = false; let inputPending = false; const components = new Map(); const localEntries = []; const history = new Set(); const welcome = new Container(); welcome.addChild(new Text(theme.fg('accent', theme.bold('Ο Pi')) + theme.fg('muted', ' browser workspace'), 1, 1)); welcome.addChild(new Text('Ask Pi to work with the files on the right.\n\n/load load MiniCPM\n/help show commands\n!ls run a workspace command', 1, 0)); welcome.addChild(new Spacer(1));
function addLocal(text, error = false) { localEntries.push({ at: messages.length, component: new Text(theme.fg(error ? 'error' : 'muted', terminalText(text)), 1, 1) }); renderMessages(); ui.scrollToBottom(); } function remember(text) { if (!text || history.has(text)) return; history.add(text); editor.addToHistory(text); } function toolComponent(call, result) { const container = new Container(); container.addChild(new Spacer(1)); const box = new Box(1, 0, text => theme.bg(result ? result.isError ? 'toolErrorBg' : 'toolSuccessBg' : 'toolPendingBg', text)); const title = `${result ? result.isError ? 'Γ' : 'β' : 'Β·'} ${call.name} ${call.arguments?.path ?? call.arguments?.command ?? ''}`; box.addChild(new Text(theme.bold(terminalText(title)), 0, 0)); const args = terminalText(JSON.stringify(call.arguments, null, 2)); const output = terminalText(result ? textContent(result.content) : 'Runningβ¦'); const lines = output.split('\n'); box.addChild(new Text(theme.fg('toolOutput', expanded ? args + '\n\n' + output : lines.slice(0, 8).join('\n')), 0, 0)); if (!expanded && lines.length > 8) box.addChild(new Text(theme.fg('dim', `β¦ ${lines.length - 8} more lines Β· Ctrl+O to expand`), 0, 0)); container.addChild(box); return container; } function renderMessages() { transcript.clear(); transcript.addChild(welcome); const results = new Map(messages.filter(m => m.role === 'toolResult').map(m => [m.toolCallId, m])); const liveKeys = new Set(); for (let i = 0; i <= messages.length; i++) { for (const local of localEntries) if (local.at === i) transcript.addChild(local.component); const message = messages[i]; if (!message || message.role === 'toolResult') continue; const key = message.role + ':' + message.timestamp + ':' + i; liveKeys.add(key); let cached = components.get(key); if (!cached) { cached = { component: message.role === 'user' ? new UserMessageComponent(terminalText(textContent(message.content))) : new AssistantMessageComponent() }; components.set(key, cached); } if (message.role === 'user') remember(textContent(message.content)); if (message.role === 'assistant' && cached.message !== message) { const clean = { ...message, content: message.content.map(block => block.type === 'text' ? { ...block, text: terminalText(block.text) } : block.type === 'thinking' ? { ...block, thinking: terminalText(block.thinking) } : block), errorMessage: message.errorMessage ? terminalText(message.errorMessage) : undefined }; cached.component.updateContent(clean, !message.stopReason); } cached.message = message; transcript.addChild(cached.component); for (const call of Array.isArray(message.content) ? message.content : []) { if (call.type !== 'toolCall') continue; const result = results.get(call.id), toolKey = 'tool:' + call.id; liveKeys.add(toolKey); const signature = JSON.stringify([call, result, expanded]); let tool = components.get(toolKey); if (tool?.signature !== signature) { tool = { signature, component: toolComponent(call, result) }; components.set(toolKey, tool); } transcript.addChild(tool.component); } } for (const key of components.keys()) if (!liveKeys.has(key)) components.delete(key); ui.requestRender(); } function refreshStatus() { status.text = theme.fg(state.busy ? 'accent' : 'muted', terminalText(state.activity || (state.loaded ? 'Ready' : 'Load the model to chat Β· /help'))); editor.disableSubmit = state.busy || inputPending; editor.borderColor = text => theme.fg(state.busy ? 'accent' : 'borderMuted', text); actions.onInput?.(editor.getText()); ui.requestRender(); } async function submit(text) { if (!text.trim() || state.busy || inputPending) return; inputPending = true; refreshStatus(); remember(text); ui.scrollToBottom(); try { const trimmed = text.trim(); if (trimmed === '/help') { addLocal('/load Load MiniCPM on this device\n/new Clear the conversation; keep workspace files\n!cmd Run cmd with just-bash\n\nEnter: send Β· Shift+Enter: newline\nβ/β: edit/history Β· Ctrl+P/N: history\nEsc or Ctrl+C: stop Β· Ctrl+O: expand tools\nCtrl+Shift+F: search transcript\n\nPiβs original terminal UI and agent core run here.\nNode CLI extensions, npm, Python and native binaries are unavailable.'); } else if (trimmed === '/load') { await actions.load(); } else if (trimmed === '/new' || trimmed === '/clear') { await actions.newChat(); localEntries.length = 0; renderMessages(); } else if (trimmed.startsWith('/')) { throw Error('Unknown browser command. Type /help for available commands.'); } else if (trimmed.startsWith('!')) { const command = trimmed.slice(1).trim(); if (!command) throw Error('Enter a shell command after !.'); const result = await actions.shell(command); addLocal(`$ ${command}\n${result.stdout}${result.stderr}\n[exit ${result.exitCode}]`, result.exitCode !== 0); } else { await actions.prompt(text); } } catch (error) { addLocal(error.message, true); // Preserve a failed submission without overwriting a draft typed meanwhile. if (!editor.getText()) editor.setText(text); } finally { inputPending = false; refreshStatus(); } } editor.onSubmit = text => { void submit(text); }; editor.onChange = () => { actions.onInput?.(editor.getText()); ui.requestRender(); }; editor.onEscape = () => { if (state.busy) void actions.stop().catch(error => addLocal(error.message, true)); }; editor.onCtrlD = () => addLocal('This terminal lives in your browser. Close the tab to leave.'); editor.onAction('app.tools.expand', () => { expanded = !expanded; renderMessages(); }); editor.setAutocompleteProvider({ getSuggestions(lines, line, col) { const before = lines[line].slice(0, col), prefix = before.match(/\S*$/)?.[0] ?? ''; if (!prefix) return null; const candidates = before.startsWith('/') ? commands : files.map(path => ({ value: path, label: path, description: 'workspace file' })); const items = candidates.filter(item => item.value.startsWith(prefix) && item.value !== prefix); return items.length ? { items, prefix } : null; }, applyCompletion(lines, line, col, item, prefix) { const updated = [...lines]; updated[line] = lines[line].slice(0, col - prefix.length) + item.value + ' ' + lines[line].slice(col); return { lines: updated, cursorLine: line, cursorCol: col - prefix.length + item.value.length + 1 }; }, }); xterm.attachCustomKeyEventHandler(event => { if (event.type !== 'keydown' || event.isComposing) return true; // Let the browser deliver its native paste event (no clipboard permission // request). xterm then applies bracketed paste before Pi sees the text. if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'v') return false; // Legacy xterm input folds Ctrl+Shift+F into Ctrl+F. Preserve the modifier // in CSI-u form for Pi's existing fullscreen transcript-search binding. if (event.ctrlKey && event.shiftKey && event.code === 'KeyF') { event.preventDefault(); terminal.inputData('\x1b[102;6u'); return false; } if (event.key === 'Enter' && event.shiftKey) { event.preventDefault(); terminal.inputData('\x1b\r'); return false; } if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'c' && (xterm.hasSelection() || ui.hasActiveSelection())) { if (ui.hasActiveSelection()) { event.preventDefault(); void ui.copyActiveSelectionToClipboard(); } return false; } return true; }); // xterm's alternate buffer has no native scrollback. Route touch gestures to // Pi's ScrollView while leaving taps/IME handling with xterm itself. let touchY; element.addEventListener('touchstart', event => { if (event.touches.length === 1) touchY = event.touches[0].clientY; }, { passive: true }); element.addEventListener('touchmove', event => { if (touchY === undefined || event.touches.length !== 1) return; const y = event.touches[0].clientY, rows = Math.trunc((touchY - y) / 18); if (rows) { ui.scrollBy(rows); touchY = y; event.preventDefault(); } }, { passive: false }); element.addEventListener('touchend', () => { touchY = undefined; }, { passive: true }); function fit() { if (element.clientWidth > 0 && element.clientHeight > 0) { fitAddon.fit(); ui.requestRender(); } } const observer = new ResizeObserver(fit); observer.observe(element); fit(); ui.start(); renderMessages(); refreshStatus(); document.fonts.ready.then(fit); xterm.textarea.setAttribute('aria-label', 'Message Pi'); xterm.textarea.setAttribute('autocapitalize', 'off'); xterm.textarea.setAttribute('spellcheck', 'false'); return { setMessages(value, { reset = false } = {}) { messages = value; if (reset) { localEntries.length = 0; components.clear(); } renderMessages(); }, setFiles(value) { files = Object.keys(value).map(path => path.replace(/^\/workspace\//, '')); }, setState(value) { state = { ...state, ...value }; refreshStatus(); }, submit() { const text = editor.getExpandedText(); if (!editor.disableSubmit && text.trim()) { editor.setText(''); return submit(text); } }, focus() { xterm.focus(); }, newline() { terminal.inputData('\x1b\r'); xterm.focus(); }, get text() { return editor.getExpandedText(); }, get cols() { return xterm.cols; }, get rows() { return xterm.rows; }, get viewportTop() { return ui.viewportTop; }, readScreen() { return Array.from({ length: xterm.buffer.active.length }, (_, i) => xterm.buffer.active.getLine(i)?.translateToString(true) ?? '').join('\n'); }, dispose() { observer.disconnect(); ui.stop({ preserveScreen: true }); xterm.dispose(); }, };}12345678910111213141516171819202122232425262728293031import palette from '../../vendor/pi-coding-agent/theme/light.json';
// Upstream Pi light palette; browser styling replaces the theme file watcher// and Node's syntax highlighter. Code blocks use Pi's plain-code fallback.function color(name, text, background = false) { const value = palette.vars[palette.colors[name]] ?? palette.colors[name] ?? palette.vars.text; const rgb = value.slice(1).match(/../g).map(part => parseInt(part, 16)).join(';'); const open = `\x1b[${background ? 48 : 38};2;${rgb}m`, close = `\x1b[${background ? 49 : 39}m`; return open + String(text).replaceAll(close, open) + close;}export const theme = { fg: (name, text) => color(name, text), bg: (name, text) => color(name, text, true), bold: text => `\x1b[1m${text}\x1b[22m`, italic: text => `\x1b[3m${text}\x1b[23m`, underline: text => `\x1b[4m${text}\x1b[24m`,};export function getMarkdownTheme() { return { ...Object.fromEntries(Object.entries({ heading: 'mdHeading', link: 'mdLink', linkUrl: 'mdLinkUrl', code: 'mdCode', codeBlock: 'mdCodeBlock', codeBlockBorder: 'mdCodeBlockBorder', quote: 'mdQuote', quoteBorder: 'mdQuoteBorder', hr: 'mdHr', listBullet: 'mdListBullet' }).map(([key, value]) => [key, text => theme.fg(value, text)])), bold: theme.bold, italic: theme.italic, underline: theme.underline, strikethrough: text => `\x1b[9m${text}\x1b[29m`, highlightCode: code => code.split('\n').map(line => theme.fg('mdCodeBlock', line)), };}export function getEditorTheme() { return { borderColor: text => theme.fg('borderMuted', text), selectList: { selectedPrefix: text => theme.fg('accent', text), selectedText: text => theme.fg('accent', text), description: text => theme.fg('muted', text), scrollInfo: text => theme.fg('muted', text), noMatch: text => theme.fg('muted', text), } };}12345678910111213141516171819202122232425262728293031import { StdinBuffer } from './entry.mjs';
// Implements Pi's Terminal interface using xterm.js instead of a Node PTY.export class XtermTerminal { constructor(xterm) { this.xterm = xterm; this.subscriptions = []; } start(onInput, onResize) { this.input = new StdinBuffer(); this.input.on('data', onInput); this.input.on('paste', text => onInput(`\x1b[200~${text}\x1b[201~`)); this.subscriptions.push(this.xterm.onData(data => this.input.process(data)), this.xterm.onResize(onResize)); this.write('\x1b[?2004h'); } stop() { this.subscriptions.forEach(subscription => subscription.dispose()); this.subscriptions = []; this.input?.destroy(); this.write('\x1b[?2004l'); } async drainInput() { /* There is no parent process or SSH input to drain. */ } write(data) { this.xterm.write(data); } get columns() { return this.xterm.cols; } get rows() { return this.xterm.rows; } get kittyProtocolActive() { return false; } moveBy(lines) { if (lines) this.write(`\x1b[${Math.abs(lines)}${lines > 0 ? 'B' : 'A'}`); } hideCursor() { this.write('\x1b[?25l'); } showCursor() { this.write('\x1b[?25h'); } clearLine() { this.write('\x1b[K'); } clearFromCursor() { this.write('\x1b[J'); } clearScreen() { this.write('\x1b[2J\x1b[H'); } setTitle(title) { this.xterm.element?.setAttribute('aria-label', title); } setProgress(active) { this.xterm.element?.setAttribute('aria-busy', String(active)); } inputData(data) { this.input?.process(data); }}63 unmodified lines64656667686970717273747576777879808182838485868788899091929322 unmodified lines1161171181191201211221231241251261271281291301311321331341351367 unmodified lines14414514614714814963 unmodified lines.muted { margin-top: 4px; color: var(--muted); font-size: 11px; }.muted:empty { display: none; }#messages { flex: 1; min-height: 120px; overflow: auto; padding: 14px 2px; scrollbar-width: thin; }#welcome { max-width: 470px; margin: 22px 8px 0; }.eyebrow { color: var(--muted); font-size: 11px; }h1 { margin: 8px 0; font-family: inherit; font-size: 22px; line-height: 1.25; letter-spacing: -.025em; font-weight: 600; }#welcome p { margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }.suggestions { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }.suggestions button { display: flex; justify-content: space-between; padding: 8px 10px; background: transparent; text-align: left; font-size: 12px; }.suggestions button:hover { background: #ededed; }.suggestions span { color: var(--muted); }.message { margin: 0 0 14px; line-height: 1.55; overflow-wrap: anywhere; }.message-label { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 600; }.message-body { white-space: pre-wrap; }.message.user { border-left: 2px solid #c9c9c9; padding-left: 10px; }.tool { margin: 6px 0; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font-size: 12px; }.tool summary { cursor: pointer; padding: 7px 9px; font-family: ui-monospace, monospace; }.tool pre { max-height: 240px; margin: 0; padding: 0 10px 9px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }.error { color: #a12c28; }.message-stats { margin-top: 4px; color: var(--muted); font-size: 10px; }#notice { margin: 6px 0; padding: 8px 10px; border: 1px solid #cfcfcf; border-radius: 4px; background: #f0f0f0; font-size: 12px; }#chat-form { padding: 6px; border: 1px solid #c8c8c8; border-radius: 4px; background: var(--surface); }#prompt { width: 100%; min-height: 48px; max-height: 160px; padding: 6px; resize: vertical; border: 0; background: transparent; font-size: 13px; line-height: 1.45; }.composer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }.composer-footer span { margin-right: auto; padding-left: 6px; color: var(--muted); font-size: 10px; }footer { display: flex; justify-content: space-between; gap: 8px; padding-top: 7px; color: var(--muted); font-size: 10px; }22 unmodified lines.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }#open-tab { margin-top: 8px; font-size: 12px; color: var(--accent); text-decoration: none; white-space: normal; }.markdown { white-space: normal; }.markdown p { margin: 0 0 8px; }.markdown pre { padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; background: #f0f0f0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }.markdown code { font: 12px/1.5 ui-monospace, monospace; }.markdown :not(pre) > code { padding: 1px 4px; border-radius: 3px; background: #ededed; }.markdown a { color: var(--accent); text-underline-offset: 2px; }.markdown table { border-collapse: collapse; font-size: 12px; }.markdown td, .markdown th { padding: 4px 7px; border: 1px solid var(--line); }@media (max-width: 850px) {header { padding: 0 12px; }main { display: flex; flex-direction: column; height: auto; }.conversation { min-height: calc(100dvh - 46px); padding: 10px; }#messages { flex: 1; max-height: 65dvh; }#welcome { margin: 18px 4px; }.workspace { min-height: 520px; border-left: 0; border-top: 1px solid var(--line); }.file-area { min-height: 280px; grid-template-columns: 115px minmax(0, 1fr); }.header-right > span:not(.local-dot) { display: none; }7 unmodified lines@media (pointer: coarse) {button, .button, #files button { min-height: 38px; }.editor-heading { min-height: 40px; }.tool summary, .terminal summary { padding-top: 11px; padding-bottom: 11px; }#prompt, #command { font-size: 16px; }}63 unmodified lines64656667686970717273747576777822 unmodified lines1011021031041051061071081091107 unmodified lines11811912012112212312463 unmodified lines.muted { margin-top: 4px; color: var(--muted); font-size: 11px; }.muted:empty { display: none; }#pi-terminal { flex: 1; min-height: 180px; min-width: 0; overflow: hidden; margin-top: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }#pi-terminal .pi-terminal-mount, #pi-terminal .xterm { height: 100%; }#pi-terminal .xterm-viewport { background-color: #fff !important; }#pi-terminal textarea:focus { box-shadow: none; }.terminal-controls { display: flex; align-items: center; gap: 6px; padding-top: 7px; }.terminal-controls > span { flex: 1; min-width: 0; color: var(--muted); font-size: 10px; }#notice { margin: 6px 0; padding: 8px 10px; border: 1px solid #cfcfcf; border-radius: 4px; background: #f0f0f0; font-size: 12px; }footer { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }.composer-footer span { margin-right: auto; padding-left: 6px; color: var(--muted); font-size: 10px; }footer { display: flex; justify-content: space-between; gap: 8px; padding-top: 7px; color: var(--muted); font-size: 10px; }22 unmodified lines.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }#open-tab { margin-top: 8px; font-size: 12px; color: var(--accent); text-decoration: none; white-space: normal; }@media (max-width: 850px) {header { padding: 0 12px; }main { display: flex; flex-direction: column; height: auto; }.conversation { height: calc(100dvh - 46px); min-height: 500px; padding: 10px; }.workspace { min-height: 520px; border-left: 0; border-top: 1px solid var(--line); }.file-area { min-height: 280px; grid-template-columns: 115px minmax(0, 1fr); }.header-right > span:not(.local-dot) { display: none; }7 unmodified lines@media (pointer: coarse) {button, .button, #files button { min-height: 38px; }.editor-heading { min-height: 40px; }.terminal summary { padding-top: 11px; padding-bottom: 11px; }#command { font-size: 16px; }#pi-terminal .xterm-helper-textarea { font-size: 16px; }}
1 unmodified line2345678963 unmodified lines7374757677787980812 unmodified lines848586878889901 unmodified lineimport fs from 'node:fs/promises';import assert from 'node:assert/strict';const base = process.env.APP_URL ?? 'http://127.0.0.1:4173/?source=local';const label = process.env.TEST_LABEL ?? 'agent-browser';const profile = process.env.BROWSER_PROFILE ?? new URL('../../validation/agent-browser-profile', import.meta.url).pathname;const output = new URL(`../../validation/${label}.json`, import.meta.url);const result = { date: new Date().toISOString(), url: base, cases: [], errors: [], requests: [] };63 unmodified lines} },];for (const task of tasks) {await page.evaluate(() => window.browserPi.rpc('new_chat'));const start = Date.now();const state = await page.evaluate(prompt => window.browserPi.prompt(prompt), task.prompt);const entry = { name: task.name, elapsedMs: Date.now() - start, ...state };result.cases.push(entry); console.log('CASE', JSON.stringify(entry));task.check(state);2 unmodified linesconst running = page.evaluate(() => window.browserPi.prompt('Write a very long detailed tutorial about shell scripting. Do not use tools.'));await page.waitForFunction(() => window.browserPi.busy);await page.waitForTimeout(900);await page.locator('#stop').click();const stopped = await running;assert.equal(stopped.messages.filter(m => m.role === 'assistant').at(-1).stopReason, 'aborted');result.cancellation = { passed: true, completedGenerations: await page.evaluate(() => window.browserPi.diagnostics.generations.length) - beforeStop };1 unmodified line2345678963 unmodified lines7374757677787980818283848586878889902 unmodified lines939495969798991001 unmodified lineimport fs from 'node:fs/promises';import assert from 'node:assert/strict';const base = process.argv[2] ?? process.env.APP_URL ?? 'http://127.0.0.1:4173/?source=local';const label = process.argv[3] ?? process.env.TEST_LABEL ?? 'agent-browser';const profile = process.env.BROWSER_PROFILE ?? new URL('../../validation/agent-browser-profile', import.meta.url).pathname;const output = new URL(`../../validation/${label}.json`, import.meta.url);const result = { date: new Date().toISOString(), url: base, cases: [], errors: [], requests: [] };63 unmodified lines} },];for (const task of tasks) {console.log('START', task.name);await page.locator('#new-chat').click();await page.waitForFunction(() => !window.browserPi.busy);const start = Date.now();await page.locator('.xterm-helper-textarea').focus();await page.keyboard.type(task.prompt);console.log('TYPED', await page.evaluate(() => window.browserPi.terminal.text));await page.waitForFunction(prompt => window.browserPi.terminal.text === prompt, task.prompt, { timeout: 15_000 });await page.locator('#send').click();await page.waitForFunction(() => window.browserPi.busy);await page.waitForFunction(() => !window.browserPi.busy);const state = await page.evaluate(() => window.browserPi.rpc('snapshot'));const entry = { name: task.name, elapsedMs: Date.now() - start, ...state };result.cases.push(entry); console.log('CASE', JSON.stringify(entry));task.check(state);2 unmodified linesconst running = page.evaluate(() => window.browserPi.prompt('Write a very long detailed tutorial about shell scripting. Do not use tools.'));await page.waitForFunction(() => window.browserPi.busy);await page.waitForTimeout(900);await page.locator('.xterm-helper-textarea').focus();await page.keyboard.press('Escape');const stopped = await running;assert.equal(stopped.messages.filter(m => m.role === 'assistant').at(-1).stopReason, 'aborted');result.cancellation = { passed: true, completedGenerations: await page.evaluate(() => window.browserPi.diagnostics.generations.length) - beforeStop };
35 unmodified lines3637383940414235 unmodified linesresult.loadMs = Date.now() - start;result.device = await app.evaluate(() => window.browserPi.diagnostics.device);await app.locator('#new-chat').click(); await app.waitForFunction(() => !window.browserPi.busy);await app.locator('#prompt').fill('Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.');await app.locator('#send').click();await app.waitForFunction(() => window.browserPi.busy);await app.waitForFunction(() => !window.browserPi.busy);35 unmodified lines363738394041424335 unmodified linesresult.loadMs = Date.now() - start;result.device = await app.evaluate(() => window.browserPi.diagnostics.device);await app.locator('#new-chat').click(); await app.waitForFunction(() => !window.browserPi.busy);await app.locator('.xterm-helper-textarea').focus();await page.keyboard.type('Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.');await app.locator('#send').click();await app.waitForFunction(() => window.browserPi.busy);await app.waitForFunction(() => !window.browserPi.busy);
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104import { chromium } from 'playwright';import fs from 'node:fs/promises';import assert from 'node:assert/strict';
const url = process.argv[2] ?? process.env.APP_URL ?? 'http://127.0.0.1:4173/';const label = process.argv[3] ?? process.env.TEST_LABEL ?? 'agent-terminal';const result = { date: new Date().toISOString(), url, errors: [], requests: [], checks: [] };const browser = await chromium.launch({ executablePath: '/usr/bin/chromium', headless: true });const context = await browser.newContext({ viewport: { width: 1440, height: 1000 } });context.setDefaultTimeout(15_000);const page = await context.newPage();page.on('pageerror', error => { result.errors.push(error.stack); console.log('PAGEERROR', error.stack); });page.on('console', message => { if (message.type() === 'error') console.log('CONSOLE', message.text().slice(0, 500)); });context.on('request', request => result.requests.push(request.url()));const screen = () => page.evaluate(() => window.browserPi.terminal.readScreen());const text = () => page.evaluate(() => window.browserPi.terminal.text);async function type(value) { await page.locator('.xterm-helper-textarea').focus(); await page.keyboard.type(value); }async function waitScreen(value) { await page.waitForFunction(value => window.browserPi.terminal.readScreen().includes(value), value); }try { await page.goto(url); await page.waitForFunction(() => window.browserPi); await page.evaluate(() => window.browserPi.ready); await waitScreen('browser workspace'); result.initial = await screen(); assert(result.initial.includes('/load')); result.checks.push('Original Pi TUI rendered through xterm');
await type('/help'); await page.keyboard.press('Enter'); await waitScreen('Ctrl+O'); result.checks.push('Enter submits /help without loading a model'); await page.keyboard.press('Control+Shift+f'); await type('browser'); await page.waitForFunction(() => window.browserPi.terminal.text === '' && /\d+\/\d+/.test(window.browserPi.terminal.readScreen())); await page.keyboard.press('Escape'); await page.waitForTimeout(30); result.checks.push('Pi fullscreen transcript search preserves the editor draft'); await type('one'); await page.keyboard.press('Shift+Enter'); await type('two'); assert.equal(await text(), 'one\ntwo'); await page.keyboard.press('Backspace'); await page.keyboard.press('Control+a'); await type('X'); assert.equal(await text(), 'one\nXtw'); await page.keyboard.press('Control+u'); await page.keyboard.press('Control+k'); await page.keyboard.press('Backspace'); await page.keyboard.press('Control+u'); assert.equal(await text(), ''); result.checks.push('Pi multiline editor: Shift+Enter, cursor, deletion, Ctrl+U/K'); await page.keyboard.press('Control+p'); assert.equal(await text(), '/help'); await page.keyboard.press('Control+n'); assert.equal(await text(), ''); result.checks.push('Pi prompt history'); await type('/he'); await page.keyboard.press('Tab'); await page.waitForFunction(() => window.browserPi.terminal.text === '/help '); await page.keyboard.press('Enter'); await waitScreen('Ctrl+O'); result.checks.push('Pi autocomplete: /he β /help');
await type("!printf 'terminal-works\\n' > terminal.txt; cat terminal.txt"); await page.keyboard.press('Escape'); // Dismiss optional workspace completion. await page.waitForTimeout(30); // A lone ESC is delimited by Pi's 10ms input timer. await page.keyboard.press('Enter'); await waitScreen('[exit 0]'); await page.waitForFunction(() => !window.browserPi.busy); const state = await page.evaluate(() => window.browserPi.rpc('snapshot')); assert.equal(state.files['/workspace/terminal.txt'], 'terminal-works\n'); assert((await screen()).includes('[exit 0]')); result.checks.push('xterm keyboard β Pi editor β real just-bash β workspace file');
// Model/file text must not be able to clear the terminal or inject OSC URLs. await type("!printf 'before\\033[2Jafter\\n'"); await page.locator('#send').click(); await waitScreen('beforeafter'); result.checks.push('Shell escape sequences render as inert text');
// Paste uses xterm's actual bracketed-paste path through Pi's StdinBuffer. await context.grantPermissions(['clipboard-read', 'clipboard-write']); const largePaste = '!cat > pasted.txt <<\'EOF\'\n' + Array.from({ length: 15 }, (_, i) => 'row-' + i).join('\n') + '\nEOF'; await page.evaluate(text => navigator.clipboard.writeText(text), largePaste); await page.locator('.xterm-helper-textarea').focus(); await page.keyboard.press('Control+v'); await page.waitForFunction(text => window.browserPi.terminal.text === text, largePaste); await page.locator('#send').click(); await page.waitForFunction(() => document.querySelector('#files').textContent.includes('pasted.txt')); const pastedState = await page.evaluate(() => window.browserPi.rpc('snapshot')); assert.equal(pastedState.files['/workspace/pasted.txt'], Array.from({ length: 15 }, (_, i) => 'row-' + i).join('\n') + '\n'); result.checks.push('Large Pi paste markers expand before Send'); const pasted = 'hello δΈη π¦\nline two'; await page.evaluate(text => navigator.clipboard.writeText(text), pasted); await page.locator('.xterm-helper-textarea').focus(); await page.keyboard.press('Control+v'); await page.waitForFunction(text => window.browserPi.terminal.text === text, pasted); result.checks.push('Unicode multiline clipboard paste'); await page.locator('#newline').click(); assert.equal(await text(), pasted + '\n'); result.checks.push('Touch-accessible newline button');
// Resize while preserving a multiline draft and Pi's own viewport renderer. const desktop = await page.evaluate(() => ({ cols: window.browserPi.terminal.cols, rows: window.browserPi.terminal.rows })); await page.screenshot({ path: `../validation/${label}-desktop.png`, fullPage: true }); await page.setViewportSize({ width: 390, height: 844 }); await page.waitForFunction(cols => window.browserPi.terminal.cols < cols, desktop.cols); assert.equal(await text(), pasted + '\n'); assert(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); result.sizes = { desktop, mobile: await page.evaluate(() => ({ cols: window.browserPi.terminal.cols, rows: window.browserPi.terminal.rows })) }; assert(result.sizes.mobile.cols >= 30); assert(result.sizes.mobile.rows >= 15); await page.screenshot({ path: `../validation/${label}-mobile.png`, fullPage: true }); result.checks.push('390px layout and live terminal resize preserve the draft'); result.mobileLimitation = 'Desktop Chromium viewport simulation; physical mobile keyboards and GPUs not tested.'; assert.equal(result.errors.length, 0); assert.equal(result.requests.filter(url => /^https?:/.test(url) && new URL(url).origin !== new URL(result.url).origin).length, 0); result.passed = true; console.log(JSON.stringify({ passed: true, checks: result.checks, sizes: result.sizes }));} catch (error) { result.failure = error.stack; result.screen = await screen().catch(() => 'App failed before initialization'); await page.screenshot({ path: `../validation/${label}-failure.png`, fullPage: true }); throw error;} finally { await fs.writeFile(`../validation/${label}.json`, JSON.stringify(result, null, 2)); await browser.close(); }123456789101112131415161718192021MIT License
Copyright (c) 2025 Mario Zechner
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021# Pi CLI presentation components
These files are **unmodified copies** from the published`@earendil-works/pi-coding-agent@0.85.1` npm tarball, under `dist/modes/interactive/`.`provenance.json` records their SHA-256 digests. Pi's MIT license is included.
- `CustomEditor` is the CLI's actual editor subclass, extending `pi-tui`'s editor.- `UserMessageComponent` and `AssistantMessageComponent` are its actual message renderers.- `markdown-transform.js` is their upstream helper.- `light.json` is the upstream light theme palette.
The build redirects their `@earendil-works/pi-tui` import to a selective exportof the installed **real pi-tui** package. It redirects their Node theme serviceto `src/pi/theme.mjs`, which uses the same palette without filesystem watchers orNode syntax highlighting. See `scripts/pi-browser.mjs` for all host adaptations.
The rest of the Node CLI is not vendored. Browser shell tool cards, slash-commanddispatch, worker integration, and workspace controls are app code. They do notclaim to implement the full CLI's sessions, extensions, or provider management.
Upstream: https://github.com/earendil-works/pi/tree/v0.85.1/packages/coding-agent123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158import { Container, Markdown, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";import { getMarkdownTheme, theme } from "../theme/theme.js";import { createMarkdownTransform } from "./markdown-transform.js";const OSC133_ZONE_START = "\x1b]133;A\x07";const OSC133_ZONE_END = "\x1b]133;B\x07";const OSC133_ZONE_FINAL = "\x1b]133;C\x07";/** * Component that renders a complete assistant message */export class AssistantMessageComponent extends Container { contentContainer; hideThinkingBlock; markdownTheme; hiddenThinkingLabel; outputPad; markdownTransformers; lastMessage; hasToolCalls = false; isStreaming = false; thinkingVisibilityOverrides = new Map(); constructor(message, hideThinkingBlock = false, markdownTheme = getMarkdownTheme(), hiddenThinkingLabel = "Thinking...", outputPad = 1, markdownTransformers = []) { super(); this.hideThinkingBlock = hideThinkingBlock; this.markdownTheme = markdownTheme; this.hiddenThinkingLabel = hiddenThinkingLabel; this.outputPad = outputPad; this.markdownTransformers = markdownTransformers; // Container for text/thinking content this.contentContainer = new Container(); this.addChild(this.contentContainer); if (message) { this.updateContent(message); } } invalidate() { super.invalidate(); if (this.lastMessage) { this.updateContent(this.lastMessage); } } setHideThinkingBlock(hide) { this.hideThinkingBlock = hide; this.thinkingVisibilityOverrides.clear(); if (this.lastMessage) { this.updateContent(this.lastMessage); } } setHiddenThinkingLabel(label) { this.hiddenThinkingLabel = label; if (this.lastMessage) { this.updateContent(this.lastMessage); } } setOutputPad(padding) { this.outputPad = padding; if (this.lastMessage) { this.updateContent(this.lastMessage); } } render(width) { const lines = super.render(width); if (this.hasToolCalls || lines.length === 0) { return lines; } lines[0] = OSC133_ZONE_START + lines[0]; lines[lines.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + lines[lines.length - 1]; return lines; } updateContent(message, isStreaming = this.isStreaming) { this.lastMessage = message; this.isStreaming = isStreaming; // Clear content container this.contentContainer.clear(); const hasVisibleContent = message.content.some((c) => (c.type === "text" && c.text.trim()) || (c.type === "thinking" && c.thinking.trim())); if (hasVisibleContent) { this.contentContainer.addChild(new Spacer(1)); } // Render content in order let thinkingRunIndex = 0; for (let i = 0; i < message.content.length; i++) { const content = message.content[i]; if (content.type === "text" && content.text.trim()) { // Assistant text messages with no background - trim the text // Set paddingY=0 to avoid extra spacing before tool executions this.contentContainer.addChild(new Markdown(content.text.trim(), this.outputPad, 0, this.markdownTheme, undefined, { transform: createMarkdownTransform("assistant", this.isStreaming, this.markdownTransformers), })); } else if (content.type === "thinking") { const thinkingBlocks = []; for (; i < message.content.length; i++) { const thinkingContent = message.content[i]; if (thinkingContent.type !== "thinking") { break; } const thinking = thinkingContent.thinking.trim(); if (thinking) { thinkingBlocks.push(thinking); } } i--; if (thinkingBlocks.length === 0) { continue; } // Add spacing only when another visible assistant content block follows. // This avoids a superfluous blank line before separately-rendered tool execution blocks. const hasVisibleContentAfter = message.content .slice(i + 1) .some((c) => (c.type === "text" && c.text.trim()) || (c.type === "thinking" && c.thinking.trim())); const runIndex = thinkingRunIndex++; const hidden = this.thinkingVisibilityOverrides.get(runIndex) ?? this.hideThinkingBlock; const thinkingComponent = hidden ? new Text(theme.italic(theme.fg("thinkingText", this.hiddenThinkingLabel)), this.outputPad, 0) : new Markdown(thinkingBlocks.join("\n\n"), this.outputPad, 0, this.markdownTheme, { color: (text) => theme.fg("thinkingText", text), italic: true, }, { transform: createMarkdownTransform("assistant-thinking", this.isStreaming, this.markdownTransformers), }); this.contentContainer.addChild(new MouseRegion(thinkingComponent, (event) => { if (event.type !== "click" || event.button !== "left") return undefined; this.thinkingVisibilityOverrides.set(runIndex, !hidden); if (this.lastMessage) this.updateContent(this.lastMessage); return { handled: true }; })); if (hasVisibleContentAfter) { this.contentContainer.addChild(new Spacer(1)); } } } // Check if incomplete/failed - show after partial content. // For aborted/error tool calls, tool execution components show the error. // Length stops can happen before a tool call is complete, so surface them here too. const hasToolCalls = message.content.some((c) => c.type === "toolCall"); this.hasToolCalls = hasToolCalls; if (message.stopReason === "length") { this.contentContainer.addChild(new Spacer(1)); this.contentContainer.addChild(new Text(theme.fg("error", "Response was truncated before completion."), this.outputPad, 0)); } else if (!hasToolCalls) { if (message.stopReason === "aborted") { const abortMessage = message.errorMessage && message.errorMessage !== "Request was aborted" ? message.errorMessage : "Operation aborted"; this.contentContainer.addChild(new Spacer(1)); this.contentContainer.addChild(new Text(theme.fg("error", abortMessage), this.outputPad, 0)); } else if (message.stopReason === "error") { const errorMsg = message.errorMessage || "Unknown error"; this.contentContainer.addChild(new Spacer(1)); this.contentContainer.addChild(new Text(theme.fg("error", `Error: ${errorMsg}`), this.outputPad, 0)); } } }}//# sourceMappingURL=assistant-message.js.map123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115import { Editor, visibleWidth } from "@earendil-works/pi-tui";/** * Custom editor that handles app-level keybindings for coding-agent. */export class CustomEditor extends Editor { keybindings; workingStatusIndicator; embedWorkingStatus; actionHandlers = new Map(); // Special handlers that can be dynamically replaced onEscape; onCtrlD; onPasteImage; /** Handler for extension-registered shortcuts. Returns true if handled. */ onExtensionShortcut; constructor(tui, theme, keybindings, options) { super(tui, theme, options); this.keybindings = keybindings; this.embedWorkingStatus = options?.embedWorkingStatus ?? false; } setWorkingStatusIndicator(indicator) { this.workingStatusIndicator = indicator; } renderTopBorder(width, hiddenLineCount) { if (!this.embedWorkingStatus || !this.workingStatusIndicator || width <= 0) { return super.renderTopBorder(width, hiddenLineCount); } let status = this.workingStatusIndicator.renderInBorder(Math.max(1, width - 5)); let statusWidth = visibleWidth(status); if (statusWidth === 0) return super.renderTopBorder(width, hiddenLineCount); const overflowLabel = hiddenLineCount > 0 ? ` β ${hiddenLineCount} more ` : undefined; const overflowLabelWidth = overflowLabel ? visibleWidth(overflowLabel) : 0; const overflowStart = Math.floor((width - overflowLabelWidth) / 2); const canFitOverflow = () => overflowLabel !== undefined && overflowLabelWidth + 2 <= width && overflowStart - (3 + statusWidth + 1) >= 1; if (overflowLabel && !canFitOverflow()) { status = this.workingStatusIndicator.renderSpinnerInBorder(width); statusWidth = visibleWidth(status); } if (canFitOverflow()) { const leftBlockWidth = 3 + statusWidth + 1; return (this.borderColor("ββ ") + status + this.borderColor(` ${"β".repeat(overflowStart - leftBlockWidth)}${overflowLabel}${"β".repeat(width - overflowStart - overflowLabelWidth)}`)); } if (width >= statusWidth + 5) { return this.borderColor("ββ ") + status + this.borderColor(` ${"β".repeat(width - statusWidth - 4)}`); } status = this.workingStatusIndicator.renderSpinnerInBorder(width); statusWidth = visibleWidth(status); const prefixWidth = Math.min(3, Math.max(0, width - statusWidth)); return (this.borderColor("β".repeat(prefixWidth)) + status + this.borderColor("β".repeat(Math.max(0, width - prefixWidth - statusWidth)))); } /** * Register a handler for an app action. */ onAction(action, handler) { this.actionHandlers.set(action, handler); } handleInput(data) { // Check extension-registered shortcuts first if (this.onExtensionShortcut?.(data)) { return; } // Check for clipboard paste keybinding if (this.keybindings.matches(data, "app.clipboard.pasteImage")) { this.onPasteImage?.(); return; } // Check app keybindings first // Escape/interrupt - only if autocomplete is NOT active if (this.keybindings.matches(data, "app.interrupt")) { if (!this.isShowingAutocomplete()) { // Use dynamic onEscape if set, otherwise registered handler const handler = this.onEscape ?? this.actionHandlers.get("app.interrupt"); if (handler) { handler(); return; } } // Let parent handle escape for autocomplete cancellation super.handleInput(data); return; } // Exit (Ctrl+D) - only when editor is empty if (this.keybindings.matches(data, "app.exit")) { if (this.getText().length === 0) { const handler = this.onCtrlD ?? this.actionHandlers.get("app.exit"); if (handler) handler(); return; } // Fall through to editor handling for delete-char-forward when not empty } // Explicit history bindings take precedence over app actions while the editor is focused. // This lets users bind Ctrl+P even though it cycles models by default. if (this.keybindings.matches(data, "tui.editor.historyPrevious") || this.keybindings.matches(data, "tui.editor.historyNext")) { super.handleInput(data); return; } // Check all other app actions for (const [action, handler] of this.actionHandlers) { if (action !== "app.interrupt" && action !== "app.exit" && this.keybindings.matches(data, action)) { handler(); return; } } // Pass to parent for editor handling super.handleInput(data); }}//# sourceMappingURL=custom-editor.js.map12345678910111213141516171819export function createMarkdownTransform(messageType, isStreaming, transformers) { return (markdown, availableWidth) => applyMarkdownTransformers(markdown, { messageType, isStreaming, availableWidth }, transformers);}function applyMarkdownTransformers(markdown, context, transformers) { let transformedMarkdown = markdown; for (const transformer of transformers) { try { const transformed = transformer(transformedMarkdown, context); if (typeof transformed === "string") { transformedMarkdown = transformed; } } catch { // Keep the current Markdown and continue with the next transformer. } } return transformedMarkdown;}//# sourceMappingURL=markdown-transform.js.map12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import { Box, Container, Markdown } from "@earendil-works/pi-tui";import { getMarkdownTheme, theme } from "../theme/theme.js";import { createMarkdownTransform } from "./markdown-transform.js";const OSC133_ZONE_START = "\x1b]133;A\x07";const OSC133_ZONE_END = "\x1b]133;B\x07";const OSC133_ZONE_FINAL = "\x1b]133;C\x07";/** * Component that renders a user message */export class UserMessageComponent extends Container { text; markdownTheme; outputPad; markdownTransformers; constructor(text, markdownTheme = getMarkdownTheme(), outputPad = 1, markdownTransformers = []) { super(); this.text = text; this.markdownTheme = markdownTheme; this.outputPad = outputPad; this.markdownTransformers = markdownTransformers; this.rebuild(); } setOutputPad(padding) { this.outputPad = padding; this.rebuild(); } rebuild() { this.clear(); const contentBox = new Box(this.outputPad, 1, (content) => theme.bg("userMessageBg", content)); contentBox.addChild(new Markdown(this.text, 0, 0, this.markdownTheme, { color: (content) => theme.fg("userMessageText", content), }, { preserveOrderedListMarkers: true, preserveBackslashEscapes: true, transform: createMarkdownTransform("user", false, this.markdownTransformers), })); this.addChild(contentBox); } render(width) { const lines = super.render(width); if (lines.length === 0) { return lines; } lines[0] = OSC133_ZONE_START + lines[0]; lines[lines.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + lines[lines.length - 1]; return lines; }}//# sourceMappingURL=user-message.js.map123456789101112{ "package": "@earendil-works/pi-coding-agent", "version": "0.85.1", "source": "https://github.com/earendil-works/pi/tree/v0.85.1/packages/coding-agent", "files": { "components/custom-editor.js": "000b0056f2bf645537537468bdd6f6ee0c82e4110f5417c1c70c2e8fefc04f29", "components/user-message.js": "398a34b8a979daea5614be4cbbe6ff66e7eca97e9fd855508791dcddce994bc8", "components/assistant-message.js": "edbd1e712234609d2ad1078edcf960e3b6f549669075f1c5d1a7a4481e2b3d19", "components/markdown-transform.js": "31ad2245189328104a31bb9b12f58b0a12e4af9c7924775a242c9dcd526d2c1a", "theme/light.json": "14c7172ba7e75eab6f509504de806af0f2d9ff817bfb45d9533bff15c7e6e657" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990{ "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json", "name": "light", "vars": { "teal": "#5a8080", "blue": "#547da7", "green": "#588458", "red": "#aa5555", "yellow": "#9a7326", "text": "#1f2328", "mediumGray": "#6c6c6c", "dimGray": "#767676", "lightGray": "#b0b0b0", "selectedBg": "#d0d0e0", "userMsgBg": "#e8e8e8", "toolPendingBg": "#e8e8f0", "toolSuccessBg": "#e8f0e8", "toolErrorBg": "#f0e8e8", "customMsgBg": "#ede7f6" }, "colors": { "accent": "teal", "border": "blue", "borderAccent": "teal", "borderMuted": "lightGray", "success": "green", "error": "red", "warning": "yellow", "muted": "mediumGray", "dim": "dimGray", "text": "text", "thinkingText": "mediumGray",
"selectedBg": "selectedBg", "scrollbarTrack": "lightGray", "scrollbarThumb": "text", "searchMatchBg": "selectedBg", "searchMatchText": "text", "userMessageBg": "userMsgBg", "userMessageText": "text", "customMessageBg": "customMsgBg", "customMessageText": "text", "customMessageLabel": "#7e57c2", "toolPendingBg": "toolPendingBg", "toolSuccessBg": "toolSuccessBg", "toolErrorBg": "toolErrorBg", "toolTitle": "text", "toolOutput": "mediumGray",
"mdHeading": "yellow", "mdLink": "blue", "mdLinkUrl": "dimGray", "mdCode": "teal", "mdCodeBlock": "green", "mdCodeBlockBorder": "mediumGray", "mdQuote": "mediumGray", "mdQuoteBorder": "mediumGray", "mdHr": "mediumGray", "mdListBullet": "green",
"toolDiffAdded": "green", "toolDiffRemoved": "red", "toolDiffContext": "mediumGray",
"syntaxComment": "#008000", "syntaxKeyword": "#0000FF", "syntaxFunction": "#795E26", "syntaxVariable": "#001080", "syntaxString": "#A31515", "syntaxNumber": "#098658", "syntaxType": "#267F99", "syntaxOperator": "#000000", "syntaxPunctuation": "#000000",
"thinkingOff": "lightGray", "thinkingMinimal": "#767676", "thinkingLow": "blue", "thinkingMedium": "teal", "thinkingHigh": "#875f87", "thinkingXhigh": "#8b008b", "thinkingMax": "#af005f",
"bashMode": "green" }, "export": { "pageBg": "#f8f8f8", "cardBg": "#ffffff", "infoBg": "#fffae6" }}1 unmodified line234567891011121314151 unmodified lineimport { cpSync, mkdirSync, readdirSync, createReadStream, statSync } from 'node:fs';import { resolve } from 'node:path';import { collectLicenses } from './scripts/licenses.mjs';export default defineConfig({base: './',worker: { format: 'es' },resolve: { alias: { '@huggingface/transformers': resolve('node_modules/@huggingface/transformers/dist/transformers.web.js') } },server: { proxy: { '/models': 'http://127.0.0.1:8765' } },preview: { proxy: { '/models': 'http://127.0.0.1:8765' } },plugins: [{name: 'local-ort-runtime',configureServer(server) {server.middlewares.use('/runtime', (req, res, next) => {1 unmodified line2345678910111213141516171 unmodified lineimport { cpSync, mkdirSync, readdirSync, createReadStream, statSync } from 'node:fs';import { resolve } from 'node:path';import { collectLicenses } from './scripts/licenses.mjs';import { piBrowser } from './scripts/pi-browser.mjs';export default defineConfig({base: './',worker: { format: 'es' },optimizeDeps: { exclude: ['@earendil-works/pi-tui'], include: ['events', 'buffer'] },resolve: { alias: { '@huggingface/transformers': resolve('node_modules/@huggingface/transformers/dist/transformers.web.js') } },server: { proxy: { '/models': 'http://127.0.0.1:8765' } },preview: { proxy: { '/models': 'http://127.0.0.1:8765' } },plugins: [piBrowser(), {name: 'local-ort-runtime',configureServer(server) {server.middlewares.use('/runtime', (req, res, next) => {
1:root{font-synthesis:none;color:#262626;--surface:#fff;--panel:#fafafa;--line:#dedede;--muted:#686868;--accent:#303030;background:#f5f5f5;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,.button{cursor:pointer;border:1px solid var(--line);background:var(--surface);min-height:28px;color:inherit;white-space:nowrap;border-radius:4px;padding:5px 9px;font-size:12px;line-height:1.4}button:hover,.button:hover{background:#ededed}button:disabled{opacity:.45;cursor:default}.primary{background:var(--accent);border-color:var(--accent);color:#fff}.primary:hover{background:#171717}.quiet{background:0 0;border-color:#0000;font-size:11px}textarea,input{outline:none}textarea:focus,input:focus{box-shadow:inset 0 0 0 1px #888}button:focus-visible,.button:focus-visible{outline-offset:2px;outline:2px solid #737373}[hidden]{display:none!important}header{border-bottom:1px solid var(--line);background:#f7f7f7;justify-content:space-between;align-items:center;height:46px;padding:0 16px;display:flex}.brand{color:inherit;align-items:center;gap:8px;font-size:15px;font-weight:600;text-decoration:none;display:flex}.pi{font-family:Georgia,serif;font-size:28px;line-height:1}.brand small{color:var(--muted);margin-left:8px;font-size:11px;font-weight:400;display:inline}.header-right{align-items:center;gap:6px;font-size:11px;display:flex}.header-right button{margin-left:12px}.local-dot{background:#737373;border-radius:50%;width:5px;height:5px}main{grid-template-columns:minmax(420px,1fr) minmax(370px,.83fr);max-width:1800px;height:calc(100dvh - 46px);margin:auto;display:grid}.conversation{flex-direction:column;min-width:0;min-height:0;padding:12px 14px 8px;display:flex}.model-panel{border:1px solid var(--line);background:var(--panel);border-radius:4px;padding:9px 10px}.model-heading{justify-content:space-between;align-items:center;gap:8px;display:flex}.model-heading>div{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.model-heading strong{font-size:12px;font-weight:600}.model-panel p{color:var(--muted);margin:5px 0 0;font-size:11px;line-height:1.45}.badge{color:#595959;background:#f0f0f0;border:1px solid #d9d9d9;border-radius:3px;padding:2px 5px;font-size:10px}progress{width:100%;height:5px;accent-color:var(--accent);margin-top:8px}.muted{color:var(--muted);margin-top:4px;font-size:11px}.muted:empty{display:none}#messages{scrollbar-width:thin;flex:1;min-height:120px;padding:14px 2px;overflow:auto}#welcome{max-width:470px;margin:22px 8px 0}.eyebrow{color:var(--muted);font-size:11px}h1{letter-spacing:-.025em;margin:8px 0;font-family:inherit;font-size:22px;font-weight:600;line-height:1.25}#welcome p{color:var(--muted);margin:8px 0;font-size:12px;line-height:1.6}.suggestions{flex-direction:column;gap:6px;margin-top:16px;display:flex}.suggestions button{text-align:left;background:0 0;justify-content:space-between;padding:8px 10px;font-size:12px;display:flex}.suggestions button:hover{background:#ededed}.suggestions span{color:var(--muted)}.message{overflow-wrap:anywhere;margin:0 0 14px;line-height:1.55}.message-label{color:var(--muted);margin-bottom:4px;font-size:10px;font-weight:600}.message-body{white-space:pre-wrap}.message.user{border-left:2px solid #c9c9c9;padding-left:10px}.tool{border:1px solid var(--line);background:var(--panel);border-radius:4px;margin:6px 0;font-size:12px}.tool summary{cursor:pointer;padding:7px 9px;font-family:ui-monospace,monospace}.tool pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;margin:0;padding:0 10px 9px;font-size:11px;overflow:auto}.error{color:#a12c28}.message-stats{color:var(--muted);margin-top:4px;font-size:10px}#notice{background:#f0f0f0;border:1px solid #cfcfcf;border-radius:4px;margin:6px 0;padding:8px 10px;font-size:12px}#chat-form{background:var(--surface);border:1px solid #c8c8c8;border-radius:4px;padding:6px}#prompt{resize:vertical;background:0 0;border:0;width:100%;min-height:48px;max-height:160px;padding:6px;font-size:13px;line-height:1.45}.composer-footer{justify-content:flex-end;align-items:center;gap:6px;display:flex}.composer-footer span{color:var(--muted);margin-right:auto;padding-left:6px;font-size:10px}footer{color:var(--muted);justify-content:space-between;gap:8px;padding-top:7px;font-size:10px;display:flex}.workspace{border-left:1px solid var(--line);background:#f1f1f1;flex-direction:column;min-width:0;min-height:0;display:flex}.workspace-heading{justify-content:space-between;align-items:center;min-height:40px;padding:5px 10px;display:flex}.workspace-heading h2{margin:0;font-size:12px;font-weight:600}.workspace-heading>div{gap:0;display:flex}.button{display:inline-block}.file-area{border-top:1px solid var(--line);border-bottom:1px solid var(--line);flex:1;grid-template-columns:140px minmax(0,1fr);min-height:180px;display:grid}#files{border-right:1px solid var(--line);padding:5px 4px;overflow:auto}#files button{text-align:left;white-space:normal;overflow-wrap:anywhere;background:0 0;border:none;border-radius:3px;width:100%;padding:5px 7px;font-family:ui-monospace,monospace;font-size:11px;line-height:1.45;display:block}#files button:hover{background:#e9e9e9}#files button.selected{color:#202020;background:#dedede}.editor-area{background:var(--surface);flex-direction:column;min-width:0;min-height:0;display:flex}.editor-heading{border-bottom:1px solid var(--line);background:var(--panel);justify-content:space-between;align-items:center;gap:6px;height:32px;padding:0 6px 0 10px;display:flex}#filename{text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,monospace;font-size:11px;overflow:hidden}#editor{resize:none;color:#333;tab-size:2;white-space:pre;background:0 0;border:0;flex:1;min-height:140px;padding:10px 12px;font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;overflow:auto}.terminal{background:#f5f5f5;padding:0 10px}.terminal summary{cursor:pointer;padding:9px 0;font-size:11px;font-weight:500}.terminal summary span{float:right;color:var(--muted);font-size:10px;font-weight:400}#terminal-output{white-space:pre-wrap;overflow-wrap:anywhere;height:112px;margin:0;font:11px/1.5 ui-monospace,monospace;overflow:auto}#shell-form{border-top:1px solid var(--line);align-items:center;gap:6px;padding:4px 0;font-family:ui-monospace,monospace;display:flex}#command{background:0 0;border:0;width:100%;min-width:0;padding:6px 0;font-size:12px}.workspace-note{color:var(--muted);margin:8px 10px;font-size:10px;line-height:1.45}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}#open-tab{color:var(--accent);white-space:normal;margin-top:8px;font-size:12px;text-decoration:none}.markdown{white-space:normal}.markdown p{margin:0 0 8px}.markdown pre{border:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere;background:#f0f0f0;border-radius:4px;padding:9px 10px;overflow:auto}.markdown code{font:12px/1.5 ui-monospace,monospace}.markdown :not(pre)>code{background:#ededed;border-radius:3px;padding:1px 4px}.markdown a{color:var(--accent);text-underline-offset:2px}.markdown table{border-collapse:collapse;font-size:12px}.markdown td,.markdown th{border:1px solid var(--line);padding:4px 7px}@media (width<=850px){header{padding:0 12px}main{flex-direction:column;height:auto;display:flex}.conversation{min-height:calc(100dvh - 46px);padding:10px}#messages{flex:1;max-height:65dvh}#welcome{margin:18px 4px}.workspace{border-left:0;border-top:1px solid var(--line);min-height:520px}.file-area{grid-template-columns:115px minmax(0,1fr);min-height:280px}.header-right>span:not(.local-dot){display:none}.header-right button{margin-left:0}h1{font-size:20px}.badge{font-size:9px}.model-panel{padding:8px}footer{font-size:9px}}@media (pointer:coarse){button,.button,#files button{min-height:38px}.editor-heading{min-height:40px}.tool summary,.terminal summary{padding-top:11px;padding-bottom:11px}#prompt,#command{font-size:16px}}1:root{font-synthesis:none;color:#262626;--surface:#fff;--panel:#fafafa;--line:#dedede;--muted:#686868;--accent:#303030;background:#f5f5f5;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,.button{cursor:pointer;border:1px solid var(--line);background:var(--surface);min-height:28px;color:inherit;white-space:nowrap;border-radius:4px;padding:5px 9px;font-size:12px;line-height:1.4}button:hover,.button:hover{background:#ededed}button:disabled{opacity:.45;cursor:default}.primary{background:var(--accent);border-color:var(--accent);color:#fff}.primary:hover{background:#171717}.quiet{background:0 0;border-color:#0000;font-size:11px}textarea,input{outline:none}textarea:focus,input:focus{box-shadow:inset 0 0 0 1px #888}button:focus-visible,.button:focus-visible{outline-offset:2px;outline:2px solid #737373}[hidden]{display:none!important}header{border-bottom:1px solid var(--line);background:#f7f7f7;justify-content:space-between;align-items:center;height:46px;padding:0 16px;display:flex}.brand{color:inherit;align-items:center;gap:8px;font-size:15px;font-weight:600;text-decoration:none;display:flex}.pi{font-family:Georgia,serif;font-size:28px;line-height:1}.brand small{color:var(--muted);margin-left:8px;font-size:11px;font-weight:400;display:inline}.header-right{align-items:center;gap:6px;font-size:11px;display:flex}.header-right button{margin-left:12px}.local-dot{background:#737373;border-radius:50%;width:5px;height:5px}main{grid-template-columns:minmax(420px,1fr) minmax(370px,.83fr);max-width:1800px;height:calc(100dvh - 46px);margin:auto;display:grid}.conversation{flex-direction:column;min-width:0;min-height:0;padding:12px 14px 8px;display:flex}.model-panel{border:1px solid var(--line);background:var(--panel);border-radius:4px;padding:9px 10px}.model-heading{justify-content:space-between;align-items:center;gap:8px;display:flex}.model-heading>div{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.model-heading strong{font-size:12px;font-weight:600}.model-panel p{color:var(--muted);margin:5px 0 0;font-size:11px;line-height:1.45}.badge{color:#595959;background:#f0f0f0;border:1px solid #d9d9d9;border-radius:3px;padding:2px 5px;font-size:10px}progress{width:100%;height:5px;accent-color:var(--accent);margin-top:8px}.muted{color:var(--muted);margin-top:4px;font-size:11px}.muted:empty{display:none}#pi-terminal{border:1px solid var(--line);background:#fff;border-radius:4px;flex:1;min-width:0;min-height:180px;margin-top:10px;padding:8px;overflow:hidden}#pi-terminal .pi-terminal-mount,#pi-terminal .xterm{height:100%}#pi-terminal .xterm-viewport{background-color:#fff!important}#pi-terminal textarea:focus{box-shadow:none}.terminal-controls{align-items:center;gap:6px;padding-top:7px;display:flex}.terminal-controls>span{min-width:0;color:var(--muted);flex:1;font-size:10px}#notice{background:#f0f0f0;border:1px solid #cfcfcf;border-radius:4px;margin:6px 0;padding:8px 10px;font-size:12px}footer{justify-content:flex-end;align-items:center;gap:6px;display:flex}.composer-footer span{color:var(--muted);margin-right:auto;padding-left:6px;font-size:10px}footer{color:var(--muted);justify-content:space-between;gap:8px;padding-top:7px;font-size:10px;display:flex}.workspace{border-left:1px solid var(--line);background:#f1f1f1;flex-direction:column;min-width:0;min-height:0;display:flex}.workspace-heading{justify-content:space-between;align-items:center;min-height:40px;padding:5px 10px;display:flex}.workspace-heading h2{margin:0;font-size:12px;font-weight:600}.workspace-heading>div{gap:0;display:flex}.button{display:inline-block}.file-area{border-top:1px solid var(--line);border-bottom:1px solid var(--line);flex:1;grid-template-columns:140px minmax(0,1fr);min-height:180px;display:grid}#files{border-right:1px solid var(--line);padding:5px 4px;overflow:auto}#files button{text-align:left;white-space:normal;overflow-wrap:anywhere;background:0 0;border:none;border-radius:3px;width:100%;padding:5px 7px;font-family:ui-monospace,monospace;font-size:11px;line-height:1.45;display:block}#files button:hover{background:#e9e9e9}#files button.selected{color:#202020;background:#dedede}.editor-area{background:var(--surface);flex-direction:column;min-width:0;min-height:0;display:flex}.editor-heading{border-bottom:1px solid var(--line);background:var(--panel);justify-content:space-between;align-items:center;gap:6px;height:32px;padding:0 6px 0 10px;display:flex}#filename{text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,monospace;font-size:11px;overflow:hidden}#editor{resize:none;color:#333;tab-size:2;white-space:pre;background:0 0;border:0;flex:1;min-height:140px;padding:10px 12px;font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;overflow:auto}.terminal{background:#f5f5f5;padding:0 10px}.terminal summary{cursor:pointer;padding:9px 0;font-size:11px;font-weight:500}.terminal summary span{float:right;color:var(--muted);font-size:10px;font-weight:400}#terminal-output{white-space:pre-wrap;overflow-wrap:anywhere;height:112px;margin:0;font:11px/1.5 ui-monospace,monospace;overflow:auto}#shell-form{border-top:1px solid var(--line);align-items:center;gap:6px;padding:4px 0;font-family:ui-monospace,monospace;display:flex}#command{background:0 0;border:0;width:100%;min-width:0;padding:6px 0;font-size:12px}.workspace-note{color:var(--muted);margin:8px 10px;font-size:10px;line-height:1.45}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}#open-tab{color:var(--accent);white-space:normal;margin-top:8px;font-size:12px;text-decoration:none}@media (width<=850px){header{padding:0 12px}main{flex-direction:column;height:auto;display:flex}.conversation{height:calc(100dvh - 46px);min-height:500px;padding:10px}.workspace{border-left:0;border-top:1px solid var(--line);min-height:520px}.file-area{grid-template-columns:115px minmax(0,1fr);min-height:280px}.header-right>span:not(.local-dot){display:none}.header-right button{margin-left:0}h1{font-size:20px}.badge{font-size:9px}.model-panel{padding:8px}footer{font-size:9px}}@media (pointer:coarse){button,.button,#files button{min-height:38px}.editor-heading{min-height:40px}.terminal summary{padding-top:11px;padding-bottom:11px}#command,#pi-terminal .xterm-helper-textarea{font-size:16px}}.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}12 unmodified lines1314151617181920212223242526272829303132333435363738394012 unmodified lines53545556575859608 unmodified lines69707172737475763 unmodified lines8081828384853 unmodified lines899091929394959697989910010110210310412 unmodified lines1171181191201211221231241251261271281291301311321331341351361371381391401411421431444 unmodified lines1491501511521531541551561571581591607 unmodified lines16816917017117217317417517617717817918056 unmodified lines23723823924024124224324447 unmodified lines29229329429529629712 unmodified lines"sha256": "7b2f4725b2cb4fc1d22031a311857d5ac8754c882bf4e01b5ab1a9778b2417f0"},"README.md": {"bytes": 8633,"sha256": "979de7c20b8dc21256c1de2706f2b406a4b3c5a086e3ecb8283dcf6484d0ff7a"},"SPACE_README.md": {"bytes": 8633,"sha256": "979de7c20b8dc21256c1de2706f2b406a4b3c5a086e3ecb8283dcf6484d0ff7a"},"app/README.md": {"bytes": 6739,"sha256": "db7a2c96658c57ba566f3857809a8f0f39efee60fa65d93c8b017909979dd0dc"},"app/index.html": {"bytes": 4033,"sha256": "88ad3a62bf464e306d1fd798b2d65ea89a85d22a677c2e3eb6a7033086ae3b4e"},"app/package-lock.json": {"bytes": 156122,"sha256": "d26257b0e926fb4a5481207f47a143c861c66eca652582cf07cb26b9648ff086"},"app/package.json": {"bytes": 659,"sha256": "f353b4fa416e51c2a8695d972bfcfe73e39e69eb5ec4235ac52fd2428893a177"},"app/public/favicon.svg": {"bytes": 227,12 unmodified lines"sha256": "0457f5bcec3b3b211605dfb5d1a49042fd638f3686a410fe099c24a25af13c48"},"app/scripts/licenses.mjs": {"bytes": 1423,"sha256": "979835b01259283c99d367f5a724331197a68df9fcfbe8681ed6c53cfdc6ac69"},"app/src/agent.worker.mjs": {"bytes": 4265,8 unmodified lines"sha256": "04375923fd4d2cfd6a58e17fb2eb966ddf4fb766fb050a88459e2d8e7358926c"},"app/src/main.mjs": {"bytes": 12114,"sha256": "41b46870cb5a06b12af6bd9a9d49bf432025c71402253e94fb4517cfb9ed7745"},"app/src/markdown.mjs": {"bytes": 699,3 unmodified lines"bytes": 3656,"sha256": "67bf7df79a547f8183a6321269e9c250fd2d2aabeebbecd13949f75c4cce8bb9"},"app/src/protocol.mjs": {"bytes": 4981,"sha256": "1d4416d6a77b60aeb847d88e6d98ff9a580e8dcb163add5f42923f2d145bf52e"3 unmodified lines"sha256": "dec9e2962a0f5c076512368395017fb5af7c9f7bfbe8cfed10105072dbcb76fe"},"app/src/style.css": {"bytes": 9353,"sha256": "0f69e55070dd85f7b053067b2600b4b91aa0910c3e33e972438d4594cb6fae6c"},"app/src/workspace.mjs": {"bytes": 5206,"sha256": "d3bf4e77e6ab855cd4d10f11330f52531068a7ca13456ddf4c357d03bfee40e0"},"app/tests/browser.mjs": {"bytes": 8972,"sha256": "04372cea62da264d5ce6d5f30277b14604bb12fda43bdc6aef08681fe6a6bfe6"},"app/tests/dev-smoke.mjs": {"bytes": 1352,12 unmodified lines"sha256": "8cc0750f0861f5cf3d63e155c9ea4091bae5432a5a6719a55941d63599456e55"},"app/tests/space-embedded.mjs": {"bytes": 3553,"sha256": "2296ad1867723ccd28553213c6a7d789d4d53c80fd355ea8fa1598c41b0090df"},"app/tests/space-restricted.mjs": {"bytes": 2580,"sha256": "f71fb23f85cbf021cbf3f368e27687e64fb25cddf232dc1224202a920de78458"},"app/vite.config.mjs": {"bytes": 1524,"sha256": "43ddd0d504729d9eba88e05f530c3d324e3a2705a15fd17971886668a787f6df"},"assets/agent.worker-DqQzo9yL.js": {"bytes": 2092911,"sha256": "1fc0006217cf28bf42951d1738e67d235b9516f9d579fa46064718759fd7ba28"},"assets/index-Cfkr7NLu.css": {"bytes": 8002,"sha256": "cbd285909fa229f37aa9147314d6c8f21937550a12f7609fcfd13cd33b020bc6"},"assets/index-LA8xezhP.js": {"bytes": 192028,"sha256": "1bc7b0bc05fad0e289c4ac9ed7000e6063f1690ee339e62771079a3be967e0ab"},"assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm": {"bytes": 23567050,4 unmodified lines"sha256": "c5cf939c058ae5b63f0cdab8d1becc4544582d6ed74098e9c8460d3acb78309e"},"index.html": {"bytes": 4130,"sha256": "2d287cf57ed9665b4f87a837f93c8ce6db95f60c1c422a2974d9b7ed8b9652c1"},"licenses/dependencies.txt": {"bytes": 1367435,"sha256": "1f7eac34d3c2ac44325f7ef6d38852620ea672c124ee2f1713a0796587ffe59c"},"licenses/onnxruntime-LICENSE": {"bytes": 1073,7 unmodified lines"bytes": 1069,"sha256": "0457f5bcec3b3b211605dfb5d1a49042fd638f3686a410fe099c24a25af13c48"},"requirements-convert.txt": {"bytes": 254,"sha256": "2a2dca97d6a9480afff1ed0da8f5924610552cfe509d5081788455f9c1d71f8b"},"research/browser-agent/REPORT.md": {"bytes": 9988,"sha256": "4c204b435a7ff62cb492dff883a284b95c60854306be31575bb4dc15da19a899"},"research/browser-agent/just-bash-README.md": {"bytes": 29503,56 unmodified lines"sha256": "b9bb39d5bd7bceb260d5eafa633f5af2e47a35d6132c8453d908ea6a4ad8a0f9"},"scripts/prepare_space.py": {"bytes": 3774,"sha256": "1a281fd8f61dc9caf206e11c645dffd39c19ee5689e4680e2e6c32211d176234"},"scripts/reference.py": {"bytes": 2652,47 unmodified lines"bytes": 2244,"sha256": "64f5f41f482beb1886a922d4f5872a8f82ad61b701ff45c9e21fb7980acd4ff7"},"validation/benchmark-summary.json": {"bytes": 1500,"sha256": "5bc51fbdbc43b58caa2036b621ded2bd3b4c1c95ba487b07bb5b84f19e97ebc0"12 unmodified lines1314151617181920212223242526272829303132333435363738394012 unmodified lines5354555657585960616263648 unmodified lines73747576777879803 unmodified lines848586878889909192939495969798991001011021031041051061071081091101111121133 unmodified lines11711811912012112212312412512612712812913013113212 unmodified lines1451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072084 unmodified lines2132142152162172182192202212222232247 unmodified lines23223323423523623723823924024124224324424524624724856 unmodified lines30530630730830931031131247 unmodified lines36036136236336436536636736836937037137237337437537637712 unmodified lines"sha256": "7b2f4725b2cb4fc1d22031a311857d5ac8754c882bf4e01b5ab1a9778b2417f0"},"README.md": {"bytes": 8768,"sha256": "3c928e6cc25c94390c8564c09bf207d6ef3520ec69b8eae78bfea2f9272942b9"},"SPACE_README.md": {"bytes": 8768,"sha256": "3c928e6cc25c94390c8564c09bf207d6ef3520ec69b8eae78bfea2f9272942b9"},"app/README.md": {"bytes": 8286,"sha256": "d7f0c4e8efd9b7237de4a938dc6f8dd3937c58139e09f87ca22041e83a44ae97"},"app/index.html": {"bytes": 3254,"sha256": "fddf34b58f9bc96fd7812fbfc8946562d75d34d4d08bf4283e5ab2c27b48f1e8"},"app/package-lock.json": {"bytes": 159289,"sha256": "abf0ce0c8b9240388940b2c1d666fbdcaa4f453eebdde9d2f80744f5cc461ac7"},"app/package.json": {"bytes": 856,"sha256": "83ec2cd1c54a65c91b6b8d3162fc2a4f9543aeec7e520fe6958aba3a1c7fe06a"},"app/public/favicon.svg": {"bytes": 227,12 unmodified lines"sha256": "0457f5bcec3b3b211605dfb5d1a49042fd638f3686a410fe099c24a25af13c48"},"app/scripts/licenses.mjs": {"bytes": 1536,"sha256": "8f04bf1c94122d5ad9fe8cb6964b69f8fdf71a5c1005921be960d5c8c6d14739"},"app/scripts/pi-browser.mjs": {"bytes": 1635,"sha256": "bd061a3825e46db09624261b39150f2dfab1c838bc252d54599d0f950f246d3f"},"app/src/agent.worker.mjs": {"bytes": 4265,8 unmodified lines"sha256": "04375923fd4d2cfd6a58e17fb2eb966ddf4fb766fb050a88459e2d8e7358926c"},"app/src/main.mjs": {"bytes": 10043,"sha256": "a0a818a35e52bf8edb21d011e7167848531efe01146a4e10dd9d49a4817e93ce"},"app/src/markdown.mjs": {"bytes": 699,3 unmodified lines"bytes": 3656,"sha256": "67bf7df79a547f8183a6321269e9c250fd2d2aabeebbecd13949f75c4cce8bb9"},"app/src/pi/browser-host.mjs": {"bytes": 329,"sha256": "27db1727103727a5a01e455daefa45634fb3be62af76cc883b21abb7069a1d87"},"app/src/pi/capabilities.mjs": {"bytes": 1385,"sha256": "62f09aa13c695980717c7bc7e25ad6aba66254faa994bf81f39d2a912a89ff83"},"app/src/pi/entry.mjs": {"bytes": 1351,"sha256": "f7e6ae0ba428b78126c6873f9784dbf7d9220421cd6510ad893819492ed5ff9b"},"app/src/pi/terminal-ui.mjs": {"bytes": 13938,"sha256": "0c8bbef004dd83f2f979fc8963d8ebba376f33e35973abe20f134a081f38c6ed"},"app/src/pi/theme.mjs": {"bytes": 1835,"sha256": "2fb5e6d44ff8f68a369c8a4cc203bd3f1bb6cdf8dd64a50674ea83118961d9e8"},"app/src/pi/xterm-terminal.mjs": {"bytes": 1496,"sha256": "152d6d8cf26932e4a01efcb9613513bb30bd892aa4f3096800b98884346cba48"},"app/src/protocol.mjs": {"bytes": 4981,"sha256": "1d4416d6a77b60aeb847d88e6d98ff9a580e8dcb163add5f42923f2d145bf52e"3 unmodified lines"sha256": "dec9e2962a0f5c076512368395017fb5af7c9f7bfbe8cfed10105072dbcb76fe"},"app/src/style.css": {"bytes": 7512,"sha256": "b6423d7323eb469f40c322ccb81e0b9f724a01e3c8c9794365222ccd63252dcb"},"app/src/workspace.mjs": {"bytes": 5206,"sha256": "d3bf4e77e6ab855cd4d10f11330f52531068a7ca13456ddf4c357d03bfee40e0"},"app/tests/browser.mjs": {"bytes": 9598,"sha256": "01f506319c6654b0deaa853bc8e79c3a034fb47b1f7a4e16fbbe7ca4ba257b8f"},"app/tests/dev-smoke.mjs": {"bytes": 1352,12 unmodified lines"sha256": "8cc0750f0861f5cf3d63e155c9ea4091bae5432a5a6719a55941d63599456e55"},"app/tests/space-embedded.mjs": {"bytes": 3599,"sha256": "c5475b6eda91e9dbbacc8e81dbaaf6f89ec41be390182d37739076c81157bf7f"},"app/tests/space-restricted.mjs": {"bytes": 2580,"sha256": "f71fb23f85cbf021cbf3f368e27687e64fb25cddf232dc1224202a920de78458"},"app/tests/terminal.mjs": {"bytes": 7329,"sha256": "d19a8df4e4559f75a6c8f5397dde82b42e522da49e637fb5a7ed5496603b8013"},"app/vendor/pi-coding-agent/LICENSE": {"bytes": 1069,"sha256": "0457f5bcec3b3b211605dfb5d1a49042fd638f3686a410fe099c24a25af13c48"},"app/vendor/pi-coding-agent/README.md": {"bytes": 1185,"sha256": "b7d5406662cbece954f1bcd53d99a15b41a867adbf225380ac40d08f3487da4b"},"app/vendor/pi-coding-agent/components/assistant-message.js": {"bytes": 7410,"sha256": "edbd1e712234609d2ad1078edcf960e3b6f549669075f1c5d1a7a4481e2b3d19"},"app/vendor/pi-coding-agent/components/custom-editor.js": {"bytes": 5095,"sha256": "000b0056f2bf645537537468bdd6f6ee0c82e4110f5417c1c70c2e8fefc04f29"},"app/vendor/pi-coding-agent/components/markdown-transform.js": {"bytes": 786,"sha256": "31ad2245189328104a31bb9b12f58b0a12e4af9c7924775a242c9dcd526d2c1a"},"app/vendor/pi-coding-agent/components/user-message.js": {"bytes": 1791,"sha256": "398a34b8a979daea5614be4cbbe6ff66e7eca97e9fd855508791dcddce994bc8"},"app/vendor/pi-coding-agent/provenance.json": {"bytes": 690,"sha256": "9f8797b8d55c60820d422d88f31cb5eec6d5e9283cd4d6f5a374649f7d535b0b"},"app/vendor/pi-coding-agent/theme/light.json": {"bytes": 2236,"sha256": "14c7172ba7e75eab6f509504de806af0f2d9ff817bfb45d9533bff15c7e6e657"},"app/vite.config.mjs": {"bytes": 1679,"sha256": "eab9d66533efd95e346d22f3f455c4c77a85c1386e82e14f3e72c4fdbb8d9c16"},"assets/agent.worker-DqQzo9yL.js": {"bytes": 2092911,"sha256": "1fc0006217cf28bf42951d1738e67d235b9516f9d579fa46064718759fd7ba28"},"assets/index-BRKUEVCq.js": {"bytes": 696106,"sha256": "d5eb8ca63b1d540c55787b03658c4c74dcb541f5f6fd18165bae838c42a21077"},"assets/index-DL-Ot0hN.css": {"bytes": 10345,"sha256": "8e50e0599e5a5e56558fbcf529b549cf55c4b609eb598772a19b8fb3db7437b1"},"assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm": {"bytes": 23567050,4 unmodified lines"sha256": "c5cf939c058ae5b63f0cdab8d1becc4544582d6ed74098e9c8460d3acb78309e"},"index.html": {"bytes": 3351,"sha256": "a32849e547e267c36f069003b8816134513c476ecade94bd82eb33ade4f641de"},"licenses/dependencies.txt": {"bytes": 1384222,"sha256": "6e11a0fa7b1140bc41a9c2f50d06bfa2f12906a45437f26e1f8048f30210d4ff"},"licenses/onnxruntime-LICENSE": {"bytes": 1073,7 unmodified lines"bytes": 1069,"sha256": "0457f5bcec3b3b211605dfb5d1a49042fd638f3686a410fe099c24a25af13c48"},"licenses/pi-components.json": {"bytes": 690,"sha256": "9f8797b8d55c60820d422d88f31cb5eec6d5e9283cd4d6f5a374649f7d535b0b"},"requirements-convert.txt": {"bytes": 254,"sha256": "2a2dca97d6a9480afff1ed0da8f5924610552cfe509d5081788455f9c1d71f8b"},"research/browser-agent/REPORT.md": {"bytes": 14214,"sha256": "29fd4bdec42d8eb0e6c13698badd6182efc24697cc44585a9783c7ecc52eff00"},"research/browser-agent/just-bash-README.md": {"bytes": 29503,56 unmodified lines"sha256": "b9bb39d5bd7bceb260d5eafa633f5af2e47a35d6132c8453d908ea6a4ad8a0f9"},"scripts/prepare_space.py": {"bytes": 3867,"sha256": "7f39c89f4df965e29ba05b7a5ee4fe4ec71e225f8e04ed0f6fb933c471938502"},"scripts/reference.py": {"bytes": 2652,47 unmodified lines"bytes": 2244,"sha256": "64f5f41f482beb1886a922d4f5872a8f82ad61b701ff45c9e21fb7980acd4ff7"},"validation/agent-terminal-dev.json": {"bytes": 12592,"sha256": "3c0dc1cad52da619a31abc0b86c892b37c32ac0fd44b62afb43f326bf5ac8d66"},"validation/agent-terminal-model.json": {"bytes": 55713,"sha256": "1cf1b205095b6cb15f62a3e799e3398ebefa0d1c265fedc18a83b0e24f6ae077"},"validation/agent-terminal.json": {"bytes": 2874,"sha256": "1f0bf618a027c1a5252c247f8a82da1d9ca1b10cb8e50575994effe4c0245e37"},"validation/benchmark-summary.json": {"bytes": 1500,"sha256": "5bc51fbdbc43b58caa2036b621ded2bd3b4c1c95ba487b07bb5b84f19e97ebc0"
5 unmodified lines6789101112138 unmodified lines22232425262728293031323334353637385 unmodified lines<link rel="icon" href="./favicon.svg" type="image/svg+xml"><meta name="description" content="Pi, MiniCPM5 and a bash workspace, running entirely in your browser."><title>Pi Β· Browser workspace</title><script type="module" crossorigin src="./assets/index-LA8xezhP.js"></script><link rel="stylesheet" crossorigin href="./assets/index-Cfkr7NLu.css"></head><body><header><a class="brand" href="./"><span class="pi">Ο</span><span>Pi <small>browser workspace</small></span></a>8 unmodified lines<div id="load-detail" class="muted"></div><a id="open-tab" class="button" target="_blank" rel="noopener noreferrer" hidden>Open workspace in a new tab β</a></div><div id="messages" role="log" aria-label="Messages" aria-live="polite"><div id="welcome"><div class="eyebrow">A small agent. A real workspace.</div><h1>What shall we work on?</h1><p>Chat with Pi, work with files, and run shell commands.<br>The model and every tool run here, in your browser.</p><div class="suggestions"><button data-prompt="Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file.">Analyze the sample data <span>β</span></button><button data-prompt="Create a bash script called hello.sh that prints Hello from the browser, run it, and report the output.">Write and run a script <span>β</span></button></div></div></div><div id="notice" role="status" hidden></div><form id="chat-form"><label class="sr-only" for="prompt">Message Pi</label><textarea id="prompt" rows="3" placeholder="Ask Pi to work on somethingβ¦"></textarea><div class="composer-footer"><span id="activity">Files and chat are saved on this device.</span><button id="stop" type="button" hidden>Stop</button><button id="send" class="primary" disabled>Send β</button></div></form><footer>Pi agent core Β· just-bash Β· Transformers.js <span>4,096 token context</span></footer></section><aside class="workspace" aria-label="Workspace"><div class="workspace-heading"><h2>Workspace</h2><div><button id="add-file" class="quiet">+ File</button><label class="button quiet" for="upload">Import</label><input id="upload" type="file" multiple hidden><button id="export" class="quiet">Export</button></div></div>5 unmodified lines6789101112138 unmodified lines222324252627282930315 unmodified lines<link rel="icon" href="./favicon.svg" type="image/svg+xml"><meta name="description" content="Pi, MiniCPM5 and a bash workspace, running entirely in your browser."><title>Pi Β· Browser workspace</title><script type="module" crossorigin src="./assets/index-BRKUEVCq.js"></script><link rel="stylesheet" crossorigin href="./assets/index-DL-Ot0hN.css"></head><body><header><a class="brand" href="./"><span class="pi">Ο</span><span>Pi <small>browser workspace</small></span></a>8 unmodified lines<div id="load-detail" class="muted"></div><a id="open-tab" class="button" target="_blank" rel="noopener noreferrer" hidden>Open workspace in a new tab β</a></div><div id="pi-terminal" aria-label="Pi terminal"></div><div id="notice" role="status" hidden></div><div class="terminal-controls"><span id="activity" role="status">Files and chat are saved on this device.</span><button id="newline" type="button" title="Insert a newline (Shift+Enter)">β΅ Newline</button><button id="stop" type="button" hidden>Stop</button><button id="send" class="primary">Send β</button></div><footer>Pi TUI Β· xterm.js <span>Model and tools run in your browser</span></footer></section><aside class="workspace" aria-label="Workspace"><div class="workspace-heading"><h2>Workspace</h2><div><button id="add-file" class="quiet">+ File</button><label class="button quiet" for="upload">Import</label><input id="upload" type="file" multiple hidden><button id="export" class="quiet">Export</button></div></div>
4374 unmodified lines4375437643774378437943803707 unmodified lines808880898090809180928093347 unmodified lines8441844284438444844584468447815 unmodified lines926392649265926692679268853 unmodified lines1012210123101241012510126101272085 unmodified lines122131221412215122161221712218377 unmodified lines1259612597125981259912600126014374 unmodified lines@earendil-works/pi-telemetry@0.85.1 (MIT)----------------------------------------@esbuild/linux-x64@0.28.1 (MIT)3707 unmodified linesTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.----------------------------------------adm-zip@0.5.18 (MIT)347 unmodified lines----------------------------------------buffer@5.7.1 (MIT)The MIT License (MIT)Copyright (c) Feross Aboukhadijeh, and other contributors.815 unmodified linesTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.----------------------------------------expand-template@2.0.3 ((MIT OR WTFPL))853 unmodified lineslimitations under the License.----------------------------------------github-from-package@0.0.0 (MIT)2085 unmodified linesOTHER DEALINGS IN THE SOFTWARE.----------------------------------------matcher@3.0.0 (MIT)377 unmodified lines----------------------------------------object-keys@1.1.1 (MIT)4374 unmodified lines437543764377437843794380438143824383438443853707 unmodified lines80938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148347 unmodified lines8496849784988499850085018502815 unmodified lines931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350853 unmodified lines10204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102232085 unmodified lines12309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363377 unmodified lines127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129424374 unmodified lines@earendil-works/pi-telemetry@0.85.1 (MIT)----------------------------------------@earendil-works/pi-tui@0.85.1 (MIT)----------------------------------------@esbuild/linux-x64@0.28.1 (MIT)3707 unmodified linesTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.----------------------------------------@xterm/addon-fit@0.11.0 (MIT)Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.----------------------------------------@xterm/xterm@6.0.0 (MIT)Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com)Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.----------------------------------------adm-zip@0.5.18 (MIT)347 unmodified lines----------------------------------------buffer@6.0.3 (MIT)The MIT License (MIT)Copyright (c) Feross Aboukhadijeh, and other contributors.815 unmodified linesTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.----------------------------------------events@3.3.0 (MIT)MITCopyright Joyent, Inc. and other Node contributors.Permission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permitpersons to whom the Software is furnished to do so, subject to thefollowing conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. INNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OROTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THEUSE OR OTHER DEALINGS IN THE SOFTWARE.----------------------------------------expand-template@2.0.3 ((MIT OR WTFPL))853 unmodified lineslimitations under the License.----------------------------------------get-east-asian-width@1.6.0 (MIT)MIT LicenseCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.----------------------------------------github-from-package@0.0.0 (MIT)2085 unmodified linesOTHER DEALINGS IN THE SOFTWARE.----------------------------------------marked@18.0.5 (MIT)# License information## Contribution License AgreementIf you contribute code to this project, you are implicitly allowing your codeto be distributed under the MIT license. You are also implicitly verifying thatall code is your original work. `</legalese>`## MarkedCopyright (c) 2018+, MarkedJS (https://github.com/markedjs/)Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.## MarkdownCopyright Β© 2004, John Gruberhttp://daringfireball.net/All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.* Neither the name βMarkdownβ nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.This software is provided by the copyright holders and contributors βas isβ and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.----------------------------------------matcher@3.0.0 (MIT)377 unmodified lines----------------------------------------node-gyp-build@4.8.4 (MIT)The MIT License (MIT)Copyright (c) 2017 Mathias BuusPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.----------------------------------------node-liblzma@2.2.0 (LGPL-3.0)GNU LESSER GENERAL PUBLIC LICENSEVersion 3, 29 June 2007Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>Everyone is permitted to copy and distribute verbatim copiesof this license document, but changing it is not allowed.This version of the GNU Lesser General Public License incorporatesthe terms and conditions of version 3 of the GNU General PublicLicense, supplemented by the additional permissions listed below.0. Additional Definitions.As used herein, "this License" refers to version 3 of the GNU LesserGeneral Public License, and the "GNU GPL" refers to version 3 of the GNUGeneral Public License."The Library" refers to a covered work governed by this License,other than an Application or a Combined Work as defined below.An "Application" is any work that makes use of an interface providedby the Library, but which is not otherwise based on the Library.Defining a subclass of a class defined by the Library is deemed a modeof using an interface provided by the Library.A "Combined Work" is a work produced by combining or linking anApplication with the Library. The particular version of the Librarywith which the Combined Work was made is also called the "LinkedVersion".The "Minimal Corresponding Source" for a Combined Work means theCorresponding Source for the Combined Work, excluding any source codefor portions of the Combined Work that, considered in isolation, arebased on the Application, and not on the Linked Version.The "Corresponding Application Code" for a Combined Work means theobject code and/or source code for the Application, including any dataand utility programs needed for reproducing the Combined Work from theApplication, but excluding the System Libraries of the Combined Work.1. Exception to Section 3 of the GNU GPL.You may convey a covered work under sections 3 and 4 of this Licensewithout being bound by section 3 of the GNU GPL.2. Conveying Modified Versions.If you modify a copy of the Library, and, in your modifications, afacility refers to a function or data to be supplied by an Applicationthat uses the facility (other than as an argument passed when thefacility is invoked), then you may convey a copy of the modifiedversion:a) under this License, provided that you make a good faith effort toensure that, in the event an Application does not supply thefunction or data, the facility still operates, and performswhatever part of its purpose remains meaningful, orb) under the GNU GPL, with none of the additional permissions ofthis License applicable to that copy.3. Object Code Incorporating Material from Library Header Files.The object code form of an Application may incorporate material froma header file that is part of the Library. You may convey such objectcode under terms of your choice, provided that, if the incorporatedmaterial is not limited to numerical parameters, data structurelayouts and accessors, or small macros, inline functions and templates(ten or fewer lines in length), you do both of the following:a) Give prominent notice with each copy of the object code that theLibrary is used in it and that the Library and its use arecovered by this License.b) Accompany the object code with a copy of the GNU GPL and this licensedocument.4. Combined Works.You may convey a Combined Work under terms of your choice that,taken together, effectively do not restrict modification of theportions of the Library contained in the Combined Work and reverseengineering for debugging such modifications, if you also do each ofthe following:a) Give prominent notice with each copy of the Combined Work thatthe Library is used in it and that the Library and its use arecovered by this License.b) Accompany the Combined Work with a copy of the GNU GPL and this licensedocument.c) For a Combined Work that displays copyright notices duringexecution, include the copyright notice for the Library amongthese notices, as well as a reference directing the user to thecopies of the GNU GPL and this license document.d) Do one of the following:0) Convey the Minimal Corresponding Source under the terms of thisLicense, and the Corresponding Application Code in a formsuitable for, and under terms that permit, the user torecombine or relink the Application with a modified version ofthe Linked Version to produce a modified Combined Work, in themanner specified by section 6 of the GNU GPL for conveyingCorresponding Source.1) Use a suitable shared library mechanism for linking with theLibrary. A suitable mechanism is one that (a) uses at run timea copy of the Library already present on the user's computersystem, and (b) will operate properly with a modified versionof the Library that is interface-compatible with the LinkedVersion.e) Provide Installation Information, but only if you would otherwisebe required to provide such information under section 6 of theGNU GPL, and only to the extent that such information isnecessary to install and execute a modified version of theCombined Work produced by recombining or relinking theApplication with a modified version of the Linked Version. (Ifyou use option 4d0, the Installation Information must accompanythe Minimal Corresponding Source and Corresponding ApplicationCode. If you use option 4d1, you must provide the InstallationInformation in the manner specified by section 6 of the GNU GPLfor conveying Corresponding Source.)5. Combined Libraries.You may place library facilities that are a work based on theLibrary side by side in a single library together with other libraryfacilities that are not Applications and are not covered by thisLicense, and convey such a combined library under terms of yourchoice, if you do both of the following:a) Accompany the combined library with a copy of the same work basedon the Library, uncombined with any other library facilities,conveyed under the terms of this License.b) Give prominent notice with the combined library that part of itis a work based on the Library, and explaining where to find theaccompanying uncombined form of the same work.6. Revised Versions of the GNU Lesser General Public License.The Free Software Foundation may publish revised and/or new versionsof the GNU Lesser General Public License from time to time. Such newversions will be similar in spirit to the present version, but maydiffer in detail to address new problems or concerns.Each version is given a distinguishing version number. If theLibrary as you received it specifies that a certain numbered versionof the GNU Lesser General Public License "or any later version"applies to it, you have the option of following the terms andconditions either of that published version or of any later versionpublished by the Free Software Foundation. If the Library as youreceived it does not specify a version number of the GNU LesserGeneral Public License, you may choose any version of the GNU LesserGeneral Public License ever published by the Free Software Foundation.If the Library as you received it specifies that a proxy can decidewhether future versions of the GNU Lesser General Public License shallapply, that proxy's public statement of acceptance of any version ispermanent authorization for you to choose that version for theLibrary.----------------------------------------object-keys@1.1.1 (MIT)
123456789101112{ "package": "@earendil-works/pi-coding-agent", "version": "0.85.1", "source": "https://github.com/earendil-works/pi/tree/v0.85.1/packages/coding-agent", "files": { "components/custom-editor.js": "000b0056f2bf645537537468bdd6f6ee0c82e4110f5417c1c70c2e8fefc04f29", "components/user-message.js": "398a34b8a979daea5614be4cbbe6ff66e7eca97e9fd855508791dcddce994bc8", "components/assistant-message.js": "edbd1e712234609d2ad1078edcf960e3b6f549669075f1c5d1a7a4481e2b3d19", "components/markdown-transform.js": "31ad2245189328104a31bb9b12f58b0a12e4af9c7924775a242c9dcd526d2c1a", "theme/light.json": "14c7172ba7e75eab6f509504de806af0f2d9ff817bfb45d9533bff15c7e6e657" }}27 unmodified lines2829303132333417 unmodified lines52535427 unmodified lines## Current validation artifacts- `validation/agent-browser.json`: initial actual-model integration and reload evidence.- `validation/agent-browser-hub.json`: public model download, interrupted-load retry, actual offline agent workflows, editing, tool-error handling, and persistence.- `validation/agent-browser-limit128.json`: the same runtime under smaller GPU buffer limits.- `app/tests/protocol.test.mjs`: XML/CDATAs, malformed call rejection, history/context conversion, real just-bash commands, lossless workspace restoration, and inert Markdown rendering.17 unmodified linesThe embedded page initially exposed denied OPFS, IndexedDB, and Web Locks access. Inspection identified Playwright 1.58's default `--disable-features` list as explicitly disabling `ThirdPartyStoragePartitioning`. Restoring only normal Chromium storage partitioning allowed the real Hugging Face iframe to load the model and complete the CSV/report task through its actual chat controls. The app also provides a direct new-tab link when a browser does deny embedded storage. This does not change browser privacy settings or grant storage permission automatically. Hugging Face documents the cross-domain iframe structure and related restrictions in its [cookie limitations guide](https://huggingface.co/docs/hub/spaces-cookie-limitations).`validation/agent-space-deployment.json`, `agent-space-embedded.json`, and `agent-space-checksums.json` contain the deployed results. The restricted-storage/new-tab path has a separate browser test in `app/tests/space-restricted.mjs`.27 unmodified lines2829303132333417 unmodified lines5253545556575859606162636465666768697071727327 unmodified lines## Current validation artifacts- `validation/agent-browser.json`: latest actual-model integration and reload evidence (also saved as `agent-terminal-model.json` for the terminal integration).- `validation/agent-browser-hub.json`: public model download, interrupted-load retry, actual offline agent workflows, editing, tool-error handling, and persistence.- `validation/agent-browser-limit128.json`: the same runtime under smaller GPU buffer limits.- `app/tests/protocol.test.mjs`: XML/CDATAs, malformed call rejection, history/context conversion, real just-bash commands, lossless workspace restoration, and inert Markdown rendering.17 unmodified linesThe embedded page initially exposed denied OPFS, IndexedDB, and Web Locks access. Inspection identified Playwright 1.58's default `--disable-features` list as explicitly disabling `ThirdPartyStoragePartitioning`. Restoring only normal Chromium storage partitioning allowed the real Hugging Face iframe to load the model and complete the CSV/report task through its actual chat controls. The app also provides a direct new-tab link when a browser does deny embedded storage. This does not change browser privacy settings or grant storage permission automatically. Hugging Face documents the cross-domain iframe structure and related restrictions in its [cookie limitations guide](https://huggingface.co/docs/hub/spaces-cookie-limitations).`validation/agent-space-deployment.json`, `agent-space-embedded.json`, and `agent-space-checksums.json` contain the deployed results. The restricted-storage/new-tab path has a separate browser test in `app/tests/space-restricted.mjs`.## Pi terminal UI in xterm.js β 2026-09-12The left column now uses Pi's original terminal UI through xterm.js. The user chose to keep all execution in the browser. This is a browser host for Pi's presentation components and agent core; it does not launch the full Node CLI.Pi's published `Terminal` interface accepts input, output, resize, and lifecycle operations, making xterm.js a suitable replacement for `ProcessTerminal`. The browser imports `TuiAltScreen`, `Editor`, Markdown, containers, scroll/search handling, keybindings, and `StdinBuffer` from `@earendil-works/pi-tui@0.85.1`. It also uses the unmodified CLI `CustomEditor`, `UserMessageComponent`, and `AssistantMessageComponent` copied from the matching npm tarball, with SHA-256 provenance and MIT licensing. [Pi TUI documentation](https://github.com/earendil-works/pi/tree/v0.85.1/packages/tui), [CLI presentation source](https://github.com/earendil-works/pi/tree/v0.85.1/packages/coding-agent/src/modes/interactive/components), [xterm fit addon documentation](https://xtermjs.org/docs/guides/using-addons/).The original CLI entry point depends on Node filesystem/process services and native terminal discovery. Browser-specific host adapters instead supply the terminal, scheduling, Buffer/EventEmitter, clipboard, text-only terminal capabilities, and the upstream light theme without its file watcher. The build selects only the required TUI exports, leaving Node startup and provider/extension management out. Every vendored component is verified against its recorded upstream checksum when Vite loads its config. There are no edits to installed or vendored Pi source files.App code connects Pi's editor to the existing worker and implements `/help`, `/load`, `/new`, `/clear`, `!command`, virtual-file completion, and just-bash tool cards. The worker bundle remains `agent.worker-DqQzo9yL.js`: model inference, quantization, downloads, and agent tool execution are unchanged. The terminal uses xterm's default renderer, without a second WebGPU/WebGL rendering context.The browser adapter preserves native clipboard paste and sends Shift+Enter as Alt+Enter. It translates Ctrl+Shift+F into CSI-u because legacy terminal input otherwise loses that modifier distinction. Large Pi paste markers are expanded before the Send button submits text. Text from tools, files, and model messages is stripped of terminal control sequences before presentation; only user-clicked HTTP(S) Markdown links may open a tab. Images do not download.`validation/agent-terminal.json` and `agent-terminal-dev.json` record the production/development keyboard checks: multiline editing, cursor/deletion operations, prompt history, slash completion, shell file writes, escape-sequence stripping, Unicode clipboard paste, large-paste expansion, and live resizing from 90 to 40 columns while preserving a draft. A dedicated inner mount keeps xterm's fit calculation inside the panel's padding. Development mode explicitly bundles the CommonJS EventEmitter/Buffer dependencies and adapts versioned module URLs.`validation/agent-terminal-model.json` records five real MiniCPM workflows submitted through xterm keyboard input and Pi's editor: unseen-file read, CSV calculation/report, script creation/execution, edit/verification, and recovery from a missing-file error. All passed. Escape stopped generation; editor/import/manual shell, persistence, and cache reload passed. Verified cached model setup took 2.281 seconds and the subsequent reload 2.122 seconds in this run. The five workflows made zero network requests with networking disabled. Reload fetched zero weight shards. These are integration observations on the desktop AMD GPU, not a new quality or throughput benchmark.An early automation attempt used CDP bulk `insertText`, which did not traverse xterm's normal keyboard input path and left the test waiting for a draft. The final model suite uses actual keyboard events. Physical Android/iOS input methods, mobile GPU execution, and embedded hosting of this new terminal build have not been verified. The previous deployed Space evidence remains evidence for the earlier chat UI.
22 unmodified lines232425262728297 unmodified lines37383940414222 unmodified linesapp_out.mkdir()for name in ['package.json', 'package-lock.json', 'index.html', 'vite.config.mjs', 'README.md']:shutil.copyfile(root / 'app' / name, app_out / name)for name in ['src', 'scripts', 'public', 'tests']:shutil.copytree(root / 'app' / name, app_out / name)validation = out / 'validation'7 unmodified lines'agent-browser-no-gpu.json', 'agent-completion.json','agent-space-deployment.json', 'agent-space-embedded.json', 'agent-space-restricted.json','agent-space-checksums.json',]:source = root / 'validation' / nameif source.is_file():22 unmodified lines232425262728297 unmodified lines3738394041424322 unmodified linesapp_out.mkdir()for name in ['package.json', 'package-lock.json', 'index.html', 'vite.config.mjs', 'README.md']:shutil.copyfile(root / 'app' / name, app_out / name)for name in ['src', 'scripts', 'public', 'tests', 'vendor']:shutil.copytree(root / 'app' / name, app_out / name)validation = out / 'validation'7 unmodified lines'agent-browser-no-gpu.json', 'agent-completion.json','agent-space-deployment.json', 'agent-space-embedded.json', 'agent-space-restricted.json','agent-space-checksums.json','agent-terminal.json', 'agent-terminal-model.json', 'agent-terminal-dev.json',]:source = root / 'validation' / nameif source.is_file():
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157{ "date": "2026-09-12T08:25:07.051Z", "url": "http://127.0.0.1:5173/", "errors": [], "requests": [ "http://127.0.0.1:5173/", "http://127.0.0.1:5173/@vite/client", "http://127.0.0.1:5173/src/main.mjs?t=1789201506558", "http://127.0.0.1:5173/node_modules/vite/dist/client/env.mjs", "http://127.0.0.1:5173/src/style.css", "http://127.0.0.1:5173/src/pi/terminal-ui.mjs?t=1789201506558", "http://127.0.0.1:5173/node_modules/.vite/deps/@xterm_xterm.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/@xterm_addon-fit.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@xterm/xterm/css/xterm.css", "http://127.0.0.1:5173/src/pi/entry.mjs", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/custom-editor.js", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/user-message.js", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/assistant-message.js", "http://127.0.0.1:5173/src/pi/theme.mjs", "http://127.0.0.1:5173/src/pi/xterm-terminal.mjs", "http://127.0.0.1:5173/src/protocol.mjs", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/markdown-transform.js", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/tui.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/editor.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/text.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/markdown.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/box.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/spacer.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/keybindings.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/keys.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/utils.js?v=55d56926", "http://127.0.0.1:5173/", "http://127.0.0.1:5173/vendor/pi-coding-agent/theme/light.json?import", "http://127.0.0.1:5173/node_modules/.vite/deps/@xmldom_xmldom.js?v=55d56926", "http://127.0.0.1:5173/src/pi/browser-host.mjs", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/terminal-colors.js?v=55d56926", "http://127.0.0.1:5173/src/pi/capabilities.mjs", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/layout.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/layout-node.js?v=55d56926", "http://127.0.0.1:5173/node_modules/marked/lib/marked.esm.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/latex.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/kill-ring.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/undo-stack.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/word-navigation.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/select-list.js?v=55d56926", "http://127.0.0.1:5173/@vite/client", "http://127.0.0.1:5173/src/main.mjs?t=1789201506558", "http://127.0.0.1:5173/node_modules/vite/dist/client/env.mjs", "http://127.0.0.1:5173/src/style.css", "http://127.0.0.1:5173/src/pi/terminal-ui.mjs?t=1789201506558", "http://127.0.0.1:5173/node_modules/.vite/deps/@xterm_xterm.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/@xterm_addon-fit.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@xterm/xterm/css/xterm.css", "http://127.0.0.1:5173/src/pi/entry.mjs", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/custom-editor.js", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/user-message.js", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/assistant-message.js", "http://127.0.0.1:5173/src/pi/theme.mjs", "http://127.0.0.1:5173/src/pi/xterm-terminal.mjs", "http://127.0.0.1:5173/src/protocol.mjs", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/tui.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/editor.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/text.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/markdown.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/box.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/spacer.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/keybindings.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/keys.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/utils.js?v=55d56926", "http://127.0.0.1:5173/src/pi/browser-host.mjs", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/layout.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/layout-node.js?v=55d56926", "http://127.0.0.1:5173/src/pi/capabilities.mjs", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/terminal-colors.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/kill-ring.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/undo-stack.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/word-navigation.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/select-list.js?v=55d56926", "http://127.0.0.1:5173/node_modules/marked/lib/marked.esm.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/latex.js?v=55d56926", "http://127.0.0.1:5173/vendor/pi-coding-agent/components/markdown-transform.js", "http://127.0.0.1:5173/vendor/pi-coding-agent/theme/light.json?import", "http://127.0.0.1:5173/node_modules/.vite/deps/@xmldom_xmldom.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/stack.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/events.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/buffer.js?v=55d56926", "http://127.0.0.1:5173/node_modules/@earendil-works/pi-tui/dist/components/input.js?v=55d56926", "http://127.0.0.1:5173/node_modules/get-east-asian-width/index.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/rolldown-runtime-B-lAHAz2.js?v=55d56926", "http://127.0.0.1:5173/node_modules/get-east-asian-width/lookup.js?v=55d56926", "http://127.0.0.1:5173/node_modules/get-east-asian-width/lookup-data.js?v=55d56926", "http://127.0.0.1:5173/node_modules/get-east-asian-width/utilities.js?v=55d56926", "http://127.0.0.1:5173/src/agent.worker.mjs?worker_file&type=module", "http://127.0.0.1:5173/node_modules/vite/dist/client/env.mjs", "http://127.0.0.1:5173/node_modules/.vite/deps/@earendil-works_pi-agent-core.js?v=55d56926", "http://127.0.0.1:5173/src/inference.mjs", "http://127.0.0.1:5173/src/workspace.mjs", "http://127.0.0.1:5173/src/storage.mjs", "http://127.0.0.1:5173/node_modules/.vite/deps/@huggingface_transformers.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/@earendil-works_pi-ai_utils_event-stream.js?v=55d56926", "http://127.0.0.1:5173/src/download.mjs", "http://127.0.0.1:5173/src/protocol.mjs", "http://127.0.0.1:5173/node_modules/.vite/deps/just-bash_browser.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/@earendil-works_pi-ai.js?v=55d56926", "http://127.0.0.1:5173/favicon.svg", "http://127.0.0.1:5173/node_modules/.vite/deps/rolldown-runtime-B-lAHAz2.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/dist-HiCO7I8Y.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/libesm-Ds0pOwVw.js?v=55d56926", "http://127.0.0.1:5173/node_modules/.vite/deps/hash-wasm.js?v=55d56926", "http://127.0.0.1:5173/src/model-manifest.json?import", "http://127.0.0.1:5173/node_modules/.vite/deps/@xmldom_xmldom.js?v=55d56926", "http://127.0.0.1:5173/@vite/client" ], "checks": [ "Original Pi TUI rendered through xterm", "Enter submits /help without loading a model", "Pi fullscreen transcript search preserves the editor draft", "Pi multiline editor: Shift+Enter, cursor, deletion, Ctrl+U/K", "Pi prompt history", "Pi autocomplete: /he β /help", "xterm keyboard β Pi editor β real just-bash β workspace file", "Shell escape sequences render as inert text", "Large Pi paste markers expand before Send", "Unicode multiline clipboard paste", "Touch-accessible newline button", "390px layout and live terminal resize preserve the draft" ], "initial": " \n Ο Pi browser workspace \n \n Ask Pi to work with the files on the right. \n \n /load load MiniCPM \n /help show commands \n !ls run a workspace command \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Files and chat are saved on this device. \nββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n \nββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n /workspace Β· MiniCPM5-2B Β· 4,096 context ", "sizes": { "desktop": { "cols": 90, "rows": 41 }, "mobile": { "cols": 40, "rows": 32 } }, "mobileLimitation": "Desktop Chromium viewport simulation; physical mobile keyboards and GPUs not tested.", "passed": true}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885{ "date": "2026-09-12T08:21:57.234Z", "url": "http://127.0.0.1:4173/?source=local", "cases": [ { "name": "read-unseen-file", "elapsedMs": 2233, "version": 1, "files": { "/tmp/revenue.txt": "Notebook 12 5 60\nPencil 30 2 60\nFolder 8 3 24\nTOTAL: 144\n", "/workspace/README.md": "# Browser workspace\n\nPi can read, write, edit, and run shell commands here.\nEverything stays in this browser. Try analyzing sales.csv.\n", "/workspace/revenue.txt": "Notebook 12 5 -> 12 x 5 = 60\nPencil 30 2 -> 30 x 2 = 60\nFolder 8 3 -> 8 x 3 = 24\nTOTAL REVENUE: 144\n", "/workspace/sales.csv": "product,units,price\nNotebook,12,5\nPencil,30,2\nFolder,8,3\n", "/workspace/secret.txt": "LOCAL-fd008be1" }, "entries": [ [ "/", { "type": "directory", "mode": 493 } ], [ "/tmp", { "type": "directory", "mode": 493 } ], [ "/tmp/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSA2MApQZW5jaWwgMzAgMiA2MApGb2xkZXIgOCAzIDI0ClRPVEFMOiAxNDQK", "mode": 420 } ], [ "/usr", { "type": "directory", "mode": 493 } ], [ "/workspace", { "type": "directory", "mode": 493 } ], [ "/workspace/README.md", { "type": "file", "base64": "IyBCcm93c2VyIHdvcmtzcGFjZQoKUGkgY2FuIHJlYWQsIHdyaXRlLCBlZGl0LCBhbmQgcnVuIHNoZWxsIGNvbW1hbmRzIGhlcmUuCkV2ZXJ5dGhpbmcgc3RheXMgaW4gdGhpcyBicm93c2VyLiBUcnkgYW5hbHl6aW5nIHNhbGVzLmNzdi4K", "mode": 420 } ], [ "/workspace/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSAtPiAxMiB4IDUgPSA2MApQZW5jaWwgMzAgMiAtPiAzMCB4IDIgPSA2MApGb2xkZXIgOCAzIC0+IDggeCAzID0gMjQKVE9UQUwgUkVWRU5VRTogMTQ0Cg==", "mode": 420 } ], [ "/workspace/sales.csv", { "type": "file", "base64": "cHJvZHVjdCx1bml0cyxwcmljZQpOb3RlYm9vaywxMiw1ClBlbmNpbCwzMCwyCkZvbGRlciw4LDMK", "mode": 420 } ], [ "/workspace/secret.txt", { "type": "file", "base64": "TE9DQUwtZmQwMDhiZTE=", "mode": 420 } ] ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read secret.txt with the read tool and tell me its exact contents." } ], "timestamp": 1789201320594 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201320595, "content": [ { "type": "toolCall", "id": "4e94e30c-5284-416d-aacb-c66b4d8bc051", "name": "read", "arguments": { "path": "/workspace/secret.txt" } } ], "stopReason": "toolUse", "usage": { "input": 717, "output": 18, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 735, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "4e94e30c-5284-416d-aacb-c66b4d8bc051", "toolName": "read", "content": [ { "type": "text", "text": "LOCAL-fd008be1" } ], "details": {}, "isError": false, "timestamp": 1789201321616 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201321616, "content": [ { "type": "text", "text": "The read tool returned the contents of secret.txt as:\n\nLOCAL-fd008be1" } ], "stopReason": "stop", "usage": { "input": 771, "output": 20, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 791, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } } ] }, { "name": "analyze-and-write", "elapsedMs": 8251, "version": 1, "files": { "/tmp/revenue.txt": "Notebook 12 5 60\nPencil 30 2 60\nFolder 8 3 24\nTOTAL: 144\n", "/workspace/README.md": "# Browser workspace\n\nPi can read, write, edit, and run shell commands here.\nEverything stays in this browser. Try analyzing sales.csv.\n", "/workspace/report.md": "# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n", "/workspace/revenue.txt": "Notebook 12 5 -> 12 x 5 = 60\nPencil 30 2 -> 30 x 2 = 60\nFolder 8 3 -> 8 x 3 = 24\nTOTAL REVENUE: 144\n", "/workspace/sales.csv": "product,units,price\nNotebook,12,5\nPencil,30,2\nFolder,8,3\n", "/workspace/secret.txt": "LOCAL-fd008be1" }, "entries": [ [ "/", { "type": "directory", "mode": 493 } ], [ "/tmp", { "type": "directory", "mode": 493 } ], [ "/tmp/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSA2MApQZW5jaWwgMzAgMiA2MApGb2xkZXIgOCAzIDI0ClRPVEFMOiAxNDQK", "mode": 420 } ], [ "/usr", { "type": "directory", "mode": 493 } ], [ "/workspace", { "type": "directory", "mode": 493 } ], [ "/workspace/README.md", { "type": "file", "base64": "IyBCcm93c2VyIHdvcmtzcGFjZQoKUGkgY2FuIHJlYWQsIHdyaXRlLCBlZGl0LCBhbmQgcnVuIHNoZWxsIGNvbW1hbmRzIGhlcmUuCkV2ZXJ5dGhpbmcgc3RheXMgaW4gdGhpcyBicm93c2VyLiBUcnkgYW5hbHl6aW5nIHNhbGVzLmNzdi4K", "mode": 420 } ], [ "/workspace/report.md", { "type": "file", "base64": "IyBTYWxlcyBSZXBvcnQKClRvdGFsIHJldmVudWUgZnJvbSBzYWxlcy5jc3YgaXMgKiokMTQ0KiouCgotIE5vdGVib29rOiAxMiDDlyAkNSA9ICQ2MAotIFBlbmNpbDogMzAgw5cgJDIgPSAkNjAKLSBGb2xkZXI6IDggw5cgJDMgPSAkMjQK", "mode": 420 } ], [ "/workspace/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSAtPiAxMiB4IDUgPSA2MApQZW5jaWwgMzAgMiAtPiAzMCB4IDIgPSA2MApGb2xkZXIgOCAzIC0+IDggeCAzID0gMjQKVE9UQUwgUkVWRU5VRTogMTQ0Cg==", "mode": 420 } ], [ "/workspace/sales.csv", { "type": "file", "base64": "cHJvZHVjdCx1bml0cyxwcmljZQpOb3RlYm9vaywxMiw1ClBlbmNpbCwzMCwyCkZvbGRlciw4LDMK", "mode": 420 } ], [ "/workspace/secret.txt", { "type": "file", "base64": "TE9DQUwtZmQwMDhiZTE=", "mode": 420 } ] ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read sales.csv, calculate total revenue using bash, and save a short report to report.md. Verify the file." } ], "timestamp": 1789201322878 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201322878, "content": [ { "type": "toolCall", "id": "d609cb7d-ae48-45c5-8042-95e3aac1e0ca", "name": "read", "arguments": { "path": "/workspace/sales.csv" } } ], "stopReason": "toolUse", "usage": { "input": 726, "output": 18, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 744, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "d609cb7d-ae48-45c5-8042-95e3aac1e0ca", "toolName": "read", "content": [ { "type": "text", "text": "product,units,price\nNotebook,12,5\nPencil,30,2\nFolder,8,3\n" } ], "details": {}, "isError": false, "timestamp": 1789201323848 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201323848, "content": [ { "type": "toolCall", "id": "24c2dfa0-6414-418a-8c15-c1f246eabd3e", "name": "bash", "arguments": { "command": "awk -F',' 'NR>1 {rev=$2*$3; total+=rev; print $1,$2,$3,\"->\",$2,\"x\",$3,\"=\",rev} END {print \"TOTAL REVENUE:\", total}' sales.csv > revenue.txt && cat revenue.txt" } } ], "stopReason": "toolUse", "usage": { "input": 798, "output": 78, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 876, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "24c2dfa0-6414-418a-8c15-c1f246eabd3e", "toolName": "bash", "content": [ { "type": "text", "text": "Notebook 12 5 -> 12 x 5 = 60\nPencil 30 2 -> 30 x 2 = 60\nFolder 8 3 -> 8 x 3 = 24\nTOTAL REVENUE: 144\n\nExit code: 0" } ], "details": { "exitCode": 0 }, "isError": false, "timestamp": 1789201325902 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201325902, "content": [ { "type": "toolCall", "id": "28f41bf2-1b3f-4d1d-85cc-d3e26f230be8", "name": "write", "arguments": { "path": "report.md", "content": "# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n" } } ], "stopReason": "toolUse", "usage": { "input": 964, "output": 79, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 1043, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "28f41bf2-1b3f-4d1d-85cc-d3e26f230be8", "toolName": "write", "content": [ { "type": "text", "text": "Wrote /workspace/report.md" } ], "details": {}, "isError": false, "timestamp": 1789201328112 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201328112, "content": [ { "type": "toolCall", "id": "92952bd2-6deb-45ef-b1d1-ee04a554d595", "name": "read", "arguments": { "path": "/workspace/report.md" } } ], "stopReason": "toolUse", "usage": { "input": 1079, "output": 18, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 1097, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "92952bd2-6deb-45ef-b1d1-ee04a554d595", "toolName": "read", "content": [ { "type": "text", "text": "# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n" } ], "details": {}, "isError": false, "timestamp": 1789201329332 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201329332, "content": [ { "type": "text", "text": "Done. The report is saved at `/workspace/report.md` with total revenue of $144 (Notebook $60, Pencil $60, Folder $24)." } ], "stopReason": "stop", "usage": { "input": 1180, "output": 35, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 1215, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } } ] }, { "name": "write-and-run-script", "elapsedMs": 4368, "version": 1, "files": { "/tmp/revenue.txt": "Notebook 12 5 60\nPencil 30 2 60\nFolder 8 3 24\nTOTAL: 144\n", "/workspace/README.md": "# Browser workspace\n\nPi can read, write, edit, and run shell commands here.\nEverything stays in this browser. Try analyzing sales.csv.\n", "/workspace/hello.sh": "#!/bin/bash\necho \"Hello from the browser\"\n", "/workspace/report.md": "# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n", "/workspace/revenue.txt": "Notebook 12 5 -> 12 x 5 = 60\nPencil 30 2 -> 30 x 2 = 60\nFolder 8 3 -> 8 x 3 = 24\nTOTAL REVENUE: 144\n", "/workspace/sales.csv": "product,units,price\nNotebook,12,5\nPencil,30,2\nFolder,8,3\n", "/workspace/secret.txt": "LOCAL-fd008be1" }, "entries": [ [ "/", { "type": "directory", "mode": 493 } ], [ "/tmp", { "type": "directory", "mode": 493 } ], [ "/tmp/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSA2MApQZW5jaWwgMzAgMiA2MApGb2xkZXIgOCAzIDI0ClRPVEFMOiAxNDQK", "mode": 420 } ], [ "/usr", { "type": "directory", "mode": 493 } ], [ "/workspace", { "type": "directory", "mode": 493 } ], [ "/workspace/README.md", { "type": "file", "base64": "IyBCcm93c2VyIHdvcmtzcGFjZQoKUGkgY2FuIHJlYWQsIHdyaXRlLCBlZGl0LCBhbmQgcnVuIHNoZWxsIGNvbW1hbmRzIGhlcmUuCkV2ZXJ5dGhpbmcgc3RheXMgaW4gdGhpcyBicm93c2VyLiBUcnkgYW5hbHl6aW5nIHNhbGVzLmNzdi4K", "mode": 420 } ], [ "/workspace/hello.sh", { "type": "file", "base64": "IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8gZnJvbSB0aGUgYnJvd3NlciIK", "mode": 493 } ], [ "/workspace/report.md", { "type": "file", "base64": "IyBTYWxlcyBSZXBvcnQKClRvdGFsIHJldmVudWUgZnJvbSBzYWxlcy5jc3YgaXMgKiokMTQ0KiouCgotIE5vdGVib29rOiAxMiDDlyAkNSA9ICQ2MAotIFBlbmNpbDogMzAgw5cgJDIgPSAkNjAKLSBGb2xkZXI6IDggw5cgJDMgPSAkMjQK", "mode": 420 } ], [ "/workspace/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSAtPiAxMiB4IDUgPSA2MApQZW5jaWwgMzAgMiAtPiAzMCB4IDIgPSA2MApGb2xkZXIgOCAzIC0+IDggeCAzID0gMjQKVE9UQUwgUkVWRU5VRTogMTQ0Cg==", "mode": 420 } ], [ "/workspace/sales.csv", { "type": "file", "base64": "cHJvZHVjdCx1bml0cyxwcmljZQpOb3RlYm9vaywxMiw1ClBlbmNpbCwzMCwyCkZvbGRlciw4LDMK", "mode": 420 } ], [ "/workspace/secret.txt", { "type": "file", "base64": "TE9DQUwtZmQwMDhiZTE=", "mode": 420 } ] ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Create a bash script called hello.sh that prints Hello from the browser, run it, and report the output." } ], "timestamp": 1789201331178 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201331178, "content": [ { "type": "toolCall", "id": "b5138935-5cd3-40e5-8021-af9f2b79ca14", "name": "write", "arguments": { "path": "/workspace/hello.sh", "content": "#!/bin/bash\necho \"Hello from the browser\"\n" } } ], "stopReason": "toolUse", "usage": { "input": 725, "output": 43, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "b5138935-5cd3-40e5-8021-af9f2b79ca14", "toolName": "write", "content": [ { "type": "text", "text": "Wrote /workspace/hello.sh" } ], "details": {}, "isError": false, "timestamp": 1789201332541 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201332541, "content": [ { "type": "toolCall", "id": "26cda3ca-c25b-436b-bf85-33d3dd3eac83", "name": "bash", "arguments": { "command": "chmod +x /workspace/hello.sh && /workspace/hello.sh" } } ], "stopReason": "toolUse", "usage": { "input": 804, "output": 34, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 838, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "26cda3ca-c25b-436b-bf85-33d3dd3eac83", "toolName": "bash", "content": [ { "type": "text", "text": "Hello from the browser\n\nExit code: 0" } ], "details": { "exitCode": 0 }, "isError": false, "timestamp": 1789201333991 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201333991, "content": [ { "type": "text", "text": "The script `/workspace/hello.sh` prints \"Hello from the browser\". Running it outputs:\n\n```\nHello from the browser\n```\n\nwith exit code 0." } ], "stopReason": "stop", "usage": { "input": 878, "output": 35, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 913, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } } ] }, { "name": "edit-and-verify", "elapsedMs": 4833, "version": 1, "files": { "/tmp/revenue.txt": "Notebook 12 5 60\nPencil 30 2 60\nFolder 8 3 24\nTOTAL: 144\n", "/workspace/README.md": "# Browser workspace\n\nPi can read, write, edit, and run shell commands here.\nEverything stays in this browser. Try analyzing sales.csv.\n", "/workspace/hello.sh": "#!/bin/bash\necho \"Hello from Pi\"\n", "/workspace/report.md": "# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n", "/workspace/revenue.txt": "Notebook 12 5 -> 12 x 5 = 60\nPencil 30 2 -> 30 x 2 = 60\nFolder 8 3 -> 8 x 3 = 24\nTOTAL REVENUE: 144\n", "/workspace/sales.csv": "product,units,price\nNotebook,12,5\nPencil,30,2\nFolder,8,3\n", "/workspace/secret.txt": "LOCAL-fd008be1" }, "entries": [ [ "/", { "type": "directory", "mode": 493 } ], [ "/tmp", { "type": "directory", "mode": 493 } ], [ "/tmp/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSA2MApQZW5jaWwgMzAgMiA2MApGb2xkZXIgOCAzIDI0ClRPVEFMOiAxNDQK", "mode": 420 } ], [ "/usr", { "type": "directory", "mode": 493 } ], [ "/workspace", { "type": "directory", "mode": 493 } ], [ "/workspace/README.md", { "type": "file", "base64": "IyBCcm93c2VyIHdvcmtzcGFjZQoKUGkgY2FuIHJlYWQsIHdyaXRlLCBlZGl0LCBhbmQgcnVuIHNoZWxsIGNvbW1hbmRzIGhlcmUuCkV2ZXJ5dGhpbmcgc3RheXMgaW4gdGhpcyBicm93c2VyLiBUcnkgYW5hbHl6aW5nIHNhbGVzLmNzdi4K", "mode": 420 } ], [ "/workspace/hello.sh", { "type": "file", "base64": "IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8gZnJvbSBQaSIK", "mode": 493 } ], [ "/workspace/report.md", { "type": "file", "base64": "IyBTYWxlcyBSZXBvcnQKClRvdGFsIHJldmVudWUgZnJvbSBzYWxlcy5jc3YgaXMgKiokMTQ0KiouCgotIE5vdGVib29rOiAxMiDDlyAkNSA9ICQ2MAotIFBlbmNpbDogMzAgw5cgJDIgPSAkNjAKLSBGb2xkZXI6IDggw5cgJDMgPSAkMjQK", "mode": 420 } ], [ "/workspace/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSAtPiAxMiB4IDUgPSA2MApQZW5jaWwgMzAgMiAtPiAzMCB4IDIgPSA2MApGb2xkZXIgOCAzIC0+IDggeCAzID0gMjQKVE9UQUwgUkVWRU5VRTogMTQ0Cg==", "mode": 420 } ], [ "/workspace/sales.csv", { "type": "file", "base64": "cHJvZHVjdCx1bml0cyxwcmljZQpOb3RlYm9vaywxMiw1ClBlbmNpbCwzMCwyCkZvbGRlciw4LDMK", "mode": 420 } ], [ "/workspace/secret.txt", { "type": "file", "base64": "TE9DQUwtZmQwMDhiZTE=", "mode": 420 } ] ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read hello.sh, use the edit tool to replace Hello from the browser with Hello from Pi, then run the script and report the output." } ], "timestamp": 1789201335595 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201335596, "content": [ { "type": "toolCall", "id": "4cf27702-1db6-4297-8dcd-1a6b28cba1cb", "name": "read", "arguments": { "path": "hello.sh" } } ], "stopReason": "toolUse", "usage": { "input": 731, "output": 15, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 746, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "4cf27702-1db6-4297-8dcd-1a6b28cba1cb", "toolName": "read", "content": [ { "type": "text", "text": "#!/bin/bash\necho \"Hello from the browser\"\n" } ], "details": {}, "isError": false, "timestamp": 1789201336493 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201336493, "content": [ { "type": "toolCall", "id": "57259aeb-a574-4271-bebc-0693a9eac75f", "name": "edit", "arguments": { "path": "hello.sh", "oldText": "echo \"Hello from the browser\"", "newText": "echo \"Hello from Pi\"" } } ], "stopReason": "toolUse", "usage": { "input": 790, "output": 42, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 832, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "57259aeb-a574-4271-bebc-0693a9eac75f", "toolName": "edit", "content": [ { "type": "text", "text": "Edited /workspace/hello.sh" } ], "details": {}, "isError": false, "timestamp": 1789201337880 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201337881, "content": [ { "type": "toolCall", "id": "5ec18439-e1b8-4db2-bd9e-cde21bb97b91", "name": "bash", "arguments": { "command": "chmod +x hello.sh && ./hello.sh" } } ], "stopReason": "toolUse", "usage": { "input": 867, "output": 29, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 896, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "5ec18439-e1b8-4db2-bd9e-cde21bb97b91", "toolName": "bash", "content": [ { "type": "text", "text": "Hello from Pi\n\nExit code: 0" } ], "details": { "exitCode": 0 }, "isError": false, "timestamp": 1789201339204 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201339204, "content": [ { "type": "text", "text": "The script now outputs \"Hello from Pi\" when run." } ], "stopReason": "stop", "usage": { "input": 935, "output": 13, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 948, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } } ] }, { "name": "recover-tool-error", "elapsedMs": 5084, "version": 1, "files": { "/tmp/revenue.txt": "Notebook 12 5 60\nPencil 30 2 60\nFolder 8 3 24\nTOTAL: 144\n", "/workspace/README.md": "# Browser workspace\n\nPi can read, write, edit, and run shell commands here.\nEverything stays in this browser. Try analyzing sales.csv.\n", "/workspace/hello.sh": "#!/bin/bash\necho \"Hello from Pi\"\n", "/workspace/missing.txt": "Recovered", "/workspace/report.md": "# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n", "/workspace/revenue.txt": "Notebook 12 5 -> 12 x 5 = 60\nPencil 30 2 -> 30 x 2 = 60\nFolder 8 3 -> 8 x 3 = 24\nTOTAL REVENUE: 144\n", "/workspace/sales.csv": "product,units,price\nNotebook,12,5\nPencil,30,2\nFolder,8,3\n", "/workspace/secret.txt": "LOCAL-fd008be1" }, "entries": [ [ "/", { "type": "directory", "mode": 493 } ], [ "/tmp", { "type": "directory", "mode": 493 } ], [ "/tmp/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSA2MApQZW5jaWwgMzAgMiA2MApGb2xkZXIgOCAzIDI0ClRPVEFMOiAxNDQK", "mode": 420 } ], [ "/usr", { "type": "directory", "mode": 493 } ], [ "/workspace", { "type": "directory", "mode": 493 } ], [ "/workspace/README.md", { "type": "file", "base64": "IyBCcm93c2VyIHdvcmtzcGFjZQoKUGkgY2FuIHJlYWQsIHdyaXRlLCBlZGl0LCBhbmQgcnVuIHNoZWxsIGNvbW1hbmRzIGhlcmUuCkV2ZXJ5dGhpbmcgc3RheXMgaW4gdGhpcyBicm93c2VyLiBUcnkgYW5hbHl6aW5nIHNhbGVzLmNzdi4K", "mode": 420 } ], [ "/workspace/hello.sh", { "type": "file", "base64": "IyEvYmluL2Jhc2gKZWNobyAiSGVsbG8gZnJvbSBQaSIK", "mode": 493 } ], [ "/workspace/missing.txt", { "type": "file", "base64": "UmVjb3ZlcmVk", "mode": 420 } ], [ "/workspace/report.md", { "type": "file", "base64": "IyBTYWxlcyBSZXBvcnQKClRvdGFsIHJldmVudWUgZnJvbSBzYWxlcy5jc3YgaXMgKiokMTQ0KiouCgotIE5vdGVib29rOiAxMiDDlyAkNSA9ICQ2MAotIFBlbmNpbDogMzAgw5cgJDIgPSAkNjAKLSBGb2xkZXI6IDggw5cgJDMgPSAkMjQK", "mode": 420 } ], [ "/workspace/revenue.txt", { "type": "file", "base64": "Tm90ZWJvb2sgMTIgNSAtPiAxMiB4IDUgPSA2MApQZW5jaWwgMzAgMiAtPiAzMCB4IDIgPSA2MApGb2xkZXIgOCAzIC0+IDggeCAzID0gMjQKVE9UQUwgUkVWRU5VRTogMTQ0Cg==", "mode": 420 } ], [ "/workspace/sales.csv", { "type": "file", "base64": "cHJvZHVjdCx1bml0cyxwcmljZQpOb3RlYm9vaywxMiw1ClBlbmNpbCwzMCwyCkZvbGRlciw4LDMK", "mode": 420 } ], [ "/workspace/secret.txt", { "type": "file", "base64": "TE9DQUwtZmQwMDhiZTE=", "mode": 420 } ] ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read missing.txt using the read tool. If it does not exist, create it with the exact text Recovered and verify it by reading the file." } ], "timestamp": 1789201340477 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201340478, "content": [ { "type": "toolCall", "id": "493508b4-a058-4d93-ae05-15a1329a5da9", "name": "read", "arguments": { "path": "/workspace/missing.txt" } } ], "stopReason": "toolUse", "usage": { "input": 733, "output": 18, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 751, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "493508b4-a058-4d93-ae05-15a1329a5da9", "toolName": "read", "content": [ { "type": "text", "text": "ENOENT: no such file or directory, open '/workspace/missing.txt'" } ], "details": {}, "isError": true, "timestamp": 1789201341439 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201341439, "content": [ { "type": "toolCall", "id": "7d5678e4-fba5-43f1-bd2b-d770667f6bb1", "name": "write", "arguments": { "path": "/workspace/missing.txt", "content": "Recovered" } } ], "stopReason": "toolUse", "usage": { "input": 796, "output": 32, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 828, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "7d5678e4-fba5-43f1-bd2b-d770667f6bb1", "toolName": "write", "content": [ { "type": "text", "text": "Wrote /workspace/missing.txt" } ], "details": {}, "isError": false, "timestamp": 1789201342688 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201342688, "content": [ { "type": "toolCall", "id": "3f6e9269-4018-408d-9055-7e1a8ed81ab7", "name": "read", "arguments": { "path": "/workspace/missing.txt" } } ], "stopReason": "toolUse", "usage": { "input": 858, "output": 18, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 876, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } }, { "role": "toolResult", "toolCallId": "3f6e9269-4018-408d-9055-7e1a8ed81ab7", "toolName": "read", "content": [ { "type": "text", "text": "Recovered" } ], "details": {}, "isError": false, "timestamp": 1789201343745 }, { "role": "assistant", "api": "minicpm-webgpu", "provider": "browser", "model": "Mike0021/MiniCPM5-2B-ONNX", "timestamp": 1789201343745, "content": [ { "type": "text", "text": "The file `/workspace/missing.txt` did not exist, so I created it with the exact text \"Recovered\" and verified it by reading the file back, which confirms the content is \"Recovered\"." } ], "stopReason": "stop", "usage": { "input": 907, "output": 43, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 950, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0 } } } ] } ], "errors": [], "requests": [ { "method": "GET", "url": "http://127.0.0.1:4173/" }, { "method": "GET", "url": "http://127.0.0.1:4173/assets/index-DOivj3sw.js" }, { "method": "GET", "url": "http://127.0.0.1:4173/assets/index-DL-Ot0hN.css" }, { "method": "GET", "url": "http://127.0.0.1:4173/assets/agent.worker-DqQzo9yL.js" }, { "method": "GET", "url": "http://127.0.0.1:4173/runtime/ort-wasm-simd-threaded.asyncify.mjs" }, { "method": "GET", "url": "http://127.0.0.1:4173/runtime/ort-wasm-simd-threaded.asyncify.wasm" }, { "method": "GET", "url": "http://127.0.0.1:4173/" }, { "method": "GET", "url": "http://127.0.0.1:4173/assets/index-DOivj3sw.js" }, { "method": "GET", "url": "http://127.0.0.1:4173/assets/index-DL-Ot0hN.css" }, { "method": "GET", "url": "http://127.0.0.1:4173/assets/agent.worker-DqQzo9yL.js" }, { "method": "GET", "url": "http://127.0.0.1:4173/favicon.svg" }, { "method": "GET", "url": "http://127.0.0.1:4173/runtime/ort-wasm-simd-threaded.asyncify.mjs" }, { "method": "GET", "url": "http://127.0.0.1:4173/runtime/ort-wasm-simd-threaded.asyncify.wasm" } ], "coldLoadMs": 2281, "device": { "vendor": "amd", "architecture": "rdna-3", "maxStorageBufferBindingSize": 4294967292, "features": [ "depth32float-stencil8", "chromium-experimental-subgroup-matrix", "rg11b10ufloat-renderable", "bgra8unorm-storage", "texture-formats-tier1", "chromium-experimental-multi-draw-indirect", "texture-compression-bc", "dual-source-blending", "core-features-and-limits", "chromium-experimental-sampling-resource-table", "chromium-experimental-timestamp-query-inside-passes", "float32-filterable", "indirect-first-instance", "float32-blendable", "subgroup-size-control", "texture-compression-unaligned", "depth-clip-control", "texture-compression-bc-sliced-3d", "clip-distances", "shader-f16", "texture-formats-tier2", "timestamp-query", "primitive-index", "texture-component-swizzle", "subgroups" ], "actualLimits": { "maxStorageBufferBindingSize": 4294967292, "maxBufferSize": 4294967292 } }, "cancellation": { "passed": true, "completedGenerations": 0 }, "diagnostics": { "events": [ "agent_start", "turn_start", "message_start", "message_end", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_end", "turn_end", "agent_end", "agent_start", "turn_start", "message_start", "message_end", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_end", "turn_end", "agent_end", "agent_start", "turn_start", "message_start", "message_end", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_end", "turn_end", "agent_end", "agent_start", "turn_start", "message_start", "message_end", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_end", "turn_end", "agent_end", "agent_start", "turn_start", "message_start", "message_end", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_end", "tool_execution_start", "tool_execution_end", "message_start", "message_end", "turn_end", "turn_start", "message_start", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_update", "message_end", "turn_end", "agent_end", "agent_start", "turn_start", "message_start", "message_end", "message_start", "message_update", "message_update", "message_update", "message_update", "message_end", "turn_end", "agent_end" ], "generations": [ { "type": "generation", "raw": "<function name=\"read\"><param name=\"path\">/workspace/secret.txt</param></function><|im_end|>", "inputTokens": 717, "outputTokens": 18, "elapsedMs": 1002.8000000044703, "firstTokenMs": 666.3999999985099, "stopReason": "toolUse" }, { "type": "generation", "raw": "The read tool returned the contents of secret.txt as:\n\nLOCAL-fd008be1<|im_end|>", "inputTokens": 771, "outputTokens": 20, "elapsedMs": 1041.2000000029802, "firstTokenMs": 677.9000000059605, "stopReason": "stop" }, { "type": "generation", "raw": "<function name=\"read\"><param name=\"path\">/workspace/sales.csv</param></function><|im_end|>", "inputTokens": 726, "outputTokens": 18, "elapsedMs": 965.1000000014901, "firstTokenMs": 641.2000000029802, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"bash\"><param name=\"command\"><![CDATA[awk -F',' 'NR>1 {rev=$2*$3; total+=rev; print $1,$2,$3,\"->\",$2,\"x\",$3,\"=\",rev} END {print \"TOTAL REVENUE:\", total}' sales.csv > revenue.txt && cat revenue.txt]]></param></function><|im_end|>", "inputTokens": 798, "outputTokens": 78, "elapsedMs": 2038.1000000014901, "firstTokenMs": 690.6000000014901, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"write\"><param name=\"path\">report.md</param><param name=\"content\"><![CDATA[# Sales Report\n\nTotal revenue from sales.csv is **$144**.\n\n- Notebook: 12 Γ $5 = $60\n- Pencil: 30 Γ $2 = $60\n- Folder: 8 Γ $3 = $24\n]]></param></function><|im_end|>", "inputTokens": 964, "outputTokens": 79, "elapsedMs": 2203.0999999940395, "firstTokenMs": 839.0999999940395, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"read\"><param name=\"path\">/workspace/report.md</param></function><|im_end|>", "inputTokens": 1079, "outputTokens": 18, "elapsedMs": 1214, "firstTokenMs": 906.7000000029802, "stopReason": "toolUse" }, { "type": "generation", "raw": "Done. The report is saved at `/workspace/report.md` with total revenue of $144 (Notebook $60, Pencil $60, Folder $24).<|im_end|>", "inputTokens": 1180, "outputTokens": 35, "elapsedMs": 1609.3999999985099, "firstTokenMs": 984.7999999970198, "stopReason": "stop" }, { "type": "generation", "raw": "<function name=\"write\"><param name=\"path\">/workspace/hello.sh</param><param name=\"content\"><![CDATA[#!/bin/bash\necho \"Hello from the browser\"\n]]></param></function><|im_end|>", "inputTokens": 725, "outputTokens": 43, "elapsedMs": 1358.5, "firstTokenMs": 638.8999999985099, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"bash\"><param name=\"command\"><![CDATA[chmod +x /workspace/hello.sh && /workspace/hello.sh]]></param></function><|im_end|>", "inputTokens": 804, "outputTokens": 34, "elapsedMs": 1441.5, "firstTokenMs": 686.5, "stopReason": "toolUse" }, { "type": "generation", "raw": "The script `/workspace/hello.sh` prints \"Hello from the browser\". Running it outputs:\n\n```\nHello from the browser\n```\n\nwith exit code 0.<|im_end|>", "inputTokens": 878, "outputTokens": 35, "elapsedMs": 1343.4000000059605, "firstTokenMs": 747.6000000014901, "stopReason": "stop" }, { "type": "generation", "raw": "<function name=\"read\"><param name=\"path\">hello.sh</param></function><|im_end|>", "inputTokens": 731, "outputTokens": 15, "elapsedMs": 893.0999999940395, "firstTokenMs": 638.7999999970198, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"edit\"><param name=\"path\">hello.sh</param><param name=\"oldText\">echo \"Hello from the browser\"</param><param name=\"newText\">echo \"Hello from Pi\"</param></function><|im_end|>", "inputTokens": 790, "outputTokens": 42, "elapsedMs": 1381.2000000029802, "firstTokenMs": 679.3999999985099, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"bash\"><param name=\"command\"><![CDATA[chmod +x hello.sh && ./hello.sh]]></param></function><|im_end|>", "inputTokens": 867, "outputTokens": 29, "elapsedMs": 1316.6999999955297, "firstTokenMs": 738.7999999970198, "stopReason": "toolUse" }, { "type": "generation", "raw": "The script now outputs \"Hello from Pi\" when run.<|im_end|>", "inputTokens": 935, "outputTokens": 13, "elapsedMs": 1007.1999999955297, "firstTokenMs": 796.8999999985099, "stopReason": "stop" }, { "type": "generation", "raw": "<function name=\"read\"><param name=\"path\">/workspace/missing.txt</param></function><|im_end|>", "inputTokens": 733, "outputTokens": 18, "elapsedMs": 952.5, "firstTokenMs": 647.2999999970198, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"write\"><param name=\"path\">/workspace/missing.txt</param><param name=\"content\"><![CDATA[Recovered]]></param></function><|im_end|>", "inputTokens": 796, "outputTokens": 32, "elapsedMs": 1242.6000000014901, "firstTokenMs": 685.9000000059605, "stopReason": "toolUse" }, { "type": "generation", "raw": "<function name=\"read\"><param name=\"path\">/workspace/missing.txt</param></function><|im_end|>", "inputTokens": 858, "outputTokens": 18, "elapsedMs": 1051.5, "firstTokenMs": 751.1000000014901, "stopReason": "toolUse" }, { "type": "generation", "raw": "The file `/workspace/missing.txt` did not exist, so I created it with the exact text \"Recovered\" and verified it by reading the file back, which confirms the content is \"Recovered\".<|im_end|>", "inputTokens": 907, "outputTokens": 43, "elapsedMs": 1566.5, "firstTokenMs": 792.9000000059605, "stopReason": "stop" } ], "device": { "vendor": "amd", "architecture": "rdna-3", "maxStorageBufferBindingSize": 4294967292, "features": [ "depth32float-stencil8", "chromium-experimental-subgroup-matrix", "rg11b10ufloat-renderable", "bgra8unorm-storage", "texture-formats-tier1", "chromium-experimental-multi-draw-indirect", "texture-compression-bc", "dual-source-blending", "core-features-and-limits", "chromium-experimental-sampling-resource-table", "chromium-experimental-timestamp-query-inside-passes", "float32-filterable", "indirect-first-instance", "float32-blendable", "subgroup-size-control", "texture-compression-unaligned", "depth-clip-control", "texture-compression-bc-sliced-3d", "clip-distances", "shader-f16", "texture-formats-tier2", "timestamp-query", "primitive-index", "texture-component-swizzle", "subgroups" ], "actualLimits": { "maxStorageBufferBindingSize": 4294967292, "maxBufferSize": 4294967292 } } }, "editorAndShell": true, "requestsDuringOfflineTasks": [], "warmLoadMs": 2122, "reloadWeightRequests": [], "mobileLayout": "390 Γ 844; desktop GPU, not a mobile hardware test", "passed": true}123456789101112131415161718192021222324252627282930313233343536373839{ "date": "2026-09-12T08:26:57.014Z", "url": "http://127.0.0.1:4173/", "errors": [], "requests": [ "http://127.0.0.1:4173/", "http://127.0.0.1:4173/assets/index-BRKUEVCq.js", "http://127.0.0.1:4173/assets/index-DL-Ot0hN.css", "http://127.0.0.1:4173/assets/agent.worker-DqQzo9yL.js", "http://127.0.0.1:4173/favicon.svg" ], "checks": [ "Original Pi TUI rendered through xterm", "Enter submits /help without loading a model", "Pi fullscreen transcript search preserves the editor draft", "Pi multiline editor: Shift+Enter, cursor, deletion, Ctrl+U/K", "Pi prompt history", "Pi autocomplete: /he β /help", "xterm keyboard β Pi editor β real just-bash β workspace file", "Shell escape sequences render as inert text", "Large Pi paste markers expand before Send", "Unicode multiline clipboard paste", "Touch-accessible newline button", "390px layout and live terminal resize preserve the draft" ], "initial": " \n Ο Pi browser workspace \n \n Ask Pi to work with the files on the right. \n \n /load load MiniCPM \n /help show commands \n !ls run a workspace command \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Files and chat are saved on this device. \nββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n \nββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n /workspace Β· MiniCPM5-2B Β· 4,096 context ", "sizes": { "desktop": { "cols": 90, "rows": 41 }, "mobile": { "cols": 40, "rows": 32 } }, "mobileLimitation": "Desktop Chromium viewport simulation; physical mobile keyboards and GPUs not tested.", "passed": true}README.md+1-1
SPACE_README.md+1-1
app/README.md+11-3
app/index.html+3-10
app/package-lock.json+95-5
app/package.json+7-1
app/scripts/licenses.mjs+1
app/scripts/pi-browser.mjsAdded+31
app/src/main.mjs+20-42
app/src/pi/browser-host.mjsAdded+8
app/src/pi/capabilities.mjsAdded+25
app/src/pi/entry.mjsAdded+17
app/src/pi/terminal-ui.mjsAdded+216
app/src/pi/theme.mjsAdded+31
app/src/pi/xterm-terminal.mjsAdded+31
app/src/style.css+11-36
app/tests/browser.mjs+15-5
app/tests/space-embedded.mjs+2-1
app/tests/terminal.mjsAdded+104
app/vendor/pi-coding-agent/LICENSEAdded+21
app/vendor/pi-coding-agent/README.mdAdded+21
app/vendor/pi-coding-agent/components/assistant-message.jsAdded+158
app/vendor/pi-coding-agent/components/custom-editor.jsAdded+115
app/vendor/pi-coding-agent/components/markdown-transform.jsAdded+19
app/vendor/pi-coding-agent/components/user-message.jsAdded+49
app/vendor/pi-coding-agent/provenance.jsonAdded+12
app/vendor/pi-coding-agent/theme/light.jsonAdded+90
app/vite.config.mjs+3-1
assets/index-BRKUEVCq.jsAdded
assets/index-Cfkr7NLu.cssDeleted-1
assets/index-DL-Ot0hN.cssAdded+1
assets/index-LA8xezhP.jsDeleted
deployment-manifest.json+118-38
index.html+5-12
licenses/dependencies.txt+342-1
licenses/pi-components.jsonAdded+12
research/browser-agent/REPORT.md+20-1
scripts/prepare_space.py+2-1
validation/agent-terminal-dev.jsonAdded+157
validation/agent-terminal-model.jsonAdded+1885
validation/agent-terminal.jsonAdded+39