{"_id":"@aikdna/agent","_rev":"7-bf2be3a5f27622b5f4f941af3112cef8","name":"@aikdna/agent","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@aikdna/agent","version":"0.1.0","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"license":"Apache-2.0","_id":"@aikdna/agent@0.1.0","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://aikdna.com","bugs":{"url":"https://github.com/knowledge-dna/KDNA/issues"},"bin":{"kdna-agent-demo":"dist/demo.js"},"dist":{"shasum":"1eb4e10d169488d93d095633d8b1712aa5899bee","tarball":"https://registry.npmjs.org/@aikdna/agent/-/agent-0.1.0.tgz","fileCount":8,"integrity":"sha512-EO+si+y6KrEuVkKndaNHWKI4NsKZfZhQVJvLynOO6Ezev0rnzU94qGrRwhFtbDrZuzvFtLULYzZpCTO0kDK8VQ==","signatures":[{"sig":"MEQCIA3VjwSkRRWL9JdhzvRpSOorx1B9k7lRkKMAKZmR+8BvAiA2Fcfl7LSxyRa6U8mXHIRrZlTGwoBGi6fwiMD+67pD+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9570},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d1b521ad973dd7eef83679c09c24e31206710426","scripts":{"demo":"npm run build && node dist/demo.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/knowledge-dna/KDNA.git","type":"git","directory":"examples/typescript-agent"},"_npmVersion":"10.9.4","description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@aikdna/kdna":"^0.4.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.0_1779285663000_0.6780783955318179","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Legacy package; use @aikdna/kdna-core and the official kdna-loader integration: https://github.com/aikdna/kdna-skills"},"0.1.1":{"name":"@aikdna/agent","version":"0.1.1","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"license":"Apache-2.0","_id":"@aikdna/agent@0.1.1","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://aikdna.com","bugs":{"url":"https://github.com/knowledge-dna/KDNA/issues"},"bin":{"kdna-agent-demo":"dist/demo.js"},"dist":{"shasum":"f04d6dd3a82cf318afce023b60d6d2018ca78648","tarball":"https://registry.npmjs.org/@aikdna/agent/-/agent-0.1.1.tgz","fileCount":8,"integrity":"sha512-OzUnfcYHi6mdN/jJnEngUz4YupraaI5v61i6kdx6AflMpsoVWHSmwqgCJ+uIUfToML1u9V11GIDTXhzWEPYMfw==","signatures":[{"sig":"MEUCIDrj8M5sTRETi8dq+T47ETD4pD0ouF15Kr4XtP8675cxAiEAhlcvqCUTFUlPKqZWtKjuDZOkdQQLZlajay7MN83bomM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9641},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"ee10e8265f3ebfc170c4e479375711ce905a0554","scripts":{"demo":"npm run build && node dist/demo.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/knowledge-dna/KDNA.git","type":"git","directory":"examples/typescript-agent"},"_npmVersion":"10.9.4","description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@aikdna/kdna":"^0.6.2","@aikdna/kdna-core":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.1_1779326263141_0.0666753237694635","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Legacy package; use @aikdna/kdna-core and the official kdna-loader integration: https://github.com/aikdna/kdna-skills"},"0.1.2":{"name":"@aikdna/agent","version":"0.1.2","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"license":"Apache-2.0","_id":"@aikdna/agent@0.1.2","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://aikdna.com","bugs":{"url":"https://github.com/knowledge-dna/KDNA/issues"},"bin":{"kdna-agent-demo":"dist/demo.js"},"dist":{"shasum":"cbe92224a221b72d3f1db6c3019b1b164a38eb60","tarball":"https://registry.npmjs.org/@aikdna/agent/-/agent-0.1.2.tgz","fileCount":8,"integrity":"sha512-OBibEJcvWZn96cw3PYTArgYjh6M6RB+fk/+ojzelp0u0v4A+pjf+J3EvRbYkuUXHiAGn9KIv7KAwstB0d/p37A==","signatures":[{"sig":"MEYCIQDq22eXpNrbfTj2eMRSGRHzb5qfPlyUQHufFnbJZxXPqAIhAMn7MSePFskdemUfsendJ0CvxyUNKKgKA2kehxNX82Sq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13516},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"demo":"npm run build && node dist/demo.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/knowledge-dna/KDNA.git","type":"git","directory":"examples/typescript-agent"},"_npmVersion":"10.9.4","description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@aikdna/kdna":"^0.6.2","@aikdna/kdna-core":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.2_1779341891533_0.6058024132824205","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Legacy package; use @aikdna/kdna-core and the official kdna-loader integration: https://github.com/aikdna/kdna-skills"},"0.1.3":{"name":"@aikdna/agent","version":"0.1.3","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"license":"Apache-2.0","_id":"@aikdna/agent@0.1.3","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://aikdna.com","bugs":{"url":"https://github.com/knowledge-dna/KDNA/issues"},"bin":{"kdna-agent-demo":"dist/demo.js"},"dist":{"shasum":"d4c1488883dd6d0772993925e93506423fd148f2","tarball":"https://registry.npmjs.org/@aikdna/agent/-/agent-0.1.3.tgz","fileCount":8,"integrity":"sha512-fMt+wjXyLF7EfLEjmieh19W8OasvFV6dZG8zR85aC6Y22qju/8mTprX9v6GPv37HddYAAyNC9wQyyAkohocFSg==","signatures":[{"sig":"MEUCIHJjGfa6zn6dFrwI9oPFH7aiuanFoAsRxP5JxtLoG7ObAiEApkE2IlpYUuk6EoyW8Pfa3PskkoehYOY3yue2+3Pf9cc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15304},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"demo":"npm run build && node dist/demo.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/knowledge-dna/KDNA.git","type":"git","directory":"examples/typescript-agent"},"_npmVersion":"10.9.4","description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@aikdna/kdna":"^0.6.2","@aikdna/kdna-core":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.3_1779346958629_0.5514240243680744","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Legacy package; use @aikdna/kdna-core and the official kdna-loader integration: https://github.com/aikdna/kdna-skills"},"0.2.0":{"name":"@aikdna/agent","version":"0.2.0","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"license":"Apache-2.0","_id":"@aikdna/agent@0.2.0","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://aikdna.com","bugs":{"url":"https://github.com/knowledge-dna/KDNA/issues"},"bin":{"kdna-agent-demo":"dist/demo.js"},"dist":{"shasum":"03a9fe66578727bb1d2c21784b3a0d4306818ad2","tarball":"https://registry.npmjs.org/@aikdna/agent/-/agent-0.2.0.tgz","fileCount":8,"integrity":"sha512-uZKTy9BW+/n9LyXJHWN93/mhsiNbZIQ/DskLwoFtiojxaYf7EbxPbKazydFhvaV+2dSirgsbo3YZEnAcYnD6WA==","signatures":[{"sig":"MEUCIQC3ojs6j8cK1M/4rG7cECBHCrVodWWeatx7iumOjl/4vgIgS3rygH7KlX5k+5T/z7Oze0Ez7BhFpzUVGmdmpURjNgc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15427},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"demo":"npm run build && node dist/demo.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/knowledge-dna/KDNA.git","type":"git","directory":"examples/typescript-agent"},"_npmVersion":"10.9.4","description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@aikdna/kdna":"^0.6.2","@aikdna/kdna-core":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.2.0_1779347806181_0.29216664149653293","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Legacy package; use @aikdna/kdna-core and the official kdna-loader integration: https://github.com/aikdna/kdna-skills"},"0.2.1":{"name":"@aikdna/agent","version":"0.2.1","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"license":"Apache-2.0","_id":"@aikdna/agent@0.2.1","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"homepage":"https://aikdna.com","bugs":{"url":"https://github.com/aikdna/kdna/issues"},"bin":{"kdna-agent-demo":"dist/demo.js"},"dist":{"shasum":"13b3041a38a4e2e29ff31a88aad7d38d112ef8cb","tarball":"https://registry.npmjs.org/@aikdna/agent/-/agent-0.2.1.tgz","fileCount":8,"integrity":"sha512-JzUTveV0Mh9xtJfF9rRH6uOTWN3lKpnBhfoBRnU+osdkN7PU3j6ENYCGI/RarDzTGNE5kT8asfngNymsiqgoOQ==","signatures":[{"sig":"MEUCIQDXkKheCbOaBTKtb5s7vLh6BV8xlZe8aJWGI9SEyG0KQAIgB8zRzrE9aQ40BwMK2bLMi1Yh9z7Bze0oetSePrisWr0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aikdna%2fagent@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":13085},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"3e25a2142a2ae860ea0adbbb5a14c01b52516ce4","scripts":{"demo":"npm run build && node dist/demo.js","test":"npm run build && node dist/demo.js >/dev/null","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"code2mp4","email":"hi@code2mp4.com"},"repository":{"url":"git+https://github.com/aikdna/kdna.git","type":"git","directory":"examples/typescript-agent"},"_npmVersion":"10.9.8","description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@aikdna/kdna-core":"^0.6.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.2.1_1779985867777_0.09826196778019236","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Legacy package; use @aikdna/kdna-core and the official kdna-loader integration: https://github.com/aikdna/kdna-skills"}},"time":{"created":"2026-05-20T14:01:02.808Z","modified":"2026-07-18T14:01:32.853Z","0.1.0":"2026-05-20T14:01:03.144Z","0.1.1":"2026-05-21T01:17:43.383Z","0.1.2":"2026-05-21T05:38:11.680Z","0.1.3":"2026-05-21T07:02:38.763Z","0.2.0":"2026-05-21T07:16:46.308Z","0.2.1":"2026-05-28T16:31:07.905Z"},"bugs":{"url":"https://github.com/aikdna/kdna/issues"},"license":"Apache-2.0","homepage":"https://aikdna.com","keywords":["kdna","ai-agent","domain-cognition","judgment","agent-sdk","typescript"],"repository":{"url":"git+https://github.com/aikdna/kdna.git","type":"git","directory":"examples/typescript-agent"},"description":"KDNA TypeScript Agent SDK — framework-agnostic judgment layer for AI agents","maintainers":[{"name":"code2mp4","email":"hi@code2mp4.com"}],"readme":"# @aikdna/agent\n\nKDNA Agent SDK - pre/post judgment guardrails for AI agents.\n\n## Install\n\n```bash\nnpm install @aikdna/agent\n```\n\n## Usage\n\n```ts\nimport { KDNAAgent } from \"@aikdna/agent\";\n\nconst agent = new KDNAAgent(\"/path/to/.kdna/domains\");\n\nconst result = await agent.judge(\"Meeting transcript...\", async (systemPrompt, input) => {\n  return await yourLLM.complete({ system: systemPrompt, user: input });\n});\n\nconsole.log(result.passed);\nconsole.log(result.pre_filter);\nconsole.log(result.post_validate);\n```\n\n## API\n\n- `new KDNAAgent(domainDir)` loads a single KDNA domain directory or a parent directory containing multiple domains.\n- `agent.systemPrompt()` returns KDNA judgment context for injection into an LLM system message.\n- `agent.preFilter(input)` screens input for local banned terms and domain signals before an LLM call.\n- `agent.postValidate(response)` checks an LLM response against self-checks, banned terms, and known misunderstandings.\n- `agent.judge(input, llmCallFn)` runs pre-filter, calls your LLM function, then post-validates the response.\n\n## Package Boundary\n\nThis SDK depends on `@aikdna/kdna-core` for KDNA loading and rendering. It does not depend on the legacy `@aikdna/kdna` CLI compatibility package.\n","readmeFilename":"README.md"}