{"_id":"@yushaw/sanqian-sdk","_rev":"51-fd3779ff4a4bc0d28d151329557879c2","name":"@yushaw/sanqian-sdk","dist-tags":{"latest":"0.3.29"},"versions":{"0.1.0":{"name":"@yushaw/sanqian-sdk","version":"0.1.0","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.0","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"ec2dba0d87add2f004299ef019c7568724dc81a4","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.0.tgz","fileCount":7,"integrity":"sha512-crvuxi5uXfp6J6BdnlYS3jLJT2akI9Y6clYaeg/RLtMxUYZA39gdhzhjHJYr5qARcMMC2VwtcpGXdXb1DVTZyw==","signatures":[{"sig":"MEYCIQDGhqKLzSxUS0kjid9iRs3EHHbRGcMG2O6uEkBZEUz/nwIhAI+Ei5rvLRPh5cy/0QdIuAQusSDH2CAHwR76NKljwPms","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209901},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"d116d47f76bea80d8eb27b0346e7001479b588da","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.0_1765285213245_0.33526386826578225","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@yushaw/sanqian-sdk","version":"0.1.1","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.1","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"3d1deb24a759c83b1d98be72a10a69e514591ac9","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.1.tgz","fileCount":7,"integrity":"sha512-BdJd6zJZfQfwB/uEpzpv7mMDca1DpEf3i54vNDap5rWa4m8zi7RYXXNN93ZCtkm63c9Q13CJ37/xi43FrgtU0Q==","signatures":[{"sig":"MEUCIBGZo2GyV+vFtAjIgC5n1kxcTEfQfhGO/G2fdV0LlBPFAiEA3sA3mMc7Qq+j/I8zKnLQZ0H0WaWdfnCSOzkQjZhy3Qo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":218586},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"b9aa40a1dcbf597b782156f27358a7c1c52c280f","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.1_1765286504866_0.3510250696151427","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@yushaw/sanqian-sdk","version":"0.1.2","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.2","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"2b09541bfc1842bc3fe9967513dd594bbdf1128d","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.2.tgz","fileCount":7,"integrity":"sha512-gphjJXPDodfd4n4dPBhFbHbFlrjuwEIRlvwA+HjvtVUSNDD6ReczIVGL09OszPrFbYObLxWRIYlicYmil4BGgA==","signatures":[{"sig":"MEUCIEHcgWXRfSRXqdTBIyY+2GnEaVfcJVO1olyetapodJaqAiEAx8rjr5rz/KsZQGOvYtE+u8xDx9EMhn+XWgYk9JGqLYg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":221310},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"df9fa57006717487d4ee6ce7dfd547b15fa72f5c","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.2_1765288853048_0.16503077970915125","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@yushaw/sanqian-sdk","version":"0.1.3","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.3","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"fcdbc416af175db3682c64c672911c9ee4894304","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.3.tgz","fileCount":7,"integrity":"sha512-F+AvPM7L18TTMJ4i2lBNhOxT7/f1nhwTNvd5qkveGAQ0BzQ9G00m/S/B1+5cYOV3jOPT6qw+I30TFkEVGs+bqw==","signatures":[{"sig":"MEYCIQD67g53U9WrjfSedCbCpYvhy3ctoBn0Ztrl9OOua31Z7gIhAKB1gBoATd4JX7t9gkyl+SYe+MJr0W7pypYUH+S85pWy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":222566},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"1655f88da03cb0345974ad2d2764104d2f1448ff","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.3_1765289511137_0.2608582434000559","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@yushaw/sanqian-sdk","version":"0.1.4","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.4","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"31231eac0bb7e87c2105aec034c5bc7f83383c4c","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.4.tgz","fileCount":7,"integrity":"sha512-6zeEh5BfgEddCUDSqxPOIg6khEX5GxS6zsYg2gYtPLBrqWykcqTp5Z6fXtGSlhjdlJlSdqEi1IT2e3zW9DIBZw==","signatures":[{"sig":"MEUCIAaLxZzPGhR9Hfyi5KjwZOorEwf0Lnrm2N4wB6U1dOMGAiEAl6UPHEsHnjvzVX5mbKsJOfyhTbGd4Tdlj39n2Lx0nlg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":224370},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"1655f88da03cb0345974ad2d2764104d2f1448ff","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.4_1765289612480_0.19161366332868868","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@yushaw/sanqian-sdk","version":"0.1.5","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.5","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"99d9c05a17bc1bebd4aaeb4eebca9a88483f227c","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.5.tgz","fileCount":7,"integrity":"sha512-YPN5m6h3ZLdie02tFpt1BMc0WoNHMWNQMli4IApYWj5DBoA/Ud+bA2vKpy18PqeIwj94y5emnXChLh+sZBZOqw==","signatures":[{"sig":"MEUCIQCxGzRseXxj04Dr8lylW7qyK8d4JABh1PVO5cca2C+lRwIgCeLQcXwORhoCVZbrzoZz3UFpap1ISVwCz4Fww02hjfk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":235130},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"1655f88da03cb0345974ad2d2764104d2f1448ff","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.5_1765290301981_0.5074778985943948","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@yushaw/sanqian-sdk","version":"0.1.6","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.1.6","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"083426eb4006e462c89276c92951b03c451cca36","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.1.6.tgz","fileCount":7,"integrity":"sha512-IL6elFj/wms0cff2b3wZLlD8uqwrcjoDRaOimO0r32FYaQ4rp6pT73DmBt8yLwG/30oUcer0NMd4OZ1Np1bEBQ==","signatures":[{"sig":"MEQCIFz0VMUpgRrBcwfjQrHbBNQixnfFG94fB443TbRoJQOsAiAoBMqykYPV+eCse9vYr3d2P1wk6Aaz3tzzL4+5ZJ2bdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":235986},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"1655f88da03cb0345974ad2d2764104d2f1448ff","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.1.6_1765290345870_0.23702921976139235","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@yushaw/sanqian-sdk","version":"0.2.0","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.0","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"b614e01d1e22cea205496b762966a58ce76e7771","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.0.tgz","fileCount":7,"integrity":"sha512-UZQjJkpCJlCVmpCDhOPWscigI9e84+H7X11EmIJF8R0Vi1p9F/ySSG63oIyuyHjOaq/DPrMtK9Kzu8+vAnwd2w==","signatures":[{"sig":"MEQCIDyvPh15DubvtmEP2t+r27w+Jk5K6k1OMpc9iFfXgQuQAiBz/KP65ef8j3l7qc1Vsps1PrTQ+xzboiccV55/5ModZw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":235962},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"47fb5912f37f712e05f90c3b6ced33bfe4bb1865","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.0_1765295179290_0.5138057880072642","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@yushaw/sanqian-sdk","version":"0.2.1","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.1","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"84f4da7b3c0930ea11454b8c517740ae23aaf24f","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.1.tgz","fileCount":7,"integrity":"sha512-o1mlnvy6VmD6zg4Cn+82oBZijPCHu2tQJ0EcbcYckw266jdeJ8M0f0J3eXpxRcoK7cnkrcd/Fi5yacXnycKJ/Q==","signatures":[{"sig":"MEUCIQDVdMhIcVTB8KOWo6tCZaaKKtNwcmwRvh4XsK31NcmcTwIgFPkzr5ClkxDrl5S5FtLTcey9s/sglgg7CYRs63/GBb4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":239256},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"47fb5912f37f712e05f90c3b6ced33bfe4bb1865","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.1_1765301700867_0.029075046177486685","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@yushaw/sanqian-sdk","version":"0.2.2","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.2","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"d291e066f5b6a2770723190f68043b79ad7d9739","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.2.tgz","fileCount":7,"integrity":"sha512-/uaAQU4GRSwUSQlDgpH9KAtHckAf6Zdt4+sxhARKefzQTOP3heli/o9uTzgxUNJIsZTD7qWy4CMNSTG6Viupzw==","signatures":[{"sig":"MEYCIQCPoTZMxjYZKKLGegQu4Nsj0fxrTwJ0GvHXGA755KKDggIhAN/ynOVc5uIkSZErisRV7g1O+Zz3T1vwibaXnSvcRiPC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":277353},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"2a39aa1af11271aa43d95949644bdc7698f420cb","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.2_1765311890754_0.16738648443136261","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@yushaw/sanqian-sdk","version":"0.2.3","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.3","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"3773f3a31d4461cb40ce92507ccad19eb70771ac","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.3.tgz","fileCount":7,"integrity":"sha512-WI39P4p8sDSWPxxmOUTlA1mg2+eYMbV/yQNa2dF+Q+j4arFs5rzbLEauJ1do2jvDdV01uYbGXzwwqzzSQyHRqg==","signatures":[{"sig":"MEQCIG58voJScE347Zpz4M2sumPDbFLV4P8vWTPrOJrZOQjZAiAHU1l9VXe0O/KUDFPtVlyWawYSc5H19qUML2RYRP2fIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278165},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"34469f82623c087e6b78e0a531961ef67c4a8406","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.3_1765313298843_0.9899173881571293","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@yushaw/sanqian-sdk","version":"0.2.4","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.4","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"a30f5c2ac15f82f8400a1fbc57c7d5089b975fe7","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.4.tgz","fileCount":7,"integrity":"sha512-jrawSWVqCe3QQjTAbr8q+5h11NEp+bUX2cK2WbUBiGimO1NiSKcBahjHmIytwkP2v+pCePN19QEpnEgbUE72sw==","signatures":[{"sig":"MEYCIQC2c9KsyLtMPZ2at+Mq8yOAeTX4+p7LuO4RKskdZNBbpQIhAOwC9EdeU2c4iDNK44OPnZVoZ/+jZ7FaV+DlPHxHosVG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":279663},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"ed7ca7a0d1b86e0f96616ac428ddb3d5cee1ca13","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"11.6.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"25.2.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.4_1765313643211_0.5971474186809618","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"name":"@yushaw/sanqian-sdk","version":"0.2.5","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.5","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"200dcaed5b0bae006ff223e79e0b0c8bdd60ae6d","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.5.tgz","fileCount":7,"integrity":"sha512-QSo5/Um8+mE6WSXsWWBtx/4c3c9zfVYVQ0U7Udph0B74FHgBumvCibjeUO9RXKxYC8N8HnWlrFKY1o0hvG7A+g==","signatures":[{"sig":"MEUCIBUjHF8plppYUE6tER5dGKLV79eeV/i2jrmQA+CksQZ7AiEA9vlZNLt9wMn2m01Go24KEy8xSz7Jw5xgrpLGE/uA7kc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":281765},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"46cbdaac5ecab72d0e897799fab8f22f520071ee","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.5_1765438684869_0.11496730700836988","host":"s3://npm-registry-packages-npm-production"}},"0.2.6":{"name":"@yushaw/sanqian-sdk","version":"0.2.6","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.6","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"cbf871596647c9458c4170e6d01d565bb427dc75","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.6.tgz","fileCount":7,"integrity":"sha512-8EsfubgZirm1oXAlyh9IR+SPWXhNXi0qz+cIuFRw/7RJTiCAf3o7aJ1t3vmda7NPy34cJF804G/IeqG8lotZfg==","signatures":[{"sig":"MEUCIQCDLrJORI+Zrkj8uIaviJZpaP9SR//K7xLBt3h4n2sIigIgb5145IAJHpiBe8mXVShDZ8DQS55RTYSv+X781uZ+s20=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":282635},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"46cbdaac5ecab72d0e897799fab8f22f520071ee","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.6_1765440476354_0.5536176085863371","host":"s3://npm-registry-packages-npm-production"}},"0.2.7":{"name":"@yushaw/sanqian-sdk","version":"0.2.7","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.7","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"19b13bfacea9df44b09a0b89a4230cbee7d1da08","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.7.tgz","fileCount":7,"integrity":"sha512-VBAsZW0MIjaUxGNX0rjcMtgo6/8FV06yubWelH1cWnu6+Y2sJs4mIUQk6YZq71XZ3SxQIPJWMJxaZ7xJ1FRqFg==","signatures":[{"sig":"MEYCIQCXZErKPLU3hc/pITxpKaqu0+E/dzOJM6lQxAYTbZB/pwIhAIDQWCt8LXPZrb5Rj8zN2cLvVXe59jcW+n4nM4N8IaOM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":295988},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"2ebfc73066c49af3e7d36d656385f3440e439521","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.7_1765507119111_0.3023424309311198","host":"s3://npm-registry-packages-npm-production"}},"0.2.8":{"name":"@yushaw/sanqian-sdk","version":"0.2.8","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.8","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"7b1011c415dd729e0cd52dfa409bc19ce905982a","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.8.tgz","fileCount":7,"integrity":"sha512-7FmktZVIySAn6JGtUtxYvLeagAeZhA9aSAvnbIT5mvvV7+TXS1B+Ls67TUUE278wG7+1U8mOV5/y707TByDV4g==","signatures":[{"sig":"MEUCIQDamHFGVMGyZy4yuz+tOmDlll7m3Hvb8JM6d3yBHC6MFwIgHc/7MQCZXPQ4nUHfKQ+TqqI21Oj10st282gdVSsByLk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296151},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"059df7bb674eb0e0dea2e4385ea25d47a4f699ba","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.8_1765510606771_0.4908106449394989","host":"s3://npm-registry-packages-npm-production"}},"0.2.9":{"name":"@yushaw/sanqian-sdk","version":"0.2.9","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.9","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"5f8279d79ab23e2b59303d6c3a66916f65cfa816","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.9.tgz","fileCount":7,"integrity":"sha512-7PbS7KG2Uz/iq5m+5xzAXSCz8Cn66dINnL9PklvZSwIQ0FArko+1YqCOScouqZWZwFXlSlm64sfd1nUYHKuAoA==","signatures":[{"sig":"MEUCIFSjqHsdsiVJKQRL9iSKx/mvLUm1mo8S8TlYtI2tuNyYAiEAycFVKHMLhl5fcHL+UuDvbUMHQAyNAo9Eh0bEGEaPe0k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":299367},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"6a19834dfe72cd592c6614b3bcc6ee0144286b8f","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.9_1766146675155_0.36514495368029243","host":"s3://npm-registry-packages-npm-production"}},"0.2.10":{"name":"@yushaw/sanqian-sdk","version":"0.2.10","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.10","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"520f24026014d69142cdd67f9728f7ecf09e2a13","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.10.tgz","fileCount":7,"integrity":"sha512-T5wfsuMvKtPgN+3xJ0VLPdoQBB92rT3W2I5bfwJowtim6CnE7wVCJWYTir2wZJH43t9lD4+9Flp5DqGsq2IrfA==","signatures":[{"sig":"MEUCIQDQJ53DAae/4SfonVQeZMJnk8+ECCTrQpiaCFzpftYJnAIgY49klV+eOj8So3VRSeRfx2cJLkppm9g2YdWC2dMiv5o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":304394},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"457820104799565414d685022c07adee5d254945","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.10_1766205849985_0.9124833366126863","host":"s3://npm-registry-packages-npm-production"}},"0.2.11":{"name":"@yushaw/sanqian-sdk","version":"0.2.11","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.11","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"04b6658def188fa6b31bc79b415d38b9f570965c","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.11.tgz","fileCount":10,"integrity":"sha512-a0jdngSNjlFC2kCDQabEZrRap+eNp1PL6u9cXb0giCGBVhSkVU3DN2vA8jZHobpVK631K9Ry/mXKofepy/9rLA==","signatures":[{"sig":"MEYCIQCQGhwpgRNKbbh6Au7z6DjhcGhtWjuc1jmYI079Bz602QIhAMCDrB/md2bkh82oIY6oKHkCk409ib8s8orb25Hk49IS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":421364},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","browser":"./dist/index.browser.mjs","exports":{".":{"node":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs"},"default":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}}},"gitHead":"457820104799565414d685022c07adee5d254945","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.11_1766207219528_0.5916014469048723","host":"s3://npm-registry-packages-npm-production"}},"0.2.12":{"name":"@yushaw/sanqian-sdk","version":"0.2.12","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.12","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"65156d0b920c3eafb65c31949894f68b7e60af22","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.12.tgz","fileCount":10,"integrity":"sha512-775SDACGZRdOYBOucke4c0xBHGgFewVu057kEy/0VyQb+Q9YlbddfpZwvbUceWYf0zoabmhhh3SsleX+vxKJNQ==","signatures":[{"sig":"MEQCIBgt5Y/vpPklCVbj23HzjUYnJigmfcs0j65cel4whQuxAiBi67ru9zX282IaqwtFR6UQfo7cU5upiWPw8D2WXq6DLQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":428250},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"72bee6418fbd81822a3f19a8a46fd85633fd812c","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.12_1766222921082_0.7119737242411421","host":"s3://npm-registry-packages-npm-production"}},"0.2.13":{"name":"@yushaw/sanqian-sdk","version":"0.2.13","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.13","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"e6e01a3ab7013dc331e5c8678eda61f800e4aa6c","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.13.tgz","fileCount":10,"integrity":"sha512-PdjraccCrfZW82j9TSbGu7Zx5biuEF5zQ6qPGrHw/A9W6jViMO66ZePOC4j7PofSe7JvTqllpXqPqQkLKCtGKg==","signatures":[{"sig":"MEUCIFP6LB4H4web9uvRrKiYu8cVoHKIhWAyOVw4gLk4yamUAiEAhLwzeBDJ3MoY89vwDkk8jBl1mlfQSMONR2r4VzRC/nA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":428407},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"72bee6418fbd81822a3f19a8a46fd85633fd812c","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.13_1766225152285_0.1879710705593871","host":"s3://npm-registry-packages-npm-production"}},"0.2.14":{"name":"@yushaw/sanqian-sdk","version":"0.2.14","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.14","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"23a99f96743e9a51d490ed0e867433a77e51c03b","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.14.tgz","fileCount":10,"integrity":"sha512-L/hE/g1U/rfMnUHJ3OqEF4Nlxmie3bis/b99HrZLIAkcGS1ix8HKM4stmdqUWxXWKE75QnT2SOA3M+/xH1FfyA==","signatures":[{"sig":"MEUCIBAIOqHlesiXjJTOUQQQz7SbejOv6pSzxQNkhx1V6/gMAiEA446XhHhtHTq6lKmLm/RneCCAAWPq7hPG/Hg+8RMnSYg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":444987},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"cab7cbd1416df7195b60072287fb1fab6e65c5a5","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.14_1766766078875_0.9845576548990087","host":"s3://npm-registry-packages-npm-production"}},"0.2.15":{"name":"@yushaw/sanqian-sdk","version":"0.2.15","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.15","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"a5af7f1e428d5adb0d28d7da19a65937ca773ea2","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.15.tgz","fileCount":10,"integrity":"sha512-NxBOHOwITCd5wWruKadoabW2NDATCekw3ypR4JRv/OOAvrdarrbKSWVV2qhgU7Bi4rc6PVXUxeEc7NJUcnI+qQ==","signatures":[{"sig":"MEUCIG1fdeyitxoRZtkOyXoqQnmlW8r2dTRrBUtUdIPapp68AiEA1ufQV6VJ6pwJty/iwYLZ1LNaOOtiNT4vb66DIMu9Hoo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":444987},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"cab7cbd1416df7195b60072287fb1fab6e65c5a5","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.15_1766769389572_0.4901605246319167","host":"s3://npm-registry-packages-npm-production"}},"0.2.16":{"name":"@yushaw/sanqian-sdk","version":"0.2.16","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.2.16","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"aa2342fc47f2a1e3b5d288e7623737818fd73d6e","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.2.16.tgz","fileCount":10,"integrity":"sha512-xP+v1NJ5kM2ruoVvKrZWcYHMnkvMEZfJOmhmmZEantoFJPvWw8Q2WmHCO06pCvPg7jqat4pu9GiX4sACiDKfMw==","signatures":[{"sig":"MEUCIQCuIf8BtkZhaQTXZ7lA1mGWo5IeGPdjCDqb+UCzQYQsSQIgagFqjtbsMtBEqkRZrE0isx4fh7ldzMcFdzSIw6E8UI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":452827},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"bf34d3abaea11ae372ecd8215a2b35025f9e075b","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.2.16_1767052522907_0.9398038959793698","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@yushaw/sanqian-sdk","version":"0.3.0","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.0","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"ec8e12aa1183cd2fd7a6b5eb7170a208ae599bde","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.0.tgz","fileCount":10,"integrity":"sha512-koZRlI9o+VRamAg5RuLAXUvx2WCIN9FkSEgpeT/17urew6E8dFVG82XQcCPIh2MPHqgIOWU2dZcHjmLiAsRifg==","signatures":[{"sig":"MEYCIQCcBZDlQCN9Dxrq1T020Gba92fmrY8leq/bzKoYS8ICFAIhAN2b+rAnIdIZTWcwxwBnCsvRC2hlNrsPeuInpJPIEMvR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":476509},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"05e6d20680d3d34ddb644ce78d6621f0de09bf66","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.0_1767442700162_0.0172531031275156","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@yushaw/sanqian-sdk","version":"0.3.1","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.1","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"1587a3bd9b8d9ef650e641002152a8a2c56193e5","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.1.tgz","fileCount":10,"integrity":"sha512-X8gX9VFl+UYHasptUbbQI+DxrQJdL0Bg0aGRHwdhLXYAhbOsB5S3JSsFh04FKIoQV1/sIvRVDSZKP11AFWpVwQ==","signatures":[{"sig":"MEUCIQDX3hdJdRszU4j+a4/v9l9vycikj0vYlFw4GHqflXDKbwIgPM/C4qXaES674B92gTOsGuXMsRn0zq3xnGzET+TZZ7U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":507078},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"06883e43d247b90ba4952667511e8e340902010a","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.1_1767460622861_0.630715752302963","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@yushaw/sanqian-sdk","version":"0.3.2","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.2","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"5052c38e03c14e5ce9400ac244e177ff0d1493a9","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.2.tgz","fileCount":10,"integrity":"sha512-tUODglO5pLNvPh05t3NwvPlmXfobLO7ALy2TTSGhiGtjjdiPx6cQscto+s5zTbLfD+rXGAkTlczTvHiBTgPcxQ==","signatures":[{"sig":"MEQCIHhGTBF3sLoDGFIzTZJ2FSsEMt4tKwn0ankrM4juekPOAiBPnLgrehJi4QHYzJHWz0LdwV40AY2NVqMhabFmooNgAw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":535676},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"87e41de50b146839da8b541ad2dfbd7e2c158ea3","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.2_1767581654966_0.05446197019105825","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@yushaw/sanqian-sdk","version":"0.3.3","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.3","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"1e8286b7bd160fbd932d596bdd48c95edfffdcce","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.3.tgz","fileCount":10,"integrity":"sha512-55TpfzyLLM1N7lPn+9BtItp5ujHO4wgDxjnAZO0MPFN6e0fm9xVsadqFbxpxoizDwpuf6apGD8kBt2lmosLZAQ==","signatures":[{"sig":"MEQCIEmWZBAVoNu2uEJ0SfKpNLqpsrtTxVmNpLcSUWbIsN4GAiBpCDljRwFquUyatnKqzznaG6UvhBltkRQMIta5hyFK2A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":549291},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"623b6e1d6f3812898f86ee75acc0eb7f4d7aef0a","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.3_1767697004235_0.6334865951280997","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@yushaw/sanqian-sdk","version":"0.3.4","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.4","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"a57da00a46336b015c71329b90e8d8692a304a8b","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.4.tgz","fileCount":10,"integrity":"sha512-/B/nii2trl6OyGVHpFUoFqR/P3GwlcYQUV4te/3XplHkQhKGigozci7MpsUBbZf0URbksYgyDcKUsGjx7NdvxA==","signatures":[{"sig":"MEUCIQCc01BlvpyN7n83TrtFTDiTVdOmx7qSzAlCx9jeTCLgDwIgU9NubCqJmINOHhpqfNGnI8NXqhSAKehB+4RG86Csmqg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":554179},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"d2915a289c285e0fd446078c71d68d146aee9552","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.4_1767700662520_0.5133212750186598","host":"s3://npm-registry-packages-npm-production"}},"0.3.5":{"name":"@yushaw/sanqian-sdk","version":"0.3.5","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.5","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"24750267c33c14287855199957d8f940830ea6fc","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.5.tgz","fileCount":10,"integrity":"sha512-QnNC6+uroMkbl5Pn5+d781RLmef+j2u38R05ziTEo7WTS2ctq+sVuo8etI35pC0DBH2q/QzKMIIkFxc/7iNspQ==","signatures":[{"sig":"MEUCIQCcSKuT3sDyo/OsJHBcVP4Rh5HRJYWebTl2uIld1bWJqwIgWxtmTxZI25w9XhJFKOelPc4+YQfj9d/nfvg1QESYuxA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":555845},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"78d962885013542c3e8d2f68c818ab68629789a3","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.5_1767720895249_0.7935677720691543","host":"s3://npm-registry-packages-npm-production"}},"0.3.6":{"name":"@yushaw/sanqian-sdk","version":"0.3.6","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.6","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"4d22043c53ff79d01a334445dd5cfe9680ce092f","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.6.tgz","fileCount":10,"integrity":"sha512-nGIcvVsp8DkSL561TCEWPQNswP0WCglQ2o/aKIa8GeivvZ5QoY3TvAsKG6uQEYf+P6HOcU71lFsDqhtwqXP47A==","signatures":[{"sig":"MEUCIGshaUfBUgXPj9k+QpJ33e4WH81D+M5KOXYpz8S72lABAiEAnUwqlwI3Alo+phtjN99mTYl7ZlMscL6GWyf2F+rb1xo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":558033},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"6cc1a619ae0aab57de153e9cd5b67c742e529fbb","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.6_1767981165371_0.1743619215849863","host":"s3://npm-registry-packages-npm-production"}},"0.3.7":{"name":"@yushaw/sanqian-sdk","version":"0.3.7","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.7","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"f86c1c103c9de3d00d039eef36f98a72ec57d12e","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.7.tgz","fileCount":10,"integrity":"sha512-ZGquJqhWEISn/VUc7zm/DhXUCZkrjlqjplW0v0YCgKUB65U8qG7ggOllqUTnRfw597Vuex6izuhL+mKetyEzNg==","signatures":[{"sig":"MEUCIQCx2f6V6NiBi/1ZZXUgG+HoDA6mtS6iTZ9hePm1Pj5V1QIgLNMsjsZ7SMaPJuPm2ihk+CyNIp9fbLvxgFvgRMWfEv0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":590913},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"3390f04ec43996c528d5fdffe79a26fd2166816d","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.7_1768076502496_0.788690646237475","host":"s3://npm-registry-packages-npm-production"}},"0.3.8":{"name":"@yushaw/sanqian-sdk","version":"0.3.8","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.8","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"0710debef7c8eb47b656adbb3e2c63782ecd5cbc","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.8.tgz","fileCount":10,"integrity":"sha512-HKqZ2kSmjv7nbOV4yVQwytG5S/2DPM20GuaZtYRSRz1nghmOH/kls57IFTCnbgzg+RKjqWUHcyVvrWcmF/+MWA==","signatures":[{"sig":"MEQCIGoLAjQcIw9F81x9UJp/0M5bnPlpFsIxwpsc4eRQAZATAiBlE6R97JfkXhTVTqyQthAvcqQZOFfXui6+VM4ZCo+CCg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":600347},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"33c341ce7a9252a4d7dd56bad8e9402d43b6a409","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.8_1768298235021_0.23605358433361512","host":"s3://npm-registry-packages-npm-production"}},"0.3.9":{"name":"@yushaw/sanqian-sdk","version":"0.3.9","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.9","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"83813d172b3305c7e46677e4ac2aaa6c2e9eedf4","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.9.tgz","fileCount":10,"integrity":"sha512-VeHJX1n4kwFuvcOqgwXQgC3BEK7B8worDIxBJnJPcPCgPAJD+D110lflSWULrVQDtc7xQlC3HVQF05nW9tomrg==","signatures":[{"sig":"MEYCIQDwNiNE7kp0/VyG4ZYOSj6mxkoer8dXsdYzs8J+t2R72QIhAIrW9eCgefcmxXVnIIP6cB8vVdAZ1o1vff44JPBLuY1a","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":608261},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"7265571d352c84e0f045532aa85bebd10a1d3d32","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.9_1768501957543_0.1819032670746854","host":"s3://npm-registry-packages-npm-production"}},"0.3.10":{"name":"@yushaw/sanqian-sdk","version":"0.3.10","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.10","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"f0bd6d6b6d812b3388ba7a31166169f427fb390a","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.10.tgz","fileCount":10,"integrity":"sha512-wndU4Dqeog1u/Vtmqh2wXWj1u2wX8B1n1YlFCct0Htg4gNv8DJgnjVsKPQMGyNx9dZQz01uCmUkkI9yTg23XZA==","signatures":[{"sig":"MEUCIQDxxP3n27OdOagxwpj4xeHC859wAd8Iuj/nBAgfi3PCMQIgXbRq430ZBrtIFnum6owni1XBxSCOwkx4AoF32swzvko=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":686490},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"c3c40e4fb3b0e0f942f7a6b782b7eab7983b47f9","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.10_1769260922420_0.43886946285175177","host":"s3://npm-registry-packages-npm-production"}},"0.3.11":{"name":"@yushaw/sanqian-sdk","version":"0.3.11","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.11","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"e8641dcd0b99334205c92b25f0de436aa4c32e6e","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.11.tgz","fileCount":10,"integrity":"sha512-4joeWVjyGWknRjsaQtuAAG11DK3Rdg772ippeBY5bpUQfOYUk0SfKVYCaqLuFrEHNfnLN8KXkwqzbGEgfPDn4w==","signatures":[{"sig":"MEQCICgiCTsgE9URcOGCrTask1omo2VIb5y8+EF+tPpI89F2AiBSKhVVSkvy98rTophXB03HRuqrMyIrHZ+nRCQrbgEe7g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":691998},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"c4ea3ec34aaf5352c8fc4fef1d2c5bcb895f1a80","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.11_1769358342970_0.7873405835986602","host":"s3://npm-registry-packages-npm-production"}},"0.3.12":{"name":"@yushaw/sanqian-sdk","version":"0.3.12","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.12","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"882a55e276bac885504a686122aab7e9cabfb9f0","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.12.tgz","fileCount":10,"integrity":"sha512-6y2DaliABnQjoYvqCj+XUNf2Ii1iY/HSboc/PYQcJy33HhkY/vDfUiQ8wNxd52zkI2rvyEAHBv9RZH7EMIsNOQ==","signatures":[{"sig":"MEUCIQDCJ4TAq4oo8RwbHngfubmvMUxuDK8VaSep+fFxbDUoWgIgNLmniemAG65jrnZ+u9sqd3Ko0NlqVfMgxMRLGfcYSTY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":693105},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"b6f3834b0f6e622289913bfde70f5a8fa7d7c9e9","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.12_1769609165277_0.9133711832773077","host":"s3://npm-registry-packages-npm-production"}},"0.3.13":{"name":"@yushaw/sanqian-sdk","version":"0.3.13","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.13","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"55037d5c82eb5007f4be803bebf70f92e8550c72","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.13.tgz","fileCount":10,"integrity":"sha512-NstMN8L1Z1bVa4J73rG6XIs/aZdrS2tla1CL1pq7tbcN/NQW1MVjnC2r2f165RmadAeLsMBs7w/MFO1T7HYNHA==","signatures":[{"sig":"MEQCIFcN5ZjQvuAj67qsdRZXw5syrAdYPrItS/KLo8+FH+pVAiAgKOIZTHsnOicVWXGSTYt7HdFxdOdsDxidyOeQCl8uEw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":693959},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"4aa1fbe7f61b07358f39976695511c060a96a107","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.13_1769628137941_0.41843003283964153","host":"s3://npm-registry-packages-npm-production"}},"0.3.14":{"name":"@yushaw/sanqian-sdk","version":"0.3.14","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.14","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"4605c43690d48a1efa1a1bfd605f6447a1bb4163","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.14.tgz","fileCount":10,"integrity":"sha512-xwiIshpDegYLImhwwbdyuKYEfz7VZkLDaG2BzC2NJwvBKldks8LdphicBY3P7c04h0J01HdYC06SgBWHmwE41A==","signatures":[{"sig":"MEQCIG8rerfcsTgcgma5XmFN3tYhxzgv6w4ceaTW/M3FUwqZAiB1wM/jzsP7KoF9Yr2n++udwHESaLYBHs7yviNSWRsz7g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":697283},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"90b2b6e05326344a79d701c4af65e3a1c26d8733","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.14_1770388176657_0.5871119769967565","host":"s3://npm-registry-packages-npm-production"}},"0.3.16":{"name":"@yushaw/sanqian-sdk","version":"0.3.16","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.16","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"567b2f9a72601fed1123c65705c607d0d2192674","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.16.tgz","fileCount":10,"integrity":"sha512-MNKzSFe/Mz6XtYhMKDzIM3dIliQeyVrYYgLXbf4q8dhyW3NmcF9q9m5AD5qDYPVfKrY2qP18fPXUkiX50+AVUg==","signatures":[{"sig":"MEUCIQD+7TWupTSwIw7efTlwUoAg5+QDnAgT1cxbykcaWMpKbAIgf2oc6qr4ess9PUA+O1suTIOq9IGxOJ2AzB8kK1YAO80=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":694509},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"7b139990538711bcb7ecb18854a8e0e342c3568d","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.16_1770489536718_0.10315516608154085","host":"s3://npm-registry-packages-npm-production"}},"0.3.17":{"name":"@yushaw/sanqian-sdk","version":"0.3.17","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.17","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"cb192da8ca838a59d01c3658205997f8b92ab3b0","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.17.tgz","fileCount":11,"integrity":"sha512-v/3OnB0ZxItdm9nfEA7OzQnvatPkUIvZz1ju4zt3sAl0+k9HS7U00i1aVOLt7uwfawd6G3dBGX5BhjwES4ZjvQ==","signatures":[{"sig":"MEQCIG4bniGYskN1NFcLYBbQA4iErLrYUxFSPHXz63GJEm2GAiA5HLXEO8FrU86WRk0ndBWJC/KjqVkAwtHPYo2Q9JxEQA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":749005},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"c4b2b10527265b79620b1d532247cda57853abb2","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.17_1771146554369_0.7875736827894564","host":"s3://npm-registry-packages-npm-production"}},"0.3.18":{"name":"@yushaw/sanqian-sdk","version":"0.3.18","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.18","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"aa30879fe53d4c1dc5711203acb2dc512133dd5e","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.18.tgz","fileCount":14,"integrity":"sha512-MTgw/SwIk3CBB/7xGjYncQSAU7pppYDHXN8MLx4EpguIxJ3SeiBoLAuicb6khW3GDqMHBy8txcZjPowj7ZwChw==","signatures":[{"sig":"MEQCICP/mzrMdQ/ZNcQfuOORnWvEoD0aDrx84vd3bArmdC2JAiBl7tP7KmVJDekz5nt4wIxLO/SnQkjYKJa9VC3Bq+K7Ew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":932937},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"c4b2b10527265b79620b1d532247cda57853abb2","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.18_1771178659270_0.7867498789152818","host":"s3://npm-registry-packages-npm-production"}},"0.3.19":{"name":"@yushaw/sanqian-sdk","version":"0.3.19","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.19","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"9c0b50a19f8056d82b66dd027917dd79b67f3d74","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.19.tgz","fileCount":14,"integrity":"sha512-ITlUs6Kj1KPAK/NKA9cDrcgfgrvF5dch4nRPxBNo9cBOJLP9Sr8DSSyaNQXU3J//IrFIwEpX0h+B/TYengnJ8g==","signatures":[{"sig":"MEUCIQC8r0go1eJlmEa2dna6/OohwYL/5bTEv3qGNRpIqd9zfAIgPF+0PDtRUfDpN240Ry0Iwn0CpBYMUI9iotKAyp35Nr8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":972768},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"c4b2b10527265b79620b1d532247cda57853abb2","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.19_1771181150737_0.0916668174034061","host":"s3://npm-registry-packages-npm-production"}},"0.3.20":{"name":"@yushaw/sanqian-sdk","version":"0.3.20","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.20","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"12e84acde0994a7288d0d6b183ac69e11e75c97b","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.20.tgz","fileCount":14,"integrity":"sha512-DuG8gQiUe/Yn0rEVO8fBCBmF+Iv/dgJv6PO7TDEJ1pcClBtDbGcMFl5wFeeLRhpo0lt1MCAvHKsCIJ61ilMKNQ==","signatures":[{"sig":"MEQCIEOiSTIs+oMeOdLBgoX5+eURmxjExCjpDLDK8HZvmkybAiAasq5pwOx5hWcZRRdRBZVx6wbP8Fv+Z2RFCJGTZnnySA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1102018},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"3641086e576c7aa82ef9aa757a76ab3698ac91f5","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.20_1771352353153_0.25564802643241213","host":"s3://npm-registry-packages-npm-production"}},"0.3.21":{"name":"@yushaw/sanqian-sdk","version":"0.3.21","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.21","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"246202e356e5fad4f6e2ea20304c687a00e5d5c0","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.21.tgz","fileCount":14,"integrity":"sha512-EwgVTTIu6uOwVARJNuk+pq/jRt5fsDeVBl4pn8Gu8tehlN3yxAsGS28nLWeNxlVLJAzzTAVD2TewynegAWJonQ==","signatures":[{"sig":"MEQCIEa2iquu7JYpNdbC7Fdvfe/QET/g6nA/8VOgtYAL2focAiBQVuYKEFAhvmmicwpYh/IhEqONTyuwAeKKZwxA217/3A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1114346},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"0a87f8c00b3dc5ecd92d923c24eb607dd8450193","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.21_1771930538855_0.25248291934927836","host":"s3://npm-registry-packages-npm-production"}},"0.3.23":{"name":"@yushaw/sanqian-sdk","version":"0.3.23","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.23","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"c2c4b6ea398662db8cb6dda3f2ea6861ac99acab","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.23.tgz","fileCount":14,"integrity":"sha512-4WK8elrAZrocDZpvjRa/CQVKTGPzEOxIqHg1R58ubU04UlhGd6SiUTcKT+IGPeNACwQaQMNZa0bTESl77cPR0Q==","signatures":[{"sig":"MEQCIAXRBPoIh1mc4UpDlwSRfde2kGBqSbiHP6MwWyTAfeyQAiB2ig+C/S2BtIQVZBfcj72avtJCxIi0F2b8CLcmcIBQaA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1137676},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"0a87f8c00b3dc5ecd92d923c24eb607dd8450193","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.23_1771933023909_0.9145923256091035","host":"s3://npm-registry-packages-npm-production"}},"0.3.24":{"name":"@yushaw/sanqian-sdk","version":"0.3.24","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.24","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"fe63950ac679ce8ae13bdce7407247b2c4069c28","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.24.tgz","fileCount":14,"integrity":"sha512-b855HmaLe2ClrROmB/kS5VemVV03PaPJczLfK1/rJzqa4s0y5RLmc77Z5dP2D2VVT8nbnb3E6XNe2abT3aShfA==","signatures":[{"sig":"MEYCIQDW8rZqIvTorCZj/AyzWI88K9yQAMOym5OYyZPt9JslvAIhAL6lU59GtdkE8PicNPE0HfpXO5qwandyyQtCMpufehr3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1162446},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"0a87f8c00b3dc5ecd92d923c24eb607dd8450193","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.24_1772089328827_0.6775974965574396","host":"s3://npm-registry-packages-npm-production"}},"0.3.26":{"name":"@yushaw/sanqian-sdk","version":"0.3.26","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.26","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"97f207d6109633475850bb028dd927a7dba5bc3e","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.26.tgz","fileCount":14,"integrity":"sha512-q9jz8iQECjLbHCs+ChCj2/jsPmsJTj4MigWxB5Gln42qUg5+OQddfM/PqjpJ7AeFV9vvbF+7vIoaumAB5V7b9Q==","signatures":[{"sig":"MEYCIQDK9Kp972VVQHEhxzKeJOprdeTWeVksffhTUwhYJQZCuQIhAP5PLxK8lgt0gBmMCxpjlY2c8ui/yNnmZka1LUj728cX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1149646},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"0645f30b2c27efb84d2464cc937d8da4df28939c","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.26_1772297721500_0.4812910425515937","host":"s3://npm-registry-packages-npm-production"}},"0.3.27":{"name":"@yushaw/sanqian-sdk","version":"0.3.27","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.27","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"7b3203805ab204705cc7aa6569dbf348ecdf0e1f","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.27.tgz","fileCount":14,"integrity":"sha512-sRtm1Meeq3fHqKIIAx1aqsDgqcF5Ykc3+o9BHqaM9iGZqwyyTLZHsAWGwrP4fVlwWfnH85TqaiaB7ZWqlPRq2Q==","signatures":[{"sig":"MEUCIQD8O0oUYfA10m0IubqsOLC8uvGYznCWa92VsxgmWqAGVAIgDzf9K8xWY8q6fWID73t5mp3r8rpxgAa2jLNNo4C2e/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1150986},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"551a9c8fa3f3201d3eec1f2d1aa37dbf9864ccc1","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.27_1772298239872_0.6343112270751727","host":"s3://npm-registry-packages-npm-production"}},"0.3.28":{"name":"@yushaw/sanqian-sdk","version":"0.3.28","keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","_id":"@yushaw/sanqian-sdk@0.3.28","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"dist":{"shasum":"de52754c289ab29a35b7839bc671b1c238ab6f67","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.28.tgz","fileCount":14,"integrity":"sha512-Kj68Ns5zUtzhSKQ63N/1YxNOVZ2ilvtO9OFklod0+gXH0GR3EukSvewfIBV2NtojEfcDNswFUkrWydWoFVI4QA==","signatures":[{"sig":"MEYCIQDrKr46+UcIdINZyrRAnxjuSOJO00F1+mW9e8TWKDPD0gIhAK9edoLRW2d8FPNowvdLsE0Pz4APZuvbhMOguueNNit/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1205415},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"gitHead":"1e34b4dbcffb5e56b2dcbf2b2c7f4aea06056d16","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","prepare":"npm run build","test:e2e":"vitest run integration.test.ts","test:unit":"vitest run --exclude '**/integration.test.ts'","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","test:stream-e2e":"node scripts/stream-e2e.js"},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"_npmVersion":"10.8.2","description":"Sanqian SDK for third-party app integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"ws":"^8.18.0","isomorphic-ws":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.5","@types/ws":"^8.5.13","typescript":"^5.6.3","@types/node":"^22.9.0","@vitest/coverage-v8":"^2.1.9"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sanqian-sdk_0.3.28_1773208958563_0.3589353884751778","host":"s3://npm-registry-packages-npm-production"}},"0.3.29":{"name":"@yushaw/sanqian-sdk","version":"0.3.29","description":"Sanqian SDK for third-party app integration","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./browser":{"types":"./dist/index.browser.d.mts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"}},"scripts":{"build":"tsup","prepare":"npm run build","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","test:unit":"vitest run --exclude '**/integration.test.ts'","test:e2e":"vitest run integration.test.ts","test:stream-e2e":"node scripts/stream-e2e.js","test:hook-roundtrip-smoke":"npm run build --silent && node scripts/hook-roundtrip-smoke.js","test:watch":"vitest","test:coverage":"vitest run --coverage"},"keywords":["sanqian","sdk","ai","agent"],"author":{"name":"yushaw"},"license":"MIT","devDependencies":{"@types/node":"^22.9.0","@types/ws":"^8.5.13","@vitest/coverage-v8":"^2.1.9","tsup":"^8.3.5","typescript":"^5.6.3","vitest":"^2.1.5"},"dependencies":{"isomorphic-ws":"^5.0.0","ws":"^8.18.0"},"peerDependencies":{"electron":">=20.0.0"},"peerDependenciesMeta":{"electron":{"optional":true}},"_id":"@yushaw/sanqian-sdk@0.3.29","gitHead":"5d712951a87bc1319f777c09219ed13924b87325","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-6QP2sCbCC6r21Pyo5gQRfZZ84Kp/m/mmDcEwMX88hqAbIWTEw+CrJiDYVJ+MUjlfwpLr0kz6EgFuYKmUlVG43Q==","shasum":"05559e0f064347362c3849ce71dc0b8666f8bc34","tarball":"https://registry.npmjs.org/@yushaw/sanqian-sdk/-/sanqian-sdk-0.3.29.tgz","fileCount":14,"unpackedSize":1689738,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDVjxehDKKvQ8zMcvZZoUPdn/X2oW9OuXdTIsVsDU4OeAiBlg7X15giyBgwAypRoKYioOZaOJQkDoRjWPyGhyTW9oA=="}]},"_npmUser":{"name":"shawonline","email":"shawonline@gmail.com"},"directories":{},"maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sanqian-sdk_0.3.29_1775803705734_0.5167562079438242"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-09T13:00:13.146Z","modified":"2026-04-10T06:48:26.109Z","0.1.0":"2025-12-09T13:00:13.375Z","0.1.1":"2025-12-09T13:21:45.011Z","0.1.2":"2025-12-09T14:00:53.203Z","0.1.3":"2025-12-09T14:11:51.286Z","0.1.4":"2025-12-09T14:13:32.612Z","0.1.5":"2025-12-09T14:25:02.162Z","0.1.6":"2025-12-09T14:25:46.033Z","0.2.0":"2025-12-09T15:46:19.424Z","0.2.1":"2025-12-09T17:35:01.010Z","0.2.2":"2025-12-09T20:24:50.902Z","0.2.3":"2025-12-09T20:48:19.011Z","0.2.4":"2025-12-09T20:54:03.354Z","0.2.5":"2025-12-11T07:38:05.015Z","0.2.6":"2025-12-11T08:07:56.535Z","0.2.7":"2025-12-12T02:38:39.267Z","0.2.8":"2025-12-12T03:36:46.956Z","0.2.9":"2025-12-19T12:17:55.314Z","0.2.10":"2025-12-20T04:44:10.123Z","0.2.11":"2025-12-20T05:06:59.733Z","0.2.12":"2025-12-20T09:28:41.292Z","0.2.13":"2025-12-20T10:05:52.429Z","0.2.14":"2025-12-26T16:21:19.040Z","0.2.15":"2025-12-26T17:16:29.733Z","0.2.16":"2025-12-29T23:55:23.073Z","0.3.0":"2026-01-03T12:18:20.323Z","0.3.1":"2026-01-03T17:17:03.034Z","0.3.2":"2026-01-05T02:54:15.117Z","0.3.3":"2026-01-06T10:56:44.441Z","0.3.4":"2026-01-06T11:57:42.677Z","0.3.5":"2026-01-06T17:34:55.415Z","0.3.6":"2026-01-09T17:52:45.526Z","0.3.7":"2026-01-10T20:21:42.641Z","0.3.8":"2026-01-13T09:57:15.188Z","0.3.9":"2026-01-15T18:32:37.689Z","0.3.10":"2026-01-24T13:22:02.643Z","0.3.11":"2026-01-25T16:25:43.180Z","0.3.12":"2026-01-28T14:06:05.454Z","0.3.13":"2026-01-28T19:22:18.127Z","0.3.14":"2026-02-06T14:29:36.829Z","0.3.16":"2026-02-07T18:38:56.922Z","0.3.17":"2026-02-15T09:09:14.581Z","0.3.18":"2026-02-15T18:04:19.498Z","0.3.19":"2026-02-15T18:45:50.908Z","0.3.20":"2026-02-17T18:19:13.379Z","0.3.21":"2026-02-24T10:55:39.085Z","0.3.23":"2026-02-24T11:37:04.063Z","0.3.24":"2026-02-26T07:02:09.064Z","0.3.26":"2026-02-28T16:55:21.691Z","0.3.27":"2026-02-28T17:04:00.082Z","0.3.28":"2026-03-11T06:02:38.724Z","0.3.29":"2026-04-10T06:48:25.957Z"},"author":{"name":"yushaw"},"license":"MIT","keywords":["sanqian","sdk","ai","agent"],"description":"Sanqian SDK for third-party app integration","maintainers":[{"name":"shawonline","email":"shawonline@gmail.com"}],"readme":"# Sanqian Developer Guide / 三千开发者指南\n\n[English](#english) | [中文](#中文)\n\n---\n\n<a name=\"english\"></a>\n\n# English\n\nSanqian provides two ways to integrate with external applications:\n\n| Method | Use Case | Protocol |\n|--------|----------|----------|\n| **HTTP API** | Simple chat, any language | REST + SSE |\n| **SDK** | Tool registration, agents, context injection, deep integration | WebSocket |\n\n> Documentation baseline: `@yushaw/sanqian-sdk@0.3.28`\n\n## Quick Start\n\n### HTTP API\n\n```bash\n# Get port (Sanqian writes it on startup)\nPORT=$(cat ~/.sanqian/runtime/api.port)\n\n# Chat with default agent\ncurl -X POST \"http://localhost:$PORT/api/agents/default/chat\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}], \"stream\": false}'\n```\n\n### SDK\n\n```bash\nnpm install @yushaw/sanqian-sdk\n```\n\n```typescript\nimport { SanqianSDK } from '@yushaw/sanqian-sdk'\n\nconst sdk = new SanqianSDK({\n  appName: 'my-app',\n  appVersion: '1.0.0',\n  tools: [{\n    name: 'greet',\n    description: 'Greet a user',\n    parameters: {\n      type: 'object',\n      properties: { name: { type: 'string' } },\n      required: ['name']\n    },\n    handler: async ({ name }) => `Hello, ${name}!`\n  }]\n})\n\n// SDK auto-connects when Sanqian starts (via connection.json file watching).\n// If Sanqian is already running, it connects immediately.\n// If autoLaunchSanqian is true (default), it launches Sanqian if not running.\n```\n\n---\n\n## Recommended Reading Paths\n\n- Tool integration first-time setup: `Tools` -> `Connection` -> `Browser Build` (if needed)\n- Custom agent workflows: `Agents` -> `Chat` -> `Conversations`\n- Guardrail/intervention flows: `Hooks` -> `Human-in-the-Loop` -> `Security Levels`\n- Channel/chatbot integrations: `Messaging Channels API` -> `Capability Discovery`\n\n---\n\n## Tools\n\nTools are the primary way your app provides capabilities to Sanqian. When a user asks a question, the AI agent can call your tools to get data or perform actions.\n\n### Define Tools\n\nEach tool needs a name, description (for the LLM), JSON Schema parameters, and a handler function.\n\n```typescript\nconst sdk = new SanqianSDK({\n  appName: 'my-notes-app',\n  appVersion: '1.0.0',\n  tools: [\n    {\n      name: 'search_notes',\n      description: 'Search through user notes by keyword',\n      parameters: {\n        type: 'object',\n        properties: {\n          query: { type: 'string', description: 'Search keyword' },\n          limit: { type: 'number', description: 'Max results', default: 10 }\n        },\n        required: ['query']\n      },\n      handler: async ({ query, limit }) => {\n        const results = await db.searchNotes(query, limit)\n        return results.map(n => ({ title: n.title, snippet: n.snippet }))\n      }\n    },\n    {\n      name: 'create_note',\n      description: 'Create a new note',\n      parameters: {\n        type: 'object',\n        properties: {\n          title: { type: 'string' },\n          content: { type: 'string' }\n        },\n        required: ['title', 'content']\n      },\n      handler: async ({ title, content }) => {\n        const note = await db.createNote(title, content)\n        return { id: note.id, title: note.title }\n      }\n    }\n  ]\n})\n```\n\nTool names are automatically prefixed with your app name. `search_notes` becomes `my-notes-app:search_notes` in Sanqian.\n\n### Update Tools at Runtime\n\nYou can add, remove, or modify tools after initialization:\n\n```typescript\nawait sdk.updateTools([\n  { name: 'search_notes', /* updated definition */ handler: newHandler },\n  { name: 'new_tool', /* ... */ handler: newToolHandler }\n])\n```\n\nThis replaces the entire tool list. The change takes effect immediately for new agent runs.\n\n### Tool Searchability\n\nBy default, tools are discoverable via Sanqian's `search_capability` tool (used by agents to find relevant tools). Set `searchable: false` to hide a tool from search while keeping it available:\n\n```typescript\n{\n  name: 'internal_sync',\n  description: 'Internal data sync',\n  searchable: false,  // Available but not discoverable via search\n  parameters: { type: 'object' },\n  handler: async () => { /* ... */ }\n}\n```\n\n---\n\n## Agents\n\nPrivate agents are custom AI personas with specific tools, skills, and instructions. They appear in Sanqian's agent picker.\n\n### Create an Agent\n\n```typescript\nconst agent = await sdk.createAgent({\n  agent_id: 'notes-assistant',\n  name: 'Notes Assistant',\n  description: 'Helps manage and search notes',\n  system_prompt: 'You are a notes assistant. Help users organize their notes.',\n  tools: ['search_notes', 'create_note'],  // Your SDK tools (auto-prefixed)\n  skills: ['web-research'],                 // Sanqian built-in skills\n  subagents: ['*'],                         // Can delegate to any agent\n  searchable: true,                         // Discoverable by other agents\n})\n\nconsole.log(agent.agent_id) // \"my-notes-app:notes-assistant\"\n```\n\n### Tool Name Formats\n\nThe `tools` array in agent config supports multiple formats:\n\n| Format | Example | Description |\n|--------|---------|-------------|\n| Short name | `\"search_notes\"` | Your SDK tool (auto-prefixed with app name) |\n| Full SDK name | `\"other-app:tool_name\"` | Another SDK app's tool |\n| Built-in | `\"read_file\"`, `\"run_bash_command\"` | Sanqian built-in tools |\n| MCP | `\"mcp_servername_toolname\"` | MCP server tools |\n| Wildcard | `[\"*\"]` | All available tools |\n\n### Sub-agents\n\nControl whether your agent can delegate tasks to other agents:\n\n```typescript\n{\n  subagents: undefined,          // Cannot use task tool (default)\n  subagents: [],                 // Cannot use task tool (explicit)\n  subagents: ['*'],              // Can call any agent\n  subagents: ['agent1', 'agent2'] // Can only call specific agents\n}\n```\n\n### Update and Delete\n\n```typescript\n// Update specific fields (others unchanged)\nawait sdk.updateAgent('notes-assistant', {\n  system_prompt: 'Updated instructions...',\n  tools: ['search_notes', 'create_note', 'delete_note']\n})\n\n// Delete\nawait sdk.deleteAgent('notes-assistant')\n\n// List your agents\nconst agents = await sdk.listAgents()\n```\n\n---\n\n## Chat\n\nSend messages to any agent and get responses. Supports both streaming and non-streaming modes.\n\n### Non-streaming\n\n```typescript\nconst response = await sdk.chat('notes-assistant', [\n  { role: 'user', content: 'Find my notes about TypeScript' }\n])\n\nconsole.log(response.message.content)\nconsole.log(response.conversationId)  // Empty string if stateless\n```\n\n### Streaming\n\n```typescript\nfor await (const event of sdk.chatStream('notes-assistant', [\n  { role: 'user', content: 'Summarize my recent notes' }\n])) {\n  switch (event.type) {\n    case 'start':\n      // Stream started, event.run_id available\n      break\n    case 'text':\n      process.stdout.write(event.content || '')\n      break\n    case 'thinking':\n      // Reasoning content (DeepSeek R1, o3, etc.)\n      break\n    case 'tool_call':\n      console.log(`Calling: ${event.tool_call?.function.name}`)\n      break\n    case 'tool_args_chunk':\n      // Streaming tool arguments (partial JSON)\n      break\n    case 'tool_result':\n      console.log(`Result: ${event.success ? 'ok' : event.error}`)\n      break\n    case 'done':\n      console.log(`\\nConversation: ${event.conversationId}`)\n      break\n    case 'error':\n      console.error(event.error)\n      break\n  }\n}\n```\n\n### Stream Events\n\n| Event | Fields | Description |\n|-------|--------|-------------|\n| `start` | `run_id`, `conversationId` | Stream started |\n| `text` | `content` | Text chunk from the AI |\n| `thinking` | `content` | Reasoning content (thinking models) |\n| `tool_call` | `tool_call` | Tool invocation started |\n| `tool_args_chunk` | `tool_call_id`, `tool_name`, `chunk` | Streaming tool arguments |\n| `tool_args` | `tool_call_id`, `tool_name`, `args` | Complete tool arguments |\n| `tool_result` | `tool_call_id`, `result`, `success`, `error` | Tool execution result |\n| `interrupt` | `interrupt_type`, `interrupt_payload`, `run_id` | HITL pause (see below) |\n| `done` | `conversationId`, `title` | Stream finished |\n| `error` | `error` | Error occurred |\n| `cancelled` | `run_id` | Run was cancelled |\n\n### Stateful vs Stateless\n\n```typescript\n// Stateless: you manage message history\nconst r1 = await sdk.chat('agent', messages)\n// r1.conversationId is empty string\n\n// Stateful: server manages history\nconst r1 = await sdk.chat('agent', messages, {\n  persistHistory: true  // Creates a server-side conversation\n})\n// r1.conversationId is set, use it for follow-ups\n\nconst r2 = await sdk.chat('agent', [{ role: 'user', content: 'Follow up' }], {\n  conversationId: r1.conversationId\n})\n```\n\n### Conversation Helper\n\nFor multi-turn conversations, use the `Conversation` helper:\n\n```typescript\nconst conv = sdk.startConversation('notes-assistant')\n\nconst r1 = await conv.send('Find my TypeScript notes')\nconsole.log(r1.message.content)\n\nconst r2 = await conv.send('Summarize the first one')\nconsole.log(conv.id)  // Conversation ID (available after first send)\n\n// Streaming\nfor await (const event of conv.sendStream('Any more details?')) {\n  if (event.type === 'text') process.stdout.write(event.content || '')\n}\n\n// Get history\nconst details = await conv.getDetails({ messageLimit: 50 })\n\n// Delete\nawait conv.delete()\n```\n\n### Cancel a Run\n\n```typescript\nlet runId: string | undefined\n\nfor await (const event of sdk.chatStream('agent', messages)) {\n  if (event.type === 'start') {\n    runId = event.run_id\n  }\n  if (shouldCancel) {\n    sdk.cancelRun(runId!)\n    break\n  }\n}\n```\n\n### Auto-discovery\n\nEnable automatic discovery of skills, tools, or sub-agents for a chat call:\n\n```typescript\nconst response = await sdk.chat('agent', messages, {\n  autoDiscoverSkills: true,   // Agent can find and use skills\n  autoDiscoverTools: true,    // Agent can find and use tools\n  autoDiscoverSubagents: true // Agent can delegate to other agents\n})\n```\n\n### Local file ingest\n\nFor same-machine deployments where the Sanqian backend can read a local path directly, use `uploadFile()` first, then pass the returned `file.path` into `chat()`:\n\n```typescript\nconst uploaded = await sdk.uploadFile('/absolute/path/report.pdf', {\n  conversationId,\n  autoIndex: true,\n  asyncProcess: true,\n})\n\nconst response = await sdk.chat('agent', messages, {\n  conversationId: uploaded.conversationId,\n  filePaths: [uploaded.file.path],\n})\n```\n\n`uploadFile(localPath)` is not a remote file transfer protocol. For remote/backend-on-another-machine cases, continue using explicit byte upload APIs.\n\nConversation targeting contract:\n- If `conversationId` is omitted, backend may create a new SDK conversation and return it in `uploaded.conversationId`.\n- If `conversationId` is provided but does not exist, `uploadFile()` throws `SanqianSDKError` with code `CONVERSATION_NOT_FOUND`.\n\n---\n\n## Human-in-the-Loop (HITL)\n\nHITL allows the agent to pause and ask for user input during a run. There are three interrupt types:\n\n| Type | Use Case | Example |\n|------|----------|---------|\n| `approval_request` | Pre-execution approval | \"Delete file X?\" -> Approve/Reject |\n| `user_input_request` | Ask for user input | \"What format?\" -> [\"JSON\", \"CSV\"] or free text |\n| `user_action_request` | User completes external action | \"Login required\" -> User logs in -> \"Done\" |\n\n### Handling Interrupts\n\n```typescript\nfor await (const event of sdk.chatStream('agent', messages)) {\n  if (event.type === 'interrupt') {\n    const { interrupt_type, interrupt_payload, run_id } = event\n\n    if (interrupt_type === 'approval_request') {\n      const approved = await showApprovalDialog(interrupt_payload)\n      sdk.sendHitlResponse(run_id!, { approved })\n    }\n\n    if (interrupt_type === 'user_input_request') {\n      const answer = await showInputDialog(interrupt_payload)\n      sdk.sendHitlResponse(run_id!, { answer })\n    }\n\n    if (interrupt_type === 'user_action_request') {\n      await waitForUserAction(interrupt_payload)\n      sdk.sendHitlResponse(run_id!, { approved: true })\n    }\n  }\n}\n```\n\n### HITL Response Options\n\n```typescript\nsdk.sendHitlResponse(runId, {\n  approved: true,           // For approval_request\n  remember: true,           // Remember this choice for future\n  answer: 'JSON',           // For user_input_request (text)\n  selected_indices: [0, 2], // For multi-select options\n  cancelled: true,          // User cancelled\n  timed_out: true,          // Request timed out\n})\n```\n\n---\n\n## Conversations\n\nManage conversation history stored on the server.\n\n```typescript\n// List conversations (optionally filter by agent)\nconst { conversations, total } = await sdk.listConversations({\n  agentId: 'notes-assistant',\n  limit: 20,\n  offset: 0\n})\n\n// Get conversation with messages\nconst detail = await sdk.getConversation(conversationId, {\n  includeMessages: true,\n  messageLimit: 50,\n  messageOffset: 0\n})\n\n// Get message history (via HTTP API, aligned with main app)\nconst history = await sdk.getMessages(conversationId, {\n  limit: 50,\n  offset: 0\n})\n// Returns: { messages, has_more, session_id, returned_turns }\n\n// Delete a conversation\nawait sdk.deleteConversation(conversationId)\n```\n\n---\n\n## Context Providers\n\nContext providers let your app inject dynamic state into conversations. When the user (or agent) attaches a context, Sanqian calls your provider to fetch the latest data.\n\nThree provider methods, all optional:\n\n| Method | Purpose | When Called |\n|--------|---------|------------|\n| `getCurrent()` | Get current state | User sends message with context attached |\n| `getList(options)` | List available resources | User opens \"+\" menu to browse |\n| `getById(id)` | Get specific resource | User selects item from list |\n\n### Register Context Providers\n\n```typescript\nconst sdk = new SanqianSDK({\n  appName: 'my-notes-app',\n  appVersion: '1.0.0',\n  tools: [/* ... */],\n  contexts: [\n    {\n      id: 'active-note',\n      name: 'Active Note',\n      description: 'The note currently being edited',\n      getCurrent: async () => ({\n        content: editor.getCurrentNote().content,\n        title: editor.getCurrentNote().title,\n        type: 'note',\n      }),\n    },\n    {\n      id: 'notes',\n      name: 'Notes Library',\n      description: 'Browse and attach notes',\n      getList: async (options) => {\n        const notes = await db.searchNotes(options?.query || '', {\n          offset: options?.offset || 0,\n          limit: options?.limit || 20,\n        })\n        return {\n          items: notes.map(n => ({\n            id: n.id,\n            title: n.title,\n            summary: n.snippet,\n            type: 'note',\n            group: n.folder,\n          })),\n          hasMore: notes.length === (options?.limit || 20),\n        }\n      },\n      getById: async (id) => {\n        const note = await db.getNote(id)\n        if (!note) return null\n        return {\n          id: note.id,\n          content: note.content,\n          title: note.title,\n          type: 'note',\n        }\n      },\n    }\n  ]\n})\n```\n\n### Attach Contexts to Agents\n\nAuto-attach context providers to an agent so they're always included:\n\n```typescript\nawait sdk.createAgent({\n  agent_id: 'notes-assistant',\n  name: 'Notes Assistant',\n  tools: ['search_notes'],\n  attached_contexts: ['active-note'],  // Auto-prefixed with app name\n})\n```\n\n### Update Contexts at Runtime\n\n```typescript\nawait sdk.updateContexts([\n  { id: 'active-note', name: 'Active Note', description: '...', getCurrent: newHandler },\n  { id: 'new-context', name: 'New Context', description: '...', getList: listHandler },\n])\n```\n\n### Context Data Format\n\nThe `ContextData` object returned by providers:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `content` | Yes | Content injected into conversation |\n| `id` | No | Resource ID (for `getById` scenario) |\n| `title` | No | Display title |\n| `summary` | No | UI preview text |\n| `version` | No | Change detection (defaults to content hash) |\n| `type` | No | Resource type for display styling |\n| `metadata` | No | Extra data accessible in templates |\n| `template` | No | Custom Mustache template: `\"# {{title}}\\n\\n{{content}}\"` |\n\n---\n\n## Session Resources\n\nSession resources are temporary context your app pushes to Sanqian. Unlike context providers (pull-based), session resources are push-based: your app decides when to send data.\n\nThey're visible in all Chat UI instances and persist until your app disconnects or removes them.\n\n```typescript\n// Push a resource\nconst stored = await sdk.pushResource({\n  title: 'Current Note',\n  content: '<note>\\n# My Note\\nContent here...\\n</note>',\n  summary: 'My Note - 2024-01-15',\n  icon: '📝',\n  type: 'note',\n})\nconsole.log(stored.fullId) // \"my-notes-app:abc123\"\n\n// Remove a specific resource\nawait sdk.removeResource('my-notes-app:abc123')\n\n// Clear all your app's resources\nawait sdk.clearResources()\n\n// Get local cache (no server round-trip)\nconst resources = sdk.getSessionResources()\n\n// Fetch from server (optionally filtered by agent)\nconst serverResources = await sdk.fetchSessionResources('notes-assistant')\n```\n\n### Attach Session Resources to Chat\n\n```typescript\nfor await (const event of sdk.chatStream('agent', messages, {\n  sessionResources: ['my-notes-app:abc123'],  // Include specific resources\n})) {\n  // ...\n}\n```\n\n### Listen for Removal\n\nWhen a user removes a session resource from the Chat UI:\n\n```typescript\nsdk.on('resourceRemoved', (resourceId) => {\n  console.log(`User removed: ${resourceId}`)\n})\n```\n\n---\n\n## Hooks (Available)\n\n> **Status**: Remote hooks are available in the SDK.\n> **Compatibility**: Hook callbacks require a Sanqian backend that supports `register_hook` / `hook_invoke`. On older backends, hook registration may return ack errors and callbacks will not be invoked.\n\nRegister hooks to observe or intervene in agent execution. Unlike tools (which the agent calls) and context providers (which inject data), hooks intercept the agent's internal lifecycle -- including prompt ingress, sub-agent lifecycle, model/tool boundaries, and finalization.\n\n### Hook Points\n\n| Hook Point | Type | Description |\n|-----------|------|-------------|\n| `on_user_prompt_submit` | Intervention | User message ingress (can block or rewrite prompt) |\n| `on_stop_failure` | Observation | Run failure classification callback |\n| `on_subagent_start` | Intervention | Before sub-agent starts (can rewrite payload / block) |\n| `on_subagent_stop` | Observation | Sub-agent completion callback |\n| `on_run_start` | Observation | Agent run begins |\n| `on_run_end` | Observation | Agent run ends (success/error) |\n| `on_loop` | Intervention | Each planner loop iteration |\n| `before_model` | Intervention | Before LLM call (can modify prompt) |\n| `after_model` | Intervention | After LLM call (can modify response) |\n| `before_tool` | Intervention | Before tool execution (can block/modify args) |\n| `after_tool` | Intervention | After tool execution (can modify result) |\n| `before_compress` | Intervention | Before context compression |\n| `before_finalize` | Intervention | Before final response is persisted |\n\n### Register Hooks\n\n```typescript\nconst sdk = new SanqianSDK({\n  appName: 'my-guardrail',\n  requestedSecurityLevel: 'elevated', // required for before_tool/after_model/before_finalize\n})\n\n// Observe all tool calls (no intervention)\nsdk.registerHook({\n  hookPoints: ['after_tool'],\n  priority: 90,\n}, async (ctx, payload) => {\n  console.log(`Tool ${payload.tool_name}: ${payload.result_status}`)\n  return null // no intervention\n})\n\n// Block dangerous tools\nconst hookId = sdk.registerHook({\n  hookPoints: ['before_tool'],\n  matcher: {\n    tool_names: ['delete_file', 'run_bash_command'],\n    args_pattern: { command: 'rm *' }, // optional glob matching on payload fields\n  },\n  priority: 10,\n  failPolicy: 'closed', // if hook is unreachable, block the tool\n}, async (ctx, payload) => {\n  if (isDangerous(payload.tool_args)) {\n    return { decision: 'deny', reason: 'Blocked by safety check' }\n  }\n  return null // allow\n})\n\n// Modify tool args (e.g., inject API key)\nsdk.registerHook({\n  hookPoints: ['before_tool'],\n  matcher: { tool_names: ['web_search'] },\n  priority: 40,\n}, async (ctx, payload) => {\n  return {\n    value: { ...payload.tool_args, api_key: process.env.SEARCH_KEY },\n  }\n})\n\nawait sdk.connect()\n\n// Unregister at runtime\nawait sdk.unregisterHook(hookId)\n```\n\nNotes:\n- `registerHook()` returns `hookId` immediately and stores registration locally.\n- If already connected, SDK sends `register_hook` asynchronously; transport/ack failures are reported as SDK warnings (non-throwing).\n- For deterministic startup behavior, register hooks before the first `connect()` so declarations are included in initial app registration.\n- `unregisterHook()` is async; use `await` when you need unregister completion before continuing.\n- `unregisterHookAndWait()` waits for `unregister_hook_ack`, throws on nack/timeout, and restores local hook state on failure.\n- `getRegisteredHooks()` returns a defensive snapshot of local hook registrations for diagnostics/audit UIs.\n- `getHookExecutionStats()` returns aggregated runtime hook execution metrics (invocation/success/failure/latency/last error).\n\nDeterministic runtime registration:\n\n```typescript\nconst hookId = await sdk.registerHookAndWait({\n  hookPoints: ['before_tool'],\n  failPolicy: 'closed',\n}, async () => null)\n\nawait sdk.unregisterHookAndWait(hookId)\n```\n\n- `registerHookAndWait()` waits for `register_hook_ack`.\n- On nack/timeout, it throws and rolls back local registration state.\n- Use this when your app must fail fast on policy wiring errors.\n- `unregisterHookAndWait()` provides the same deterministic behavior for hook teardown.\n\n```typescript\nconsole.table(sdk.getRegisteredHooks().map((item) => ({\n  hookId: item.hookId,\n  hookPoints: item.registration.hookPoints.join(\",\"),\n  failPolicy: item.registration.failPolicy || \"open\",\n})))\n\nconsole.table(sdk.getHookExecutionStats().map((item) => ({\n  hookId: item.hookId,\n  invocations: item.invocationCount,\n  success: item.successCount,\n  failure: item.failureCount,\n  avgMs: Number(item.averageDurationMs.toFixed(2)),\n  lastError: item.lastError || \"\",\n})))\n```\n\nTyped single-point registration helper:\n\n```typescript\nsdk.registerHookForPoint('before_tool', {\n  matcher: { tool_names: ['run_bash_command'] },\n}, async (_ctx, payload) => {\n  // payload is strongly typed for before_tool\n  return { metadata: { tool: payload.tool_name } }\n})\n\nawait sdk.registerHookForPointAndWait('before_tool', {\n  failPolicy: 'closed',\n}, async (_ctx, payload) => {\n  return { decision: payload.tool_name === 'delete_file' ? 'ask' : 'passthrough' }\n})\n```\n\n`payloadValidation` option for typed helpers:\n- `strict` (default): schema mismatch causes hook invocation failure.\n- `warn`: emits SDK `error` event but still calls your handler.\n- `off`: disables runtime schema checks.\n\nHook roundtrip smoke script:\n\n```bash\nnpm --prefix packages/sdk run test:hook-roundtrip-smoke\n```\n\nThis script starts a local mock WS backend and verifies all 13 hook points, strict typed payload validation failure path, deterministic unregister (`unregisterHookAndWait`) success/rollback paths, and `hookLifecycle` event emission.\n\n### Hook Actions\n\nHook handlers return `null` (no intervention) or a `HookResult`:\n\n```typescript\ninterface HookResult {\n  skip?: boolean        // Block the operation (e.g., prevent tool execution)\n  value?: unknown       // Replace the value (e.g., modified args or response)\n  suspend?: boolean     // Pause agent, wait for human confirmation\n  suspend_payload?: unknown // Data shown in the HITL confirmation UI\n  metadata?: Record<string, unknown>\n  decision?: 'deny' | 'ask' | 'passthrough' // Structured policy decision\n  reason?: string      // Human-readable reason for deny/ask\n}\n```\n\nDecision precedence on backend aggregation: `deny > ask > passthrough`.\n\n### Suspend (Human-in-the-Loop)\n\nHooks can pause the agent and wait for external confirmation:\n\n```typescript\nsdk.registerHook({\n  hookPoints: ['before_tool'],\n  matcher: { tool_names: ['send_email'] },\n  priority: 10,\n}, async (ctx, payload) => {\n  // After human confirms, the hook replays with ctx.resume_value\n  if (ctx.resume_value) {\n    return ctx.resume_value.approved ? null : { skip: true }\n  }\n  // First trigger: suspend and show confirmation UI\n  return {\n    suspend: true,\n    suspend_payload: {\n      question: `Allow sending email to ${payload.tool_args.to}?`,\n      preview: JSON.stringify(payload.tool_args).substring(0, 500),\n    },\n  }\n})\n```\n\n### Security Levels\n\nHook points require minimum security levels:\n\n| Level | Hook Points |\n|-------|-------------|\n| `standard` | on_user_prompt_submit, on_stop_failure, on_subagent_start, on_subagent_stop, on_run_start, on_run_end, on_loop, after_tool, before_compress |\n| `elevated` | before_tool, after_model, before_finalize |\n| `unrestricted` | before_model |\n\nSet `requestedSecurityLevel` in SDKConfig to match the hook points you need.\n\n### Reliability\n\n- **Fail policy**: `\"open\"` (default) -- hook timeout/error does not block agent. `\"closed\"` -- hook failure blocks the operation (use for safety-critical hooks).\n- **Timeout**: Differentiated by hook point (tool: 10s, model: 30s, observation: 5s). Override per-hook with `timeout` in registration.\n- **Circuit breaker**: After 5 consecutive failures, the hook is temporarily bypassed (60s recovery).\n\n### Hook Observability Events\n\n```typescript\nsdk.on('hookInvoked', (event) => {\n  console.log(event.hookPoint, event.callId, event.payload)\n})\n\nsdk.on('hookResult', (event) => {\n  console.log(event.hookPoint, event.success, event.durationMs, event.error)\n})\n\nsdk.on('hookLifecycle', (event) => {\n  console.log(\n    event.action,\n    event.hookId,\n    event.success,\n    event.deterministic,\n    event.durationMs,\n    event.error\n  )\n})\n```\n\n---\n\n## Capability Discovery\n\nQuery Sanqian's full capability registry: tools, skills, agents, and context providers.\n\n```typescript\n// List all tools\nconst tools = await sdk.listTools()\n\n// List by source\nconst builtinTools = await sdk.listTools('builtin')\nconst sdkTools = await sdk.listTools('sdk')\nconst mcpTools = await sdk.listTools('mcp')\n\n// List skills\nconst skills = await sdk.listSkills()\n\n// List all available agents (not just your own)\nconst agents = await sdk.listAvailableAgents()\n\n// Generic listing with filters\nconst caps = await sdk.listCapabilities({\n  type: 'tool',        // 'tool' | 'skill' | 'agent' | 'context' | 'all'\n  source: 'builtin',   // Filter by source\n  category: 'file',    // Filter by category (tools only)\n})\n\n// Semantic search (BM25 + Vector hybrid)\nconst results = await sdk.searchCapabilities('file operations', {\n  type: 'tool',\n  limit: 5,\n})\nfor (const r of results) {\n  console.log(`${r.capability.id}: score=${r.score}`)\n  console.log(`  How to use: ${r.howToUse}`)\n}\n```\n\n---\n\n## Embedding & Rerank Config\n\nReuse the embedding and rerank models configured in Sanqian. Useful for apps that need vector search or document ranking without managing their own API keys.\n\n```typescript\n// Embedding\nconst embedding = await sdk.getEmbeddingConfig()\nif (embedding.available) {\n  // Use embedding.apiUrl, embedding.apiKey, embedding.modelName, embedding.dimensions\n}\n\n// Rerank\nconst rerank = await sdk.getRerankConfig()\nif (rerank.available) {\n  // Use rerank.apiUrl, rerank.apiKey, rerank.modelName\n}\n```\n\n---\n\n## Messaging Channels API\n\nChannels methods in the SDK use Sanqian HTTP endpoints with `X-App-Token` auth. They only require runtime connection info and do not require WebSocket registration to be completed first.\n\n```typescript\n// Useful when building URLs for local HTTP integrations\nconst baseUrl = sdk.getBaseUrl() // e.g. http://127.0.0.1:8765\n\n// Fetch config schema for setup forms\nconst schema = await sdk.getChannelConfigSchema('telegram')\n\n// Validate/probe config before creating an account\nconst probe = await sdk.probeChannelConfig({\n  channel_type: 'telegram',\n  config: { bot_token: process.env.TELEGRAM_BOT_TOKEN }\n})\nif (!probe.ok) {\n  console.error(probe.error)\n}\n```\n\nThis section only shows the newly added methods. Full account/binding/message operations are available via `listChannelAccounts`, `createChannelAccount`, `listChannelBindings`, `sendChannelMessage`, and related methods.\n\n---\n\n## Connection\n\n### Connection Lifecycle\n\nThe SDK manages connection automatically:\n\n1. **Constructor**: Reads `~/.sanqian/runtime/connection.json` and watches for changes\n2. **Auto-connect**: When connection.json appears (Sanqian starts), SDK connects automatically\n3. **Auto-launch**: If `autoLaunchSanqian: true` (default), SDK starts Sanqian if not running\n4. **Registration**: After WebSocket connects, SDK registers app name, tools, and context providers\n5. **Heartbeat**: 30-second interval to detect dead connections\n6. **Auto-reconnect**: Exponential backoff (500ms to 5s) with jitter when connection drops\n\n```\nconnection.json appears -> WebSocket connect -> Register -> Heartbeat\n        ^                                                      |\n        |                  Reconnect (backoff)                 v\n        +<------------------  Disconnect  <-------- Heartbeat timeout\n```\n\n### Reconnect Control\n\nAuto-reconnect is reference-counted. Enable it when your UI needs a persistent connection:\n\n```typescript\n// Chat panel opens - request persistent connection\nsdk.acquireReconnect()\n\n// Chat panel closes - release\nsdk.releaseReconnect()\n\n// When refCount reaches 0, auto-reconnect stops\n```\n\n### Connection State\n\n```typescript\nconst state = sdk.getState()\n// { connected: boolean, registering: boolean, registered: boolean,\n//   lastError?: Error, reconnectAttempts: number }\n\nsdk.isConnected() // true when connected AND registered\n```\n\n### Events\n\n```typescript\nsdk.on('connected', () => { /* WebSocket opened */ })\nsdk.on('disconnected', (reason) => { /* Connection lost */ })\nsdk.on('registered', () => { /* Tools and contexts registered */ })\nsdk.on('error', (error) => { /* Connection error */ })\nsdk.on('tool_call', ({ name, arguments }) => { /* Tool invoked (for logging) */ })\nsdk.on('resourcePushed', (resource) => { /* Session resource pushed */ })\nsdk.on('resourceRemoved', (resourceId) => { /* Session resource removed by user */ })\nsdk.on('resourcesCleared', (appName) => { /* All resources cleared */ })\n\n// One-time listener\nsdk.once('registered', () => { /* ... */ })\n\n// Remove listeners\nsdk.off('connected', handler)\nsdk.removeAllListeners()        // All events\nsdk.removeAllListeners('error') // Specific event\n```\n\n### Manual Connection\n\n```typescript\n// Connect (usually not needed - SDK auto-connects)\nawait sdk.connect()\n\n// Disconnect\nawait sdk.disconnect()\n```\n\n### Launched by Sanqian\n\nWhen Sanqian launches your app (via `launchCommand`), it sets `SANQIAN_LAUNCHED=1`. The SDK detects this and connects immediately without auto-reconnect (Sanqian manages the lifecycle).\n\n### SDKConfig Options\n\n```typescript\nconst sdk = new SanqianSDK({\n  // Required\n  appName: 'my-app',\n  appVersion: '1.0.0',\n  tools: [],\n\n  // Display\n  displayName: 'My App',           // Shown in Sanqian UI\n  requestedSecurityLevel: 'standard', // Optional: standard | elevated | unrestricted\n\n  // Launch\n  launchCommand: '/path/to/app',   // For Sanqian to start your app\n  metadata: { browser: 'chrome' }, // App metadata stored with registration\n\n  // Context\n  contexts: [],                    // Context providers (see above)\n\n  // Timeouts\n  reconnectInterval: 5000,         // Reconnect interval (ms, default: 5000)\n  heartbeatInterval: 30000,        // Heartbeat interval (ms, default: 30000)\n  toolExecutionTimeout: 30000,     // Tool timeout (ms, default: 30000)\n  connectionFileReconnectMaxDurationMs: 300000, // File-watch reconnect max duration (ms, default: 5min)\n  connectionFileReconnectJitterMs: 300,         // Extra random delay per retry (ms, default: 300)\n\n  // Auto-launch\n  autoLaunchSanqian: true,         // Launch Sanqian if not running (default: true)\n  sanqianPath: '/path/to/Sanqian', // Custom executable path (optional)\n\n  // Debug\n  debug: false,                    // Console logging (default: false)\n\n  // Register handshake (optional; defaults shown)\n  protocolVersion: '2026-03-29',   // Register protocol version (YYYY-MM-DD)\n  hookCapabilities: {              // Hook capability declarations\n    streamingHook: false,          // Negotiated with backend (most-restrictive-wins)\n  },\n\n  // Browser mode (see Browser Build section)\n  connectionInfo: undefined,       // Pre-configured connection (skips file discovery)\n})\n```\n\n---\n\n## Browser Build\n\nFor browser environments (extensions, web apps, Office Add-ins), use the browser-specific import:\n\n```typescript\nimport { SanqianSDK } from '@yushaw/sanqian-sdk/browser'\n```\n\nThe browser build:\n- Uses native `WebSocket` (no Node.js `ws` dependency)\n- Requires `connectionInfo` in config (no filesystem access for discovery)\n- Does not support `autoLaunchSanqian` or connection.json file watching\n- Supports all other features: tools, agents, chat, context providers, session resources, HITL, capability discovery\n\n```typescript\nimport { SanqianSDK } from '@yushaw/sanqian-sdk/browser'\n\nconst sdk = new SanqianSDK({\n  appName: 'my-extension',\n  appVersion: '1.0.0',\n  connectionInfo: {\n    port: 38765,\n    token: 'your-token',\n    ws_path: '/ws/apps',\n    version: 1,\n    pid: 0,\n    started_at: '',\n  },\n  tools: [/* ... */]\n})\n\nawait sdk.connect()\n```\n\n---\n\n## HTTP API Reference\n\nFor simple integrations without the SDK. Base URL: `http://localhost:{PORT}` (port from `~/.sanqian/runtime/api.port`).\n\n### Chat\n\n```\nPOST /api/agents/{agent_id}/chat\n```\n\n**Request body:**\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `messages` | `ChatMessage[]` | Yes | Messages to send |\n| `stream` | `boolean` | No | Enable SSE streaming (default: true) |\n| `conversation_id` | `string` | No | Continue existing conversation |\n\n**Non-streaming response (`stream: false`):**\n```json\n{\n  \"message\": { \"role\": \"assistant\", \"content\": \"...\" },\n  \"conversation_id\": \"abc123\"\n}\n```\n\n**Streaming response (`stream: true`, SSE):**\n```\ndata: {\"type\": \"text\", \"content\": \"Hello\"}\ndata: {\"type\": \"text\", \"content\": \" world\"}\ndata: {\"type\": \"tool_call\", \"tool_call\": {...}}\ndata: {\"type\": \"tool_result\", \"tool_result\": {...}}\ndata: {\"type\": \"done\", \"conversation_id\": \"abc123\"}\n```\n\n### List Agents\n\n```\nGET /api/agents\n```\n\nReturns all available agents:\n```json\n[\n  { \"id\": \"default\", \"name\": \"Default\", \"description\": \"...\" },\n  { \"id\": \"coding\", \"name\": \"Coding\", \"description\": \"...\" }\n]\n```\n\n### Get Agent\n\n```\nGET /api/agents/{agent_id}\n```\n\n### Examples\n\n**Python:**\n```python\nimport requests, json\n\nport = open('~/.sanqian/runtime/api.port').read().strip()\n\n# Non-streaming\nr = requests.post(f'http://localhost:{port}/api/agents/default/chat', json={\n    'messages': [{'role': 'user', 'content': 'Hello'}],\n    'stream': False,\n})\nprint(r.json()['message']['content'])\n\n# Streaming\nr = requests.post(f'http://localhost:{port}/api/agents/default/chat', json={\n    'messages': [{'role': 'user', 'content': 'Hello'}],\n    'stream': True,\n}, stream=True)\nfor line in r.iter_lines():\n    if line.startswith(b'data: '):\n        event = json.loads(line[6:])\n        if event['type'] == 'text':\n            print(event['content'], end='', flush=True)\n```\n\n**JavaScript (no SDK):**\n```javascript\nconst port = require('fs').readFileSync(\n  require('os').homedir() + '/.sanqian/runtime/api.port', 'utf8'\n).trim()\n\nconst response = await fetch(`http://localhost:${port}/api/agents/default/chat`, {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\n    messages: [{ role: 'user', content: 'Hello' }],\n    stream: false,\n  }),\n})\nconst data = await response.json()\nconsole.log(data.message.content)\n```\n\n---\n\n## Built-in Tools Reference\n\nThese tools are available to all agents. Use tool names in agent config to enable specific ones, or `[\"*\"]` for all.\nThis table is a snapshot. Use `sdk.listTools('builtin')` (or `/api/capabilities`) as runtime source of truth.\n\n### File Operations\n\n| Tool | Description |\n|------|-------------|\n| `read_file` | Read files from workspace |\n| `write_file` | Write files to workspace |\n| `edit_file` | Edit files with precise string replacement |\n| `delete_file` | Delete files from workspace |\n| `list_files` | List files in workspace directory |\n| `find_files` | Find files by name pattern (glob) |\n| `search_file` | Search for content within files |\n| `grep_content` | Cross-file content search with regex |\n\n### Web & Search\n\n| Tool | Description |\n|------|-------------|\n| `web_search` | Search the web (Google Custom Search) |\n| `fetch_web` | Fetch web pages and convert to markdown |\n\n### Execution\n\n| Tool | Description |\n|------|-------------|\n| `run_bash_command` | Execute shell commands in workspace (sandboxed) |\n\n### Memory\n\n| Tool | Description |\n|------|-------------|\n| `search_memory` | Search user memories by semantic similarity |\n| `save_memory` | Save a new memory for the user |\n| `list_memories` | List all user memories with optional filtering |\n\n### Task & Agent\n\n| Tool | Description |\n|------|-------------|\n| `todo_write` | Create and update task list |\n| `task` | Delegate a task to another agent |\n| `search_capability` | Search available tools, skills, and agents |\n| `ask_human` | Ask user for input when additional information is needed |\n\n### Vision & Image\n\n| Tool | Description |\n|------|-------------|\n| `vision_analyze` | Analyze images using vision model |\n| `generate_image` | Generate images from text |\n\n### macOS Apple Integration (macOS only)\n\n| Tool | Description |\n|------|-------------|\n| `calendar_search` / `calendar_create` / `calendar_delete` | Calendar operations |\n| `notes_search` / `notes_create` / `notes_delete` | Notes operations |\n| `reminders_search` / `reminders_create` / `reminders_complete` / `reminders_delete` | Reminders operations |\n| `contacts_search` | Search contacts |\n\n---\n\n## FAQ\n\n**How do I get the agent_id for chat?**\nUse the List Agents API (`GET /api/agents`) or `sdk.listAgents()`. Common built-in IDs: `default`, `coding`.\n\n**When to use HTTP API vs SDK?**\nHTTP API for simple chat from any language. SDK when you need tools, agents, context providers, or session resources.\n\n**Are SDK conversations visible in Sanqian?**\nYes. Conversations created via SDK appear in Sanqian's conversation list.\n\n**What about tool naming conflicts?**\nSDK tools are namespaced: `appName:toolName`. No conflicts between apps.\n\n**Does the agent auto-reconnect after Sanqian restarts?**\nYes. The Node.js SDK watches `connection.json`. When Sanqian restarts and writes a new file, SDK reconnects automatically.\n\n**What happens if Sanqian is not running when my app starts?**\nWith `autoLaunchSanqian: true` (default), SDK launches Sanqian in tray mode. Otherwise, SDK watches for `connection.json` and connects when Sanqian starts later.\n\n## Error Codes\n\n| Code | Description |\n|------|-------------|\n| `400` | Invalid request parameters |\n| `404` | Agent or conversation not found |\n| `429` | Rate limited |\n| `500` | Internal server error |\n\n---\n\n<a name=\"中文\"></a>\n\n# 中文\n\nSanqian 提供两种外部集成方式：\n\n| 方式 | 适用场景 | 协议 |\n|------|----------|------|\n| **HTTP API** | 简单对话，任意语言 | REST + SSE |\n| **SDK** | 工具注册、Agent、上下文注入、深度集成 | WebSocket |\n\n> 文档基线：`@yushaw/sanqian-sdk@0.3.28`\n\n## 快速开始\n\n### HTTP API\n\n```bash\n# 获取端口（Sanqian 启动时写入）\nPORT=$(cat ~/.sanqian/runtime/api.port)\n\n# 与默认 Agent 对话\ncurl -X POST \"http://localhost:$PORT/api/agents/default/chat\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"messages\": [{\"role\": \"user\", \"content\": \"你好\"}], \"stream\": false}'\n```\n\n### SDK\n\n```bash\nnpm install @yushaw/sanqian-sdk\n```\n\n```typescript\nimport { SanqianSDK } from '@yushaw/sanqian-sdk'\n\nconst sdk = new SanqianSDK({\n  appName: 'my-app',\n  appVersion: '1.0.0',\n  tools: [{\n    name: 'greet',\n    description: '向用户打招呼',\n    parameters: {\n      type: 'object',\n      properties: { name: { type: 'string' } },\n      required: ['name']\n    },\n    handler: async ({ name }) => `你好，${name}！`\n  }]\n})\n\n// SDK 会在 Sanqian 启动时自动连接（通过监听 connection.json 文件变化）。\n// 如果 Sanqian 已在运行，则立即连接。\n// 如果 autoLaunchSanqian 为 true（默认），在 Sanqian 未运行时会自动启动它。\n```\n\n---\n\n## 推荐阅读路径\n\n- 第一次做工具集成：`工具 (Tools)` -> `连接` -> `浏览器构建`（如需要）\n- 自定义 Agent 工作流：`Agent` -> `对话 (Chat)` -> `会话管理`\n- 安全干预/护栏：`Hooks` -> `人机协作 (HITL)` -> `安全等级`\n- 渠道机器人接入：`消息渠道 API` -> `能力发现`\n\n---\n\n## 工具 (Tools)\n\n工具是你的应用向 Sanqian 提供能力的主要方式。当用户提问时，AI Agent 可以调用你的工具来获取数据或执行操作。\n\n### 定义工具\n\n每个工具需要名称、描述（给 LLM 看的）、JSON Schema 参数和处理函数。\n\n```typescript\nconst sdk = new SanqianSDK({\n  appName: 'my-notes-app',\n  appVersion: '1.0.0',\n  tools: [\n    {\n      name: 'search_notes',\n      description: '按关键词搜索用户笔记',\n      parameters: {\n        type: 'object',\n        properties: {\n          query: { type: 'string', description: '搜索关键词' },\n          limit: { type: 'number', description: '最大结果数', default: 10 }\n        },\n        required: ['query']\n      },\n      handler: async ({ query, limit }) => {\n        const results = await db.searchNotes(query, limit)\n        return results.map(n => ({ title: n.title, snippet: n.snippet }))\n      }\n    }\n  ]\n})\n```\n\n工具名称会自动加上应用前缀。`search_notes` 在 Sanqian 中变为 `my-notes-app:search_notes`。\n\n### 运行时更新工具\n\n```typescript\nawait sdk.updateTools([\n  { name: 'search_notes', /* 更新后的定义 */ handler: newHandler },\n  { name: 'new_tool', /* ... */ handler: newToolHandler }\n])\n```\n\n这会替换整个工具列表。新的 Agent 运行会立即使用更新后的工具。\n\n### 工具可搜索性\n\n默认情况下，工具可以通过 Sanqian 的 `search_capability` 工具被发现。设置 `searchable: false` 隐藏工具但保持可用：\n\n```typescript\n{\n  name: 'internal_sync',\n  description: '内部数据同步',\n  searchable: false,  // 可用但不可被搜索发现\n  parameters: { type: 'object' },\n  handler: async () => { /* ... */ }\n}\n```\n\n---\n\n## Agent\n\n私有 Agent 是具有特定工具、技能和指令的自定义 AI 角色。它们会出现在 Sanqian 的 Agent 选择器中。\n\n### 创建 Agent\n\n```typescript\nconst agent = await sdk.createAgent({\n  agent_id: 'notes-assistant',\n  name: '笔记助手',\n  description: '帮助管理和搜索笔记',\n  system_prompt: '你是一个笔记助手。帮助用户整理笔记。',\n  tools: ['search_notes', 'create_note'],  // SDK 工具（自动加前缀）\n  skills: ['web-research'],                 // Sanqian 内置技能\n  subagents: ['*'],                         // 可以委派给任何 Agent\n  searchable: true,                         // 可被其他 Agent 发现\n})\n```\n\n### 工具名称格式\n\n| 格式 | 示例 | 说明 |\n|------|------|------|\n| 短名称 | `\"search_notes\"` | 你的 SDK 工具（自动加应用前缀） |\n| 完整 SDK 名称 | `\"other-app:tool_name\"` | 其他 SDK 应用的工具 |\n| 内置 | `\"read_file\"`, `\"run_bash_command\"` | Sanqian 内置工具 |\n| MCP | `\"mcp_servername_toolname\"` | MCP 服务器工具 |\n| 通配符 | `[\"*\"]` | 所有可用工具 |\n\n### 子 Agent\n\n控制你的 Agent 是否可以委派任务给其他 Agent：\n\n```typescript\n{\n  subagents: undefined,           // 不能使用 task 工具（默认）\n  subagents: [],                  // 不能使用 task 工具（显式）\n  subagents: ['*'],               // 可以调用任何 Agent\n  subagents: ['agent1', 'agent2'] // 只能调用指定的 Agent\n}\n```\n\n### 更新和删除\n\n```typescript\n// 更新特定字段（其他不变）\nawait sdk.updateAgent('notes-assistant', {\n  system_prompt: '更新后的指令...',\n  tools: ['search_notes', 'create_note', 'delete_note']\n})\n\n// 删除\nawait sdk.deleteAgent('notes-assistant')\n\n// 列出你的 Agent\nconst agents = await sdk.listAgents()\n```\n\n---\n\n## 对话 (Chat)\n\n向任何 Agent 发送消息并获取回复。支持流式和非流式模式。\n\n### 非流式\n\n```typescript\nconst response = await sdk.chat('notes-assistant', [\n  { role: 'user', content: '找到我关于 TypeScript 的笔记' }\n])\n\nconsole.log(response.message.content)\n```\n\n### 流式\n\n```typescript\nfor await (const event of sdk.chatStream('notes-assistant', [\n  { role: 'user', content: '总结我最近的笔记' }\n])) {\n  switch (event.type) {\n    case 'start':\n      // 流开始，event.run_id 可用\n      break\n    case 'text':\n      process.stdout.write(event.content || '')\n      break\n    case 'thinking':\n      // 推理内容（DeepSeek R1、o3 等）\n      break\n    case 'tool_call':\n      console.log(`调用工具: ${event.tool_call?.function.name}`)\n      break\n    case 'tool_args_chunk':\n      // 流式工具参数（部分 JSON）\n      break\n    case 'tool_result':\n      console.log(`结果: ${event.success ? '成功' : event.error}`)\n      break\n    case 'done':\n      console.log(`\\n会话: ${event.conversationId}`)\n      break\n    case 'error':\n      console.error(event.error)\n      break\n  }\n}\n```\n\n### 流事件\n\n| 事件 | 字段 | 说明 |\n|------|------|------|\n| `start` | `run_id`, `conversationId` | 流开始 |\n| `text` | `content` | AI 文本片段 |\n| `thinking` | `content` | 推理内容（思考模型） |\n| `tool_call` | `tool_call` | 工具调用开始 |\n| `tool_args_chunk` | `tool_call_id`, `tool_name`, `chunk` | 流式工具参数 |\n| `tool_args` | `tool_call_id`, `tool_name`, `args` | 完整工具参数 |\n| `tool_result` | `tool_call_id`, `result`, `success`, `error` | 工具执行结果 |\n| `interrupt` | `interrupt_type`, `interrupt_payload`, `run_id` | HITL 暂停 |\n| `done` | `conversationId`, `title` | 流结束 |\n| `error` | `error` | 发生错误 |\n| `cancelled` | `run_id` | 运行被取消 |\n\n### 有状态 vs 无状态\n\n```typescript\n// 无状态：你自己管理消息历史\nconst r1 = await sdk.chat('agent', messages)\n// r1.conversationId 是空字符串\n\n// 有状态：服务器管理历史\nconst r1 = await sdk.chat('agent', messages, {\n  persistHistory: true  // 创建服务端会话\n})\n// r1.conversationId 有值，后续使用它\n\nconst r2 = await sdk.chat('agent', [{ role: 'user', content: '继续' }], {\n  conversationId: r1.conversationId\n})\n```\n\n### 会话助手\n\n多轮对话可以使用 `Conversation` 助手：\n\n```typescript\nconst conv = sdk.startConversation('notes-assistant')\n\nconst r1 = await conv.send('找到我的 TypeScript 笔记')\nconst r2 = await conv.send('总结第一个')\nconsole.log(conv.id)  // 会话 ID（首次 send 后可用）\n\n// 流式\nfor await (const event of conv.sendStream('还有更多细节吗？')) {\n  if (event.type === 'text') process.stdout.write(event.content || '')\n}\n\n// 获取历史\nconst details = await conv.getDetails({ messageLimit: 50 })\n\n// 删除\nawait conv.delete()\n```\n\n### 取消运行\n\n```typescript\nlet runId: string | undefined\n\nfor await (const event of sdk.chatStream('agent', messages)) {\n  if (event.type === 'start') runId = event.run_id\n  if (shouldCancel) {\n    sdk.cancelRun(runId!)\n    break\n  }\n}\n```\n\n### 自动发现\n\n为对话启用自动发现技能、工具或子 Agent：\n\n```typescript\nconst response = await sdk.chat('agent', messages, {\n  autoDiscoverSkills: true,   // Agent 可以搜索并使用技能\n  autoDiscoverTools: true,    // Agent 可以搜索并使用工具\n  autoDiscoverSubagents: true // Agent 可以委派给其他 Agent\n})\n```\n\n### 本地文件导入\n\n对于 Sanqian 后端与调用方在同一台机器、且后端能直接读取本地路径的场景，先调用 `uploadFile()`，再把返回的 `file.path` 传给 `chat()`：\n\n```typescript\nconst uploaded = await sdk.uploadFile('/absolute/path/report.pdf', {\n  conversationId,\n  autoIndex: true,\n  asyncProcess: true,\n})\n\nconst response = await sdk.chat('agent', messages, {\n  conversationId: uploaded.conversationId,\n  filePaths: [uploaded.file.path],\n})\n```\n\n`uploadFile(localPath)` 不是远程文件传输协议。对于远程 backend 或不同机器场景，仍应使用显式字节上传能力。\n\n会话目标契约：\n- 未传 `conversationId` 时，后端可能创建新的 SDK conversation，并通过 `uploaded.conversationId` 返回。\n- 传了 `conversationId` 但该会话不存在时，`uploadFile()` 会抛出 `SanqianSDKError`，错误码为 `CONVERSATION_NOT_FOUND`。\n\n---\n\n## 人机协作 (HITL)\n\nHITL 允许 Agent 在运行中暂停并请求用户输入。三种中断类型：\n\n| 类型 | 用途 | 示例 |\n|------|------|------|\n| `approval_request` | 执行前审批 | \"删除文件 X？\" -> 批准/拒绝 |\n| `user_input_request` | 请求用户输入 | \"什么格式？\" -> [\"JSON\", \"CSV\"] 或自由文本 |\n| `user_action_request` | 用户完成外部操作 | \"需要登录\" -> 用户登录 -> \"完成\" |\n\n### 处理中断\n\n```typescript\nfor await (const event of sdk.chatStream('agent', messages)) {\n  if (event.type === 'interrupt') {\n    const { interrupt_type, interrupt_payload, run_id } = event\n\n    if (interrupt_type === 'approval_request') {\n      const approved = await showApprovalDialog(interrupt_payload)\n      sdk.sendHitlResponse(run_id!, { approved })\n    }\n\n    if (interrupt_type === 'user_input_request') {\n      const answer = await showInputDialog(interrupt_payload)\n      sdk.sendHitlResponse(run_id!, { answer })\n    }\n  }\n}\n```\n\n---\n\n## 会话管理 (Conversations)\n\n管理服务器上存储的对话历史。\n\n```typescript\n// 列出会话\nconst { conversations, total } = await sdk.listConversations({\n  agentId: 'notes-assistant',\n  limit: 20,\n  offset: 0\n})\n\n// 获取会话详情（含消息）\nconst detail = await sdk.getConversation(conversationId, {\n  includeMessages: true,\n  messageLimit: 50,\n})\n\n// 获取消息历史（通过 HTTP API，与主应用一致）\nconst history = await sdk.getMessages(conversationId, { limit: 50 })\n\n// 删除会话\nawait sdk.deleteConversation(conversationId)\n```\n\n---\n\n## 上下文提供者 (Context Providers)\n\n上下文提供者让你的应用向对话注入动态状态。当用户附加上下文时，Sanqian 调用你的提供者获取最新数据。\n\n三种提供者方法，均为可选：\n\n| 方法 | 用途 | 调用时机 |\n|------|------|----------|\n| `getCurrent()` | 获取当前状态 | 用户发送带上下文的消息 |\n| `getList(options)` | 列出可用资源 | 用户打开 \"+\" 菜单浏览 |\n| `getById(id)` | 获取特定资源 | 用户从列表中选择 |\n\n### 注册上下文提供者\n\n```typescript\nconst sdk = new SanqianSDK({\n  appName: 'my-notes-app',\n  appVersion: '1.0.0',\n  tools: [/* ... */],\n  contexts: [\n    {\n      id: 'active-note',\n      name: '当前笔记',\n      description: '正在编辑的笔记',\n      getCurrent: async () => ({\n        content: editor.getCurrentNote().content,\n        title: editor.getCurrentNote().title,\n        type: 'note',\n      }),\n    },\n    {\n      id: 'notes',\n      name: '笔记库',\n      description: '浏览并附加笔记',\n      getList: async (options) => {\n        const notes = await db.searchNotes(options?.query || '', {\n          offset: options?.offset || 0,\n          limit: options?.limit || 20,\n        })\n        return {\n          items: notes.map(n => ({\n            id: n.id,\n            title: n.title,\n            summary: n.snippet,\n            type: 'note',\n            group: n.folder,\n          })),\n          hasMore: notes.length === (options?.limit || 20),\n        }\n      },\n      getById: async (id) => {\n        const note = await db.getNote(id)\n        if (!note) return null\n        return { id: note.id, content: note.content, title: note.title, type: 'note' }\n      },\n    }\n  ]\n})\n```\n\n### 将上下文附加到 Agent\n\n```typescript\nawait sdk.createAgent({\n  agent_id: 'notes-assistant',\n  name: '笔记助手',\n  tools: ['search_notes'],\n  attached_contexts: ['active-note'],  // 自动加应用前缀\n})\n```\n\n### 运行时更新上下文\n\n```typescript\nawait sdk.updateContexts([\n  { id: 'active-note', name: '当前笔记', description: '...', getCurrent: newHandler },\n])\n```\n\n---\n\n## 会话资源 (Session Resources)\n\n会话资源是你的应用推送给 Sanqian 的临时上下文。与上下文提供者（拉取式）不同，会话资源是推送式的。\n\n```typescript\n// 推送资源\nconst stored = await sdk.pushResource({\n  title: '当前笔记',\n  content: '<note>\\n# 我的笔记\\n内容...\\n</note>',\n  summary: '我的笔记 - 2024-01-15',\n})\nconsole.log(stored.fullId) // \"my-notes-app:abc123\"\n\n// 移除资源\nawait sdk.removeResource('my-notes-app:abc123')\n\n// 清除所有资源\nawait sdk.clearResources()\n\n// 本地缓存（无网络请求）\nconst resources = sdk.getSessionResources()\n\n// 从服务器获取\nconst serverResources = await sdk.fetchSessionResources('notes-assistant')\n```\n\n### 在对话中附加会话资源\n\n```typescript\nfor await (const event of sdk.chatStream('agent', messages, {\n  sessionResources: ['my-notes-app:abc123'],\n})) { /* ... */ }\n```\n\n---\n\n## Hooks（已可用）\n\n> **状态**: 远程 Hook API 已在 SDK 中可用。\n> **兼容性**: Hook 回调依赖后端支持 `register_hook` / `hook_invoke`。旧版后端可能返回 ack 错误，且不会触发回调。\n\n注册 hooks 来观察或干预 agent 执行。与工具（agent 调用）和上下文提供者（注入数据）不同，hooks 拦截 agent 的内部生命周期，包括用户输入入口、子 agent 生命周期、模型/工具边界和最终收口阶段。\n\n### Hook 点\n\n| Hook 点 | 类型 | 说明 |\n|---------|------|------|\n| `on_user_prompt_submit` | 干预 | 用户消息入口（可拒绝/改写） |\n| `on_stop_failure` | 观察 | 运行失败分类回调 |\n| `on_subagent_start` | 干预 | 子 agent 启动前（可改写 payload / 阻断） |\n| `on_subagent_stop` | 观察 | 子 agent 结束回调 |\n| `on_run_start` | 观察 | Agent run 开始 |\n| `on_run_end` | 观察 | Agent run 结束（成功/错误） |\n| `on_loop` | 干预 | 每轮 planner 循环 |\n| `before_model` | 干预 | LLM 调用前（可修改 prompt） |\n| `after_model` | 干预 | LLM 调用后（可修改响应） |\n| `before_tool` | 干预 | 工具执行前（可阻断/修改参数） |\n| `after_tool` | 干预 | 工具执行后（可修改结果） |\n| `before_compress` | 干预 | 上下文压缩前 |\n| `before_finalize` | 干预 | 最终响应持久化前 |\n\n### 注册 Hooks\n\n```typescript\nconst sdk = new SanqianSDK({\n  appName: 'my-guardrail',\n  requestedSecurityLevel: 'elevated', // before_tool/after_model/before_finalize 需要\n})\n\n// 观察所有工具调用（不干预）\nsdk.registerHook({\n  hookPoints: ['after_tool'],\n  priority: 90,\n}, async (ctx, payload) => {\n  console.log(`工具 ${payload.tool_name}: ${payload.result_status}`)\n  return null // 不干预\n})\n\n// 阻断危险工具\nconst hookId = sdk.registerHook({\n  hookPoints: ['before_tool'],\n  matcher: {\n    tool_names: ['delete_file', 'run_bash_command'],\n    args_pattern: { command: 'rm *' }, // 可选：按 payload 字段做 glob 匹配\n  },\n  priority: 10,\n  failPolicy: 'closed', // hook 不可达时阻断操作\n}, async (ctx, payload) => {\n  if (isDangerous(payload.tool_args)) {\n    return { decision: 'deny', reason: '安全检查未通过' }\n  }\n  return null // 放行\n})\n\n// 修改工具参数（如注入 API key）\nsdk.registerHook({\n  hookPoints: ['before_tool'],\n  matcher: { tool_names: ['web_search'] },\n  priority: 40,\n}, async (ctx, payload) => {\n  return {\n    value: { ...payload.tool_args, api_key: process.env.SEARCH_KEY },\n  }\n})\n\nawait sdk.connect()\n\n// 运行时注销\nawait sdk.unregisterHook(hookId)\n```\n\n说明：\n- `registerHook()` 会立即返回 `hookId`，并先在本地登记。\n- 若当前已连接，SDK 会异步发送 `register_hook`；传输/ack 失败仅记录 warning（不会抛出异常）。\n- 若希望启动阶段行为可预测，建议在第一次 `connect()` 前完成 hook 注册，这样会随应用初始注册一并下发。\n- `unregisterHook()` 是异步方法；若后续逻辑依赖注销完成，请使用 `await`。\n- `unregisterHookAndWait()` 会等待 `unregister_hook_ack`；nack/超时时抛错，并回滚本地 hook 状态。\n- `getRegisteredHooks()` 返回本地 hook 注册的防御性快照，可用于诊断/审计界面。\n- `getHookExecutionStats()` 返回运行时 hook 执行聚合指标（调用/成功/失败/耗时/最近错误）。\n\n需要确定性注册时：\n\n```typescript\nconst hookId = await sdk.registerHookAndWait({\n  hookPoints: ['before_tool'],\n  failPolicy: 'closed',\n}, async () => null)\n\nawait sdk.unregisterHookAndWait(hookId)\n```\n\n- `registerHookAndWait()` 会等待 `register_hook_ack`。\n- 若 nack/超时，会抛错并回滚本地注册状态。\n- 适用于“策略挂载失败就应立即失败”的场景。\n- `unregisterHookAndWait()` 为 hook 下线提供同样的确定性保障。\n\n```typescript\nconsole.table(sdk.getRegisteredHooks().map((item) => ({\n  hookId: item.hookId,\n  hookPoints: item.registration.hookPoints.join(\",\"),\n  failPolicy: item.registration.failPolicy || \"open\",\n})))\n\nconsole.table(sdk.getHookExecutionStats().map((item) => ({\n  hookId: item.hookId,\n  invocations: item.invocationCount,\n  success: item.successCount,\n  failure: item.failureCount,\n  avgMs: Number(item.averageDurationMs.toFixed(2)),\n  lastError: item.lastError || \"\",\n})))\n```\n\n单点强类型注册辅助 API：\n\n```typescript\nsdk.registerHookForPoint('before_tool', {\n  matcher: { tool_names: ['run_bash_command'] },\n}, async (_ctx, payload) => {\n  // payload 在 before_tool 下是强类型\n  return { metadata: { tool: payload.tool_name } }\n})\n\nawait sdk.registerHookForPointAndWait('before_tool', {\n  failPolicy: 'closed',\n}, async (_ctx, payload) => {\n  return { decision: payload.tool_name === 'delete_file' ? 'ask' : 'passthrough' }\n})\n```\n\n单点强类型 API 支持 `payloadValidation`：\n- `strict`（默认）：payload 不匹配时本次 hook 调用失败。\n- `warn`：发出 SDK `error` 事件，但继续调用 handler。\n- `off`：关闭运行时 payload 校验。\n\nHook roundtrip 冒烟脚本：\n\n```bash\nnpm --prefix packages/sdk run test:hook-roundtrip-smoke\n```\n\n该脚本会启动本地 WS mock backend，校验 13 个 hook 点的往返调用、strict 模式下 payload 不匹配失败路径、`unregisterHookAndWait` 的确定性成功/回滚路径，以及 `hookLifecycle` 事件。\n\n### Hook 动作\n\nHook handler 返回 `null`（不干预）或 `HookResult`：\n\n```typescript\ninterface HookResult {\n  skip?: boolean        // 阻断操作（如阻止工具执行）\n  value?: unknown       // 替换值（如修改后的参数或响应）\n  suspend?: boolean     // 暂停 agent，等待人工确认\n  suspend_payload?: unknown // 在 HITL 确认界面显示的数据\n  metadata?: Record<string, unknown>\n  decision?: 'deny' | 'ask' | 'passthrough' // 结构化决策\n  reason?: string      // deny/ask 的可读原因\n}\n```\n\n后端聚合优先级：`deny > ask > passthrough`。\n\n### Suspend（人机协作）\n\nHooks 可以暂停 agent 并等待外部确认：\n\n```typescript\nsdk.registerHook({\n  hookPoints: ['before_tool'],\n  matcher: { tool_names: ['send_email'] },\n  priority: 10,\n}, async (ctx, payload) => {\n  // 人工确认后，hook 会带着 ctx.resume_value 重新触发\n  if (ctx.resume_value) {\n    return ctx.resume_value.approved ? null : { skip: true }\n  }\n  // 首次触发：挂起并显示确认界面\n  return {\n    suspend: true,\n    suspend_payload: {\n      question: `是否允许发送邮件给 ${payload.tool_args.to}？`,\n      preview: JSON.stringify(payload.tool_args).substring(0, 500),\n    },\n  }\n})\n```\n\n### 安全等级\n\nHook 点需要最低安全等级：\n\n| 等级 | Hook 点 |\n|------|---------|\n| `standard` | on_user_prompt_submit, on_stop_failure, on_subagent_start, on_subagent_stop, on_run_start, on_run_end, on_loop, after_tool, before_compress |\n| `elevated` | before_tool, after_model, before_finalize |\n| `unrestricted` | before_model |\n\n在 SDKConfig 中设置 `requestedSecurityLevel` 以匹配所需的 hook 点。\n\n### 可靠性\n\n- **失败策略**: `\"open\"`（默认）-- hook 超时/错误不阻断 agent。`\"closed\"` -- hook 失败时阻断操作（用于安全关键的 hook）。\n- **超时**: 按 hook 点差异化（tool: 10s, model: 30s, observation: 5s）。注册时可通过 `timeout` 覆盖。\n- **熔断器**: 连续 5 次失败后自动熔断（60s 恢复期）。\n\n### Hook 可观测事件\n\n```typescript\nsdk.on('hookInvoked', (event) => {\n  console.log(event.hookPoint, event.callId, event.payload)\n})\n\nsdk.on('hookResult', (event) => {\n  console.log(event.hookPoint, event.success, event.durationMs, event.error)\n})\n\nsdk.on('hookLifecycle', (event) => {\n  console.log(\n    event.action,\n    event.hookId,\n    event.success,\n    event.deterministic,\n    event.durationMs,\n    event.error\n  )\n})\n```\n\n---\n\n## 能力发现 (Capability Discovery)\n\n查询 Sanqian 的完整能力注册表。\n\n```typescript\n// 列出工具\nconst tools = await sdk.listTools()\nconst builtinTools = await sdk.listTools('builtin')\n\n// 列出技能\nconst skills = await sdk.listSkills()\n\n// 列出所有可用 Agent\nconst agents = await sdk.listAvailableAgents()\n\n// 语义搜索（BM25 + 向量混合搜索）\nconst results = await sdk.searchCapabilities('文件操作', {\n  type: 'tool',\n  limit: 5,\n})\n```\n\n---\n\n## Embedding 与 Rerank 配置\n\n复用 Sanqian 中配置的嵌入和重排序模型。\n\n```typescript\nconst embedding = await sdk.getEmbeddingConfig()\nif (embedding.available) {\n  // 使用 embedding.apiUrl, embedding.apiKey, embedding.modelName\n}\n\nconst rerank = await sdk.getRerankConfig()\nif (rerank.available) {\n  // 使用 rerank.apiUrl, rerank.apiKey, rerank.modelName\n}\n```\n\n---\n\n## 消息渠道 API\n\nSDK 的 channels 方法通过 Sanqian HTTP 接口调用，并自动附带 `X-App-Token` 鉴权。它们只依赖运行时连接信息，不要求先完成 WebSocket 注册。\n\n```typescript\n// 构建本地 HTTP 集成时可直接复用\nconst baseUrl = sdk.getBaseUrl() // 例如 http://127.0.0.1:8765\n\n// 获取某个渠道的配置 schema（用于设置表单）\nconst schema = await sdk.getChannelConfigSchema('telegram')\n\n// 创建账号前先探测配置是否可用\nconst probe = await sdk.probeChannelConfig({\n  channel_type: 'telegram',\n  config: { bot_token: process.env.TELEGRAM_BOT_TOKEN }\n})\nif (!probe.ok) {\n  console.error(probe.error)\n}\n```\n\n这里仅展示新增方法。完整渠道能力可通过 `listChannelAccounts`、`createChannelAccount`、`listChannelBindings`、`sendChannelMessage` 等方法使用。\n\n---\n\n## 连接\n\n### 连接生命周期\n\nSDK 自动管理连接：\n\n1. **构造函数**：读取 `~/.sanqian/runtime/connection.json` 并监听变化\n2. **自动连接**：connection.json 出现时（Sanqian 启动），SDK 自动连接\n3. **自动启动**：`autoLaunchSanqian: true`（默认），未运行时自动启动 Sanqian\n4. **注册**：WebSocket 连接后，注册应用名称、工具和上下文提供者\n5. **心跳**：30 秒间隔检测连接状态\n6. **自动重连**：指数退避（500ms 到 5s）带抖动\n\n### 重连控制\n\n自动重连是引用计数的：\n\n```typescript\nsdk.acquireReconnect()  // 聊天面板打开 - 请求持久连接\nsdk.releaseReconnect()  // 聊天面板关闭 - 释放\n```\n\n### 连接状态\n\n```typescript\nconst state = sdk.getState()\n// { connected, registering, registered, lastError?, reconnectAttempts }\n\nsdk.isConnected() // true 当已连接且已注册\n```\n\n### 事件\n\n```typescript\nsdk.on('connected', () => { /* WebSocket 已打开 */ })\nsdk.on('disconnected', (reason) => { /* 连接断开 */ })\nsdk.on('registered', () => { /* 工具和上下文已注册 */ })\nsdk.on('error', (error) => { /* 连接错误 */ })\nsdk.on('tool_call', ({ name, arguments }) => { /* 工具被调用 */ })\nsdk.on('resourcePushed', (resource) => { /* 会话资源已推送 */ })\nsdk.on('resourceRemoved', (resourceId) => { /* 用户移除了会话资源 */ })\nsdk.on('resourcesCleared', (appName) => { /* 所有资源已清除 */ })\n\nsdk.once('registered', () => { /* 一次性监听 */ })\nsdk.removeAllListeners() // 移除所有监听器\n```\n\n### SDKConfig 选项\n\n```typescript\nconst sdk = new SanqianSDK({\n  // 必填\n  appName: 'my-app',\n  appVersion: '1.0.0',\n  tools: [],\n\n  // 显示\n  displayName: 'My App',           // Sanqian UI 中显示的名称\n  requestedSecurityLevel: 'standard', // 可选：standard | elevated | unrestricted\n\n  // 启动\n  launchCommand: '/path/to/app',   // Sanqian 启动你的应用的命令\n  metadata: { browser: 'chrome' }, // 应用元数据\n\n  // 上下文\n  contexts: [],                    // 上下文提供者\n\n  // 超时\n  reconnectInterval: 5000,         // 重连间隔（毫秒，默认 5000）\n  heartbeatInterval: 30000,        // 心跳间隔（毫秒，默认 30000）\n  toolExecutionTimeout: 30000,     // 工具超时（毫秒，默认 30000）\n\n  // 自动启动\n  autoLaunchSanqian: true,         // 未运行时启动 Sanqian（默认 true）\n  sanqianPath: '/path/to/Sanqian', // 自定义可执行文件路径\n\n  // 调试\n  debug: false,                    // 控制台日志（默认 false）\n\n  // 注册握手（可选，默认值如下）\n  protocolVersion: '2026-03-29',   // 协议版本（YYYY-MM-DD）\n  hookCapabilities: {              // Hook 能力声明\n    streamingHook: false,          // 与后端协商（most-restrictive-wins）\n  },\n\n  // 浏览器模式\n  connectionInfo: undefined,       // 预配置连接信息（跳过文件发现）\n})\n```\n\n---\n\n## 浏览器构建 (Browser Build)\n\n用于浏览器环境（扩展、Web 应用、Office 插件）：\n\n```typescript\nimport { SanqianSDK } from '@yushaw/sanqian-sdk/browser'\n\nconst sdk = new SanqianSDK({\n  appName: 'my-extension',\n  appVersion: '1.0.0',\n  connectionInfo: {\n    port: 38765,\n    token: 'your-token',\n    ws_path: '/ws/apps',\n    version: 1,\n    pid: 0,\n    started_at: '',\n  },\n  tools: [/* ... */]\n})\n\nawait sdk.connect()\n```\n\n浏览器构建使用原生 WebSocket，需要提供 `connectionInfo`，不支持 `autoLaunchSanqian` 和 connection.json 文件监听。其他所有功能均可使用。\n\n---\n\n## HTTP API 参考\n\n简单集成无需 SDK。基础 URL：`http://localhost:{PORT}`（端口来自 `~/.sanqian/runtime/api.port`）。\n\n### 对话\n\n```\nPOST /api/agents/{agent_id}/chat\n```\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `messages` | `ChatMessage[]` | 是 | 发送的消息 |\n| `stream` | `boolean` | 否 | 启用 SSE 流（默认 true） |\n| `conversation_id` | `string` | 否 | 继续已有会话 |\n\n### 列出 Agent\n\n```\nGET /api/agents\n```\n\n### 示例\n\n**Python：**\n```python\nimport requests, json\n\nport = open('~/.sanqian/runtime/api.port').read().strip()\n\nr = requests.post(f'http://localhost:{port}/api/agents/default/chat', json={\n    'messages': [{'role': 'user', 'content': '你好'}],\n    'stream': False,\n})\nprint(r.json()['message']['content'])\n```\n\n**JavaScript（无 SDK）：**\n```javascript\nconst port = require('fs').readFileSync(\n  require('os').homedir() + '/.sanqian/runtime/api.port', 'utf8'\n).trim()\n\nconst response = await fetch(`http://localhost:${port}/api/agents/default/chat`, {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\n    messages: [{ role: 'user', content: '你好' }],\n    stream: false,\n  }),\n})\nconst data = await response.json()\nconsole.log(data.message.content)\n```\n\n---\n\n## 内置工具参考\n\n下表是静态快照。运行时请以 `sdk.listTools('builtin')`（或 `/api/capabilities`）为准。\n\n### 文件操作\n\n| 工具 | 说明 |\n|------|------|\n| `read_file` | 读取工作区文件 |\n| `write_file` | 写入工作区文件 |\n| `edit_file` | 精确字符串替换编辑文件 |\n| `delete_file` | 删除工作区文件 |\n| `list_files` | 列出目录内容 |\n| `find_files` | 按 glob 模式查找文件 |\n| `search_file` | 搜索文件内容 |\n| `grep_content` | 跨文件正则内容搜索 |\n\n### 网络\n\n| 工具 | 说明 |\n|------|------|\n| `web_search` | 网络搜索 |\n| `fetch_web` | 获取网页并转换为 Markdown |\n\n### 执行\n\n| 工具 | 说明 |\n|------|------|\n| `run_bash_command` | 执行 Shell 命令（沙箱化） |\n\n### 记忆\n\n| 工具 | 说明 |\n|------|------|\n| `search_memory` | 按语义相似度搜索记忆 |\n| `save_memory` | 保存新记忆 |\n| `list_memories` | 列出所有记忆 |\n\n### 任务与 Agent\n\n| 工具 | 说明 |\n|------|------|\n| `todo_write` | 创建和更新任务列表 |\n| `task` | 委派任务给其他 Agent |\n| `search_capability` | 搜索可用工具/技能/Agent |\n| `ask_human` | 需要更多信息时询问用户 |\n\n### 视觉与图像\n\n| 工具 | 说明 |\n|------|------|\n| `vision_analyze` | 图像分析 |\n| `generate_image` | 文本生成图像 |\n\n### macOS Apple 集成（仅 macOS）\n\n| 工具 | 说明 |\n|------|------|\n| `calendar_search` / `calendar_create` / `calendar_delete` | 日历操作 |\n| `notes_search` / `notes_create` / `notes_delete` | 备忘录操作 |\n| `reminders_search` / `reminders_create` / `reminders_complete` / `reminders_delete` | 提醒事项操作 |\n| `contacts_search` | 搜索通讯录 |\n\n---\n\n## 常见问题\n\n**如何获取 agent_id？**\n使用 `GET /api/agents` 或 `sdk.listAgents()`。常见内置 ID：`default`、`coding`。\n\n**什么时候用 HTTP API vs SDK？**\nHTTP API 适合任意语言的简单对话。SDK 适合需要工具、Agent、上下文提供者或会话资源的场景。\n\n**SDK 会话在 Sanqian 中可见吗？**\n是的。通过 SDK 创建的会话会出现在 Sanqian 的会话列表中。\n\n**Sanqian 重启后 Agent 会自动重连吗？**\n是的。Node.js SDK 监听 `connection.json`。Sanqian 重启写入新文件后，SDK 自动重连。\n\n**如果启动时 Sanqian 未运行怎么办？**\n`autoLaunchSanqian: true`（默认）时，SDK 会在托盘模式下启动 Sanqian。否则 SDK 监听 `connection.json`，Sanqian 启动后自动连接。\n\n## 错误码\n\n| 码 | 说明 |\n|----|------|\n| `400` | 请求参数无效 |\n| `404` | Agent 或会话未找到 |\n| `429` | 频率限制 |\n| `500` | 内部服务器错误 |\n\n## Changelog\n\n### 0.3.28\n\n- Remote hooks SDK API is now available in both Node and Browser builds (`registerHook` / `unregisterHook`, hook type exports, runtime hook invoke/result handling).\n- Added `requestedSecurityLevel` handshake support and hook declaration sync in registration payloads.\n- Hardened docs to match current runtime behavior and compatibility constraints.\n\n### 0.3.25\n\n- Centralized HTTP request pipeline: all HTTP API calls now go through a unified `httpRequest()` method that automatically injects `X-App-Token` auth headers and standardizes error handling via `SanqianSDKError`. This prevents auth header omissions and ensures consistent error types for SDK consumers.\n- Fixed 4 HTTP methods (`getMessages`, `fetchSessionResources`, `listCapabilities`, `searchCapabilities`) that were missing auth headers, causing 401 errors when `ConnectionTokenMiddleware` is active.\n- Net reduction of ~240 lines of duplicated fetch/error-handling boilerplate across Node.js and browser clients.\n- Fixed browser build (`@yushaw/sanqian-sdk/browser`) missing type exports: `ConversationHistoryResult`, `ContextCapability`, `ResourceType`, `ResourceListOptions`, `ResourceListResult`. Browser consumers can now import these types directly.\n- Fixed browser build missing Context Provider support: constructor registration, registration message, and incoming message handlers (`context_get_current/list/by_id`) now match the Node.js build.\n- Fixed browser build registration missing `appKey` field.\n- Unified error types: all `throw new Error()` in both clients replaced with `createSDKError()` for consistent `SanqianSDKError` across the SDK surface.\n- Added JSON parse error handling in `httpRequest()` to catch malformed server responses.\n- Fixed promise leak in `connectWithInfo()`: if WebSocket closes or errors before `onopen` fires, the connection promise now properly rejects instead of hanging indefinitely.\n- Added constructor config validation: `appName` required, `tools` must be array,","readmeFilename":"README.md"}