{"_id":"@altheia-xyz/sdk","_rev":"2-64513ec03d0d90b3221a5acaec7064fb","name":"@altheia-xyz/sdk","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@altheia-xyz/sdk","version":"0.0.1","keywords":["solana","ai","agent","iam","swig","altheia","audit","policy"],"license":"Apache-2.0","_id":"@altheia-xyz/sdk@0.0.1","maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"homepage":"https://altheia.xyz","bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"dist":{"shasum":"4122d5f23c359c043037e6c074ef8d28e1c97421","tarball":"https://registry.npmjs.org/@altheia-xyz/sdk/-/sdk-0.0.1.tgz","fileCount":5,"integrity":"sha512-Gn2uxecwYGgp9H0MvJ/SIMsts+5NXDtTKjB5ly2e9OgrsDR0biZoKBZHaz2jnYCZf4slqjcu9ezV+WjnX/uibA==","signatures":[{"sig":"MEYCIQCqgGoFe7H7g8lEfgm83IDjyYh2StNxV+kC2Icky9nqvwIhAKmo+IQ4M9bnbhMHZ+/zSYwceMPD4HRaYybdCOwSZ1EF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11213},"main":"./dist/index.js","type":"module","_from":"file:altheia-xyz-sdk-0.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsup src/index.ts --format esm --dts --watch","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"_npmUser":{"name":"altheia","email":"hello@altheia.xyz"},"_resolved":"/private/var/folders/z_/6656h13j1sx674klh55bc21m0000gp/T/f891bb3a1df7ef484d948fb4d7efe275/altheia-xyz-sdk-0.0.1.tgz","_integrity":"sha512-Gn2uxecwYGgp9H0MvJ/SIMsts+5NXDtTKjB5ly2e9OgrsDR0biZoKBZHaz2jnYCZf4slqjcu9ezV+WjnX/uibA==","repository":{"url":"git+https://github.com/altheia-xyz/altheia-sdk.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.3.0","description":"Altheia SDK — gate AI agent actions with on-chain-enforced policy. The trust layer for crypto AI agents.","directories":{},"_nodeVersion":"24.2.0","dependencies":{"zod":"^3.23.0","@altheia-xyz/types":"0.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.1_1778341018009_0.9244570806461849","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@altheia-xyz/sdk","version":"0.0.2","description":"AI agents you can fire — Altheia SDK. Per-action policy, on-chain Swig session keys, one-click revoke. For AI agents on Solana.","license":"Apache-2.0","homepage":"https://docs.altheia.xyz","repository":{"type":"git","url":"git+https://github.com/altheia-xyz/altheia-sdk.git","directory":"packages/sdk"},"keywords":["solana","ai","agent","iam","swig","altheia","audit","policy"],"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"zod":"^3.23.0","@altheia-xyz/types":"0.0.2"},"devDependencies":{"tsup":"^8.3.0","typescript":"^5.6.0","vitest":"^2.1.0"},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean","dev":"tsup src/index.ts --format esm --dts --watch","test":"vitest run","typecheck":"tsc --noEmit"},"_id":"@altheia-xyz/sdk@0.0.2","bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"_integrity":"sha512-FuzFkr1mBAod8ZNv2jc/vXLrdp3kSl4S2FIGyHX1nTnfpeXiObVtH3WrLjj+J0KpuC3NdHJ9dnV9/POFR8JsKw==","_resolved":"/private/var/folders/z_/6656h13j1sx674klh55bc21m0000gp/T/9c2840dc33a565ec3bc710f085626d6c/altheia-xyz-sdk-0.0.2.tgz","_from":"file:altheia-xyz-sdk-0.0.2.tgz","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-FuzFkr1mBAod8ZNv2jc/vXLrdp3kSl4S2FIGyHX1nTnfpeXiObVtH3WrLjj+J0KpuC3NdHJ9dnV9/POFR8JsKw==","shasum":"2c9d621411228996b1f7187eeefdb2bf6780d323","tarball":"https://registry.npmjs.org/@altheia-xyz/sdk/-/sdk-0.0.2.tgz","fileCount":5,"unpackedSize":12299,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCZG3krtDL8kAPu0F/KSc57TBJaNcDnfO1GZf0x3nvu9wIgVMYq87Nl+ZtfHYPlM3x4N5ONBw2684hYPyVLu5mWeZo="}]},"_npmUser":{"name":"altheia","email":"hello@altheia.xyz"},"directories":{},"maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.0.2_1778541794852_0.8902890382756423"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T15:36:57.891Z","modified":"2026-05-11T23:23:15.126Z","0.0.1":"2026-05-09T15:36:58.152Z","0.0.2":"2026-05-11T23:23:14.988Z"},"bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"license":"Apache-2.0","homepage":"https://docs.altheia.xyz","keywords":["solana","ai","agent","iam","swig","altheia","audit","policy"],"repository":{"type":"git","url":"git+https://github.com/altheia-xyz/altheia-sdk.git","directory":"packages/sdk"},"description":"AI agents you can fire — Altheia SDK. Per-action policy, on-chain Swig session keys, one-click revoke. For AI agents on Solana.","maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"readme":"# `@altheia-xyz/sdk`\n\n**AI agents you can fire.**\n\n📖 Docs: [docs.altheia.xyz](https://docs.altheia.xyz)\n\nThe TypeScript SDK for [Altheia](https://altheia.xyz). Wrap your agent's actions with `altheia.guard()` — they're checked against your operator's policy (off-chain pre-flight) and enforced on-chain at the [Swig](https://github.com/anagrambuild/swig-wallet) session-key signing layer.\n\nRevoke an agent's authority in one click from the dashboard. The wallet stops signing immediately — no key rotation, no downtime.\n\n## Install\n\n```bash\npnpm add @altheia-xyz/sdk\n```\n\n## Use\n\nRegister an agent at [altheia.xyz/dashboard](https://altheia.xyz/dashboard) — copy the `agentPda` and `apiKey` from the registration modal. Then:\n\n```ts\nimport { Altheia } from \"@altheia-xyz/sdk\";\n\nconst altheia = new Altheia({\n  agentPda: process.env.ALTHEIA_AGENT_PDA!,\n  apiKey:   process.env.ALTHEIA_API_KEY!,\n  // endpoint defaults to https://api.altheia.xyz — no need to set it\n});\n\nconst result = await altheia.guard(\n  {\n    type: \"swap\",\n    amount: 0.5,\n    asset: \"USDC\",\n    target: \"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\",\n  },\n  async () => {\n    // The actual action — only runs if policy allows\n    return await jupiter.swap(/* ... */);\n  }\n);\n```\n\nIf the policy denies the action, `guard()` throws `PolicyDeniedError` and your callback **never runs** — the wallet doesn't sign, nothing lands on chain.\n\n## Failure modes\n\nBy default, `failureMode: \"open\"` — if the Altheia backend is unreachable, the SDK returns allowed and the agent proceeds. Swig's on-chain scope still catches over-cap actions. Set `failureMode: \"closed\"` to halt on outage.\n\n## Status\n\n`v0.0.2` — alpha. Public API stable; mainnet ready (unaudited).\n\nLicense: Apache-2.0.\n","readmeFilename":"README.md"}