@sentropic/cluster-mesh 0.20.0 → 0.21.1

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 (53) hide show
  1. package/README.md +53 -3
  2. package/dist/compose/mcp-stateful.d.ts +9 -0
  3. package/dist/compose/mcp-stateful.d.ts.map +1 -0
  4. package/dist/compose/mcp-stateful.js +96 -0
  5. package/dist/compose/mcp-stateful.js.map +1 -0
  6. package/dist/integrations/mcp/artifacts.d.ts +1 -0
  7. package/dist/integrations/mcp/artifacts.d.ts.map +1 -1
  8. package/dist/integrations/mcp/artifacts.js +1 -0
  9. package/dist/integrations/mcp/artifacts.js.map +1 -1
  10. package/dist/loaders/mcp/index.d.ts +2 -0
  11. package/dist/loaders/mcp/index.d.ts.map +1 -1
  12. package/dist/loaders/mcp/index.js +2 -0
  13. package/dist/loaders/mcp/index.js.map +1 -1
  14. package/dist/loaders/mcp/result-codec.d.ts +4 -0
  15. package/dist/loaders/mcp/result-codec.d.ts.map +1 -0
  16. package/dist/loaders/mcp/result-codec.js +5 -0
  17. package/dist/loaders/mcp/result-codec.js.map +1 -0
  18. package/dist/loaders/mcp/tool-schemas.d.ts +4 -0
  19. package/dist/loaders/mcp/tool-schemas.d.ts.map +1 -0
  20. package/dist/loaders/mcp/tool-schemas.js +5 -0
  21. package/dist/loaders/mcp/tool-schemas.js.map +1 -0
  22. package/dist/mcp/registry.d.ts +2 -0
  23. package/dist/mcp/registry.d.ts.map +1 -1
  24. package/dist/mcp/registry.js +1 -0
  25. package/dist/mcp/registry.js.map +1 -1
  26. package/dist/mcp/stateful-context.d.ts +8 -0
  27. package/dist/mcp/stateful-context.d.ts.map +1 -0
  28. package/dist/mcp/stateful-context.js +61 -0
  29. package/dist/mcp/stateful-context.js.map +1 -0
  30. package/dist/mcp/stateful-contracts.d.ts +53 -0
  31. package/dist/mcp/stateful-contracts.d.ts.map +1 -0
  32. package/dist/mcp/stateful-contracts.js +2 -0
  33. package/dist/mcp/stateful-contracts.js.map +1 -0
  34. package/dist/mcp/stateful-preflight.d.ts +48 -0
  35. package/dist/mcp/stateful-preflight.d.ts.map +1 -0
  36. package/dist/mcp/stateful-preflight.js +46 -0
  37. package/dist/mcp/stateful-preflight.js.map +1 -0
  38. package/dist/modules/catalog.d.ts +4 -4
  39. package/dist/modules/catalog.d.ts.map +1 -1
  40. package/dist/modules/catalog.js +8 -6
  41. package/dist/modules/catalog.js.map +1 -1
  42. package/dist/modules/contracts.d.ts +1 -1
  43. package/dist/modules/contracts.d.ts.map +1 -1
  44. package/dist/modules/contracts.js +2 -0
  45. package/dist/modules/contracts.js.map +1 -1
  46. package/dist/modules/registry.d.ts.map +1 -1
  47. package/dist/modules/registry.js +13 -1
  48. package/dist/modules/registry.js.map +1 -1
  49. package/dist/storage/common-contract.d.ts +73 -0
  50. package/dist/storage/common-contract.d.ts.map +1 -0
  51. package/dist/storage/common-contract.js +188 -0
  52. package/dist/storage/common-contract.js.map +1 -0
  53. package/package.json +7 -4
package/README.md CHANGED
@@ -148,12 +148,12 @@ providers stay independent packages and never depend on cluster-mesh. They are
148
148
  | `/gateway/auth-hono` (session mode) | `@sentropic/llm-gateway/auth-hono` | gateway + `@sentropic/auth-hono ^0.15.0 \|\| ^0.16.0` |
149
149
  | `/loaders/<leaf>` | async typed loader (`loadLlmMesh`, `loadGateway`, `loadGatewayAuth`, ...) | as its leaf, resolved on call |
150
150
  | `/compose/llm-mesh`, `/compose/gateway` | `createLlmMeshNamespaceModule`, `createGatewayNamespaceModule` | as the loaders they call |
151
- | `/mcp/registry`, `/mcp/stdio` | `@sentropic/mcp-platform` MCP kernel entries | `@sentropic/mcp-platform >=0.3.0 <0.4.0` (plus `@modelcontextprotocol/sdk ^1.31.0` for the stdio transport) |
151
+ | `/mcp/registry`, `/mcp/stdio` | Embedded `@sentropic/mcp-platform` MCP kernel entries | Platform and SDK installed transitively by mesh |
152
152
  | `/compose/mcp`, `/loaders/mcp` | `createMcpNamespaceModule`, `loadMcpPlatform{Registry,Stdio,Bridge,Entry,Hono}` | as its leaf, resolved on call |
153
- | `/mcp/artifacts` | `createArtifactsBuiltin` over `@sentropic/artifacts/mcp` | `@sentropic/artifacts >=0.1.0 <0.2.0`, `@sentropic/mcp-platform >=0.3.0 <0.4.0` |
153
+ | `/mcp/artifacts` | `createArtifactsBuiltin`, `createArtifactsToolExecutor` | `@sentropic/artifacts >=0.1.3 <0.2.0`; platform embedded in mesh |
154
154
 
155
155
  The `./mcp/artifacts` export provides the `sentropic.artifacts` builtin factory;
156
- its optional `@sentropic/artifacts >=0.1.0 <0.2.0` peer must be installed when
156
+ its optional `@sentropic/artifacts >=0.1.3 <0.2.0` peer must be installed when
157
157
  that leaf is imported. `loadArtifactsMcp` from `./loaders/mcp` acquires the same
158
158
  provider through the module registry. The root entry remains usable without it.
159
159
 
@@ -364,3 +364,53 @@ Manual publication is forbidden. For the first release, merge the validated pack
364
364
  run the `ci.yml` workflow with `bootstrap_publish_target=cluster-mesh`, then attach the
365
365
  npm OIDC trusted publisher to `rhanka/sentropic` and `ci.yml`. Later releases use the
366
366
  repository CI publication path.
367
+ # Stateful MCP wrapping (0.21.0)
368
+
369
+ `createStatefulMcpNamespace` from `@sentropic/cluster-mesh/compose/mcp-stateful`
370
+ wraps an existing host through the explicit StatefulMcpHost contract.
371
+ Immo installs `@sentropic/cluster-mesh@0.21.0` and `@sentropic/artifacts@0.1.3`.
372
+ Mesh declares platform `>=0.4.0 <0.5.0` as a regular dependency (qualified at 0.4.0),
373
+ so npm installs platform and its SDK automatically. A regular dependency preserves
374
+ one shared kernel and normal npm resolution without duplicating bundled code.
375
+ The host uses these mesh entries for composition, registry setup and artifacts:
376
+
377
+ ```ts
378
+ import { createStatefulMcpNamespace } from '@sentropic/cluster-mesh/compose/mcp-stateful';
379
+ import { createMcpRegistry, computeManifestDigest } from '@sentropic/cluster-mesh/mcp/registry';
380
+ import { createArtifactsBuiltin, createArtifactsToolExecutor } from '@sentropic/cluster-mesh/mcp/artifacts';
381
+ ```
382
+
383
+ The host owns
384
+ authentication, HTTP budgets, server/transport/session objects, ownership and
385
+ expiry rules, cancellation and close-once cleanup. The composer owns immutable
386
+ request authority, digest-bound registry/schema preflight and per-call policy
387
+ followed by live account/domain authorization.
388
+
389
+ The host's `bind` must pause new dispatch including initialize, drain old calls
390
+ to their existing deadline, register both bridge handlers on every existing
391
+ public McpServer.server, clear obsolete bearer state, disable high-level tool
392
+ updates, and register all future servers before connect. Drain timeout precedes
393
+ mutation; installation failure keeps admission closed with safe 503 responses.
394
+ The composer binds once and caches the complete host router. Mount that router
395
+ at root to retain /mcp and public protected-resource metadata paths:
396
+
397
+ ```ts
398
+ const wrapped = await createStatefulMcpNamespace(modules, options);
399
+ const plugin = createClusterMeshPlugin({
400
+ runtime, namespaces: [wrapped], mounts: { '/mcp': '/' },
401
+ });
402
+ ```
403
+
404
+ The host alone sees credentials and passes sanitized SDK requests. Domain
405
+ callbacks receive verified, frozen claims/attributes and combined cancellation;
406
+ never raw requests, bearer values or an exchange capability. Claim labels must
407
+ have host-evaluated verified predicates. Protected remote access fails closed
408
+ until the separately authorized exchange integration. This release does not
409
+ activate Radar's receiver #865 or its production cutover.
410
+
411
+ Core qualification uses twelve Immo tools with Mesh 0.21.0 and its transitive
412
+ Platform 0.4.0 dependency. The qualified optional variant adds Artifacts 0.1.3,
413
+ whose platform peer range is widened to `>=0.3.0 <0.5.0`, and exposes all 27 tools
414
+ through Mesh exports.
415
+ The installed consumer lane is
416
+ `make cluster-mesh-workspace CM_ACTION=stateful-consumer ENV=test-cm-wrap`.
@@ -0,0 +1,9 @@
1
+ import '../modules/topology-guard-mcp.js';
2
+ import type { ClusterMeshModules } from '../modules/contracts.js';
3
+ import type { ClusterMeshHonoNamespaceModule } from '../hono/plugin.js';
4
+ import type { StatefulMcpNamespaceOptions } from '../mcp/stateful-contracts.js';
5
+ export type { McpWrapRefusal, StatefulMcpHost, StatefulMcpHooks, StatefulMcpNamespaceOptions, VerifiedMcpRequest, } from '../mcp/stateful-contracts.js';
6
+ export type { McpToolValidationLimits } from '@sentropic/mcp-platform/transport/tool-schemas';
7
+ /** Wrap public SDK dispatch while the existing host retains its complete HTTP lifecycle. */
8
+ export declare function createStatefulMcpNamespace(modules: ClusterMeshModules, options: StatefulMcpNamespaceOptions): Promise<ClusterMeshHonoNamespaceModule>;
9
+ //# sourceMappingURL=mcp-stateful.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-stateful.d.ts","sourceRoot":"","sources":["../../src/compose/mcp-stateful.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAMxE,OAAO,KAAK,EAAkB,2BAA2B,EAAsB,MAAM,8BAA8B,CAAC;AAEpH,YAAY,EACV,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,kBAAkB,GACnG,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAM9F,4FAA4F;AAC5F,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,2BAA2B,GAChE,OAAO,CAAC,8BAA8B,CAAC,CAsEzC"}
@@ -0,0 +1,96 @@
1
+ import '../modules/topology-guard-mcp.js';
2
+ import { authorizeDispatch } from '@sentropic/mcp-platform/transport/dispatch';
3
+ import { loadMcpPlatformBridge } from '../loaders/mcp/bridge.js';
4
+ import { loadMcpPlatformToolSchemas } from '../loaders/mcp/tool-schemas.js';
5
+ import { loadMcpPlatformResultCodec } from '../loaders/mcp/result-codec.js';
6
+ import { createStatefulAuthority, combineMcpSignals } from '../mcp/stateful-context.js';
7
+ import { prepareStatefulTools } from '../mcp/stateful-preflight.js';
8
+ const boundHosts = new WeakSet();
9
+ const safeFailure = () => ({ content: [{ type: 'text', text: 'Tool call failed' }], isError: true });
10
+ /** Wrap public SDK dispatch while the existing host retains its complete HTTP lifecycle. */
11
+ export async function createStatefulMcpNamespace(modules, options) {
12
+ const { tools, registry, claimNames } = prepareStatefulTools(options);
13
+ if (boundHosts.has(options.host))
14
+ throw new TypeError('MCP host is already bound');
15
+ const [bridge, validators, codec] = await Promise.all([
16
+ loadMcpPlatformBridge(modules), loadMcpPlatformToolSchemas(modules), loadMcpPlatformResultCodec(modules),
17
+ ]);
18
+ const limits = Object.freeze({ ...options.limits });
19
+ const schemas = validators.compileMcpToolSchemas(tools, limits);
20
+ const authority = createStatefulAuthority(claimNames);
21
+ const invoke = options.invoke;
22
+ const authorize = options.authorize;
23
+ const formatRefusal = options.formatRefusal;
24
+ let active = false;
25
+ const refusal = (tool, reason, context = authority.current()) => {
26
+ if (!context)
27
+ return safeFailure();
28
+ try {
29
+ const result = codec.validateMcpWireResult(formatRefusal(tool, reason, context), limits);
30
+ if (result.isError !== true)
31
+ throw new TypeError();
32
+ return result;
33
+ }
34
+ catch {
35
+ return safeFailure();
36
+ }
37
+ };
38
+ const runner = {
39
+ async run(tool, args, extra) {
40
+ const current = authority.current();
41
+ if (!active || !current)
42
+ return refusal(tool, { kind: 'inactive' });
43
+ const context = Object.freeze({
44
+ ...current, signal: combineMcpSignals([current.signal, extra.signal]),
45
+ });
46
+ if (context.signal.aborted)
47
+ return refusal(tool, { kind: 'inactive' }, context);
48
+ const decision = authorizeDispatch({
49
+ registry, toolName: tool,
50
+ principal: { sub: context.principal.sub, clientId: context.principal.clientId ?? '',
51
+ scopes: [...context.principal.scopes], claims: [...context.principal.claims] },
52
+ });
53
+ if (!decision.allowed) {
54
+ const reason = decision.code === 'insufficient_scope'
55
+ ? { kind: 'scope', missingScopes: registry.resolveTool(tool).requiredScopes.filter(scope => !context.principal.scopes.includes(scope)) }
56
+ : { kind: 'policy' };
57
+ return refusal(tool, reason, context);
58
+ }
59
+ let allowed = false;
60
+ try {
61
+ allowed = await authorize(tool, context);
62
+ }
63
+ catch { /* Account lookup fails closed. */ }
64
+ if (allowed !== true)
65
+ return refusal(tool, { kind: 'account' }, context);
66
+ context.signal.throwIfAborted();
67
+ const result = await invoke(tool, args, context);
68
+ context.signal.throwIfAborted();
69
+ return result;
70
+ },
71
+ };
72
+ // Recheck after asynchronous leaf acquisition: concurrent composition must bind once.
73
+ if (boundHosts.has(options.host))
74
+ throw new TypeError('MCP host is already bound');
75
+ boundHosts.add(options.host);
76
+ try {
77
+ const router = await options.host.bind(Object.freeze({
78
+ maxRequestBytes: limits.maxRequestBytes,
79
+ run: authority.run,
80
+ register: (server) => {
81
+ bridge.registerMcpWireTools(server, tools, runner, {
82
+ schemas, limits, formatFailure: (tool, failure) => refusal(tool, { kind: failure.kind }),
83
+ });
84
+ },
85
+ }));
86
+ if (!router || typeof router.fetch !== 'function')
87
+ throw new TypeError('MCP host bind must return its complete router');
88
+ active = true;
89
+ return { namespace: '/mcp', enabled: true, createRouter: () => router };
90
+ }
91
+ catch (error) {
92
+ active = false;
93
+ throw error;
94
+ }
95
+ }
96
+ //# sourceMappingURL=mcp-stateful.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-stateful.js","sourceRoot":"","sources":["../../src/compose/mcp-stateful.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAI/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAQpE,MAAM,UAAU,GAAG,IAAI,OAAO,EAAU,CAAC;AACzC,MAAM,WAA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B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YACnD,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,GAAG,EAAE,SAAS,CAAC,GAAG;YAClB,QAAQ,EAAE,CAAC,MAAyD,EAAE,EAAE;gBACtE,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBACjD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;iBACzF,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU;YAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QACxH,MAAM,GAAG,IAAI,CAAC;QACd,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;IAC1E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,KAAK,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -3,6 +3,7 @@ import type { ClusterMeshModules } from '../../modules/contracts.js';
3
3
  import type { McpRegistryBuiltin } from '../../mcp/registry.js';
4
4
  import { type ArtifactsDefinitionOptions } from '@sentropic/artifacts/mcp';
5
5
  export type { ArtifactsDefinitionOptions };
6
+ export { createArtifactsToolExecutor, type ArtifactsApp } from '@sentropic/artifacts/mcp';
6
7
  /**
7
8
  * The `sentropic.artifacts` builtin descriptor (spec-v8 §3/§9): static
8
9
  * metadata for the catalog plus a qualified loader. The heavy definition
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/integrations/mcp/artifacts.ts"],"names":[],"mappings":"AACA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAKL,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,UAAU,EAAE,0BAA0B,CAAC;CACxC,GAAG,kBAAkB,CAWrB"}
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/integrations/mcp/artifacts.ts"],"names":[],"mappings":"AACA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAKL,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE1F;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,UAAU,EAAE,0BAA0B,CAAC;CACxC,GAAG,kBAAkB,CAWrB"}
@@ -2,6 +2,7 @@
2
2
  import '../../modules/topology-guard-mcp.js';
3
3
  import { loadArtifactsMcp } from '../../loaders/mcp/artifacts.js';
4
4
  import { ARTIFACTS_TOOL_NAMES, ARTIFACTS_PARAMETER_SCHEMA, ARTIFACTS_PROVIDER_ID, ARTIFACTS_PROVIDER_VERSION, } from '@sentropic/artifacts/mcp';
5
+ export { createArtifactsToolExecutor } from '@sentropic/artifacts/mcp';
5
6
  /**
6
7
  * The `sentropic.artifacts` builtin descriptor (spec-v8 §3/§9): static
7
8
  * metadata for the catalog plus a qualified loader. The heavy definition
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../src/integrations/mcp/artifacts.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,qCAAqC,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,GAE3B,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAGtC;IACC,OAAO;QACL,UAAU,EAAE,qBAAqB;QACjC,OAAO,EAAE,0BAA0B;QACnC,YAAY,EAAE,CAAC,GAAG,oBAAoB,CAAC;QACvC,eAAe,EAAE,0BAA0B;QAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,OAAO,GAAG,CAAC,iCAAiC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACnE,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../src/integrations/mcp/artifacts.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,qCAAqC,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,GAE3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,2BAA2B,EAAqB,MAAM,0BAA0B,CAAC;AAE1F;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAGtC;IACC,OAAO;QACL,UAAU,EAAE,qBAAqB;QACjC,OAAO,EAAE,0BAA0B;QACnC,YAAY,EAAE,CAAC,GAAG,oBAAoB,CAAC;QACvC,eAAe,EAAE,0BAA0B;QAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,OAAO,GAAG,CAAC,iCAAiC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACnE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export { loadMcpPlatformBridge } from './bridge.js';
2
+ export { loadMcpPlatformToolSchemas } from './tool-schemas.js';
3
+ export { loadMcpPlatformResultCodec } from './result-codec.js';
2
4
  export { loadMcpPlatformEntry } from './entry.js';
3
5
  export { loadMcpPlatformHono } from './hono.js';
4
6
  export { loadMcpPlatformRegistry } from './registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loaders/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loaders/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export { loadMcpPlatformBridge } from './bridge.js';
2
+ export { loadMcpPlatformToolSchemas } from './tool-schemas.js';
3
+ export { loadMcpPlatformResultCodec } from './result-codec.js';
2
4
  export { loadMcpPlatformEntry } from './entry.js';
3
5
  export { loadMcpPlatformHono } from './hono.js';
4
6
  export { loadMcpPlatformRegistry } from './registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/loaders/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/loaders/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import '../../modules/topology-guard-mcp.js';
2
+ import type { ClusterMeshModules } from '../../modules/contracts.js';
3
+ export declare function loadMcpPlatformResultCodec(modules: ClusterMeshModules): Promise<typeof import('@sentropic/mcp-platform/transport/result-codec')>;
4
+ //# sourceMappingURL=result-codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-codec.d.ts","sourceRoot":"","sources":["../../../src/loaders/mcp/result-codec.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,cAAc,gDAAgD,CAAC,CAAC,CAE1E"}
@@ -0,0 +1,5 @@
1
+ import '../../modules/topology-guard-mcp.js';
2
+ export async function loadMcpPlatformResultCodec(modules) {
3
+ return await modules.load('mcp-platform/result-codec');
4
+ }
5
+ //# sourceMappingURL=result-codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-codec.js","sourceRoot":"","sources":["../../../src/loaders/mcp/result-codec.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAA2B;IAE3B,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAoE,CAAC;AAC5H,CAAC"}
@@ -0,0 +1,4 @@
1
+ import '../../modules/topology-guard-mcp.js';
2
+ import type { ClusterMeshModules } from '../../modules/contracts.js';
3
+ export declare function loadMcpPlatformToolSchemas(modules: ClusterMeshModules): Promise<typeof import('@sentropic/mcp-platform/transport/tool-schemas')>;
4
+ //# sourceMappingURL=tool-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-schemas.d.ts","sourceRoot":"","sources":["../../../src/loaders/mcp/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,cAAc,gDAAgD,CAAC,CAAC,CAE1E"}
@@ -0,0 +1,5 @@
1
+ import '../../modules/topology-guard-mcp.js';
2
+ export async function loadMcpPlatformToolSchemas(modules) {
3
+ return await modules.load('mcp-platform/tool-schemas');
4
+ }
5
+ //# sourceMappingURL=tool-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-schemas.js","sourceRoot":"","sources":["../../../src/loaders/mcp/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAA2B;IAE3B,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAoE,CAAC;AAC5H,CAAC"}
@@ -14,6 +14,8 @@
14
14
  import '../modules/topology-guard-mcp.js';
15
15
  import type { ClusterMeshModules } from '../modules/contracts.js';
16
16
  import type { CompiledMcpRegistry, CompileRegistryInput, CompileRegistryResult, ProviderCatalogEntry, ProviderParameterSchema, RegistryDefinition } from '@sentropic/mcp-platform/registry';
17
+ export { computeManifestDigest } from '@sentropic/mcp-platform/tool-configuration';
18
+ export type { CompiledMcpRegistry, CompileRegistryInput, CompileRegistryResult, RegistryDefinition };
17
19
  /** Static mesh-supplied builtin: metadata descriptor plus a loader (no dynamic code). */
18
20
  export interface McpRegistryBuiltin {
19
21
  readonly providerId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/mcp/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;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B,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAqJ9E"}
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import '../modules/topology-guard-mcp.js';
15
15
  import { loadMcpPlatformRegistry } from '../loaders/mcp/registry.js';
16
+ export { computeManifestDigest } from '@sentropic/mcp-platform/tool-configuration';
16
17
  function isRecord(value) {
17
18
  return typeof value === 'object' && value !== null && !Array.isArray(value);
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/mcp/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAkCrE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,IAAI,CAAC,IAAY,EAAE,OAAe;IACzC,MAAM,WAAW,GAAkC;QACjD,EAAE,IAAI,EAAE,gBAAyB,EAAE,IAAI,EAAE,OAAO,EAAE;KACnD,CAAC;IACF,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAyB;IACzD,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IACxC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA8B,CAAC;IACvD,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QAC7C,IAAI,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC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,CAAC;oBAAE,SAAS;gBAC9C,IAAI,CAAC;oBACH,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;gBACvC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,IAAI,CACT,cAAc,UAAU,IAAI,EAC5B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,MAAM,CAAC,EAAE;gBAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC;YACzC,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,QAAQ;YACN,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { VerifiedMcpRequest } from './stateful-contracts.js';
2
+ export declare const combineMcpSignals: (signals: AbortSignal[]) => AbortSignal;
3
+ /** One authority store per composer; never attach the most recent caller to a session. */
4
+ export declare function createStatefulAuthority(verifiedClaimNames: readonly string[]): {
5
+ current: () => VerifiedMcpRequest | undefined;
6
+ run<T>(authority: VerifiedMcpRequest, next: () => Promise<T>): Promise<T>;
7
+ };
8
+ //# sourceMappingURL=stateful-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-context.d.ts","sourceRoot":"","sources":["../../src/mcp/stateful-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,eAAO,MAAM,iBAAiB,YAAa,WAAW,EAAE,KAAG,WACqC,CAAC;AA2BjG,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE;;sBAOjD,kBAAkB,QAAQ,MAAM,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;EAuBlF"}
@@ -0,0 +1,61 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ // Same request-local pattern as #689; this mode never installs a subject-token store.
3
+ export const combineMcpSignals = (signals) => AbortSignal.any(signals);
4
+ function frozenJson(value, active = new Set(), depth = 0) {
5
+ if (depth > 64)
6
+ throw new TypeError('Invalid verified attributes');
7
+ if (value === null || typeof value === 'string' || typeof value === 'boolean'
8
+ || (typeof value === 'number' && Number.isFinite(value)))
9
+ return value;
10
+ if (typeof value !== 'object' || value === null || active.has(value)
11
+ || (!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype
12
+ && Object.getPrototypeOf(value) !== null)) {
13
+ throw new TypeError('Invalid verified attributes');
14
+ }
15
+ active.add(value);
16
+ if (Object.getOwnPropertySymbols(value).length
17
+ || (Array.isArray(value) && Object.keys(value).length !== value.length)) {
18
+ throw new TypeError('Invalid verified attributes');
19
+ }
20
+ const entries = Object.entries(value).map(([key, child]) => {
21
+ if (/^(authorization(header)?|accesstoken|refreshtoken|subjecttoken|bearer|cookie|setcookie)$/.test(key.replace(/[_-]/g, '').toLowerCase())) {
22
+ throw new TypeError('Credentials are forbidden in verified attributes');
23
+ }
24
+ return [key, frozenJson(child, active, depth + 1)];
25
+ });
26
+ active.delete(value);
27
+ return Object.freeze(Array.isArray(value) ? entries.map(([, child]) => child) : Object.fromEntries(entries));
28
+ }
29
+ /** One authority store per composer; never attach the most recent caller to a session. */
30
+ export function createStatefulAuthority(verifiedClaimNames) {
31
+ const storage = new AsyncLocalStorage();
32
+ const labels = new Set(verifiedClaimNames);
33
+ const text = (value) => typeof value === 'string' && value.length > 0;
34
+ const strings = (value) => Array.isArray(value) && value.every(text);
35
+ return {
36
+ current: () => storage.getStore(),
37
+ async run(authority, next) {
38
+ const p = authority?.principal;
39
+ if (!p || !text(p.issuer) || !text(p.sub) || !text(authority.resource)
40
+ || !text(authority.correlationId) || !(authority.signal instanceof AbortSignal)
41
+ || !strings(p.scopes) || !strings(p.claims) || p.claims.some(label => !labels.has(label))
42
+ || (p.clientId !== undefined && !text(p.clientId)) || (p.tid !== undefined && !text(p.tid))
43
+ || typeof p.attributes !== 'object' || p.attributes === null || Array.isArray(p.attributes)) {
44
+ throw new TypeError('Invalid verified MCP request');
45
+ }
46
+ const snapshot = Object.freeze({
47
+ principal: Object.freeze({
48
+ issuer: p.issuer, sub: p.sub,
49
+ ...(p.clientId === undefined ? {} : { clientId: p.clientId }),
50
+ ...(p.tid === undefined ? {} : { tid: p.tid }),
51
+ scopes: Object.freeze([...p.scopes]), claims: Object.freeze([...p.claims]),
52
+ attributes: frozenJson(p.attributes),
53
+ }),
54
+ resource: authority.resource, correlationId: authority.correlationId, signal: authority.signal,
55
+ });
56
+ snapshot.signal.throwIfAborted();
57
+ return storage.run(snapshot, next);
58
+ },
59
+ };
60
+ }
61
+ //# sourceMappingURL=stateful-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-context.js","sourceRoot":"","sources":["../../src/mcp/stateful-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAsB,EAAe,EAAE,CACtE,WAAgF,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAEjG,SAAS,UAAU,CAAC,KAAc,EAAE,SAAS,IAAI,GAAG,EAAU,EAAE,KAAK,GAAG,CAAC;IACvE,IAAI,KAAK,GAAG,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;IACnE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;WACxE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACzE,IAAI,OAAO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CAAC,MAAM;aAC/F,CAAC,CAAC;YACH,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YACjC,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { Hono } from 'hono';
2
+ import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import type { CallToolResult, Tool } from '@modelcontextprotocol/sdk/types.js';
4
+ import type { CompiledMcpRegistry } from '@sentropic/mcp-platform/registry';
5
+ import type { McpToolValidationLimits } from '@sentropic/mcp-platform/transport/tool-schemas';
6
+ export interface VerifiedMcpRequest {
7
+ readonly principal: Readonly<{
8
+ issuer: string;
9
+ sub: string;
10
+ clientId?: string;
11
+ tid?: string;
12
+ scopes: readonly string[];
13
+ claims: readonly string[];
14
+ attributes: Readonly<Record<string, unknown>>;
15
+ }>;
16
+ readonly resource: string;
17
+ readonly correlationId: string;
18
+ readonly signal: AbortSignal;
19
+ }
20
+ export interface StatefulMcpHooks {
21
+ /** Host must bound the complete raw JSON-RPC body before parsing. */
22
+ readonly maxRequestBytes: number;
23
+ /** Public McpServer.server seam: install before connect, or under the host barrier. */
24
+ register(server: Server): void;
25
+ run<T>(authority: VerifiedMcpRequest, next: () => Promise<T>): Promise<T>;
26
+ }
27
+ export interface StatefulMcpHost {
28
+ readonly verifiedClaimNames: readonly string[];
29
+ /**
30
+ * Bind once: pause admission (including initialize), drain old calls, then
31
+ * replace list/call on every existing server and register future servers.
32
+ * Clear old bearer state; disable high-level tool updates. Release only on
33
+ * complete success; installation failure retains objects and closed admission.
34
+ * The host keeps sessions, authentication, owner/expiry semantics and cleanup.
35
+ */
36
+ bind(hooks: StatefulMcpHooks): Promise<Hono>;
37
+ }
38
+ export type McpWrapRefusal = {
39
+ kind: 'scope';
40
+ missingScopes: readonly string[];
41
+ } | {
42
+ kind: 'account' | 'policy' | 'invalid-arguments' | 'inactive' | 'internal';
43
+ };
44
+ export interface StatefulMcpNamespaceOptions {
45
+ readonly host: StatefulMcpHost;
46
+ readonly registry: CompiledMcpRegistry;
47
+ readonly tools: readonly Tool[];
48
+ readonly limits: McpToolValidationLimits;
49
+ authorize(tool: string, context: VerifiedMcpRequest): Promise<boolean>;
50
+ invoke(tool: string, args: Record<string, unknown>, context: VerifiedMcpRequest): Promise<CallToolResult>;
51
+ formatRefusal(tool: string, refusal: McpWrapRefusal, context: VerifiedMcpRequest): CallToolResult;
52
+ }
53
+ //# sourceMappingURL=stateful-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-contracts.d.ts","sourceRoot":"","sources":["../../src/mcp/stateful-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAE9F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QAC1B,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QAC1B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC/C,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,C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C,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,kBAAkB,GAAG,cAAc,CAAC;CACnG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stateful-contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-contracts.js","sourceRoot":"","sources":["../../src/mcp/stateful-contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,48 @@
1
+ import type { CompiledMcpRegistry } from '@sentropic/mcp-platform/registry';
2
+ import type { StatefulMcpNamespaceOptions } from './stateful-contracts.js';
3
+ /** All checks and snapshots complete before the host can mutate an existing server. */
4
+ export declare function prepareStatefulTools(options: StatefulMcpNamespaceOptions): {
5
+ tools: readonly {
6
+ inputSchema: {
7
+ [x: string]: unknown;
8
+ type: "object";
9
+ properties?: {
10
+ [x: string]: object;
11
+ } | undefined;
12
+ required?: string[] | undefined;
13
+ };
14
+ name: string;
15
+ description?: string | undefined;
16
+ outputSchema?: {
17
+ [x: string]: unknown;
18
+ type: "object";
19
+ properties?: {
20
+ [x: string]: object;
21
+ } | undefined;
22
+ required?: string[] | undefined;
23
+ } | undefined;
24
+ annotations?: {
25
+ title?: string | undefined;
26
+ readOnlyHint?: boolean | undefined;
27
+ destructiveHint?: boolean | undefined;
28
+ idempotentHint?: boolean | undefined;
29
+ openWorldHint?: boolean | undefined;
30
+ } | undefined;
31
+ execution?: {
32
+ taskSupport?: "forbidden" | "optional" | "required" | undefined;
33
+ } | undefined;
34
+ _meta?: {
35
+ [x: string]: unknown;
36
+ } | undefined;
37
+ icons?: {
38
+ src: string;
39
+ mimeType?: string | undefined;
40
+ sizes?: string[] | undefined;
41
+ theme?: "light" | "dark" | undefined;
42
+ }[] | undefined;
43
+ title?: string | undefined;
44
+ }[];
45
+ registry: CompiledMcpRegistry;
46
+ claimNames: readonly any[];
47
+ };
48
+ //# sourceMappingURL=stateful-preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateful-preflight.d.ts","sourceRoot":"","sources":["../../src/mcp/stateful-preflight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAA0B,MAAM,kCAAkC,CAAC;AACpG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAU3E,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCxE"}
@@ -0,0 +1,46 @@
1
+ import { isDeepStrictEqual } from 'node:util';
2
+ import { ToolSchema } from '@modelcontextprotocol/sdk/types.js';
3
+ function freeze(value) {
4
+ if (typeof value === 'object' && value !== null) {
5
+ Object.values(value).forEach(freeze);
6
+ Object.freeze(value);
7
+ }
8
+ return value;
9
+ }
10
+ /** All checks and snapshots complete before the host can mutate an existing server. */
11
+ export function prepareStatefulTools(options) {
12
+ if (!options.host || typeof options.host.bind !== 'function'
13
+ || typeof options.authorize !== 'function' || typeof options.invoke !== 'function'
14
+ || typeof options.formatRefusal !== 'function')
15
+ throw new TypeError('Missing stateful host bindings');
16
+ const claimNames = options.host.verifiedClaimNames;
17
+ if (!Array.isArray(claimNames) || claimNames.some(name => typeof name !== 'string' || !name)
18
+ || new Set(claimNames).size !== claimNames.length)
19
+ throw new TypeError('Invalid verified claim mappings');
20
+ const tools = freeze(structuredClone(options.tools));
21
+ const resolutions = new Map();
22
+ for (const tool of tools) {
23
+ const resolution = options.registry.resolveTool(tool.name);
24
+ if (!tool.name || resolutions.has(tool.name) || !resolution || !ToolSchema.safeParse(tool).success) {
25
+ throw new TypeError('MCP tools must be unique, valid and resolve in the compiled registry');
26
+ }
27
+ if (!isDeepStrictEqual(tool.inputSchema, resolution.inputSchema)) {
28
+ throw new TypeError(`${tool.name}: descriptor schema differs from digest-bound manifest`);
29
+ }
30
+ if (resolution.requiredClaims.some(claim => !claimNames.includes(claim))) {
31
+ throw new TypeError(`${tool.name}: required claim has no verified host mapping`);
32
+ }
33
+ resolutions.set(tool.name, freeze({
34
+ ...resolution, requiredScopes: [...resolution.requiredScopes], requiredClaims: [...resolution.requiredClaims],
35
+ }));
36
+ }
37
+ if (resolutions.size !== options.registry.tools.size
38
+ || [...options.registry.tools.keys()].some(name => !resolutions.has(name))) {
39
+ throw new TypeError('MCP wrapping requires complete selected-provider tool coverage');
40
+ }
41
+ const registry = {
42
+ providers: options.registry.providers, tools: resolutions, resolveTool: name => resolutions.get(name),
43
+ };
44
+ return { tools, registry, claimNames: Object.freeze([...claimNames]) };
45
+ }
46
+ //# sourceMappingURL=stateful-preflight.js.map