{"_id":"@aikdna/kdna-web-client","_rev":"9-5e19b800cc52c0b391ae3f654bf8bfdb","name":"@aikdna/kdna-web-client","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@aikdna/kdna-web-client","version":"0.1.0","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"license":"Apache-2.0","_id":"@aikdna/kdna-web-client@0.1.0","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://github.com/aikdna/kdna-web-client","bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"dist":{"shasum":"799fd143c0b0effdffca078a28401a59424062cb","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.1.0.tgz","fileCount":8,"integrity":"sha512-1XrZBlh3lgbFExDzJz0/SmcBOBG1W8Fvsg+KsV5jZkTDtJI60CWvu1OpMAhT8qjK2tW+RzJ0cWAKsvLUaFPeng==","signatures":[{"sig":"MEUCIC53FRut9+1O3o6y6xw2qngE/MKFCeD7i0o1qFVdvwGEAiEA/iekayxULgZ2/XCFf2MJ2swBzdNC69eVQiYmTjO6CcQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23756},"type":"module","engines":{"node":">=18"},"exports":{".":"./src/index.js"},"gitHead":"829b0f8f65caf770d4351270156858e3d58f82ae","scripts":{"ci":"npm test && npm run build && npm run size && npm pack --dry-run --json","size":"node scripts/size.js","test":"node --test tests/**/*.test.js","build":"node scripts/build.js"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna-web-client.git","type":"git"},"_npmVersion":"10.9.8","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","directories":{},"_nodeVersion":"22.22.3","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/kdna-web-client_0.1.0_1783068081162_0.4867295745719984","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aikdna/kdna-web-client","version":"0.1.1","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"license":"Apache-2.0","_id":"@aikdna/kdna-web-client@0.1.1","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://github.com/aikdna/kdna-web-client","bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"dist":{"shasum":"2f41bb22c77d6ab6e4ad9a24b10511c0993d116a","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.1.1.tgz","fileCount":8,"integrity":"sha512-zMbwtF/hr4bqcJaokQ9oxXe0G7A8PzIuOHpwZNH/bZlPlyHxxc1V8KUtYxgSKkEH4YKUrCOSekwmChRF2EE1Rg==","signatures":[{"sig":"MEQCICXnAxIsh4O/5HhtDgfPbl1O9nh2czIn6bjSUF6C6biQAiAUXpumMY9eY8molldU4HBbM3H2ShplSzjQmlvp+kmXiQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aikdna%2fkdna-web-client@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23850},"type":"module","engines":{"node":">=20"},"exports":{".":"./src/index.js"},"gitHead":"a210a341dcbbd8c4e8005e7e21c79113eb116563","scripts":{"ci":"npm test && npm run lint && npm run build && npm run size && npm pack --dry-run --json","lint":"node scripts/lint.js","size":"node scripts/size.js","test":"node --test tests/client.test.js","build":"node scripts/build.js","prepublishOnly":"npm run ci"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna-web-client.git","type":"git"},"_npmVersion":"10.9.8","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","directories":{},"_nodeVersion":"22.23.1","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/kdna-web-client_0.1.1_1783089250753_0.6783528917666499","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aikdna/kdna-web-client","version":"0.1.2","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"license":"Apache-2.0","_id":"@aikdna/kdna-web-client@0.1.2","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://github.com/aikdna/kdna-web-client","bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"dist":{"shasum":"27b5bc91777fb1ac866b70bebe0355983081a574","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.1.2.tgz","fileCount":9,"integrity":"sha512-CRo6kiOdw5E+/nTVllcAF8on0q/aOB/jyWa+i7nqdsCqks6Qxc0Pxh6VNTQq13pIjQjgBfPJuF9ZR5DE+611Ug==","signatures":[{"sig":"MEUCIA2+Ec1XQym9/B2+jZTk8fIKCRFSh68HLyCLilukHN//AiEA4/ptpxTacDqyfUQJdsgvm0/5NWL/q+YIeF1RJVN3Mf4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28296},"type":"module","engines":{"node":">=20"},"exports":{".":"./src/index.js"},"gitHead":"a0a4680a970e467d33c018e6d7381f8f7b030cd0","scripts":{"ci":"npm test && npm run lint && npm run build && npm run size && npm pack --dry-run --json","lint":"node scripts/lint.js","size":"node scripts/size.js","test":"node --test tests/client.test.js","build":"node scripts/build.js","prepublishOnly":"npm run ci"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna-web-client.git","type":"git"},"_npmVersion":"10.9.8","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","directories":{},"_nodeVersion":"22.22.3","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/kdna-web-client_0.1.2_1783732581826_0.10521644989551815","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aikdna/kdna-web-client","version":"0.2.0","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"license":"Apache-2.0","_id":"@aikdna/kdna-web-client@0.2.0","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://github.com/aikdna/kdna-web-client","bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"dist":{"shasum":"1100da94982a47abf36ed85e2a1e1a9214f4c92b","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.2.0.tgz","fileCount":9,"integrity":"sha512-Ov46PsolScTxK0PZ7hC7aEhOfjY99oHYdao52c/8q4SxjwBE1bQonl4H+cNIDw0txJaf7ukOv4x1hPY2X1BKcw==","signatures":[{"sig":"MEUCIBRGBPTP7OJIOKpLZAnNwtNm3hpnwDC4Qz1MqEI2tLb+AiEAvcoFwSwtLGNnBFO26chjFBxIBNN63lt/rMrRAsHzGY4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aikdna%2fkdna-web-client@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30898},"type":"module","engines":{"node":">=20"},"exports":{".":"./src/index.js"},"gitHead":"ad27c702c29b0780dce89dfa5e3665d69fca179d","scripts":{"ci":"npm test && npm run lint && npm run build && npm run size && npm pack --dry-run --json","lint":"node scripts/lint.js","size":"node scripts/size.js","test":"node --test tests/client.test.js","build":"node scripts/build.js","prepublishOnly":"npm run ci"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna-web-client.git","type":"git"},"_npmVersion":"10.9.8","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","directories":{},"_nodeVersion":"22.23.1","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/kdna-web-client_0.2.0_1783907967389_0.681178445695424","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aikdna/kdna-web-client","version":"0.2.1","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"license":"Apache-2.0","_id":"@aikdna/kdna-web-client@0.2.1","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://github.com/aikdna/kdna-web-client","bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"dist":{"shasum":"d9acc4dfc33be1d9203bbdafbf36913217e40dc7","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.2.1.tgz","fileCount":10,"integrity":"sha512-9DWb6b0h786pxDZ+/drghiU62h7hBqK/1zVk9CUlCMLf8qCtxX1Ii9SqOIcqiWXq403sJrn/RVRc0bIVfj76ag==","signatures":[{"sig":"MEYCIQDhnruzK5EgxJSJhCehQLIrlEcwfuXR71DTRgv5x+ZeWgIhAPDjzDG/eqzuXzKbUOXZbdPxlpDWLcmgkIdi8klhe3lp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aikdna%2fkdna-web-client@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":299313},"type":"module","types":"./src/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"gitHead":"c517456736bc31ebd22d21c12ca68b708bf3ef29","scripts":{"ci":"npm run ci:boundary && npm run validators:check && npm test && npm run typecheck && npm run lint && npm run build && npm run size && npm run public:check && npm run naming:check && npm run package:runtime-check && npm pack --dry-run --json","lint":"node scripts/lint.js","size":"node scripts/size.js","test":"node --test tests/client.test.js tests/release-context.test.cjs","build":"node scripts/build.js","typecheck":"tsc --noEmit","ci:boundary":"node scripts/check-ci-boundary.js && node scripts/test-ci-boundary-hostile.js && node scripts/test-packed-runtime-boundary-hostile.js","naming:check":"node scripts/check-naming-integrity.js","public:check":"node scripts/check-public-surface.js","prepublishOnly":"npm run ci","release:context":"node scripts/verify-release-context.cjs","validators:check":"node scripts/generate-runtime-validators.js --check","validators:generate":"node scripts/generate-runtime-validators.js --write","package:runtime-check":"node scripts/check-packed-runtime-boundary.js","test:web-server-integration":"node --test tests/web-server-integration.test.js"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna-web-client.git","type":"git"},"_npmVersion":"10.9.8","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","directories":{},"_nodeVersion":"22.23.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.17.1","esbuild":"^0.25.6","typescript":"^5.9.3","ajv-formats":"^3.0.1","@aikdna/kdna-web-server":"0.3.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/kdna-web-client_0.2.1_1784366208904_0.6854559558409177","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@aikdna/kdna-web-client","version":"0.2.2","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"license":"Apache-2.0","_id":"@aikdna/kdna-web-client@0.2.2","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://github.com/aikdna/kdna-web-client","bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"dist":{"shasum":"fc7e30c60c249b9e5e6e71456aa831b89129ac77","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.2.2.tgz","fileCount":10,"integrity":"sha512-3VCUmaC67/eSEs68Jn95UyoHqRxovwB/I81eHQQE4x+bZgRh8goMCUX1vOSlUPMYZ+4yqdQb1Fnzea/qXHAz0Q==","signatures":[{"sig":"MEYCIQCKD9cSf5jhueWk404keS/D3w4eyYKQZne0Jj7r8RE/SgIhANsKFrQbOVekQ6y+AaJ4B6+8TQZgzgCk4qWMBUEZtRei","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aikdna%2fkdna-web-client@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":299404},"type":"module","types":"./src/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"gitHead":"7b7f140cfe3abde5d5efb1794bed726d47eaec84","scripts":{"ci":"npm run ci:boundary && npm run validators:check && npm test && npm run typecheck && npm run lint && npm run build && npm run size && npm run public:check && npm run naming:check && npm run package:runtime-check && npm pack --dry-run --json","lint":"node scripts/lint.js","size":"node scripts/size.js","test":"node --test tests/client.test.js tests/release-context.test.cjs","build":"node scripts/build.js","typecheck":"tsc --noEmit","ci:boundary":"node scripts/check-ci-boundary.js && node scripts/test-ci-boundary-hostile.js && node scripts/test-packed-runtime-boundary-hostile.js","naming:check":"node scripts/check-naming-integrity.js","public:check":"node scripts/check-public-surface.js","prepublishOnly":"npm run ci","release:context":"node scripts/verify-release-context.cjs","validators:check":"node scripts/generate-runtime-validators.js --check","validators:generate":"node scripts/generate-runtime-validators.js --write","package:runtime-check":"node scripts/check-packed-runtime-boundary.js","test:web-server-integration":"node --test tests/web-server-integration.test.js"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna-web-client.git","type":"git"},"_npmVersion":"10.9.8","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","directories":{},"_nodeVersion":"22.23.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.17.1","esbuild":"^0.25.6","typescript":"^5.9.3","ajv-formats":"^3.0.1","@aikdna/kdna-web-server":"0.3.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/kdna-web-client_0.2.2_1784367744016_0.46184326587750824","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aikdna/kdna-web-client","version":"0.3.0","description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","type":"module","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"types":"./src/index.d.ts","scripts":{"ci":"npm run ci:boundary && npm run validators:check && npm test && npm run typecheck && npm run lint && npm run build && npm run size && npm run public:check && npm run naming:check && npm run package:runtime-check && npm pack --dry-run --json","ci:boundary":"node scripts/check-ci-boundary.js && node scripts/test-ci-boundary-hostile.js && node scripts/test-packed-runtime-boundary-hostile.js","test":"node --test tests/client.test.js tests/regexp-safety.test.js tests/release-context.test.cjs","test:web-server-integration":"node --test tests/web-server-integration.test.js","typecheck":"tsc --noEmit","lint":"node scripts/lint.js","build":"node scripts/build.js","size":"node scripts/size.js","validators:generate":"node scripts/generate-runtime-validators.js --write","validators:check":"node scripts/generate-runtime-validators.js --check","naming:check":"node scripts/check-naming-integrity.js","public:check":"node scripts/check-public-surface.js","package:runtime-check":"node scripts/check-packed-runtime-boundary.js","release:context":"node scripts/verify-release-context.cjs","prepublishOnly":"npm run ci"},"engines":{"node":">=20"},"peerDependencies":{},"dependencies":{},"devDependencies":{"@aikdna/kdna-web-server":"0.3.0","ajv":"^8.17.1","ajv-formats":"^3.0.1","esbuild":"^0.25.6","typescript":"^5.9.3"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/aikdna/kdna-web-client.git"},"bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"homepage":"https://github.com/aikdna/kdna-web-client","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"_id":"@aikdna/kdna-web-client@0.3.0","gitHead":"ac6f44c5158f1fe47e532517c59ce115e87160c9","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-6eYSGnLYxOANaz7VCpcX0ht4pYn2kR7eUDoSzW6lm7CYiIk1C3DZRQK5s3I242mMlrJaNj4m5+oiVhSy925GUg==","shasum":"cfd96ae6668ee859db28c69b562e761af7f7fa20","tarball":"https://registry.npmjs.org/@aikdna/kdna-web-client/-/kdna-web-client-0.3.0.tgz","fileCount":10,"unpackedSize":318339,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aikdna%2fkdna-web-client@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHlHifYg9daCjXPHrX9YhvhvzyxaA4NNdSkscwZQPdCOAiBJLFYlGSc9kGOtm566deZUr5M7ZvSk0OE56GieikremA=="}]},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"directories":{},"maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kdna-web-client_0.3.0_1786162214655_0.40037483940297913"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T08:41:21.001Z","modified":"2026-08-08T04:10:15.207Z","0.1.0":"2026-07-03T08:41:21.300Z","0.1.1":"2026-07-03T14:34:10.881Z","0.1.2":"2026-07-11T01:16:21.982Z","0.2.0":"2026-07-13T01:59:27.538Z","0.2.1":"2026-07-18T09:16:49.082Z","0.2.2":"2026-07-18T09:42:24.141Z","0.3.0":"2026-08-08T04:10:14.857Z"},"bugs":{"url":"https://github.com/aikdna/kdna-web-client/issues"},"license":"Apache-2.0","homepage":"https://github.com/aikdna/kdna-web-client","keywords":["kdna","kdna-web-client","browser","file-api","load-plan","judgment-asset"],"repository":{"type":"git","url":"git+https://github.com/aikdna/kdna-web-client.git"},"description":"Browser-safe KDNA utilities — file selection, metadata inspection, upload, and load-plan state management. Never performs decryption.","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"readme":"# @aikdna/kdna-web-client\n\n**Browser-safe KDNA utilities.**\n\n> **Status:** Experimental published browser integration at its exact package\n> coordinate. It is not a stable browser Runtime or a complete Host policy.\n\nFile selection, metadata inspection, upload to your server, and\nload-plan state management — without ever performing decryption in\nthe browser.\n\n> **Design constraint:** this package never decrypts anything. It reads\n> public metadata from a `.kdna` file and delegates all sensitive\n> operations to a server running\n> [@aikdna/kdna-web-server](https://github.com/aikdna/kdna-web-server).\n\n> New to KDNA? → [KDNA Core](https://github.com/aikdna/kdna)\n>\n> Need a server-side adapter? →\n> [@aikdna/kdna-web-server](https://github.com/aikdna/kdna-web-server)\n>\n> Need React components? →\n> [@aikdna/kdna-react](https://github.com/aikdna/kdna-react)\n\n[![npm](https://img.shields.io/npm/v/@aikdna/kdna-web-client)](https://www.npmjs.com/package/@aikdna/kdna-web-client)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)\n\n---\n\n## Install\n\n```bash\nnpm install @aikdna/kdna-web-client\n```\n\nNo peer dependencies. No Node.js built-ins in the browser bundle.\n\n---\n\n## Quick start\n\n```js\nimport { readKDNAMetadata, uploadKDNA, KDNALoadPlanManager } from '@aikdna/kdna-web-client'\n\n// 1. Let the user pick a file\nconst input = document.createElement('input')\ninput.type = 'file'\ninput.accept = '.kdna'\ninput.onchange = async () => {\n  const file = input.files[0]\n\n  // 2. Read public metadata (no server round-trip, no decryption)\n  const meta = await readKDNAMetadata(file)\n  console.log(meta.domain, meta.version, meta.encrypted)\n\n  // 3. Upload to your server and get a fileId\n  const { fileId } = await uploadKDNA(file, '/api/kdna/inspect')\n\n  // 4. Manage the load-plan flow\n  const manager = new KDNALoadPlanManager('/api/kdna')\n  const plan = await manager.planLoad(fileId)\n\n  if (plan.canProceed) {\n    const result = await manager.load(fileId, { profile: 'compact' })\n    console.log(result.capsule.context)\n  } else {\n    console.log('Missing:', plan.missing)  // e.g. ['enter_password']\n  }\n}\ninput.click()\n```\n\nThe file picker establishes an explicit user selection for this operation. If\nan application remembers the file as an attachment, it must keep exact\nidentity, digest, scope, and reason visible and provide disable/switch/rollback\ncontrols. Upload storage alone does not authorize future tasks.\n\n---\n\n## API reference\n\n### `readKDNAMetadata(file)`\n\nReads public manifest fields from a `.kdna` `File` object without\nuploading it or performing any decryption.\n\n```js\nconst meta = await readKDNAMetadata(file)\n```\n\nReturns:\n\n```ts\n{\n  domain:      string         // e.g. \"kdna:aikdna:laozi-wuwei\"\n  version:     string         // e.g. \"1.2.0\"\n  title:       string | null\n  description: string | null\n  encrypted:   boolean\n  profiles:    string[]       // available load profiles\n  fileSize:    number         // bytes\n}\n```\n\nThe default `maxSizeBytes` is 10 MiB, aligned with the official Web Server.\nPass a smaller positive integer when your application needs a tighter memory\nbudget. The public manifest is independently limited to 1 MiB.\n\nThrows `KDNAFileSizeError` if the file is too large.\nThrows `KDNAFormatError` if the file is not a valid `.kdna` container.\n\n---\n\n### `uploadKDNA(file, endpoint)`\n\nUpload a `.kdna` `File` to an endpoint (typically\n`/api/kdna/inspect`) and return the `fileId` assigned by the server.\n\n```js\nconst { fileId, inspect } = await uploadKDNA(file, '/api/kdna/inspect')\n```\n\nReturns:\n\n```ts\n{\n  fileId:   string    // opaque ID — pass to plan-load and load\n  inspect:  object    // bounded public inspect fields only\n}\n```\n\nThe client keeps only `fileId`, public asset metadata, the default profile,\noptional profiles, and the public LoadPlan. Server storage metadata, internal\npaths, and unknown fields are discarded.\n\nThrows `KDNAUploadError` if the request fails or the server returns a non-200\nstatus. Public errors contain a fixed local message, HTTP status, and a\ncanonical KDNA error code when the server supplies one. Server error messages\nand response bodies are never attached; the compatibility `response` property\nis always `null`.\n\n---\n\n### `KDNALoadPlanManager`\n\nStateful class that drives the load-plan flow for a single file.\n\n```js\nconst manager = new KDNALoadPlanManager(baseUrl)\n```\n\n| Method | Description |\n|--------|-------------|\n| `planLoad(fileId, context?)` | Evaluate the LoadPlan. Returns requirements. |\n| `load(fileId, options)` | Load the asset. Credentials are passed directly. |\n\n#### `planLoad(fileId, context?)`\n\n```js\nconst plan = await manager.planLoad('abc123', {\n  hasPassword: false,\n  entitlementToken: null,\n})\n```\n\nReturns:\n\n```ts\n{\n  canProceed:   boolean\n  missing:      string[]    // e.g. ['enter_password']\n  requirements: {\n    password:   { required: boolean, hint: string | null }\n    licenseKey: { required: boolean }\n  }\n}\n```\n\n#### `load(fileId, options)`\n\n```js\nconst result = await manager.load('abc123', {\n  profile:          'compact',\n  password:         '...',   // only if required\n  entitlementToken: { status: 'active' }, // signed entitlement from /activate, only if required\n})\n```\n\nReturns a public projection derived from `capsule` only after `capsule`\nsatisfies the complete Runtime Capsule schema closure pinned to an audited KDNA\nCore commit. Unknown top-level server fields are discarded.\nThe Agent-facing artifact is the Runtime Capsule; `content` is a web-UI\nconvenience alias of `capsule.context`:\n\n```ts\n{\n  domain: \"kdna:aikdna:laozi-wuwei\"\n  version: \"0.1.1\"\n  judgmentVersion: \"0.1.0\"\n  profile: \"compact\"\n  content: object\n  capsule: {\n    type: \"kdna.runtime-capsule\"\n    contract_version: \"0.1.0\"\n    asset: object\n    digests: object\n    signature: object\n    access: \"public\" | \"licensed\" | \"remote\"\n    profile: \"index\" | \"compact\" | \"scenario\" | \"full\"\n    context: object\n    trace: object\n  }\n}\n```\n\n---\n\n### `KDNAFileSizeError`\n\nThrown by `readKDNAMetadata` when the file exceeds the configured\nmaximum size.\n\n### `KDNAFormatError`\n\nThrown by `readKDNAMetadata` when the file does not have a valid\n`.kdna` header.\n\n### `KDNAUploadError`\n\nThrown by `uploadKDNA` when the HTTP request fails.\n\n### `KDNALoadError`\n\nThrown by LoadPlan and load calls when the request fails or the returned\nRuntime Capsule is invalid. As with `KDNAUploadError`, upstream response bodies\nand messages are never exposed.\n\n---\n\n## Security model\n\nSee [docs/security-model.md](./docs/security-model.md).\n\nShort version:\n\n- This package reads only the container header and public `kdna.json` manifest\n  in memory. It never parses, decrypts, or exposes `payload.kdnab`; loading is\n  delegated to the official server-side toolchain.\n- Passwords and signed entitlement records or tokens are passed as\n  arguments to `manager.load()` and are POSTed directly to the server\n  endpoint. They are not stored in any object property or module-level\n  variable. Raw license keys belong on your activation endpoint, not\n  `/load`.\n- This package has no Node.js built-in dependencies. It runs entirely\n  within the browser's security model.\n- JSON responses are read as bounded UTF-8 and must be JSON objects. Error\n  payloads are reduced to status and a canonical code; success payloads are\n  projected to the documented public surface.\n\n## Consumption traces\n\n`parseJudgmentTrace`, `judgmentTraceView`, and the dependency-free\n`JudgmentTraceViewer` validate the complete JudgmentTrace schema closure pinned\nto the same audited KDNA Core commit and fail closed on unknown or inconsistent\nnested evidence. They keep Capsule delivery, Host execution,\nsemantic consumption, and conformance as separate evidence. A correlated Host\nresponse does not prove that a model semantically consumed the judgment or that\nthe answer conforms to it.\n\nBrowser clients should receive a trace from a trusted application endpoint.\nThe browser check proves schema conformance only; cryptographic and semantic\nconformance remain server-side KDNA Core responsibilities. A trace is never\npermission to read a protected payload.\n\n---\n\n## Related packages\n\n| Package | Role |\n|---------|------|\n| [`@aikdna/kdna-core`](https://github.com/aikdna/kdna) | KDNA format and runtime (Node.js) |\n| [`@aikdna/kdna-web-server`](https://github.com/aikdna/kdna-web-server) | Server-side adapter |\n| [`@aikdna/kdna-react`](https://github.com/aikdna/kdna-react) | React components and hooks |\n| [`create-kdna-web-app`](https://github.com/aikdna/create-kdna-web-app) | Project scaffolding CLI |\n\n---\n\n## License\n\nApache 2.0 — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}