{"_id":"@lushly-dev/afd-server","_rev":"9-6647a4b8265e960e1973b816d7a1d868","name":"@lushly-dev/afd-server","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@lushly-dev/afd-server","version":"0.1.0","keywords":["afd","agent-first","mcp","server","zod","validation"],"license":"MIT","_id":"@lushly-dev/afd-server@0.1.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"dist":{"shasum":"6a55733df6e1b111b37d6f8f13b468d6f0302f72","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.1.0.tgz","fileCount":43,"integrity":"sha512-YccdRaOWLLEMTOSznFB+oUhDomKbmqpE4TR8Hve7lc8fPtaTXHnAvk0Hc8us2uBT3NiacY3F+FYx8TDPBbSHrA==","signatures":[{"sig":"MEQCIBE4F4RB3TTTgNP8WqypICr5HATW8VEnrazpRJofcV7jAiBh4BFcxOnePmlGU2Ttt00CO4lhyCntK6+15jNm6ypzLw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":160710},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"C:\\Users\\jasfalk\\AppData\\Local\\Temp\\f74d09f12157141e9f06fa0b7c3a7fb9\\lushly-dev-afd-server-0.1.0.tgz","_integrity":"sha512-YccdRaOWLLEMTOSznFB+oUhDomKbmqpE4TR8Hve7lc8fPtaTXHnAvk0Hc8us2uBT3NiacY3F+FYx8TDPBbSHrA==","_npmVersion":"11.2.0","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"_nodeVersion":"23.3.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.1.0","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^1.6.0","typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.1.0_1767824768375_0.7385358079380728","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@lushly-dev/afd-server","version":"0.3.0","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.3.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"5ec40d33e277eb043733b302819c874f6eaac8c3","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.3.0.tgz","fileCount":47,"integrity":"sha512-tpw2ygh+6p718soWHYsMgZWT+s6/G2Yp2stcB4nH6BiiA5v+zLdNNPnM7E8trMEgAkhZ8KiTw4NHOuIdis/dug==","signatures":[{"sig":"MEUCIQCG4qJB0KnaxoCnAtFztezNBXw8+kiD2c5kNISbFnGw9QIgfbIwV9W0gvXZaZr4OK5nqRmxjou6GuJuT3jpV4S52Hs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":238629},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.3.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/642840e2936a8589ca0bfedacb411713/lushly-dev-afd-server-0.3.0.tgz","_integrity":"sha512-tpw2ygh+6p718soWHYsMgZWT+s6/G2Yp2stcB4nH6BiiA5v+zLdNNPnM7E8trMEgAkhZ8KiTw4NHOuIdis/dug==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"10.9.4","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.3.0","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^1.6.0","typescript":"^5.4.0","@lushly-dev/afd-client":"0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.3.0_1772238051190_0.5628902158465363","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@lushly-dev/afd-server","version":"0.3.1","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.3.1","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"1c0fb1c944368cc48a72511b3f8ff15adeeb1c7d","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.3.1.tgz","fileCount":47,"integrity":"sha512-s6j43wMRfnlMGz+7xkyKE3ObBym/D9dJjDU8PwJq3vZ82yuPX/J5eSgkLgbqfUirAuDE8G+mm44Y+LTG+U2lqg==","signatures":[{"sig":"MEUCIQDya3zWU/JB4/cmuHOhfBzdDdoAC14n1/GTPwBVKT3f8gIgfK6FIh0Xd1oMdiyHbhMF9SsjtpU0zGrfxsijoxtJfuM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":238668},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.3.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/c2562b4edc5185239f7ddec0a133a836/lushly-dev-afd-server-0.3.1.tgz","_integrity":"sha512-s6j43wMRfnlMGz+7xkyKE3ObBym/D9dJjDU8PwJq3vZ82yuPX/J5eSgkLgbqfUirAuDE8G+mm44Y+LTG+U2lqg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"10.9.4","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.3.1","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.4.0","@vitest/coverage-v8":"^4.0.18","@lushly-dev/afd-client":"0.3.1"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.3.1_1772250989785_0.33990921898583104","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@lushly-dev/afd-server","version":"0.3.2","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.3.2","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"cba92db54d8eb99160d6aae00c571260fc97b7ff","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.3.2.tgz","fileCount":47,"integrity":"sha512-PgYzomka+azD0xTH6PdQSFkrDRXztz/lALvSVwz9d9XU59FRn1ZIcODzMGOuDdhY37tQFlqRMCsYVn1YLdrzuQ==","signatures":[{"sig":"MEUCIE8BNzKVPJsKI2ZgniIPkTPL/ww+MHyqh2BRkd1DIxIbAiEAty+UQGiSd44RFJA2vAivOfa91n8mK4EpRkPQ0SDiyYE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":238668},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.3.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/0d0bbd4be4b44208db347914d150a2fb/lushly-dev-afd-server-0.3.2.tgz","_integrity":"sha512-PgYzomka+azD0xTH6PdQSFkrDRXztz/lALvSVwz9d9XU59FRn1ZIcODzMGOuDdhY37tQFlqRMCsYVn1YLdrzuQ==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"10.9.4","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.3.2","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.4.0","@vitest/coverage-v8":"^4.0.18","@lushly-dev/afd-client":"0.3.2"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.3.2_1772256956763_0.3608139032363398","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@lushly-dev/afd-server","version":"0.3.4","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.3.4","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"cb27772d016c7e3542802e56b0b0506303b0beb6","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.3.4.tgz","fileCount":47,"integrity":"sha512-brp1dhsagNWLOiBAkBKKaW4ww6U8zl0Za+UQ8iYY3UAY+9ORZoafJLAYflGiY1fUKHxpy316WcWvKEd/f1lDlw==","signatures":[{"sig":"MEYCIQClApEmd4sWX1jOYTGvj/YqLav3HjFN/Pgl2MYgRku9cQIhAIED19uVy9izvVSCzJno6R5ViAXCdHXYWLvy4+FDg9Jd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.3.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":238668},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.3.4.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/602f3ff10dec8c495ffcfbed173f316b/lushly-dev-afd-server-0.3.4.tgz","_integrity":"sha512-brp1dhsagNWLOiBAkBKKaW4ww6U8zl0Za+UQ8iYY3UAY+9ORZoafJLAYflGiY1fUKHxpy316WcWvKEd/f1lDlw==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"10.9.4","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.3.4","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.4.0","@vitest/coverage-v8":"^4.0.18","@lushly-dev/afd-client":"0.3.4"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.3.4_1772258405441_0.8530167020441781","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@lushly-dev/afd-server","version":"0.4.0","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.4.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"daf67c0b69fe25cc0fd58d38e09d760fdc456236","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.4.0.tgz","fileCount":47,"integrity":"sha512-kTeahz0o1HN1k8I52WiTz/tMEy6PMwmEKvBdpkKccU/azMA/0yiSjyGwdMJ/WOBfFrbYqNFxYzqyQiunBRtZZg==","signatures":[{"sig":"MEUCIQCNf+sT9tt6LvNz89XqJuoibdy5G8Se8W7mn06W70amygIgZjNPxemNpQBHDYgNu9PfzPR9sHSNatB8JnhS+Sr5nIY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":238668},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.4.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/de96c2944fd8770d489380b5356c0537/lushly-dev-afd-server-0.4.0.tgz","_integrity":"sha512-kTeahz0o1HN1k8I52WiTz/tMEy6PMwmEKvBdpkKccU/azMA/0yiSjyGwdMJ/WOBfFrbYqNFxYzqyQiunBRtZZg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"10.9.4","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.4.0","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.4.0","@vitest/coverage-v8":"^4.0.18","@lushly-dev/afd-client":"0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.4.0_1772310073378_0.47218126742280253","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@lushly-dev/afd-server","version":"0.5.0","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.5.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"fa896afe41d457f6df9c12816996204b880a2c06","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.5.0.tgz","fileCount":75,"integrity":"sha512-RZg4D8kTIiUNNvl0crjtjqmz9/iqjmFVRucqbjODh9XEwL2B14GzfBv38r7bZyGPhvkg66KCVQnAXFishFY8Lg==","signatures":[{"sig":"MEUCIB5J9CPQxyeGc22Kze3cxQA5axpqJCorxK5cjnyT4xLIAiEA8WBIkzpnDDTDZNK4ta/GmpGKNUlMJNoAu4n5xtb+wVw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":310747},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.5.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/b6174d43c1dcd944a6695027c39568f6/lushly-dev-afd-server-0.5.0.tgz","_integrity":"sha512-RZg4D8kTIiUNNvl0crjtjqmz9/iqjmFVRucqbjODh9XEwL2B14GzfBv38r7bZyGPhvkg66KCVQnAXFishFY8Lg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"10.9.4","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.23.8","zod-to-json-schema":"^3.23.5","@lushly-dev/afd-core":"0.5.0","@modelcontextprotocol/sdk":"^1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.4.0","@vitest/coverage-v8":"^4.0.18","@lushly-dev/afd-client":"0.5.0"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.5.0_1773188895822_0.9196090777624273","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@lushly-dev/afd-server","version":"0.6.0","keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/afd-server@0.6.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"e31da02d0d793fb6e8bc1997f347660eaa4428ee","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-0.6.0.tgz","fileCount":75,"integrity":"sha512-SBDfq58+6kjnss+rpiPNg5HGNFk8VAGsPXojDuCv2c1rz9vcekTqeNd8j19ev1UtVviEcAiVNBA1y6omZDplNg==","signatures":[{"sig":"MEQCIEF9PRjsC6u2MABAIrvsHMeqbbDrh16PnGr/8nypllinAiBAvA7cVovu8ahl/1EkQ3VZQakoE2gRGn/Q8g7qf0peHQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":303530},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-afd-server-0.6.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/9433dee44161d81eb6eb353e83c722c1/lushly-dev-afd-server-0.6.0.tgz","_integrity":"sha512-SBDfq58+6kjnss+rpiPNg5HGNFk8VAGsPXojDuCv2c1rz9vcekTqeNd8j19ev1UtVviEcAiVNBA1y6omZDplNg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/server"},"_npmVersion":"11.9.0","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"zod":"^4.0.0","@lushly-dev/afd-core":"0.6.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.0","typescript":"^5.9.3","@vitest/coverage-v8":"^4.1.0","@lushly-dev/afd-client":"0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/afd-server_0.6.0_1773466659014_0.5413450432349758","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@lushly-dev/afd-server","version":"1.0.0","description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"@modelcontextprotocol/sdk":"^1.27.1","zod":"^4.0.0","@lushly-dev/afd-core":"1.0.0"},"devDependencies":{"@vitest/coverage-v8":"^4.1.0","typescript":"^5.9.3","vitest":"^4.1.0","@lushly-dev/afd-client":"1.0.0"},"keywords":["afd","agent-first","mcp","server","zod","validation"],"author":{"name":"Falkicon"},"license":"MIT","homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"repository":{"type":"git","url":"git+https://github.com/lushly-dev/afd.git","directory":"packages/server"},"engines":{"node":">=22.0.0"},"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"build":"tsc","dev":"tsc --watch","test":"vitest run","test:watch":"vitest","clean":"rm -rf dist"},"_id":"@lushly-dev/afd-server@1.0.0","_integrity":"sha512-tbpEocu1SnuRofCaD5Ngtv8NQh7IQfwdAENV6rJnAf6JmMMqek9+TzNU5clqKNDfKCjyo8qBIBXNrWlye494vg==","_resolved":"/tmp/7da6115925de7bfdac86515acf779aa4/lushly-dev-afd-server-1.0.0.tgz","_from":"file:lushly-dev-afd-server-1.0.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-tbpEocu1SnuRofCaD5Ngtv8NQh7IQfwdAENV6rJnAf6JmMMqek9+TzNU5clqKNDfKCjyo8qBIBXNrWlye494vg==","shasum":"88f3b0d7a1f08b0c6a974889cd42902c75808c99","tarball":"https://registry.npmjs.org/@lushly-dev/afd-server/-/afd-server-1.0.0.tgz","fileCount":75,"unpackedSize":306996,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2fafd-server@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDZD1cDZFjebyp+SAYqBJ1VnQ8COoxzIOcIvltBOLjOnwIgMMkkAq2YZTN5Gp9XxZ9jqjKRzUEh5UxmSONfhXvnvTw="}]},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"directories":{},"maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/afd-server_1.0.0_1773633892531_0.2961473352126478"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-07T22:26:08.264Z","modified":"2026-03-16T04:04:53.025Z","0.1.0":"2026-01-07T22:26:08.551Z","0.3.0":"2026-02-28T00:20:51.348Z","0.3.1":"2026-02-28T03:56:29.946Z","0.3.2":"2026-02-28T05:35:56.931Z","0.3.4":"2026-02-28T06:00:05.588Z","0.4.0":"2026-02-28T20:21:13.529Z","0.5.0":"2026-03-11T00:28:15.980Z","0.6.0":"2026-03-14T05:37:39.188Z","1.0.0":"2026-03-16T04:04:52.696Z"},"bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"author":{"name":"Falkicon"},"license":"MIT","homepage":"https://github.com/lushly-dev/afd#readme","keywords":["afd","agent-first","mcp","server","zod","validation"],"repository":{"type":"git","url":"git+https://github.com/lushly-dev/afd.git","directory":"packages/server"},"description":"Server-side utilities for building AFD-compliant MCP servers with Zod validation","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"readme":"# @lushly-dev/afd-server\n\nServer-side utilities for building AFD-compliant MCP servers with Zod validation.\n\n## Installation\n\n```bash\nnpm install @lushly-dev/afd-server\n# or\npnpm add @lushly-dev/afd-server\n```\n\n## Features\n\n- **Zod-based Command Definition** - Define commands with Zod schemas for type-safe validation\n- **Auto JSON Schema Generation** - Automatic conversion to JSON Schema for MCP tool definitions\n- **Multiple Transport Support** - stdio for IDE/agent integration, HTTP/SSE for browser clients\n- **Auto Transport Detection** - Automatically selects the right transport based on environment\n- **Built-in Validation** - Automatic input validation before handler execution\n- **Middleware System** - Logging, tracing, rate limiting, and custom middleware\n- **Command Prerequisites** - Declare `requires` dependencies so agents can plan execution order\n- **Full TypeScript Support** - Complete type inference from Zod schemas\n\n## Quick Start\n\n```typescript\nimport { z } from 'zod';\nimport { defineCommand, createMcpServer, defaultMiddleware, success, failure } from '@lushly-dev/afd-server';\n\n// Define a command with Zod schema\nconst greet = defineCommand({\n  name: 'greet',\n  description: 'Greet a user by name',\n  category: 'demo',\n  input: z.object({\n    name: z.string().min(1, 'Name is required'),\n    formal: z.boolean().default(false),\n  }),\n\n  async handler(input) {\n    const greeting = input.formal\n      ? `Good day, ${input.name}.`\n      : `Hello, ${input.name}!`;\n\n    return success({ greeting }, {\n      reasoning: `Generated ${input.formal ? 'formal' : 'casual'} greeting`,\n      confidence: 1.0,\n    });\n  },\n});\n\n// Create and start the server (auto-detects transport)\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [greet],\n  middleware: defaultMiddleware(),  // Trace IDs, logging, slow-command warnings\n  port: 3100,\n});\n\nawait server.start();\nconsole.log(`Server running at ${server.getUrl()}`);\n```\n\n## Embedding In A Host-Controlled HTTP Server\n\nUse `createMcpHandler()` when your platform owns the HTTP server lifecycle and expects a request handler instead of a self-starting server object:\n\n```typescript\nimport { createServer } from 'node:http';\nimport { createMcpHandler } from '@lushly-dev/afd-server';\n\nconst handler = createMcpHandler({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [greet],\n  host: '127.0.0.1',\n  port: 3100,\n});\n\ncreateServer((req, res) => {\n  void handler(req, res);\n}).listen(3100, '127.0.0.1');\n```\n\nUse `createMcpServer()` for the batteries-included standalone server. Use `createMcpHandler()` when you need AFD to plug into an existing Node HTTP host.\n\n## Transport Protocols\n\nThe server supports multiple transport protocols for different use cases:\n\n### Auto-Detection (Default)\n\nBy default, the server auto-detects the best transport based on the environment:\n\n```typescript\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [greet],\n  // transport: 'auto' is the default\n});\n\n// When stdin is piped (IDE/agent context): uses stdio\n// When stdin is a TTY (interactive context): uses HTTP\n```\n\n### stdio Transport (IDE/Agent Integration)\n\nUse stdio for integration with IDE MCP clients like Cursor, Claude Code, or Antigravity:\n\n```typescript\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [greet],\n  transport: 'stdio',  // Explicit stdio mode\n});\n\nawait server.start();\n// Server reads JSON-RPC from stdin, writes to stdout\n```\n\nIn your IDE's MCP configuration (adjust the path to match your project):\n```json\n{\n  \"mcpServers\": {\n    \"my-server\": {\n      \"command\": \"node\",\n      \"args\": [\"path/to/your/server.js\"]\n    }\n  }\n}\n```\n\n### HTTP Transport (Browser/Web UI)\n\nUse HTTP for browser-based clients and web UIs:\n\n```typescript\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [greet],\n  transport: 'http',  // Explicit HTTP mode\n  port: 3100,\n});\n\nawait server.start();\nconsole.log(`Server running at ${server.getUrl()}`);\n// Exposes /sse, /message, /health endpoints\n```\n\n## Defining Commands\n\n### Basic Command\n\n```typescript\nimport { z } from 'zod';\nimport { defineCommand, success, failure } from '@lushly-dev/afd-server';\n\nconst createUser = defineCommand({\n  name: 'user-create',\n  description: 'Create a new user',\n  category: 'users',\n  mutation: true,\n  \n  input: z.object({\n    email: z.string().email(),\n    name: z.string().min(1).max(100),\n    role: z.enum(['admin', 'user', 'guest']).default('user'),\n  }),\n  \n  async handler(input) {\n    // Your implementation\n    const user = await db.users.create(input);\n    \n    return success(user, {\n      reasoning: `Created user ${user.email} with role ${user.role}`,\n    });\n  },\n});\n```\n\n### Command with Error Handling\n\n```typescript\nconst getUser = defineCommand({\n  name: 'user-get',\n  description: 'Get a user by ID',\n  category: 'users',\n  errors: ['NOT_FOUND'],\n  \n  input: z.object({\n    id: z.string().uuid(),\n  }),\n  \n  async handler(input) {\n    const user = await db.users.find(input.id);\n    \n    if (!user) {\n      return failure({\n        code: 'NOT_FOUND',\n        message: `User with ID \"${input.id}\" not found`,\n        suggestion: 'Check the ID or use user-list to find available users',\n      });\n    }\n    \n    return success(user);\n  },\n});\n```\n\n### Command with Prerequisites\n\n```typescript\nconst secretData = defineCommand({\n  name: 'secret-data',\n  description: 'Return sensitive data for the authenticated user',\n  requires: ['auth-sign-in'],  // Agent sees this before calling\n  input: z.object({}),\n\n  async handler(input, context) {\n    return success({ secret: '...' });\n  },\n});\n```\n\nPrerequisites are metadata — they tell agents what to call first but are not enforced at runtime (middleware handles enforcement). They appear in MCP tool `_meta` and `afd-help` output.\n\n### Command with Output Schema\n\nDeclare what a command returns so agents know the response shape before calling:\n\n```typescript\nconst Todo = z.object({\n  id: z.string(),\n  title: z.string(),\n  done: z.boolean(),\n});\n\nconst listTodos = defineCommand({\n  name: 'todo-list',\n  description: 'List all todo items',\n  input: z.object({ filter: z.enum(['all', 'active', 'done']).optional() }),\n  output: Todo.array(),  // Agents see this in _meta.outputSchema and afd-detail\n  async handler(input) {\n    const todos = await store.list(input.filter);\n    return success(todos, { reasoning: `Found ${todos.length} todos` });\n  },\n});\n```\n\nOutput schemas are optional (backward compatible). They describe the shape of `CommandResult.data`, not the full envelope. No runtime output validation is performed.\n\n### Command with Context Scoping\n\nRestrict commands to specific contexts for large command sets:\n\n```typescript\nconst formatDoc = defineCommand({\n  name: 'doc-format',\n  description: 'Format the current document',\n  contexts: ['editing'],  // Only visible when 'editing' context is active\n  input: z.object({ style: z.string() }),\n  async handler(input) { ... },\n});\n```\n\nCommands without `contexts` are universal (always visible). See \"Context Management\" below for server-level context configuration.\n\n\n## Server Configuration\n\n```typescript\nconst server = createMcpServer({\n  // Required\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [cmd1, cmd2, cmd3],\n\n  // Optional\n  port: 3100,              // Default: 3100\n  host: 'localhost',       // Default: localhost\n  cors: true,              // Enable CORS (default: true)\n\n  // Middleware — zero-config observability\n  middleware: defaultMiddleware(),\n\n  // Callbacks\n  onCommand(command, input, result) {\n    console.log(`Executed ${command}:`, result.success);\n  },\n  onError(error) {\n    console.error('Server error:', error);\n  },\n});\n```\n\n## Middleware\n\n### Default Middleware (Recommended)\n\n`defaultMiddleware()` returns a pre-configured stack of three middleware covering common observability needs:\n\n1. **Auto Trace ID** — generates `context.traceId` via `crypto.randomUUID()` when not present\n2. **Structured Logging** — logs command start/completion with trace ID correlation\n3. **Slow-Command Warnings** — warns when commands exceed a configurable threshold (default: 1000ms)\n\n```typescript\nimport { defaultMiddleware } from '@lushly-dev/afd-server';\n\n// Zero-config — all three enabled\nmiddleware: defaultMiddleware()\n\n// Selective disable\nmiddleware: defaultMiddleware({ timing: false })\n\n// Custom options\nmiddleware: defaultMiddleware({\n  logging: { logInput: true },\n  timing: { slowThreshold: 500, onSlow: (name, ms) => logger.warn(`${name}: ${ms}ms`) },\n  traceId: { generate: () => `custom-${Date.now()}` },\n})\n\n// Compose with custom middleware\nmiddleware: [...defaultMiddleware(), myAuthMiddleware, myRateLimiter]\n```\n\n### Logging\n\n```typescript\nimport { createLoggingMiddleware } from '@lushly-dev/afd-server';\n\nconst middleware = createLoggingMiddleware({\n  log: console.log,        // Custom log function\n  logInput: false,         // Don't log input (may contain sensitive data)\n  logResult: false,        // Don't log full results\n});\n```\n\n### Timing\n\n```typescript\nimport { createTimingMiddleware } from '@lushly-dev/afd-server';\n\nconst middleware = createTimingMiddleware({\n  slowThreshold: 1000,     // Warn if command takes > 1s\n  onSlow(command, durationMs) {\n    console.warn(`Slow command: ${command} took ${durationMs}ms`);\n  },\n});\n```\n\n### OpenTelemetry Tracing\n\n```typescript\nimport { trace } from '@opentelemetry/api';\nimport { createTracingMiddleware } from '@lushly-dev/afd-server';\n\nconst tracer = trace.getTracer('my-app');\n\nconst middleware = createTracingMiddleware({\n  tracer,\n  spanPrefix: 'command',   // Span names: command.user-create, etc.\n});\n```\n\n### Rate Limiting\n\n```typescript\nimport { createRateLimitMiddleware } from '@lushly-dev/afd-server';\n\nconst middleware = createRateLimitMiddleware({\n  maxRequests: 100,\n  windowMs: 60000,         // 100 requests per minute\n  keyFn: (context) => context.userId ?? 'anonymous',\n});\n```\n\n### Custom Middleware\n\n```typescript\nimport type { CommandMiddleware } from '@lushly-dev/afd-server';\n\nconst myMiddleware: CommandMiddleware = async (commandName, input, context, next) => {\n  console.log(`Before: ${commandName}`);\n  const result = await next();\n  console.log(`After: ${commandName}, success: ${result.success}`);\n  return result;\n};\n```\n\n## Validation Utilities\n\n```typescript\nimport { validateInput, validateOrThrow, isValid, patterns } from '@lushly-dev/afd-server';\n\n// Validate and get result\nconst result = validateInput(schema, data);\nif (!result.success) {\n  console.log(result.errors);\n}\n\n// Validate or throw\ntry {\n  const data = validateOrThrow(schema, input);\n} catch (e) {\n  if (e instanceof ValidationException) {\n    console.log(e.errors);\n  }\n}\n\n// Check validity\nif (isValid(schema, data)) {\n  // data is typed\n}\n\n// Common patterns\nconst schema = z.object({\n  id: patterns.uuid,\n  email: patterns.email,\n  count: patterns.positiveInt,\n  ...patterns.pagination,\n});\n```\n\n## API Reference\n\n### defineCommand(options)\n\nCreate a command definition with Zod schema.\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `name` | string | Yes | Unique command name (e.g., `user-create`) |\n| `description` | string | Yes | Human-readable description |\n| `input` | ZodType | Yes | Zod schema for input validation |\n| `handler` | function | Yes | Command implementation |\n| `category` | string | No | Category for grouping |\n| `mutation` | boolean | No | Whether command has side effects |\n| `version` | string | No | Command version |\n| `tags` | string[] | No | Additional tags |\n| `output` | ZodType | No | Output schema — declares response `data` shape for agent introspection |\n| `contexts` | string[] | No | Restrict command to specific contexts (omit for universal) |\n| `requires` | string[] | No | Commands that should be called before this one (metadata only) |\n| `errors` | string[] | No | Possible error codes |\n\n### createMcpServer(options)\n\nCreate an MCP server from commands.\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `name` | string | Yes | Server name |\n| `version` | string | Yes | Server version |\n| `commands` | array | Yes | Command definitions |\n| `transport` | `'stdio' \\| 'http' \\| 'auto'` | No | Transport protocol (default: `'auto'`) |\n| `port` | number | No | Port for HTTP transport (default: 3100) |\n| `host` | string | No | Host for HTTP transport (default: localhost) |\n| `toolStrategy` | `'individual' \\| 'grouped' \\| 'lazy'` | No | How commands appear as MCP tools (default: `'grouped'`) |\n| `contexts` | `{ name, description }[]` | No | Context scopes for dynamic tool filtering |\n| `devMode` | boolean | No | Enable development mode (default: false) |\n| `cors` | boolean | No | Enable CORS for HTTP transport (default: follows devMode) |\n| `middleware` | array | No | Middleware functions |\n| `onCommand` | function | No | Command execution callback |\n| `onError` | function | No | Error callback |\n\n### defaultMiddleware(options?)\n\nReturns a pre-configured `CommandMiddleware[]` with trace ID generation, logging, and timing.\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `logging` | `LoggingOptions \\| false` | enabled | Structured logging config, or `false` to disable |\n| `timing` | `TimingOptions \\| false` | enabled (1000ms) | Slow-command warning config, or `false` to disable |\n| `traceId` | `TraceIdOptions \\| false` | enabled (UUID) | Trace ID auto-generation config, or `false` to disable |\n\n### Server Methods\n\n| Method | Description |\n|--------|-------------|\n| `start()` | Start the server |\n| `stop()` | Stop the server |\n| `getUrl()` | Get server URL (`\"stdio://\"` for stdio transport) |\n| `getTransport()` | Get the resolved transport mode (`\"stdio\"` or `\"http\"`) |\n| `getCommands()` | Get registered commands |\n| `execute(name, input, context)` | Execute command directly |\n\n## HTTP Endpoints\n\nThe server exposes these endpoints:\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/sse` | GET | SSE connection for MCP clients |\n| `/message` | POST | JSON-RPC message endpoint |\n| `/rpc` | POST | Simple JSON-RPC for browser clients |\n| `/health` | GET | Health check |\n\n### Browser-Friendly `/rpc` Endpoint\n\nThe `/rpc` endpoint provides a simple JSON-RPC interface for browser clients:\n\n```typescript\n// Request format\n{\n  method: \"command-name\",  // The command to execute\n  params: { ... },         // Input parameters\n  id: 1                    // Optional request ID\n}\n\n// Response format\n{\n  jsonrpc: \"2.0\",\n  id: 1,\n  result: CommandResult    // The AFD CommandResult\n}\n```\n\n### Browser Example (Vanilla JavaScript)\n\n```javascript\nasync function callCommand(method, params) {\n  const response = await fetch('http://localhost:3100/rpc', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({ method, params, id: Date.now() }),\n  });\n\n  const { result, error } = await response.json();\n  if (error) throw new Error(error.message);\n  return result;\n}\n\n// Usage\nconst result = await callCommand('greet', { name: 'World' });\nconsole.log(result.data.greeting); // \"Hello, World!\"\n```\n\n### CORS Configuration\n\nCORS is enabled by default for HTTP transport. Configure it in server options:\n\n```typescript\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: [greet],\n  transport: 'http',\n  port: 3100,\n  cors: true,      // Enable CORS (default: true)\n  devMode: true,   // Development mode enables permissive CORS\n});\n```\n\n## Lazy Strategy\n\nFor servers with many commands, the `lazy` strategy exposes 5 meta-tools instead of listing all commands:\n\n```typescript\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: allCommands,\n  toolStrategy: 'lazy',\n});\n```\n\nAgents discover commands at runtime: `afd-discover` (filter/list) → `afd-detail` (get schemas) → `afd-call` (execute).\n\n| Meta-Tool | Description |\n|-----------|-------------|\n| `afd-discover` | List commands by category, tag, or search (paginated, max 200) |\n| `afd-detail` | Get full schema for 1–10 commands by name |\n| `afd-call` | Universal dispatcher — available in all strategies |\n| `afd-batch` | Execute multiple commands in one call |\n| `afd-pipe` | Pipeline execution with step references |\n\n## Context Management\n\nDynamic context scoping filters which commands are visible:\n\n```typescript\nconst server = createMcpServer({\n  name: 'my-server',\n  version: '1.0.0',\n  commands: allCommands,\n  contexts: [\n    { name: 'editing', description: 'Document editing tools' },\n    { name: 'reviewing', description: 'Review and approval tools' },\n  ],\n});\n```\n\nWhen contexts are configured, the server registers three additional bootstrap commands:\n\n- **`afd-context-list`** — Lists all contexts and the active context\n- **`afd-context-enter`** — Pushes a context onto the stack (filters visible tools)\n- **`afd-context-exit`** — Pops the current context (restores previous)\n\nCommands without `contexts` are always visible. Context commands themselves are always visible.\n\n## Related\n\n- [@lushly-dev/afd-core](../core) - Core types and helpers\n- [@lushly-dev/afd-client](../client) - MCP client library\n- [@lushly-dev/afd-cli](../cli) - Command-line interface\n- [Example: Todo App](../examples/todo/) - Complete working example\n","readmeFilename":"README.md"}