{"_id":"@archastro/tui-shot","_rev":"4-3c02f4f63621f1b9a39563b093fe0c3f","name":"@archastro/tui-shot","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@archastro/tui-shot","version":"0.1.0","keywords":["ink","pty","ratatui","terminal","screenshot","testing","tui"],"license":"MIT","_id":"@archastro/tui-shot@0.1.0","maintainers":[{"name":"calvin.grunewald","email":"calvin@archastro.ai"},{"name":"vks-archastro","email":"vks@archastro.ai"},{"name":"tore-archastro","email":"tore@archastro.ai"}],"homepage":"https://github.com/ArchAstro/astroshots#readme","bugs":{"url":"https://github.com/ArchAstro/astroshots/issues"},"bin":{"tui-shot":"bin/tui-shot.mjs"},"dist":{"shasum":"020e0352b7098153231d70a0568df5dd5838705a","tarball":"https://registry.npmjs.org/@archastro/tui-shot/-/tui-shot-0.1.0.tgz","fileCount":22,"integrity":"sha512-IxdXD/NABEl7Md50UWW7kp4qZivAfiqQSkv/QBp0xDub5+vuxYT8oaVRWXBMI46eb61bJgrj0fAcKG3cu5e1Eg==","signatures":[{"sig":"MEUCIQDEI+xEls7qXfBmcxmlGK6FfLrakxdKcRh9afVaglqGRwIgamNumaj4+RNOhVzK6hLZCg55jAQ0NdUp+TWP2hbElNQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60040},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js"}},"gitHead":"27a128c6cb694c92dbbc63271192ff0cb871262a","scripts":{"test":"npm run test:unit && npm run test:e2e","build":"tsc -p tsconfig.build.json","clean":"node scripts/clean.mjs","prepack":"npm run clean && npm run build","test:e2e":"npm run build && vitest run --config vitest.e2e.config.ts","test:unit":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"calvin.grunewald","email":"calvin@archastro.ai"},"repository":{"url":"git+https://github.com/ArchAstro/astroshots.git","type":"git","directory":"packages/tui-shot"},"_npmVersion":"11.17.0","description":"Deterministic PNG screenshots of Ink fixtures and arbitrary PTY programs","directories":{},"_nodeVersion":"26.5.0","dependencies":{"tsx":"^4.20.0","yaml":"^2.8.0","playwright":"1.61.1","@xterm/headless":"^5.5.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ink":"^7.1.0","react":"^19.2.0","sharp":"^0.35.3","vitest":"^4.1.0","typescript":"^5.9.0","@types/node":"^22.0.0","@types/react":"^19.0.0"},"peerDependencies":{"ink":"^7.1.0","react":"^19.0.0"},"optionalDependencies":{"node-pty":"1.2.0-beta.14"},"peerDependenciesMeta":{"ink":{"optional":true},"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tui-shot_0.1.0_1785861775787_0.30500517925968507","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@archastro/tui-shot","version":"0.2.0","keywords":["ink","pty","ratatui","terminal","screenshot","testing","tui"],"license":"MIT","_id":"@archastro/tui-shot@0.2.0","maintainers":[{"name":"calvin.grunewald","email":"calvin@archastro.ai"},{"name":"vks-archastro","email":"vks@archastro.ai"},{"name":"tore-archastro","email":"tore@archastro.ai"}],"homepage":"https://github.com/ArchAstro/astroshots#readme","bugs":{"url":"https://github.com/ArchAstro/astroshots/issues"},"bin":{"tui-shot":"bin/tui-shot.mjs"},"dist":{"shasum":"83d921b44a17ac10d08bf19dbd5f876593789030","tarball":"https://registry.npmjs.org/@archastro/tui-shot/-/tui-shot-0.2.0.tgz","fileCount":22,"integrity":"sha512-g2VheOsp+qT/jQVYOzIG6+PkJGDZiJGF8tSP3xfaKuwkfyOosP/02pgvDBcaN7BfA1TuXHznYlDRZWZn6ltcrw==","signatures":[{"sig":"MEUCIBxMOramdrBU8agFH7kTiX/onKcROlcohzmZjGwj6GovAiEA/YpJ58bReIJxjUXuBAglVnNv8vIuVWn0etbRgZct+Qo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@archastro%2ftui-shot@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":60040},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js"}},"gitHead":"d50b84239748475d3283edc57ca230bc255d102f","scripts":{"test":"npm run test:unit && npm run test:e2e","build":"tsc -p tsconfig.build.json","clean":"node scripts/clean.mjs","prepack":"npm run clean && npm run build","test:e2e":"npm run build && vitest run --config vitest.e2e.config.ts","test:unit":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6a9f5944-72fb-4f7d-acf0-35ffc894f001"}},"repository":{"url":"git+https://github.com/ArchAstro/astroshots.git","type":"git","directory":"packages/tui-shot"},"_npmVersion":"11.17.0","description":"Deterministic PNG screenshots of Ink fixtures and arbitrary PTY programs","directories":{},"_nodeVersion":"24.18.0","dependencies":{"tsx":"^4.20.0","yaml":"^2.8.0","playwright":"1.61.1","@xterm/headless":"^5.5.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ink":"^7.1.0","react":"^19.2.0","sharp":"^0.35.3","vitest":"^4.1.0","typescript":"^5.9.0","@types/node":"^22.0.0","@types/react":"^19.0.0"},"peerDependencies":{"ink":"^7.1.0","react":"^19.0.0"},"optionalDependencies":{"node-pty":"1.2.0-beta.14"},"peerDependenciesMeta":{"ink":{"optional":true},"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tui-shot_0.2.0_1786280870394_0.47021155552527194","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@archastro/tui-shot","version":"0.2.1","keywords":["ink","pty","ratatui","terminal","screenshot","testing","tui"],"license":"MIT","_id":"@archastro/tui-shot@0.2.1","maintainers":[{"name":"calvin.grunewald","email":"calvin@archastro.ai"},{"name":"vks-archastro","email":"vks@archastro.ai"},{"name":"tore-archastro","email":"tore@archastro.ai"}],"homepage":"https://github.com/ArchAstro/astroshots#readme","bugs":{"url":"https://github.com/ArchAstro/astroshots/issues"},"bin":{"tui-shot":"bin/tui-shot.mjs"},"dist":{"shasum":"03e3af2f75db12eb4b3b621c48ae81e497fa0ba3","tarball":"https://registry.npmjs.org/@archastro/tui-shot/-/tui-shot-0.2.1.tgz","fileCount":22,"integrity":"sha512-OrmxLGOInjo9mmiLvBLRda8gyZz71K34sFG8OR30YeiUKgbsnvj/7rrfxs2O+v9d01+QZZDBAdnGtEoLbzXM7A==","signatures":[{"sig":"MEUCID1pSjlNaqVKJ24nobuv9qhLb8QUxAOk0WD2HVBo8/CAAiEAr7gw5M4+vSAgHLBFOlpahJINb/Gm7FqrdGo0rJFyVbg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@archastro%2ftui-shot@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59672},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js"}},"gitHead":"f2573ed7436ed4a76e0b940024006271e625348c","scripts":{"test":"npm run test:unit && npm run test:e2e","build":"tsc -p tsconfig.build.json","clean":"node scripts/clean.mjs","prepack":"npm run clean && npm run build","test:e2e":"npm run build && vitest run --config vitest.e2e.config.ts","test:unit":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6a9f5944-72fb-4f7d-acf0-35ffc894f001"}},"repository":{"url":"git+https://github.com/ArchAstro/astroshots.git","type":"git","directory":"packages/tui-shot"},"_npmVersion":"11.17.0","description":"Deterministic PNG screenshots of Ink fixtures and arbitrary PTY programs","directories":{},"_nodeVersion":"24.19.0","dependencies":{"tsx":"^4.20.0","yaml":"^2.8.0","playwright":"1.61.1","@xterm/headless":"^5.5.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ink":"^7.1.0","react":"^19.2.0","sharp":"^0.35.3","vitest":"^4.1.0","typescript":"^5.9.0","@types/node":"^22.0.0","@types/react":"^19.0.0"},"peerDependencies":{"ink":"^7.1.0","react":"^19.0.0"},"optionalDependencies":{"node-pty":"1.2.0-beta.14"},"peerDependenciesMeta":{"ink":{"optional":true},"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/tui-shot_0.2.1_1787184464510_0.8979939461362161","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"_id":"@archastro/tui-shot@0.2.2","bin":{"tui-shot":"bin/tui-shot.mjs"},"bugs":{"url":"https://github.com/ArchAstro/astroshots/issues"},"dist":{"shasum":"a15f0a3be4be0510af984b45884e888a39cd14e8","tarball":"https://registry.npmjs.org/@archastro/tui-shot/-/tui-shot-0.2.2.tgz","fileCount":24,"integrity":"sha512-nJSw/+Oz1cgd1IlYiP8KPw5GgKBncLWNlOoBHnktNBnPYm61gPG95RUBI3MnM3lZYk+KHv9ok/9wu4Njar1CbA==","signatures":[{"sig":"MEUCIQDeeQxp9bbU/TEdAEJrXxM1HkLeRPfRZecVm5zSfZQoKQIgZcRK85lp0T9rs8HmfikmmFD/tdyYB2Qb3fQqnZYHvKQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDlniLqQH6al/QrhOYPTvmuRE6NPL3YmTDJDp8qcgs7oQIhAJ7f+LXLeGtmoq4qNJB+KQ47hH+Uhdt+/jEnoC1xpPCY"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@archastro%2ftui-shot@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":73494},"main":"./dist/index.js","name":"@archastro/tui-shot","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js"}},"gitHead":"5915ef1463a066b84f0c5128c06b53e6b1c3dc11","license":"MIT","scripts":{"test":"npm run test:unit && npm run test:e2e","build":"tsc -p tsconfig.build.json","clean":"node scripts/clean.mjs","prepack":"npm run clean && npm run build","test:e2e":"npm run build && vitest run --config vitest.e2e.config.ts","test:unit":"vitest run","typecheck":"tsc --noEmit"},"version":"0.2.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6a9f5944-72fb-4f7d-acf0-35ffc894f001"}},"homepage":"https://github.com/ArchAstro/astroshots#readme","keywords":["ink","pty","ratatui","terminal","screenshot","testing","tui"],"repository":{"url":"git+https://github.com/ArchAstro/astroshots.git","type":"git","directory":"packages/tui-shot"},"_npmVersion":"11.17.0","description":"Deterministic PNG screenshots of Ink fixtures and arbitrary PTY programs","directories":{},"maintainers":[{"name":"calvin.grunewald","email":"calvin@archastro.ai"},{"name":"vks-archastro","email":"vks@archastro.ai"},{"name":"tore-archastro","email":"tore@archastro.ai"}],"_nodeVersion":"24.20.0","dependencies":{"tsx":"^4.20.0","yaml":"^2.8.0","playwright":"1.61.1","@xterm/headless":"^5.5.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"ink":"^7.1.0","react":"^19.2.0","sharp":"^0.35.3","vitest":"^4.1.0","typescript":"^5.9.0","@types/node":"^22.0.0","@types/react":"^19.0.0"},"peerDependencies":{"ink":"^7.1.0","react":"^19.0.0"},"optionalDependencies":{"node-pty":"1.2.0-beta.14"},"peerDependenciesMeta":{"ink":{"optional":true},"react":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tui-shot_0.2.2_1789431048713_0.23939326088898394"}}},"time":{"created":"2026-08-04T16:42:55.669Z","modified":"2026-09-15T00:10:49.165Z","0.1.0":"2026-08-04T16:42:55.979Z","0.2.0":"2026-08-09T13:07:50.538Z","0.2.1":"2026-08-20T00:07:44.658Z","0.2.2":"2026-09-15T00:10:48.833Z"},"bugs":{"url":"https://github.com/ArchAstro/astroshots/issues"},"license":"MIT","homepage":"https://github.com/ArchAstro/astroshots#readme","keywords":["ink","pty","ratatui","terminal","screenshot","testing","tui"],"repository":{"url":"git+https://github.com/ArchAstro/astroshots.git","type":"git","directory":"packages/tui-shot"},"description":"Deterministic PNG screenshots of Ink fixtures and arbitrary PTY programs","maintainers":[{"name":"calvin.grunewald","email":"calvin@archastro.ai"},{"name":"vks-archastro","email":"vks@archastro.ai"},{"name":"tore-archastro","email":"tore@archastro.ai"}],"readme":"# @archastro/tui-shot\n\nThe terminal rendering engine behind `@archastro/astroshot`. It supports two\ncapture boundaries:\n\n- Ink fixture trees rendered in-process and interpreted with xterm.\n- Arbitrary executables launched in a real pseudoterminal, driven by scripted\n  input, interpreted with the same xterm model, and captured in Chromium.\n\nUse the unified `@archastro/astroshot` package for command-line capture.\n\n## Quick start\n\nRun from a Node.js 22.14 or newer project. Install the project-local peers only\nwhen using Ink mode:\n\n```bash\nnpm install --save-dev ink@^7.1 react@^19\nnpx astroshot install-browser\nnpx astroshot init ink\nnpx astroshot init pty\n```\n\nThen capture either boundary:\n\n```bash\nnpx astroshot ink ./ink.shot.tsx -o ./ink.png\nnpx astroshot pty ./pty.shot.yaml -o ./ratatui.png\n```\n\nOn Linux hosts missing Chromium's system libraries, install the browser with\n`install-browser --with-deps`.\n\n## Ink fixture contract\n\n```tsx\nimport { Box, Text } from \"ink\";\nimport React from \"react\";\nimport type { InkShotFixture } from \"@archastro/astroshot/ink\";\n\nexport default {\n  cols: 80,\n  rows: 12,\n  background: \"#090a12\",\n  scale: 2,\n  expectText: [\"Ready to deploy\"],\n  component: (\n    <Box borderStyle=\"round\">\n      <Text color=\"#b9a8ff\">Ready to deploy</Text>\n    </Box>\n  ),\n} satisfies InkShotFixture;\n```\n\n`expectText` makes capture fail unless every listed string exists in the final\nterminal screen. `--cols`, `--rows`, and `--scale` override fixture values.\nInk capture also supports `batch <manifest.yaml|json>`; manifest paths resolve\nrelative to the manifest.\n\n## PTY fixture contract\n\nPTY fixtures work with any executable that behaves like a terminal program:\n\n```yaml\nversion: 1\ncommand: ./target/debug/my-ratatui-app\nargs: []\ncwd: .\ncols: 100\nrows: 30\ntimeoutMs: 15000\nsettleMs: 100\nactions:\n  - waitFor: Choose an option\n  - key: down\n  - key: enter\n  - waitFor: Ready\nexpectText:\n  - Ready\n```\n\nThe child receives `TERM=xterm-256color`, a fixed terminal grid, and the\nfixture environment. `command` is spawned directly—not through a shell—and\n`cwd` resolves relative to the fixture. On Windows, use an `.exe`; `.cmd` and\n`.bat` scripts are rejected because they require a shell. Supported actions\nare:\n\n- `waitFor` with an optional per-action `timeoutMs`;\n- `waitForExit: true` with an optional `timeoutMs` when the documented program\n  is expected to terminate before capture;\n- `key`: `enter`, arrows, `tab`, `escape`, `backspace`, `space`, `ctrl-c`, or\n  `ctrl-d`;\n- `text` for literal input;\n- `pauseMs` for a bounded delay.\n\nActions run in order. The final xterm screen must contain every `expectText`\nvalue before Chromium captures it. Astroshot terminates a still-running child\nafter the screenshot.\n\nA child that exits nonzero before capture fails by default, even when expected\ntext rendered. Set `allowNonZeroExit: true` only to document an intentional\nfailure state. Use a final `waitForExit: true` action when process completion is\npart of the documented state; this waits for the authoritative child status\ninstead of relying on a fixed settle delay.\n\nThe renderer targets text and ANSI/VT terminal interfaces. Mouse events,\nmid-journey resize actions, and terminal graphics protocols such as Sixel or\nKitty images are not currently modeled.\n\n`node-pty` is an optional, lazily loaded native dependency so React and Ink\ncapture still work on an unsupported PTY host. This release pins the exact\nofficial `1.2.0-beta.14` build; PTY capture reports an actionable error if its\nnative addon is unavailable.\n\n## Reproducibility and trust\n\nPlaywright is pinned so each release selects one Chromium version. PNG bytes\ncan still differ across operating systems because the default stage uses host\nfonts. Set `fontFamily` and use a consistent OS/container for pixel baselines.\n\nInk fixture modules and PTY commands are executable code with the current\nuser's permissions. Only capture trusted repositories. A PTY is an I/O\nboundary, not a security sandbox; use a container for untrusted programs.\n\n## Programmatic API\n\n```ts\nimport {\n  closeSharedBrowser,\n  takePtyShot,\n  takeTuiShot,\n} from \"@archastro/tui-shot\";\n\nawait takeTuiShot({\n  fixturePath: \"./screenshots/welcome.tsx\",\n  outPath: \"./screenshots/welcome.png\",\n});\nawait takePtyShot({\n  fixturePath: \"./screenshots/ratatui.yaml\",\n  outPath: \"./screenshots/ratatui.png\",\n});\nawait closeSharedBrowser();\n```\n\nInk fixtures support Ink 7 and React 19 as peer dependencies.\n\n## Graphics-aware PTY captures\n\nAdd `graphics: kitty` to a PTY fixture to emulate a terminal that supports the\nKitty graphics protocol. The harness answers the capability query and cell-size\nreports, records transmitted images and their placements at the cursor, strips\nthe escape sequences from the text, and paints the pictures into the PNG in\ncell units. `KittyGraphicsTracker` is exported for harnesses that drive a PTY\nthemselves.\n","readmeFilename":"README.md"}