@nekzus/liop 2.0.0-alpha.3 → 2.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +73 -16
  2. package/dist/bin/agent.js +3 -3
  3. package/dist/bin/agent.js.map +1 -1
  4. package/dist/bridge.d.ts +4 -2
  5. package/dist/bridge.js +1 -1
  6. package/dist/chunk-2MGFSIXN.js +2 -0
  7. package/dist/chunk-2MGFSIXN.js.map +1 -0
  8. package/dist/chunk-4C666HHU.js +2 -0
  9. package/dist/chunk-4C666HHU.js.map +1 -0
  10. package/dist/{chunk-PPCOS2NU.js → chunk-DQ6UW6L7.js} +2 -2
  11. package/dist/chunk-DQ6UW6L7.js.map +1 -0
  12. package/dist/chunk-L5A64CNT.js +54 -0
  13. package/dist/chunk-L5A64CNT.js.map +1 -0
  14. package/dist/chunk-N6FGTZ6A.js +3 -0
  15. package/dist/chunk-N6FGTZ6A.js.map +1 -0
  16. package/dist/chunk-RYYRR4N5.js +31 -0
  17. package/dist/chunk-RYYRR4N5.js.map +1 -0
  18. package/dist/chunk-SB5XJXKV.js +2 -0
  19. package/dist/chunk-SB5XJXKV.js.map +1 -0
  20. package/dist/chunk-SW53FNSN.js +2 -0
  21. package/dist/chunk-SW53FNSN.js.map +1 -0
  22. package/dist/chunk-TYVG6TXQ.js +2 -0
  23. package/dist/chunk-TYVG6TXQ.js.map +1 -0
  24. package/dist/chunk-V5MKJT6S.js +2 -0
  25. package/dist/chunk-V5MKJT6S.js.map +1 -0
  26. package/dist/chunk-VGXNGTIC.js +33 -0
  27. package/dist/chunk-VGXNGTIC.js.map +1 -0
  28. package/dist/chunk-W2QGWRTT.js +3 -0
  29. package/dist/chunk-W2QGWRTT.js.map +1 -0
  30. package/dist/chunk-YZVCAJJO.js +13 -0
  31. package/dist/chunk-YZVCAJJO.js.map +1 -0
  32. package/dist/client.d.ts +3 -2
  33. package/dist/client.js +1 -1
  34. package/dist/gateway.d.ts +14 -3
  35. package/dist/gateway.js +1 -1
  36. package/dist/{index-CyxNLlz7.d.ts → index-B_Vbrb_I.d.ts} +23 -1
  37. package/dist/index-CL8m1L1d.d.ts +500 -0
  38. package/dist/index.d.ts +124 -6
  39. package/dist/index.js +17 -4
  40. package/dist/index.js.map +1 -1
  41. package/dist/kyber-NONMBQNH.js +2 -0
  42. package/dist/{kyber-2WDOTUQX.js.map → kyber-NONMBQNH.js.map} +1 -1
  43. package/dist/mesh.d.ts +3 -0
  44. package/dist/mesh.js +1 -1
  45. package/dist/server.d.ts +5 -324
  46. package/dist/server.js +1 -1
  47. package/dist/types-DzEXgi4s.d.ts +228 -0
  48. package/dist/types.d.ts +3 -148
  49. package/dist/types.js +1 -1
  50. package/dist/verifier-Z26UC7M4.js +2 -0
  51. package/dist/{verifier-RQRYXA4C.js.map → verifier-Z26UC7M4.js.map} +1 -1
  52. package/dist/workers/logic-execution.d.ts +12 -6
  53. package/dist/workers/logic-execution.js +1 -1
  54. package/dist/workers/logic-execution.js.map +1 -1
  55. package/dist/workers/zk-verifier.d.ts +4 -4
  56. package/dist/workers/zk-verifier.js +1 -1
  57. package/dist/workers/zk-verifier.js.map +1 -1
  58. package/package.json +56 -48
  59. package/dist/chunk-7MAGL6ON.js +0 -33
  60. package/dist/chunk-7MAGL6ON.js.map +0 -1
  61. package/dist/chunk-FW6CICSY.js +0 -29
  62. package/dist/chunk-FW6CICSY.js.map +0 -1
  63. package/dist/chunk-HM77MWB6.js +0 -2
  64. package/dist/chunk-HM77MWB6.js.map +0 -1
  65. package/dist/chunk-HNDVAKEK.js +0 -24
  66. package/dist/chunk-HNDVAKEK.js.map +0 -1
  67. package/dist/chunk-HQZHZM6U.js +0 -2
  68. package/dist/chunk-HQZHZM6U.js.map +0 -1
  69. package/dist/chunk-JBMEAXYU.js +0 -13
  70. package/dist/chunk-JBMEAXYU.js.map +0 -1
  71. package/dist/chunk-LYULZHZO.js +0 -3
  72. package/dist/chunk-LYULZHZO.js.map +0 -1
  73. package/dist/chunk-P52IE4L6.js +0 -2
  74. package/dist/chunk-P52IE4L6.js.map +0 -1
  75. package/dist/chunk-PPCOS2NU.js.map +0 -1
  76. package/dist/chunk-UVTEJYHN.js +0 -2
  77. package/dist/chunk-UVTEJYHN.js.map +0 -1
  78. package/dist/kyber-2WDOTUQX.js +0 -2
  79. package/dist/verifier-RQRYXA4C.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/security/prm.ts","../src/gateway/hybrid.ts"],"names":["buildProtectedResourceMetadata","issuer","audience","LIOP_SCOPES","LiopHybridGateway","liopServer","meshNode","rpcPort","LiopMcpRouter","socket","buffer","isHttp2","log","err","stream","headers","contentType","path","req","res","url","method","callback","originalUrl","prm","meshInfo","m","baseUrl","authInfoResponse","t","authInfo","authHeader","e","body","chunk","jsonRequest","response","data","port","host","tools","tool","resolve","reject","addr","actualHost","assignedPort"],"mappings":"iLAoCO,SAASA,CAAAA,CACfC,CAAAA,CACAC,CAAAA,CAC4B,CAC5B,OAAO,CACN,QAAA,CAAUA,CAAAA,CACV,qBAAA,CAAuB,CAACD,CAAM,CAAA,CAC9B,gBAAA,CAAkBE,CAAAA,CAClB,wBAAA,CAA0B,CAAC,QAAQ,CAAA,CACnC,uBAAwB,gCACzB,CACD,CCjCO,IAAMC,CAAAA,CAAN,KAAwB,CAS9B,WAAA,CACSC,CAAAA,CACAC,CAAAA,CAA4B,IAAA,CACpCC,CAAAA,CAAkB,KAAA,CACjB,CAHO,IAAA,CAAA,UAAA,CAAAF,CAAAA,CACA,IAAA,CAAA,QAAA,CAAAC,CAAAA,CAGR,IAAA,CAAK,YAAA,CAAe,IAAA,CAAK,UAAA,CAAW,YAAA,CACpC,IAAA,CAAK,aAAA,CAAgB,IAAA,CAAK,UAAA,CAAW,aAAA,CAGrC,KAAK,MAAA,CAAS,IAAIE,CAAAA,CAAc,IAAA,CAAK,UAAA,CAAY,IAAA,CAAK,SAAUD,CAAO,CAAA,CAGvE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A,CAAK,SAAA,CAAU,EAAA,CAAG,OAAA,CAAU9B,CAAAA,EAAmC,CAC1DA,CAAAA,CAAI,IAAA,GAAS,YAAA,CAChBD,CAAAA,CAAI,IAAA,CACH,CAAA,2BAAA,EAA8B0B,CAAI,CAAA,sCAAA,CACnC,CAAA,CAEA1B,CAAAA,CAAI,KAAA,CAAM,CAAA,8BAAA,EAAiCC,CAAAA,CAAI,OAAO,CAAA,CAAE,CAAA,CAEzD8B,CAAAA,CAAO9B,CAAG,EACX,CAAC,CAAA,CAED,IAAA,CAAK,SAAA,CAAU,MAAA,CAAOyB,CAAAA,CAAMC,CAAAA,CAAM,IAAM,CACvC,IAAMK,CAAAA,CAAO,IAAA,CAAK,SAAA,CAAU,OAAA,EAAQ,CAC9BC,CAAAA,CACL,OAAOD,CAAAA,EAAS,QAAA,CAAWA,CAAAA,CAAOA,CAAAA,EAAM,OAAA,EAAWL,CAAAA,CAC9CO,GAAAA,CACL,OAAOF,CAAAA,EAAS,QAAA,CAAWN,CAAAA,CAAOM,CAAAA,EAAM,IAAA,EAAQN,CAAAA,CAEjD1B,CAAAA,CAAI,IAAA,CACH,CAAA,sEAAA,EAAoEiC,CAAU,CAAA,CAAA,EAAIC,GAAY,CAAA,CAC/F,CAAA,CACAJ,CAAAA,CAAQI,GAAY,EACrB,CAAC,EACF,CAAC,CACF,CAEA,MAAa,IAAA,EAAO,CACf,IAAA,CAAK,QAAA,EACR,MAAM,IAAA,CAAK,QAAA,CAAS,IAAA,EAAK,CAE1B,IAAA,CAAK,SAAA,CAAU,KAAA,EAAM,CACrB,IAAA,CAAK,QAAA,CAAS,KAAA,EAAM,CACpB,IAAA,CAAK,QAAA,CAAS,KAAA,GACf,CAEO,SAAA,EAA2B,CACjC,OAAO,IAAA,CAAK,MACb,CACD","file":"chunk-YZVCAJJO.js","sourcesContent":["/**\n * LIOP Protected Resource Metadata — RFC 9728\n *\n * Builds the JSON document served at /.well-known/oauth-protected-resource.\n * This enables MCP clients to discover the authorization server and\n * required scopes for accessing LIOP tools and resources.\n *\n * Standards: RFC 9728, MCP Spec 2025-11-25\n */\n\nimport { LIOP_SCOPES } from \"./rbac.js\";\n\n/**\n * RFC 9728 Protected Resource Metadata response.\n *\n * @see https://datatracker.ietf.org/doc/rfc9728\n */\nexport interface ProtectedResourceMetadata {\n\t/** Identifier for the protected resource. */\n\tresource: string;\n\t/** Array of authorization server issuer URLs that can issue tokens for this resource. */\n\tauthorization_servers: string[];\n\t/** OAuth scopes accepted by this resource. */\n\tscopes_supported: readonly string[];\n\t/** Methods of presenting the bearer token (always \"header\" for LIOP). */\n\tbearer_methods_supported: string[];\n\t/** URL to the resource documentation. */\n\tresource_documentation: string;\n}\n\n/**\n * Builds the Protected Resource Metadata document (RFC 9728).\n *\n * @param issuer - OIDC issuer URL of the Nexus authorization server\n * @param audience - JWT audience claim (resource identifier)\n */\nexport function buildProtectedResourceMetadata(\n\tissuer: string,\n\taudience: string,\n): ProtectedResourceMetadata {\n\treturn {\n\t\tresource: audience,\n\t\tauthorization_servers: [issuer],\n\t\tscopes_supported: LIOP_SCOPES,\n\t\tbearer_methods_supported: [\"header\"],\n\t\tresource_documentation: \"https://github.com/nekzus/liop\",\n\t};\n}\n","import * as http from \"node:http\";\nimport * as http2 from \"node:http2\";\nimport * as net from \"node:net\";\nimport type { MeshNode } from \"../mesh/index.js\";\nimport type { AuthInfo, JwtValidator } from \"../security/jwt-validator.js\";\nimport { buildProtectedResourceMetadata } from \"../security/prm.js\";\nimport type { LiopServer } from \"../server/index.js\";\nimport { log } from \"../utils/logger.js\";\nimport { LiopMcpRouter } from \"./router.js\";\n\n/**\n * LIOP Hybrid Gateway\n * High-level orchestration for connecting MCP (JSON-RPC) clients to the LIOP Mesh.\n */\nexport class LiopHybridGateway {\n\tprivate netServer: net.Server;\n\tprivate h2Server: http2.Http2Server;\n\tprivate h1Server: http.Server;\n\tprivate router: LiopMcpRouter;\n\tprivate jwtValidator?: JwtValidator;\n\t// biome-ignore lint/suspicious/noExplicitAny: oidc-provider is loaded in Phase C\n\tprivate oauthProvider?: any;\n\n\tconstructor(\n\t\tprivate liopServer: LiopServer,\n\t\tprivate meshNode: MeshNode | null = null,\n\t\trpcPort: number = 50051,\n\t) {\n\t\tthis.jwtValidator = this.liopServer.jwtValidator;\n\t\tthis.oauthProvider = this.liopServer.oauthProvider;\n\n\t\t// Initialize the Universal Router\n\t\tthis.router = new LiopMcpRouter(this.liopServer, this.meshNode, rpcPort);\n\n\t\t// Internal HTTP/2 Server (for Native gRPC Proxying)\n\t\tthis.h2Server = http2.createServer();\n\t\tthis.setupH2Routes();\n\n\t\t// Internal HTTP/1 Server (for Browser/MCP)\n\t\tthis.h1Server = http.createServer();\n\t\tthis.setupH1Routes();\n\n\t\t// Primary Multiplexer (L4)\n\t\tthis.netServer = net.createServer((socket) => {\n\t\t\tsocket.once(\"data\", (buffer) => {\n\t\t\t\tconst isHttp2 = buffer.toString().startsWith(\"PRI * HTTP/2.0\");\n\t\t\t\tlog.info(\n\t\t\t\t\t`[LIOP-Gateway] Incoming L4 Connection. Protocol: ${isHttp2 ? \"HTTP/2 (gRPC)\" : \"HTTP/1.1 (MCP)\"}`,\n\t\t\t\t);\n\t\t\t\tif (isHttp2) {\n\t\t\t\t\tthis.h2Server.emit(\"connection\", socket);\n\t\t\t\t} else {\n\t\t\t\t\tthis.h1Server.emit(\"connection\", socket);\n\t\t\t\t}\n\t\t\t\tsocket.unshift(buffer);\n\t\t\t});\n\t\t\tsocket.on(\"error\", (err) =>\n\t\t\t\tlog.error(`[LIOP-Gateway] NetServer Socket Error: ${err.message}`),\n\t\t\t);\n\t\t});\n\n\t\t// Attach error listeners to sub-servers to catch silent failures\n\t\tthis.h1Server.on(\"error\", (err) =>\n\t\t\tlog.error(`[LIOP-Gateway] H1 Server Error: ${err.message}`),\n\t\t);\n\t\tthis.h2Server.on(\"error\", (err) =>\n\t\t\tlog.error(`[LIOP-Gateway] H2 Server Error: ${err.message}`),\n\t\t);\n\n\t\tlog.info(\"[LIOP-Gateway] Hybrid adapter initialized.\");\n\t}\n\n\tprivate setupH2Routes() {\n\t\tthis.h2Server.on(\"stream\", (stream, headers) => {\n\t\t\tconst contentType = headers[\"content-type\"] as string;\n\t\t\tconst path = headers[\":path\"] as string;\n\n\t\t\tif (contentType === \"application/grpc\") {\n\t\t\t\tthis.handleGrpcStream(stream as http2.ServerHttp2Stream);\n\t\t\t} else if (path === \"/mcp\") {\n\t\t\t\tthis.handleMcpH2Stream(stream as http2.ServerHttp2Stream, headers);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate setupH1Routes() {\n\t\tthis.h1Server.on(\"request\", async (req, res) => {\n\t\t\tconst url = req.url || \"\";\n\t\t\tconst method = req.method;\n\n\t\t\t// [SEC] M2M OAuth 2.1 OIDC Authorization Server Router (Phase C proxy)\n\t\t\tif (url.startsWith(\"/oidc\") && this.oauthProvider) {\n\t\t\t\tconst callback =\n\t\t\t\t\ttypeof this.oauthProvider.callback === \"function\"\n\t\t\t\t\t\t? this.oauthProvider.callback()\n\t\t\t\t\t\t: this.oauthProvider;\n\t\t\t\t// Rewrite req.url to strip the '/oidc' prefix before delegating to oidc-provider\n\t\t\t\tconst originalUrl = req.url;\n\t\t\t\treq.url = (originalUrl || \"\").slice(5) || \"/\";\n\t\t\t\ttry {\n\t\t\t\t\treturn callback(req, res);\n\t\t\t\t} finally {\n\t\t\t\t\treq.url = originalUrl;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// [SEC] RFC 9728 Protected Resource Metadata (PRM) Endpoint\n\t\t\tif (method === \"GET\" && url === \"/.well-known/oauth-protected-resource\") {\n\t\t\t\tif (this.jwtValidator) {\n\t\t\t\t\tconst prm = buildProtectedResourceMetadata(\n\t\t\t\t\t\tthis.jwtValidator.getIssuer(),\n\t\t\t\t\t\tthis.jwtValidator.getAudience(),\n\t\t\t\t\t);\n\t\t\t\t\tres.writeHead(200, { \"Content-Type\": \"application/json\" });\n\t\t\t\t\tres.end(JSON.stringify(prm));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tres.writeHead(404);\n\t\t\t\tres.end(\"Not Found\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tmethod === \"GET\" &&\n\t\t\t\t(url === \"/\" || url === \"/mcp\" || url === \"/health\")\n\t\t\t) {\n\t\t\t\tif (\n\t\t\t\t\turl === \"/health\" &&\n\t\t\t\t\treq.headers.accept?.includes(\"application/json\")\n\t\t\t\t) {\n\t\t\t\t\tconst meshInfo = this.meshNode\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tpeerId: this.meshNode.getPeerId()?.toString() || \"\",\n\t\t\t\t\t\t\t\tmultiaddrs: this.meshNode\n\t\t\t\t\t\t\t\t\t.getMultiaddrs()\n\t\t\t\t\t\t\t\t\t.map((m) => m.toString()),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: null;\n\t\t\t\t\tconst issuer = this.jwtValidator?.getIssuer();\n\t\t\t\t\tconst baseUrl = issuer\n\t\t\t\t\t\t? issuer.endsWith(\"/oidc\")\n\t\t\t\t\t\t\t? issuer\n\t\t\t\t\t\t\t: `${issuer}/oidc`\n\t\t\t\t\t\t: \"\";\n\t\t\t\t\tconst authInfoResponse =\n\t\t\t\t\t\tthis.jwtValidator && issuer\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tissuer,\n\t\t\t\t\t\t\t\t\tjwks_uri: `${baseUrl}/jwks`,\n\t\t\t\t\t\t\t\t\t...(this.oauthProvider\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\ttoken_endpoint: `${baseUrl}/token`,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined;\n\n\t\t\t\t\tres.writeHead(200, { \"Content-Type\": \"application/json\" });\n\t\t\t\t\tres.end(\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tstatus: \"healthy\",\n\t\t\t\t\t\t\tnode: this.liopServer.getServerInfo(),\n\t\t\t\t\t\t\tmesh: meshInfo,\n\t\t\t\t\t\t\ttools: this.liopServer.listTools().map((t) => t.name),\n\t\t\t\t\t\t\tauth: authInfoResponse,\n\t\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tres.writeHead(200, { \"Content-Type\": \"text/html; charset=utf-8\" });\n\t\t\t\tres.end(`\n <body style=\"background:#0f172a;color:#f8fafc;font-family:sans-serif;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;margin:0\">\n <div style=\"background:#1e293b;padding:40px;border-radius:16px;border:1px solid #38bdf8;text-align:center;box-shadow:0 20px 25px -5px rgba(0,0,0,0.1)\">\n <h1 style=\"color:#38bdf8;margin-top:0\">LIOP Protocol Transformer</h1>\n <p style=\"opacity:0.8;font-weight:600\">L4/L7 Transcoding: JSON-RPC &harr; gRPC</p>\n <p style=\"opacity:0.6;font-size:14px\">Active Protections: Kyber768 + AES-256-GCM + ZK-Proof Ready</p>\n <div style=\"background:#0f172a;padding:15px;border-radius:8px;margin-top:20px;border:1px dashed #334155\">\n <code style=\"color:#10b981\">Endpoint: http://localhost:3000/mcp</code>\n </div>\n </div>\n </body>\n `);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (url === \"/mcp\" && method === \"POST\") {\n\t\t\t\tlet authInfo: AuthInfo | null = null;\n\n\t\t\t\t// [SEC] Continuous verification of Bearer token (NIST SP 800-207)\n\t\t\t\tif (this.jwtValidator) {\n\t\t\t\t\tconst authHeader = req.headers.authorization;\n\t\t\t\t\tif (!authHeader?.startsWith(\"Bearer \")) {\n\t\t\t\t\t\tres.writeHead(401, {\n\t\t\t\t\t\t\t\"WWW-Authenticate\":\n\t\t\t\t\t\t\t\t'Bearer error=\"invalid_token\", error_description=\"Missing or malformed Authorization header\"',\n\t\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\tres.end(JSON.stringify({ error: \"Unauthorized\" }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tauthInfo = await this.jwtValidator.validate(authHeader.slice(7));\n\t\t\t\t\t} catch (e: unknown) {\n\t\t\t\t\t\tres.writeHead(401, {\n\t\t\t\t\t\t\t\"WWW-Authenticate\": `Bearer error=\"invalid_token\", error_description=\"${(e as Error).message}\"`,\n\t\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\tres.end(JSON.stringify({ error: \"Invalid token\" }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet body = \"\";\n\t\t\t\treq.on(\"data\", (chunk) => (body += chunk.toString()));\n\t\t\t\treq.on(\"end\", async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst jsonRequest = JSON.parse(body);\n\t\t\t\t\t\tconst response = await this.router.dispatch(jsonRequest, authInfo);\n\t\t\t\t\t\tres.writeHead(200, { \"Content-Type\": \"application/json\" });\n\t\t\t\t\t\tres.end(JSON.stringify(response));\n\t\t\t\t\t} catch (e: unknown) {\n\t\t\t\t\t\tlog.info(\n\t\t\t\t\t\t\t`[LIOP-Gateway] Error processing JSON-RPC payload: ${(e as Error).message}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tres.writeHead(400);\n\t\t\t\t\t\tres.end(\n\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\t\t\t\t\terror: { code: -32700, message: \"Parse error\" },\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tres.writeHead(404);\n\t\t\t\tres.end(\"Not Found\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate handleGrpcStream(stream: http2.ServerHttp2Stream) {\n\t\tstream.on(\"data\", (chunk: unknown) => {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: Standard gRPC stream data is Buffer\n\t\t\tconst data = chunk as any;\n\t\t\tif (data)\n\t\t\t\tlog.info(\n\t\t\t\t\t`[LIOP-Gateway] Native gRPC Proxy passing ${data.length} bytes`,\n\t\t\t\t);\n\t\t});\n\t\tstream.respond({ \":status\": 200, \"content-type\": \"application/grpc\" });\n\t\tstream.end();\n\t}\n\n\tprivate handleMcpH2Stream(\n\t\tstream: http2.ServerHttp2Stream,\n\t\theaders: http2.IncomingHttpHeaders,\n\t) {\n\t\tlet body = \"\";\n\t\tstream.on(\"data\", (chunk) => (body += chunk.toString()));\n\t\tstream.on(\"end\", async () => {\n\t\t\ttry {\n\t\t\t\tlet authInfo: AuthInfo | null = null;\n\n\t\t\t\t// [SEC] Continuous verification of Bearer token over HTTP/2 (NIST SP 800-207)\n\t\t\t\tif (this.jwtValidator) {\n\t\t\t\t\tconst authHeader = headers.authorization as string;\n\t\t\t\t\tif (!authHeader?.startsWith(\"Bearer \")) {\n\t\t\t\t\t\tstream.respond({\n\t\t\t\t\t\t\t\":status\": 401,\n\t\t\t\t\t\t\t\"www-authenticate\":\n\t\t\t\t\t\t\t\t'Bearer error=\"invalid_token\", error_description=\"Missing or malformed Authorization header\"',\n\t\t\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\tstream.end(JSON.stringify({ error: \"Unauthorized\" }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tauthInfo = await this.jwtValidator.validate(authHeader.slice(7));\n\t\t\t\t\t} catch (e: unknown) {\n\t\t\t\t\t\tstream.respond({\n\t\t\t\t\t\t\t\":status\": 401,\n\t\t\t\t\t\t\t\"www-authenticate\": `Bearer error=\"invalid_token\", error_description=\"${(e as Error).message}\"`,\n\t\t\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\tstream.end(JSON.stringify({ error: \"Invalid token\" }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst response = await this.router.dispatch(JSON.parse(body), authInfo);\n\t\t\t\tif (response) {\n\t\t\t\t\tstream.respond({\n\t\t\t\t\t\t\":status\": 200,\n\t\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t\t});\n\t\t\t\t\tstream.end(JSON.stringify(response));\n\t\t\t\t} else stream.close();\n\t\t\t} catch (_e) {\n\t\t\t\tstream.respond({ \":status\": 400 });\n\t\t\t\tstream.end();\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic async listen(port: number, host: string = \"0.0.0.0\"): Promise<number> {\n\t\tif (this.meshNode) {\n\t\t\tawait this.meshNode.start();\n\n\t\t\t// Announce all local tools to the DHT\n\t\t\tconst tools = this.liopServer.listTools();\n\t\t\tfor (const tool of tools) {\n\t\t\t\tawait this.meshNode.announceCapability(tool.name);\n\t\t\t\tlog.info(\n\t\t\t\t\t`[LIOP-Gateway] 📡 Announced local tool to Mesh: ${tool.name}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.netServer.on(\"error\", (err: Error & { code?: string }) => {\n\t\t\t\tif (err.code === \"EADDRINUSE\") {\n\t\t\t\t\tlog.info(\n\t\t\t\t\t\t`[LIOP-Gateway] FATAL: Port ${port} is already in use by another process.`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(`[LIOP-Gateway] Binding Error: ${err.message}`);\n\t\t\t\t}\n\t\t\t\treject(err);\n\t\t\t});\n\n\t\t\tthis.netServer.listen(port, host, () => {\n\t\t\t\tconst addr = this.netServer.address();\n\t\t\t\tconst actualHost =\n\t\t\t\t\ttypeof addr === \"string\" ? addr : addr?.address || host;\n\t\t\t\tconst assignedPort =\n\t\t\t\t\ttypeof addr === \"string\" ? port : addr?.port || port;\n\n\t\t\t\tlog.info(\n\t\t\t\t\t`[LIOP-Gateway] ✅ Transformer Mesh Gateway READY and listening on ${actualHost}:${assignedPort}`,\n\t\t\t\t);\n\t\t\t\tresolve(assignedPort);\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic async stop() {\n\t\tif (this.meshNode) {\n\t\t\tawait this.meshNode.stop();\n\t\t}\n\t\tthis.netServer.close();\n\t\tthis.h2Server.close();\n\t\tthis.h1Server.close();\n\t}\n\n\tpublic getRouter(): LiopMcpRouter {\n\t\treturn this.router;\n\t}\n}\n"]}
package/dist/client.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import './verifier-DTCD9imJ.js';
2
2
  import './mesh.js';
3
- export { a as LiopClient } from './index-CyxNLlz7.js';
4
- import './types.js';
3
+ export { a as LiopClient } from './index-B_Vbrb_I.js';
4
+ import './types-DzEXgi4s.js';
5
5
  import 'zod';
6
+ import 'jose';
package/dist/client.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as LiopClient}from'./chunk-P52IE4L6.js';import'./chunk-UVTEJYHN.js';import'./chunk-ANFXJGMP.js';import'./chunk-DBXGYHKY.js';import'./chunk-HM77MWB6.js';import'./chunk-PPCOS2NU.js';import'./chunk-S6RJHZV2.js';//# sourceMappingURL=client.js.map
1
+ export{b as LiopClient}from'./chunk-N6FGTZ6A.js';import'./chunk-SW53FNSN.js';import'./chunk-ANFXJGMP.js';import'./chunk-DBXGYHKY.js';import'./chunk-V5MKJT6S.js';import'./chunk-DQ6UW6L7.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';//# sourceMappingURL=client.js.map
2
2
  //# sourceMappingURL=client.js.map
package/dist/gateway.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { MeshNode } from './mesh.js';
2
- import { LiopServer } from './server.js';
2
+ import { L as LiopServer } from './index-CL8m1L1d.js';
3
3
  import { L as LiopVerifier } from './verifier-DTCD9imJ.js';
4
- import { McpRequest, McpResponse } from './types.js';
4
+ import { M as McpRequest, A as AuthInfo, b as McpResponse } from './types-DzEXgi4s.js';
5
5
  import 'zod';
6
+ import 'jose';
6
7
 
7
8
  /**
8
9
  * LIOP MCP Router
@@ -34,7 +35,7 @@ declare class LiopMcpRouter {
34
35
  private shouldSkipManifestQuery;
35
36
  private recordManifestQuerySuccess;
36
37
  private recordManifestQueryFailure;
37
- dispatch(request: McpRequest): Promise<McpResponse | null>;
38
+ dispatch(request: McpRequest, authInfo?: AuthInfo | null): Promise<McpResponse | null>;
38
39
  /**
39
40
  * MCP clients often send notifications/initialized then immediately tools/list.
40
41
  * Start manifest discovery without blocking the notification handler.
@@ -73,6 +74,14 @@ declare class LiopMcpRouter {
73
74
  private redactPeerId;
74
75
  private transcodeMcpToLiop;
75
76
  private routeToRemoteProvider;
77
+ /** Cached M2M token for dynamic gateway-to-node routing */
78
+ private meshAgentToken?;
79
+ /**
80
+ * Dynamically acquires an M2M access token from the Nexus Authorization Server.
81
+ * If peerId is provided, checks if there are node-specific environment tokens
82
+ * before falling back to the global static token or Nexus acquisition.
83
+ */
84
+ private getOrAcquireMeshAgentToken;
76
85
  private performTranscoding;
77
86
  private encryptWithNonce;
78
87
  }
@@ -88,6 +97,8 @@ declare class LiopHybridGateway {
88
97
  private h2Server;
89
98
  private h1Server;
90
99
  private router;
100
+ private jwtValidator?;
101
+ private oauthProvider?;
91
102
  constructor(liopServer: LiopServer, meshNode?: MeshNode | null, rpcPort?: number);
92
103
  private setupH2Routes;
93
104
  private setupH1Routes;
package/dist/gateway.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as LiopHybridGateway}from'./chunk-JBMEAXYU.js';import'./chunk-7MAGL6ON.js';import'./chunk-UVTEJYHN.js';import'./chunk-ANFXJGMP.js';import'./chunk-DBXGYHKY.js';import'./chunk-HM77MWB6.js';import'./chunk-S6RJHZV2.js';//# sourceMappingURL=gateway.js.map
1
+ export{b as LiopHybridGateway}from'./chunk-YZVCAJJO.js';import'./chunk-VGXNGTIC.js';import'./chunk-SW53FNSN.js';import'./chunk-ANFXJGMP.js';import'./chunk-DBXGYHKY.js';import'./chunk-SB5XJXKV.js';import'./chunk-V5MKJT6S.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';//# sourceMappingURL=gateway.js.map
2
2
  //# sourceMappingURL=gateway.js.map
@@ -1,6 +1,6 @@
1
1
  import { L as LiopVerifier } from './verifier-DTCD9imJ.js';
2
2
  import { MeshNodeConfig } from './mesh.js';
3
- import { CallToolRequest, CallToolResult } from './types.js';
3
+ import { C as CallToolRequest, a as CallToolResult } from './types-DzEXgi4s.js';
4
4
 
5
5
  /**
6
6
  * LIOP TLS Configuration
@@ -8,6 +8,15 @@ import { CallToolRequest, CallToolResult } from './types.js';
8
8
  * Provides conditional TLS credential factories for gRPC connections.
9
9
  * When TLS options are provided, connections are secured with mutual TLS.
10
10
  * Otherwise, falls back to insecure credentials (alpha/development mode).
11
+ *
12
+ * Production Hardening (Phase 128):
13
+ * - When NODE_ENV=production and TLS is configured but certificate loading
14
+ * fails, the system throws a fatal error instead of silently degrading
15
+ * to insecure credentials. This prevents MITM/eavesdropping attacks
16
+ * caused by misconfigured certificate paths going unnoticed.
17
+ * - Reference: gRPC-node official docs — "Using insecure credentials in
18
+ * production poses significant security risks including eavesdropping,
19
+ * MITM attacks, and lack of authentication."
11
20
  */
12
21
 
13
22
  interface LiopTlsOptions {
@@ -30,13 +39,26 @@ declare class LiopClient {
30
39
  private tlsOptions?;
31
40
  private serverInfo?;
32
41
  verifier: LiopVerifier;
42
+ private oauthToken?;
33
43
  constructor(tls?: LiopTlsOptions);
44
+ /**
45
+ * Requests an M2M access token from the Nexus Authorization Server using Client Credentials.
46
+ */
47
+ private acquireM2MToken;
34
48
  /**
35
49
  * Discovers and connects to the target server or mesh capability.
36
50
  * If address is omitted, it sets up the MeshNode to act purely dynamically.
37
51
  */
38
52
  connect(address?: string, options?: {
39
53
  meshConfig?: MeshNodeConfig;
54
+ auth?: {
55
+ clientId?: string;
56
+ clientSecret?: string;
57
+ nexusUrl?: string;
58
+ audience?: string;
59
+ scope?: string;
60
+ token?: string;
61
+ };
40
62
  }): Promise<void>;
41
63
  /**
42
64
  * Dynamically queries Kademlia DHT to find the optimal PeerID providing the Capability
@@ -0,0 +1,500 @@
1
+ import { z } from 'zod';
2
+ import { MeshNode } from './mesh.js';
3
+ import { J as JwtValidator, S as ServerInfo, a as CallToolResult, P as Prompt, G as GetPromptRequest, c as GetPromptResult, C as CallToolRequest, T as Tool, R as Resource } from './types-DzEXgi4s.js';
4
+
5
+ /**
6
+ * LIOP OAuth 2.1 Hybrid Auth — Configuration Types
7
+ *
8
+ * Defines the auth configuration interface consumed by LiopServerOptions.
9
+ * Designed for zero-friction developer experience: most values auto-resolve.
10
+ *
11
+ * Standards: NIST SP 800-207, OWASP API-A07, MCP Spec 2025-11-25
12
+ */
13
+ /**
14
+ * Role of this node in the LIOP auth hierarchy.
15
+ * - "nexus": Runs the embedded Authorization Server (oidc-provider) + Resource Server.
16
+ * - "node": Resource Server only; validates JWTs issued by the Nexus.
17
+ * - "none": Auth disabled (dev mode, stdio/local transport).
18
+ */
19
+ type AuthRole = "nexus" | "node" | "none";
20
+ /**
21
+ * OAuth client registration for M2M (Client Credentials) flows.
22
+ * Used exclusively by the Nexus role.
23
+ */
24
+ interface OAuthClientConfig {
25
+ /** Unique identifier for the OAuth client. */
26
+ client_id: string;
27
+ /** Client secret for authentication (client_secret_post). */
28
+ client_secret: string;
29
+ /** OAuth grant types allowed for this client (e.g., ["client_credentials"]). */
30
+ grant_types: string[];
31
+ /** Space-delimited scopes this client can request. */
32
+ scope: string;
33
+ }
34
+ /**
35
+ * LIOP Auth Configuration.
36
+ *
37
+ * Minimal surface for developers:
38
+ * - Nexus node: { role: "nexus" }
39
+ * - Data node: { role: "node" }
40
+ * - Dev/stdio: omit or { role: "none" }
41
+ *
42
+ * All other fields auto-resolve from env, DHT, or secure defaults.
43
+ */
44
+ interface LiopAuthConfig {
45
+ /** Role of this node in the auth hierarchy. */
46
+ role: AuthRole;
47
+ /**
48
+ * OIDC Issuer URL. Auto-derived:
49
+ * - Nexus: inferred from listen address (e.g., "http://localhost:3000")
50
+ * - Node: resolved from Nexus /health endpoint
51
+ */
52
+ issuer?: string;
53
+ /**
54
+ * JWT audience claim.
55
+ * Default: "urn:liop:mesh:api"
56
+ */
57
+ audience?: string;
58
+ /**
59
+ * URL of the Nexus authorization server (node role only).
60
+ * Fallback: env.LIOP_NEXUS_URL → DHT auto-discovery.
61
+ */
62
+ nexusUrl?: string;
63
+ /**
64
+ * Required scopes for accessing this node's tools.
65
+ * Default: auto-derived from registered tools.
66
+ */
67
+ requiredScopes?: string[];
68
+ /**
69
+ * Pre-registered OAuth clients (nexus role only).
70
+ * Fallback: auto-detected from env.LIOP_OAUTH_CLIENT_ID + env.LIOP_OAUTH_CLIENT_SECRET.
71
+ */
72
+ clients?: OAuthClientConfig[];
73
+ /**
74
+ * Path to local token revocation JSON list (Resource Token Revocation List).
75
+ * Saved as an array of SHA-256 hashes of revoked access tokens.
76
+ */
77
+ revocationPath?: string;
78
+ /**
79
+ * Pre-shared local test token for isolated testing in non-production environments.
80
+ * A token matching this will bypass remote JWKS check only on this specific node.
81
+ */
82
+ localTestToken?: string;
83
+ }
84
+ /**
85
+ * Secure defaults for the OAuth subsystem.
86
+ * Sources: NIST SP 800-207 §3.1, NIST SP 800-63B, OWASP API-A07
87
+ */
88
+ declare const AUTH_DEFAULTS: {
89
+ /** JWT audience claim for the LIOP mesh API. */
90
+ readonly audience: "urn:liop:mesh:api";
91
+ /** M2M token time-to-live in seconds (1 hour). */
92
+ readonly tokenTtlSeconds: 3600;
93
+ /** JWKS cache TTL in milliseconds (10 min — jose default). */
94
+ readonly jwksCacheTtlMs: 600000;
95
+ /** Minimum interval between JWKS refetches (30s — jose default). */
96
+ readonly jwksCooldownMs: 30000;
97
+ /** Clock tolerance for JWT expiration checks (mesh clock skew). */
98
+ readonly clockToleranceSec: 5;
99
+ /** JWT signing algorithm (aligned with libp2p Ed25519 PeerID curve). */
100
+ readonly signingAlgorithm: "EdDSA";
101
+ };
102
+
103
+ /** Single named entity detected by the NER scanner. */
104
+ interface NerEntity {
105
+ type: "person" | "place" | "organization";
106
+ text: string;
107
+ }
108
+ /** Result of an NER scan operation. */
109
+ interface NerScanResult {
110
+ detected: boolean;
111
+ entities: NerEntity[];
112
+ }
113
+ /**
114
+ * Scans text content for named entities that may represent PII.
115
+ * Uses `compromise/three` for person, place, and organization detection.
116
+ *
117
+ * Designed for egress filtering — optimized for recall over precision
118
+ * to ensure sensitive data does not leak through aliased output keys.
119
+ */
120
+ declare class NerScanner {
121
+ private static nlp;
122
+ /**
123
+ * Lazy loads the compromise library only when needed.
124
+ */
125
+ private getNlp;
126
+ /**
127
+ * Scans a single string value for named entities.
128
+ * Returns detected entities if the text contains recognizable PII.
129
+ */
130
+ scan(text: string): Promise<NerScanResult>;
131
+ /**
132
+ * Recursively scans all string values within an object/array.
133
+ * Stops at the first detection for performance (fail-fast).
134
+ */
135
+ scanDeep(input: unknown, seen?: WeakSet<object>): Promise<NerScanResult>;
136
+ }
137
+
138
+ /**
139
+ * LIOP Egress Shield Output Sanitizer (NIST SP 800-226 and OWASP DLP 2025 compliant)
140
+ * Recursively sanitizes execution outputs by rounding floating-point numbers
141
+ * and clamping negative values to zero floor where appropriate.
142
+ *
143
+ * Implements absolute immutability, returning a fresh copy of the data.
144
+ */
145
+ interface OutputSanitizerConfig {
146
+ /** Maximum decimal places for floating-point values (default: 4) */
147
+ maxDecimalPlaces?: number;
148
+ /** Clamp negative values to zero floor (default: true) */
149
+ clampNonNegative?: boolean;
150
+ }
151
+ /**
152
+ * Recursively walks a JSON-like tree, rounding floats and clamping negative values.
153
+ *
154
+ * @param output - The raw or DP-modified output object/value to sanitize
155
+ * @param config - Sanitization parameters (rounding depth, negative clamping)
156
+ * @returns A sanitized deep copy of the output
157
+ */
158
+ declare function sanitizeOutput(output: unknown, config?: OutputSanitizerConfig): unknown;
159
+
160
+ /**
161
+ * LIOP Professional PII Engine (The Shield V2 - Tier-1 Military Edition)
162
+ * Implements high-fidelity detection based on NIST and OWASP standards.
163
+ * Features Multi-Layer Verification (Regex + Algorithmic Validators).
164
+ */
165
+ type PiiRuleDefinition = {
166
+ name: string;
167
+ pattern: string | RegExp;
168
+ validator?: (match: string) => boolean;
169
+ };
170
+ type PiiRule = string | RegExp | PiiRuleDefinition;
171
+ declare const PII_PATTERNS: {
172
+ EMAIL: PiiRuleDefinition;
173
+ CREDIT_CARD: PiiRuleDefinition;
174
+ IP_ADDRESS: PiiRuleDefinition;
175
+ PHONE: PiiRuleDefinition;
176
+ SSN: PiiRuleDefinition;
177
+ IBAN: PiiRuleDefinition;
178
+ PASSPORT_MRZ: PiiRuleDefinition;
179
+ };
180
+ /**
181
+ * Regional and Cultural Security Presets for Out-Of-The-Box compliance.
182
+ * Developers can override, merge, or omit these based on local laws.
183
+ */
184
+ declare const PII_PRESETS: {
185
+ GLOBAL_STRICT: PiiRuleDefinition[];
186
+ US_COMPLIANT: PiiRuleDefinition[];
187
+ EU_GDPR: PiiRuleDefinition[];
188
+ };
189
+ declare class PiiScanner {
190
+ private patterns;
191
+ private forbiddenKeysSet;
192
+ private nerScanner;
193
+ /**
194
+ * Safelist of keys that contain forbidden substrings but are NOT PII.
195
+ * Prevents false positives from fuzzy matching (e.g., "grid" contains "id").
196
+ */
197
+ private static readonly KEY_SAFELIST;
198
+ /**
199
+ * Short forbidden tokens (< 4 chars) that require boundary-aware matching.
200
+ * Uses regex boundary detection to avoid false positives.
201
+ */
202
+ private shortTokenBoundaryPatterns;
203
+ /**
204
+ * Long forbidden tokens (>= 4 chars) that use substring containment.
205
+ */
206
+ private longForbiddenTokens;
207
+ constructor(patterns?: PiiRule[], forbiddenKeys?: string[], nerScanner?: NerScanner | null);
208
+ /**
209
+ * Scans any input (string, object, array) for PII violations.
210
+ * Returns the pattern/rule name that triggered the violation, or null if safe.
211
+ *
212
+ * Detection pipeline (fail-fast):
213
+ * 1. Exact key match (O(1) Set lookup)
214
+ * 2. Fuzzy key match (boundary detection for short tokens, substring for long)
215
+ * 3. Regex/algorithmic pattern match on string values
216
+ * 4. NER content scan on string values (if enabled)
217
+ */
218
+ scan(input: unknown, seen?: WeakSet<object>): Promise<string | null>;
219
+ /**
220
+ * Checks a key against fuzzy matching rules.
221
+ * Short tokens use boundary-aware regex; long tokens use substring containment.
222
+ */
223
+ private checkKeyFuzzy;
224
+ private checkString;
225
+ }
226
+
227
+ type ToolHandler<T extends z.ZodRawShape = z.ZodRawShape> = (args: z.infer<z.ZodObject<T>>, extra: {
228
+ signal?: AbortSignal;
229
+ }) => Promise<CallToolResult>;
230
+ interface LiopServerOptions {
231
+ capabilities?: Record<string, unknown>;
232
+ workerPool?: {
233
+ enabled?: boolean;
234
+ minThreads?: number;
235
+ maxThreads?: number;
236
+ idleTimeout?: number;
237
+ /** Max heap memory per worker in MB (default: 64). Prevents heap bomb DoS. */
238
+ maxHeapMb?: number;
239
+ };
240
+ security?: {
241
+ piiPatterns?: PiiRule[];
242
+ forbiddenKeys?: string[];
243
+ sensitiveKeys?: string[];
244
+ /** Enable NLP-based Named Entity Recognition scanning on output values. */
245
+ enableNerScanning?: boolean;
246
+ /** Rate limiting configuration for tool calls (OWASP A01). */
247
+ rateLimit?: {
248
+ /** Maximum calls per window per tool (default: 15). */
249
+ maxPerWindow?: number;
250
+ /** Maximum calls per window across ALL tools combined (default: 40). */
251
+ globalMaxPerWindow?: number;
252
+ /** Sliding window duration in milliseconds (default: 60000 = 1 min). */
253
+ windowMs?: number;
254
+ };
255
+ };
256
+ taxonomy?: {
257
+ domain?: string;
258
+ clearanceTier?: number;
259
+ executionTypes?: string[];
260
+ };
261
+ /**
262
+ * OAuth 2.1 Hybrid Auth configuration.
263
+ *
264
+ * Minimal usage:
265
+ * - Nexus (Authorization Server): `{ role: "nexus" }`
266
+ * - Data Node (Resource Server): `{ role: "node" }`
267
+ * - Disabled (dev/stdio): omit or `{ role: "none" }`
268
+ *
269
+ * All other values (issuer, JWKS, audience) auto-resolve from
270
+ * env vars, DHT discovery, or secure defaults.
271
+ */
272
+ auth?: LiopAuthConfig;
273
+ /**
274
+ * Canonical slug for deterministic token resolution.
275
+ * Agents/clients resolve `LIOP_TOKEN_<tokenSlug>` from environment.
276
+ * Must match SCREAMING_SNAKE_CASE: /^[A-Z][A-Z0-9_]*$/ (e.g., "BANK", "VAULT", "HFT_ORACLE").
277
+ */
278
+ tokenSlug?: string;
279
+ }
280
+ interface AggregationPolicy {
281
+ /** Maximum number of object-type array elements allowed (default: 10) */
282
+ maxOutputRows?: number;
283
+ /** Allow arrays containing only primitive values (default: true) */
284
+ allowPrimitiveArrays?: boolean;
285
+ /** Block min/max extraction when dataset size < this value (default: 50) */
286
+ minMaxBlockThreshold?: number;
287
+ }
288
+ interface LogicExecutionPolicy {
289
+ /**
290
+ * Validate the business payload returned by sandbox logic (post-execution).
291
+ * This runs before final egress checks and blocks non-conforming outputs.
292
+ */
293
+ outputSchema?: z.ZodType<unknown>;
294
+ /**
295
+ * Enforce aggregation-first heuristics (preflight + post-check).
296
+ */
297
+ enforceAggregationFirst?: boolean | AggregationPolicy;
298
+ /**
299
+ * Optional additional deny patterns checked against extracted logic source.
300
+ */
301
+ preflightDenyPatterns?: RegExp[];
302
+ /**
303
+ * Differential Privacy epsilon per query (default: 1.0).
304
+ * Lower = stronger privacy + more noise. Standard: Apple iOS uses 1.0.
305
+ */
306
+ dpEpsilon?: number;
307
+ /**
308
+ * DP sensitivity: max change when one record added/removed (default: 1.0).
309
+ * For SUM queries on a field with range [0, X], set sensitivity = X.
310
+ */
311
+ dpSensitivity?: number;
312
+ /**
313
+ * Dataset size threshold below which Differential Privacy is active (default: 50).
314
+ */
315
+ dpSmallDatasetThreshold?: number;
316
+ /**
317
+ * Max queries per numeric field per PQC session (default: 5).
318
+ * Prevents multi-query differencing attacks.
319
+ */
320
+ queryBudgetPerField?: number;
321
+ /**
322
+ * Domain-specific sensitive keys that fall under the "sensitive" query budget tier.
323
+ */
324
+ sensitiveKeys?: string[];
325
+ }
326
+ declare class LiopServer {
327
+ private serverInfo;
328
+ private config?;
329
+ private logicCache;
330
+ private connectionStats;
331
+ private readonly CACHE_TTL_MS;
332
+ private readonly THROTTLE_THRESHOLD;
333
+ private readonly THROTTLE_COOLDOWN_MS;
334
+ private toolCallWindows;
335
+ private readonly toolCallMaxPerWindow;
336
+ private readonly toolCallWindowMs;
337
+ private globalCallWindow;
338
+ private readonly globalCallMaxPerWindow;
339
+ private fieldQueryBudget;
340
+ private readonly taintAnalyzer;
341
+ private tools;
342
+ private resources;
343
+ private prompts;
344
+ private activeSchema;
345
+ private sandboxRecords;
346
+ private piiScanner;
347
+ private workerPool;
348
+ private meshNode;
349
+ private rpcServer;
350
+ private boundPort;
351
+ jwtValidator?: JwtValidator;
352
+ oauthProvider?: any;
353
+ private sessions;
354
+ private revokedTokenHashes;
355
+ private lastRevocationLoadTime;
356
+ private static readonly LIOP_COMPACT_REGEX;
357
+ private extractLogic;
358
+ private parseUnknownJson;
359
+ private runPreflightPolicy;
360
+ private validateOutputPolicy;
361
+ /**
362
+ * Proxied tools stringify a full MCP CallToolResult (`{ content: [...] }`).
363
+ * Aggregation-first heuristics must scan the inner business JSON, not the MCP envelope
364
+ * (otherwise `content` looks like a tabular array of objects and everything blocks).
365
+ */
366
+ private unwrapForAggregationPolicyScan;
367
+ private violatesAggregationFirstPolicy;
368
+ constructor(serverInfo: ServerInfo, config?: LiopServerOptions | undefined);
369
+ /**
370
+ * Builds the centralized LIOP envelope specification document.
371
+ * Served as a single Resource (liop://protocol/envelope-spec) instead
372
+ * of being duplicated across every tool description.
373
+ */
374
+ private buildEnvelopeSpec;
375
+ /**
376
+ * Extracts a compact, human-readable field summary from a JSON Schema.
377
+ *
378
+ * Walks the schema structure to find actual data property names and types,
379
+ * rather than returning top-level schema metadata keys (type, items, etc.).
380
+ *
381
+ * Example output for a banking schema:
382
+ * "Array of {id(string), accountHolder(string), balance(number), transactions(array of {date(string), amount(number)})}"
383
+ */
384
+ private extractSchemaFieldSummary;
385
+ /**
386
+ * Convenience alias for connectToMesh(), matching official documentation.
387
+ */
388
+ connect(options?: {
389
+ port?: number;
390
+ meshConfig?: {
391
+ listenAddresses?: string[];
392
+ bootstrapNodes?: string[];
393
+ identityPath?: string;
394
+ };
395
+ }): Promise<void>;
396
+ /**
397
+ * Register a new Tool
398
+ */
399
+ tool<T extends z.ZodRawShape>(name: string, description: string, shape: T, handler: ToolHandler<T>, policy?: LogicExecutionPolicy): void;
400
+ /**
401
+ * Register a dynamic prompt
402
+ */
403
+ prompt(name: string, description: string | undefined, args: Prompt["arguments"], handler: (request: GetPromptRequest) => GetPromptResult | Promise<GetPromptResult>): void;
404
+ /**
405
+ * Enables LIOP Zero-Shot Autonomy by registering the Blind Analyst standard prompt.
406
+ */
407
+ enableZeroShotAutonomy(): void;
408
+ /**
409
+ * Register a dynamic resource
410
+ */
411
+ resource(name: string, uri: string, description?: string, mimeType?: string, content?: string | (() => Promise<string>)): void;
412
+ /**
413
+ * Builds execution guidelines served as a resource to guide LLM code generation.
414
+ */
415
+ private buildExecutionGuidelines;
416
+ /**
417
+ * Broadcasts the Data Dictionary to the LLM prior to code injection.
418
+ */
419
+ dataDictionary(schema: Record<string, unknown>, name?: string, uri?: string, description?: string): void;
420
+ /**
421
+ * Manually invalidates the AST Logic Cache (e.g. for Zero-Day patches).
422
+ */
423
+ clearAstCache(): void;
424
+ /**
425
+ * Sliding window rate limiter for tool call frequency.
426
+ * Prevents micro-query exfiltration attacks where an attacker
427
+ * makes hundreds of individually-legitimate calls to reconstruct
428
+ * the full dataset field by field. (OWASP A01)
429
+ */
430
+ private checkToolCallRateLimit;
431
+ /**
432
+ * Global cross-tool rate limiter.
433
+ * Prevents attackers from distributing micro-queries across multiple tools
434
+ * to evade per-tool rate limits. (OWASP A01)
435
+ */
436
+ private checkGlobalRateLimit;
437
+ /**
438
+ * Emulates calling a tool (used locally or via LIOPMcpBridge)
439
+ */
440
+ callTool(request: CallToolRequest, clientId?: string): Promise<CallToolResult>;
441
+ /**
442
+ * Retrieves registered tools
443
+ */
444
+ listTools(): Tool[];
445
+ /**
446
+ * Retrieves registered prompts
447
+ */
448
+ listPrompts(): Prompt[];
449
+ /**
450
+ * Gets a specific prompt by name
451
+ */
452
+ getPrompt(request: GetPromptRequest): Promise<GetPromptResult>;
453
+ /**
454
+ * Retrieves registered resources
455
+ */
456
+ listResources(): Resource[];
457
+ /**
458
+ * Reads a specific resource by URI
459
+ */
460
+ readResource(uri: string): Promise<{
461
+ contents: Array<{
462
+ uri: string;
463
+ mimeType?: string;
464
+ text: string;
465
+ }>;
466
+ }>;
467
+ getServerInfo(): ServerInfo;
468
+ getMeshNode(): MeshNode | null;
469
+ /**
470
+ * Injects data into the secure sandbox context for Logic-on-Origin tools.
471
+ */
472
+ setSandboxData(records: Record<string, unknown>[]): void;
473
+ getBoundPort(): number | null;
474
+ /**
475
+ * Connects to the libp2p Kademlia DHT and announces capabilities.
476
+ * Boots the gRPC server for secure Logic-on-Origin.
477
+ */
478
+ connectToMesh(options?: {
479
+ port?: number;
480
+ meshConfig?: {
481
+ listenAddresses?: string[];
482
+ bootstrapNodes?: string[];
483
+ identityPath?: string;
484
+ };
485
+ }): Promise<void>;
486
+ /**
487
+ * Internal worker execution with Egress Filtering logic.
488
+ */
489
+ private executeInWorkerPool;
490
+ /**
491
+ * Safely destroys the worker pool, gRPC server, and Mesh node.
492
+ * Recommended to be called during graceful shutdowns or test teardowns.
493
+ */
494
+ close(): Promise<void>;
495
+ private loadRevocationList;
496
+ revokeToken(token: string): void;
497
+ revokeTokenHash(hash: string): void;
498
+ }
499
+
500
+ export { AUTH_DEFAULTS as A, LiopServer as L, NerScanner as N, type OAuthClientConfig as O, PII_PATTERNS as P, type ToolHandler as T, type LiopServerOptions as a, type AggregationPolicy as b, type AuthRole as c, type LiopAuthConfig as d, type LogicExecutionPolicy as e, type OutputSanitizerConfig as f, PII_PRESETS as g, type PiiRule as h, PiiScanner as i, sanitizeOutput as s };