{"_id":"@agentica-ai/sdk","_rev":"3-360879f5e8b866d16dd099dcd02010d6","name":"@agentica-ai/sdk","dist-tags":{"latest":"1.4.16"},"versions":{"0.1.0":{"name":"@agentica-ai/sdk","version":"0.1.0","keywords":["agentica","gateway","agent","sse"],"author":{"name":"XuMing","email":"xuming624@qq.com"},"license":"Apache-2.0","_id":"@agentica-ai/sdk@0.1.0","maintainers":[{"name":"shibing624-xm","email":"507153809@qq.com"}],"homepage":"https://github.com/shibing624/agentica/tree/main/sdk-ts","bugs":{"url":"https://github.com/shibing624/agentica/issues"},"dist":{"shasum":"aad6f81f17b08932b03bcde5179d612b3dcd074a","tarball":"https://registry.npmjs.org/@agentica-ai/sdk/-/sdk-0.1.0.tgz","fileCount":16,"integrity":"sha512-FLMxqAf2/15S97aL6igRR5OEhmO7iRniy43BbppzN9ZTVgmrvX0EIRAv+4L9QnVRW8jnaxfTV3IjOBb4eB5+/Q==","signatures":[{"sig":"MEUCIQDQWYuM/jxDEwNsZowuNA40N9uieFyg5byUDUUpxwq6sAIgAsyDPB1esUNasxKDM6Q8nQugrFc4eoOSOqIkKTVOO3I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18512},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"87101f576b92f9772b5717a12a35cb24fbaaa190","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsc --project tsconfig.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"shibing624-xm","email":"507153809@qq.com"},"repository":{"url":"git+https://github.com/shibing624/agentica.git","type":"git","directory":"sdk-ts"},"_npmVersion":"10.9.0","description":"TypeScript HTTP client for a running agentica-gateway. Not an Agent runtime.","directories":{},"_nodeVersion":"22.12.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1788265092663_0.32978503313529606","host":"s3://npm-registry-packages-npm-production"}},"1.4.15":{"name":"@agentica-ai/sdk","version":"1.4.15","keywords":["agentica","gateway","agent","sse"],"author":{"name":"XuMing","email":"xuming624@qq.com"},"license":"Apache-2.0","_id":"@agentica-ai/sdk@1.4.15","maintainers":[{"name":"shibing624-xm","email":"507153809@qq.com"}],"homepage":"https://github.com/shibing624/agentica/tree/main/sdk-ts","bugs":{"url":"https://github.com/shibing624/agentica/issues"},"dist":{"shasum":"213b7f9c99fe08bb864a62fce506cfa7d6f7e804","tarball":"https://registry.npmjs.org/@agentica-ai/sdk/-/sdk-1.4.15.tgz","fileCount":16,"integrity":"sha512-9T4Iunpa5GjjQ8aubySsMe7E9N0uygXqVONm/nJ+d5cIz3CTQTOuZUmqTJ+veck6PHfBfqtIvcsFlWEBZY919Q==","signatures":[{"sig":"MEUCIGPjqjbhea+sLkVS4ZPU+Yil31PStnO+AOtVE3CxiayvAiEAv2o0YxKu5mp3CVvvrJIq2YL+UW3m+mA+09A8Izu9Y2c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18184},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"bbbc5431352329e5ce9bd711a4564ffc92956ccb","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsc --project tsconfig.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"shibing624-xm","email":"507153809@qq.com"},"repository":{"url":"git+https://github.com/shibing624/agentica.git","type":"git","directory":"sdk-ts"},"_npmVersion":"10.9.0","description":"TypeScript HTTP client for a running agentica-gateway. Not an Agent runtime.","directories":{},"_nodeVersion":"22.12.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.4.15_1788273306211_0.6216509587907102","host":"s3://npm-registry-packages-npm-production"}},"1.4.16":{"_id":"@agentica-ai/sdk@1.4.16","bugs":{"url":"https://github.com/shibing624/agentica/issues"},"dist":{"shasum":"3276ea7af226a227f1d5f3a401c4bb2a9d025406","tarball":"https://registry.npmjs.org/@agentica-ai/sdk/-/sdk-1.4.16.tgz","fileCount":16,"integrity":"sha512-bBOu4rU18J4zrKE4+tin5MuIuqFJ0m9ttmn7gECmGxLOsxxZhyR0XebJvq0B9TLRX7w8eTTast7dWbzxqApRlw==","signatures":[{"sig":"MEUCIQCwQID8xO+QEIutNzYLiwCUM64ocn5BXwkAN3AjpXPMtQIgJ8PGr+dGtcZIXVnhebHiJEpeG5g5+d0Zz7XZaKoxrnE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDrLJWlRoN/iaVuvgbvxctWyjEyVl3+SVP3Q3M+b3kybAIgHiKM+XIouos9wimHfS+bzUd3e+nHJFkgYraJC5yD+fc="}],"unpackedSize":18323},"main":"./dist/index.js","name":"@agentica-ai/sdk","type":"module","types":"./dist/index.d.ts","author":{"name":"XuMing","email":"xuming624@qq.com"},"engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"abbdc638cc09872ea4a924eb312e1d01f24b1817","license":"Apache-2.0","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsc --project tsconfig.json","typecheck":"tsc --noEmit"},"version":"1.4.16","_npmUser":{"name":"shibing624-xm","email":"507153809@qq.com"},"homepage":"https://github.com/shibing624/agentica/tree/main/sdk-ts","keywords":["agentica","gateway","agent","sse"],"repository":{"url":"git+https://github.com/shibing624/agentica.git","type":"git","directory":"sdk-ts"},"_npmVersion":"10.9.0","description":"TypeScript HTTP client for a running agentica-gateway. Not an Agent runtime.","directories":{},"maintainers":[{"name":"shibing624-xm","email":"507153809@qq.com"}],"_nodeVersion":"22.12.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.4.16_1789451025006_0.031271231300846525"}}},"time":{"created":"2026-09-01T12:18:12.430Z","modified":"2026-09-15T05:43:45.307Z","0.1.0":"2026-09-01T12:18:12.797Z","1.4.15":"2026-09-01T14:35:06.355Z","1.4.16":"2026-09-15T05:43:45.102Z"},"bugs":{"url":"https://github.com/shibing624/agentica/issues"},"author":{"name":"XuMing","email":"xuming624@qq.com"},"license":"Apache-2.0","homepage":"https://github.com/shibing624/agentica/tree/main/sdk-ts","keywords":["agentica","gateway","agent","sse"],"repository":{"url":"git+https://github.com/shibing624/agentica.git","type":"git","directory":"sdk-ts"},"description":"TypeScript HTTP client for a running agentica-gateway. Not an Agent runtime.","maintainers":[{"name":"shibing624-xm","email":"507153809@qq.com"}],"readme":"# @agentica-ai/sdk\n\nTypeScript HTTP client for a running [`agentica-gateway`](https://github.com/shibing624/agentica). It is **not** a port of the Python `Agent` runtime: chat, tools and memory stay in that process. This package sends the same REST/SSE calls the Web UI uses.\n\nStarting the Web UI is unchanged: `uv tool install \"agentica[gateway]\"` then `agentica-gateway`. You only need this package if you are writing a Node/TypeScript program that talks to that gateway.\n\n## Install\n\n```bash\nnpm install @agentica-ai/sdk\n```\n\nAlways the scoped name **`@agentica-ai/sdk`**. The CLI talks to `https://registry.npmjs.org/` (not `www.npmjs.com`). Requires Node 18+ (native `fetch`).\n\n## Usage\n\n```ts\nimport { Agentica } from \"@agentica-ai/sdk\";\n\nconst agentica = new Agentica({\n  baseURL: \"http://127.0.0.1:8881\",\n  // Machine token from ~/.agentica/cache/gateway/runtime.json\n  // Omit when GATEWAY_AUTH=false.\n  apiKey: process.env.AGENTICA_GATEWAY_TOKEN,\n});\n\nawait agentica.health();\n\nconst sessions = await agentica.sessions.list();\n\nfor await (const event of agentica.chat.stream({\n  session_id: \"demo\",\n  message: \"What files are in this repo?\",\n})) {\n  if (event.event === \"content\") process.stdout.write(String(event.data));\n}\n```\n\n`baseURL` falls back to `AGENTICA_URL` then `http://127.0.0.1:8881`. `apiKey` falls back to `AGENTICA_GATEWAY_TOKEN`.\n\nBackground runs (refresh-safe, same as the Web UI):\n\n```ts\nconst run = await agentica.chat.createRun({ session_id: \"demo\", message: \"…\" });\nfor await (const event of agentica.chat.events(run.run_id, run.seq)) {\n  // reconnect with the last seq after a drop\n}\nawait agentica.chat.approve(\"demo\", toolCallId, \"allow\");\n```\n\n## Auth\n\nScripts present the **machine token** (`Authorization: Bearer`), not the browser session cookie. Read it from the running gateway's `runtime.json`, or pin it with `AGENTICA_GATEWAY_TOKEN` on both the gateway and the client.\n\n## Develop\n\n```bash\ncd sdk-ts\nnpm install\nnpm test\n```\n\n## Publish\n\nManual, same as the PyPI wheel. One package: `@agentica-ai/sdk` (org `agentica-ai`). Bump `version` in `package.json` first; do not republish an existing version.\n\n```bash\ncd sdk-ts\nnpm ci\nnpm test\nnpm publish --access public --registry https://registry.npmjs.org/\n```\n","readmeFilename":"README.md"}