{"_id":"@agenttraceai/sdk","_rev":"2-898b01208cb4ceafc6e72348a1cc453d","name":"@agenttraceai/sdk","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@agenttraceai/sdk","version":"0.1.0","license":"MIT","_id":"@agenttraceai/sdk@0.1.0","maintainers":[{"name":"nimrasyed","email":"nimrasyed003@gmail.com"}],"homepage":"https://github.com/nimra-syed/agenttrace#readme","bugs":{"url":"https://github.com/nimra-syed/agenttrace/issues"},"dist":{"shasum":"6a7c2ce58a5c690ef295c4cc3e0958fee1a8bb95","tarball":"https://registry.npmjs.org/@agenttraceai/sdk/-/sdk-0.1.0.tgz","fileCount":5,"integrity":"sha512-IfxZMt3eaRs1Kt6YKfe4sI5Bi7yg2WbDSqHlIb4/0d165Y/ea+zzE7vjPB9tvxhlfTagre7tgk8MbYueMemLLg==","signatures":[{"sig":"MEUCIDsH6xXb77Ojg91cfE7s9bQrlYHJPfqkL3TGRHiXGfC2AiEAvqht3Xpqq1GwRelrMm/+GdQHTTOJCVmS1xWgP6CtVOw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13184},"jest":{"rootDir":"src","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"moduleFileExtensions":["js","json","ts"]},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"1ef28982647e478bab95dc61e56fc6ee7739f59e","scripts":{"test":"jest","build":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=cjs --outfile=dist/index.js && dts-bundle-generator --no-banner -o dist/index.d.ts src/index.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"nimrasyed","email":"nimrasyed003@gmail.com"},"repository":{"url":"git+https://github.com/nimra-syed/agenttrace.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.12.1","description":"Instrumentation client for AgentTrace: record an AI agent's traces and spans.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","jest":"^30.0.0","esbuild":"^0.24.2","ts-jest":"^29.2.5","typescript":"^5.7.3","@types/jest":"^30.0.0","@types/node":"^24.0.0","dts-bundle-generator":"^9.5.1","@agenttraceai/shared-types":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1785859898835_0.6597944682604167","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agenttraceai/sdk","version":"0.1.1","description":"Instrumentation client for AgentTrace: record an AI agent's traces and spans.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/nimra-syed/agenttrace.git","directory":"packages/sdk"},"publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=cjs --outfile=dist/index.js && dts-bundle-generator --no-banner -o dist/index.d.ts src/index.ts","typecheck":"tsc --noEmit","test":"jest"},"devDependencies":{"@agenttraceai/shared-types":"workspace:*","@types/jest":"^30.0.0","@types/node":"^24.0.0","dts-bundle-generator":"^9.5.1","esbuild":"^0.24.2","jest":"^30.0.0","ts-jest":"^29.2.5","tsx":"^4.23.1","typescript":"^5.7.3"},"jest":{"moduleFileExtensions":["js","json","ts"],"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"rootDir":"src","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node"},"gitHead":"02d6c151c78454a917da099d5c0228aa8903752c","_id":"@agenttraceai/sdk@0.1.1","bugs":{"url":"https://github.com/nimra-syed/agenttrace/issues"},"homepage":"https://github.com/nimra-syed/agenttrace#readme","_nodeVersion":"22.14.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-8eMMq5d6SIHPJJLTO1kvpw6Y4ecJ7N8mV2QcqqnQyHLltQAevc5wV7NGsn9ayHsAuFiVg3syRsoFQp5VjVfO3A==","shasum":"17db59cd9dd4118d1ad6617589f749048f9dbe84","tarball":"https://registry.npmjs.org/@agenttraceai/sdk/-/sdk-0.1.1.tgz","fileCount":5,"unpackedSize":13605,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA8DpgKbi08+Zvz+h/XH2XeLl4Q4k2pPIE9jiT54rg2CAiBpRLtMNExl/MGcDHyANUdtDxnPccwkkqZvRYIrdG+IGQ=="}]},"_npmUser":{"name":"nimrasyed","email":"nimrasyed003@gmail.com"},"directories":{},"maintainers":[{"name":"nimrasyed","email":"nimrasyed003@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.1_1785882573917_0.9478116273263206"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-04T16:11:38.654Z","modified":"2026-08-04T22:29:34.273Z","0.1.0":"2026-08-04T16:11:38.987Z","0.1.1":"2026-08-04T22:29:34.058Z"},"bugs":{"url":"https://github.com/nimra-syed/agenttrace/issues"},"license":"MIT","homepage":"https://github.com/nimra-syed/agenttrace#readme","repository":{"type":"git","url":"git+https://github.com/nimra-syed/agenttrace.git","directory":"packages/sdk"},"description":"Instrumentation client for AgentTrace: record an AI agent's traces and spans.","maintainers":[{"name":"nimrasyed","email":"nimrasyed003@gmail.com"}],"readme":"# @agenttraceai/sdk\n\nInstrumentation client for [AgentTrace](https://github.com/nimra-syed/agenttrace):\nrecord an AI agent's LLM calls, tool calls, latency, token usage, cost,\nand errors as traces and spans.\n\n## Usage\n\n```ts\nimport { AgentTraceClient } from \"@agenttraceai/sdk\";\n\nconst client = new AgentTraceClient({\n  apiKey: process.env.AGENTTRACE_API_KEY!,\n  baseUrl: process.env.AGENTTRACE_BASE_URL,\n});\n\nawait client.trace(\n  { name: \"issue-investigation\", agentName: \"github-agent\" },\n  async (trace) => {\n    const result = await trace.span(\n      { name: \"call-llm\", type: \"LLM\" },\n      async (span) => {\n        const response = await callLlm();\n        span.recordUsage({\n          promptTokens: response.usage.promptTokens,\n          completionTokens: response.usage.completionTokens,\n        });\n        return response.text;\n      },\n    );\n\n    trace.setOutput(result);\n  },\n);\n```\n\n`client.trace()`/`trace.span()` measure timing and report to AgentTrace\nautomatically. A wrapped function's return value is never sent as\noutput automatically; call `setOutput()` explicitly when there's\nsomething worth recording. Every outbound call fails open (a bounded\ntimeout, warnings that only ever describe the failure kind, never\nrequest/response content), so a problem with AgentTrace itself can\nnever break or hang the agent being instrumented.\n\n## Connecting a project\n\nThe easiest way to get an API key and get connected is\n[`@agenttraceai/cli`](https://www.npmjs.com/package/@agenttraceai/cli):\n\n```bash\nnpx @agenttraceai/cli init\n```\n","readmeFilename":"README.md"}