{"_id":"@amarsia/sdk","_rev":"12-333313a72238e8609ae8b0a809740396","name":"@amarsia/sdk","dist-tags":{"latest":"1.5.1"},"versions":{"0.1.1":{"name":"@amarsia/sdk","version":"0.1.1","author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@0.1.1","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"24d3b479caa7b4abb09ed7603e099c7ee8bc9aef","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-0.1.1.tgz","fileCount":8,"integrity":"sha512-3r/jCJgBgXuaFfPbjKslKzbyPMpKUanJBwJpNiLZOhIfEucxzH4cSKBBPtB6JvBTs2vahoe3ERrqln1k/py1UQ==","signatures":[{"sig":"MEYCIQD1vjRgnAsOm08PzoXyWVi13IyBmJgP9DC3vEmkSNIh2wIhAI7v8OcWXcN7RbmZGb4J9l/Bt+R0ZAsLc9wBNfngc5Vc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2288},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9357d542ceacab9526809dce8bc7663eeae34fb4","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git"},"_npmVersion":"10.8.2","description":"Official TypeScript/JavaScript SDK for Amarsia APIs.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1774356911198_0.9236291818510927","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@amarsia/sdk","version":"1.0.0","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.0.0","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"2d3db1e8b5ddb631e3cc1e4ff3239ef298a3c0a7","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.0.0.tgz","fileCount":8,"integrity":"sha512-0mYTTkSVaMallGynwRL/oFLoTqnt2H5xyqPnMSIFblEGueTW+3Nx3unEkvlHZsaZJDR6PsevqB3JYETZDQLEqQ==","signatures":[{"sig":"MEQCIHozRkpYjtm/d6Za/V+4PzCveGO9Mn6OT11jhgAO/JX4AiAs5yim5W6O5q0IhnmIKiWms7isu2NpvqwEpUZwQv/GbA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":172427},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"818ffe2154fb995bfc73898ea03cc57cf964a5d6","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1774366718340_0.5207306792922148","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@amarsia/sdk","version":"1.1.0","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.1.0","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"f9c283f4b06fdef3aeae623dcb27adb866ccb2ae","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.1.0.tgz","fileCount":6,"integrity":"sha512-/50q+l0VDNYlwGGYKXIwrkYmgHayuNkmTa2m98SKLjT0C9t9edsxXbclfebXpyy3YJUlpqrEOSFi+lEDZx3cvQ==","signatures":[{"sig":"MEYCIQDZDWtfMWnxVd29VRgiE9IH+sLsBzv5NklvidpRpVZBPgIhAJFpfOGAMBSS9aB1XZyNk5ezKGfj4UNq4tTrrYubgLkd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":82007},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"dcff2e636cd697bd54507f3c02338d263e0e5e14","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.1.0_1774429571103_0.7838509539017626","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@amarsia/sdk","version":"1.2.0","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.2.0","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"0e2c650ed75fc59a52e551154b25f6b2f6ddbfed","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.2.0.tgz","fileCount":6,"integrity":"sha512-IYxPdwqAJ18tG4E3OCaHDWsKcYXfvRW/KvnL8CSwZmYzWVpQuumHt4zlAaSbzg9V02qSpqGTAr93aYCzSUVH5w==","signatures":[{"sig":"MEUCIQDhE5D8EdmsRVjTsN1XZumM6xVt5WbAlilOtrQ++/mLigIgGe5E5jtauoLggAFu/POww8fgtoa6Ryu8ms+Uoy8zDhY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":90462},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"e18a49663d000e3787dbe202643ee666adbe07aa","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.0_1776420794541_0.48658130216309314","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@amarsia/sdk","version":"1.2.1","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.2.1","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"46399739acdc03a8885c4e9a42a87de24dda0b14","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.2.1.tgz","fileCount":6,"integrity":"sha512-unfIqm00ZKv7T+W61a3FJ7CSpdFevKN/D35wZ9Qix2mFQmynn/jw71VcPoi9Dd2Z+Iy0LRcNONBy7hZAcSGsug==","signatures":[{"sig":"MEYCIQD/uKhF0iY5TQKq/ZCzzAfG6vevmCYIUsfXqWBmLxf6igIhANOdH7CzZ+YDs9fggiqhIfPBc0adTsjQ463ZiQpkkTMg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":91791},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f274f36c4c4ce88b334b044cac4e844f252313c0","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.1_1776685334867_0.16156898547029352","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@amarsia/sdk","version":"1.2.2","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.2.2","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"a96b65215d5c88007bdb297ee3b40493c702097c","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.2.2.tgz","fileCount":6,"integrity":"sha512-1VFcmC6UZH1+oSMcR/eLp4lrnT0iuO/cHLBi5I3VDT6NaM6fVmz1/qmluiCWZWG7FLPyLjMwMNBoiA9Lks4KNw==","signatures":[{"sig":"MEYCIQDggqF1jop81cQrkhztywY/euVUFzc4a6B+F37Ocvu2HgIhAOgLZZvfRM3oaLDLaj8pnI8KQv5msoKrKWA6ttkw+TnN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":93011},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"308d178cafcda217f66b9eb69b337fbb16633a61","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.2_1776755727034_0.8405364643097033","host":"s3://npm-registry-packages-npm-production"}},"1.2.3":{"name":"@amarsia/sdk","version":"1.2.3","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.2.3","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"54929d2341ae4964e6a4926ca59ff20bbe40b553","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.2.3.tgz","fileCount":6,"integrity":"sha512-tkwTbpRLMZus3t8Avd/1LMjw6Rs3+qAIehALuqODHR8w5+moaRnxLWmuywJ9XazHaoJnCcJrzJ0hqjgaVes8Kg==","signatures":[{"sig":"MEQCIDe4EI64KAuMMBojDfvk8omMKrB/YZlkeYV2OP76UgTCAiAGVGxMW7LrgL67NYypwo7dC2+c72SKtWbak3C+O6UoGg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":93255},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"406ec9fa8726b3f7037e558b7471732bbd36603c","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.3_1777312961943_0.023535914044571005","host":"s3://npm-registry-packages-npm-production"}},"1.2.4":{"name":"@amarsia/sdk","version":"1.2.4","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.2.4","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"c72d537a498edb0837458dc778a1ec358f89a896","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.2.4.tgz","fileCount":6,"integrity":"sha512-TpAEKJJ5c82iDpfv70mj0YuE02d/T2OAa50oQy0whVxJaIXKQHK1aobipGY/3+ngTJJH4zagAPkizN3uoUDrOg==","signatures":[{"sig":"MEYCIQD4g/u/iqcKRA4PbmFfHeIbUyFQ6aRHgXrLjL9sjjl2QAIhALV+WHTkD+hjGb4kx8LaTd5YEs1boIHxWCCIIuZtAwjF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.2.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":94104},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"4618ffd77489bdaad8d7e8b8be8e7810e0722c50","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.4_1779964198639_0.4406321262265609","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@amarsia/sdk","version":"1.3.0","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.3.0","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"a59fe450d2f37e15e8583953cfdb9f463d70246b","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.3.0.tgz","fileCount":6,"integrity":"sha512-nf04eW3XGqNnZwl/hiwvB3S1oqj0RJY7JnSwNMAYrd789LJ6CBwz7g3OF8WKnFyawF8OSVrbOmQLNgrah43JLQ==","signatures":[{"sig":"MEQCIF1lHgWNIAYciggJs/3wuF14pu9NYdKFe7c9UZKxmXMQAiBe2s1vcSIk6Jh5ip+hHzQhQDFHpDkLxtBv4dxIuf9Kdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":104592},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"8d2f321b037b07bcaf6374d58b49824348e4df28","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.3.0_1783433196153_0.06440239281385218","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@amarsia/sdk","version":"1.4.0","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.4.0","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"9fda4aef2397d70303d76e2dae521b2193e2705a","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.4.0.tgz","fileCount":6,"integrity":"sha512-QGy74ebRyTURwwBkoxd1peIGPsquj4r9b3BoV98WuTTSI4F51jntp/ZvsNG0wfsvHH6emYfBj1dGhCWhpJ49zA==","signatures":[{"sig":"MEQCIH1src0xP39dY+u6Ye1+r3IxoDN/exrSmxhBbbAx/eypAiBTJJDNOZuI/sKKQuXxaruNO1KCkOGc+gTIt5GPdwxXDQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":110040},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9bba5c7a657e58da0b7b35bc23b1af5f40850576","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.4.0_1783603604337_0.9666608679733086","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@amarsia/sdk","version":"1.5.0","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"author":{"name":"Amarsia"},"license":"MIT","_id":"@amarsia/sdk@1.5.0","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"dist":{"shasum":"91734e360444e2d406180c28d54fe0c1f09cd2e2","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.5.0.tgz","fileCount":6,"integrity":"sha512-LD/dKCcCiYaXQVRTXJc1c4/Rbvh9EoeOyQqmsN0wMzjIWwXddmgE5EDNQjGRBdAwWJvKHUAA48d0XIl0o0O1FQ==","signatures":[{"sig":"MEYCIQDfbxc/dTfdGyabll2bcqjON8z0MR35RDbYyVoG0jYAFwIhAKCF8l437k6s3iemNYIkNFLzBfyyY9RJDBTGmSNA3XeM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":169458},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"c2fd5a64be1531181dd2e329400ecc936232db46","scripts":{"lint":"eslint src","build":"npm run clean && tsup","clean":"rimraf dist","lint:fix":"eslint src --fix","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"repository":{"url":"git+https://github.com/Amarsia/amarsia-packages.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.8.2","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_1.5.0_1783928127041_0.907735236157676","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"name":"@amarsia/sdk","version":"1.5.1","description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","license":"MIT","author":{"name":"Amarsia"},"repository":{"type":"git","url":"git+https://github.com/Amarsia/amarsia-packages.git","directory":"packages/sdk"},"homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"sideEffects":false,"engines":{"node":">=18"},"scripts":{"clean":"rimraf dist","build":"npm run clean && tsup","typecheck":"tsc --noEmit","lint":"eslint src","lint:fix":"eslint src --fix"},"publishConfig":{"access":"public","provenance":true},"_id":"@amarsia/sdk@1.5.1","gitHead":"3f8297a803f5b2cfbf3f7c21daef33d64a81da48","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-bLG5z0Wm9WOFzAJFLuEWkJY0fwqJz6+Wza6qquPGArpdgma19lB/SDfWm1AoOxiXyLia0IPau81XXqjuE2CAqw==","shasum":"62a532b2228859531de55acfce62a8f2df1d6fda","tarball":"https://registry.npmjs.org/@amarsia/sdk/-/sdk-1.5.1.tgz","fileCount":6,"unpackedSize":169892,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amarsia%2fsdk@1.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICKkVrYy8OcTcBa88T63DG+esMQunFD+iD8tDX+GYIfLAiEA6wyk70XLr8rIewb/ltwM0dXi5BkvrAtEWWzjSS1rrv0="}]},"_npmUser":{"name":"anuj.amarsia","email":"anuj@amarsia.com"},"directories":{},"maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.5.1_1783935478749_0.9459183931394546"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T12:55:11.122Z","modified":"2026-07-13T09:37:59.189Z","0.1.1":"2026-03-24T12:55:11.349Z","1.0.0":"2026-03-24T15:38:38.506Z","1.1.0":"2026-03-25T09:06:11.243Z","1.2.0":"2026-04-17T10:13:14.677Z","1.2.1":"2026-04-20T11:42:15.044Z","1.2.2":"2026-04-21T07:15:27.181Z","1.2.3":"2026-04-27T18:02:42.080Z","1.2.4":"2026-05-28T10:29:58.781Z","1.3.0":"2026-07-07T14:06:36.280Z","1.4.0":"2026-07-09T13:26:44.465Z","1.5.0":"2026-07-13T07:35:27.171Z","1.5.1":"2026-07-13T09:37:58.879Z"},"bugs":{"url":"https://github.com/Amarsia/amarsia-packages/issues"},"author":{"name":"Amarsia"},"license":"MIT","homepage":"https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk#readme","keywords":["ai","sdk","amarsia","assistant","streaming","llm","orchestration","agent builder","ai sdk","typescript sdk","javascript sdk","conversation api","stateful ai sdk","multimodal ai"],"repository":{"type":"git","url":"git+https://github.com/Amarsia/amarsia-packages.git","directory":"packages/sdk"},"description":"The official JavaScript and TypeScript SDK for Amarsia — run, stream, and manage AI assistants.","maintainers":[{"name":"anuj.amarsia","email":"anuj@amarsia.com"}],"readme":"# @amarsia/sdk\n\nOfficial TypeScript/JavaScript SDK for Amarsia APIs.\n\n- docs: [docs.amarsia.com](https://docs.amarsia.com)\n- npm: [@amarsia/sdk](https://www.npmjs.com/package/@amarsia/sdk)\n- repository: [amarsia-packages/packages/sdk](https://github.com/Amarsia/amarsia-packages/tree/main/packages/sdk)\n- React wrapper: [@amarsia/react](https://www.npmjs.com/package/@amarsia/react)\n\n`@amarsia/sdk` gives you a transparent API-style interface with state built in:\n\n- Initialize once with `amarsia.init(...)`\n- Use `client.run(...)` for one-shot responses\n- Use `client.stream(...)` for streaming responses\n- Use `client.conversation` for stateful conversation workflows with `conversation.id` and `conversation.data`\n- Use `client.agent` for durable, reconnectable workflows with client tools\n\n## What Is `@amarsia/sdk`?\n\n`@amarsia/sdk` is the official Amarsia AI SDK for JavaScript and TypeScript. It provides:\n\n- `run` for one-shot runner API requests\n- `stream` for streaming AI output\n- `conversation` for stateful multi-turn chat with conversation history\n- `agent` for durable turns, hidden polling, and explicit or automatic client-tool resolution\n\nIt is designed for Node.js, browser apps, Next.js apps, and agentic workflows where you need simple API access with built-in state.\n\n## Install\n\n```bash\nnpm install @amarsia/sdk\n```\n\n## Quick Start\n\n```ts\nimport { amarsia } from \"@amarsia/sdk\";\n\nconst client = amarsia.init({\n  apiKey: process.env.AMARSIA_API_KEY!,\n  deploymentId: \"dep_123\"\n});\n\nconst result = await client.run({\n  content: [{ type: \"text\", text: \"Write a short intro for Amarsia.\" }]\n});\n\nconsole.log(result.content);\nconsole.log(client.run.meta); // token/model metadata when available\n```\n\n## Initialization\n\n```ts\nimport { amarsia } from \"@amarsia/sdk\";\n\nconst client = amarsia.init({\n  apiKey: \"YOUR_API_KEY\", // optional; required only when the workflow has authentication enabled\n  deploymentId: \"dep_123\", // optional default deployment for all calls\n  baseUrl: \"https://api.amarsia.com\", // optional, defaults to this\n  dangerouslyAllowBrowserApiKey: true // optional browser risk acknowledgment\n});\n```\n\n### Public (auth-less) workflows\n\nIf a workflow has **Authentication** turned off in the dashboard, you can\ncall it without an API key. The request is authorized by the workflow's\n**Allowlist** based on the browser's `Origin` / `Referer`, so the\ninitialization can simply omit `apiKey`:\n\n```ts\nconst client = amarsia.init({\n  deploymentId: \"dep_123\"\n});\n```\n\nWhen `apiKey` is omitted, the SDK will not send the `x-api-key` header.\nIf the workflow still requires authentication server-side, the API will\nreturn a 401.\n\n### Deployment ID behavior\n\n- `run` and `stream` use `deploymentId` from `amarsia.init(...)` by default.\n- `run` and `stream` can still override `deploymentId` per call.\n- `conversation` uses the init-level deployment by default.\n- For most apps, if you need a different deployment for conversations, create a new client instance with `amarsia.init({ deploymentId: \"dep_...\" })`.\n- If no deployment id is available from either source, SDK throws a configuration error.\n\n## API overview\n\n```ts\nconst client = amarsia.init({ apiKey: \"...\", deploymentId: \"dep_123\" });\n\nawait client.run({ content: [...] });\nawait client.stream({ content: [...] });\nclient.conversation.start();\nawait client.conversation.stream({ content: [...] });\nawait client.agent.start({ content: [...] });\n```\n\nAll controllers expose state:\n\n- `.status` -> `idle | loading | streaming | success | error`\n- `.data` -> latest complete response payload\n- `.live` -> live stream buffer only during streaming (cleared after completion)\n- `.error` -> typed SDK error object\n- `.meta` -> token/model/request metadata when present\n- `.raw` -> raw response payload\n- `.getState()` and `.subscribe(...)` for reactive UI updates\n\n### `.data` vs `.live`\n\n- Use `.live` for live token/chunk rendering while a stream is in progress.\n- Use `.data` for the final completed response after the call finishes.\n- For streaming calls, `.live` is intentionally transient and reset to empty on completion.\n\n## Run API\n\n```ts\nconst data = await client.run({\n  content: [{ type: \"text\", text: \"Explain vector search in one paragraph.\" }],\n  variables: { audience: \"developer\" }\n});\n\nconsole.log(data.content);\nconsole.log(client.run.data);\n```\n\n## Stream API\n\n```ts\nconst unsubscribe = client.stream.subscribe((state) => {\n  if (state.status === \"streaming\") {\n    // progressively updated during stream\n    console.log(state.live);\n  }\n});\n\nconst data = await client.stream({\n  content: [{ type: \"text\", text: \"Generate a checklist for API launch.\" }]\n});\n\nconsole.log(data.content); // full final content\nunsubscribe();\n```\n\nAbort an in-flight stream:\n\n```ts\nclient.stream.abort();\n```\n\n## Conversation API (stateful)\n\n`client.conversation` keeps an instance-scoped conversation context (`conversation.id`, `deploymentId`, state, history helpers).\n\n### 1) Start a conversation context\n\n```ts\nconst conversation = client.conversation;\n\nconversation.start(); // new local conversation context, use init deploymentId\nconversation.start(\"conv_existing_123\"); // bind to existing conversation id\n```\n\nFor most apps, prefer creating a new client instance when switching deployments:\n\n```ts\nconst supportClient = amarsia.init({ apiKey: \"...\", deploymentId: \"dep_support_uuid\" });\nconst salesClient = amarsia.init({ apiKey: \"...\", deploymentId: \"dep_sales_uuid\" });\n```\n\n### Resume an existing conversation id\n\nStore `conversation_id` from a previous API response in your DB, then resume that thread later:\n\n```ts\nconst conversation = client.conversation;\n\n// Example: loaded from your database/session\nconst storedConversationId = \"conv_abc123\";\n\nconversation.start(storedConversationId);\n\nconst data = await conversation.run({\n  content: [{ type: \"text\", text: \"Continue from where we left off.\" }]\n});\n\nconsole.log(data.conversation_id); // \"conv_abc123\"\n```\n\nImportant:\n- `conversation.start(...)` is the only place to set conversation id and conversation deployment context.\n- `conversation.run(...)` and `conversation.stream(...)` do not accept conversation id or deployment id overrides.\n- Calling `conversation.start(...)` resets local conversation state for the new context.\n- Do not switch deployment mid-thread and expect to continue the same conversation history.\n- The second argument on `conversation.start(conversationId?, deploymentId?)` is an advanced option; most users should switch deployments by initializing a new client.\n\n### 2) Continue conversation (run vs stream)\n\nUse `conversation.run(...)` for single complete responses and `conversation.stream(...)` for live chunked output.\n\n```ts\n// non-stream continuation (final response only)\nawait conversation.run({\n  content: [{ type: \"text\", text: \"Summarize the previous answer.\" }],\n  historyLimit: 10\n});\n\n// stream continuation (live chunks + final response)\nawait conversation.stream({\n  content: [{ type: \"text\", text: \"Now explain in bullet points.\" }],\n  historyLimit: 10\n});\n```\n\nFresh conversation rule:\n- `variables` and `meta` are accepted only when no active conversation id exists (fresh conversation creation path).\n- If a conversation id is already active, passing `variables` or `meta` throws a validation error.\n\n### 3) Query old conversations and messages\n\n```ts\n// list old conversations using meta filters\nconst conversations = await conversation.list({\n  page: 1,\n  pageSize: 20,\n  meta: { team: \"growth\" }\n});\n\n// get messages for the active conversation id\nconst firstPage = await conversation.loadMessages(); // API defaults\nconst nextPage = await conversation.loadMessages({ page: 2, pageSize: 20, append: true });\n\n// or fetch by explicit id without mutating local conversation state\nconst byId = await conversation.loadMessages({\n  conversationId: \"conv_existing_123\",\n  page: 1,\n  pageSize: 20\n});\n```\n\n`append: true` merges new pages into local state and deduplicates by message `id`.\n\n### 4) Conversation state fields\n\n- `conversation.id`: current active conversation id\n- `conversation.deploymentId`: active deployment context for conversation calls\n- `conversation.status`: `idle | loading | streaming | success | error`\n- `conversation.data`: latest complete conversation response payload\n- `conversation.live`: transient streaming buffer (cleared on completion)\n- `conversation.meta`: model/token/request metadata when present\n- `conversation.messages`: locally cached messages from `loadMessages(...)`\n- `conversation.messagesPageInfo`: paging info for messages\n- `conversation.conversations`: locally cached list from `list(...)`\n- `conversation.conversationsPageInfo`: paging info for conversations\n- `conversation.error`: typed SDK error object\n- `conversation.raw`: latest raw response envelope/payload\n\n## Durable Agent API\n\n`client.agent` starts and resumes turns through the v2 conversation endpoint, then polls the ordered v2 agent-history timeline for durable state. `history` contains messages, tools, actions, and client-tool activity in chronological order; `messages` remains a derived message-only view.\n\n```ts\nconst lookupCustomer = Object.assign(\n  async ({ customerId }: Record<string, unknown>) => ({ customerId, active: true }),\n  {\n    inputSchema: {\n      type: \"object\",\n      properties: { customerId: { type: \"string\" } },\n      required: [\"customerId\"]\n    }\n  }\n);\n\nawait client.agent.start({\n  triggerId: \"trigger-id\",\n  clientTools: { lookupCustomer }\n});\n\n// One-time status and message snapshot; does not poll:\nconst snapshot = await client.agent.get(\"conversation-id\", {\n  pageSize: 25\n});\n\n// Open an interactive session and keep it synchronized:\nawait client.agent.open(\"conversation-id\", { clientTools: { lookupCustomer } });\n\n// Tools without handlers remain available for explicit UI resolution:\nawait client.agent.resolveTool(client.agent.pendingToolCalls[0].callId, { approved: true });\n\n// Fetch the next older history page when requested by your UI:\nif (client.agent.historyPageInfo?.hasMore) {\n  await client.agent.loadMoreHistory();\n}\n```\n\n`get()` is a one-time read. `open()` starts SDK-managed refresh for an interactive UI, and `subscribe()` notifies your code when that state changes. Completed conversations are read-only. Call `close()` or `abort()` to stop polling. The controller does not use SSE or local storage; it manages opaque history cursors internally.\n\n## React / Next.js\n\nFor React/Next usage, use [@amarsia/react](https://www.npmjs.com/package/@amarsia/react) instead of manually wiring `useState` + `useEffect`.\n\n- React package README: [amarsia-packages/packages/react](https://github.com/Amarsia/amarsia-packages/tree/main/packages/react)\n- Full docs: [docs.amarsia.com](https://docs.amarsia.com)\n\n## API Reference (Types and field meaning)\n\n### `amarsia.init` contract\n\n```ts\ntype InitConfig = {\n  apiKey?: string;\n  deploymentId?: string;\n  baseUrl?: string;\n  dangerouslyAllowBrowserApiKey?: boolean;\n  fetch?: typeof globalThis.fetch;\n};\n```\n\n### Stateful controller contract\n\nAll stateful controllers (`client.run`, `client.stream`, `client.conversation`) expose:\n\n```ts\n{\n  status: \"idle\" | \"loading\" | \"streaming\" | \"success\" | \"error\";\n  data: unknown | null; // latest complete response payload\n  live: string; // transient live stream buffer\n  error: { name: string; message: string; ... } | null;\n  meta: Record<string, unknown> | null;\n  raw: unknown;\n  getState(): Readonly<State>;\n  subscribe(listener: (state: Readonly<State>) => void): () => void;\n}\n```\n\n### `MessageContent`\n\n```ts\ntype MessageContent =\n  | { type: \"text\"; text: string }\n  | { type: \"image\" | \"video\" | \"audio\" | \"url\"; mime_type: string; file_uri: string };\n```\n\n### `run` request body\n\n```ts\n{\n  content: MessageContent[];\n  variables?: Record<string, unknown>;\n  deploymentId?: string;\n}\n```\n\n`run` response (common fields):\n\n```ts\n{\n  content: string | Record<string, unknown>;\n  model?: string;\n  input_tokens?: number;\n  output_tokens?: number;\n  [key: string]: unknown;\n}\n```\n\n### `stream` request body\n\nSame as `run`, plus optional `signal`.\n\n### `conversation.start`\n\n```ts\nstart(conversationId?: string, deploymentId?: string): void\n```\n\nBehavior:\n- Sets active conversation context for future conversation calls.\n- If `conversationId` is omitted, next `conversation.run/stream` creates a fresh conversation.\n- If `deploymentId` is omitted, conversation context keeps previous deployment id (or init default).\n\n### `conversation.run` / `conversation.stream` request body\n\n```ts\n{\n  content: MessageContent[];\n  historyLimit?: number;\n  signal?: AbortSignal;\n  variables?: Record<string, unknown>; // fresh-conversation only\n  meta?: Record<string, string | number | boolean>; // fresh-conversation only\n}\n```\n\nConversation behavior contract:\n- Fresh conversation (no active `conversation.id`):\n  - `run`/`stream` creates conversation using `/conversation`.\n  - `variables` and `meta` are accepted.\n- Existing conversation (active `conversation.id`):\n  - `run` continues via non-stream conversation endpoint.\n  - `stream` continues via stream conversation endpoint.\n  - `variables` and `meta` are rejected with validation error.\n\n### Response highlights\n\n- `content`: model output (string or structured object depending on deployment behavior)\n- `conversation_id`: conversation identifier for conversation APIs\n- `model`: model identifier used\n- `input_tokens` / `output_tokens`: token usage\n- `created_at` / `updated_at`: timestamps when present\n\n### `conversation` state fields\n\n```ts\n{\n  id: string | null;\n  deploymentId: string | null;\n  status: \"idle\" | \"loading\" | \"streaming\" | \"success\" | \"error\";\n  data: ConversationData | null;\n  live: string;\n  error: AmarsiaSdkErrorData | null;\n  meta: UsageMetadata | null;\n  raw: unknown;\n  messages: ConversationMessage[];\n  messagesPageInfo: { page: number; page_size: number; total: number; has_more: boolean } | null;\n  conversations: ChatConversation[];\n  conversationsPageInfo: { page: number; page_size: number; total: number; has_more: boolean } | null;\n}\n```\n\n### History/query helpers\n\n```ts\ninterface ChatConversation {\n  id: string;\n  name?: string | null;\n  created_at?: string;\n  updated_at?: string;\n  message_count?: number;\n  meta?: Record<string, unknown>;\n}\n\ninterface ConversationListResponse {\n  items: ChatConversation[];\n  total: number;\n  page: number;\n  page_size: number;\n  has_more: boolean;\n}\n\ninterface ConversationMessagesResponse {\n  items: ConversationMessage[];\n  total: number;\n  page: number;\n  page_size: number;\n  has_more: boolean;\n}\n\nconversation.loadMessages({ conversationId?, page?, pageSize?, append? });\nconversation.list({ page?, pageSize?, meta? }): Promise<ChatConversation[]>;\n```\n\n`conversation.list(...)` resolves deployment from conversation context (or client init config) and calls `/v1/runner/{deployment_id}/conversations`.\nThe list and message-history endpoint responses use `items`; the SDK returns those item arrays and stores them in `conversation.conversations` or `conversation.messages`.\n\nSee full examples and endpoint docs at [docs.amarsia.com](https://docs.amarsia.com).\n\n## Error handling\n\nEvery SDK method (`run`, `stream`, `conversation.run`, `conversation.stream`, `conversation.loadMessages`, `conversation.list`) throws `AmarsiaSdkError` on failure with normalized fields.\n\n```ts\nimport { AmarsiaSdkError } from \"@amarsia/sdk\";\n\ntry {\n  await client.run({\n    content: [{ type: \"text\", text: \"Hello\" }]\n  });\n} catch (error) {\n  if (error instanceof AmarsiaSdkError) {\n    console.error(error.name);    // e.g. \"AmarsiaHttpError\"\n    console.error(error.status);  // HTTP status, e.g. 401\n    console.error(error.code);    // stable string code, e.g. \"unauthorized\"\n    console.error(error.message); // human-readable message from the API\n  } else {\n    console.error(error);\n  }\n}\n```\n\n### Error field reference\n\n| Field | Description |\n|---|---|\n| `name` | Error class name: `AmarsiaHttpError`, `AmarsiaValidationError`, `AmarsiaConfigurationError`, `AmarsiaAbortError`, `AmarsiaNetworkError`. |\n| `status` | HTTP status for API errors. `undefined` for SDK-side errors. |\n| `code` | Stable symbolic code you can switch on. For HTTP errors derived from the status when the API doesn't send one. |\n| `message` | Human-readable message, extracted from the API response. |\n| `details` | The full response body (parsed) or raw string. |\n\n### Common codes\n\n| `code` | Typical cause |\n|---|---|\n| `bad_request` | Malformed payload or unknown deployment id. |\n| `unauthorized` | API key is required, invalid, expired, or for the wrong project. |\n| `forbidden` | The workflow is public but the request origin is not in its allowlist. |\n| `not_found` | The workflow or resource does not exist. |\n| `unprocessable_entity` | Request body failed server-side validation (FastAPI 422). |\n| `rate_limited` | Usage or action rate limits exceeded. |\n| `internal_server_error` | Unhandled error on the server. |\n\n### Example: branching on `code`\n\n```ts\ntry {\n  await client.run({ content: [{ type: \"text\", text: \"Hello\" }] });\n} catch (error) {\n  if (!(error instanceof AmarsiaSdkError)) throw error;\n\n  switch (error.code) {\n    case \"unauthorized\":\n      // Missing or invalid apiKey for a workflow that requires authentication.\n      break;\n    case \"forbidden\":\n      // Public workflow, but the current origin is not on the allowlist.\n      break;\n    default:\n      throw error;\n  }\n}\n```\n\n### Controller state\n\nEvery controller (`client.run`, `client.stream`, `client.conversation`) also mirrors the error on its state, so UIs that subscribe to `getState()` / `subscribe(...)` get `status === \"error\"` and the same `AmarsiaSdkErrorData` on `.error` without needing a try/catch.\n\n## Security guidance\n\nIf you use long-lived API keys in browser apps, keys can be extracted and abused.\n\nRecommended production approach:\n\n- Keep primary API keys on your backend\n- Call Amarsia from a backend route/proxy\n- If you must call from browser, use short-lived tokens and rotate frequently\n\nThe SDK warns in browser contexts unless `dangerouslyAllowBrowserApiKey: true` is set during init.\n\n## FAQ\n\n### Is this the official Amarsia SDK?\n\nYes. `@amarsia/sdk` is the official SDK for Amarsia APIs.\n\n### Does it support streaming AI responses?\n\nYes. Use `client.stream(...)` for streaming output and `client.conversation.stream(...)` for stateful streaming conversation continuation.\n\n### Should I use this with React?\n\nFor raw SDK usage, use `@amarsia/sdk` directly. For React hooks with no manual `useState/useEffect` wiring, use [@amarsia/react](https://www.npmjs.com/package/@amarsia/react).\n\n### Search terms\n\nAmarsia SDK, Amarsia TypeScript SDK, Amarsia JavaScript SDK, Amarsia conversation API SDK, Amarsia streaming API SDK.\n","readmeFilename":"README.md"}