@reddb-io/ui-mcp 0.1.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.
- package/LICENSE +17 -0
- package/dist/connection.d.ts +20 -0
- package/dist/connection.js +61 -0
- package/dist/connection.js.map +1 -0
- package/dist/data-tools.d.ts +51 -0
- package/dist/data-tools.js +285 -0
- package/dist/data-tools.js.map +1 -0
- package/dist/embed-server.d.ts +40 -0
- package/dist/embed-server.js +280 -0
- package/dist/embed-server.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +599 -0
- package/dist/index.js.map +1 -0
- package/dist/local-server.d.ts +62 -0
- package/dist/local-server.js +356 -0
- package/dist/local-server.js.map +1 -0
- package/dist/red-client.d.ts +72 -0
- package/dist/red-client.js +171 -0
- package/dist/red-client.js.map +1 -0
- package/dist/target-mode.d.ts +10 -0
- package/dist/target-mode.js +39 -0
- package/dist/target-mode.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
// Same-origin local UI for the MCP App (#51, ADR-0006).
|
|
2
|
+
//
|
|
3
|
+
// In local-file mode the API is a spawned `red server` on `http://127.0.0.1:<port>`
|
|
4
|
+
// (see local-server.ts). If the visual UI is still loaded from the hosted HTTPS
|
|
5
|
+
// origin (https://ui.reddb.io), the browser sees an HTTPS page fetching an
|
|
6
|
+
// `http://localhost` API — mixed content. Chrome exempts localhost, but Firefox
|
|
7
|
+
// and Safari are unreliable, and it requires the network anyway.
|
|
8
|
+
//
|
|
9
|
+
// So for local mode we serve the Embeddable Lib bundle (#37, shipped in
|
|
10
|
+
// `@reddb-io/ui/dist/embed`) ourselves over `http://127.0.0.1:<port>`. The iframe
|
|
11
|
+
// then loads from `http://localhost` and fetches the `http://localhost` API:
|
|
12
|
+
// same scheme, no mixed content, fully offline. The embed bundle owns auth via
|
|
13
|
+
// an InjectedClientProvider seeded from the `?cs=` connection string.
|
|
14
|
+
//
|
|
15
|
+
// One embed server per MCP process (the bundle is identical regardless of which
|
|
16
|
+
// file is open); torn down on MCP exit/disconnect — no orphan servers.
|
|
17
|
+
import { createServer, } from "node:http";
|
|
18
|
+
import { accessSync, constants as fsConstants, createReadStream, } from "node:fs";
|
|
19
|
+
import { createServer as createNetServer } from "node:net";
|
|
20
|
+
import { createRequire } from "node:module";
|
|
21
|
+
import { dirname, extname, isAbsolute, join, normalize, relative, resolve, } from "node:path";
|
|
22
|
+
import { fileURLToPath } from "node:url";
|
|
23
|
+
const require = createRequire(import.meta.url);
|
|
24
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
function isFile(file) {
|
|
26
|
+
try {
|
|
27
|
+
accessSync(file, fsConstants.F_OK);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Locate the built Embeddable Lib bundle directory (`@reddb-io/ui/dist/embed`),
|
|
36
|
+
* the one containing `index.js`. Resolution order: explicit `RED_UI_EMBED_DIR`
|
|
37
|
+
* → the published `@reddb-io/ui/embed` export → the monorepo sibling
|
|
38
|
+
* (`packages/ui/dist/embed`) → the published dependency layout (the MCP lives in
|
|
39
|
+
* `<ui>/node_modules/@reddb-io/ui-mcp`). Throws an actionable error when none of
|
|
40
|
+
* these holds the bundle.
|
|
41
|
+
*/
|
|
42
|
+
export function resolveEmbedDir(override) {
|
|
43
|
+
const candidates = [];
|
|
44
|
+
const fromArg = override?.trim() || process.env.RED_UI_EMBED_DIR?.trim();
|
|
45
|
+
if (fromArg)
|
|
46
|
+
candidates.push(resolve(fromArg));
|
|
47
|
+
// `@reddb-io/ui` exports `./embed` → `<ui>/dist/embed/index.js`.
|
|
48
|
+
try {
|
|
49
|
+
candidates.push(dirname(require.resolve("@reddb-io/ui/embed")));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Not resolvable from here (e.g. the monorepo, where ui depends on the MCP
|
|
53
|
+
// and not the reverse). Fall through to path-based strategies.
|
|
54
|
+
}
|
|
55
|
+
// Monorepo dev/test: packages/mcp/dist/embed-server.js → packages/ui/dist/embed.
|
|
56
|
+
candidates.push(resolve(here, "..", "..", "ui", "dist", "embed"));
|
|
57
|
+
// Published layout: <ui>/node_modules/@reddb-io/ui-mcp/dist → <ui>/dist/embed.
|
|
58
|
+
candidates.push(resolve(here, "..", "..", "..", "..", "dist", "embed"));
|
|
59
|
+
for (const dir of candidates) {
|
|
60
|
+
if (isFile(join(dir, "index.js")))
|
|
61
|
+
return dir;
|
|
62
|
+
}
|
|
63
|
+
throw new Error("Cannot serve the local UI: the red-ui embeddable bundle was not found. " +
|
|
64
|
+
"Build it with `pnpm --filter @reddb-io/ui build`, install a published " +
|
|
65
|
+
"@reddb-io/ui, or set RED_UI_EMBED_DIR to the directory holding the " +
|
|
66
|
+
"embed `index.js`. See ADR-0006 / issue #51.");
|
|
67
|
+
}
|
|
68
|
+
/** Reserve a free TCP port on the loopback interface, then release it. */
|
|
69
|
+
function pickEphemeralPort() {
|
|
70
|
+
return new Promise((resolvePort, reject) => {
|
|
71
|
+
const srv = createNetServer();
|
|
72
|
+
srv.unref();
|
|
73
|
+
srv.once("error", reject);
|
|
74
|
+
srv.listen(0, "127.0.0.1", () => {
|
|
75
|
+
const addr = srv.address();
|
|
76
|
+
const port = addr && typeof addr === "object" ? addr.port : 0;
|
|
77
|
+
srv.close(() => {
|
|
78
|
+
if (port)
|
|
79
|
+
resolvePort(port);
|
|
80
|
+
else
|
|
81
|
+
reject(new Error("Could not reserve an ephemeral port."));
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const CONTENT_TYPES = {
|
|
87
|
+
".html": "text/html; charset=utf-8",
|
|
88
|
+
".js": "text/javascript; charset=utf-8",
|
|
89
|
+
".mjs": "text/javascript; charset=utf-8",
|
|
90
|
+
".css": "text/css; charset=utf-8",
|
|
91
|
+
".json": "application/json; charset=utf-8",
|
|
92
|
+
".map": "application/json; charset=utf-8",
|
|
93
|
+
".png": "image/png",
|
|
94
|
+
".svg": "image/svg+xml",
|
|
95
|
+
".woff": "font/woff",
|
|
96
|
+
".woff2": "font/woff2",
|
|
97
|
+
".ttf": "font/ttf",
|
|
98
|
+
};
|
|
99
|
+
function contentType(filePath) {
|
|
100
|
+
return CONTENT_TYPES[extname(filePath)] ?? "application/octet-stream";
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The host page. It imports the embed bundle from the same origin, builds a
|
|
104
|
+
* single-connection InjectedClientProvider from the `?cs=` endpoint the MCP
|
|
105
|
+
* seeded (the spawned `red server`), and mounts red-ui into a full-document
|
|
106
|
+
* host element. `?to=` selects the initial route. No secret rides the URL
|
|
107
|
+
* (ADR-0005); the local server is loopback-only and unauthenticated.
|
|
108
|
+
*/
|
|
109
|
+
export function renderHostHtml() {
|
|
110
|
+
return `<!doctype html>
|
|
111
|
+
<html lang="en" data-theme="dark">
|
|
112
|
+
<head>
|
|
113
|
+
<meta charset="utf-8" />
|
|
114
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
115
|
+
<title>red-ui (local)</title>
|
|
116
|
+
<style>
|
|
117
|
+
html, body { margin: 0; height: 100%; background: #050607; color: #f7f8fa; }
|
|
118
|
+
#red-ui-host { display: block; min-height: 100vh; }
|
|
119
|
+
.boot-error {
|
|
120
|
+
padding: 24px;
|
|
121
|
+
font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
122
|
+
color: #ff5470;
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
125
|
+
</head>
|
|
126
|
+
<body>
|
|
127
|
+
<div id="red-ui-host"></div>
|
|
128
|
+
<script type="module">
|
|
129
|
+
import {
|
|
130
|
+
RedClient,
|
|
131
|
+
InjectedClientProvider,
|
|
132
|
+
mountRedUi,
|
|
133
|
+
} from "./embed/index.js";
|
|
134
|
+
|
|
135
|
+
const host = document.getElementById("red-ui-host");
|
|
136
|
+
const params = new URLSearchParams(location.search);
|
|
137
|
+
const cs = (params.get("cs") || "").trim();
|
|
138
|
+
const to = (params.get("to") || "/query").trim();
|
|
139
|
+
|
|
140
|
+
if (!cs) {
|
|
141
|
+
host.className = "boot-error";
|
|
142
|
+
host.textContent =
|
|
143
|
+
"No connection string (cs) was provided to the local red-ui host.";
|
|
144
|
+
} else {
|
|
145
|
+
const client = new RedClient(cs);
|
|
146
|
+
const provider = new InjectedClientProvider({
|
|
147
|
+
client,
|
|
148
|
+
connection: {
|
|
149
|
+
id: "host",
|
|
150
|
+
url: cs,
|
|
151
|
+
label: "Local file",
|
|
152
|
+
role: "primary",
|
|
153
|
+
description: "Served by a local red server (ADR-0006).",
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
mountRedUi(host, {
|
|
157
|
+
connectionProvider: provider,
|
|
158
|
+
initialRoute: to,
|
|
159
|
+
theme: "dark",
|
|
160
|
+
}).catch((error) => {
|
|
161
|
+
host.className = "boot-error";
|
|
162
|
+
host.textContent =
|
|
163
|
+
"Failed to mount red-ui: " +
|
|
164
|
+
(error && error.message ? error.message : String(error));
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
</script>
|
|
168
|
+
</body>
|
|
169
|
+
</html>`;
|
|
170
|
+
}
|
|
171
|
+
function sendText(res, status, type, body) {
|
|
172
|
+
res.writeHead(status, { "content-type": type });
|
|
173
|
+
res.end(body);
|
|
174
|
+
}
|
|
175
|
+
function handleRequest(req, res, embedDir, host, port) {
|
|
176
|
+
let pathname;
|
|
177
|
+
try {
|
|
178
|
+
pathname = decodeURIComponent(new URL(req.url ?? "/", `http://${host}:${port}`).pathname);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
sendText(res, 400, "text/plain; charset=utf-8", "Bad request");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (pathname === "/" || pathname === "/index.html") {
|
|
185
|
+
sendText(res, 200, "text/html; charset=utf-8", renderHostHtml());
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
// Everything else must resolve to a file under `<embedDir>` and be reached via
|
|
189
|
+
// the `/embed/` prefix (matching the host page's `./embed/index.js` imports).
|
|
190
|
+
const EMBED_PREFIX = "/embed/";
|
|
191
|
+
if (!pathname.startsWith(EMBED_PREFIX)) {
|
|
192
|
+
sendText(res, 404, "text/plain; charset=utf-8", "Not found");
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const requestedRel = pathname.slice(EMBED_PREFIX.length);
|
|
196
|
+
const candidate = resolve(embedDir, normalize(requestedRel).replace(/^(\.\.(\/|\\|$))+/, ""));
|
|
197
|
+
const rel = relative(embedDir, candidate);
|
|
198
|
+
const insideEmbed = rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
199
|
+
if (!insideEmbed || !isFile(candidate)) {
|
|
200
|
+
sendText(res, 404, "text/plain; charset=utf-8", "Not found");
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
res.writeHead(200, { "content-type": contentType(candidate) });
|
|
204
|
+
const stream = createReadStream(candidate);
|
|
205
|
+
stream.on("error", () => {
|
|
206
|
+
if (!res.headersSent)
|
|
207
|
+
res.writeHead(500);
|
|
208
|
+
res.end();
|
|
209
|
+
});
|
|
210
|
+
stream.pipe(res);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Start one loopback HTTP server that serves the host page at `/` and the embed
|
|
214
|
+
* bundle under `/embed/`. The returned handle's `stop()` closes it.
|
|
215
|
+
*/
|
|
216
|
+
export async function startEmbedServer(options = {}) {
|
|
217
|
+
const embedDir = resolveEmbedDir(options.embedDir);
|
|
218
|
+
const host = "127.0.0.1";
|
|
219
|
+
const port = options.port ?? (await pickEphemeralPort());
|
|
220
|
+
const baseUrl = `http://${host}:${port}`;
|
|
221
|
+
const server = createServer((req, res) => handleRequest(req, res, embedDir, host, port));
|
|
222
|
+
await new Promise((resolveListen, reject) => {
|
|
223
|
+
server.once("error", reject);
|
|
224
|
+
server.listen(port, host, () => {
|
|
225
|
+
server.removeListener("error", reject);
|
|
226
|
+
resolveListen();
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
const handle = {
|
|
230
|
+
baseUrl,
|
|
231
|
+
port,
|
|
232
|
+
embedDir,
|
|
233
|
+
server,
|
|
234
|
+
stop: makeStop(server),
|
|
235
|
+
};
|
|
236
|
+
trackServer(handle);
|
|
237
|
+
return handle;
|
|
238
|
+
}
|
|
239
|
+
function makeStop(server) {
|
|
240
|
+
let stopping = null;
|
|
241
|
+
return () => {
|
|
242
|
+
if (stopping)
|
|
243
|
+
return stopping;
|
|
244
|
+
stopping = new Promise((resolveStop) => {
|
|
245
|
+
server.close(() => resolveStop());
|
|
246
|
+
// Drop keep-alive sockets so close() can complete promptly.
|
|
247
|
+
server.closeAllConnections?.();
|
|
248
|
+
});
|
|
249
|
+
return stopping;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// --- lifecycle registry: no orphan UI servers on MCP exit/disconnect ---------
|
|
253
|
+
const liveServers = new Set();
|
|
254
|
+
let exitHooksInstalled = false;
|
|
255
|
+
function installExitHooks() {
|
|
256
|
+
if (exitHooksInstalled)
|
|
257
|
+
return;
|
|
258
|
+
exitHooksInstalled = true;
|
|
259
|
+
process.on("exit", () => {
|
|
260
|
+
for (const handle of liveServers) {
|
|
261
|
+
try {
|
|
262
|
+
handle.server.close();
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
// already gone
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function trackServer(handle) {
|
|
271
|
+
installExitHooks();
|
|
272
|
+
liveServers.add(handle);
|
|
273
|
+
handle.server.once("close", () => liveServers.delete(handle));
|
|
274
|
+
}
|
|
275
|
+
/** Stop every tracked embed server (MCP transport close / shutdown). */
|
|
276
|
+
export async function stopAllEmbedServers() {
|
|
277
|
+
const handles = [...liveServers];
|
|
278
|
+
await Promise.all(handles.map((h) => h.stop()));
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=embed-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed-server.js","sourceRoot":"","sources":["../src/embed-server.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,oFAAoF;AACpF,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,kFAAkF;AAClF,6EAA6E;AAC7E,+EAA+E;AAC/E,sEAAsE;AACtE,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AAEvE,OAAO,EAGL,YAAY,GACb,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,UAAU,EACV,SAAS,IAAI,WAAW,EACxB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,OAAO,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAmBrD,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,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