{"_id":"@ai-zen/agents-core","_rev":"26-8e39757c82371d66dc903fefbc5a80a2","name":"@ai-zen/agents-core","dist-tags":{"next":"3.0.0-alpha.3","alpha":"3.0.0-alpha.4","latest":"4.3.0"},"versions":{"2.0.0":{"name":"@ai-zen/agents-core","version":"2.0.0","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.0.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"28ae0e27a72872c7cafdd09ecb1264b118d38859","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.0.0.tgz","fileCount":100,"integrity":"sha512-LDmtdnca9/lu6T7wrNTHotH1SIV+83/k3XP5x4cBAV5x9h5cEkRoHVN4uarFcBoOedxutz77imWiV+jtjfkwoQ==","signatures":[{"sig":"MEUCIQDUpJM/1u2X3iCZEnIm/SGmT1fJwwT9LUpQ1JmBQK/NmgIgPe0dUD6rcvluPcv1UMLfzpW5nuXwhkVqDYQFiNiuNAg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114947},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"92956da5766b0f0e017861aced0b814656e8c07d","scripts":{"test":"npm run build && node ./dist/test.js","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.3.0","description":"","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.2.2","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.5","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.0.0_1776584959073_0.6883226620894147","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@ai-zen/agents-core","version":"2.0.1","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.0.1","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"beab430c5218128b06ee494b5decaa7401d042ff","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.0.1.tgz","fileCount":100,"integrity":"sha512-/eiqPgeKWYFC7fC2dBg8QCpB0IvaCHvocr8yqd9l+Wyho1YeRsH7iTecG+ojKh/efnb6pY26Uz3itgJZJnNGUQ==","signatures":[{"sig":"MEYCIQCvEKZZqxcrs3v2PtJI092TLrUHqG+xGr6Ld3ndiRswVwIhAJQQbSznHIhwQkure55Lz2mCrYjnfK9XMj/efOemMWzI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":115309},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"92956da5766b0f0e017861aced0b814656e8c07d","scripts":{"test":"npm run build && node ./dist/test.js","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.3.0","description":"","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.2.2","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.5","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.0.1_1777931960553_0.9083950131992689","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@ai-zen/agents-core","version":"2.0.2","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.0.2","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"39e72aa0b9600f0e269f9359c466370353ee9650","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.0.2.tgz","fileCount":100,"integrity":"sha512-PhlAsnCmVbuZYnPsE6VvSwG7xl31l5cbq97lkGRL47ic9z9heEWT6NftGptMwi0Ezm1W33hJHoWSshjAMbct2g==","signatures":[{"sig":"MEYCIQCooCS1KgbBDqBAz86AQA41hhUGbQaWjCP4kItcnPzlKQIhAJ0dhskqogg7ojrzVa0uDN2ToJBT6aSDlW7UJ6j2PYGQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":116274},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"09aa449897990185bf359874d580d610c43ebccd","scripts":{"test":"npm run build && node ./dist/test.js","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.3.0","description":"","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.2.2","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.5","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.0.2_1777935658615_0.23218998654952872","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@ai-zen/agents-core","version":"2.1.0","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.1.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"c20cafd788202924ea8d072e36d914f0b25bf351","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.1.0.tgz","fileCount":109,"integrity":"sha512-7idb5ydfhprjh/pUbBwB3lPsGGP618aVxzl1AlS7jOZ5hCGeT/X8kye9Qo0iY1IJQGYdiDVSceCknmLlh3UGhg==","signatures":[{"sig":"MEUCIBVVlnX3oLor+8Cs8FjZ9IiOSu90PenSXlYLfuwhEtQwAiEA18siuvEgNSzlXeZoEZn+jxdhFAmvkjeG4ANFg1LrePk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":124745},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"c3f35151934d8841e327a2dbfa61788e5314e181","scripts":{"test":"npm run build && node ./dist/test.js","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.3.0","description":"","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.2.2","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.5","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.1.0_1780434969917_0.13644358086428254","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@ai-zen/agents-core","version":"2.3.0","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.3.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"d3c7d90a6e564584e4eb0f6d91e23aed52d1f08d","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.3.0.tgz","fileCount":110,"integrity":"sha512-DMcvsX38yHnpCSTnwJRM6i3wDoaBlWq+WW/vGKpZjOFhIQV52/5kjIeMnHgWqKxb1WolRG78R8pJysu6fSiaag==","signatures":[{"sig":"MEUCIQCqVVFiKrZ9isO1vsNla7NBSMMEpWx27ZC1Sl5HxobuugIgJAQkWchYzW/lMqapPiPsEqLCph2bYo86xGjTnsSpWhM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147082},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-2.3.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\99fb5a5902453b7f92215d6b86ffbc21\\ai-zen-agents-core-2.3.0.tgz","_integrity":"sha512-DMcvsX38yHnpCSTnwJRM6i3wDoaBlWq+WW/vGKpZjOFhIQV52/5kjIeMnHgWqKxb1WolRG78R8pJysu6fSiaag==","_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.2.2","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.3.0_1781726033729_0.4591080867040407","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"@ai-zen/agents-core","version":"2.4.0","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.4.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"c43c5231302a69debe3ac107fe9ab69a3bd9144e","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.4.0.tgz","fileCount":109,"integrity":"sha512-eV+3VbR7/kHlEa7YNbgCsuE7IKDHzrvx1HkOla379dHLkbzHI9f5qJ0COccAviahgyz61KGYbkSb+bJ9jjNd7w==","signatures":[{"sig":"MEUCIQDuSxonTFfyez4yS/BCD7VAauuiGxLzvUdJdN50sJQGcQIgIP0NqQtCzBC9p3LJ6/K1eZeDWT+r3Tl359dObsOmFHA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148283},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"cfd2c94c028a55909d2f5e6c2454e3afb6a25a73","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.13.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.2.2","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.4.0_1782270390078_0.17043022820261156","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"name":"@ai-zen/agents-core","version":"2.5.0","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.5.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"d9153d7a0d4e0ba26c3d91c26a35bbd647974584","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.5.0.tgz","fileCount":109,"integrity":"sha512-mCMNwVTgDOx2bRl8P353KH8HY0VzU2V43xKQZUIeUtGH1fjgzpbUC50RObFrng3QyyexhEsRXV5RFaWmVERsQg==","signatures":[{"sig":"MEQCIHURxSJN899fJ+1SHAOjbqY8ncbdlYKpd8jBeh2SltIoAiAV/tpgYgH/uMvWHQiR2hiLCAl6wiwpKZtm3+XTjZRvcQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148283},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"e5c18bec89921407fd30b72ca410cb0ccf53ac0a","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.13.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.5.0_1783069842757_0.06583969413435464","host":"s3://npm-registry-packages-npm-production"}},"2.5.1":{"name":"@ai-zen/agents-core","version":"2.5.1","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.5.1","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"93e65f5e718cc78e2cce8a515d535f3e565d18a7","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.5.1.tgz","fileCount":110,"integrity":"sha512-gnZiWm1A1EF1d+cZdZfiXnRjaAuDMHDVtn/VvWUB93J4aigEDqcqvHNJPpMU27YRSbqCAYIOMlrZbkofVL1f1g==","signatures":[{"sig":"MEUCIQDOB8Y760ML0ti91rTxqX7rOWmB1cHMRnNFLhG/xzisOQIgTmDbnvWdP+35KDV0gC3bFDUFp0q91pcv/HGl74ITuCg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":149499},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"description":"","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.5.1_1783355587458_0.8766039728537223","host":"s3://npm-registry-packages-npm-production"}},"2.5.2":{"name":"@ai-zen/agents-core","version":"2.5.2","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.5.2","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"6d1f65274d49441a59b0eed4d51e6865c61940c4","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.5.2.tgz","fileCount":113,"integrity":"sha512-0R9JFUmE8u7mDznHFsobLasK9PwrfTaKtbmaVJjeH2bSnKMJQc0xNqGDeH3x8zTGGa40aN2RQMomvUOmK/mkGA==","signatures":[{"sig":"MEYCIQDxbwpVwYiBA3epjZ54e4muJsv0psvoHHyE1Ze7G8/TVAIhAMDnhxbHAierClpfaajVDcOJPL+1673vUs+TrIxj8WSC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":154592},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"description":"","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.5.2_1783854192401_0.5964042183663798","host":"s3://npm-registry-packages-npm-production"}},"2.6.0":{"name":"@ai-zen/agents-core","version":"2.6.0","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.6.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"c8f217440c1610e8ad7f35d88d2b7a9734c3ee10","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.6.0.tgz","fileCount":113,"integrity":"sha512-/h4iSxTgskthsUOGyTmquAYVteyEdc9cCN/BJW4tpI0voelfkCKPq+wY1SSMBtapR/yxTD/tkTJFhFbJn7FPPg==","signatures":[{"sig":"MEUCIAVwuNfGHpELozR2QnsQR8HmQIkdSiXz1s0sn7taCVYrAiEAmng46IxkGC+OSNVNs1vtGoHOyhkSyfg35Pn4RnZ1FnE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":155479},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"description":"","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.6.0_1784063949129_0.3869166160523636","host":"s3://npm-registry-packages-npm-production"}},"2.6.1":{"name":"@ai-zen/agents-core","version":"2.6.1","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@2.6.1","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"02a932eb4ce9d5d4214307c8cba9e55b3bdfb357","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-2.6.1.tgz","fileCount":114,"integrity":"sha512-pcspQN31Cmaz34j4cVQZ+w0ToxTuINoidRWzmGl2lvJuNsHsNr5o1Njg15IycrQ0XJqjUZ9YYd5W2//dvK3DvQ==","signatures":[{"sig":"MEQCIH05OKra+P61D3buiDBJXmseSzd58eT/BLfs9ybx/ZDeAiBWOBOoIYJAfgX3R9A1Hwfb2sAsWHlO8/znsLvEA+qK5g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":161349},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-2.6.1.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\fa2f5ad5ac44cc93b9a0abe7050bbbc1\\ai-zen-agents-core-2.6.1.tgz","_integrity":"sha512-pcspQN31Cmaz34j4cVQZ+w0ToxTuINoidRWzmGl2lvJuNsHsNr5o1Njg15IycrQ0XJqjUZ9YYd5W2//dvK3DvQ==","_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_2.6.1_1784372214085_0.6325149107284072","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-alpha.1":{"name":"@ai-zen/agents-core","version":"3.0.0-alpha.1","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@3.0.0-alpha.1","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"587d5d09ad61b3e48af01a1c8cdb9f2423be949d","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.0.0-alpha.1.tgz","fileCount":115,"integrity":"sha512-VGbXd1MPOZAT8+XelrD9YaI7drPNrY0cvXPynBuGLSZ0D0OZ7R3P4lODZVh6V0OPECdrTi3ZtFpemGBAWuUHKw==","signatures":[{"sig":"MEUCIQDxvuARnOgipFZBiZKkjPhf3hhDD+sbN2mbafOONWIeOQIgIVBRDKWKNMKhV+KB/7dY12LHcD+8XPhPjL1XMrv2G8U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":163082},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-3.0.0-alpha.1.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\a90d4af1f8bcb24cdeeac6ab25a7cdde\\ai-zen-agents-core-3.0.0-alpha.1.tgz","_integrity":"sha512-VGbXd1MPOZAT8+XelrD9YaI7drPNrY0cvXPynBuGLSZ0D0OZ7R3P4lODZVh6V0OPECdrTi3ZtFpemGBAWuUHKw==","_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.0.0-alpha.1_1784394584234_0.747135044475224","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-alpha.2":{"name":"@ai-zen/agents-core","version":"3.0.0-alpha.2","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@3.0.0-alpha.2","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"c294f1276f0b80cf9d093eb0d4cfa7358790600c","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.0.0-alpha.2.tgz","fileCount":112,"integrity":"sha512-KByN+fLwGPU47tQeL4MJB96+czLDr6GRgtdJJeSZg/oDuvU4N0AA5f6sQjfQehRiIE+ELUrsqUOMkZLmnYGouw==","signatures":[{"sig":"MEQCIAql6C419l2uIwBsIkBaAQeQH6zI/QYRdPSQ34OHPQ2GAiBWzKncH3YabUXV3AglLLInGtqBfKUgAH4RPazrkrB8SQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":162369},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-3.0.0-alpha.2.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\b0b3c98f0bd429c5b3e4056b8fc1c1c1\\ai-zen-agents-core-3.0.0-alpha.2.tgz","_integrity":"sha512-KByN+fLwGPU47tQeL4MJB96+czLDr6GRgtdJJeSZg/oDuvU4N0AA5f6sQjfQehRiIE+ELUrsqUOMkZLmnYGouw==","_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.0.0-alpha.2_1784400432189_0.6515270361449645","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-alpha.3":{"name":"@ai-zen/agents-core","version":"3.0.0-alpha.3","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@3.0.0-alpha.3","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"56c7a7a98fb19e4e8898e67b126d640f7250cb59","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.0.0-alpha.3.tgz","fileCount":111,"integrity":"sha512-sYlpwFIdS2geMc8wnU2TxPc5XUt2YO2Ny8rW+oP14UsKakFHGUE1KD+bxlAYIH/AZfUH2cgE0mtrS+dFB7UTTw==","signatures":[{"sig":"MEUCIQCZQzhFCUilIno4os1OgUoY791v7kTCp8snWaJAdjpCggIgeFfCPL1jAf+qalUT1xyATilDwOKhfR5ABL0OcNUgH/o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":164778},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"47a45d456ef92b051261476adc512d050f80026c","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"deprecated":"已废弃，请使用 3.0.0-alpha.4 或更高版本","_npmVersion":"11.13.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.0.0-alpha.3_1784608379648_0.5669641973924251","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-alpha.4":{"name":"@ai-zen/agents-core","version":"3.0.0-alpha.4","keywords":[],"author":"","license":"ISC","_id":"@ai-zen/agents-core@3.0.0-alpha.4","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"846c57110cce943e59cb50934cefc6294bca68a2","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.0.0-alpha.4.tgz","fileCount":111,"integrity":"sha512-T2cF613U9NGFJfXMHj/G+0bnzWpkdd428inC8ZEQbuO1blrcts7MiAiPKIjZO24x1+4FEMtJHL37oyTuYPkG5Q==","signatures":[{"sig":"MEYCIQChvLmB13GKTkEZ2vfxmv837KROgBHi5r1qglnEbJxN1gIhANkQ0bqYuaAMdotWP/vHWFa26rJDjG+9i0hORR9kK8RW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":164778},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"47a45d456ef92b051261476adc512d050f80026c","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.13.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.0.0-alpha.4_1784608415061_0.34756388839751384","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@ai-zen/agents-core","version":"3.0.1","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@3.0.1","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"1d9def3e23c2a1a4863f3c9a665886697c79961d","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.0.1.tgz","fileCount":112,"integrity":"sha512-PN2VbE1CHg6mZmkwjHhd3Xcaplg3z2UThGR3hGc13CPlH9LQz+oIseJTjEaQ7XPlK/3dN3CQHIYh3PI5ADcygg==","signatures":[{"sig":"MEUCIChDu/oy7nf5Udai5visnNDgVjWfmXRlOBmHCUV7AlrQAiEAyj+7WdP06gWa3bXEFGQv5RcKCONpazW84Beg/aQTalU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":165442},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-3.0.1.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\8588a201e2215dc2295d21b394ee8fb2\\ai-zen-agents-core-3.0.1.tgz","_integrity":"sha512-PN2VbE1CHg6mZmkwjHhd3Xcaplg3z2UThGR3hGc13CPlH9LQz+oIseJTjEaQ7XPlK/3dN3CQHIYh3PI5ADcygg==","_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.0.1_1785011552872_0.7811728134151896","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"@ai-zen/agents-core","version":"3.1.0","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@3.1.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"fd99901f289818122a2a973fb69cfcf44852fba7","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.1.0.tgz","fileCount":111,"integrity":"sha512-COx8H+X34v/x6xENV+OaFNCPcREvPDRwB8FVhtKnQIrzlvBuuSnKkr+y26fN5AqBHTG+JeftFfqpDXAk1ZqRvQ==","signatures":[{"sig":"MEYCIQD5zFBw31It8pMR2p49AesOl06sOTWtmgOFHbNQ5bXcqQIhAL/9nHsCPBpksCyAIudeoSz/P6+LBENhpoDD2sfAAcbo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":166369},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"22eb1d70c9c33570dbf5ace5e53f8e7ca37facd0","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.1.0_1785698187764_0.5775096318832229","host":"s3://npm-registry-packages-npm-production"}},"3.2.0":{"name":"@ai-zen/agents-core","version":"3.2.0","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@3.2.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"29f8620979c34df5f3894805ef93b23647b58632","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.2.0.tgz","fileCount":111,"integrity":"sha512-ilL9fAVVeY3vmd4SykuWbyZSJ5oTEvrnLF3Fqrd88k/4ZnSWj2LikWiECk9LJ3TbQnXfIJ5ljW7sy8yaDCdgIQ==","signatures":[{"sig":"MEYCIQDo3/8h91ydBx57u4IzQ/ZtsnsAAzRGaDIKovTnJPhpEwIhAJXwOfbfw4QGSVAAie1D494Zj1ELt7yUPbAwYXKbJyd3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":168399},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"5c76661c22ec1ebd22e4329248fa18e57c7a03ce","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","prepublishOnly":"npm run build","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_npmVersion":"11.3.0","description":"AI Agent 核心框架，提供构建智能代理所需的基础抽象层。支持 Node.js 和浏览器环境。","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.2.0_1785701939225_0.518405292907717","host":"s3://npm-registry-packages-npm-production"}},"3.3.0":{"name":"@ai-zen/agents-core","version":"3.3.0","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@3.3.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"0678517d81488eb664c1a1cac506eefb7628fee5","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.3.0.tgz","fileCount":113,"integrity":"sha512-HdagN6UrjaNDNPaA0/ZM/f3QSim6BpvU0+tfLYpi18tqliM82JI9CNTwueQTDBV6cKYosMmcAiEkQ3yInaQ6MQ==","signatures":[{"sig":"MEUCIQCNmFZ/+Jq/ripbQZj5x/EGc9Il43VJR1LzPenfnMB+SAIgTF2PPOtAv2j059o49aLGXAwWQ3v2GuzfHs/f9Y+wIGA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":203694},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-3.3.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\932a4e15cdab8f153afb171131588f36\\ai-zen-agents-core-3.3.0.tgz","_integrity":"sha512-HdagN6UrjaNDNPaA0/ZM/f3QSim6BpvU0+tfLYpi18tqliM82JI9CNTwueQTDBV6cKYosMmcAiEkQ3yInaQ6MQ==","_npmVersion":"11.3.0","description":"Core framework for building LLM agents: Agent, Messages, Tools, Models, Endpoints, RAG, Vector Database","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.3.0_1786649077045_0.5134569760713548","host":"s3://npm-registry-packages-npm-production"}},"3.3.1":{"name":"@ai-zen/agents-core","version":"3.3.1","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@3.3.1","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"7a197fc8305c15ea3bb3779ea612d875268bf46a","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.3.1.tgz","fileCount":113,"integrity":"sha512-Ui/6YSJ9VO2PBGFi87q2hk4AX+J79zRzy6ShDoTmfJC/hNIF05vEIgoB53I3aiIrJDtsMrAUhq/q2+j3EenGnQ==","signatures":[{"sig":"MEYCIQCS87o5g0CNysy6mwH/sxOsLVKyyo/BNSoRkmZ7vGz5/AIhAIcPDTDXoveh4UGVUF/kvOHS9YmjcTaKffM6ROqBcXaJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206285},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-3.3.1.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\e9b68e8c560d0279c00376ef672a1e87\\ai-zen-agents-core-3.3.1.tgz","_integrity":"sha512-Ui/6YSJ9VO2PBGFi87q2hk4AX+J79zRzy6ShDoTmfJC/hNIF05vEIgoB53I3aiIrJDtsMrAUhq/q2+j3EenGnQ==","_npmVersion":"11.3.0","description":"Core framework for building LLM agents: Agent, Messages, Tools, Models, Endpoints, RAG, Vector Database","directories":{},"_nodeVersion":"24.1.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.3.1_1786655922176_0.7179079567054882","host":"s3://npm-registry-packages-npm-production"}},"3.4.0":{"name":"@ai-zen/agents-core","version":"3.4.0","keywords":[],"author":"LZQCN","license":"MIT","_id":"@ai-zen/agents-core@3.4.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"e19d7ee824480a1733c0e72ce4d9afaf83a0c3d1","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-3.4.0.tgz","fileCount":113,"integrity":"sha512-5uB83HqMrMJ+8swuoDs4442B7oO7WpJfcNjFa8cqPEBo86e7fJPTeBpOPhJPI/bebnsLKsdZx7XBREwiag6yBg==","signatures":[{"sig":"MEUCIQDYoTlpcUBVLsNaTri0FxGcfp7x24K4b+4tlRkU6ZudWwIgLQXssbRGQKhmL5cRDxf+vlxcZdkydcYirvjGHVIvDd0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":211579},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"description":"Core framework for building LLM agents: Agent, Messages, Tools, Models, Endpoints, RAG, Vector Database","directories":{},"_nodeVersion":"24.16.0","dependencies":{"jose":"^5","@ai-zen/event-bus":"^1.1.0","@ai-zen/async-queue":"^1.4.0","@ai-zen/node-fetch-event-source":"^2.1.4"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_3.4.0_1786708723684_0.16875250181381363","host":"s3://npm-registry-packages-npm-production"}},"4.0.0":{"name":"@ai-zen/agents-core","version":"4.0.0","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@4.0.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"fda68c8eccb24219dddae7c3083ad9844c00c68c","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-4.0.0.tgz","fileCount":47,"integrity":"sha512-OQCBXdvSnroiG6f63nSo3e6Nbxq+R1PEfx4W+lm5s4qgW2rn+1UkfkQvrU3KxrHG2iaKM6vYDSk206drY5jQTQ==","signatures":[{"sig":"MEYCIQDxiBa/o+v0F3yuEkVsJX7yS6VR5Csgi+RTA/SO7iwMZgIhAKHvtkIWQ3kyT7rK5//7SWI4Qdzv9xDmfopjVxNCawYE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":146642},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-4.0.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\f3fd4c196498b4a764367c526beeff0b\\ai-zen-agents-core-4.0.0.tgz","_integrity":"sha512-OQCBXdvSnroiG6f63nSo3e6Nbxq+R1PEfx4W+lm5s4qgW2rn+1UkfkQvrU3KxrHG2iaKM6vYDSk206drY5jQTQ==","_npmVersion":"11.3.0","description":"Core framework for building LLM agents: plugin-driven Agent runtime on the official OpenAI SDK, Messages, Tools","directories":{},"_nodeVersion":"24.1.0","dependencies":{"openai":"^7.5.0","@ai-zen/event-bus":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_4.0.0_1787512327473_0.7606213947136404","host":"s3://npm-registry-packages-npm-production"}},"4.1.0":{"name":"@ai-zen/agents-core","version":"4.1.0","keywords":[],"author":{"name":"LZQCN"},"license":"MIT","_id":"@ai-zen/agents-core@4.1.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"f00a8f6a6fbce1638a1770d5e0ae7e2faa4e730d","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-4.1.0.tgz","fileCount":47,"integrity":"sha512-mTc+kIXcGbcUWzK3nOoqCpPsrxh6CUvFSpH3CovW0LJ7WCnoekVESuQyeYnfgk3kvFUxlPSDxas766b7ee50kg==","signatures":[{"sig":"MEQCIBXlJGmiljY6P7huPCO3AZG9+KKV2R+0WRh7WKnykEl0AiAYUi3CuF1KAT5Pphl+cfNzHgGcMAnNJHl2vW9QUruIIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148144},"main":"dist/index.js","type":"module","_from":"file:ai-zen-agents-core-4.1.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"_resolved":"C:\\Users\\bylzq\\AppData\\Local\\Temp\\558404dfce47c384cc933e795e6158f6\\ai-zen-agents-core-4.1.0.tgz","_integrity":"sha512-mTc+kIXcGbcUWzK3nOoqCpPsrxh6CUvFSpH3CovW0LJ7WCnoekVESuQyeYnfgk3kvFUxlPSDxas766b7ee50kg==","_npmVersion":"11.3.0","description":"Core framework for building LLM agents: plugin-driven Agent runtime on the official OpenAI SDK, Messages, Tools","directories":{},"_nodeVersion":"24.1.0","dependencies":{"openai":"^7.5.0","@ai-zen/event-bus":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_4.1.0_1787850832544_0.09070100849369855","host":"s3://npm-registry-packages-npm-production"}},"4.2.0":{"name":"@ai-zen/agents-core","version":"4.2.0","keywords":[],"author":"LZQCN","license":"MIT","_id":"@ai-zen/agents-core@4.2.0","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"dist":{"shasum":"3bebd9d28f8c563914e02576f2a8d6406b9404ac","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-4.2.0.tgz","fileCount":47,"integrity":"sha512-Q7ImxpKvO11sBWhp/9U3DVAB0ieG6PM8YJki4OrWLdqa6GQjB+S2vGe9zWeLYLPMdkAnNyZsK1f74IMpBsALEg==","signatures":[{"sig":"MEUCIQDVy1zl0nv9tPs5xfA9ohFio4r/1ts64+1NQELEZizSyAIgMpd3ItC2QeIe+QVNX6RZ12n026pEw8O84pYXakOs9ro=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICP7j8dVRI76OKsYqWJuaIYFNYOSiv5SjLlQBN1kiHDqAiEAhd3aGMW+pqkjpXSoR0EUpui3NHbAPrH1XlITpWlKZaw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":155326},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"description":"Core framework for building LLM agents: plugin-driven Agent runtime on the official OpenAI SDK, Messages, Tools","directories":{},"_nodeVersion":"26.8.1","dependencies":{"openai":"^7.5.0","@ai-zen/event-bus":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/agents-core_4.2.0_1790579186677_0.09950080560621011","host":"s3://npm-registry-packages-npm-production"}},"4.3.0":{"_id":"@ai-zen/agents-core@4.3.0","dist":{"shasum":"3d0b9abfe253a41e48e107f060430e2fc20065b3","tarball":"https://registry.npmjs.org/@ai-zen/agents-core/-/agents-core-4.3.0.tgz","fileCount":47,"integrity":"sha512-rc5p63jyPo9gaDo41mFwfhfm9aEdKyo4+hl2QiKTP8zbd+lblTLs8PGdJLF1/QcQmRIGBrxZ8MQyWIB8wilxGw==","signatures":[{"sig":"MEQCIGMUl7iLyDXD+d5Q6DwtDtpPK/FM35Zw9STWRvaiztHCAiA/jllno7dKnNqH/cgMA3OaDNSK/FrIJ7ZNrnwTru04lA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCNfQn1FvdX9EQykkLH5ta3w/uxl+04KY68LjaL0Xf+tQIgSVmgTwvSmr0sYPxlm/diVuykbgbgtjLsZsPFGnYpJH0="}],"unpackedSize":157783},"main":"dist/index.js","name":"@ai-zen/agents-core","type":"module","types":"dist/index.d.ts","author":"LZQCN","license":"MIT","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf ./dist","prebuild":"npm run clean","test:integration":"vitest run --reporter=verbose src/integration.test.ts"},"version":"4.3.0","_npmUser":{"name":"lzqcn","email":"by.lzq@qq.com"},"keywords":[],"description":"Core framework for building LLM agents: plugin-driven Agent runtime on the official OpenAI SDK, Messages, Tools","directories":{},"maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"_nodeVersion":"26.8.1","dependencies":{"openai":"^7.5.0","@ai-zen/event-bus":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^17.4.2","rimraf":"^6.0.0","vitest":"^4.1.9","typescript":"^5.3.3","@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agents-core_4.3.0_1790583389131_0.617488928643046"}}},"time":{"created":"2026-04-19T07:49:18.992Z","modified":"2026-09-28T08:16:29.455Z","2.0.0":"2026-04-19T07:49:19.232Z","2.0.1":"2026-05-04T21:59:20.719Z","2.0.2":"2026-05-04T23:00:58.774Z","2.1.0":"2026-06-02T21:16:10.072Z","2.3.0":"2026-06-17T19:53:53.860Z","2.4.0":"2026-06-24T03:06:30.217Z","2.5.0":"2026-07-03T09:10:42.948Z","2.5.1":"2026-07-06T16:33:07.610Z","2.5.2":"2026-07-12T11:03:12.538Z","2.6.0":"2026-07-14T21:19:09.284Z","2.6.1":"2026-07-18T10:56:54.293Z","3.0.0-alpha.1":"2026-07-18T17:09:44.376Z","3.0.0-alpha.2":"2026-07-18T18:47:12.339Z","3.0.0-alpha.3":"2026-07-21T04:32:59.786Z","3.0.0-alpha.4":"2026-07-21T04:33:35.193Z","3.0.1":"2026-07-25T20:32:32.997Z","3.1.0":"2026-08-02T19:16:27.906Z","3.2.0":"2026-08-02T20:18:59.364Z","3.3.0":"2026-08-13T19:24:37.181Z","3.3.1":"2026-08-13T21:18:42.384Z","3.4.0":"2026-08-14T11:58:43.826Z","4.0.0":"2026-08-23T19:12:07.624Z","4.1.0":"2026-08-27T17:13:52.735Z","4.2.0":"2026-09-28T07:06:26.857Z","4.3.0":"2026-09-28T08:16:29.233Z"},"author":"LZQCN","license":"MIT","keywords":[],"description":"Core framework for building LLM agents: plugin-driven Agent runtime on the official OpenAI SDK, Messages, Tools","maintainers":[{"name":"lzqcn","email":"by.lzq@qq.com"}],"readme":"# @ai-zen/agents-core\n\nCore framework for building LLM agents, providing the base abstractions needed to build intelligent agents. Works in both Node.js and browser environments.\n\nThe agent runtime is **plugin-driven** and runs directly on the **official OpenAI SDK** (`openai` package) — no in-house request layer.\n\n## Installation\n\n```bash\nnpm install @ai-zen/agents-core\n```\n\n## Core Concepts\n\n### Agent\n\n`Agent` is the core class. It extends `AgentContext` and manages the conversation lifecycle, supporting streaming, tool calls, and multi-round recursive conversations.\n\n```typescript\nimport OpenAI from \"openai\";\nimport { Agent, Message } from \"@ai-zen/agents-core\";\n\n// 1. Create an OpenAI SDK client (any OpenAI-compatible endpoint via baseURL)\nconst client = new OpenAI({\n  apiKey: \"sk-xxx\",\n  baseURL: \"https://api.openai.com/v1\",\n});\n\n// 2. Create an Agent\nconst agent = new Agent({\n  client,\n  model: \"gpt-4o\",\n  modelConfig: { temperature: 0.7 },\n});\n\n// 3. Add a system message\nagent.append(Message.System(\"You are an AI assistant.\"));\n\n// 4. Send a message and await the reply\nawait agent.send(\"Hello, please introduce yourself.\");\n\n// 5. Get the reply\nconsole.log(agent.messages.at(-1)?.content);\n```\n\nThe `client` is an `openai` SDK instance — any OpenAI-compatible vendor (OpenAI, DeepSeek, Zhipu BigModel, Azure OpenAI via a compatible endpoint, etc.) is supported through `baseURL`.\n\n### AgentContext\n\n`AgentContext` is the base class of every Agent and holds the following core configuration:\n\n```typescript\ninterface AgentContext {\n  client: OpenAI;                    // openai SDK client\n  model: string;                     // Model name sent to the API\n  modelConfig: Record<string, unknown>; // Model params (temperature etc.), spread into the request; may include vendor-specific fields (e.g. DeepSeek `thinking`)\n  messages: AgentNS.Message[];       // Message list\n  tools: Tool[];                     // Tool list\n  allowJsonParseError: boolean;      // Whether JSON parse errors are allowed (default true)\n}\n```\n\n- `append(message)` — appends a message to the message list and returns it\n- Extension happens through **plugins** (`agent.use(plugin)`), not constructor hooks\n\n### Message\n\nCreate messages for various roles using static factory methods:\n\n```typescript\nimport { Message, AgentNS } from \"@ai-zen/agents-core\";\n\n// System message\nMessage.System(\"You are an assistant.\");\n\n// User message (plain text)\nMessage.User(\"Hello\");\n\n// User message (multimodal: text + image)\nMessage.User([\n  { type: \"text\", text: \"What is this?\" },\n  { type: \"image_url\", image_url: { url: \"https://example.com/img.jpg\" } },\n]);\n\n// User message (text + image with detail level: low / high / original / auto)\nMessage.User([\n  { type: \"text\", text: \"Read the text in this screenshot\" },\n  { type: \"image_url\", image_url: { url: \"https://example.com/img.jpg\", detail: \"high\" } },\n]);\n\n// User message (text + file referenced by file_id via the Files API)\nMessage.User([\n  { type: \"text\", text: \"What is in this image?\" },\n  { type: \"file\", file_id: \"file-api-xxxxxxxxxxxxxxxx\" },\n]);\n\n// Assistant message (Pending by default, waiting for the AI reply)\nMessage.Assistant();\n\n// Tool call result\nMessage.Tool(toolCall, \"execution result\");\n\n// Function call result\nMessage.Function(functionCall, \"execution result\");\n```\n\nMessage status enum:\n\n| Status | Description |\n|--------|-------------|\n| `Pending` | Waiting for processing |\n| `Writing` | AI is generating |\n| `Completed` | Done |\n| `Error` | An error occurred |\n| `Aborted` | Aborted |\n\n### Tool\n\nAbstract base class that extends the Agent's capabilities. Custom tools must extend `Tool`, declare a `function` definition, and implement the `exec()` method:\n\n```typescript\nimport { Tool, ToolCallContext } from \"@ai-zen/agents-core\";\n\nclass WeatherTool extends Tool {\n  // Tool definition lives with its implementation (class-body field)\n  function = {\n    name: \"get_weather\",\n    description: \"Query the weather\",\n    parameters: {\n      type: \"object\",\n      properties: {\n        city: { type: \"string\", description: \"City name\" },\n      },\n      required: [\"city\"],\n    },\n  };\n\n  async exec(ctx: ToolCallContext) {\n    const { city } = ctx.parsedArgs;\n    return `The weather in ${city} today is sunny, 22°C.`;\n  }\n}\n\n// Register on an Agent\nconst agent = new Agent({ client, model: \"gpt-4o\", tools: [new WeatherTool()] });\n```\n\n`exec()` returns `AgentNS.MessageContent` — either a plain string (text result) or an array of content sections (multimodal result). Returning content sections lets a tool hand structured content back to the model, e.g. an image:\n\n```typescript\nasync exec(ctx: ToolCallContext): Promise<AgentNS.MessageContent> {\n  // 文本结果\n  return `The weather in ${city} today is sunny.`;\n\n  // 图片/文件结果：模型直接看到\n  return [\n    { type: \"text\", text: \"当前截图：\" },\n    { type: \"image_url\", image_url: { url: \"https://example.com/shot.png\" } },\n  ];\n}\n```\n\n### Built-in Tools\n\n#### CallbackTool\nDefine a tool quickly via a callback function. The callback receives `(parsedArgs, ctx)` — use `ctx` (a `ToolCallContext`) to access the agent, abort signal, etc.\n\n```typescript\nimport { CallbackTool } from \"@ai-zen/agents-core\";\n\nconst tool = new CallbackTool({\n  function: {\n    name: \"calculator\",\n    description: \"Calculate the sum of two numbers\",\n    parameters: {\n      type: \"object\",\n      properties: {\n        a: { type: \"number\", description: \"First number\" },\n        b: { type: \"number\", description: \"Second number\" },\n      },\n      required: [\"a\", \"b\"],\n      additionalProperties: false,\n    },\n  },\n  callback(parsedArgs, ctx) {\n    // ctx: ToolCallContext — e.g. ctx.agent, ctx.signal, ctx.preventDefault()\n    return parsedArgs.a + parsedArgs.b;\n  },\n});\n```\n\n#### CodeTool\n> **Deprecated** — string-code tools (defined via `new Function`) lack type safety and clear parameter mapping. Prefer `CallbackTool` or a custom `Tool` subclass. Kept for backward compatibility.\n\n#### AgentTool\nExpose a sub-Agent as a tool, enabling nested Agent calls. The sub-Agent has its own client, model, message list, and tools.\n\n```typescript\nimport { AgentTool, Message } from \"@ai-zen/agents-core\";\n\nconst tool = new AgentTool({\n  function: {\n    name: \"general_assistant\",\n    description: \"Delegate complex tasks to a general assistant\",\n    parameters: {\n      type: \"object\",\n      properties: {\n        task: { type: \"string\", description: \"The task to handle\" },\n      },\n      required: [\"task\"],\n    },\n  },\n  client,            // Reuse the main Agent's client, or use a dedicated one\n  model: \"gpt-4o\",   // The sub-Agent's model name\n  messages: [\n    Message.System(\"You are a general assistant good at completing various tasks independently.\"),\n    Message.User(\"Please complete the following task: {{task}}\"), // {{variable}} is substituted at call time\n  ],\n  tools: [], // Tools available to the sub-Agent\n});\n```\n\n> **Note**: The last message in an AgentTool's message list must be a User message, where `{{variableName}}` placeholders are automatically replaced with `parsedArgs` at call time.\n\n#### AgentToolLazy\nLike `AgentTool`, but the sub-Agent is not built at construction time — it is built lazily via a `buildAgent(parsedArgs, ctx)` callback at execution time. This avoids recursive construction issues when building tool lists (SubAgent → build tool list → SubAgent → …).\n\n`messages` is optional: when provided, the child's messages are replaced by the template after `{{variableName}}` injection; when omitted, the child's initial messages are decided entirely by `buildAgent` (useful when they depend on runtime arguments).\n\n```typescript\nimport { AgentToolLazy, Agent, Message } from \"@ai-zen/agents-core\";\n\nconst tool = new AgentToolLazy({\n  function: { /* ... */ },\n  messages: [Message.System(\"...\"), Message.User(\"...\")],\n  async buildAgent(parsedArgs, ctx) {\n    // ctx.agent gives access to the parent Agent\n    return new Agent({\n      client: ctx.agent.client,\n      model: parsedArgs.model ?? \"gpt-4o\",\n      tools: [/* ... */],\n    });\n  },\n});\n```\n\n#### IndexedSearchTool\nA keyword-based local search tool that automatically extracts keywords from entries as the enum.\n\n```typescript\nimport { IndexedSearchTool } from \"@ai-zen/agents-core\";\n\nconst tool = new IndexedSearchTool({\n  entries: [\n    { keywords: [\"price\", \"fee\"], text: \"This product costs $99/month\" },\n    { keywords: [\"support\", \"warranty\"], text: \"One-year free warranty is provided\" },\n  ],\n});\n```\n\n### Plugins — the only extension point\n\n`AgentContext` no longer provides any `onXxx` constructor hooks. **Plugins are the only way to extend the Agent.** Register a plugin with `agent.use(plugin)`, then `await agent.init()`.\n\n```typescript\nimport { Agent, Message } from \"@ai-zen/agents-core\";\nimport type { AgentPlugin, SendContext, ToolCallContext, UnknownToolContext } from \"@ai-zen/agents-core\";\n\nconst guard: AgentPlugin = {\n  // Fired before send(); a string rejects this send (throws)\n  onBeforeSend(ctx: SendContext) {\n    if (ctx.content.includes(\"secret\")) {\n      return \"This content is not allowed.\";\n    }\n  },\n\n  // Fired before every tool call; a string rejects the tool (reason returned to the LLM)\n  onToolCall(ctx: ToolCallContext) {\n    if (ctx.tool_call.function?.name === \"rm\") {\n      return `Tool \"rm\" is rejected: requires explicit user authorization.`;\n    }\n    // undefined = allow\n  },\n\n  // Fired when the LLM calls an unregistered tool; a string is used as the tool result\n  onUnknownTool(ctx: UnknownToolContext) {\n    return `Tool \"${ctx.toolCall.function?.name}\" is unavailable.`;\n  },\n};\n\nconst agent = new Agent({ client, model: \"gpt-4o\", tools: [weatherTool] });\nagent.use(guard);\nawait agent.init();\n```\n\n#### AgentPlugin hooks\n\n| Hook | Arguments | Returning a string means |\n|------|-----------|--------------------------|\n| `onInit` | — | initialization, no short-circuit |\n| `onBeforeSend` | `SendContext` | reject the send (throws) |\n| `onAfterSend` | `SendContext` | short-circuit later plugins only |\n| `onInnerLoopStart` | `SendContext` | interrupt this round (throws) |\n| `onInnerLoopEnd` | `SendContext` | short-circuit later plugins only |\n| `onInnerLoopsStart` | `SendContext` | interrupt the whole group (throws) |\n| `onInnerLoopsEnd` | `SendContext` | short-circuit later plugins only |\n| `onToolCall` | `ToolCallContext` | reject the tool, the reason is returned to the LLM |\n| `onUnknownTool` | `UnknownToolContext` | used as the tool result; `undefined` → default hint |\n| `onSubAgentStart` | `SubAgentContext` | reject the delegation; the reason is returned to the LLM as the tool result |\n| `onSubAgentEnd` | `SubAgentContext` | short-circuit later plugins only |\n\n#### HookResult — unified short-circuit semantics\n\nEvery hook returns `HookResult = string | void | Promise<string | void>`:\n\n- **string** → short-circuits (reject / interrupt / provide a result, per the table above)\n- **undefined / void** → passes through (continue with later plugins or the default behavior)\n\nMultiple plugins run in registration order; the first to return a string short-circuits.\n\n#### dispatchHook — unified entry for events + plugins\n\nInternally every hook goes through `dispatchHook`: it first emits a **non-blocking** kebab-case event (`agent.events`), then **blockingly** invokes plugin hooks in order. So you can either observe via events (non-blocking, cannot affect the flow) or intervene via plugins (blocking, can short-circuit).\n\nEvent names: `before-send` / `after-send` / `inner-loop-start` / `inner-loop-end` / `inner-loops-start` / `inner-loops-end` / `tool-call` / `unknown-tool`.\n\n**Unknown tool fallback**: the Agent keeps a simple built-in hint. Smarter hints come from the `onUnknownTool` plugin (e.g. the SDK's `UnknownToolHintPlugin` for MCP guidance, registered explicitly by the caller). Plugins have the highest priority; an `undefined` return falls back to the built-in hint.\n\n### ToolCallContext\n\nA single class spanning **interception decision → execution**. The same instance is passed to both the `onToolCall` hook (pre-execution interception) and `Tool.exec(ctx)` (actual execution).\n\n| Property | Description |\n|----------|-------------|\n| `agent` | The Agent instance that triggered the call |\n| `tool_call` | Unified tool call shape (`{ id?, type?, function: { name, arguments } }`) |\n| `tool` | The matched registered tool (undefined if not registered) |\n| `function_call` | Compatibility field, equal to `tool_call.function` (legacy shape) |\n| `parsedArgs` | The JSON-parsed argument dictionary |\n| `resultMessage` | The tool result message — execution result / rejection reason / parse error are written here |\n| `isPreventDefault` | Whether the automatic continuation of the conversation is blocked |\n| `parseError` | JSON parse error info (when `allowJsonParseError=true`) |\n| `signal` | Abort signal for this tool execution (fires on `abort()`; tools can listen to truly interrupt) |\n| `preventDefault()` | Marks the conversation to stop auto-continuing to the next round |\n\n## How the Agent Works\n\n### Conversation Flow\n\n```\nsend(content)\n  ├── onBeforeSend hook → may reject\n  ├── Appends a User message\n  └── run()\n        ├── onInnerLoopsStart hook (once per send)\n        ├── Inner loop (repeats while tool calls continue)\n        │     ├── Appends an Assistant placeholder (Pending) at the start\n        │     ├── onInnerLoopStart hook (before each request)\n        │     ├── client.chat.completions.create(...) — streaming via the official SDK\n        │     ├── parseStreamData() → content / reasoning_content / tool_calls\n        │     ├── handleToolCall() → executes tool calls\n        │     │     ├── onToolCall interception hook → may reject\n        │     │     ├── onUnknownTool plugin (may provide a hint) → built-in fallback\n        │     │     └── Tool.exec(ctx) executes the matched tool\n        │     └── onInnerLoopEnd hook\n        ├── onInnerLoopsEnd hook\n        └── returns this.messages\n  └── onAfterSend hook\n```\n\n### Tool Call Handling\n\n- When the model returns `tool_calls`, the Agent automatically executes the matching tools (in parallel)\n- Tool execution results are appended to the message list as Tool role messages\n- If all tools succeed and `preventDefault()` was not called, the Agent automatically starts a new round (feeding the results back to the model)\n- If `allowJsonParseError = true` (default), parse failures automatically send the error back to the AI for correction\n- Unregistered tools go through `onUnknownTool` plugins (any string is used as the tool result), falling back to a simple built-in hint\n\n### Event System\n\nThe Agent provides an event bus. Events are non-blocking notifications (they cannot affect the flow — use plugins to intervene):\n\n```typescript\n// Lifecycle events (payload = the corresponding hook ctx)\nagent.events.on(\"before-send\", (ctx: SendContext) => {});\nagent.events.on(\"after-send\", (ctx: SendContext) => {});\nagent.events.on(\"inner-loop-start\", (ctx: SendContext) => {});\nagent.events.on(\"inner-loop-end\", (ctx: SendContext) => {});\nagent.events.on(\"inner-loops-start\", (ctx: SendContext) => {});\nagent.events.on(\"inner-loops-end\", (ctx: SendContext) => {});\nagent.events.on(\"tool-call\", (ctx: ToolCallContext) => {});\nagent.events.on(\"unknown-tool\", (ctx: UnknownToolContext) => {});\n\n// Streaming / lifecycle events\nagent.events.on(\"open\", () => {});                       // connection established\nagent.events.on(\"chunk\", (chunk) => {});                 // raw streamed chunk\nagent.events.on(\"chunk-parsed\", (receiver, chunk) => {});// chunk merged into the receiver message\nagent.events.on(\"parsed\", (receiver) => {});             // full response parsed\nagent.events.on(\"error\", (error) => {});                 // an error occurred\nagent.events.on(\"finally\", () => {});                    // run finished (success or failure)\n\n// Sub-agent delegation boundaries (payload: agent = host, subAgent = child)\nagent.events.on(\"sub-agent-start\", ({ agent, subAgent, toolCallContext }) => {}); // before the sub-agent runs\nagent.events.on(\"sub-agent-end\", ({ agent, subAgent, toolCallContext }) => {});   // after the sub-agent finished\n```\n\n### Aborting\n\n```typescript\nagent.abort(); // Abort all in-flight inner-loop tasks of the current round\n```\n\n## More Examples\n\n### Multi-round Conversation with Tools\n\n```typescript\nconst agent = new Agent({\n  client,\n  model: \"gpt-4o\",\n  tools: [new WeatherTool(), new CalculatorTool()],\n  allowJsonParseError: true, // Let the AI auto-correct argument format errors\n});\n\n// Add a system prompt\nagent.append(Message.System(\"You are a weather assistant. You can use tools to query the weather.\"));\n\n// Send a message; the Agent automatically handles tool calls and multi-round conversations\nawait agent.send(\"What is the weather like in Beijing and Shanghai today?\");\n```\n\n## Testing\n\n```bash\npnpm test\n```\n\n## License\n\nMIT\n","readmeFilename":""}