{"_id":"@augur-ai-co/sdk","name":"@augur-ai-co/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@augur-ai-co/sdk","version":"0.1.0","description":"Native TypeScript client for the Augur model gateway","type":"module","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"types":"./dist/index.d.ts","module":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepack":"bun run build","typecheck":"tsc --noEmit","test":"vitest run"},"devDependencies":{"@augur/shared":"workspace:*","typescript":"^5.8.3","vitest":"^3.2.4"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/LPT-elev/augur-ai.git","directory":"packages/sdk"},"homepage":"https://augur-ai.co","license":"Apache-2.0","_id":"@augur-ai-co/sdk@0.1.0","gitHead":"65fcea65b5cd66e7f8dbc41e46c470d828c37695","bugs":{"url":"https://github.com/LPT-elev/augur-ai/issues"},"_nodeVersion":"20.20.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-GFBhh97lzNM6DUum+/MeaMh71jGDtGD4J7pt6DVgRgfy29GPT2PrOOdmJ/v4LoW/sMedomnMJcLLlm4YvhngjQ==","shasum":"2a1cb52c61b6842cc04afed8f5e709ab6a47e289","tarball":"https://registry.npmjs.org/@augur-ai-co/sdk/-/sdk-0.1.0.tgz","fileCount":23,"unpackedSize":78027,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCh6hdZPtOJnLDq4r2aaeYbA/U6zXym14suER76OahRDgIhAIojno3UvRmPIufyiHGFkjocGAPgi2fRvB3gnQWbo3gr"}]},"_npmUser":{"name":"lpt-elev","email":"luke@proveniq.co.uk"},"directories":{},"maintainers":[{"name":"lpt-elev","email":"luke@proveniq.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1787162938396_0.15947999222352616"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T18:08:58.098Z","0.1.0":"2026-08-19T18:08:58.539Z","modified":"2026-08-19T18:08:58.833Z"},"maintainers":[{"name":"lpt-elev","email":"luke@proveniq.co.uk"}],"description":"Native TypeScript client for the Augur model gateway","homepage":"https://augur-ai.co","repository":{"type":"git","url":"git+https://github.com/LPT-elev/augur-ai.git","directory":"packages/sdk"},"bugs":{"url":"https://github.com/LPT-elev/augur-ai/issues"},"license":"Apache-2.0","readme":"# Augur TypeScript SDK\n\nNative access to Augur's model gateway: project authentication, idempotent\ncompletions, usage-bearing streams, catalogue discovery, immutable receipts,\noutcomes and workload evidence.\n\nReleases are published from an immutable `sdk-v<version>` repository tag. The\ntag must exactly match this package's version, and the npm package is built,\ntested and published through npm trusted publishing by the release workflow.\n\n```bash\nbun add @augur-ai-co/sdk\n```\n\n## Complete\n\n```ts\nimport { AUGUR_AUTO_MODEL, Augur } from \"@augur-ai-co/sdk\";\n\nconst augur = new Augur({\n  apiKey: process.env.AUGUR_API_KEY!,\n  baseUrl: process.env.AUGUR_BASE_URL ?? \"http://localhost:8002\",\n});\n\nconst result = await augur.complete({\n  model: AUGUR_AUTO_MODEL,\n  messages: [{ role: \"user\", content: \"What is 2 + 2?\" }],\n  idempotencyKey: \"calculator-session-42-turn-1\",\n  workload: { key: \"calculator\", taskClass: \"simple_qa\" },\n});\n\nconsole.log(result.data.text);\nconsole.log(result.receiptId);\nconsole.log(result.routingMode); // \"automatic\"\n```\n\n`idempotencyKey` identifies a logical, billable call. Reuse it if your\napplication retries that call; create a new key for new work. The helper\n`Augur.idempotencyKey(\"turn\")` creates a suitable fresh value.\n\n`augur/auto` is the normal route: Augur applies current classifier and model\nevaluation evidence, then chooses the lowest estimated-cost model above the\nquality floor. A concrete model ID or project alias is also supported, but opts\nthat request out of automatic model selection and its potential savings. The\nresult exposes `routingMode` and, for a manual request, `routingAdvisory`.\n\n## Stream\n\n```ts\nconst controller = new AbortController();\nconst stream = await augur.stream(\n  {\n    model: AUGUR_AUTO_MODEL,\n    messages: [{ role: \"user\", content: \"Explain cache affinity.\" }],\n    idempotencyKey: Augur.idempotencyKey(),\n    cacheAffinityKey: \"conversation-42\",\n  },\n  { signal: controller.signal, requestId: \"trace-42\" },\n);\n\ntry {\n  for await (const event of stream) {\n    if (event.type === \"delta\") process.stdout.write(event.text);\n    if (event.type === \"usage\") console.log(event.usage);\n  }\n} finally {\n  await stream.cancel();\n}\n```\n\nThe client requires a provider-reported `usage` event before `done`. A broken\nor truncated stream raises `AugurError` instead of being presented as a\nsuccessful, unpriced completion. Once any stream content has been emitted, an\nupstream failure is never automatically replayed.\n\n## Receipts and outcomes\n\n```ts\nconst receipt = await augur.receipt(result.receiptId!);\n\nawait augur.createOutcome(receipt.data.requestId, {\n  idempotencyKey: `outcome_${receipt.data.requestId}_success`,\n  signal: \"success\",\n  source: \"application\",\n});\n\nconst evidence = await augur.evidence(\"calculator\");\n```\n\nThe client also exposes `listModels()`, `catalog()`, `health()` and\n`listOutcomes()`. HTTP 409/429/502/503/504 responses and transport failures may\nbe retried before a response is accepted. Retries preserve the exact request\nand idempotency key. `AugurError` provides stable `code`, `status`,\n`requestId`, `retryable` and `details` fields.\n\n## License\n\nThe Augur TypeScript SDK is available under the\n[Apache License 2.0](./LICENSE). This licence applies to the SDK package only;\nit does not license the rest of the Augur product repository.\n","readmeFilename":"README.md","_rev":"1-7510f1fc942fcdebc18e4132c4e9dee5"}