{"_id":"@asymptote/sdk","name":"@asymptote/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@asymptote/sdk","version":"0.1.0","description":"Asymptote TypeScript SDK for Observe agent telemetry","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/asymptote-labs/agent-beacon.git","directory":"packages/asymptote-sdk-js"},"keywords":["asymptote","observe","beacon","opentelemetry","agents","llm","ai"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=20"},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"npm run clean && tsc -p tsconfig.build.json","check":"tsc -p tsconfig.json --noEmit","clean":"rm -rf dist","pack:smoke":"node scripts/smoke-pack.mjs","pack:dry-run":"npm pack --dry-run","prepack":"npm run build","test":"vitest run","test:unit":"vitest run src"},"sideEffects":false,"dependencies":{"@opentelemetry/api":"^1.9.1","@opentelemetry/exporter-trace-otlp-http":"^0.218.0","@opentelemetry/instrumentation":"^0.218.0","@opentelemetry/resources":"^2.7.1","@opentelemetry/sdk-trace-base":"^2.7.1","@opentelemetry/sdk-trace-node":"^2.7.1","@opentelemetry/semantic-conventions":"^1.41.1","@traceloop/instrumentation-anthropic":"^0.27.0","@traceloop/instrumentation-openai":"^0.27.0"},"devDependencies":{"@anthropic-ai/sdk":"^0.102.0","@types/node":"^25.9.2","typescript":"^6.0.3","vitest":"^4.1.8"},"gitHead":"7b365b8cf2d50d6f5b67d48f800393297dd0aaaa","_id":"@asymptote/sdk@0.1.0","bugs":{"url":"https://github.com/asymptote-labs/agent-beacon/issues"},"homepage":"https://github.com/asymptote-labs/agent-beacon#readme","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-AWULLgtsqX1X34yMfop8u+KwTWC9Wb4SvuZJEuDTfoBV/O+Yx/oWX72LzxGYAFDDp1AirhLx7eUuSWE4z0eS8w==","shasum":"37a7fdaccd978f87ce49a0ce30038d6e5462cb41","tarball":"https://registry.npmjs.org/@asymptote/sdk/-/sdk-0.1.0.tgz","fileCount":8,"unpackedSize":31253,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCs0ipKp5HBuJcPA7QI+5QVUlmyhIQIn5AaF9+5mju9LgIhALOomYcz0ZJDEIbM6/l/xp/pY4uS7m2teLLhxhoGJZ7N"}]},"_npmUser":{"name":"jqdsouza","email":"justin@asymptotelabs.ai"},"directories":{},"maintainers":[{"name":"jqdsouza","email":"justin@asymptotelabs.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1781078558021_0.2830305546145082"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T08:02:37.885Z","0.1.0":"2026-06-10T08:02:38.172Z","modified":"2026-06-10T08:02:38.386Z"},"maintainers":[{"name":"jqdsouza","email":"justin@asymptotelabs.ai"}],"description":"Asymptote TypeScript SDK for Observe agent telemetry","homepage":"https://github.com/asymptote-labs/agent-beacon#readme","keywords":["asymptote","observe","beacon","opentelemetry","agents","llm","ai"],"repository":{"type":"git","url":"git+https://github.com/asymptote-labs/agent-beacon.git","directory":"packages/asymptote-sdk-js"},"bugs":{"url":"https://github.com/asymptote-labs/agent-beacon/issues"},"license":"MIT","readme":"# Asymptote TypeScript SDK\n\nThe Asymptote SDK instruments cloud-hosted agent apps through the `Observe`\nmodule and exports OpenTelemetry spans that remain compatible with Beacon's\nnormalized JSONL event schema.\n\n## Hosted Asymptote Observe\n\n```bash\nnpm install @asymptote/sdk\nexport ASYMPTOTE_API_KEY=...\n```\n\n```typescript\nimport { Observe } from \"@asymptote/sdk\";\n\nObserve.initialize({\n  apiKey: process.env.ASYMPTOTE_API_KEY,\n});\n```\n\nHosted Observe contract:\n\n- Transport: OpenTelemetry over HTTP.\n- Default base URL: `https://api.asymptotelabs.ai`.\n- Observe path: `/v1/observe` is appended when the endpoint does not already include it.\n- Auth: `authorization: Bearer <ASYMPTOTE_API_KEY>`.\n- Override base URL with `ASYMPTOTE_BASE_URL` or `initialize({ baseUrl })`.\n\nThe TypeScript SDK preserves this hosted contract, but this repository does not\nimplement the managed ingest service. Use `baseUrl` with a local stub in tests.\n\n## Local Or Customer-Managed Observe Export\n\n```typescript\nimport { Observe } from \"@asymptote/sdk\";\n\nObserve.initialize({\n  otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,\n});\n```\n\nThe SDK appends `/v1/observe` when the endpoint does not already include it.\nCloud spans carry `beacon.origin=cloud` and the compatibility\nattributes documented in `docs/asymptote-observe-sdk.md`.\n\nEndpoint precedence:\n\n1. `initialize({ otlpEndpoint })`\n2. `OTEL_EXPORTER_OTLP_ENDPOINT`\n3. hosted `baseUrl` when an API key is present\n\nBeacon endpoint installs remain local-first and never require hosted credentials.\n\n## Automatic AI Instrumentation\n\nAsymptote Observe follows an OpenTelemetry-first pattern: initialize once\nas early as possible, then use existing OpenLLMetry instrumentations for common\nprovider SDKs.\n\n```typescript\nimport { Observe } from \"@asymptote/sdk\";\n\nObserve.initialize({\n  apiKey: process.env.ASYMPTOTE_API_KEY,\n});\n```\n\nBy default the SDK enables OpenAI and Anthropic OpenLLMetry instrumentations.\nDisable or configure them if needed:\n\n```typescript\nObserve.initialize({\n  apiKey: process.env.ASYMPTOTE_API_KEY,\n  instrumentationOptions: {\n    openAI: { traceContent: true },\n    anthropic: false,\n  },\n});\n```\n\nIf your app already owns OpenTelemetry setup, use\n`Observe.instrumentations()` with that provider instead of calling\n`initialize()` twice.\n\n## Vercel AI SDK\n\n```typescript\nimport { registerTelemetry } from \"ai\";\nimport { OpenTelemetry } from \"@ai-sdk/otel\";\nimport { Observe } from \"@asymptote/sdk\";\n\nObserve.initialize();\n\nregisterTelemetry(new OpenTelemetry({\n  tracer: Observe.getTracer(),\n}));\n```\n\n## Claude Agent SDK\n\n```typescript\nimport { query as originalQuery } from \"@anthropic-ai/claude-agent-sdk\";\nimport { Observe } from \"@asymptote/sdk\";\n\nObserve.initialize();\n\nconst query = Observe.wrapClaudeAgentQuery(originalQuery);\n```\n\nFor the first SDK release, prefer provider-level Anthropic/OpenLLMetry\ninstrumentation or `observe()` around the agent entry point. Custom Claude Agent\nSDK hooks are deferred until those paths leave important telemetry gaps.\n\n## Custom Agent Steps\n\n```typescript\nconst plan = Observe.observe(\n  {\n    name: \"agent.plan\",\n    attributes: {\n      \"beacon.harness.name\": \"custom_agent\",\n      \"beacon.event.action\": \"tool.invoked\",\n    },\n  },\n  async (input: string) => {\n    return runPlanner(input);\n  },\n);\n```\n\nCall `Observe.flush()` before short-lived scripts exit, or\n`Observe.shutdown()` when the process owns the provider lifecycle.\n\n## Beta Support Matrix\n\n- OpenAI SDK: OpenLLMetry instrumentation enabled by default.\n- Anthropic SDK: OpenLLMetry instrumentation enabled by default.\n- Vercel AI SDK: register `@ai-sdk/otel` with `Observe.getTracer()`.\n- Claude Agent SDK: wrap query functions with `wrapClaudeAgentQuery()` or use `observe()`.\n- Custom orchestration: wrap functions with `observe()`.\n- Custom Claude hook and OpenAI Agents tracing adapters are intentionally deferred.\n","readmeFilename":"README.md","_rev":"1-418ab60f3bc7a13cb35210bb514c024c"}