mountly-mcp 3.1.0 → 4.0.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.
- package/README.md +54 -29
- package/dist/bridge/iframe-entry.js +24 -16
- package/dist/bridge/index.d.ts +5 -5
- package/dist/bridge/index.js +2 -2
- package/dist/build/index.d.ts +3 -3
- package/dist/build/index.js +2 -2
- package/dist/{chunk-NLQDVNZP.js → chunk-AEVQKFXX.js} +12 -8
- package/dist/chunk-AEVQKFXX.js.map +1 -0
- package/dist/{chunk-SNWNF2XI.js → chunk-JVQZGKBL.js} +13 -13
- package/dist/chunk-JVQZGKBL.js.map +1 -0
- package/dist/chunk-KWVGW5Q7.js +582 -0
- package/dist/chunk-KWVGW5Q7.js.map +1 -0
- package/dist/{chunk-DQLQOMDM.js → chunk-M4WFJR3C.js} +2 -2
- package/dist/{chunk-DQLQOMDM.js.map → chunk-M4WFJR3C.js.map} +1 -1
- package/dist/{chunk-4WAKOYMK.js → chunk-MTJDRWGD.js} +2 -2
- package/dist/chunk-MTJDRWGD.js.map +1 -0
- package/dist/chunk-SADNMGP6.js +16 -0
- package/dist/chunk-SADNMGP6.js.map +1 -0
- package/dist/cli.js +21 -10
- package/dist/cli.js.map +1 -1
- package/dist/create.d.ts +10 -0
- package/dist/create.js +107 -0
- package/dist/create.js.map +1 -0
- package/dist/dev/host-entry.js +2 -2
- package/dist/dev/index.d.ts +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -2
- package/dist/json-render/{widget.d.ts → generative-view.d.ts} +9 -11
- package/dist/json-render/index.d.ts +1 -1
- package/dist/json-render/index.js +9 -8
- package/dist/json-render/index.js.map +1 -1
- package/dist/publish.d.ts +10 -0
- package/dist/react/context.d.ts +1 -1
- package/dist/react/create-view.d.ts +8 -0
- package/dist/react/hooks.d.ts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +6 -5
- package/dist/schema.d.ts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/svelte/index.d.ts +10 -16
- package/dist/svelte/index.js +7 -3
- package/dist/svelte/index.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/types.d.ts +14 -4
- package/dist/vite/index.d.ts +6 -6
- package/dist/vite/index.js +7 -7
- package/dist/vite/index.js.map +1 -1
- package/dist/vue/index.d.ts +12 -17
- package/dist/vue/index.js +10 -6
- package/dist/vue/index.js.map +1 -1
- package/package.json +7 -11
- package/templates/react/.gitignore.tmpl +4 -0
- package/templates/react/README.md.tmpl +15 -0
- package/templates/react/mcp.fixtures.json.tmpl +4 -0
- package/templates/react/package.json.tmpl +27 -0
- package/templates/react/server.mjs.tmpl +70 -0
- package/templates/react/src/view.tsx.tmpl +160 -0
- package/templates/react/tsconfig.json.tmpl +15 -0
- package/templates/react/vite.config.ts.tmpl +22 -0
- package/templates/svelte/.gitignore.tmpl +4 -0
- package/templates/svelte/README.md.tmpl +14 -0
- package/templates/svelte/mcp.fixtures.json.tmpl +4 -0
- package/templates/svelte/package.json.tmpl +26 -0
- package/templates/svelte/server.mjs.tmpl +70 -0
- package/templates/svelte/src/Dashboard.svelte.tmpl +158 -0
- package/templates/svelte/src/view.ts.tmpl +14 -0
- package/templates/svelte/tsconfig.json.tmpl +14 -0
- package/templates/svelte/vite.config.ts.tmpl +22 -0
- package/templates/vue/.gitignore.tmpl +4 -0
- package/templates/vue/README.md.tmpl +14 -0
- package/templates/vue/mcp.fixtures.json.tmpl +4 -0
- package/templates/vue/package.json.tmpl +26 -0
- package/templates/vue/server.mjs.tmpl +70 -0
- package/templates/vue/src/Dashboard.vue.tmpl +159 -0
- package/templates/vue/src/view.ts.tmpl +14 -0
- package/templates/vue/tsconfig.json.tmpl +15 -0
- package/templates/vue/vite.config.ts.tmpl +22 -0
- package/dist/chunk-4WAKOYMK.js.map +0 -1
- package/dist/chunk-KRAS266U.js +0 -260
- package/dist/chunk-KRAS266U.js.map +0 -1
- package/dist/chunk-NLQDVNZP.js.map +0 -1
- package/dist/chunk-SNWNF2XI.js.map +0 -1
- package/dist/react/create-widget.d.ts +0 -11
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
import {
|
|
2
|
+
escapeInlineScript,
|
|
3
|
+
serializeInlineScriptValue
|
|
4
|
+
} from "./chunk-YJA4H6IB.js";
|
|
5
|
+
|
|
6
|
+
// src/dev/index.ts
|
|
7
|
+
import { existsSync } from "fs";
|
|
8
|
+
import { readFile } from "fs/promises";
|
|
9
|
+
import { createServer } from "http";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
function escapeHtml(value) {
|
|
12
|
+
return value.replace(
|
|
13
|
+
/[&<>"']/g,
|
|
14
|
+
(character) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[character]
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
var runtimeCache = /* @__PURE__ */ new Map();
|
|
18
|
+
function loadRuntime(name) {
|
|
19
|
+
const cached = runtimeCache.get(name);
|
|
20
|
+
if (cached) return cached;
|
|
21
|
+
const loading = (async () => {
|
|
22
|
+
try {
|
|
23
|
+
return await readFile(
|
|
24
|
+
fileURLToPath(import.meta.resolve(`mountly-mcp/dev/${name}.js`)),
|
|
25
|
+
"utf8"
|
|
26
|
+
);
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
const entry = fileURLToPath(new URL(`./${name}.ts`, import.meta.url));
|
|
30
|
+
if (!existsSync(entry)) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`mountly-mcp dev: ${name} runtime missing. Expected the packaged 'mountly-mcp/dev/${name}.js' export, or ${entry} when running from source.`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const { build } = await import("vite");
|
|
36
|
+
const result = await build({
|
|
37
|
+
configFile: false,
|
|
38
|
+
logLevel: "silent",
|
|
39
|
+
build: {
|
|
40
|
+
write: false,
|
|
41
|
+
target: "es2022",
|
|
42
|
+
minify: false,
|
|
43
|
+
lib: { entry, formats: ["iife"], name: "__mountlyMcpDevRuntime" }
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const outputs = Array.isArray(result) ? result : [result];
|
|
47
|
+
const chunk = outputs.flatMap((output) => "output" in output ? output.output : []).find((item) => item.type === "chunk");
|
|
48
|
+
if (!chunk || chunk.type !== "chunk")
|
|
49
|
+
throw new Error(`mountly-mcp dev: failed to bundle ${name}`);
|
|
50
|
+
return chunk.code;
|
|
51
|
+
})();
|
|
52
|
+
runtimeCache.set(name, loading);
|
|
53
|
+
return loading;
|
|
54
|
+
}
|
|
55
|
+
function listenOnFreePort(server, port) {
|
|
56
|
+
return new Promise((resolvePort, reject) => {
|
|
57
|
+
const attempt = (candidate) => {
|
|
58
|
+
const onError = (error) => {
|
|
59
|
+
server.removeListener("listening", onListening);
|
|
60
|
+
if (error.code === "EADDRINUSE" && candidate < port + 50) attempt(candidate + 1);
|
|
61
|
+
else reject(error);
|
|
62
|
+
};
|
|
63
|
+
const onListening = () => {
|
|
64
|
+
server.removeListener("error", onError);
|
|
65
|
+
const address = server.address();
|
|
66
|
+
resolvePort(typeof address === "object" && address !== null ? address.port : candidate);
|
|
67
|
+
};
|
|
68
|
+
server.once("error", onError);
|
|
69
|
+
server.once("listening", onListening);
|
|
70
|
+
server.listen(candidate);
|
|
71
|
+
};
|
|
72
|
+
attempt(port);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async function startDevHost(options) {
|
|
76
|
+
const { htmlPath, fixtures = {}, toolInput = {}, callTool } = options;
|
|
77
|
+
const metaPath = `${htmlPath}.meta.json`;
|
|
78
|
+
const initialMeta = JSON.parse(await readFile(metaPath, "utf8"));
|
|
79
|
+
const toolName = options.toolName ?? initialMeta.name;
|
|
80
|
+
const [hostRuntime, sandboxRuntime] = await Promise.all([
|
|
81
|
+
loadRuntime("host-entry"),
|
|
82
|
+
loadRuntime("sandbox-entry")
|
|
83
|
+
]);
|
|
84
|
+
let version = 1;
|
|
85
|
+
let hostOrigin = "";
|
|
86
|
+
const sandboxServer = createServer((_req, res) => {
|
|
87
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" });
|
|
88
|
+
res.end(sandboxProxyShell(hostOrigin, sandboxRuntime));
|
|
89
|
+
});
|
|
90
|
+
const sandboxPort = await listenOnFreePort(
|
|
91
|
+
sandboxServer,
|
|
92
|
+
options.sandboxPort ?? (options.hostPort ?? 5179) + 1
|
|
93
|
+
);
|
|
94
|
+
const sandboxOrigin = `http://localhost:${sandboxPort}`;
|
|
95
|
+
const hostServer = createServer(async (req, res) => {
|
|
96
|
+
const path = new URL(req.url ?? "/", "http://localhost").pathname;
|
|
97
|
+
const send = (status, type, body) => {
|
|
98
|
+
res.writeHead(status, { "Content-Type": type, "Cache-Control": "no-store" });
|
|
99
|
+
res.end(body);
|
|
100
|
+
};
|
|
101
|
+
try {
|
|
102
|
+
if (path === "/call" && req.method === "POST") {
|
|
103
|
+
if (!callTool) return send(400, "text/plain", "no server connected");
|
|
104
|
+
const body = await new Promise((done, fail) => {
|
|
105
|
+
let raw = "";
|
|
106
|
+
req.on("data", (chunk) => raw += chunk);
|
|
107
|
+
req.on("end", () => done(raw));
|
|
108
|
+
req.on("error", fail);
|
|
109
|
+
});
|
|
110
|
+
const { name, arguments: args } = JSON.parse(body);
|
|
111
|
+
const result = await callTool(name, args).catch((error) => ({
|
|
112
|
+
isError: true,
|
|
113
|
+
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }]
|
|
114
|
+
}));
|
|
115
|
+
return send(200, "application/json", JSON.stringify(result));
|
|
116
|
+
}
|
|
117
|
+
if (path === "/") return send(200, "text/html; charset=utf-8", hostPage());
|
|
118
|
+
if (path === "/host.js") return send(200, "text/javascript; charset=utf-8", hostRuntime);
|
|
119
|
+
if (path === "/version") return send(200, "application/json", String(version));
|
|
120
|
+
if (path === "/view.html")
|
|
121
|
+
return send(200, "text/plain; charset=utf-8", await readFile(htmlPath, "utf8"));
|
|
122
|
+
if (path === "/view.meta.json")
|
|
123
|
+
return send(200, "application/json", await readFile(metaPath, "utf8"));
|
|
124
|
+
send(404, "text/plain", "not found");
|
|
125
|
+
} catch (error) {
|
|
126
|
+
send(500, "text/plain", error instanceof Error ? error.message : String(error));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
let hostPort;
|
|
130
|
+
try {
|
|
131
|
+
hostPort = await listenOnFreePort(hostServer, options.hostPort ?? 5179);
|
|
132
|
+
} catch (caught) {
|
|
133
|
+
await new Promise((done) => sandboxServer.close(() => done()));
|
|
134
|
+
throw caught;
|
|
135
|
+
}
|
|
136
|
+
hostOrigin = `http://localhost:${hostPort}`;
|
|
137
|
+
function hostPage() {
|
|
138
|
+
return devHostHtml({
|
|
139
|
+
toolName,
|
|
140
|
+
sandboxOrigin,
|
|
141
|
+
fixtures,
|
|
142
|
+
toolInput,
|
|
143
|
+
uri: initialMeta.uri,
|
|
144
|
+
hasServer: callTool !== void 0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
hostUrl: hostOrigin,
|
|
149
|
+
sandboxUrl: sandboxOrigin,
|
|
150
|
+
reload() {
|
|
151
|
+
version += 1;
|
|
152
|
+
},
|
|
153
|
+
async close() {
|
|
154
|
+
await Promise.all([
|
|
155
|
+
new Promise((done) => hostServer.close(() => done())),
|
|
156
|
+
new Promise((done) => sandboxServer.close(() => done()))
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function devHostHtml(options) {
|
|
162
|
+
const { toolName, sandboxOrigin, fixtures, toolInput, uri, hasServer } = options;
|
|
163
|
+
const buttons = Object.keys(fixtures).map(
|
|
164
|
+
(name, index) => `<button class="chip" type="button" data-fixture="${escapeHtml(name)}"${index === 0 ? ' data-active="true"' : ""}>${escapeHtml(name)}</button>`
|
|
165
|
+
).join("\n");
|
|
166
|
+
const firstFixture = Object.keys(fixtures)[0] ?? "sample";
|
|
167
|
+
return `<!doctype html>
|
|
168
|
+
<html lang="en">
|
|
169
|
+
<head>
|
|
170
|
+
<meta charset="utf-8">
|
|
171
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
172
|
+
<title>${escapeHtml(toolName)} \xB7 Mountly MCP</title>
|
|
173
|
+
<style>
|
|
174
|
+
:root {
|
|
175
|
+
color-scheme: light;
|
|
176
|
+
--bg: #f5f5f5;
|
|
177
|
+
--bg-chat: #efefef;
|
|
178
|
+
--fg: #171717;
|
|
179
|
+
--muted: #737373;
|
|
180
|
+
--accent: #0f766e;
|
|
181
|
+
--accent-soft: #ccfbf1;
|
|
182
|
+
--border: #e5e5e5;
|
|
183
|
+
--surface: #ffffff;
|
|
184
|
+
--user-bg: #171717;
|
|
185
|
+
--user-fg: #fafafa;
|
|
186
|
+
--assistant-fg: #171717;
|
|
187
|
+
--composer: #ffffff;
|
|
188
|
+
--shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 6%);
|
|
189
|
+
}
|
|
190
|
+
:root[data-theme="dark"] {
|
|
191
|
+
color-scheme: dark;
|
|
192
|
+
--bg: #0a0a0a;
|
|
193
|
+
--bg-chat: #111111;
|
|
194
|
+
--fg: #f5f5f5;
|
|
195
|
+
--muted: #a3a3a3;
|
|
196
|
+
--accent: #2dd4bf;
|
|
197
|
+
--accent-soft: #134e4a;
|
|
198
|
+
--border: #262626;
|
|
199
|
+
--surface: #171717;
|
|
200
|
+
--user-bg: #e5e5e5;
|
|
201
|
+
--user-fg: #0a0a0a;
|
|
202
|
+
--assistant-fg: #f5f5f5;
|
|
203
|
+
--composer: #171717;
|
|
204
|
+
--shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 12px 32px rgb(0 0 0 / 35%);
|
|
205
|
+
}
|
|
206
|
+
* { box-sizing: border-box; }
|
|
207
|
+
html, body { height: 100%; }
|
|
208
|
+
body {
|
|
209
|
+
margin: 0;
|
|
210
|
+
background: var(--bg);
|
|
211
|
+
color: var(--fg);
|
|
212
|
+
font: 15px/1.5 "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
|
|
213
|
+
}
|
|
214
|
+
.app {
|
|
215
|
+
display: grid;
|
|
216
|
+
grid-template-rows: auto 1fr auto;
|
|
217
|
+
min-height: 100%;
|
|
218
|
+
max-width: 880px;
|
|
219
|
+
margin: 0 auto;
|
|
220
|
+
}
|
|
221
|
+
.topbar {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: 12px;
|
|
225
|
+
padding: 12px 18px;
|
|
226
|
+
border-bottom: 1px solid var(--border);
|
|
227
|
+
background: color-mix(in srgb, var(--surface) 92%, transparent);
|
|
228
|
+
backdrop-filter: blur(10px);
|
|
229
|
+
position: sticky;
|
|
230
|
+
top: 0;
|
|
231
|
+
z-index: 3;
|
|
232
|
+
}
|
|
233
|
+
.model {
|
|
234
|
+
display: inline-flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
gap: 8px;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
}
|
|
239
|
+
.avatar {
|
|
240
|
+
width: 28px;
|
|
241
|
+
height: 28px;
|
|
242
|
+
border-radius: 8px;
|
|
243
|
+
background:
|
|
244
|
+
linear-gradient(135deg, var(--accent-soft), transparent 60%),
|
|
245
|
+
var(--surface);
|
|
246
|
+
border: 1px solid var(--border);
|
|
247
|
+
flex: 0 0 auto;
|
|
248
|
+
}
|
|
249
|
+
.model h1 {
|
|
250
|
+
margin: 0;
|
|
251
|
+
font-size: 14px;
|
|
252
|
+
font-weight: 600;
|
|
253
|
+
letter-spacing: -0.01em;
|
|
254
|
+
white-space: nowrap;
|
|
255
|
+
overflow: hidden;
|
|
256
|
+
text-overflow: ellipsis;
|
|
257
|
+
}
|
|
258
|
+
.model .sub {
|
|
259
|
+
color: var(--muted);
|
|
260
|
+
font-size: 12px;
|
|
261
|
+
white-space: nowrap;
|
|
262
|
+
overflow: hidden;
|
|
263
|
+
text-overflow: ellipsis;
|
|
264
|
+
}
|
|
265
|
+
.spacer { flex: 1; }
|
|
266
|
+
.icon-btn {
|
|
267
|
+
appearance: none;
|
|
268
|
+
border: 1px solid var(--border);
|
|
269
|
+
background: var(--surface);
|
|
270
|
+
color: var(--fg);
|
|
271
|
+
width: 34px;
|
|
272
|
+
height: 34px;
|
|
273
|
+
border-radius: 10px;
|
|
274
|
+
font: inherit;
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
}
|
|
277
|
+
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
|
|
278
|
+
.chat {
|
|
279
|
+
background:
|
|
280
|
+
radial-gradient(900px 420px at 50% -8%, var(--accent-soft), transparent 55%),
|
|
281
|
+
var(--bg-chat);
|
|
282
|
+
padding: 28px 18px 18px;
|
|
283
|
+
display: flex;
|
|
284
|
+
flex-direction: column;
|
|
285
|
+
gap: 22px;
|
|
286
|
+
overflow: auto;
|
|
287
|
+
}
|
|
288
|
+
.turn {
|
|
289
|
+
display: grid;
|
|
290
|
+
grid-template-columns: 32px 1fr;
|
|
291
|
+
gap: 12px;
|
|
292
|
+
align-items: start;
|
|
293
|
+
max-width: 720px;
|
|
294
|
+
width: 100%;
|
|
295
|
+
}
|
|
296
|
+
.turn.user {
|
|
297
|
+
margin-left: auto;
|
|
298
|
+
grid-template-columns: 1fr 32px;
|
|
299
|
+
}
|
|
300
|
+
.turn.user .who { order: 2; }
|
|
301
|
+
.turn.user .body { order: 1; text-align: right; }
|
|
302
|
+
.who {
|
|
303
|
+
width: 32px;
|
|
304
|
+
height: 32px;
|
|
305
|
+
border-radius: 999px;
|
|
306
|
+
display: grid;
|
|
307
|
+
place-items: center;
|
|
308
|
+
font-size: 11px;
|
|
309
|
+
font-weight: 700;
|
|
310
|
+
letter-spacing: 0.04em;
|
|
311
|
+
border: 1px solid var(--border);
|
|
312
|
+
background: var(--surface);
|
|
313
|
+
color: var(--muted);
|
|
314
|
+
}
|
|
315
|
+
.turn.user .who {
|
|
316
|
+
background: var(--user-bg);
|
|
317
|
+
color: var(--user-fg);
|
|
318
|
+
border-color: transparent;
|
|
319
|
+
}
|
|
320
|
+
.bubble {
|
|
321
|
+
display: inline-block;
|
|
322
|
+
text-align: left;
|
|
323
|
+
background: var(--surface);
|
|
324
|
+
border: 1px solid var(--border);
|
|
325
|
+
border-radius: 18px;
|
|
326
|
+
padding: 12px 14px;
|
|
327
|
+
box-shadow: var(--shadow);
|
|
328
|
+
color: var(--assistant-fg);
|
|
329
|
+
}
|
|
330
|
+
.turn.user .bubble {
|
|
331
|
+
background: var(--user-bg);
|
|
332
|
+
color: var(--user-fg);
|
|
333
|
+
border-color: transparent;
|
|
334
|
+
}
|
|
335
|
+
.bubble p { margin: 0; }
|
|
336
|
+
.artifact {
|
|
337
|
+
margin-top: 10px;
|
|
338
|
+
border: 1px solid var(--border);
|
|
339
|
+
border-radius: 16px;
|
|
340
|
+
overflow: hidden;
|
|
341
|
+
background: var(--surface);
|
|
342
|
+
box-shadow: var(--shadow);
|
|
343
|
+
text-align: left;
|
|
344
|
+
}
|
|
345
|
+
.artifact-bar {
|
|
346
|
+
display: flex;
|
|
347
|
+
align-items: center;
|
|
348
|
+
gap: 8px;
|
|
349
|
+
padding: 10px 12px;
|
|
350
|
+
border-bottom: 1px solid var(--border);
|
|
351
|
+
background: color-mix(in srgb, var(--bg-chat) 55%, var(--surface));
|
|
352
|
+
color: var(--muted);
|
|
353
|
+
font-size: 12px;
|
|
354
|
+
}
|
|
355
|
+
.artifact-bar .dot {
|
|
356
|
+
width: 7px;
|
|
357
|
+
height: 7px;
|
|
358
|
+
border-radius: 50%;
|
|
359
|
+
background: var(--accent);
|
|
360
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
|
|
361
|
+
}
|
|
362
|
+
iframe {
|
|
363
|
+
display: block;
|
|
364
|
+
width: 100%;
|
|
365
|
+
height: 420px;
|
|
366
|
+
border: 0;
|
|
367
|
+
background: #fff;
|
|
368
|
+
}
|
|
369
|
+
.composer {
|
|
370
|
+
border-top: 1px solid var(--border);
|
|
371
|
+
background: color-mix(in srgb, var(--composer) 94%, transparent);
|
|
372
|
+
backdrop-filter: blur(10px);
|
|
373
|
+
padding: 12px 18px 16px;
|
|
374
|
+
position: sticky;
|
|
375
|
+
bottom: 0;
|
|
376
|
+
}
|
|
377
|
+
.composer-box {
|
|
378
|
+
border: 1px solid var(--border);
|
|
379
|
+
background: var(--surface);
|
|
380
|
+
border-radius: 18px;
|
|
381
|
+
padding: 10px 12px 12px;
|
|
382
|
+
box-shadow: var(--shadow);
|
|
383
|
+
}
|
|
384
|
+
.composer-hint {
|
|
385
|
+
color: var(--muted);
|
|
386
|
+
font-size: 13px;
|
|
387
|
+
margin: 0 0 10px;
|
|
388
|
+
}
|
|
389
|
+
.samples {
|
|
390
|
+
display: flex;
|
|
391
|
+
flex-wrap: wrap;
|
|
392
|
+
gap: 8px;
|
|
393
|
+
align-items: center;
|
|
394
|
+
}
|
|
395
|
+
.samples .label {
|
|
396
|
+
color: var(--muted);
|
|
397
|
+
font-size: 12px;
|
|
398
|
+
margin-right: 2px;
|
|
399
|
+
}
|
|
400
|
+
#fixtures { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
|
|
401
|
+
.chip {
|
|
402
|
+
appearance: none;
|
|
403
|
+
border: 1px solid var(--border);
|
|
404
|
+
background: color-mix(in srgb, var(--bg-chat) 40%, var(--surface));
|
|
405
|
+
color: var(--fg);
|
|
406
|
+
padding: 7px 12px;
|
|
407
|
+
border-radius: 999px;
|
|
408
|
+
font: inherit;
|
|
409
|
+
font-size: 13px;
|
|
410
|
+
cursor: pointer;
|
|
411
|
+
}
|
|
412
|
+
.chip:hover { border-color: var(--accent); color: var(--accent); }
|
|
413
|
+
.chip[data-active="true"] {
|
|
414
|
+
background: var(--accent);
|
|
415
|
+
color: #fff;
|
|
416
|
+
border-color: var(--accent);
|
|
417
|
+
}
|
|
418
|
+
:root[data-theme="dark"] .chip[data-active="true"] { color: #042f2e; }
|
|
419
|
+
details.debug {
|
|
420
|
+
margin-top: 10px;
|
|
421
|
+
border: 1px dashed var(--border);
|
|
422
|
+
border-radius: 14px;
|
|
423
|
+
background: transparent;
|
|
424
|
+
overflow: hidden;
|
|
425
|
+
}
|
|
426
|
+
details.debug > summary {
|
|
427
|
+
cursor: pointer;
|
|
428
|
+
list-style: none;
|
|
429
|
+
padding: 10px 12px;
|
|
430
|
+
font-size: 11px;
|
|
431
|
+
font-weight: 600;
|
|
432
|
+
letter-spacing: 0.08em;
|
|
433
|
+
text-transform: uppercase;
|
|
434
|
+
color: var(--muted);
|
|
435
|
+
}
|
|
436
|
+
details.debug > summary::-webkit-details-marker { display: none; }
|
|
437
|
+
.debug-body {
|
|
438
|
+
display: grid;
|
|
439
|
+
grid-template-columns: 1fr 1fr;
|
|
440
|
+
gap: 0;
|
|
441
|
+
border-top: 1px solid var(--border);
|
|
442
|
+
}
|
|
443
|
+
.panel { padding: 12px; min-width: 0; }
|
|
444
|
+
.panel + .panel { border-left: 1px solid var(--border); }
|
|
445
|
+
.panel h2 {
|
|
446
|
+
margin: 0 0 8px;
|
|
447
|
+
font-size: 11px;
|
|
448
|
+
text-transform: uppercase;
|
|
449
|
+
letter-spacing: 0.08em;
|
|
450
|
+
color: var(--muted);
|
|
451
|
+
}
|
|
452
|
+
pre {
|
|
453
|
+
margin: 0;
|
|
454
|
+
padding: 10px;
|
|
455
|
+
border-radius: 8px;
|
|
456
|
+
background: color-mix(in srgb, var(--bg-chat) 80%, transparent);
|
|
457
|
+
font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;
|
|
458
|
+
overflow: auto;
|
|
459
|
+
max-height: 180px;
|
|
460
|
+
}
|
|
461
|
+
.log {
|
|
462
|
+
font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;
|
|
463
|
+
color: var(--muted);
|
|
464
|
+
white-space: pre-wrap;
|
|
465
|
+
max-height: 180px;
|
|
466
|
+
overflow: auto;
|
|
467
|
+
}
|
|
468
|
+
@media (max-width: 720px) {
|
|
469
|
+
.debug-body { grid-template-columns: 1fr; }
|
|
470
|
+
.panel + .panel { border-left: 0; border-top: 1px solid var(--border); }
|
|
471
|
+
.turn, .turn.user { grid-template-columns: 28px 1fr; }
|
|
472
|
+
.turn.user .who { order: 0; }
|
|
473
|
+
.turn.user .body { order: 0; text-align: left; }
|
|
474
|
+
}
|
|
475
|
+
</style>
|
|
476
|
+
</head>
|
|
477
|
+
<body>
|
|
478
|
+
<div class="app">
|
|
479
|
+
<header class="topbar">
|
|
480
|
+
<div class="model">
|
|
481
|
+
<div class="avatar" aria-hidden="true"></div>
|
|
482
|
+
<div>
|
|
483
|
+
<h1>Mountly \xB7 ${escapeHtml(toolName)}</h1>
|
|
484
|
+
<div class="sub">${escapeHtml(uri)}</div>
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
<span class="spacer"></span>
|
|
488
|
+
<button class="icon-btn" id="theme" type="button" title="Toggle theme" aria-label="Toggle theme">\u25D0</button>
|
|
489
|
+
<button class="icon-btn" id="teardown" type="button" title="Teardown" aria-label="Teardown">\xD7</button>
|
|
490
|
+
</header>
|
|
491
|
+
|
|
492
|
+
<main class="chat">
|
|
493
|
+
<div class="turn user">
|
|
494
|
+
<div class="who" aria-hidden="true">You</div>
|
|
495
|
+
<div class="body">
|
|
496
|
+
<div class="bubble">
|
|
497
|
+
<p>Call <strong>${escapeHtml(toolName)}</strong> with sample \u201C${escapeHtml(firstFixture)}\u201D.</p>
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
<div class="turn assistant">
|
|
503
|
+
<div class="who" aria-hidden="true">AI</div>
|
|
504
|
+
<div class="body">
|
|
505
|
+
<div class="bubble">
|
|
506
|
+
<p>Here\u2019s the interactive result from that tool.</p>
|
|
507
|
+
<div class="artifact">
|
|
508
|
+
<div class="artifact-bar"><span class="dot" aria-hidden="true"></span> MCP App \xB7 inline</div>
|
|
509
|
+
<iframe id="sandbox" sandbox="allow-scripts allow-same-origin" title="mountly-mcp sandbox proxy"></iframe>
|
|
510
|
+
</div>
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
</div>
|
|
514
|
+
</main>
|
|
515
|
+
|
|
516
|
+
<footer class="composer">
|
|
517
|
+
<div class="composer-box">
|
|
518
|
+
<p class="composer-hint">Ask another sample \u2014 same as switching fixtures in a real host.</p>
|
|
519
|
+
<div class="samples">
|
|
520
|
+
<span class="label">Samples</span>
|
|
521
|
+
<div id="fixtures">${buttons || '<span class="label">No fixtures \u2014 add mcp.fixtures.json</span>'}</div>
|
|
522
|
+
</div>
|
|
523
|
+
<details class="debug">
|
|
524
|
+
<summary>Protocol debug</summary>
|
|
525
|
+
<div class="debug-body">
|
|
526
|
+
<section class="panel">
|
|
527
|
+
<h2>Last structuredContent</h2>
|
|
528
|
+
<pre id="payload">(none yet)</pre>
|
|
529
|
+
</section>
|
|
530
|
+
<section class="panel">
|
|
531
|
+
<h2>Channel log</h2>
|
|
532
|
+
<div class="log" id="log"></div>
|
|
533
|
+
</section>
|
|
534
|
+
</div>
|
|
535
|
+
</details>
|
|
536
|
+
</div>
|
|
537
|
+
</footer>
|
|
538
|
+
</div>
|
|
539
|
+
<script>
|
|
540
|
+
globalThis.__mountlyMcpDevHost__ = ${serializeInlineScriptValue({
|
|
541
|
+
toolName,
|
|
542
|
+
sandboxOrigin,
|
|
543
|
+
fixtures,
|
|
544
|
+
toolInput,
|
|
545
|
+
uri,
|
|
546
|
+
hasServer,
|
|
547
|
+
sandboxPath: "/sandbox-proxy.html"
|
|
548
|
+
})};
|
|
549
|
+
const HAS_SERVER = ${hasServer ? "true" : "false"};
|
|
550
|
+
</script>
|
|
551
|
+
<script src="/host.js"></script>
|
|
552
|
+
</body>
|
|
553
|
+
</html>
|
|
554
|
+
`;
|
|
555
|
+
}
|
|
556
|
+
function sandboxProxyShell(hostOrigin, runtime) {
|
|
557
|
+
return `<!doctype html>
|
|
558
|
+
<html lang="en">
|
|
559
|
+
<head>
|
|
560
|
+
<meta charset="utf-8">
|
|
561
|
+
<title>mountly-mcp sandbox proxy</title>
|
|
562
|
+
<style>
|
|
563
|
+
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
|
|
564
|
+
#inner { width: 100%; height: 100%; border: 0; background: white; }
|
|
565
|
+
</style>
|
|
566
|
+
</head>
|
|
567
|
+
<body>
|
|
568
|
+
<script>globalThis.__mountlyMcpSandbox__ = ${serializeInlineScriptValue({ hostOrigin })};</script>
|
|
569
|
+
<script>${escapeInlineScript(runtime)}</script>
|
|
570
|
+
</body>
|
|
571
|
+
</html>
|
|
572
|
+
`;
|
|
573
|
+
}
|
|
574
|
+
async function sandboxProxyHtml(hostOrigin) {
|
|
575
|
+
return sandboxProxyShell(hostOrigin, await loadRuntime("sandbox-entry"));
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export {
|
|
579
|
+
startDevHost,
|
|
580
|
+
sandboxProxyHtml
|
|
581
|
+
};
|
|
582
|
+
//# sourceMappingURL=chunk-KWVGW5Q7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dev/index.ts"],"sourcesContent":["/**\n * A local MCP Apps host, so a View can be developed without installing a\n * real host and restarting it on every change.\n *\n * It is a genuine host, not a preview shim: two origins as the spec requires\n * (§8.4), a sandbox proxy that injects the sidecar's CSP and permissions, the\n * full `ui/initialize` handshake, and tool-input/tool-result delivery. A View\n * that works here works in Claude, and one that reaches for `eval` fails here\n * for the same reason it would fail there.\n *\n * ```ts\n * const host = await startDevHost({ htmlPath: \"dist/view.html\", fixtures });\n * console.log(host.hostUrl);\n * ```\n */\nimport { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { createServer, type Server } from \"node:http\";\nimport { fileURLToPath } from \"node:url\";\nimport type { McpResourceDeclaration } from \"../types.js\";\nimport { escapeInlineScript, serializeInlineScriptValue } from \"../html.js\";\n\nexport interface DevHostOptions {\n /** Built View HTML. Its `.meta.json` sidecar is read alongside. */\n htmlPath: string;\n /**\n * Named samples, each becoming a button in the host chrome.\n *\n * Without `callTool` the value is delivered straight through as\n * `structuredContent`. With `callTool` it is the tool's *arguments*, and\n * what the view receives is whatever the real tool returns.\n */\n fixtures?: Record<string, unknown>;\n /**\n * Run a real tool. Supplied when the developer points `dev` at their server,\n * and used both for the fixture buttons and for `tools/call` requests the\n * view makes itself — so app-only tools behave as they will in production.\n */\n callTool?: (name: string, args: unknown) => Promise<unknown>;\n /** Arguments delivered as `ui/notifications/tool-input`. */\n toolInput?: Record<string, unknown>;\n /** Shown in the host chrome. Defaults to the sidecar's resource name. */\n toolName?: string;\n /** Defaults to 5179, incrementing until a free port is found. */\n hostPort?: number;\n /** Defaults to `hostPort + 1`, incrementing until a free port is found. */\n sandboxPort?: number;\n}\n\nexport interface DevHost {\n hostUrl: string;\n sandboxUrl: string;\n /** Tell connected browsers to reload — call after a rebuild. */\n reload(): void;\n close(): Promise<void>;\n}\n\nfunction escapeHtml(value: string): string {\n return value.replace(\n /[&<>\"']/g,\n (character) =>\n ({ \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\" })[character]!,\n );\n}\n\nconst runtimeCache = new Map<string, Promise<string>>();\n\n/**\n * Load one of the browser-side runtimes (`host-entry`, `sandbox-entry`) as a\n * string to inline into a page.\n *\n * Installed, the built IIFE is a declared package export, so ask the module\n * resolver for it. Walking from `import.meta.url` breaks the moment a bundler\n * hoists this module into a shared chunk at a different depth — which is what\n * tsup does, leaving it looking in dist/ while the file sits in dist/dev/.\n */\nfunction loadRuntime(name: \"host-entry\" | \"sandbox-entry\"): Promise<string> {\n const cached = runtimeCache.get(name);\n if (cached) return cached;\n const loading = (async () => {\n try {\n return await readFile(\n fileURLToPath(import.meta.resolve(`mountly-mcp/dev/${name}.js`)),\n \"utf8\",\n );\n } catch {\n // Running from source in this repo, where nothing is built yet.\n }\n const entry = fileURLToPath(new URL(`./${name}.ts`, import.meta.url));\n if (!existsSync(entry)) {\n throw new Error(\n `mountly-mcp dev: ${name} runtime missing. Expected the packaged 'mountly-mcp/dev/${name}.js' export, or ${entry} when running from source.`,\n );\n }\n const { build } = await import(\"vite\");\n const result = await build({\n configFile: false,\n logLevel: \"silent\",\n build: {\n write: false,\n target: \"es2022\",\n minify: false,\n lib: { entry, formats: [\"iife\"], name: \"__mountlyMcpDevRuntime\" },\n },\n });\n const outputs = Array.isArray(result) ? result : [result];\n const chunk = outputs\n .flatMap((output) => (\"output\" in output ? output.output : []))\n .find((item) => item.type === \"chunk\");\n if (!chunk || chunk.type !== \"chunk\")\n throw new Error(`mountly-mcp dev: failed to bundle ${name}`);\n return chunk.code;\n })();\n runtimeCache.set(name, loading);\n return loading;\n}\n\nfunction listenOnFreePort(server: Server, port: number): Promise<number> {\n return new Promise((resolvePort, reject) => {\n const attempt = (candidate: number): void => {\n // Listeners are paired and torn down together: `listen()`'s callback form\n // leaves a stale one attached across retries, which then resolves with\n // the port that was already taken.\n const onError = (error: NodeJS.ErrnoException): void => {\n server.removeListener(\"listening\", onListening);\n // ponytail: linear probe, fine for a dev tool on a developer's laptop.\n if (error.code === \"EADDRINUSE\" && candidate < port + 50) attempt(candidate + 1);\n else reject(error);\n };\n const onListening = (): void => {\n server.removeListener(\"error\", onError);\n const address = server.address();\n resolvePort(typeof address === \"object\" && address !== null ? address.port : candidate);\n };\n server.once(\"error\", onError);\n server.once(\"listening\", onListening);\n server.listen(candidate);\n };\n attempt(port);\n });\n}\n\nexport async function startDevHost(options: DevHostOptions): Promise<DevHost> {\n const { htmlPath, fixtures = {}, toolInput = {}, callTool } = options;\n\n const metaPath = `${htmlPath}.meta.json`;\n const initialMeta = JSON.parse(await readFile(metaPath, \"utf8\")) as McpResourceDeclaration;\n const toolName = options.toolName ?? initialMeta.name;\n const [hostRuntime, sandboxRuntime] = await Promise.all([\n loadRuntime(\"host-entry\"),\n loadRuntime(\"sandbox-entry\"),\n ]);\n\n // Bumped on reload(); the browser polls it and reloads when it changes. The\n // View HTML is read per request rather than baked into the page, so a\n // rebuild is picked up with no server restart.\n let version = 1;\n\n // The two servers reference each other's origin, and each only needs the\n // other's once a request arrives — so the sandbox reads this after the host\n // has bound its port.\n let hostOrigin = \"\";\n\n const sandboxServer = createServer((_req, res) => {\n res.writeHead(200, { \"Content-Type\": \"text/html; charset=utf-8\", \"Cache-Control\": \"no-store\" });\n res.end(sandboxProxyShell(hostOrigin, sandboxRuntime));\n });\n const sandboxPort = await listenOnFreePort(\n sandboxServer,\n options.sandboxPort ?? (options.hostPort ?? 5179) + 1,\n );\n const sandboxOrigin = `http://localhost:${sandboxPort}`;\n\n const hostServer = createServer(async (req, res) => {\n const path = new URL(req.url ?? \"/\", \"http://localhost\").pathname;\n const send = (status: number, type: string, body: string | Buffer): void => {\n res.writeHead(status, { \"Content-Type\": type, \"Cache-Control\": \"no-store\" });\n res.end(body);\n };\n try {\n if (path === \"/call\" && req.method === \"POST\") {\n if (!callTool) return send(400, \"text/plain\", \"no server connected\");\n const body = await new Promise<string>((done, fail) => {\n let raw = \"\";\n req.on(\"data\", (chunk) => (raw += chunk));\n req.on(\"end\", () => done(raw));\n req.on(\"error\", fail);\n });\n const { name, arguments: args } = JSON.parse(body) as { name: string; arguments?: unknown };\n // Tool failures are the view's problem to render, not the dev server's\n // to crash on, so they come back as a normal result.\n const result = await callTool(name, args).catch((error: unknown) => ({\n isError: true,\n content: [{ type: \"text\", text: error instanceof Error ? error.message : String(error) }],\n }));\n return send(200, \"application/json\", JSON.stringify(result));\n }\n if (path === \"/\") return send(200, \"text/html; charset=utf-8\", hostPage());\n if (path === \"/host.js\") return send(200, \"text/javascript; charset=utf-8\", hostRuntime);\n if (path === \"/version\") return send(200, \"application/json\", String(version));\n if (path === \"/view.html\")\n return send(200, \"text/plain; charset=utf-8\", await readFile(htmlPath, \"utf8\"));\n if (path === \"/view.meta.json\")\n return send(200, \"application/json\", await readFile(metaPath, \"utf8\"));\n send(404, \"text/plain\", \"not found\");\n } catch (error) {\n // A rebuild in flight can briefly leave the file missing; say so rather\n // than crashing the dev server.\n send(500, \"text/plain\", error instanceof Error ? error.message : String(error));\n }\n });\n let hostPort: number;\n try {\n hostPort = await listenOnFreePort(hostServer, options.hostPort ?? 5179);\n } catch (caught) {\n await new Promise<void>((done) => sandboxServer.close(() => done()));\n throw caught;\n }\n hostOrigin = `http://localhost:${hostPort}`;\n\n function hostPage(): string {\n return devHostHtml({\n toolName,\n sandboxOrigin,\n fixtures,\n toolInput,\n uri: initialMeta.uri,\n hasServer: callTool !== undefined,\n });\n }\n\n return {\n hostUrl: hostOrigin,\n sandboxUrl: sandboxOrigin,\n reload() {\n version += 1;\n },\n async close() {\n await Promise.all([\n new Promise<void>((done) => hostServer.close(() => done())),\n new Promise<void>((done) => sandboxServer.close(() => done())),\n ]);\n },\n };\n}\n\ninterface HostPageOptions {\n toolName: string;\n sandboxOrigin: string;\n fixtures: Record<string, unknown>;\n toolInput: Record<string, unknown>;\n uri: string;\n hasServer: boolean;\n}\n\nfunction devHostHtml(options: HostPageOptions): string {\n const { toolName, sandboxOrigin, fixtures, toolInput, uri, hasServer } = options;\n const buttons = Object.keys(fixtures)\n .map(\n (name, index) =>\n `<button class=\"chip\" type=\"button\" data-fixture=\"${escapeHtml(name)}\"${index === 0 ? ' data-active=\"true\"' : \"\"}>${escapeHtml(name)}</button>`,\n )\n .join(\"\\n\");\n const firstFixture = Object.keys(fixtures)[0] ?? \"sample\";\n\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n<title>${escapeHtml(toolName)} · Mountly MCP</title>\n<style>\n :root {\n color-scheme: light;\n --bg: #f5f5f5;\n --bg-chat: #efefef;\n --fg: #171717;\n --muted: #737373;\n --accent: #0f766e;\n --accent-soft: #ccfbf1;\n --border: #e5e5e5;\n --surface: #ffffff;\n --user-bg: #171717;\n --user-fg: #fafafa;\n --assistant-fg: #171717;\n --composer: #ffffff;\n --shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 6%);\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --bg: #0a0a0a;\n --bg-chat: #111111;\n --fg: #f5f5f5;\n --muted: #a3a3a3;\n --accent: #2dd4bf;\n --accent-soft: #134e4a;\n --border: #262626;\n --surface: #171717;\n --user-bg: #e5e5e5;\n --user-fg: #0a0a0a;\n --assistant-fg: #f5f5f5;\n --composer: #171717;\n --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 12px 32px rgb(0 0 0 / 35%);\n }\n * { box-sizing: border-box; }\n html, body { height: 100%; }\n body {\n margin: 0;\n background: var(--bg);\n color: var(--fg);\n font: 15px/1.5 \"Segoe UI\", \"Helvetica Neue\", system-ui, sans-serif;\n }\n .app {\n display: grid;\n grid-template-rows: auto 1fr auto;\n min-height: 100%;\n max-width: 880px;\n margin: 0 auto;\n }\n .topbar {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 18px;\n border-bottom: 1px solid var(--border);\n background: color-mix(in srgb, var(--surface) 92%, transparent);\n backdrop-filter: blur(10px);\n position: sticky;\n top: 0;\n z-index: 3;\n }\n .model {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n }\n .avatar {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background:\n linear-gradient(135deg, var(--accent-soft), transparent 60%),\n var(--surface);\n border: 1px solid var(--border);\n flex: 0 0 auto;\n }\n .model h1 {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: -0.01em;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .model .sub {\n color: var(--muted);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .spacer { flex: 1; }\n .icon-btn {\n appearance: none;\n border: 1px solid var(--border);\n background: var(--surface);\n color: var(--fg);\n width: 34px;\n height: 34px;\n border-radius: 10px;\n font: inherit;\n cursor: pointer;\n }\n .icon-btn:hover { border-color: var(--accent); color: var(--accent); }\n .chat {\n background:\n radial-gradient(900px 420px at 50% -8%, var(--accent-soft), transparent 55%),\n var(--bg-chat);\n padding: 28px 18px 18px;\n display: flex;\n flex-direction: column;\n gap: 22px;\n overflow: auto;\n }\n .turn {\n display: grid;\n grid-template-columns: 32px 1fr;\n gap: 12px;\n align-items: start;\n max-width: 720px;\n width: 100%;\n }\n .turn.user {\n margin-left: auto;\n grid-template-columns: 1fr 32px;\n }\n .turn.user .who { order: 2; }\n .turn.user .body { order: 1; text-align: right; }\n .who {\n width: 32px;\n height: 32px;\n border-radius: 999px;\n display: grid;\n place-items: center;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.04em;\n border: 1px solid var(--border);\n background: var(--surface);\n color: var(--muted);\n }\n .turn.user .who {\n background: var(--user-bg);\n color: var(--user-fg);\n border-color: transparent;\n }\n .bubble {\n display: inline-block;\n text-align: left;\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 18px;\n padding: 12px 14px;\n box-shadow: var(--shadow);\n color: var(--assistant-fg);\n }\n .turn.user .bubble {\n background: var(--user-bg);\n color: var(--user-fg);\n border-color: transparent;\n }\n .bubble p { margin: 0; }\n .artifact {\n margin-top: 10px;\n border: 1px solid var(--border);\n border-radius: 16px;\n overflow: hidden;\n background: var(--surface);\n box-shadow: var(--shadow);\n text-align: left;\n }\n .artifact-bar {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--border);\n background: color-mix(in srgb, var(--bg-chat) 55%, var(--surface));\n color: var(--muted);\n font-size: 12px;\n }\n .artifact-bar .dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--accent);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);\n }\n iframe {\n display: block;\n width: 100%;\n height: 420px;\n border: 0;\n background: #fff;\n }\n .composer {\n border-top: 1px solid var(--border);\n background: color-mix(in srgb, var(--composer) 94%, transparent);\n backdrop-filter: blur(10px);\n padding: 12px 18px 16px;\n position: sticky;\n bottom: 0;\n }\n .composer-box {\n border: 1px solid var(--border);\n background: var(--surface);\n border-radius: 18px;\n padding: 10px 12px 12px;\n box-shadow: var(--shadow);\n }\n .composer-hint {\n color: var(--muted);\n font-size: 13px;\n margin: 0 0 10px;\n }\n .samples {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n align-items: center;\n }\n .samples .label {\n color: var(--muted);\n font-size: 12px;\n margin-right: 2px;\n }\n #fixtures { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }\n .chip {\n appearance: none;\n border: 1px solid var(--border);\n background: color-mix(in srgb, var(--bg-chat) 40%, var(--surface));\n color: var(--fg);\n padding: 7px 12px;\n border-radius: 999px;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n }\n .chip:hover { border-color: var(--accent); color: var(--accent); }\n .chip[data-active=\"true\"] {\n background: var(--accent);\n color: #fff;\n border-color: var(--accent);\n }\n :root[data-theme=\"dark\"] .chip[data-active=\"true\"] { color: #042f2e; }\n details.debug {\n margin-top: 10px;\n border: 1px dashed var(--border);\n border-radius: 14px;\n background: transparent;\n overflow: hidden;\n }\n details.debug > summary {\n cursor: pointer;\n list-style: none;\n padding: 10px 12px;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--muted);\n }\n details.debug > summary::-webkit-details-marker { display: none; }\n .debug-body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0;\n border-top: 1px solid var(--border);\n }\n .panel { padding: 12px; min-width: 0; }\n .panel + .panel { border-left: 1px solid var(--border); }\n .panel h2 {\n margin: 0 0 8px;\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--muted);\n }\n pre {\n margin: 0;\n padding: 10px;\n border-radius: 8px;\n background: color-mix(in srgb, var(--bg-chat) 80%, transparent);\n font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;\n overflow: auto;\n max-height: 180px;\n }\n .log {\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--muted);\n white-space: pre-wrap;\n max-height: 180px;\n overflow: auto;\n }\n @media (max-width: 720px) {\n .debug-body { grid-template-columns: 1fr; }\n .panel + .panel { border-left: 0; border-top: 1px solid var(--border); }\n .turn, .turn.user { grid-template-columns: 28px 1fr; }\n .turn.user .who { order: 0; }\n .turn.user .body { order: 0; text-align: left; }\n }\n</style>\n</head>\n<body>\n<div class=\"app\">\n <header class=\"topbar\">\n <div class=\"model\">\n <div class=\"avatar\" aria-hidden=\"true\"></div>\n <div>\n <h1>Mountly · ${escapeHtml(toolName)}</h1>\n <div class=\"sub\">${escapeHtml(uri)}</div>\n </div>\n </div>\n <span class=\"spacer\"></span>\n <button class=\"icon-btn\" id=\"theme\" type=\"button\" title=\"Toggle theme\" aria-label=\"Toggle theme\">◐</button>\n <button class=\"icon-btn\" id=\"teardown\" type=\"button\" title=\"Teardown\" aria-label=\"Teardown\">×</button>\n </header>\n\n <main class=\"chat\">\n <div class=\"turn user\">\n <div class=\"who\" aria-hidden=\"true\">You</div>\n <div class=\"body\">\n <div class=\"bubble\">\n <p>Call <strong>${escapeHtml(toolName)}</strong> with sample “${escapeHtml(firstFixture)}”.</p>\n </div>\n </div>\n </div>\n\n <div class=\"turn assistant\">\n <div class=\"who\" aria-hidden=\"true\">AI</div>\n <div class=\"body\">\n <div class=\"bubble\">\n <p>Here’s the interactive result from that tool.</p>\n <div class=\"artifact\">\n <div class=\"artifact-bar\"><span class=\"dot\" aria-hidden=\"true\"></span> MCP App · inline</div>\n <iframe id=\"sandbox\" sandbox=\"allow-scripts allow-same-origin\" title=\"mountly-mcp sandbox proxy\"></iframe>\n </div>\n </div>\n </div>\n </div>\n </main>\n\n <footer class=\"composer\">\n <div class=\"composer-box\">\n <p class=\"composer-hint\">Ask another sample — same as switching fixtures in a real host.</p>\n <div class=\"samples\">\n <span class=\"label\">Samples</span>\n <div id=\"fixtures\">${buttons || '<span class=\"label\">No fixtures — add mcp.fixtures.json</span>'}</div>\n </div>\n <details class=\"debug\">\n <summary>Protocol debug</summary>\n <div class=\"debug-body\">\n <section class=\"panel\">\n <h2>Last structuredContent</h2>\n <pre id=\"payload\">(none yet)</pre>\n </section>\n <section class=\"panel\">\n <h2>Channel log</h2>\n <div class=\"log\" id=\"log\"></div>\n </section>\n </div>\n </details>\n </div>\n </footer>\n</div>\n<script>\nglobalThis.__mountlyMcpDevHost__ = ${serializeInlineScriptValue({\n toolName,\n sandboxOrigin,\n fixtures,\n toolInput,\n uri,\n hasServer,\n sandboxPath: \"/sandbox-proxy.html\",\n })};\nconst HAS_SERVER = ${hasServer ? \"true\" : \"false\"};\n</script>\n<script src=\"/host.js\"></script>\n</body>\n</html>\n`;\n}\n/**\n * The proxy document: a shell around the compiled sandbox runtime.\n *\n * Kept separate from {@link sandboxProxyHtml} so the dev server can load the\n * runtime once at startup and still stamp in the host origin per request,\n * which it only learns after binding a port.\n */\nfunction sandboxProxyShell(hostOrigin: string, runtime: string): string {\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>mountly-mcp sandbox proxy</title>\n<style>\n html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }\n #inner { width: 100%; height: 100%; border: 0; background: white; }\n</style>\n</head>\n<body>\n<script>globalThis.__mountlyMcpSandbox__ = ${serializeInlineScriptValue({ hostOrigin })};</script>\n<script>${escapeInlineScript(runtime)}</script>\n</body>\n</html>\n`;\n}\n\n/**\n * The MCP Apps sandbox proxy document (spec §8.4), ready to serve from an\n * origin distinct from the host page.\n *\n * Exported because this is the security boundary — it builds the CSP from the\n * sidecar and decides what the view may execute and reach. Anything standing\n * up a host, including the example harnesses in this repo, should serve this\n * rather than keep a copy that drifts from it.\n */\nexport async function sandboxProxyHtml(hostOrigin: string): Promise<string> {\n return sandboxProxyShell(host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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAwBrE,WAAW,qEAAgE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAmBnE,2BAA2B;AAAA,IAC5D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,EACf,CAAC,CAAC;AAAA,qBACiB,YAAY,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMjD;AAQA,SAAS,kBAAkB,YAAoB,SAAyB;AACtE,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6CAWoC,2BAA2B,EAAE,WAAW,CAAC,CAAC;AAAA,UAC7E,mBAAmB,OAAO,CAAC;AAAA;AAAA;AAAA;AAIrC;AAWA,eAAsB,iBAAiB,YAAqC;AAC1E,SAAO,kBAAkB,YAAY,MAAM,YAAY,eAAe,CAAC;AACzE;","names":[]}
|
|
@@ -10,7 +10,7 @@ var MCP_ERROR_CODES = {
|
|
|
10
10
|
INITIALIZE_FAILED: "mountly-mcp/initialize-failed",
|
|
11
11
|
INITIALIZE_TIMEOUT: "mountly-mcp/initialize-timeout",
|
|
12
12
|
TOOL_CALL_FAILED: "mountly-mcp/tool-call-failed",
|
|
13
|
-
|
|
13
|
+
VIEW_MOUNT_THREW: "mountly-mcp/view-mount-threw",
|
|
14
14
|
INVALID_ORIGIN: "mountly-mcp/invalid-origin"
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
RESOURCE_URI_META_KEY,
|
|
23
23
|
EXTENSION_ID
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-M4WFJR3C.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schema.ts"],"sourcesContent":["/**\n * Spec constants — re-exported from the canonical SDK so they cannot drift.\n * See `@modelcontextprotocol/ext-apps` for the source of truth.\n */\nexport {\n LATEST_PROTOCOL_VERSION as MCP_APPS_PROTOCOL_VERSION,\n RESOURCE_MIME_TYPE as MCP_APPS_MIME,\n RESOURCE_URI_META_KEY,\n} from \"@modelcontextprotocol/ext-apps\";\n\nexport { EXTENSION_ID } from \"@modelcontextprotocol/ext-apps/server\";\n\nexport const MCP_APPS_URI_SCHEME = \"ui://\" as const;\n\n/**\n * Implementation-specific error codes for mountly-mcp's host/bridge layer.\n * The spec doesn't standardize these; they appear in `notifications/message`\n * params so hosts can categorize
|
|
1
|
+
{"version":3,"sources":["../src/schema.ts"],"sourcesContent":["/**\n * Spec constants — re-exported from the canonical SDK so they cannot drift.\n * See `@modelcontextprotocol/ext-apps` for the source of truth.\n */\nexport {\n LATEST_PROTOCOL_VERSION as MCP_APPS_PROTOCOL_VERSION,\n RESOURCE_MIME_TYPE as MCP_APPS_MIME,\n RESOURCE_URI_META_KEY,\n} from \"@modelcontextprotocol/ext-apps\";\n\nexport { EXTENSION_ID } from \"@modelcontextprotocol/ext-apps/server\";\n\nexport const MCP_APPS_URI_SCHEME = \"ui://\" as const;\n\n/**\n * Implementation-specific error codes for mountly-mcp's host/bridge layer.\n * The spec doesn't standardize these; they appear in `notifications/message`\n * params so hosts can categorize View failures.\n */\nexport const MCP_ERROR_CODES = {\n INITIALIZE_FAILED: \"mountly-mcp/initialize-failed\",\n INITIALIZE_TIMEOUT: \"mountly-mcp/initialize-timeout\",\n TOOL_CALL_FAILED: \"mountly-mcp/tool-call-failed\",\n VIEW_MOUNT_THREW: \"mountly-mcp/view-mount-threw\",\n INVALID_ORIGIN: \"mountly-mcp/invalid-origin\",\n} as const;\n\nexport type McpErrorCode = (typeof MCP_ERROR_CODES)[keyof typeof MCP_ERROR_CODES];\n"],"mappings":";AAIA;AAAA,EAC6B;AAAA,EACL;AAAA,EACtB;AAAA,OACK;AAEP,SAAS,oBAAoB;AAEtB,IAAM,sBAAsB;AAO5B,IAAM,kBAAkB;AAAA,EAC7B,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,gBAAgB;AAClB;","names":[]}
|