{"_id":"@angadie/chittie-companion","_rev":"3-98a6f1d72cb26fb3f0d8f61ec9907a20","name":"@angadie/chittie-companion","dist-tags":{"latest":"0.7.1"},"versions":{"0.6.0":{"name":"@angadie/chittie-companion","version":"0.6.0","license":"MIT","_id":"@angadie/chittie-companion@0.6.0","maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"dist":{"shasum":"d2c1235ce3c6959ae2a1778c346e253dfef7c4d3","tarball":"https://registry.npmjs.org/@angadie/chittie-companion/-/chittie-companion-0.6.0.tgz","fileCount":5,"integrity":"sha512-j5USa0M1BeSjr8ZsAv2wH50XGiNSEkuVbe+4hfkHiWWs3D4aFznrvDR8BJpelnrLf28YEBNyfex/BZGGJapQRg==","signatures":[{"sig":"MEQCIDcdNPOs4NdaEFq+ndkjbhdGgcqPukW/I/7iA2fn0lcsAiAgsCmWjcEqIJzPPmaLn5Fg8QWCrgRkehghK9C+zzHB1w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8242},"type":"module","_from":"file:angadie-chittie-companion-0.6.0.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"scripts":{"test":"tsx spikes/companion.spike.ts","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"octalpixel","email":"mithushancj@gmail.com"},"_resolved":"/private/var/folders/j5/7dkmn95d0_9b5fdnfsmpjs580000gn/T/f86e320a5ec577b52bbbf5fd85cc9a1d/angadie-chittie-companion-0.6.0.tgz","_integrity":"sha512-j5USa0M1BeSjr8ZsAv2wH50XGiNSEkuVbe+4hfkHiWWs3D4aFznrvDR8BJpelnrLf28YEBNyfex/BZGGJapQRg==","_npmVersion":"10.9.7","description":"Client SDK for the chittie print companion: discover printers, print to a pinned station, and get back exactly where it printed. Web + RN + Node (fetch-based).","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/chittie-companion_0.6.0_1782296615043_0.8801490826535072","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@angadie/chittie-companion","version":"0.7.0","license":"MIT","_id":"@angadie/chittie-companion@0.7.0","maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"dist":{"shasum":"1377f8dc7fb3ece11263cdedcfe5341acbd29484","tarball":"https://registry.npmjs.org/@angadie/chittie-companion/-/chittie-companion-0.7.0.tgz","fileCount":5,"integrity":"sha512-WavVQjHVuFF/QJDIBbDNUQBQV0BsmpIh5uERCFIfRx+nTzYnhS4RTN3OjDgT+SiMF105vj92ShgupwFYy1hFUA==","signatures":[{"sig":"MEYCIQCugIZeQAJGHYS0rOrGl5zsPD65dLRew1guFIa/z9zUagIhAO+elY/p+3CX9sDRkvvNQPcyXw70OFC1NYzcqdYM0fH0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8392},"type":"module","_from":"file:angadie-chittie-companion-0.7.0.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"scripts":{"test":"tsx spikes/companion.spike.ts","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"octalpixel","email":"mithushancj@gmail.com"},"_resolved":"/private/var/folders/j5/7dkmn95d0_9b5fdnfsmpjs580000gn/T/a9495384b279d85fac6f75dc5b2711dc/angadie-chittie-companion-0.7.0.tgz","_integrity":"sha512-WavVQjHVuFF/QJDIBbDNUQBQV0BsmpIh5uERCFIfRx+nTzYnhS4RTN3OjDgT+SiMF105vj92ShgupwFYy1hFUA==","_npmVersion":"10.9.7","description":"Client SDK for the chittie print companion: discover printers, print to a pinned station, and get back exactly where it printed. Web + RN + Node (fetch-based).","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/chittie-companion_0.7.0_1782372096977_0.676429954934014","host":"s3://npm-registry-packages-npm-production"}},"0.7.1":{"name":"@angadie/chittie-companion","version":"0.7.1","description":"Client SDK for the chittie print companion: discover printers, print to a pinned station, and get back exactly where it printed. Web + RN + Node (fetch-based).","license":"MIT","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsdown","typecheck":"tsc --noEmit","test":"tsx spikes/companion.spike.ts"},"_id":"@angadie/chittie-companion@0.7.1","_integrity":"sha512-T9cYZcpXsC8Eb5q071Lw6DLInl6mt0CUF0hisKKfn8J/OeGn5FNfWF6gKo/1unKM1A48PPZm6C5R5eeIw/wAFg==","_resolved":"/private/var/folders/j5/7dkmn95d0_9b5fdnfsmpjs580000gn/T/69ff967b9b2e38238b16600833b870d1/angadie-chittie-companion-0.7.1.tgz","_from":"file:angadie-chittie-companion-0.7.1.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-T9cYZcpXsC8Eb5q071Lw6DLInl6mt0CUF0hisKKfn8J/OeGn5FNfWF6gKo/1unKM1A48PPZm6C5R5eeIw/wAFg==","shasum":"e340a4cdd4819d401fe5cbb528c8698eb31ce8d1","tarball":"https://registry.npmjs.org/@angadie/chittie-companion/-/chittie-companion-0.7.1.tgz","fileCount":5,"unpackedSize":8429,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF2Sqgn9deuEhtfDq4IQIpoy2RWfQ+p6i75lHbcen+tMAiEAx4BzWLW0BAr5daRnBvtsnq55kVx2ugXV+PhVDkEdvdQ="}]},"_npmUser":{"name":"octalpixel","email":"mithushancj@gmail.com"},"directories":{},"maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chittie-companion_0.7.1_1782462999779_0.8360764275822274"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-24T10:23:34.915Z","modified":"2026-06-26T08:36:40.001Z","0.6.0":"2026-06-24T10:23:35.186Z","0.7.0":"2026-06-25T07:21:37.123Z","0.7.1":"2026-06-26T08:36:39.894Z"},"license":"MIT","description":"Client SDK for the chittie print companion: discover printers, print to a pinned station, and get back exactly where it printed. Web + RN + Node (fetch-based).","maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"readme":"# @angadie/chittie-companion\n\nClient SDK for the **chittie print companion** (the localhost print-agent / Tauri companion\napp). Build bytes with `@angadie/chittie` (receipts) or `@angadie/chittie-label` (tags), then\nprint to a **pinned station** and get back **exactly where it printed** — never a silent\nfallback. `fetch`-based, so it runs on web, React Native, and Node 18+.\n\n```bash\nnpm i @angadie/chittie-companion\n```\n\n```ts\nimport { createCompanionClient } from '@angadie/chittie-companion';\n\nconst printer = createCompanionClient({\n  url: 'http://localhost:8930',\n  token: import.meta.env.VITE_PRINT_TOKEN,\n  stations: {                         // pin once (onboarding) — never trust the OS default\n    receipt: 'XP-365B',\n    kitchen: '192.168.1.51:9100',     // host:port → raw TCP\n    bar: '192.168.1.52:9100',\n  },\n});\n\nif (!(await printer.available())) showSetupHint();          // companion not running\nconst printers = await printer.printers();                  // for the pin/diagnostics screen\n\nconst res = await printer.print(bytes, { station: 'receipt' });\ntoast(res.printed ? `✓ Printed → ${res.target}` : `✗ ${res.reason}`);\n```\n\n> Full integration guide: [MANUAL.md](./MANUAL.md)\n\n## API\n- `health()` → `Health | null` (null if unreachable).\n- `available()` → `boolean` — use it to choose direct Web Serial vs the companion.\n- `printers()` → `PrinterInfo[]` — OS queues + direct-USB devices, for the pin screen.\n- `print(bytes, { station } | { target })` → `PrintResult`\n  - `{ printed: true, transport, target, bytes }` or `{ printed: false, reason }` — always resolves, never throws.\n  - **station** resolves via the `stations` map; a named-but-unconfigured station returns\n    `{ printed: false }` **without printing** (no guessing a default — the hard-won POS lesson).\n  - **target** is an explicit override: a queue name, `\"usb\"`, `\"host:port\"`, or `\"virtual\"`.\n\n## Notes\n- React Native: pass `{ fetch }` if your runtime needs a polyfill.\n- Targets the companion's `POST /print-raw` (raw bytes + `x-print-target`); the companion writes\n  to the OS queue / USB / TCP and reports the printer name back.\n- For the cafe KOT/BOT pattern, configure one station per printer and `print(bytes, { station })`\n  per ticket — see the chittie POS vendor guide.\n","readmeFilename":"README.md"}