skybridge 0.0.0-dev.7ca051e → 0.0.0-dev.7eec2ca
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 +21 -674
- package/README.md +68 -314
- package/dist/src/server/devtoolsStaticServer.d.ts +15 -0
- package/dist/src/server/devtoolsStaticServer.js +38 -0
- package/dist/src/server/devtoolsStaticServer.js.map +1 -0
- package/dist/src/server/index.d.ts +3 -2
- package/dist/src/server/index.js +1 -0
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/inferUtilityTypes.d.ts +10 -0
- package/dist/src/server/server.d.ts +42 -17
- package/dist/src/server/server.js +54 -34
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/server/templateHelper.d.ts +2 -0
- package/dist/src/server/templateHelper.js +5 -4
- package/dist/src/server/templateHelper.js.map +1 -1
- package/dist/src/server/templates/development.hbs +3 -2
- package/dist/src/server/templates/production.hbs +1 -0
- package/dist/src/server/widgetsDevServer.js +3 -3
- package/dist/src/server/widgetsDevServer.js.map +1 -1
- package/dist/src/test/utils.d.ts +54 -8
- package/dist/src/test/utils.js +86 -8
- package/dist/src/test/utils.js.map +1 -1
- package/dist/src/test/widget.test.js +71 -27
- package/dist/src/test/widget.test.js.map +1 -1
- package/dist/src/web/create-store.d.ts +3 -0
- package/dist/src/web/create-store.js +25 -0
- package/dist/src/web/create-store.js.map +1 -0
- package/dist/src/web/create-store.test.d.ts +1 -0
- package/dist/src/web/create-store.test.js +70 -0
- package/dist/src/web/create-store.test.js.map +1 -0
- package/dist/src/web/data-llm.d.ts +1 -0
- package/dist/src/web/data-llm.js +4 -3
- package/dist/src/web/data-llm.js.map +1 -1
- package/dist/src/web/data-llm.test.js.map +1 -1
- package/dist/src/web/generate-helpers.d.ts +11 -11
- package/dist/src/web/generate-helpers.js +6 -4
- package/dist/src/web/generate-helpers.js.map +1 -1
- package/dist/src/web/generate-helpers.test-d.js +58 -3
- package/dist/src/web/generate-helpers.test-d.js.map +1 -1
- package/dist/src/web/generate-helpers.test.js +1 -1
- package/dist/src/web/generate-helpers.test.js.map +1 -1
- package/dist/src/web/helpers/state.d.ts +7 -0
- package/dist/src/web/helpers/state.js +40 -0
- package/dist/src/web/helpers/state.js.map +1 -0
- package/dist/src/web/helpers/state.test.d.ts +1 -0
- package/dist/src/web/helpers/state.test.js +53 -0
- package/dist/src/web/helpers/state.test.js.map +1 -0
- package/dist/src/web/hooks/index.d.ts +2 -4
- package/dist/src/web/hooks/index.js +1 -3
- package/dist/src/web/hooks/index.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.d.ts +1 -1
- package/dist/src/web/hooks/use-call-tool.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.test-d.js +1 -1
- package/dist/src/web/hooks/use-call-tool.test-d.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.test.js +9 -15
- package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.test.js +2 -2
- package/dist/src/web/hooks/use-display-mode.test.js.map +1 -1
- package/dist/src/web/hooks/use-files.test.js +1 -1
- package/dist/src/web/hooks/use-files.test.js.map +1 -1
- package/dist/src/web/hooks/use-locale.js.map +1 -1
- package/dist/src/web/hooks/use-locale.test.js +2 -2
- package/dist/src/web/hooks/use-locale.test.js.map +1 -1
- package/dist/src/web/hooks/use-open-external.test.js +2 -2
- package/dist/src/web/hooks/use-open-external.test.js.map +1 -1
- package/dist/src/web/hooks/use-openai-global.d.ts +2 -2
- package/dist/src/web/hooks/use-openai-global.js +7 -5
- package/dist/src/web/hooks/use-openai-global.js.map +1 -1
- package/dist/src/web/hooks/use-request-modal.test.js +2 -2
- package/dist/src/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/src/web/hooks/use-theme.js.map +1 -1
- package/dist/src/web/hooks/use-theme.test.js +2 -2
- package/dist/src/web/hooks/use-theme.test.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +1 -1
- package/dist/src/web/hooks/use-tool-info.js +4 -6
- package/dist/src/web/hooks/use-tool-info.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js +0 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.test.js +2 -2
- package/dist/src/web/hooks/use-tool-info.test.js.map +1 -1
- package/dist/src/web/hooks/use-user-agent.js.map +1 -1
- package/dist/src/web/hooks/use-user-agent.test.js +2 -2
- package/dist/src/web/hooks/use-user-agent.test.js.map +1 -1
- package/dist/src/web/hooks/use-widget-state.js +3 -25
- package/dist/src/web/hooks/use-widget-state.js.map +1 -1
- package/dist/src/web/hooks/use-widget-state.test.js +2 -2
- package/dist/src/web/hooks/use-widget-state.test.js.map +1 -1
- package/dist/src/web/index.d.ts +4 -3
- package/dist/src/web/index.js +4 -3
- package/dist/src/web/index.js.map +1 -1
- package/dist/src/web/plugin/plugin.js +10 -4
- package/dist/src/web/plugin/plugin.js.map +1 -1
- package/dist/src/web/proxy.js +6 -1
- package/dist/src/web/proxy.js.map +1 -1
- package/dist/src/web/types.d.ts +10 -6
- package/dist/src/web/types.js.map +1 -1
- package/package.json +11 -5
- package/dist/src/web/hooks/use-tool-output.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-output.js +0 -9
- package/dist/src/web/hooks/use-tool-output.js.map +0 -1
- package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
- package/dist/src/web/hooks/use-tool-response-metadata.js.map +0 -1
|
@@ -1,48 +1,39 @@
|
|
|
1
|
-
import { McpServer as McpServerBase, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import { templateHelper } from "./templateHelper.js";
|
|
3
1
|
import { readFileSync } from "node:fs";
|
|
4
2
|
import path from "node:path";
|
|
3
|
+
import { McpServer as McpServerBase, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { templateHelper } from "./templateHelper.js";
|
|
5
5
|
export class McpServer extends McpServerBase {
|
|
6
|
-
|
|
7
|
-
const uri = `ui://widgets/${name}.html`;
|
|
6
|
+
registerWidget(name, resourceConfig, toolConfig, toolCallback) {
|
|
8
7
|
const resourceMetadata = {
|
|
9
8
|
...(resourceConfig._meta ?? {}),
|
|
10
9
|
};
|
|
11
10
|
if (toolConfig.description !== undefined) {
|
|
12
11
|
resourceMetadata["openai/widgetDescription"] = toolConfig.description;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
contents: [
|
|
34
|
-
{
|
|
35
|
-
uri,
|
|
36
|
-
mimeType: "text/html+skybridge",
|
|
37
|
-
text: html,
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
};
|
|
13
|
+
const appsSdkResourceConfig = {
|
|
14
|
+
host: "apps-sdk",
|
|
15
|
+
uri: `ui://widgets/apps-sdk/${name}.html`,
|
|
16
|
+
mimeType: "text/html+skybridge",
|
|
17
|
+
};
|
|
18
|
+
const extAppsResourceConfig = {
|
|
19
|
+
host: "ext-apps",
|
|
20
|
+
uri: `ui://widgets/ext-apps/${name}.html`,
|
|
21
|
+
mimeType: "text/html;profile=mcp-app",
|
|
22
|
+
};
|
|
23
|
+
[appsSdkResourceConfig, extAppsResourceConfig].forEach(({ host, uri, mimeType }) => {
|
|
24
|
+
this.registerWidgetResource({
|
|
25
|
+
name,
|
|
26
|
+
host,
|
|
27
|
+
widgetUri: uri,
|
|
28
|
+
mimeType,
|
|
29
|
+
resourceConfig,
|
|
30
|
+
resourceMetadata,
|
|
31
|
+
});
|
|
41
32
|
});
|
|
42
33
|
const toolMeta = {
|
|
43
34
|
...toolConfig._meta,
|
|
44
|
-
"openai/outputTemplate": uri,
|
|
45
|
-
"ui/resourceUri": uri,
|
|
35
|
+
"openai/outputTemplate": appsSdkResourceConfig.uri,
|
|
36
|
+
// "ui/resourceUri": extAppsResourceConfig.uri,
|
|
46
37
|
};
|
|
47
38
|
this.registerTool(name, {
|
|
48
39
|
...toolConfig,
|
|
@@ -54,9 +45,38 @@ export class McpServer extends McpServerBase {
|
|
|
54
45
|
super.registerTool(name, config, cb);
|
|
55
46
|
return this;
|
|
56
47
|
}
|
|
48
|
+
registerWidgetResource({ name, host, widgetUri, mimeType, resourceConfig, resourceMetadata, }) {
|
|
49
|
+
this.registerResource(name, widgetUri, { ...resourceConfig, _meta: resourceMetadata }, async (uri, extra) => {
|
|
50
|
+
const serverUrl = process.env.NODE_ENV === "production"
|
|
51
|
+
? `https://${extra?.requestInfo?.headers?.["x-forwarded-host"] ?? extra?.requestInfo?.headers?.host}`
|
|
52
|
+
: `http://localhost:3000`;
|
|
53
|
+
const html = process.env.NODE_ENV === "production"
|
|
54
|
+
? templateHelper.renderProduction({
|
|
55
|
+
host,
|
|
56
|
+
serverUrl,
|
|
57
|
+
widgetFile: this.lookupDistFileWithIndexFallback(`src/widgets/${name}`),
|
|
58
|
+
styleFile: this.lookupDistFile("style.css"),
|
|
59
|
+
})
|
|
60
|
+
: templateHelper.renderDevelopment({
|
|
61
|
+
host,
|
|
62
|
+
serverUrl,
|
|
63
|
+
widgetName: name,
|
|
64
|
+
});
|
|
65
|
+
return { contents: [{ uri: uri.href, mimeType, text: html }] };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
57
68
|
lookupDistFile(key) {
|
|
58
|
-
const manifest =
|
|
69
|
+
const manifest = this.readManifest();
|
|
59
70
|
return manifest[key]?.file;
|
|
60
71
|
}
|
|
72
|
+
lookupDistFileWithIndexFallback(basePath) {
|
|
73
|
+
const manifest = this.readManifest();
|
|
74
|
+
const flatFileKey = `${basePath}.tsx`;
|
|
75
|
+
const indexFileKey = `${basePath}/index.tsx`;
|
|
76
|
+
return manifest[flatFileKey]?.file ?? manifest[indexFileKey]?.file;
|
|
77
|
+
}
|
|
78
|
+
readManifest() {
|
|
79
|
+
return JSON.parse(readFileSync(path.join(process.cwd(), "dist", "assets", ".vite", "manifest.json"), "utf-8"));
|
|
80
|
+
}
|
|
61
81
|
}
|
|
62
82
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/server/server.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/server/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,SAAS,IAAI,aAAa,GAG3B,MAAM,yCAAyC,CAAC;AAcjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAqIrD,MAAM,OAAO,SAEX,SAAQ,aAAa;IAGrB,cAAc,CAKZ,IAAW,EACX,cAA+C,EAC/C,UAGC,EACD,YAA0C;QAQ1C,MAAM,gBAAgB,GAAiB;YACrC,GAAG,CAAC,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC;SAChC,CAAC;QACF,IAAI,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACzC,gBAAgB,CAAC,0BAA0B,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC;QACxE,CAAC;QAED,MAAM,qBAAqB,GAAyB;YAClD,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,yBAAyB,IAAI,OAAO;YACzC,QAAQ,EAAE,qBAAqB;SAChC,CAAC;QAEF,MAAM,qBAAqB,GAAyB;YAClD,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,yBAAyB,IAAI,OAAO;YACzC,QAAQ,EAAE,2BAA2B;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plateHelper {
|
|
|
2
2
|
private templateCache;
|
|
3
3
|
private loadTemplate;
|
|
4
4
|
renderProduction(data: {
|
|
5
|
+
host: "apps-sdk" | "ext-apps";
|
|
5
6
|
serverUrl: string;
|
|
6
7
|
widgetFile: string;
|
|
7
8
|
styleFile: string;
|
|
8
9
|
}): string;
|
|
9
10
|
renderDevelopment(data: {
|
|
11
|
+
host: "apps-sdk" | "ext-apps";
|
|
10
12
|
serverUrl: string;
|
|
11
13
|
widgetName: string;
|
|
12
14
|
}): string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import Handlebars from "handlebars";
|
|
2
1
|
import { readFileSync } from "node:fs";
|
|
3
|
-
import {
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
+
import Handlebars from "handlebars";
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = dirname(__filename);
|
|
7
7
|
class TemplateHelper {
|
|
8
8
|
templateCache = new Map();
|
|
9
9
|
loadTemplate(templateName) {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const cached = this.templateCache.get(templateName);
|
|
11
|
+
if (cached) {
|
|
12
|
+
return cached;
|
|
12
13
|
}
|
|
13
14
|
const templatePath = join(__dirname, "templates", `${templateName}.hbs`);
|
|
14
15
|
const templateSource = readFileSync(templatePath, "utf-8");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateHelper.js","sourceRoot":"","sources":["../../../src/server/templateHelper.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"templateHelper.js","sourceRoot":"","sources":["../../../src/server/templateHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,UA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Hook } from "{{serverUrl}}/@react-refresh";
|
|
4
5
|
injectIntoGlobalHook(window); window.$RefreshReg$ = () => {};
|
|
@@ -7,6 +8,6 @@
|
|
|
7
8
|
</script>
|
|
8
9
|
<script type="module" src="{{serverUrl}}/@vite/client"></script>
|
|
9
10
|
<div id="root"></div>
|
|
10
|
-
<script type="module">
|
|
11
|
-
import('{{serverUrl}}/src/widgets/{{widgetName}}
|
|
11
|
+
<script type="module" id="dev-widget-entry">
|
|
12
|
+
import('{{serverUrl}}/src/widgets/{{widgetName}}');
|
|
12
13
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import express, {} from "express";
|
|
2
|
-
import cors from "cors";
|
|
3
1
|
import path from "node:path";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
import express, {} from "express";
|
|
4
4
|
/**
|
|
5
5
|
* Install Vite dev server
|
|
6
6
|
* This router MUST be installed at the application root, like so:
|
|
@@ -17,7 +17,7 @@ export const widgetsDevServer = async () => {
|
|
|
17
17
|
const workspaceRoot = searchForWorkspaceRoot(process.cwd());
|
|
18
18
|
const webAppRoot = path.join(workspaceRoot, "web");
|
|
19
19
|
const configResult = await loadConfigFromFile({ command: "serve", mode: "development" }, path.join(webAppRoot, "vite.config.ts"), webAppRoot);
|
|
20
|
-
// Remove build-specific options that don't apply to dev server
|
|
20
|
+
// biome-ignore lint/correctness/noUnusedVariables: Remove build-specific options that don't apply to dev server
|
|
21
21
|
const { build, preview, ...devConfig } = configResult?.config || {};
|
|
22
22
|
const vite = await createServer({
|
|
23
23
|
...devConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetsDevServer.js","sourceRoot":"","sources":["../../../src/server/widgetsDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"widgetsDevServer.js","sourceRoot":"","sources":["../../../src/server/widgetsDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO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C,CAAC"}
|
package/dist/src/test/utils.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { McpServer } from "../server/server.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createMockMcpServer(): {
|
|
7
7
|
server: McpServer;
|
|
8
|
-
|
|
8
|
+
mockRegisterResource: MockInstance<McpServer["registerResource"]>;
|
|
9
9
|
mockRegisterTool: MockInstance<McpServer["registerTool"]>;
|
|
10
10
|
};
|
|
11
|
-
export declare function createTestServer(): McpServer<{
|
|
11
|
+
export declare function createTestServer(): McpServer<Record<never, import("../server/server.js").ToolDef<unknown, unknown, unknown>> & {
|
|
12
12
|
"search-voyage": import("../server/server.js").ToolDef<{
|
|
13
13
|
destination: string;
|
|
14
14
|
departureDate?: string | undefined;
|
|
@@ -20,7 +20,7 @@ export declare function createTestServer(): McpServer<{
|
|
|
20
20
|
price: number;
|
|
21
21
|
}[];
|
|
22
22
|
totalCount: number;
|
|
23
|
-
}>;
|
|
23
|
+
}, unknown>;
|
|
24
24
|
} & {
|
|
25
25
|
"get-trip-details": import("../server/server.js").ToolDef<{
|
|
26
26
|
tripId: string;
|
|
@@ -28,9 +28,9 @@ export declare function createTestServer(): McpServer<{
|
|
|
28
28
|
name: string;
|
|
29
29
|
description: string;
|
|
30
30
|
images: string[];
|
|
31
|
-
}>;
|
|
31
|
+
}, unknown>;
|
|
32
32
|
} & {
|
|
33
|
-
"no-input-widget": import("../server/server.js").ToolDef<{}, {}>;
|
|
33
|
+
"no-input-widget": import("../server/server.js").ToolDef<{}, {}, unknown>;
|
|
34
34
|
} & {
|
|
35
35
|
"inferred-output-widget": import("../server/server.js").ToolDef<{
|
|
36
36
|
query: string;
|
|
@@ -40,7 +40,7 @@ export declare function createTestServer(): McpServer<{
|
|
|
40
40
|
score: number;
|
|
41
41
|
}[];
|
|
42
42
|
inferredCount: number;
|
|
43
|
-
}>;
|
|
43
|
+
}, unknown>;
|
|
44
44
|
} & {
|
|
45
45
|
"calculate-price": import("../server/server.js").ToolDef<{
|
|
46
46
|
tripId: string;
|
|
@@ -48,7 +48,7 @@ export declare function createTestServer(): McpServer<{
|
|
|
48
48
|
}, {
|
|
49
49
|
totalPrice: number;
|
|
50
50
|
currency: string;
|
|
51
|
-
}>;
|
|
51
|
+
}, unknown>;
|
|
52
52
|
} & {
|
|
53
53
|
"inferred-tool": import("../server/server.js").ToolDef<{
|
|
54
54
|
itemId: string;
|
|
@@ -58,15 +58,61 @@ export declare function createTestServer(): McpServer<{
|
|
|
58
58
|
available: boolean;
|
|
59
59
|
};
|
|
60
60
|
fetchedAt: string;
|
|
61
|
+
}, unknown>;
|
|
62
|
+
} & {
|
|
63
|
+
"widget-with-metadata": import("../server/server.js").ToolDef<{
|
|
64
|
+
resourceId: string;
|
|
65
|
+
}, {
|
|
66
|
+
data: {
|
|
67
|
+
id: string;
|
|
68
|
+
loaded: boolean;
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
requestId: string;
|
|
72
|
+
timestamp: number;
|
|
73
|
+
cached: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
} & {
|
|
76
|
+
"tool-with-metadata": import("../server/server.js").ToolDef<{
|
|
77
|
+
query: string;
|
|
78
|
+
}, {
|
|
79
|
+
results: string[];
|
|
80
|
+
}, {
|
|
81
|
+
executionTime: number;
|
|
82
|
+
source: string;
|
|
83
|
+
}>;
|
|
84
|
+
} & {
|
|
85
|
+
"widget-with-mixed-returns": import("../server/server.js").ToolDef<{
|
|
86
|
+
shouldSucceed: boolean;
|
|
87
|
+
}, {
|
|
88
|
+
error: string;
|
|
89
|
+
data?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
data: string;
|
|
92
|
+
error?: undefined;
|
|
93
|
+
}, {
|
|
94
|
+
processedAt: number;
|
|
95
|
+
region: string;
|
|
61
96
|
}>;
|
|
62
97
|
}>;
|
|
63
|
-
export declare function createMinimalTestServer(): McpServer<{
|
|
98
|
+
export declare function createMinimalTestServer(): McpServer<Record<never, import("../server/server.js").ToolDef<unknown, unknown, unknown>> & {
|
|
64
99
|
"search-voyage": import("../server/server.js").ToolDef<{
|
|
65
100
|
destination: string;
|
|
66
101
|
}, {
|
|
67
102
|
results: {
|
|
68
103
|
id: string;
|
|
69
104
|
}[];
|
|
105
|
+
}, unknown>;
|
|
106
|
+
}>;
|
|
107
|
+
export declare function createInterfaceTestServer(): McpServer<Record<never, import("../server/server.js").ToolDef<unknown, unknown, unknown>> & {
|
|
108
|
+
"interface-widget": import("../server/server.js").ToolDef<{
|
|
109
|
+
id: string;
|
|
110
|
+
}, {
|
|
111
|
+
itemName: string;
|
|
112
|
+
quantity: number;
|
|
113
|
+
}, {
|
|
114
|
+
processedBy: string;
|
|
115
|
+
version: number;
|
|
70
116
|
}>;
|
|
71
117
|
}>;
|
|
72
118
|
/**
|
package/dist/src/test/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vi } from "vitest";
|
|
2
|
+
import * as z from "zod";
|
|
2
3
|
import { McpServer } from "../server/server.js";
|
|
3
|
-
import { z } from "zod";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a real McpServer instance for testing
|
|
6
6
|
*/
|
|
@@ -11,17 +11,17 @@ export function createMockMcpServer() {
|
|
|
11
11
|
version: "0.0.1",
|
|
12
12
|
}, { capabilities: {} });
|
|
13
13
|
// Mock the underlying methods to track calls
|
|
14
|
-
const
|
|
14
|
+
const mockRegisterResource = vi.spyOn(server, "registerResource");
|
|
15
15
|
const mockRegisterTool = vi.spyOn(server, "registerTool");
|
|
16
16
|
return {
|
|
17
17
|
server,
|
|
18
|
-
|
|
18
|
+
mockRegisterResource,
|
|
19
19
|
mockRegisterTool,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function createTestServer() {
|
|
23
23
|
return new McpServer({ name: "test-app", version: "1.0.0" }, {})
|
|
24
|
-
.
|
|
24
|
+
.registerWidget("search-voyage", {}, {
|
|
25
25
|
description: "Search for voyages",
|
|
26
26
|
inputSchema: {
|
|
27
27
|
destination: z.string(),
|
|
@@ -45,7 +45,7 @@ export function createTestServer() {
|
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
47
|
})
|
|
48
|
-
.
|
|
48
|
+
.registerWidget("get-trip-details", {}, {
|
|
49
49
|
description: "Get trip details",
|
|
50
50
|
inputSchema: {
|
|
51
51
|
tripId: z.string(),
|
|
@@ -65,7 +65,7 @@ export function createTestServer() {
|
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
})
|
|
68
|
-
.
|
|
68
|
+
.registerWidget("no-input-widget", {}, {
|
|
69
69
|
description: "Widget with no input",
|
|
70
70
|
inputSchema: {},
|
|
71
71
|
outputSchema: {},
|
|
@@ -75,7 +75,7 @@ export function createTestServer() {
|
|
|
75
75
|
structuredContent: {},
|
|
76
76
|
};
|
|
77
77
|
})
|
|
78
|
-
.
|
|
78
|
+
.registerWidget("inferred-output-widget", {}, {
|
|
79
79
|
description: "Widget with output inferred from callback",
|
|
80
80
|
inputSchema: {
|
|
81
81
|
query: z.string(),
|
|
@@ -121,10 +121,68 @@ export function createTestServer() {
|
|
|
121
121
|
fetchedAt: "2024-01-01",
|
|
122
122
|
},
|
|
123
123
|
};
|
|
124
|
+
})
|
|
125
|
+
.registerWidget("widget-with-metadata", {}, {
|
|
126
|
+
description: "Widget that returns response metadata",
|
|
127
|
+
inputSchema: {
|
|
128
|
+
resourceId: z.string(),
|
|
129
|
+
},
|
|
130
|
+
}, async ({ resourceId }) => {
|
|
131
|
+
return {
|
|
132
|
+
content: [{ type: "text", text: `Resource: ${resourceId}` }],
|
|
133
|
+
structuredContent: {
|
|
134
|
+
data: { id: resourceId, loaded: true },
|
|
135
|
+
},
|
|
136
|
+
_meta: {
|
|
137
|
+
requestId: "req-123",
|
|
138
|
+
timestamp: 1704067200000,
|
|
139
|
+
cached: false,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
.registerTool("tool-with-metadata", {
|
|
144
|
+
description: "Tool that returns response metadata",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
query: z.string(),
|
|
147
|
+
},
|
|
148
|
+
}, async ({ query }) => {
|
|
149
|
+
return {
|
|
150
|
+
content: [{ type: "text", text: `Query: ${query}` }],
|
|
151
|
+
structuredContent: {
|
|
152
|
+
results: [query],
|
|
153
|
+
},
|
|
154
|
+
_meta: {
|
|
155
|
+
executionTime: 150,
|
|
156
|
+
source: "cache",
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
})
|
|
160
|
+
.registerWidget("widget-with-mixed-returns", {}, {
|
|
161
|
+
description: "Widget with mixed return paths (some with _meta, some without)",
|
|
162
|
+
inputSchema: {
|
|
163
|
+
shouldSucceed: z.boolean(),
|
|
164
|
+
},
|
|
165
|
+
}, async ({ shouldSucceed }) => {
|
|
166
|
+
if (!shouldSucceed) {
|
|
167
|
+
// Error path - no _meta
|
|
168
|
+
return {
|
|
169
|
+
content: [{ type: "text", text: "Error occurred" }],
|
|
170
|
+
structuredContent: { error: "Something went wrong" },
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
// Success path - has _meta
|
|
174
|
+
return {
|
|
175
|
+
content: [{ type: "text", text: "Success" }],
|
|
176
|
+
structuredContent: { data: "result" },
|
|
177
|
+
_meta: {
|
|
178
|
+
processedAt: 1704067200000,
|
|
179
|
+
region: "eu-west-1",
|
|
180
|
+
},
|
|
181
|
+
};
|
|
124
182
|
});
|
|
125
183
|
}
|
|
126
184
|
export function createMinimalTestServer() {
|
|
127
|
-
return new McpServer({ name: "test-app", version: "1.0.0" }, {}).
|
|
185
|
+
return new McpServer({ name: "test-app", version: "1.0.0" }, {}).registerWidget("search-voyage", {}, {
|
|
128
186
|
description: "Search for voyages",
|
|
129
187
|
inputSchema: {
|
|
130
188
|
destination: z.string(),
|
|
@@ -139,6 +197,26 @@ export function createMinimalTestServer() {
|
|
|
139
197
|
};
|
|
140
198
|
});
|
|
141
199
|
}
|
|
200
|
+
export function createInterfaceTestServer() {
|
|
201
|
+
return new McpServer({ name: "interface-test-app", version: "1.0.0" }, {}).registerWidget("interface-widget", {}, {
|
|
202
|
+
description: "Widget with interface-typed output",
|
|
203
|
+
inputSchema: {
|
|
204
|
+
id: z.string(),
|
|
205
|
+
},
|
|
206
|
+
}, async ({ id }) => {
|
|
207
|
+
return {
|
|
208
|
+
content: [{ type: "text", text: `Item ${id}` }],
|
|
209
|
+
structuredContent: {
|
|
210
|
+
itemName: "Test Item",
|
|
211
|
+
quantity: 42,
|
|
212
|
+
},
|
|
213
|
+
_meta: {
|
|
214
|
+
processedBy: "test",
|
|
215
|
+
version: 1,
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
}
|
|
142
220
|
/**
|
|
143
221
|
* Mock extra parameter for resource callback
|
|
144
222
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,mBAAmB;IAKjC,mCAAmC;IACnC,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;QACE,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,OAAO;KACjB,EACD,EAAE,YAAY,EAAE,EAAE,EAAE,CACrB,CAAC;IAEF,6CAA6C;IAC7C,MAAM,oBAAoB,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAClE,MAAM,gBAAgB,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAE1D,OAAO;QACL,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