{"_id":"@coolwithakay/uatp","_rev":"2-ce25e6e39bd24ec379a9132ecf273af6","name":"@coolwithakay/uatp","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"@coolwithakay/uatp","version":"0.1.0","keywords":["uatp","ai","audit","cryptography","ed25519","signatures","reasoning","compliance"],"author":{"name":"UATP Team"},"license":"MIT","_id":"@coolwithakay/uatp@0.1.0","maintainers":[{"name":"coolwithakay","email":"kayron@houseofcalloway.com"}],"homepage":"https://github.com/KayronCalloway/uatp#readme","bugs":{"url":"https://github.com/KayronCalloway/uatp/issues"},"dist":{"shasum":"be173bd56fe77a0481b7febfcb865a3d7e35a7b2","tarball":"https://registry.npmjs.org/@coolwithakay/uatp/-/uatp-0.1.0.tgz","fileCount":6,"integrity":"sha512-Cpug7VYdj51CSAkrWRRfGG/s3vVQP2+23tHLV0XVrw+R3awjeUrUX+zNgu+Rhh0byelKAuCOPi+s7nBtqKP0hA==","signatures":[{"sig":"MEUCIGkzicUd+5BJt9TEf4dP3JXTwf0DfSK+irOs4pkuwNx3AiEAy9j3PwUvT1P9roTfU2sVfPmWadfVZokIDwtBgReDiGM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@coolwithakay%2fuatp@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50302},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"28523e224563ce97813c63804bd5e35909c33f0a","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src/","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"coolwithakay","email":"kayron@houseofcalloway.com"},"repository":{"url":"git+https://github.com/KayronCalloway/uatp.git","type":"git","directory":"sdk/typescript"},"_npmVersion":"10.8.2","description":"Cryptographic audit trails for AI decisions","directories":{},"_nodeVersion":"20.20.1","dependencies":{"@noble/hashes":"^1.4.0","@noble/ed25519":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/uatp_0.1.0_1773778385942_0.4768940181897976","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@coolwithakay/uatp","version":"1.0.1","description":"Cryptographic audit trails for AI decisions","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts","dev":"tsup src/index.ts --format cjs,esm --dts --watch","test":"vitest","lint":"eslint src/","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["uatp","ai","audit","cryptography","ed25519","signatures","reasoning","compliance"],"author":{"name":"UATP Team"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/KayronCalloway/uatp.git","directory":"sdk/typescript"},"homepage":"https://github.com/KayronCalloway/uatp#readme","bugs":{"url":"https://github.com/KayronCalloway/uatp/issues"},"dependencies":{"@noble/ed25519":"^2.1.0","@noble/hashes":"^1.4.0"},"devDependencies":{"@types/node":"^20.0.0","tsup":"^8.0.0","typescript":"^5.0.0","vitest":"^1.0.0"},"engines":{"node":">=18.0.0"},"gitHead":"b413d6e894a987cd16197aaabf73bf6ef23f0e23","_id":"@coolwithakay/uatp@1.0.1","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-dDkB4+AwJEto2labsJfqkl6NCfzmEMKYh21oDbS6HQSLY/1b9TLntimEitBcjif5KIvKjckLN/l9NVPWzlmYRA==","shasum":"ac5413ad9501b601238d97e4b80578df56d60c4a","tarball":"https://registry.npmjs.org/@coolwithakay/uatp/-/uatp-1.0.1.tgz","fileCount":6,"unpackedSize":50302,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCKpXGgBRp+wIoCZHAA1rkV6SszChtosdvawHIx2w1NygIhAJ/h8bMeWXwcxbuPbljKE4XJNYSaWvSOyp1LAoO29uTh"}]},"_npmUser":{"name":"coolwithakay","email":"kayron@houseofcalloway.com"},"directories":{},"maintainers":[{"name":"coolwithakay","email":"kayron@houseofcalloway.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uatp_1.0.1_1773809347022_0.30428055275244015"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T20:13:05.876Z","modified":"2026-03-18T04:49:07.299Z","0.1.0":"2026-03-17T20:13:06.081Z","1.0.1":"2026-03-18T04:49:07.156Z"},"bugs":{"url":"https://github.com/KayronCalloway/uatp/issues"},"author":{"name":"UATP Team"},"license":"MIT","homepage":"https://github.com/KayronCalloway/uatp#readme","keywords":["uatp","ai","audit","cryptography","ed25519","signatures","reasoning","compliance"],"repository":{"type":"git","url":"git+https://github.com/KayronCalloway/uatp.git","directory":"sdk/typescript"},"description":"Cryptographic audit trails for AI decisions","maintainers":[{"name":"coolwithakay","email":"kayron@houseofcalloway.com"}],"readme":"# UATP TypeScript SDK\n\nCryptographic audit trails for AI decisions.\n\n[![npm](https://img.shields.io/npm/v/uatp)](https://www.npmjs.com/package/uatp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Installation\n\n```bash\nnpm install @coolwithakay/uatp\n```\n\n## Quick Start\n\n```typescript\nimport { UATP } from '@coolwithakay/uatp';\n\nconst client = new UATP();\n\n// Create and sign a capsule (keys generated locally, never transmitted)\nconst result = await client.certify({\n  task: 'Loan decision',\n  decision: 'Approved for $50,000 at 5.2% APR',\n  reasoning: [\n    { step: 1, thought: 'Credit score 720 (excellent)', confidence: 0.95 },\n    { step: 2, thought: 'Debt-to-income 0.28 (acceptable)', confidence: 0.90 }\n  ]\n});\n\nconsole.log(result.capsuleId);   // cap_xyz123...\nconsole.log(result.signature);   // Ed25519 signature\nconsole.log(result.publicKey);   // Your verification key\n```\n\n## Zero-Trust Architecture\n\nYour private key **never leaves your device**:\n\n```\n┌─────────────────────────────┐\n│  YOUR DEVICE                │\n│  ✓ Private key (derived)    │\n│  ✓ ALL signing happens here │\n│  ✓ Ed25519 + PBKDF2 480K    │\n└──────────────┬──────────────┘\n               │ Only hash sent\n               ▼\n┌─────────────────────────────┐\n│  UATP SERVER (optional)     │\n│  - Timestamp service        │\n│  - Capsule storage          │\n└─────────────────────────────┘\n```\n\n## Usage Examples\n\n### Basic Usage\n\n```typescript\nimport { UATP } from '@coolwithakay/uatp';\n\nconst client = new UATP();\n\nconst result = await client.certify({\n  task: 'Product recommendation',\n  decision: 'Recommended iPhone 15 Pro',\n  reasoning: [\n    { step: 1, thought: 'User prefers Apple ecosystem', confidence: 0.92 },\n    { step: 2, thought: 'Budget matches Pro pricing', confidence: 0.88 }\n  ]\n});\n```\n\n### With Custom Passphrase (Production)\n\n```typescript\nconst result = await client.certify({\n  task: 'Medical diagnosis',\n  decision: 'Recommend follow-up tests',\n  reasoning: [\n    { step: 1, thought: 'Symptoms consistent with condition X', confidence: 0.85 }\n  ],\n  passphrase: 'your-secure-passphrase',\n  deviceBound: false\n});\n```\n\n### Verify Locally (No Server Needed)\n\n```typescript\nconst verification = client.verifyLocal(capsule);\n\nif (verification.valid) {\n  console.log('Capsule is authentic!');\n} else {\n  console.log('Verification failed:', verification.errors);\n}\n```\n\n### Store on Server\n\n```typescript\nconst result = await client.certify({\n  task: 'Insurance claim',\n  decision: 'Approved: $5,000',\n  reasoning: [...],\n  storeOnServer: true\n});\n\nconsole.log(result.proofUrl); // https://...\n```\n\n### Retrieve Proof\n\n```typescript\nconst proof = await client.getProof('cap_abc123');\nconsole.log(proof.payload.task);\nconsole.log(proof.payload.decision);\n```\n\n## API Reference\n\n### `new UATP(config?)`\n\nCreate a new UATP client.\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiKey` | `string` | - | API key for authenticated requests |\n| `baseUrl` | `string` | `http://localhost:8000` | UATP server URL |\n| `timeout` | `number` | `30000` | Request timeout (ms) |\n\n### `client.certify(options)`\n\nCreate a signed capsule.\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `task` | `string` | Yes | Description of the task |\n| `decision` | `string` | Yes | The AI's decision |\n| `reasoning` | `ReasoningStep[]` | Yes | Reasoning steps |\n| `passphrase` | `string` | No | Key encryption passphrase |\n| `deviceBound` | `boolean` | No | Derive passphrase from device (default: true) |\n| `confidence` | `number` | No | Overall confidence (0-1) |\n| `metadata` | `object` | No | Additional metadata |\n| `requestTimestamp` | `boolean` | No | Get RFC 3161 timestamp (default: true) |\n| `storeOnServer` | `boolean` | No | Store on UATP server (default: false) |\n\n### `client.verifyLocal(capsule)`\n\nVerify a capsule cryptographically without server.\n\n### `client.getProof(capsuleId)`\n\nRetrieve proof from server.\n\n### `client.listCapsules(limit?)`\n\nList capsules from server.\n\n### `client.recordOutcome(capsuleId, outcome)`\n\nRecord actual outcome for a decision.\n\n## Framework Integration\n\n### React\n\n```typescript\nimport { UATP } from '@coolwithakay/uatp';\nimport { useState } from 'react';\n\nfunction useUATP() {\n  const [client] = useState(() => new UATP());\n\n  const certify = async (task: string, decision: string, reasoning: any[]) => {\n    return client.certify({ task, decision, reasoning });\n  };\n\n  return { certify };\n}\n```\n\n### Next.js API Route\n\n```typescript\n// pages/api/certify.ts\nimport { UATP } from '@coolwithakay/uatp';\n\nconst client = new UATP({ baseUrl: process.env.UATP_URL });\n\nexport default async function handler(req, res) {\n  const result = await client.certify(req.body);\n  res.json({ capsuleId: result.capsuleId });\n}\n```\n\n### Lovable / AI App Builders\n\n```typescript\n// In your Lovable-generated app\nimport { UATP } from '@coolwithakay/uatp';\n\nconst client = new UATP();\n\n// Audit every AI decision\nasync function makeDecision(userQuery: string) {\n  const aiResponse = await callYourAI(userQuery);\n\n  // Create audit trail\n  const proof = await client.certify({\n    task: userQuery,\n    decision: aiResponse.decision,\n    reasoning: aiResponse.steps.map((s, i) => ({\n      step: i + 1,\n      thought: s.thought,\n      confidence: s.confidence\n    }))\n  });\n\n  return { ...aiResponse, proofId: proof.capsuleId };\n}\n```\n\n## Security\n\n- **Ed25519** signatures (128-bit security)\n- **PBKDF2-HMAC-SHA256** key derivation (480,000 iterations)\n- **SHA-256** content hashing\n- Keys derived from passphrase, never stored in plaintext\n- Optional **RFC 3161** timestamps from external authority\n\n## License\n\nMIT\n","readmeFilename":"README.md"}