@vinkius-core/mcp-fusion 0.10.0 → 1.1.0

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 (122) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +274 -303
  3. package/dist/framework/builder/ActionGroupBuilder.d.ts +1 -1
  4. package/dist/framework/builder/ActionGroupBuilder.d.ts.map +1 -1
  5. package/dist/framework/builder/ActionGroupBuilder.js +1 -0
  6. package/dist/framework/builder/ActionGroupBuilder.js.map +1 -1
  7. package/dist/framework/builder/GroupedToolBuilder.d.ts +29 -1
  8. package/dist/framework/builder/GroupedToolBuilder.d.ts.map +1 -1
  9. package/dist/framework/builder/GroupedToolBuilder.js +108 -18
  10. package/dist/framework/builder/GroupedToolBuilder.js.map +1 -1
  11. package/dist/framework/builder/defineTool.d.ts +5 -2
  12. package/dist/framework/builder/defineTool.d.ts.map +1 -1
  13. package/dist/framework/builder/defineTool.js +5 -0
  14. package/dist/framework/builder/defineTool.js.map +1 -1
  15. package/dist/framework/execution/ExecutionPipeline.d.ts.map +1 -1
  16. package/dist/framework/execution/ExecutionPipeline.js +4 -2
  17. package/dist/framework/execution/ExecutionPipeline.js.map +1 -1
  18. package/dist/framework/execution/MiddlewareCompiler.d.ts +1 -14
  19. package/dist/framework/execution/MiddlewareCompiler.d.ts.map +1 -1
  20. package/dist/framework/execution/MiddlewareCompiler.js.map +1 -1
  21. package/dist/framework/index.d.ts +11 -0
  22. package/dist/framework/index.d.ts.map +1 -1
  23. package/dist/framework/index.js +11 -0
  24. package/dist/framework/index.js.map +1 -1
  25. package/dist/framework/introspection/IntrospectionResource.d.ts +20 -0
  26. package/dist/framework/introspection/IntrospectionResource.d.ts.map +1 -0
  27. package/dist/framework/introspection/IntrospectionResource.js +116 -0
  28. package/dist/framework/introspection/IntrospectionResource.js.map +1 -0
  29. package/dist/framework/introspection/ManifestCompiler.d.ts +33 -0
  30. package/dist/framework/introspection/ManifestCompiler.d.ts.map +1 -0
  31. package/dist/framework/introspection/ManifestCompiler.js +88 -0
  32. package/dist/framework/introspection/ManifestCompiler.js.map +1 -0
  33. package/dist/framework/introspection/index.d.ts +6 -0
  34. package/dist/framework/introspection/index.d.ts.map +1 -0
  35. package/dist/framework/introspection/index.js +4 -0
  36. package/dist/framework/introspection/index.js.map +1 -0
  37. package/dist/framework/introspection/types.d.ts +120 -0
  38. package/dist/framework/introspection/types.d.ts.map +1 -0
  39. package/dist/framework/introspection/types.js +13 -0
  40. package/dist/framework/introspection/types.js.map +1 -0
  41. package/dist/framework/observability/DebugObserver.d.ts +150 -0
  42. package/dist/framework/observability/DebugObserver.d.ts.map +1 -0
  43. package/dist/framework/observability/DebugObserver.js +95 -0
  44. package/dist/framework/observability/DebugObserver.js.map +1 -0
  45. package/dist/framework/presenter/PostProcessor.d.ts +38 -0
  46. package/dist/framework/presenter/PostProcessor.d.ts.map +1 -0
  47. package/dist/framework/presenter/PostProcessor.js +64 -0
  48. package/dist/framework/presenter/PostProcessor.js.map +1 -0
  49. package/dist/framework/presenter/Presenter.d.ts +375 -0
  50. package/dist/framework/presenter/Presenter.d.ts.map +1 -0
  51. package/dist/framework/presenter/Presenter.js +534 -0
  52. package/dist/framework/presenter/Presenter.js.map +1 -0
  53. package/dist/framework/presenter/PresenterValidationError.d.ts +42 -0
  54. package/dist/framework/presenter/PresenterValidationError.d.ts.map +1 -0
  55. package/dist/framework/presenter/PresenterValidationError.js +55 -0
  56. package/dist/framework/presenter/PresenterValidationError.js.map +1 -0
  57. package/dist/framework/presenter/ResponseBuilder.d.ts +225 -0
  58. package/dist/framework/presenter/ResponseBuilder.d.ts.map +1 -0
  59. package/dist/framework/presenter/ResponseBuilder.js +306 -0
  60. package/dist/framework/presenter/ResponseBuilder.js.map +1 -0
  61. package/dist/framework/presenter/index.d.ts +13 -0
  62. package/dist/framework/presenter/index.d.ts.map +1 -0
  63. package/dist/framework/presenter/index.js +16 -0
  64. package/dist/framework/presenter/index.js.map +1 -0
  65. package/dist/framework/presenter/ui.d.ts +205 -0
  66. package/dist/framework/presenter/ui.d.ts.map +1 -0
  67. package/dist/framework/presenter/ui.js +222 -0
  68. package/dist/framework/presenter/ui.js.map +1 -0
  69. package/dist/framework/registry/ToolRegistry.d.ts +29 -0
  70. package/dist/framework/registry/ToolRegistry.d.ts.map +1 -1
  71. package/dist/framework/registry/ToolRegistry.js +42 -0
  72. package/dist/framework/registry/ToolRegistry.js.map +1 -1
  73. package/dist/framework/server/ServerAttachment.d.ts +89 -0
  74. package/dist/framework/server/ServerAttachment.d.ts.map +1 -1
  75. package/dist/framework/server/ServerAttachment.js +20 -3
  76. package/dist/framework/server/ServerAttachment.js.map +1 -1
  77. package/dist/framework/state-sync/CausalEngine.d.ts +28 -0
  78. package/dist/framework/state-sync/CausalEngine.d.ts.map +1 -0
  79. package/dist/framework/state-sync/CausalEngine.js +17 -0
  80. package/dist/framework/state-sync/CausalEngine.js.map +1 -0
  81. package/dist/framework/state-sync/DescriptionDecorator.d.ts +31 -0
  82. package/dist/framework/state-sync/DescriptionDecorator.d.ts.map +1 -0
  83. package/dist/framework/state-sync/DescriptionDecorator.js +38 -0
  84. package/dist/framework/state-sync/DescriptionDecorator.js.map +1 -0
  85. package/dist/framework/state-sync/GlobMatcher.d.ts +29 -0
  86. package/dist/framework/state-sync/GlobMatcher.d.ts.map +1 -0
  87. package/dist/framework/state-sync/GlobMatcher.js +79 -0
  88. package/dist/framework/state-sync/GlobMatcher.js.map +1 -0
  89. package/dist/framework/state-sync/PolicyEngine.d.ts +75 -0
  90. package/dist/framework/state-sync/PolicyEngine.d.ts.map +1 -0
  91. package/dist/framework/state-sync/PolicyEngine.js +107 -0
  92. package/dist/framework/state-sync/PolicyEngine.js.map +1 -0
  93. package/dist/framework/state-sync/PolicyValidator.d.ts +35 -0
  94. package/dist/framework/state-sync/PolicyValidator.d.ts.map +1 -0
  95. package/dist/framework/state-sync/PolicyValidator.js +72 -0
  96. package/dist/framework/state-sync/PolicyValidator.js.map +1 -0
  97. package/dist/framework/state-sync/ResponseDecorator.d.ts +33 -0
  98. package/dist/framework/state-sync/ResponseDecorator.d.ts.map +1 -0
  99. package/dist/framework/state-sync/ResponseDecorator.js +19 -0
  100. package/dist/framework/state-sync/ResponseDecorator.js.map +1 -0
  101. package/dist/framework/state-sync/StateSyncLayer.d.ts +106 -0
  102. package/dist/framework/state-sync/StateSyncLayer.d.ts.map +1 -0
  103. package/dist/framework/state-sync/StateSyncLayer.js +127 -0
  104. package/dist/framework/state-sync/StateSyncLayer.js.map +1 -0
  105. package/dist/framework/state-sync/index.d.ts +24 -0
  106. package/dist/framework/state-sync/index.d.ts.map +1 -0
  107. package/dist/framework/state-sync/index.js +25 -0
  108. package/dist/framework/state-sync/index.js.map +1 -0
  109. package/dist/framework/state-sync/types.d.ts +112 -0
  110. package/dist/framework/state-sync/types.d.ts.map +1 -0
  111. package/dist/framework/state-sync/types.js +17 -0
  112. package/dist/framework/state-sync/types.js.map +1 -0
  113. package/dist/framework/types.d.ts +38 -5
  114. package/dist/framework/types.d.ts.map +1 -1
  115. package/dist/framework/types.js +1 -0
  116. package/dist/framework/types.js.map +1 -1
  117. package/dist/index.d.ts +2 -2
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +1 -1
  120. package/dist/index.js.map +1 -1
  121. package/llms.txt +224 -67
  122. package/package.json +10 -3
package/CHANGELOG.md CHANGED
@@ -5,6 +5,74 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.0] - 2026-02-22
9
+
10
+ ### 🔍 Dynamic Manifest — RBAC-Aware Server Capabilities via MCP Resources
11
+
12
+ Expose a **live capabilities manifest** (`fusion://manifest.json`) as a native MCP Resource. Orchestrators, admin dashboards, and AI agents can discover every tool, action, and presenter registered on the server — dynamically filtered by the requesting user's role and permissions.
13
+
14
+ ### Added
15
+
16
+ - **Dynamic Manifest Resource:** New opt-in MCP Resource (`fusion://manifest.json`) that exposes the full server capabilities tree. Uses native MCP `resources/list` and `resources/read` protocol — no custom HTTP endpoints. Zero overhead when disabled.
17
+ - **ManifestCompiler:** New `compileManifest()` function that extracts metadata from all registered `ToolBuilder` instances and produces a structured `ManifestPayload` with tools, actions, input schemas, and presenter references. `cloneManifest()` provides deep-clone isolation for RBAC filtering.
18
+ - **IntrospectionResource:** New `registerIntrospectionResource()` function that registers `resources/list` and `resources/read` handlers on the low-level MCP Server. Supports custom URIs, RBAC filter callbacks, and context factory integration.
19
+ - **RBAC Filtering:** Filter callback receives a deep clone of the manifest plus the session context (from `contextFactory`). Delete tools, actions, or presenters the user should not see. Each request gets a fresh clone — concurrent sessions with different roles never interfere.
20
+ - **Presenter Introspection Accessors:** `getSchemaKeys()`, `getUiBlockTypes()`, and `hasContextualRules()` on the `Presenter` class — read-only accessors that extract metadata without executing `.make()`, no side effects, don't seal.
21
+ - **`ActionMetadata` Presenter Fields:** Extended `ActionMetadata` with `presenterName`, `presenterSchemaKeys`, `presenterUiBlockTypes`, and `presenterHasContextualRules` for action-level presenter metadata.
22
+ - **`ToolRegistry.getBuilders()`:** New method returning an iterable of all registered `ToolBuilder` instances for introspection.
23
+ - **`AttachOptions.introspection`:** New `IntrospectionConfig<TContext>` option with `enabled`, `uri`, and `filter` fields.
24
+ - **`AttachOptions.serverName`:** New option to set the manifest's server name (default: `'mcp-fusion-server'`).
25
+
26
+ ### Documentation
27
+ - **New "Dynamic Manifest" page:** Dedicated documentation page with full configuration guide, RBAC patterns, payload structure reference, architecture diagram, and real-world examples (multi-tenant RBAC, compliance audits, admin dashboards).
28
+ - **SEO:** 8 new FAQs for the Dynamic Manifest page with full structured data (FAQPage + TechArticle JSON-LD).
29
+
30
+ ### Test Suite
31
+ - **50 new tests** across 2 new test files:
32
+ - `Introspection.test.ts` — 31 tests covering ManifestCompiler, Presenter accessors, RBAC filtering, cloneManifest, ToolRegistry.getBuilders, ActionMetadata presenter fields.
33
+ - `IntrospectionIntegration.test.ts` — 19 mock-based integration tests covering handler registration, resources/list and resources/read, RBAC with context factory, zero-overhead guarantee, custom URIs, concurrent reads, dynamic registry, and full payload structure.
34
+ - **Test count:** 1,246 tests across 56 files, all passing.
35
+
36
+ ## [1.0.0] - 2026-02-22
37
+
38
+ ### 🎉 First Stable Release — MVA Architecture for AI-Native MCP Servers
39
+
40
+ This is the first stable release of `mcp-fusion`, introducing **MVA (Model-View-Agent)** — a new architectural pattern created by Renato Marinho at Vinkius Labs that replaces MVC for the AI era.
41
+
42
+ ### Highlights
43
+
44
+ - **MVA Architecture:** The Presenter replaces the View with a deterministic perception layer — domain rules, rendered charts, action affordances, and cognitive guardrails. Every response is structured. Every action is explicit.
45
+ - **Presenter Engine:** `createPresenter()` with Zod schema validation, system rules (static & dynamic), UI blocks (ECharts, Mermaid, Summary), suggested actions (Agentic HATEOAS), cognitive guardrails (`.agentLimit()`), and Presenter composition via `.embed()`.
46
+ - **Action Consolidation:** 5,000+ operations behind ONE tool via `module.action` discriminator. 10x fewer tokens. Hierarchical groups with infinite nesting.
47
+ - **Two Builder APIs:** `defineTool()` (JSON-first, zero Zod imports) and `createTool()` (full Zod power). Both produce identical runtime behavior.
48
+ - **tRPC-style Middleware:** Pre-compiled at build time with `defineMiddleware()` for context derivation. Apply globally or per-group. Zero runtime allocation.
49
+ - **Self-Healing Errors:** `toolError()` with structured recovery hints and suggested retry arguments. AI agents self-correct without human intervention.
50
+ - **FusionClient:** tRPC-style end-to-end type safety with `createFusionClient<TRouter>()`. Full autocomplete, compile-time checking, zero code generation.
51
+ - **State Sync:** RFC 7234-inspired cache signals with `cacheSignal()` and `invalidates()` for cross-domain causal invalidation. Prevents temporal blindness.
52
+ - **Cognitive Guardrails:** `.agentLimit(n)` prevents context DDoS. Reduces token costs by up to 100x on large datasets.
53
+ - **TOON Encoding:** `toonSuccess()` reduces token count by ~40% vs standard JSON while remaining LLM-parseable.
54
+ - **Zero-Overhead Observability:** `createDebugObserver()` with typed events. Absolutely zero runtime cost when disabled.
55
+ - **Result Monad:** `succeed()` / `fail()` for composable, type-safe error handling with TypeScript type narrowing.
56
+ - **Streaming Progress:** Generator handlers with `yield progress()` for real-time updates.
57
+ - **Introspection:** `getActionNames()`, `getActionMetadata()`, `previewPrompt()` for runtime inspection and documentation generation.
58
+ - **Typed Handler Args:** `defineTool()` handlers receive fully-typed `args` inferred from params. No casts needed.
59
+ - **InferRouter:** Compile-time router type extraction with `InferRouter<typeof registry>`.
60
+ - **Freeze-After-Build:** `Object.freeze()` after `.buildToolDefinition()` ensures immutable, deterministic tool definitions.
61
+ - **Zod .strip() Security:** Only declared fields reach the AI. Internal fields silently removed.
62
+ - **Tag Filtering:** Role-based tool exposure per session without code changes.
63
+ - **Validation Error Formatter:** LLM-friendly Zod error messages with actionable correction guidance.
64
+
65
+ ### Documentation
66
+ - **23 documentation pages** covering every feature with code examples and real-world patterns.
67
+ - **AEOS-optimized SEO:** 130+ unique FAQs across all pages as JSON-LD structured data, optimized for AI engines (ChatGPT, Perplexity, Gemini, Google SGE).
68
+ - **Per-page Open Graph, TechArticle, and FAQPage JSON-LD** via `transformHead` hook.
69
+ - **Global SoftwareSourceCode JSON-LD** with full metadata.
70
+ - **Comparison table** showing 20+ differentiators vs raw MCP.
71
+
72
+ ### Test Suite
73
+ - **842 tests** across 36 files, all passing.
74
+ - Covers: invariant contracts, security vectors, adversarial inputs, schema collisions, concurrent stress, E2E integration, streaming, FusionClient contracts, and Presenter composition.
75
+
8
76
  ## [0.10.0] - 2026-02-22
9
77
 
10
78
  ### Added