{"_id":"@agent-webkit/core","name":"@agent-webkit/core","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@agent-webkit/core","version":"0.2.0","description":"L1 vanilla JS SDK for the agent-webkit wire protocol. Isomorphic (browser/Node/Deno/Bun).","license":"MIT","author":{"name":"BlitzJB"},"homepage":"https://github.com/BlitzJB/agent-webkit#readme","bugs":{"url":"https://github.com/BlitzJB/agent-webkit/issues"},"repository":{"type":"git","url":"git+https://github.com/BlitzJB/agent-webkit.git","directory":"packages/core"},"keywords":["claude","agent-sdk","sse","anthropic","agent"],"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"devDependencies":{"typescript":"^5.4.5","vitest":"^1.6.0"},"sideEffects":false,"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run"},"_id":"@agent-webkit/core@0.2.0","_integrity":"sha512-gsXScG4hVeFkA2VZ7E6Mb+ZZe62vNmn9jPgXn0cEnE1271wmvVxAl0NQDbOXjQxF8MdvNmSgLpbsxefd2kDcCA==","_resolved":"/private/var/folders/yj/g_x6cnk53n7dsdr1bkv34x840000gn/T/bd3c3510f0bd7da3bb451627ddeadae2/agent-webkit-core-0.2.0.tgz","_from":"file:agent-webkit-core-0.2.0.tgz","_nodeVersion":"25.6.1","_npmVersion":"11.9.0","dist":{"integrity":"sha512-gsXScG4hVeFkA2VZ7E6Mb+ZZe62vNmn9jPgXn0cEnE1271wmvVxAl0NQDbOXjQxF8MdvNmSgLpbsxefd2kDcCA==","shasum":"12871c51216f25a2d8deb54d906f669da6692365","tarball":"https://registry.npmjs.org/@agent-webkit/core/-/core-0.2.0.tgz","fileCount":23,"unpackedSize":45449,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGV43rTSnTtNS1O7+xcE95V62aDkS/onJFHtcvbzEw0QAiBxwZwMi8xUDbkDbniYWII2/CXebGOsGvYmN7M3UsAucA=="}]},"_npmUser":{"name":"blitzjb","email":"blitz04.dev@gmail.com"},"directories":{},"maintainers":[{"name":"blitzjb","email":"blitz04.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.2.0_1777328906945_0.2218227623236586"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-27T22:28:26.845Z","0.2.0":"2026-04-27T22:28:27.101Z","modified":"2026-04-27T22:28:27.323Z"},"maintainers":[{"name":"blitzjb","email":"blitz04.dev@gmail.com"}],"description":"L1 vanilla JS SDK for the agent-webkit wire protocol. Isomorphic (browser/Node/Deno/Bun).","homepage":"https://github.com/BlitzJB/agent-webkit#readme","keywords":["claude","agent-sdk","sse","anthropic","agent"],"repository":{"type":"git","url":"git+https://github.com/BlitzJB/agent-webkit.git","directory":"packages/core"},"author":{"name":"BlitzJB"},"bugs":{"url":"https://github.com/BlitzJB/agent-webkit/issues"},"license":"MIT","readme":"# @agent-webkit/core\n\nL1 vanilla JS SDK for the agent-webkit wire protocol. Isomorphic — runs in browsers,\nNode 18+, Deno, and Bun. No React, no UI, no transitive deps.\n\n## Install\n\n```sh\npnpm add @agent-webkit/core\n```\n\n## Usage\n\n```ts\nimport { createAgentClient } from \"@agent-webkit/core\";\n\nconst client = createAgentClient({ baseUrl: \"http://localhost:8000\", token: \"...\" });\nconst session = await client.createSession({ model: \"claude-opus-4-7\" });\n\nawait session.send(\"Read README.md and summarize it.\");\n\nfor await (const ev of session.events()) {\n  switch (ev.event) {\n    case \"message_delta\":\n      // stream tokens\n      break;\n    case \"permission_request\":\n      await session.approve(ev.data.correlation_id);\n      break;\n    case \"ask_user_question\":\n      await session.answer(ev.data.correlation_id, { /* per AskUserQuestion shape */ });\n      break;\n    case \"done\":\n      return;\n  }\n}\n```\n\n## Transport selection\n\nIf `token` is provided, uses fetch-based SSE (works in Node + browsers, supports custom headers).\nIf no token, native `EventSource` could be used, but the fetch-based path is used uniformly to\nkeep behavior consistent across runtimes. Both approaches honor `Last-Event-ID` for resume.\n\n## Resume\n\n```ts\nconst session = client.attachSession(savedId, { resumeFromEventId: savedSeq });\nfor await (const ev of session.events()) { /* ... */ }\n```\n\nIf the requested seq has been evicted from the server's ring buffer, `events()` throws a\n`TransportError` with status 412.\n","readmeFilename":"README.md","_rev":"1-7b3012af0c27f27f91e0c399b5a7842a"}