mountly-mcp 0.0.0 → 3.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 (100) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +258 -20
  3. package/dist/artifact/index.d.ts +49 -0
  4. package/dist/artifact/index.js +21 -0
  5. package/dist/artifact/index.js.map +1 -0
  6. package/dist/bridge/iframe-entry.d.ts +1 -0
  7. package/dist/bridge/iframe-entry.js +251 -209
  8. package/dist/bridge/index.d.ts +17 -12
  9. package/dist/bridge/index.js +2 -2
  10. package/dist/build/emit-html.d.ts +30 -0
  11. package/dist/build/emit-meta.d.ts +17 -0
  12. package/dist/build/index.d.ts +32 -47
  13. package/dist/build/index.js +9 -135
  14. package/dist/build/index.js.map +1 -1
  15. package/dist/chunk-33DMFKKD.js +111 -0
  16. package/dist/chunk-33DMFKKD.js.map +1 -0
  17. package/dist/chunk-4HC3OWAQ.js +185 -0
  18. package/dist/chunk-4HC3OWAQ.js.map +1 -0
  19. package/dist/chunk-4WAKOYMK.js +196 -0
  20. package/dist/chunk-4WAKOYMK.js.map +1 -0
  21. package/dist/chunk-5EHNJCMF.js +58 -0
  22. package/dist/chunk-5EHNJCMF.js.map +1 -0
  23. package/dist/chunk-6QHKKFO3.js +30 -0
  24. package/dist/chunk-6QHKKFO3.js.map +1 -0
  25. package/dist/chunk-DKK26TRS.js +199 -0
  26. package/dist/chunk-DKK26TRS.js.map +1 -0
  27. package/dist/{chunk-A64ZILAS.js → chunk-DQLQOMDM.js} +2 -1
  28. package/dist/{chunk-A64ZILAS.js.map → chunk-DQLQOMDM.js.map} +1 -1
  29. package/dist/chunk-KRAS266U.js +260 -0
  30. package/dist/chunk-KRAS266U.js.map +1 -0
  31. package/dist/chunk-NLQDVNZP.js +115 -0
  32. package/dist/chunk-NLQDVNZP.js.map +1 -0
  33. package/dist/chunk-SNWNF2XI.js +171 -0
  34. package/dist/chunk-SNWNF2XI.js.map +1 -0
  35. package/dist/chunk-UECZA34Q.js +52 -0
  36. package/dist/chunk-UECZA34Q.js.map +1 -0
  37. package/dist/chunk-YJA4H6IB.js +13 -0
  38. package/dist/chunk-YJA4H6IB.js.map +1 -0
  39. package/dist/cli.d.ts +2 -0
  40. package/dist/cli.js +286 -0
  41. package/dist/cli.js.map +1 -0
  42. package/dist/connect-server-7L4HGKKL.js +7 -0
  43. package/dist/connect-server-7L4HGKKL.js.map +1 -0
  44. package/dist/dev/connect-server.d.ts +13 -0
  45. package/dist/dev/host-entry.d.ts +13 -0
  46. package/dist/dev/host-entry.js +18330 -0
  47. package/dist/dev/index.d.ts +45 -0
  48. package/dist/dev/index.js +14 -0
  49. package/dist/dev/index.js.map +1 -0
  50. package/dist/dev/sandbox-entry.d.ts +7 -0
  51. package/dist/dev/sandbox-entry.js +80 -0
  52. package/dist/html.d.ts +4 -0
  53. package/dist/index.d.ts +6 -26
  54. package/dist/index.js +8 -3
  55. package/dist/json-render/app.d.ts +22 -0
  56. package/dist/json-render/app.js +10 -0
  57. package/dist/json-render/app.js.map +1 -0
  58. package/dist/json-render/index.d.ts +10 -0
  59. package/dist/json-render/index.js +119 -0
  60. package/dist/json-render/index.js.map +1 -0
  61. package/dist/json-render/mcp.d.ts +49 -0
  62. package/dist/json-render/mcp.js +11 -0
  63. package/dist/json-render/mcp.js.map +1 -0
  64. package/dist/json-render/server.d.ts +72 -0
  65. package/dist/json-render/server.js +98 -0
  66. package/dist/json-render/server.js.map +1 -0
  67. package/dist/json-render/spec-stream.d.ts +26 -0
  68. package/dist/json-render/use-spec-stream.d.ts +26 -0
  69. package/dist/json-render/widget.d.ts +59 -0
  70. package/dist/react/context.d.ts +14 -0
  71. package/dist/react/create-widget.d.ts +11 -0
  72. package/dist/react/hooks.d.ts +46 -0
  73. package/dist/react/index.d.ts +3 -0
  74. package/dist/react/index.js +35 -0
  75. package/dist/react/index.js.map +1 -0
  76. package/dist/sandbox/index.d.ts +16 -0
  77. package/dist/sandbox/index.js +8 -0
  78. package/dist/sandbox/index.js.map +1 -0
  79. package/dist/schema.d.ts +20 -0
  80. package/dist/server/index.d.ts +73 -0
  81. package/dist/server/index.js +235 -0
  82. package/dist/server/index.js.map +1 -0
  83. package/dist/svelte/index.d.ts +35 -0
  84. package/dist/svelte/index.js +9 -0
  85. package/dist/svelte/index.js.map +1 -0
  86. package/dist/testing/index.d.ts +27 -0
  87. package/dist/testing/index.js +312 -0
  88. package/dist/testing/index.js.map +1 -0
  89. package/dist/testing/render-artifact.d.ts +35 -0
  90. package/dist/types.d.ts +55 -0
  91. package/dist/vite/index.d.ts +23 -0
  92. package/dist/vite/index.js +211 -0
  93. package/dist/vite/index.js.map +1 -0
  94. package/dist/vue/index.d.ts +56 -0
  95. package/dist/vue/index.js +89 -0
  96. package/dist/vue/index.js.map +1 -0
  97. package/package.json +166 -20
  98. package/dist/chunk-BUGGLMNA.js +0 -132
  99. package/dist/chunk-BUGGLMNA.js.map +0 -1
  100. package/dist/types-B9JAWm4W.d.ts +0 -62
@@ -1,132 +0,0 @@
1
- import {
2
- MCP_ERROR_CODES
3
- } from "./chunk-A64ZILAS.js";
4
-
5
- // src/bridge/index.ts
6
- import {
7
- App,
8
- PostMessageTransport
9
- } from "@modelcontextprotocol/ext-apps";
10
- function renderErrorBoundary(container, code, message) {
11
- const doc = container.ownerDocument;
12
- if (!doc) return;
13
- const errorDiv = doc.createElement("div");
14
- errorDiv.setAttribute("data-mountly-mcp-error", code);
15
- if (message !== void 0) errorDiv.textContent = message;
16
- container.innerHTML = "";
17
- container.appendChild(errorDiv);
18
- }
19
- function runBridge(options) {
20
- const {
21
- widget,
22
- container,
23
- awaitToolResult = true,
24
- availableDisplayModes = ["inline"],
25
- appInfo = { name: "mountly-mcp", version: "0.0.0" }
26
- } = options;
27
- const appCapabilities = {
28
- availableDisplayModes: [...availableDisplayModes]
29
- };
30
- const app = options.app ?? new App(appInfo, appCapabilities);
31
- let toolInput;
32
- let toolResult;
33
- let mounted = false;
34
- let pending = Promise.resolve();
35
- function currentProps() {
36
- return {
37
- mcp: app,
38
- toolInput,
39
- toolResult,
40
- hostContext: app.getHostContext()
41
- };
42
- }
43
- function notifyError(code, error) {
44
- const message = error instanceof Error ? error.message : String(error);
45
- try {
46
- app.sendLog({ level: "error", data: { code, message } });
47
- } catch {
48
- }
49
- renderErrorBoundary(container, code, message);
50
- }
51
- function renderWith(props) {
52
- pending = pending.then(async () => {
53
- try {
54
- if (!mounted) {
55
- const r = widget.mount(container, props);
56
- if (r instanceof Promise) await r;
57
- mounted = true;
58
- } else if (widget.update) {
59
- const r = widget.update(container, props);
60
- if (r instanceof Promise) await r;
61
- } else {
62
- widget.unmount(container);
63
- const r = widget.mount(container, props);
64
- if (r instanceof Promise) await r;
65
- mounted = true;
66
- }
67
- } catch (error) {
68
- notifyError(MCP_ERROR_CODES.WIDGET_MOUNT_THREW, error);
69
- }
70
- });
71
- }
72
- app.ontoolinput = (params) => {
73
- toolInput = params;
74
- if (!awaitToolResult) return;
75
- if (mounted || toolResult !== void 0) renderWith(currentProps());
76
- };
77
- app.ontoolinputpartial = () => {
78
- };
79
- app.ontoolresult = (params) => {
80
- toolResult = params;
81
- renderWith(currentProps());
82
- };
83
- app.ontoolcancelled = () => {
84
- renderWith(currentProps());
85
- };
86
- app.onhostcontextchanged = () => {
87
- if (mounted) renderWith(currentProps());
88
- };
89
- app.onteardown = async () => {
90
- if (mounted) {
91
- widget.unmount(container);
92
- mounted = false;
93
- }
94
- return {};
95
- };
96
- const ready = (async () => {
97
- if (!options.app) {
98
- await app.connect();
99
- }
100
- try {
101
- app.setupSizeChangedNotifications();
102
- } catch {
103
- }
104
- if (!awaitToolResult) {
105
- renderWith({ mcp: app });
106
- }
107
- })();
108
- const detachTeardown = options.onTeardown?.(() => {
109
- if (mounted) widget.unmount(container);
110
- }) ?? (typeof window !== "undefined" ? (() => {
111
- const h = () => {
112
- if (mounted) widget.unmount(container);
113
- };
114
- window.addEventListener("beforeunload", h);
115
- return () => window.removeEventListener("beforeunload", h);
116
- })() : () => void 0);
117
- return {
118
- ready,
119
- app,
120
- stop() {
121
- detachTeardown();
122
- if (mounted) widget.unmount(container);
123
- }
124
- };
125
- }
126
-
127
- export {
128
- App,
129
- PostMessageTransport,
130
- runBridge
131
- };
132
- //# sourceMappingURL=chunk-BUGGLMNA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/bridge/index.ts"],"sourcesContent":["/**\n * View-side bridge that turns an MCP Apps `App` into a mountly `WidgetModule`\n * lifecycle. The full spec handshake — `ui/initialize`,\n * `ui/notifications/initialized`, `ui/notifications/tool-input(-partial)`,\n * `ui/notifications/tool-result`, `ui/notifications/tool-cancelled`,\n * `ui/notifications/host-context-changed`, `ui/resource-teardown`,\n * `ui/notifications/size-changed` — is delegated to ext-apps's `App`.\n */\nimport {\n App,\n PostMessageTransport,\n type McpUiAppCapabilities,\n} from \"@modelcontextprotocol/ext-apps\";\nimport type { WidgetModule } from \"mountly/adapter\";\nimport { MCP_ERROR_CODES } from \"../schema.js\";\nimport type {\n DisplayMode,\n McpWidgetProps,\n ToolInput,\n ToolResult,\n} from \"../types.js\";\n\nexport interface RunBridgeOptions {\n /** Pre-constructed App (used by jsdom tests); otherwise one is created here. */\n app?: App;\n widget: WidgetModule;\n container: Element;\n /**\n * If true (default), mount is deferred until the first tool-result arrives;\n * the widget renders against `{ toolInput, toolResult, hostContext, mcp }`\n * props on each notification.\n *\n * If false, mount fires immediately after `ui/initialize` with `{ mcp }`\n * only — for \"stateless\" views that drive themselves via `mcp.callServerTool`.\n */\n awaitToolResult?: boolean;\n /** Display modes this view supports. Declared to the host during `ui/initialize`. */\n availableDisplayModes?: ReadonlyArray<DisplayMode>;\n /** App identity sent during `ui/initialize`. */\n appInfo?: { name: string; version: string };\n /** Override for tests; defaults to `window.addEventListener('beforeunload', ...)`. */\n onTeardown?: (handler: () => void) => () => void;\n}\n\nexport interface RunningBridge {\n /** Resolves once `ui/initialize` handshake completes and the first mount (or deferred mount) is wired. */\n ready: Promise<void>;\n /** The underlying App; exposed for hosts that want to drive the view directly. */\n app: App;\n /** Synchronously triggers teardown. */\n stop(): void;\n}\n\nfunction renderErrorBoundary(container: Element, code: string, message?: string): void {\n const doc = container.ownerDocument;\n if (!doc) return;\n const errorDiv = doc.createElement(\"div\");\n errorDiv.setAttribute(\"data-mountly-mcp-error\", code);\n if (message !== undefined) errorDiv.textContent = message;\n container.innerHTML = \"\";\n container.appendChild(errorDiv);\n}\n\nexport function runBridge(options: RunBridgeOptions): RunningBridge {\n const {\n widget,\n container,\n awaitToolResult = true,\n availableDisplayModes = [\"inline\"],\n appInfo = { name: \"mountly-mcp\", version: \"0.0.0\" },\n } = options;\n\n const appCapabilities: McpUiAppCapabilities = {\n availableDisplayModes: [...availableDisplayModes],\n };\n\n const app = options.app ?? new App(appInfo, appCapabilities);\n\n let toolInput: ToolInput | undefined;\n let toolResult: ToolResult | undefined;\n let mounted = false;\n let pending: Promise<void> = Promise.resolve();\n\n function currentProps(): McpWidgetProps {\n return {\n mcp: app,\n toolInput,\n toolResult,\n hostContext: app.getHostContext(),\n };\n }\n\n function notifyError(code: string, error: unknown): void {\n const message = error instanceof Error ? error.message : String(error);\n try {\n app.sendLog({ level: \"error\", data: { code, message } });\n } catch {\n // ignore — log channel may not be ready\n }\n renderErrorBoundary(container, code, message);\n }\n\n function renderWith(props: McpWidgetProps): void {\n pending = pending.then(async () => {\n try {\n if (!mounted) {\n const r = widget.mount(container, props);\n if (r instanceof Promise) await r;\n mounted = true;\n } else if (widget.update) {\n const r = widget.update(container, props);\n if (r instanceof Promise) await r;\n } else {\n widget.unmount(container);\n const r = widget.mount(container, props);\n if (r instanceof Promise) await r;\n mounted = true;\n }\n } catch (error) {\n notifyError(MCP_ERROR_CODES.WIDGET_MOUNT_THREW, error);\n }\n });\n }\n\n // Event handlers MUST be registered before connect() — ext-apps will refuse\n // to attach handlers retroactively after the initialize handshake completes.\n app.ontoolinput = (params) => {\n toolInput = params;\n if (!awaitToolResult) return;\n if (mounted || toolResult !== undefined) renderWith(currentProps());\n };\n\n app.ontoolinputpartial = () => {\n // Views MAY ignore partial input per spec; default policy is to skip.\n // Consumers wanting streaming UX can subscribe via app.addEventListener.\n };\n\n app.ontoolresult = (params) => {\n toolResult = params;\n renderWith(currentProps());\n };\n\n app.ontoolcancelled = () => {\n renderWith(currentProps());\n };\n\n app.onhostcontextchanged = () => {\n if (mounted) renderWith(currentProps());\n };\n\n app.onteardown = async () => {\n if (mounted) {\n widget.unmount(container);\n mounted = false;\n }\n return {};\n };\n\n const ready = (async () => {\n if (!options.app) {\n // App.connect() defaults to PostMessageTransport(window.parent, window.parent).\n await app.connect();\n }\n\n try {\n app.setupSizeChangedNotifications();\n } catch {\n // ResizeObserver may be unavailable (jsdom/non-browser).\n }\n\n if (!awaitToolResult) {\n renderWith({ mcp: app });\n }\n })();\n\n const detachTeardown =\n options.onTeardown?.(() => {\n if (mounted) widget.unmount(container);\n }) ??\n (typeof window !== \"undefined\"\n ? (() => {\n const h = () => {\n if (mounted) widget.unmount(container);\n };\n window.addEventListener(\"beforeunload\", h);\n return () => window.removeEventListener(\"beforeunload\", h);\n })()\n : () => undefined);\n\n return {\n ready,\n app,\n stop() {\n detachTeardown();\n if (mounted) widget.unmount(container);\n },\n };\n}\n\nexport { App, PostMessageTransport };\nexport type {\n McpUiAppCapabilities,\n McpUiHostCapabilities,\n McpUiHostContext,\n McpUiToolInputNotification,\n McpUiToolResultNotification,\n McpUiToolCancelledNotification,\n McpUiHostContextChangedNotification,\n} from \"@modelcontextprotocol/ext-apps\";\n"],"mappings":";;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAyCP,SAAS,oBAAoB,WAAoB,MAAc,SAAwB;AACrF,QAAM,MAAM,UAAU;AACtB,MAAI,CAAC,IAAK;AACV,QAAM,WAAW,IAAI,cAAc,KAAK;AACxC,WAAS,aAAa,0BAA0B,IAAI;AACpD,MAAI,YAAY,OAAW,UAAS,cAAc;AAClD,YAAU,YAAY;A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AAQ,SAAS;AAAA,IACvC;AAAA,EACF;AACF;","names":[]}
@@ -1,62 +0,0 @@
1
- import { McpUiAppCapabilities, McpUiDisplayMode, McpUiHostCapabilities, McpUiHostContext, McpUiHostContextChangedNotification, McpUiResourceCsp, App, RESOURCE_MIME_TYPE, McpUiResourceMeta, McpUiResourcePermissions, McpUiToolMeta, McpUiToolVisibility, McpUiToolInputNotification, McpUiToolResultNotification, McpUiToolCancelledNotification } from '@modelcontextprotocol/ext-apps';
2
-
3
- /**
4
- * Types — re-exported from `@modelcontextprotocol/ext-apps` so they stay in
5
- * lock-step with the official MCP Apps spec (SEP-1865, 2026-01-26).
6
- *
7
- * Only the mountly-specific glue types (props passed to a widget's mount(),
8
- * resource declaration written to the sidecar JSON) live here.
9
- */
10
-
11
- /** The MCP Apps view-side SDK instance. mountly-mcp surfaces this through React context. */
12
- type McpHost = App;
13
- type DisplayMode = McpUiDisplayMode;
14
- type AppCapabilities = McpUiAppCapabilities;
15
- type HostCapabilities = McpUiHostCapabilities;
16
- type HostContext = McpUiHostContext;
17
- type McpCsp = McpUiResourceCsp;
18
- type McpResourcePermissions = McpUiResourcePermissions;
19
- type McpResourceMeta = McpUiResourceMeta;
20
- type McpToolMeta = McpUiToolMeta;
21
- type McpToolVisibility = McpUiToolVisibility;
22
- type ToolInput = McpUiToolInputNotification["params"];
23
- type ToolResult = McpUiToolResultNotification["params"];
24
- type ToolCancelled = McpUiToolCancelledNotification["params"];
25
- type HostContextChanged = McpUiHostContextChangedNotification["params"];
26
- /**
27
- * Props passed to a `WidgetModule.mount(container, props)` call.
28
- *
29
- * The bridge surfaces the App handle plus the latest tool input/result and a
30
- * snapshot of host context. Widgets receive new props through `update()` as
31
- * notifications arrive — see `runBridge` in `bridge/index.ts`.
32
- */
33
- interface McpWidgetProps {
34
- /** The view-side ext-apps App; exposes the full spec-compliant API surface. */
35
- mcp: McpHost;
36
- /** Tool arguments (after `ui/notifications/tool-input`). */
37
- toolInput?: ToolInput;
38
- /** Tool result (after `ui/notifications/tool-result`). */
39
- toolResult?: ToolResult;
40
- /** Host context (theme, styles, displayMode, container dimensions, etc.). */
41
- hostContext?: HostContext;
42
- }
43
- /**
44
- * Resource metadata written to the `.meta.json` sidecar next to the emitted
45
- * HTML, consumed by `mountly-mcp-server` when registering the `ui://`
46
- * resource with `_meta.ui = {...}`.
47
- */
48
- interface McpResourceDeclaration {
49
- protocolVersion: string;
50
- uri: string;
51
- name: string;
52
- description?: string;
53
- mimeType: typeof RESOURCE_MIME_TYPE;
54
- /** Whether `runBridge` defers mount until the first tool-result arrives. */
55
- awaitToolResult: boolean;
56
- displayModes: ReadonlyArray<DisplayMode>;
57
- _meta: {
58
- ui: McpResourceMeta;
59
- };
60
- }
61
-
62
- export type { AppCapabilities as A, DisplayMode as D, HostCapabilities as H, McpCsp as M, ToolCancelled as T, HostContext as a, HostContextChanged as b, McpHost as c, McpResourceDeclaration as d, McpResourceMeta as e, McpResourcePermissions as f, McpToolMeta as g, McpToolVisibility as h, McpWidgetProps as i, ToolInput as j, ToolResult as k };