@nekzus/liop 2.0.0-alpha.27 → 2.0.0-alpha.29

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 (55) hide show
  1. package/README.md +36 -9
  2. package/dist/bin/agent.js +1 -1
  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-7I6YJS3C.js → chunk-DQ6UW6L7.js} +2 -2
  7. package/dist/chunk-DQ6UW6L7.js.map +1 -0
  8. package/dist/chunk-L5A64CNT.js +54 -0
  9. package/dist/chunk-L5A64CNT.js.map +1 -0
  10. package/dist/chunk-N6FGTZ6A.js +3 -0
  11. package/dist/chunk-N6FGTZ6A.js.map +1 -0
  12. package/dist/chunk-RYYRR4N5.js +31 -0
  13. package/dist/chunk-RYYRR4N5.js.map +1 -0
  14. package/dist/chunk-SB5XJXKV.js +2 -0
  15. package/dist/chunk-SB5XJXKV.js.map +1 -0
  16. package/dist/{chunk-TNMS53OP.js → chunk-TYVG6TXQ.js} +2 -2
  17. package/dist/{chunk-TNMS53OP.js.map → chunk-TYVG6TXQ.js.map} +1 -1
  18. package/dist/chunk-VGXNGTIC.js +33 -0
  19. package/dist/chunk-VGXNGTIC.js.map +1 -0
  20. package/dist/chunk-W2QGWRTT.js +3 -0
  21. package/dist/chunk-W2QGWRTT.js.map +1 -0
  22. package/dist/chunk-YZVCAJJO.js +13 -0
  23. package/dist/chunk-YZVCAJJO.js.map +1 -0
  24. package/dist/client.d.ts +3 -2
  25. package/dist/client.js +1 -1
  26. package/dist/gateway.d.ts +14 -3
  27. package/dist/gateway.js +1 -1
  28. package/dist/{index-BihN3W-K.d.ts → index-B_Vbrb_I.d.ts} +14 -1
  29. package/dist/index-CL8m1L1d.d.ts +500 -0
  30. package/dist/index.d.ts +124 -6
  31. package/dist/index.js +2 -2
  32. package/dist/index.js.map +1 -1
  33. package/dist/mesh.d.ts +3 -0
  34. package/dist/mesh.js +1 -1
  35. package/dist/server.d.ts +5 -377
  36. package/dist/server.js +1 -1
  37. package/dist/types-DzEXgi4s.d.ts +228 -0
  38. package/dist/types.d.ts +3 -148
  39. package/dist/types.js +1 -1
  40. package/dist/workers/logic-execution.js +1 -1
  41. package/dist/workers/logic-execution.js.map +1 -1
  42. package/package.json +4 -1
  43. package/dist/chunk-7I6YJS3C.js.map +0 -1
  44. package/dist/chunk-AKTU6ZMX.js +0 -2
  45. package/dist/chunk-AKTU6ZMX.js.map +0 -1
  46. package/dist/chunk-BDQZURCS.js +0 -54
  47. package/dist/chunk-BDQZURCS.js.map +0 -1
  48. package/dist/chunk-GFRRQ2EB.js +0 -33
  49. package/dist/chunk-GFRRQ2EB.js.map +0 -1
  50. package/dist/chunk-GYK2HORK.js +0 -3
  51. package/dist/chunk-GYK2HORK.js.map +0 -1
  52. package/dist/chunk-RNS4FR5L.js +0 -31
  53. package/dist/chunk-RNS4FR5L.js.map +0 -1
  54. package/dist/chunk-YTIMVS2I.js +0 -13
  55. package/dist/chunk-YTIMVS2I.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  export { LiopBridgeOptions, LiopMcpBridge, LiopStreamBridge, LiopStreamBridgeOptions } from './bridge.js';
2
- import { L as LiopTlsOptions } from './index-BihN3W-K.js';
3
- export { a as LiopClient } from './index-BihN3W-K.js';
2
+ import { L as LiopTlsOptions } from './index-B_Vbrb_I.js';
3
+ export { a as LiopClient } from './index-B_Vbrb_I.js';
4
4
  export { LiopHybridGateway } from './gateway.js';
5
5
  export { LiopManifest, MeshNode, MeshNodeConfig } from './mesh.js';
6
6
  import * as grpc from '@grpc/grpc-js';
7
- export { AggregationPolicy, LiopServer, LiopServerOptions, LogicExecutionPolicy, NerScanner, OutputSanitizerConfig, PII_PATTERNS, PII_PRESETS, PiiRule, PiiScanner, ToolHandler, sanitizeOutput } from './server.js';
8
- export { CallToolRequest, CallToolResult, GetPromptRequest, GetPromptResult, McpRequest, McpResponse, Prompt, PromptSchema, Resource, ResourceSchema, ServerInfo, Tool, ToolSchema } from './types.js';
7
+ export { A as AUTH_DEFAULTS, b as AggregationPolicy, c as AuthRole, d as LiopAuthConfig, L as LiopServer, a as LiopServerOptions, e as LogicExecutionPolicy, N as NerScanner, O as OAuthClientConfig, f as OutputSanitizerConfig, P as PII_PATTERNS, g as PII_PRESETS, h as PiiRule, i as PiiScanner, T as ToolHandler, s as sanitizeOutput } from './index-CL8m1L1d.js';
8
+ import { A as AuthInfo } from './types-DzEXgi4s.js';
9
+ export { C as CallToolRequest, a as CallToolResult, G as GetPromptRequest, c as GetPromptResult, J as JwtValidator, M as McpRequest, b as McpResponse, P as Prompt, d as PromptSchema, R as Resource, e as ResourceSchema, S as ServerInfo, T as Tool, f as ToolSchema } from './types-DzEXgi4s.js';
10
+ import * as jose from 'jose';
11
+ import Provider from 'oidc-provider';
9
12
  import '@modelcontextprotocol/sdk/server/mcp.js';
10
13
  import 'zod';
11
14
  import './verifier-DTCD9imJ.js';
@@ -248,7 +251,8 @@ interface LogicResponse {
248
251
  */
249
252
  declare class LiopRpcClient {
250
253
  private client;
251
- constructor(address: string, tls?: LiopTlsOptions);
254
+ private token?;
255
+ constructor(address: string, tls?: LiopTlsOptions, token?: string);
252
256
  /**
253
257
  * Negotiates intent with the remote host.
254
258
  * Returns the ephemeral Kyber public key for payload encryption.
@@ -273,6 +277,11 @@ declare class LiopRpcServer {
273
277
  stop(): Promise<void>;
274
278
  }
275
279
 
280
+ /**
281
+ * Returns a filtered environment object containing only safe system variables,
282
+ * preventing exposure of sensitive credentials and shell function injection.
283
+ */
284
+ declare function getDefaultEnvironment(): Record<string, string>;
276
285
  interface SandboxConfig {
277
286
  allowEnv?: boolean;
278
287
  allowedDirectories?: Record<string, string>;
@@ -310,4 +319,113 @@ declare class WasiSandbox {
310
319
  teardown(): Promise<void>;
311
320
  }
312
321
 
313
- export { type AIProvider, ErrorCode, HeuristicTokenEstimator, LiopError, LiopOTelBridge, LiopRpcClient, LiopRpcServer, type PromptConfig, RealTokenEstimator, type SandboxConfig, type TokenEstimator, type TokenOperationMetric, type TokenSessionReport, TokenTelemetryEngine, type ToolTokenBreakdown, WasiSandbox, createSyncTokenEstimator, createTokenEstimator, generateSystemInstructions };
322
+ /**
323
+ * LIOP Embedded OAuth 2.1 Authorization Server
324
+ *
325
+ * Implements a lightweight, high-performance OAuth 2.1 / OIDC Authorization Server
326
+ * for the Nexus node using `panva/node-oidc-provider`.
327
+ *
328
+ * Security Hardening:
329
+ * - M2M (Machine-to-Machine) Client Credentials Grant ONLY (Zero human interaction interface).
330
+ * - Algorithmic whitelist: EdDSA (Ed25519) for token signing.
331
+ * - JWT Access Tokens: Allows stateless, cryptographically-secure validation on data nodes (NIST SP 800-207).
332
+ * - Interaction Lockout: Throws exception on any interactive flow attempt to prevent hijack attacks (OWASP).
333
+ *
334
+ * Standards: OAuth 2.1, RFC 6749, RFC 7519, NIST SP 800-63B
335
+ */
336
+
337
+ interface OAuthServerClientConfig {
338
+ client_id: string;
339
+ client_secret: string;
340
+ grant_types: string[];
341
+ scope: string;
342
+ }
343
+ interface OAuthServerConfig {
344
+ issuer: string;
345
+ clients: OAuthServerClientConfig[];
346
+ }
347
+ interface OAuthServerResult {
348
+ provider: Provider;
349
+ jwks: jose.JSONWebKeySet;
350
+ }
351
+ /**
352
+ * Creates and configures the embedded node-oidc-provider instance for the Nexus.
353
+ *
354
+ * @param config - Server configuration containing the issuer URL and allowed M2M clients.
355
+ */
356
+ declare function createOAuthServer(config: OAuthServerConfig): OAuthServerResult;
357
+
358
+ /**
359
+ * LIOP Protected Resource Metadata — RFC 9728
360
+ *
361
+ * Builds the JSON document served at /.well-known/oauth-protected-resource.
362
+ * This enables MCP clients to discover the authorization server and
363
+ * required scopes for accessing LIOP tools and resources.
364
+ *
365
+ * Standards: RFC 9728, MCP Spec 2025-11-25
366
+ */
367
+ /**
368
+ * RFC 9728 Protected Resource Metadata response.
369
+ *
370
+ * @see https://datatracker.ietf.org/doc/rfc9728
371
+ */
372
+ interface ProtectedResourceMetadata {
373
+ /** Identifier for the protected resource. */
374
+ resource: string;
375
+ /** Array of authorization server issuer URLs that can issue tokens for this resource. */
376
+ authorization_servers: string[];
377
+ /** OAuth scopes accepted by this resource. */
378
+ scopes_supported: readonly string[];
379
+ /** Methods of presenting the bearer token (always "header" for LIOP). */
380
+ bearer_methods_supported: string[];
381
+ /** URL to the resource documentation. */
382
+ resource_documentation: string;
383
+ }
384
+ /**
385
+ * Builds the Protected Resource Metadata document (RFC 9728).
386
+ *
387
+ * @param issuer - OIDC issuer URL of the Nexus authorization server
388
+ * @param audience - JWT audience claim (resource identifier)
389
+ */
390
+ declare function buildProtectedResourceMetadata(issuer: string, audience: string): ProtectedResourceMetadata;
391
+
392
+ /**
393
+ * LIOP RBAC Engine — Scope-Based Authorization
394
+ *
395
+ * Maps MCP JSON-RPC methods to required LIOP OAuth scopes.
396
+ * Enforces least-privilege access at the router level before
397
+ * any tool execution or resource read occurs.
398
+ *
399
+ * Standards: NIST SP 800-207 §4.3 (least privilege), OWASP LLM06 (Excessive Agency),
400
+ * OWASP API-A01 (Broken Access Control)
401
+ */
402
+
403
+ /**
404
+ * Authorization result with optional denial reason for audit logging.
405
+ */
406
+ interface AuthorizationResult {
407
+ allowed: boolean;
408
+ reason?: string;
409
+ }
410
+ /**
411
+ * Evaluates whether a request is authorized based on JWT scopes.
412
+ *
413
+ * Decision logic:
414
+ * 1. Methods with no required scopes (initialize, ping) → always allowed.
415
+ * 2. Methods with required scopes but no auth → denied.
416
+ * 3. Methods with required scopes → all scopes must be present in the JWT.
417
+ * 4. Unknown methods with no auth → denied (fail-closed per NIST SP 800-207).
418
+ *
419
+ * @param method - MCP JSON-RPC method name (e.g., "tools/call")
420
+ * @param auth - Validated JWT context, or null if unauthenticated
421
+ * @param additionalScopes - Extra scopes required by specific node configuration
422
+ */
423
+ declare function authorizeRequest(method: string, auth: AuthInfo | null, additionalScopes?: readonly string[]): AuthorizationResult;
424
+ /**
425
+ * All LIOP OAuth scopes supported by the protocol.
426
+ * Used for PRM metadata and client registration.
427
+ */
428
+ declare const LIOP_SCOPES: readonly ["liop:tools:list", "liop:tools:call", "liop:resources:read", "liop:schema:read", "liop:mesh:query"];
429
+ type LiopScope = (typeof LIOP_SCOPES)[number];
430
+
431
+ export { type AIProvider, AuthInfo, ErrorCode, HeuristicTokenEstimator, LIOP_SCOPES, LiopError, LiopOTelBridge, LiopRpcClient, LiopRpcServer, type LiopScope, type PromptConfig, RealTokenEstimator, type SandboxConfig, type TokenEstimator, type TokenOperationMetric, type TokenSessionReport, TokenTelemetryEngine, type ToolTokenBreakdown, WasiSandbox, authorizeRequest, buildProtectedResourceMetadata, createOAuthServer, createSyncTokenEstimator, createTokenEstimator, generateSystemInstructions, getDefaultEnvironment };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export{b as WasiSandbox}from'./chunk-RNS4FR5L.js';export{b as LiopClient,a as LiopRpcClient}from'./chunk-AKTU6ZMX.js';export{c as PromptSchema,b as ResourceSchema,a as ToolSchema}from'./chunk-TNMS53OP.js';export{b as LiopMcpBridge,a as LiopStreamBridge}from'./chunk-GYK2HORK.js';export{a as LiopHybridGateway}from'./chunk-YTIMVS2I.js';export{a as LiopRpcServer,g as LiopServer,b as NerScanner,d as PII_PATTERNS,e as PII_PRESETS,f as PiiScanner,c as sanitizeOutput}from'./chunk-BDQZURCS.js';import'./chunk-2MGFSIXN.js';export{b as HeuristicTokenEstimator,e as LiopOTelBridge,a as RealTokenEstimator,f as TokenTelemetryEngine,d as createSyncTokenEstimator,c as createTokenEstimator}from'./chunk-GFRRQ2EB.js';import'./chunk-SW53FNSN.js';import'./chunk-ANFXJGMP.js';import'./chunk-DBXGYHKY.js';import'./chunk-V5MKJT6S.js';export{a as MeshNode}from'./chunk-7I6YJS3C.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';var m=(e=>(e.CapabilityViolation="CapabilityViolation",e.SandboxEscape="SandboxEscape",e.PiiLeak="PiiLeak",e.InvalidIntent="InvalidIntent",e.Throttled="Throttled",e.ZkVerificationFailed="ZkVerificationFailed",e.MeshUnavailable="MeshUnavailable",e.ConnectionFailed="ConnectionFailed",e))(m||{}),n=class extends Error{code;constructor(o,t){super(t),this.name="LiopError",this.code=o;}};var g={claude:{xmlStandard:true,jsonSchemaPreferred:false},openai:{xmlStandard:false,jsonSchemaPreferred:true},gemini:{xmlStandard:false,jsonSchemaPreferred:true}};function _(i){let o=g[i],t=`[LIOP-PROTO-V1: LOGIC-ON-ORIGIN SPECIFICATION]
1
+ export{c as WasiSandbox,b as getDefaultEnvironment}from'./chunk-RYYRR4N5.js';export{b as LiopClient,a as LiopRpcClient}from'./chunk-N6FGTZ6A.js';export{c as PromptSchema,b as ResourceSchema,a as ToolSchema}from'./chunk-TYVG6TXQ.js';export{b as LiopMcpBridge,a as LiopStreamBridge}from'./chunk-W2QGWRTT.js';export{b as LiopHybridGateway,a as buildProtectedResourceMetadata}from'./chunk-YZVCAJJO.js';export{b as AUTH_DEFAULTS,c as JwtValidator,a as LiopRpcServer,j as LiopServer,e as NerScanner,g as PII_PATTERNS,h as PII_PRESETS,i as PiiScanner,d as createOAuthServer,f as sanitizeOutput}from'./chunk-L5A64CNT.js';import'./chunk-2MGFSIXN.js';export{b as HeuristicTokenEstimator,e as LiopOTelBridge,a as RealTokenEstimator,f as TokenTelemetryEngine,d as createSyncTokenEstimator,c as createTokenEstimator}from'./chunk-VGXNGTIC.js';import'./chunk-SW53FNSN.js';import'./chunk-ANFXJGMP.js';import'./chunk-DBXGYHKY.js';export{b as LIOP_SCOPES,a as authorizeRequest}from'./chunk-SB5XJXKV.js';import'./chunk-V5MKJT6S.js';export{a as MeshNode}from'./chunk-DQ6UW6L7.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';var h=(e=>(e.CapabilityViolation="CapabilityViolation",e.SandboxEscape="SandboxEscape",e.PiiLeak="PiiLeak",e.InvalidIntent="InvalidIntent",e.Throttled="Throttled",e.ZkVerificationFailed="ZkVerificationFailed",e.MeshUnavailable="MeshUnavailable",e.ConnectionFailed="ConnectionFailed",e))(h||{}),n=class extends Error{code;constructor(o,t){super(t),this.name="LiopError",this.code=o;}};var x={claude:{xmlStandard:true,jsonSchemaPreferred:false},openai:{xmlStandard:false,jsonSchemaPreferred:true},gemini:{xmlStandard:false,jsonSchemaPreferred:true}};function W(i){let o=x[i],t=`[LIOP-PROTO-V1: LOGIC-ON-ORIGIN SPECIFICATION]
2
2
  You are interacting with a Logic-Injection-on-Origin Protocol (LIOP) Mesh Network.
3
3
  Unlike standard MCP where you pull context to evaluate it remotely, in LIOP you WRITE code that executes on the data's origin.
4
4
 
@@ -40,5 +40,5 @@ Example:
40
40
  "target": "liop://vault/patients",
41
41
  "logic_blob": "const records = await liop.readResource(args.target); return { targetCount: records.filter(r => r.disease === 'Hypertension').length };"
42
42
  }
43
- `),t}export{m as ErrorCode,n as LiopError,_ as generateSystemInstructions};//# sourceMappingURL=index.js.map
43
+ `),t}export{h as ErrorCode,n as LiopError,W as generateSystemInstructions};//# sourceMappingURL=index.js.map
44
44
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/prompts/adapters.ts"],"names":["ErrorCode","LiopError","code","message","PROVIDER_CONFIGS","generateSystemInstructions","provider","config","instructions"],"mappings":"y5BAAO,IAAKA,OACXA,CAAAA,CAAA,mBAAA,CAAsB,qBAAA,CACtBA,CAAAA,CAAA,cAAgB,eAAA,CAChBA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,EAAA,aAAA,CAAgB,eAAA,CAChBA,EAAA,SAAA,CAAY,WAAA,CACZA,EAAA,oBAAA,CAAuB,sBAAA,CACvBA,CAAAA,CAAA,eAAA,CAAkB,kBAClBA,CAAAA,CAAA,gBAAA,CAAmB,kBAAA,CARRA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IAWCC,CAAAA,CAAN,cAAwB,KAAM,CACpB,KAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAiB,CAC7C,KAAA,CAAMA,CAAO,CAAA,CACb,IAAA,CAAK,IAAA,CAAO,WAAA,CACZ,KAAK,IAAA,CAAOD,EACb,CACD,ECLA,IAAME,CAAAA,CAAqD,CAC1D,MAAA,CAAQ,CAAE,YAAa,IAAA,CAAM,mBAAA,CAAqB,KAAM,CAAA,CACxD,MAAA,CAAQ,CAAE,WAAA,CAAa,KAAA,CAAO,mBAAA,CAAqB,IAAK,EACxD,MAAA,CAAQ,CAAE,YAAa,KAAA,CAAO,mBAAA,CAAqB,IAAK,CACzD,CAAA,CAMO,SAASC,CAAAA,CAA2BC,EAA8B,CACxE,IAAMC,EAASH,CAAAA,CAAiBE,CAAQ,EAEpCE,CAAAA,CAAe,CAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CA2BnB,OAAID,CAAAA,CAAO,WAAA,CACVC,CAAAA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAUND,CAAAA,CAAO,sBACjBC,CAAAA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAAA,CAWVA,CACR","file":"index.js","sourcesContent":["export enum ErrorCode {\n\tCapabilityViolation = \"CapabilityViolation\",\n\tSandboxEscape = \"SandboxEscape\",\n\tPiiLeak = \"PiiLeak\",\n\tInvalidIntent = \"InvalidIntent\",\n\tThrottled = \"Throttled\",\n\tZkVerificationFailed = \"ZkVerificationFailed\",\n\tMeshUnavailable = \"MeshUnavailable\",\n\tConnectionFailed = \"ConnectionFailed\",\n}\n\nexport class LiopError extends Error {\n\tpublic readonly code: ErrorCode;\n\n\tconstructor(code: ErrorCode, message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"LiopError\";\n\t\tthis.code = code;\n\t}\n}\n","/**\n * LIOP Cross-AI Prompt Adapters (Fase 92)\n *\n * Normalizes system instructions for different LLM providers (Claude, OpenAI, Gemini)\n * to ensure they understand how to generate \"Logic-on-Origin\" WASM-compatible payload structures.\n */\n\nexport type AIProvider = \"claude\" | \"openai\" | \"gemini\";\n\nexport interface PromptConfig {\n\txmlStandard: boolean;\n\tjsonSchemaPreferred: boolean;\n}\n\nconst PROVIDER_CONFIGS: Record<AIProvider, PromptConfig> = {\n\tclaude: { xmlStandard: true, jsonSchemaPreferred: false },\n\topenai: { xmlStandard: false, jsonSchemaPreferred: true },\n\tgemini: { xmlStandard: false, jsonSchemaPreferred: true },\n};\n\n/**\n * Generates specific System Prompts optimized for the provided AI.\n * This instructs the LLM on how to bypass Context-Pulling and use Logic-Injection (Zero-Shot).\n */\nexport function generateSystemInstructions(provider: AIProvider): string {\n\tconst config = PROVIDER_CONFIGS[provider];\n\n\tlet instructions = `[LIOP-PROTO-V1: LOGIC-ON-ORIGIN SPECIFICATION]\nYou are interacting with a Logic-Injection-on-Origin Protocol (LIOP) Mesh Network.\nUnlike standard MCP where you pull context to evaluate it remotely, in LIOP you WRITE code that executes on the data's origin.\n\n### CORE PARADIGM\nWhen you call a tool or resource, you MUST provide a payload that represents secure sandboxed logic to be executed on the remote Node.\nThe node will execute your logic securely on the raw secure data, and return only the RESULT, avoiding PII data egress.\n\n### EXECUTION RULES\n1. Provide a self-contained JavaScript syntax block that we will compile to WASM-Sandboxed logic.\n2. Rely only on standard ECMA script features (No Node.js polyfills).\n3. The logic must end by returning the calculated insights, not the raw data.\n\n### DIFFERENTIAL PRIVACY (DP) MECHANISM (Laplace Mechanism)\nTo prevent database reconstruction and inference attacks, numeric query outputs are processed by a Laplace DP engine:\n- COUNT / LENGTH queries: To get EXACT integer values without noise, you MUST name return keys containing 'count', 'length', 'size', 'num', 'positive', 'negative', or starting with 'total_' or 'num_' (e.g. 'total_tx', 'credits_count'). This forces sensitivity=1.0, rounds values, and clamps to non-negative values.\n- AVERAGE queries: Return keys containing 'avg', 'mean', or 'average' scale down noise automatically by dividing global sensitivity by the dataset size (sensitivity / n).\n- SUM / OTHER queries: Return keys without these semantic names receive full Laplace noise based on the global node sensitivity (which can be up to 100,000 in Bank nodes to protect raw balances). Do NOT attempt to bypass this by renaming sum fields to count fields, as it violates protocol integrity.\n\n### SANDBOX RUNTIME RESTRICTIONS & WORKAROUNDS\n- Date is poisoned: The 'Date' class/constructor is undefined (calling 'new Date()', 'Date.now()', or 'Date.parse()' will crash the execution).\n - Workaround: Perform chronological sorting and comparisons lexicographically on ISO 8601 string dates (e.g. record.date >= '2024-01-01').\n- Poisoned globals: eval, Function, setTimeout, setInterval, Buffer, ArrayBuffer, and TypedArrays are undefined.\n- Frozen prototypes: Modifications to Object.prototype, Array.prototype, etc., are blocked.\n- K-Anonymity constraints: Small datasets (< 10 records) limit outputs to max 3 scalar keys with NO nesting. Datasets with >= 10 records limit outputs to max 10 fields.\n`;\n\n\tif (config.xmlStandard) {\n\t\tinstructions += `\n### PAYLOAD FORMATTING (CLAUDE-XML PREFERRED)\nYou must wrap your logic precisely within <liop_logic> tags.\nExample:\n<liop_logic>\nconst records = await liop.readResource(\"liop://vault/patients\");\nconst filtered = records.filter(r => r.disease === \"Hypertension\");\nreturn { alert: \"High risk demographic\", targetCount: filtered.length };\n</liop_logic>\n`;\n\t} else if (config.jsonSchemaPreferred) {\n\t\tinstructions += `\n### PAYLOAD FORMATTING (JSON PARSING PREFERRED)\nYou must provide your logic strictly within a JSON string key called \\`\"logic_blob\"\\` inside your tool call parameters.\nExample:\n{\n \"target\": \"liop://vault/patients\",\n \"logic_blob\": \"const records = await liop.readResource(args.target); return { targetCount: records.filter(r => r.disease === 'Hypertension').length };\"\n}\n`;\n\t}\n\n\treturn instructions;\n}\n"]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/prompts/adapters.ts"],"names":["ErrorCode","LiopError","code","message","PROVIDER_CONFIGS","generateSystemInstructions","provider","config","instructions"],"mappings":"4lCAAO,IAAKA,OACXA,CAAAA,CAAA,mBAAA,CAAsB,qBAAA,CACtBA,CAAAA,CAAA,cAAgB,eAAA,CAChBA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,EAAA,aAAA,CAAgB,eAAA,CAChBA,EAAA,SAAA,CAAY,WAAA,CACZA,EAAA,oBAAA,CAAuB,sBAAA,CACvBA,CAAAA,CAAA,eAAA,CAAkB,kBAClBA,CAAAA,CAAA,gBAAA,CAAmB,kBAAA,CARRA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IAWCC,CAAAA,CAAN,cAAwB,KAAM,CACpB,KAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAiB,CAC7C,KAAA,CAAMA,CAAO,CAAA,CACb,IAAA,CAAK,IAAA,CAAO,WAAA,CACZ,KAAK,IAAA,CAAOD,EACb,CACD,ECLA,IAAME,CAAAA,CAAqD,CAC1D,MAAA,CAAQ,CAAE,YAAa,IAAA,CAAM,mBAAA,CAAqB,KAAM,CAAA,CACxD,MAAA,CAAQ,CAAE,WAAA,CAAa,KAAA,CAAO,mBAAA,CAAqB,IAAK,EACxD,MAAA,CAAQ,CAAE,YAAa,KAAA,CAAO,mBAAA,CAAqB,IAAK,CACzD,CAAA,CAMO,SAASC,CAAAA,CAA2BC,EAA8B,CACxE,IAAMC,EAASH,CAAAA,CAAiBE,CAAQ,EAEpCE,CAAAA,CAAe,CAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CA2BnB,OAAID,CAAAA,CAAO,WAAA,CACVC,CAAAA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAUND,CAAAA,CAAO,sBACjBC,CAAAA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAAA,CAWVA,CACR","file":"index.js","sourcesContent":["export enum ErrorCode {\n\tCapabilityViolation = \"CapabilityViolation\",\n\tSandboxEscape = \"SandboxEscape\",\n\tPiiLeak = \"PiiLeak\",\n\tInvalidIntent = \"InvalidIntent\",\n\tThrottled = \"Throttled\",\n\tZkVerificationFailed = \"ZkVerificationFailed\",\n\tMeshUnavailable = \"MeshUnavailable\",\n\tConnectionFailed = \"ConnectionFailed\",\n}\n\nexport class LiopError extends Error {\n\tpublic readonly code: ErrorCode;\n\n\tconstructor(code: ErrorCode, message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"LiopError\";\n\t\tthis.code = code;\n\t}\n}\n","/**\n * LIOP Cross-AI Prompt Adapters (Fase 92)\n *\n * Normalizes system instructions for different LLM providers (Claude, OpenAI, Gemini)\n * to ensure they understand how to generate \"Logic-on-Origin\" WASM-compatible payload structures.\n */\n\nexport type AIProvider = \"claude\" | \"openai\" | \"gemini\";\n\nexport interface PromptConfig {\n\txmlStandard: boolean;\n\tjsonSchemaPreferred: boolean;\n}\n\nconst PROVIDER_CONFIGS: Record<AIProvider, PromptConfig> = {\n\tclaude: { xmlStandard: true, jsonSchemaPreferred: false },\n\topenai: { xmlStandard: false, jsonSchemaPreferred: true },\n\tgemini: { xmlStandard: false, jsonSchemaPreferred: true },\n};\n\n/**\n * Generates specific System Prompts optimized for the provided AI.\n * This instructs the LLM on how to bypass Context-Pulling and use Logic-Injection (Zero-Shot).\n */\nexport function generateSystemInstructions(provider: AIProvider): string {\n\tconst config = PROVIDER_CONFIGS[provider];\n\n\tlet instructions = `[LIOP-PROTO-V1: LOGIC-ON-ORIGIN SPECIFICATION]\nYou are interacting with a Logic-Injection-on-Origin Protocol (LIOP) Mesh Network.\nUnlike standard MCP where you pull context to evaluate it remotely, in LIOP you WRITE code that executes on the data's origin.\n\n### CORE PARADIGM\nWhen you call a tool or resource, you MUST provide a payload that represents secure sandboxed logic to be executed on the remote Node.\nThe node will execute your logic securely on the raw secure data, and return only the RESULT, avoiding PII data egress.\n\n### EXECUTION RULES\n1. Provide a self-contained JavaScript syntax block that we will compile to WASM-Sandboxed logic.\n2. Rely only on standard ECMA script features (No Node.js polyfills).\n3. The logic must end by returning the calculated insights, not the raw data.\n\n### DIFFERENTIAL PRIVACY (DP) MECHANISM (Laplace Mechanism)\nTo prevent database reconstruction and inference attacks, numeric query outputs are processed by a Laplace DP engine:\n- COUNT / LENGTH queries: To get EXACT integer values without noise, you MUST name return keys containing 'count', 'length', 'size', 'num', 'positive', 'negative', or starting with 'total_' or 'num_' (e.g. 'total_tx', 'credits_count'). This forces sensitivity=1.0, rounds values, and clamps to non-negative values.\n- AVERAGE queries: Return keys containing 'avg', 'mean', or 'average' scale down noise automatically by dividing global sensitivity by the dataset size (sensitivity / n).\n- SUM / OTHER queries: Return keys without these semantic names receive full Laplace noise based on the global node sensitivity (which can be up to 100,000 in Bank nodes to protect raw balances). Do NOT attempt to bypass this by renaming sum fields to count fields, as it violates protocol integrity.\n\n### SANDBOX RUNTIME RESTRICTIONS & WORKAROUNDS\n- Date is poisoned: The 'Date' class/constructor is undefined (calling 'new Date()', 'Date.now()', or 'Date.parse()' will crash the execution).\n - Workaround: Perform chronological sorting and comparisons lexicographically on ISO 8601 string dates (e.g. record.date >= '2024-01-01').\n- Poisoned globals: eval, Function, setTimeout, setInterval, Buffer, ArrayBuffer, and TypedArrays are undefined.\n- Frozen prototypes: Modifications to Object.prototype, Array.prototype, etc., are blocked.\n- K-Anonymity constraints: Small datasets (< 10 records) limit outputs to max 3 scalar keys with NO nesting. Datasets with >= 10 records limit outputs to max 10 fields.\n`;\n\n\tif (config.xmlStandard) {\n\t\tinstructions += `\n### PAYLOAD FORMATTING (CLAUDE-XML PREFERRED)\nYou must wrap your logic precisely within <liop_logic> tags.\nExample:\n<liop_logic>\nconst records = await liop.readResource(\"liop://vault/patients\");\nconst filtered = records.filter(r => r.disease === \"Hypertension\");\nreturn { alert: \"High risk demographic\", targetCount: filtered.length };\n</liop_logic>\n`;\n\t} else if (config.jsonSchemaPreferred) {\n\t\tinstructions += `\n### PAYLOAD FORMATTING (JSON PARSING PREFERRED)\nYou must provide your logic strictly within a JSON string key called \\`\"logic_blob\"\\` inside your tool call parameters.\nExample:\n{\n \"target\": \"liop://vault/patients\",\n \"logic_blob\": \"const records = await liop.readResource(args.target); return { targetCount: records.filter(r => r.disease === 'Hypertension').length };\"\n}\n`;\n\t}\n\n\treturn instructions;\n}\n"]}
package/dist/mesh.d.ts CHANGED
@@ -26,6 +26,9 @@ interface LiopManifest {
26
26
  clearanceTier: number;
27
27
  executionTypes: string[];
28
28
  };
29
+ authRequired?: boolean;
30
+ /** Canonical slug for deterministic token resolution. Agents resolve LIOP_TOKEN_<tokenSlug>. Must match /^[A-Z][A-Z0-9_]*$/. */
31
+ tokenSlug?: string;
29
32
  }
30
33
  interface MeshNodeConfig {
31
34
  listenAddresses?: string[];
package/dist/mesh.js CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-RWRRBYG4.js';export{a as MeshNode}from'./chunk-7I6YJS3C.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';//# sourceMappingURL=mesh.js.map
1
+ import'./chunk-RWRRBYG4.js';export{a as MeshNode}from'./chunk-DQ6UW6L7.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';//# sourceMappingURL=mesh.js.map
2
2
  //# sourceMappingURL=mesh.js.map
package/dist/server.d.ts CHANGED
@@ -1,377 +1,5 @@
1
- import { z } from 'zod';
2
- import { MeshNode } from './mesh.js';
3
- import { ServerInfo, CallToolResult, Prompt, GetPromptRequest, GetPromptResult, CallToolRequest, Tool, Resource } from './types.js';
4
-
5
- /** Single named entity detected by the NER scanner. */
6
- interface NerEntity {
7
- type: "person" | "place" | "organization";
8
- text: string;
9
- }
10
- /** Result of an NER scan operation. */
11
- interface NerScanResult {
12
- detected: boolean;
13
- entities: NerEntity[];
14
- }
15
- /**
16
- * Scans text content for named entities that may represent PII.
17
- * Uses `compromise/three` for person, place, and organization detection.
18
- *
19
- * Designed for egress filtering — optimized for recall over precision
20
- * to ensure sensitive data does not leak through aliased output keys.
21
- */
22
- declare class NerScanner {
23
- private static nlp;
24
- /**
25
- * Lazy loads the compromise library only when needed.
26
- */
27
- private getNlp;
28
- /**
29
- * Scans a single string value for named entities.
30
- * Returns detected entities if the text contains recognizable PII.
31
- */
32
- scan(text: string): Promise<NerScanResult>;
33
- /**
34
- * Recursively scans all string values within an object/array.
35
- * Stops at the first detection for performance (fail-fast).
36
- */
37
- scanDeep(input: unknown, seen?: WeakSet<object>): Promise<NerScanResult>;
38
- }
39
-
40
- /**
41
- * LIOP Egress Shield Output Sanitizer (NIST SP 800-226 and OWASP DLP 2025 compliant)
42
- * Recursively sanitizes execution outputs by rounding floating-point numbers
43
- * and clamping negative values to zero floor where appropriate.
44
- *
45
- * Implements absolute immutability, returning a fresh copy of the data.
46
- */
47
- interface OutputSanitizerConfig {
48
- /** Maximum decimal places for floating-point values (default: 4) */
49
- maxDecimalPlaces?: number;
50
- /** Clamp negative values to zero floor (default: true) */
51
- clampNonNegative?: boolean;
52
- }
53
- /**
54
- * Recursively walks a JSON-like tree, rounding floats and clamping negative values.
55
- *
56
- * @param output - The raw or DP-modified output object/value to sanitize
57
- * @param config - Sanitization parameters (rounding depth, negative clamping)
58
- * @returns A sanitized deep copy of the output
59
- */
60
- declare function sanitizeOutput(output: unknown, config?: OutputSanitizerConfig): unknown;
61
-
62
- /**
63
- * LIOP Professional PII Engine (The Shield V2 - Tier-1 Military Edition)
64
- * Implements high-fidelity detection based on NIST and OWASP standards.
65
- * Features Multi-Layer Verification (Regex + Algorithmic Validators).
66
- */
67
- type PiiRuleDefinition = {
68
- name: string;
69
- pattern: string | RegExp;
70
- validator?: (match: string) => boolean;
71
- };
72
- type PiiRule = string | RegExp | PiiRuleDefinition;
73
- declare const PII_PATTERNS: {
74
- EMAIL: PiiRuleDefinition;
75
- CREDIT_CARD: PiiRuleDefinition;
76
- IP_ADDRESS: PiiRuleDefinition;
77
- PHONE: PiiRuleDefinition;
78
- SSN: PiiRuleDefinition;
79
- IBAN: PiiRuleDefinition;
80
- PASSPORT_MRZ: PiiRuleDefinition;
81
- };
82
- /**
83
- * Regional and Cultural Security Presets for Out-Of-The-Box compliance.
84
- * Developers can override, merge, or omit these based on local laws.
85
- */
86
- declare const PII_PRESETS: {
87
- GLOBAL_STRICT: PiiRuleDefinition[];
88
- US_COMPLIANT: PiiRuleDefinition[];
89
- EU_GDPR: PiiRuleDefinition[];
90
- };
91
- declare class PiiScanner {
92
- private patterns;
93
- private forbiddenKeysSet;
94
- private nerScanner;
95
- /**
96
- * Safelist of keys that contain forbidden substrings but are NOT PII.
97
- * Prevents false positives from fuzzy matching (e.g., "grid" contains "id").
98
- */
99
- private static readonly KEY_SAFELIST;
100
- /**
101
- * Short forbidden tokens (< 4 chars) that require boundary-aware matching.
102
- * Uses regex boundary detection to avoid false positives.
103
- */
104
- private shortTokenBoundaryPatterns;
105
- /**
106
- * Long forbidden tokens (>= 4 chars) that use substring containment.
107
- */
108
- private longForbiddenTokens;
109
- constructor(patterns?: PiiRule[], forbiddenKeys?: string[], nerScanner?: NerScanner | null);
110
- /**
111
- * Scans any input (string, object, array) for PII violations.
112
- * Returns the pattern/rule name that triggered the violation, or null if safe.
113
- *
114
- * Detection pipeline (fail-fast):
115
- * 1. Exact key match (O(1) Set lookup)
116
- * 2. Fuzzy key match (boundary detection for short tokens, substring for long)
117
- * 3. Regex/algorithmic pattern match on string values
118
- * 4. NER content scan on string values (if enabled)
119
- */
120
- scan(input: unknown, seen?: WeakSet<object>): Promise<string | null>;
121
- /**
122
- * Checks a key against fuzzy matching rules.
123
- * Short tokens use boundary-aware regex; long tokens use substring containment.
124
- */
125
- private checkKeyFuzzy;
126
- private checkString;
127
- }
128
-
129
- type ToolHandler<T extends z.ZodRawShape = z.ZodRawShape> = (args: z.infer<z.ZodObject<T>>, extra: {
130
- signal?: AbortSignal;
131
- }) => Promise<CallToolResult>;
132
- interface LiopServerOptions {
133
- capabilities?: Record<string, unknown>;
134
- workerPool?: {
135
- enabled?: boolean;
136
- minThreads?: number;
137
- maxThreads?: number;
138
- idleTimeout?: number;
139
- /** Max heap memory per worker in MB (default: 64). Prevents heap bomb DoS. */
140
- maxHeapMb?: number;
141
- };
142
- security?: {
143
- piiPatterns?: PiiRule[];
144
- forbiddenKeys?: string[];
145
- sensitiveKeys?: string[];
146
- /** Enable NLP-based Named Entity Recognition scanning on output values. */
147
- enableNerScanning?: boolean;
148
- /** Rate limiting configuration for tool calls (OWASP A01). */
149
- rateLimit?: {
150
- /** Maximum calls per window per tool (default: 15). */
151
- maxPerWindow?: number;
152
- /** Maximum calls per window across ALL tools combined (default: 40). */
153
- globalMaxPerWindow?: number;
154
- /** Sliding window duration in milliseconds (default: 60000 = 1 min). */
155
- windowMs?: number;
156
- };
157
- };
158
- taxonomy?: {
159
- domain?: string;
160
- clearanceTier?: number;
161
- executionTypes?: string[];
162
- };
163
- }
164
- interface AggregationPolicy {
165
- /** Maximum number of object-type array elements allowed (default: 10) */
166
- maxOutputRows?: number;
167
- /** Allow arrays containing only primitive values (default: true) */
168
- allowPrimitiveArrays?: boolean;
169
- /** Block min/max extraction when dataset size < this value (default: 50) */
170
- minMaxBlockThreshold?: number;
171
- }
172
- interface LogicExecutionPolicy {
173
- /**
174
- * Validate the business payload returned by sandbox logic (post-execution).
175
- * This runs before final egress checks and blocks non-conforming outputs.
176
- */
177
- outputSchema?: z.ZodType<unknown>;
178
- /**
179
- * Enforce aggregation-first heuristics (preflight + post-check).
180
- */
181
- enforceAggregationFirst?: boolean | AggregationPolicy;
182
- /**
183
- * Optional additional deny patterns checked against extracted logic source.
184
- */
185
- preflightDenyPatterns?: RegExp[];
186
- /**
187
- * Differential Privacy epsilon per query (default: 1.0).
188
- * Lower = stronger privacy + more noise. Standard: Apple iOS uses 1.0.
189
- */
190
- dpEpsilon?: number;
191
- /**
192
- * DP sensitivity: max change when one record added/removed (default: 1.0).
193
- * For SUM queries on a field with range [0, X], set sensitivity = X.
194
- */
195
- dpSensitivity?: number;
196
- /**
197
- * Dataset size threshold below which Differential Privacy is active (default: 50).
198
- */
199
- dpSmallDatasetThreshold?: number;
200
- /**
201
- * Max queries per numeric field per PQC session (default: 5).
202
- * Prevents multi-query differencing attacks.
203
- */
204
- queryBudgetPerField?: number;
205
- /**
206
- * Domain-specific sensitive keys that fall under the "sensitive" query budget tier.
207
- */
208
- sensitiveKeys?: string[];
209
- }
210
- declare class LiopServer {
211
- private serverInfo;
212
- private config?;
213
- private logicCache;
214
- private connectionStats;
215
- private readonly CACHE_TTL_MS;
216
- private readonly THROTTLE_THRESHOLD;
217
- private readonly THROTTLE_COOLDOWN_MS;
218
- private toolCallWindows;
219
- private readonly toolCallMaxPerWindow;
220
- private readonly toolCallWindowMs;
221
- private globalCallWindow;
222
- private readonly globalCallMaxPerWindow;
223
- private fieldQueryBudget;
224
- private readonly taintAnalyzer;
225
- private tools;
226
- private resources;
227
- private prompts;
228
- private activeSchema;
229
- private sandboxRecords;
230
- private piiScanner;
231
- private workerPool;
232
- private meshNode;
233
- private rpcServer;
234
- private boundPort;
235
- private sessions;
236
- private static readonly LIOP_COMPACT_REGEX;
237
- private extractLogic;
238
- private parseUnknownJson;
239
- private runPreflightPolicy;
240
- private validateOutputPolicy;
241
- /**
242
- * Proxied tools stringify a full MCP CallToolResult (`{ content: [...] }`).
243
- * Aggregation-first heuristics must scan the inner business JSON, not the MCP envelope
244
- * (otherwise `content` looks like a tabular array of objects and everything blocks).
245
- */
246
- private unwrapForAggregationPolicyScan;
247
- private violatesAggregationFirstPolicy;
248
- constructor(serverInfo: ServerInfo, config?: LiopServerOptions | undefined);
249
- /**
250
- * Builds the centralized LIOP envelope specification document.
251
- * Served as a single Resource (liop://protocol/envelope-spec) instead
252
- * of being duplicated across every tool description.
253
- */
254
- private buildEnvelopeSpec;
255
- /**
256
- * Extracts a compact, human-readable field summary from a JSON Schema.
257
- *
258
- * Walks the schema structure to find actual data property names and types,
259
- * rather than returning top-level schema metadata keys (type, items, etc.).
260
- *
261
- * Example output for a banking schema:
262
- * "Array of {id(string), accountHolder(string), balance(number), transactions(array of {date(string), amount(number)})}"
263
- */
264
- private extractSchemaFieldSummary;
265
- /**
266
- * Convenience alias for connectToMesh(), matching official documentation.
267
- */
268
- connect(options?: {
269
- port?: number;
270
- meshConfig?: {
271
- listenAddresses?: string[];
272
- bootstrapNodes?: string[];
273
- identityPath?: string;
274
- };
275
- }): Promise<void>;
276
- /**
277
- * Register a new Tool
278
- */
279
- tool<T extends z.ZodRawShape>(name: string, description: string, shape: T, handler: ToolHandler<T>, policy?: LogicExecutionPolicy): void;
280
- /**
281
- * Register a dynamic prompt
282
- */
283
- prompt(name: string, description: string | undefined, args: Prompt["arguments"], handler: (request: GetPromptRequest) => GetPromptResult | Promise<GetPromptResult>): void;
284
- /**
285
- * Enables LIOP Zero-Shot Autonomy by registering the Blind Analyst standard prompt.
286
- */
287
- enableZeroShotAutonomy(): void;
288
- /**
289
- * Register a dynamic resource
290
- */
291
- resource(name: string, uri: string, description?: string, mimeType?: string, content?: string | (() => Promise<string>)): void;
292
- /**
293
- * Builds execution guidelines served as a resource to guide LLM code generation.
294
- */
295
- private buildExecutionGuidelines;
296
- /**
297
- * Broadcasts the Data Dictionary to the LLM prior to code injection.
298
- */
299
- dataDictionary(schema: Record<string, unknown>, name?: string, uri?: string, description?: string): void;
300
- /**
301
- * Manually invalidates the AST Logic Cache (e.g. for Zero-Day patches).
302
- */
303
- clearAstCache(): void;
304
- /**
305
- * Sliding window rate limiter for tool call frequency.
306
- * Prevents micro-query exfiltration attacks where an attacker
307
- * makes hundreds of individually-legitimate calls to reconstruct
308
- * the full dataset field by field. (OWASP A01)
309
- */
310
- private checkToolCallRateLimit;
311
- /**
312
- * Global cross-tool rate limiter.
313
- * Prevents attackers from distributing micro-queries across multiple tools
314
- * to evade per-tool rate limits. (OWASP A01)
315
- */
316
- private checkGlobalRateLimit;
317
- /**
318
- * Emulates calling a tool (used locally or via LIOPMcpBridge)
319
- */
320
- callTool(request: CallToolRequest, clientId?: string): Promise<CallToolResult>;
321
- /**
322
- * Retrieves registered tools
323
- */
324
- listTools(): Tool[];
325
- /**
326
- * Retrieves registered prompts
327
- */
328
- listPrompts(): Prompt[];
329
- /**
330
- * Gets a specific prompt by name
331
- */
332
- getPrompt(request: GetPromptRequest): Promise<GetPromptResult>;
333
- /**
334
- * Retrieves registered resources
335
- */
336
- listResources(): Resource[];
337
- /**
338
- * Reads a specific resource by URI
339
- */
340
- readResource(uri: string): Promise<{
341
- contents: Array<{
342
- uri: string;
343
- mimeType?: string;
344
- text: string;
345
- }>;
346
- }>;
347
- getServerInfo(): ServerInfo;
348
- getMeshNode(): MeshNode | null;
349
- /**
350
- * Injects data into the secure sandbox context for Logic-on-Origin tools.
351
- */
352
- setSandboxData(records: Record<string, unknown>[]): void;
353
- getBoundPort(): number | null;
354
- /**
355
- * Connects to the libp2p Kademlia DHT and announces capabilities.
356
- * Boots the gRPC server for secure Logic-on-Origin.
357
- */
358
- connectToMesh(options?: {
359
- port?: number;
360
- meshConfig?: {
361
- listenAddresses?: string[];
362
- bootstrapNodes?: string[];
363
- identityPath?: string;
364
- };
365
- }): Promise<void>;
366
- /**
367
- * Internal worker execution with Egress Filtering logic.
368
- */
369
- private executeInWorkerPool;
370
- /**
371
- * Safely destroys the worker pool, gRPC server, and Mesh node.
372
- * Recommended to be called during graceful shutdowns or test teardowns.
373
- */
374
- close(): Promise<void>;
375
- }
376
-
377
- export { type AggregationPolicy, LiopServer, type LiopServerOptions, type LogicExecutionPolicy, NerScanner, type OutputSanitizerConfig, PII_PATTERNS, PII_PRESETS, type PiiRule, PiiScanner, type ToolHandler, sanitizeOutput };
1
+ export { b as AggregationPolicy, L as LiopServer, a as LiopServerOptions, e as LogicExecutionPolicy, N as NerScanner, f as OutputSanitizerConfig, P as PII_PATTERNS, g as PII_PRESETS, h as PiiRule, i as PiiScanner, T as ToolHandler, s as sanitizeOutput } from './index-CL8m1L1d.js';
2
+ import 'zod';
3
+ import './mesh.js';
4
+ import './types-DzEXgi4s.js';
5
+ import 'jose';
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- export{g as LiopServer,b as NerScanner,d as PII_PATTERNS,e as PII_PRESETS,f as PiiScanner,c as sanitizeOutput}from'./chunk-BDQZURCS.js';import'./chunk-2MGFSIXN.js';import'./chunk-V5MKJT6S.js';import'./chunk-7I6YJS3C.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';//# sourceMappingURL=server.js.map
1
+ export{j as LiopServer,e as NerScanner,g as PII_PATTERNS,h as PII_PRESETS,i as PiiScanner,f as sanitizeOutput}from'./chunk-L5A64CNT.js';import'./chunk-2MGFSIXN.js';import'./chunk-SB5XJXKV.js';import'./chunk-V5MKJT6S.js';import'./chunk-DQ6UW6L7.js';import'./chunk-S6RJHZV2.js';import'./chunk-4C666HHU.js';//# sourceMappingURL=server.js.map
2
2
  //# sourceMappingURL=server.js.map