{"_id":"@converge.ai/a13n","_rev":"3-e407425c9169a2f4e213efa407d1b4d8","name":"@converge.ai/a13n","dist-tags":{"rc":"0.0.3-rc.1","latest":"0.0.93"},"versions":{"0.0.3-rc.1":{"name":"@converge.ai/a13n","version":"0.0.3-rc.1","license":"Apache-2.0","_id":"@converge.ai/a13n@0.0.3-rc.1","maintainers":[{"name":"serickcoco","email":"scchen@converge.ai"},{"name":"zsji-convergeai","email":"zsji@converge.ai"},{"name":"convergeai","email":"kntech@converge.ai"}],"homepage":"https://github.com/converge-ai-labs/agent-foundation#readme","bugs":{"url":"https://github.com/converge-ai-labs/agent-foundation/issues"},"dist":{"shasum":"b239f78522b5a2477e064973ef0754f27863aa09","tarball":"https://registry.npmjs.org/@converge.ai/a13n/-/a13n-0.0.3-rc.1.tgz","fileCount":7,"integrity":"sha512-J+jsZRNZJ4cq55tQD12PWEWpr9/71OXRY2RSBOj/BNeiJCqrKAxGsKBFdYX7a/Q97XREb14ppQ+s2ZqqF2yszw==","signatures":[{"sig":"MEYCIQCkS68OUZk/DPanKN5X6uqCHrzeNHkRMikoKA0jes1lKgIhALgs9TUu2EDmis+XDiorAFrgZt2vi60Elbsw7UtxVvXe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15587},"main":"./dist/index.js","type":"module","_from":"file:dist/converge.ai-a13n-0.0.3-rc.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.14"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"npm run build && node --test tests/*.test.mjs","build":"tsc -p tsconfig.build.json","check":"npm run format:check && npm run typecheck","clean":"rm -rf dist *.tgz","format":"prettier --write .","check:all":"npm run check && npm test && npm run pack:check","typecheck":"tsc --noEmit -p tsconfig.json","pack:check":"npm pack --dry-run","format:check":"prettier --check ."},"_npmUser":{"name":"zsji-convergeai","email":"zsji@converge.ai"},"_resolved":"/tmp/ya-agent-e8c7500b2760466aaac5a6b77f9a83c2/npm-bootstrap/dist/converge.ai-a13n-0.0.3-rc.1.tgz","_integrity":"sha512-J+jsZRNZJ4cq55tQD12PWEWpr9/71OXRY2RSBOj/BNeiJCqrKAxGsKBFdYX7a/Q97XREb14ppQ+s2ZqqF2yszw==","repository":{"url":"git+https://github.com/converge-ai-labs/agent-foundation.git","type":"git","directory":"sdk/typescript"},"_npmVersion":"11.6.0","description":"TypeScript SDK for a13n Service","directories":{},"sideEffects":false,"_nodeVersion":"24.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"npm@11.9.0","devDependencies":{"prettier":"^3.9.6","typescript":"^7.0.2"},"_npmOperationalInternal":{"tmp":"tmp/a13n_0.0.3-rc.1_1788793952223_0.6671969863639238","host":"s3://npm-registry-packages-npm-production"}},"0.0.90":{"name":"@converge.ai/a13n","version":"0.0.90","license":"Apache-2.0","_id":"@converge.ai/a13n@0.0.90","maintainers":[{"name":"serickcoco","email":"scchen@converge.ai"},{"name":"zsji-convergeai","email":"zsji@converge.ai"},{"name":"convergeai","email":"kntech@converge.ai"}],"homepage":"https://github.com/converge-ai-labs/a13n-sdk-typescript#readme","bugs":{"url":"https://github.com/converge-ai-labs/a13n-sdk-typescript/issues"},"dist":{"shasum":"93407f966e9ddb88fc0993e5f467736f790a0462","tarball":"https://registry.npmjs.org/@converge.ai/a13n/-/a13n-0.0.90.tgz","fileCount":52,"integrity":"sha512-BHz8rskSh/k6BGr09AAKbbVEIVs2VW97A2ahO6+W67LWpOcB/ueIITCKPqP5CWrbEDqPhCMmbkwYlYi1JqU6Lg==","signatures":[{"sig":"MEYCIQCBPGG8lP8H7gUJy5hUegNOB76MgwuIBF1Zz4rBwZp3MgIhAI7By7Cs9rgraWjOzZT1s2jfFOqi4jXOOcY+cUXPolsL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIHSLyih4Fx8PY7wl1x8HutrGkoXS+mLryPSKcFr5D1BWAiEAk8clU9a0f8yK642O2jw6iZQ7+47lymQMogq8MbVGKCA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@converge.ai%2fa13n@0.0.90","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2366059},"main":"./dist/index.js","type":"module","_from":"file:dist/converge.ai-a13n-0.0.90.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.14"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./openapi.json":"./openapi.json","./package.json":"./package.json"},"scripts":{"lint":"eslint . --max-warnings 0","test":"npm run build && node --test tests/*.test.mjs","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"npm run format:check && npm run lint && npm run typecheck","clean":"rm -rf dist *.tgz","format":"prettier --write .","generate":"node generate.mjs","check:all":"npm run check && npm test && npm run pack:check && npm run package:acceptance","typecheck":"tsc --noEmit -p tsconfig.json","pack:check":"npm pack --dry-run","format:check":"prettier --check .","package:acceptance":"node scripts/package-acceptance.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"921e2b7b-927f-4420-b58d-51275047d29f"}},"_resolved":"/home/runner/work/a13n-sdk-typescript/a13n-sdk-typescript/dist/converge.ai-a13n-0.0.90.tgz","_integrity":"sha512-BHz8rskSh/k6BGr09AAKbbVEIVs2VW97A2ahO6+W67LWpOcB/ueIITCKPqP5CWrbEDqPhCMmbkwYlYi1JqU6Lg==","repository":{"url":"git+https://github.com/converge-ai-labs/a13n-sdk-typescript.git","type":"git"},"_npmVersion":"11.19.0","description":"TypeScript SDK for a13n Service","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"npm@11.9.0","devDependencies":{"eslint":"^10.10.0","globals":"^16.5.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^5.9.3","typescript-eslint":"^8.70.0","openapi-typescript":"^7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/a13n_0.0.90_1790665198548_0.6426820191744158","host":"s3://npm-registry-packages-npm-production"}},"0.0.93":{"_id":"@converge.ai/a13n@0.0.93","bugs":{"url":"https://github.com/converge-ai-labs/a13n-sdk-typescript/issues"},"dist":{"shasum":"b6d3006ec446203904456633a008a24b80cd094a","tarball":"https://registry.npmjs.org/@converge.ai/a13n/-/a13n-0.0.93.tgz","fileCount":52,"integrity":"sha512-VyV5C+HeAxAx0VYDxi+a7xJJryYF25eKmPM9mOi+XpyV39xX9mKL/7NQFG6Zsat1J8saL6PigazELSjhOzq5Gw==","signatures":[{"sig":"MEYCIQDiee6BufDjTBdBR6HV8ATmRbcj2jWFmBhXyDRabV7kLAIhANokGUHNgUhphPV83BhVuBSFT+OBNNzILu1VlAlJ51Jo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDaiAfYOPfL7vBm0Zd2paVS49yTOeBe8K9GzX8/TQehJwIgFMT4Ybzjsmhjt7kcrQK46C9b3SHYDAgw+gSX1vvxr0c="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@converge.ai%2fa13n@0.0.93","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2429354},"main":"./dist/index.js","name":"@converge.ai/a13n","type":"module","_from":"file:dist/converge.ai-a13n-0.0.93.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.14"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./openapi.json":"./openapi.json","./package.json":"./package.json"},"license":"Apache-2.0","scripts":{"lint":"eslint . --max-warnings 0","test":"npm run build && node --test tests/*.test.mjs","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"npm run format:check && npm run lint && npm run typecheck","clean":"rm -rf dist *.tgz","format":"prettier --write .","generate":"node generate.mjs","check:all":"npm run check && npm test && npm run pack:check && npm run package:acceptance","typecheck":"tsc --noEmit -p tsconfig.json","pack:check":"npm pack --dry-run","format:check":"prettier --check .","package:acceptance":"node scripts/package-acceptance.mjs"},"version":"0.0.93","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"921e2b7b-927f-4420-b58d-51275047d29f"}},"homepage":"https://github.com/converge-ai-labs/a13n-sdk-typescript#readme","_resolved":"/home/runner/work/a13n-sdk-typescript/a13n-sdk-typescript/dist/converge.ai-a13n-0.0.93.tgz","_integrity":"sha512-VyV5C+HeAxAx0VYDxi+a7xJJryYF25eKmPM9mOi+XpyV39xX9mKL/7NQFG6Zsat1J8saL6PigazELSjhOzq5Gw==","repository":{"url":"git+https://github.com/converge-ai-labs/a13n-sdk-typescript.git","type":"git"},"_npmVersion":"11.19.0","description":"TypeScript SDK for a13n Service","directories":{},"maintainers":[{"name":"serickcoco","email":"scchen@converge.ai"},{"name":"zsji-convergeai","email":"zsji@converge.ai"},{"name":"convergeai","email":"kntech@converge.ai"}],"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"npm@11.9.0","devDependencies":{"eslint":"^10.10.0","globals":"^16.5.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^5.9.3","typescript-eslint":"^8.70.0","openapi-typescript":"^7.13.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a13n_0.0.93_1790872395005_0.6913129305609926"}}},"time":{"created":"2026-09-07T15:12:32.046Z","modified":"2026-10-01T16:33:15.460Z","0.0.3-rc.1":"2026-09-07T15:12:32.349Z","0.0.90":"2026-09-29T06:59:58.627Z","0.0.93":"2026-10-01T16:33:15.116Z"},"bugs":{"url":"https://github.com/converge-ai-labs/a13n-sdk-typescript/issues"},"license":"Apache-2.0","homepage":"https://github.com/converge-ai-labs/a13n-sdk-typescript#readme","repository":{"url":"git+https://github.com/converge-ai-labs/a13n-sdk-typescript.git","type":"git"},"description":"TypeScript SDK for a13n Service","maintainers":[{"name":"serickcoco","email":"scchen@converge.ai"},{"name":"zsji-convergeai","email":"zsji@converge.ai"},{"name":"convergeai","email":"kntech@converge.ai"}],"readme":"# @converge.ai/a13n\n\nStart an Agent, continue its conversation, or follow its output from a Node.js application. The SDK talks to an existing a13n Service; it does not run Agents locally.\n\n## Get ready\n\nYou need Node.js 22.14+, a Service URL, a workspace API key, and the **ID** of an Agent you can run. Get the URL, key, and Agent ID from your Service administrator or Console. The key selects its workspace automatically; there is no workspace setting in the example. The Agent also needs a configured Model and provider access to produce a response. Keep the key out of source control and browser bundles.\n\n**Install from this checkout during pre-release development:**\n\n```bash\ncd /path/to/a13n-sdk-typescript\nnpm ci --ignore-scripts\nnpm run build\nnpm pack\ncd /path/to/your-node-app\nnpm install /path/to/a13n-sdk-typescript/converge.ai-a13n-0.0.0.tgz\n```\n\nThe source version is `0.0.0`; a published registry package is **not** implied. After a release, install that published version with `npm install @converge.ai/a13n` instead.\n\n## Ask your Agent\n\nSave this as `hello.mjs` in your Node.js app:\n\n```js\nimport { randomUUID } from \"node:crypto\";\nimport { createClient } from \"@converge.ai/a13n\";\n\nfor (const name of [\"A13N_SERVICE_URL\", \"A13N_API_TOKEN\", \"A13N_AGENT_ID\"]) {\n  if (!process.env[name]) throw new Error(`${name} is required`);\n}\n\nconst client = createClient({\n  baseUrl: process.env.A13N_SERVICE_URL,\n  auth: { type: \"bearer\", token: process.env.A13N_API_TOKEN },\n});\n\ntry {\n  const agent = client.agents.ref(process.env.A13N_AGENT_ID);\n  const interaction = await agent.start(\"Say hello in one sentence.\", {\n    idempotencyKey: randomUUID(),\n  });\n  const result = await interaction.result();\n  console.log(result.status);\n  if (result.status === \"completed\") {\n    const messages = await result.run.items();\n    console.log(JSON.stringify(messages.data.items, null, 2));\n  } else if (result.status === \"waiting\") console.log(result.pending);\n  else console.log(result.failure);\n  console.log(\"Thread ID:\", interaction.thread.id);\n} finally {\n  client.close();\n}\n```\n\nSet the variables in your shell, then run the file:\n\n```bash\nexport A13N_SERVICE_URL=\"https://your-service.example\"\nexport A13N_API_TOKEN=\"your-workspace-api-key\"\nexport A13N_AGENT_ID=\"ap_your-agent-id\"\nnode hello.mjs\n```\n\nThe example prints saved messages and tool activity as JSON. `result.output` is the Run's optional output value, not necessarily its conversation text.\n\nEach **new logical request** needs its own idempotency key. The example generates one. If a network failure leaves the outcome uncertain, save and reuse the **same key and request** when reconciling or retrying; generating a fresh key may submit a second message. `result()` waits for this submission to finish or pause without opening a streaming connection. It returns `completed`, `waiting`, `failed`, or `cancelled`—check the status before using the output. The default local wait limit is five minutes; see [timeouts and recovery](docs/07-errors-and-recovery.md).\n\n## Continue the conversation\n\nTo send another message, retain the Thread ID printed above. In the same `try` block, send **only after the first result is `completed`**. A `waiting` Run needs its pending tool or approval resolved first; a premature message can stay queued:\n\n```js\nif (result.status === \"completed\") {\n  const followUp = await agent.send(\n    interaction.thread.id,\n    \"What did you mean?\",\n    {\n      idempotencyKey: randomUUID(),\n    },\n  );\n  const nextResult = await followUp.result();\n  console.log(nextResult.status);\n  if (nextResult.status === \"completed\") {\n    console.log((await nextResult.run.items()).data.items);\n  }\n} else {\n  console.log(\n    \"Resolve or inspect the first Run before continuing:\",\n    result.status,\n  );\n}\n```\n\nStore the Thread ID if the conversation must survive process restarts. A Thread can receive messages from different Agents; `send` always uses the Agent you selected.\n\n## Watch output as it arrives\n\nFor a **new** interaction, iterate the returned object before asking it for the final result:\n\n```js\nconst live = await agent.start(\"Explain your answer step by step.\", {\n  idempotencyKey: randomUUID(),\n});\nfor await (const event of live) {\n  if (event.frame.type === \"delta\") console.log(event.frame.data.event);\n  if (event.frame.type === \"gap\" || event.frame.type === \"reset\") {\n    console.log(\"Some live updates may be missing; use committed readback.\");\n  }\n}\nconst finalResult = await live.result();\nconsole.log(finalResult.status);\nif (finalResult.status === \"completed\") {\n  console.log((await finalResult.run.items()).data.items);\n}\n```\n\nThis finite stream stops when that interaction finishes or pauses, even if the connection is idle. Live events may be incomplete; for committed display state use `await finalResult.run.items()`. Do not break out of the loop if you still need `live.result()`: an early break closes this interaction's local observation. Closing or cancelling locally does **not** interrupt the remote Run. See [streaming and committed output](docs/02-streaming-and-readback.md).\n\n## Go further\n\n- [Configure conversations and continue across calls](docs/01-setup-and-conversations.md)\n- [Stream updates and reconcile committed output](docs/02-streaming-and-readback.md)\n- [Handle waiting Runs and client tools](docs/03-waiting-and-tools.md)\n- [Attach files and mount Memory](docs/04-files-and-memory.md)\n- [Use a same-origin browser session](docs/05-browser-sessions.md)\n- [Create Agents and manage resources with ETags](docs/06-generated-resources.md)\n- [Recover from timeouts and uncertain submissions](docs/07-errors-and-recovery.md)\n\nFor the complete wire contract, see the [pinned OpenAPI](openapi.json) and [SDK specification](spec/README.md). Contributors can use [CONTRIBUTING.md](CONTRIBUTING.md) for generation, validation, and release procedures.\n","readmeFilename":"README.md"}