{"_id":"@plannotator/webtui","name":"@plannotator/webtui","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@plannotator/webtui","version":"0.1.0","license":"MIT","type":"module","description":"Importable Xterm terminal sessions for coding agents with a local node-pty backend.","repository":{"type":"git","url":"git+https://github.com/plannotator/webtui.git"},"bugs":{"url":"https://github.com/plannotator/webtui/issues"},"homepage":"https://github.com/plannotator/webtui#readme","keywords":["terminal","tui","xterm","pty","agent","react"],"sideEffects":["./src/react/webtui.css"],"main":"./dist/core/index.js","types":"./dist/core/index.d.ts","exports":{".":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js"},"./browser":{"types":"./dist/browser/index.d.ts","import":"./dist/browser/index.js"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js"},"./styles.css":"./src/react/webtui.css"},"scripts":{"typecheck":"tsc --noEmit -p tsconfig.json","lint":"oxlint .","test":"vitest run","check":"npm run lint && npm run typecheck && npm run test && npm run smoke","build":"tsc -p tsconfig.build.json","prepack":"npm run build","prepublishOnly":"npm run check","smoke":"tsc -p tsconfig.build.json && node smoke/import-smoke.mjs","example:build":"vite build --config examples/basic/vite.config.ts","example:start":"node examples/basic/server.mjs"},"dependencies":{"@xterm/addon-fit":"0.12.0-beta.216","@xterm/addon-unicode11":"0.10.0-beta.216","@xterm/addon-web-links":"0.13.0-beta.216","@xterm/addon-webgl":"0.20.0-beta.215","@xterm/xterm":"6.1.0-beta.216","lucide-react":"^0.577.0","node-pty":"^1.1.0","ws":"^8.20.0"},"peerDependencies":{"react":"^18.3.0 || ^19.0.0","react-dom":"^18.3.0 || ^19.0.0"},"devDependencies":{"@radix-ui/react-label":"^2.1.8","@radix-ui/react-select":"^2.2.6","@types/node":"^25.6.0","@types/react":"^19.2.3","@types/react-dom":"^19.2.3","@types/ws":"^8.18.1","@vitejs/plugin-react":"^5.2.0","oxlint":"^1.63.0","react":"19.2.5","react-dom":"19.2.5","typescript":"^5.9.3","vite":"^7.3.2","vitest":"^4.1.5"},"engines":{"node":">=20"},"gitHead":"47b197b4eca8b5582d5ff1158c730f41cee8a9ce","_id":"@plannotator/webtui@0.1.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-pwJfFg5VXOwucs55K6mef5fgK5eC8mJrFYc8RJdvB/T00alwnzgDjT/BAsarPiMj4U3NjUZImzxnbypJsn/ESA==","shasum":"662a205ffedd69a33da5fc8dfcb5f8eeffd62098","tarball":"https://registry.npmjs.org/@plannotator/webtui/-/webtui-0.1.0.tgz","fileCount":145,"unpackedSize":386939,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAvvJQUa1YDKzJF6TBNjdZ6ShfgI9pdMwTtset1T1ElVAiEA59UiHMHrhrgqaXOQSbj9N1e4jh42gnQ/wK/HEynHQtc="}]},"_npmUser":{"name":"backnotprop","email":"backnotprop@gmail.com"},"directories":{},"maintainers":[{"name":"backnotprop","email":"backnotprop@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webtui_0.1.0_1781819655430_0.35237061504443945"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-18T21:54:15.175Z","0.1.0":"2026-06-18T21:54:15.607Z","modified":"2026-06-18T21:54:15.842Z"},"maintainers":[{"name":"backnotprop","email":"backnotprop@gmail.com"}],"description":"Importable Xterm terminal sessions for coding agents with a local node-pty backend.","homepage":"https://github.com/plannotator/webtui#readme","keywords":["terminal","tui","xterm","pty","agent","react"],"repository":{"type":"git","url":"git+https://github.com/plannotator/webtui.git"},"bugs":{"url":"https://github.com/plannotator/webtui/issues"},"license":"MIT","readme":"<div align=\"center\">\n\n<img src=\"assets/webtui.webp\" alt=\"webtui\" width=\"160\" />\n\n\n\n**TUI in a GUI**\n\nhttps://github.com/user-attachments/assets/704e68e3-c7dd-4b0d-a289-61ccbee42d05\n\n\n</div>\n\n## What It Is WebTUI\n\n- TypeScript library for running local coding agents inside Xterm.\n- Browser UI talks to a PTY backend.\n- Included backend uses `node-pty`.\n- Included React component mounts the terminal.\n- Included example app launches agents, accepts prompts, and supports file drag/drop into the terminal.\n\n## Run The Example\n\n```bash\ncd ~/oss/webtui\npnpm run build\npnpm run example:build\npnpm run example:start\n```\n\nOpen:\n\n```text\nhttp://localhost:8730\n```\n\nPorts:\n\n- App: `8730`\n- PTY websocket: `8731`\n\n## Example App\n\n- Select an agent.\n- Optional working directory.\n- Enter a prompt.\n- Click `Launch`.\n- Use the left file tree after the session starts.\n- Drag files from the tree into the terminal.\n- Use `Inject` to send another message to the running agent.\n- Use `Cmd/Ctrl +`, `Cmd/Ctrl -`, and `Cmd/Ctrl 0` for terminal font zoom.\n\n## Imports\n\n```ts\nimport { buildAgentLaunchPlan, listBuiltInAgents } from '@plannotator/webtui'\nimport { WebSocketPtyBackend } from '@plannotator/webtui/browser'\nimport { WebTuiTerminal } from '@plannotator/webtui/react'\nimport { NodePtyBackend, createNodePtyWebSocketServer } from '@plannotator/webtui/server'\nimport '@plannotator/webtui/styles.css'\n```\n\n## React Usage\n\n```tsx\nimport { WebSocketPtyBackend } from '@plannotator/webtui/browser'\nimport { WebTuiTerminal } from '@plannotator/webtui/react'\nimport '@plannotator/webtui/styles.css'\n\nconst backend = new WebSocketPtyBackend('ws://localhost:8731/pty')\n\nexport function AgentPane() {\n  return (\n    <WebTuiTerminal\n      backend={backend}\n      agent=\"codex\"\n      cwd=\"/path/to/project\"\n      prompt={{ text: 'Fix the failing tests' }}\n      fontZoom\n    />\n  )\n}\n```\n\n## Browser Controller\n\n```ts\nimport { createAgentTerminalSession, WebSocketPtyBackend } from '@plannotator/webtui/browser'\n\nconst session = await createAgentTerminalSession({\n  container,\n  backend: new WebSocketPtyBackend('ws://localhost:8731/pty'),\n  agent: 'claude',\n  cwd: '/path/to/project',\n  prompt: { text: 'Summarize this repo' }\n})\n\nsession.sendAgentMessage({ text: 'Now inspect the tests' })\n```\n\n## Backend\n\n```ts\nimport { createNodePtyWebSocketServer, NodePtyBackend } from '@plannotator/webtui/server'\n\ncreateNodePtyWebSocketServer({\n  port: 8731,\n  backend: new NodePtyBackend({ agentTrustPreflight: true })\n})\n```\n\n## Useful Scripts\n\n```bash\npnpm run typecheck\npnpm run lint\npnpm run test\npnpm run build\npnpm run smoke\npnpm run example:build\npnpm run example:start\n```\n","readmeFilename":"README.md","_rev":"1-f3f919e156b3d148e87298ac9de10f5d"}