@brander/mcp-tools 0.2.4 → 0.2.5
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.
|
@@ -28,7 +28,7 @@ function injectInitialConfig(html, projectConfig) {
|
|
|
28
28
|
*/
|
|
29
29
|
export function registerAppResourceHandler(server, projectConfig) {
|
|
30
30
|
server.registerResource("BranderUX Element Renderer", RESOURCE_URI, {
|
|
31
|
-
description: "Universal HTML renderer for all
|
|
31
|
+
description: "Universal HTML renderer for all 15 BranderUX element types",
|
|
32
32
|
mimeType: MCP_APP_MIME_TYPE,
|
|
33
33
|
}, async (uri) => {
|
|
34
34
|
const html = loadAppHtml();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,iBAAiB,EAAiB,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,iBAAiB,EAAiB,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAqCpF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,SAAS,GACpB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,iBAAiB,CAoEvD"}
|
|
@@ -6,17 +6,31 @@ import { buildContentSummary } from "../elements/element-functions.js";
|
|
|
6
6
|
import { RESOURCE_URI } from "../resource/resource-registry.js";
|
|
7
7
|
import { ElementType } from "../types/element-types.js";
|
|
8
8
|
import { getElementDefinition } from "./element-definitions.js";
|
|
9
|
-
/**
|
|
9
|
+
/** Domains allowed for media loading (video, images, fonts) */
|
|
10
|
+
const MEDIA_RESOURCE_DOMAINS = [
|
|
11
|
+
"*.googleapis.com",
|
|
12
|
+
"*.gstatic.com",
|
|
13
|
+
"*.googleusercontent.com",
|
|
14
|
+
"*.unsplash.com",
|
|
15
|
+
"*.cloudinary.com",
|
|
16
|
+
"*.imgur.com",
|
|
17
|
+
];
|
|
18
|
+
/** Domains allowed for iframe embedding (e.g. YouTube) */
|
|
19
|
+
const FRAME_DOMAINS = ["*.youtube.com", "*.youtube-nocookie.com"];
|
|
20
|
+
/** Build _meta with resource URI, CSP connect/resource/frame domains */
|
|
10
21
|
function buildMeta(apiConfig) {
|
|
11
22
|
const meta = {
|
|
12
23
|
ui: { resourceUri: RESOURCE_URI },
|
|
13
24
|
"ui/resourceUri": RESOURCE_URI,
|
|
14
25
|
};
|
|
26
|
+
const csp = {
|
|
27
|
+
resourceDomains: [...MEDIA_RESOURCE_DOMAINS],
|
|
28
|
+
frameDomains: [...FRAME_DOMAINS],
|
|
29
|
+
};
|
|
15
30
|
if (apiConfig) {
|
|
16
|
-
|
|
17
|
-
connectDomains: [new URL(apiConfig.apiBaseUrl).origin],
|
|
18
|
-
};
|
|
31
|
+
csp.connectDomains = [new URL(apiConfig.apiBaseUrl).origin];
|
|
19
32
|
}
|
|
33
|
+
meta.ui.csp = csp;
|
|
20
34
|
return meta;
|
|
21
35
|
}
|
|
22
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOlD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,SAAS,GACpB,IAAI,
|
|
1
|
+
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOlD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,SAAS,GACpB,IAAI,CAmDN"}
|
|
@@ -27,7 +27,20 @@ export function registerTools(server, projectConfig, apiConfig) {
|
|
|
27
27
|
description,
|
|
28
28
|
inputSchema: generateScreenInputSchema,
|
|
29
29
|
_meta: {
|
|
30
|
-
ui: {
|
|
30
|
+
ui: {
|
|
31
|
+
resourceUri: RESOURCE_URI,
|
|
32
|
+
csp: {
|
|
33
|
+
resourceDomains: [
|
|
34
|
+
"*.googleapis.com",
|
|
35
|
+
"*.gstatic.com",
|
|
36
|
+
"*.googleusercontent.com",
|
|
37
|
+
"*.unsplash.com",
|
|
38
|
+
"*.cloudinary.com",
|
|
39
|
+
"*.imgur.com",
|
|
40
|
+
],
|
|
41
|
+
frameDomains: ["*.youtube.com", "*.youtube-nocookie.com"],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
31
44
|
"ui/resourceUri": RESOURCE_URI,
|
|
32
45
|
},
|
|
33
46
|
}, async (args) => {
|