@miragon/mcp-toolkit-core 0.10.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/framework/render-view.d.ts +1 -1
- package/dist/framework/render-view.d.ts.map +1 -1
- package/dist/framework/render-view.js +3 -0
- package/dist/framework/render-view.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/middleware/role-filter.d.ts +16 -32
- package/dist/middleware/role-filter.d.ts.map +1 -1
- package/dist/middleware/role-filter.js +10 -22
- package/dist/middleware/role-filter.js.map +1 -1
- package/dist/tools/backend-registry.d.ts +9 -3
- package/dist/tools/backend-registry.d.ts.map +1 -1
- package/dist/tools/backend-registry.js +13 -12
- package/dist/tools/backend-registry.js.map +1 -1
- package/dist/tools/create-framework-app.d.ts +51 -38
- package/dist/tools/create-framework-app.d.ts.map +1 -1
- package/dist/tools/create-framework-app.js +79 -78
- package/dist/tools/create-framework-app.js.map +1 -1
- package/dist/tools/index.d.ts +4 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/install-toolkit.d.ts +77 -0
- package/dist/tools/install-toolkit.d.ts.map +1 -0
- package/dist/tools/install-toolkit.js +85 -0
- package/dist/tools/install-toolkit.js.map +1 -0
- package/dist/tools/register-catalogue-tool.d.ts +1 -1
- package/dist/tools/register-catalogue-tool.d.ts.map +1 -1
- package/dist/tools/register-catalogue-tool.js +2 -3
- package/dist/tools/register-catalogue-tool.js.map +1 -1
- package/dist/tools/register-dashboard-tools.d.ts +1 -1
- package/dist/tools/register-dashboard-tools.d.ts.map +1 -1
- package/dist/tools/register-dashboard-tools.js +6 -6
- package/dist/tools/register-dashboard-tools.js.map +1 -1
- package/dist/tools/register-framework-tools.d.ts +15 -47
- package/dist/tools/register-framework-tools.d.ts.map +1 -1
- package/dist/tools/register-framework-tools.js +31 -63
- package/dist/tools/register-framework-tools.js.map +1 -1
- package/dist/tools/register-tool.d.ts +1 -1
- package/dist/tools/register-tool.d.ts.map +1 -1
- package/dist/tools/register-tool.js +14 -8
- package/dist/tools/register-tool.js.map +1 -1
- package/dist/tools/register-widget-tool.d.ts +35 -11
- package/dist/tools/register-widget-tool.d.ts.map +1 -1
- package/dist/tools/register-widget-tool.js +57 -30
- package/dist/tools/register-widget-tool.js.map +1 -1
- package/dist/tools/tool-results.d.ts +46 -0
- package/dist/tools/tool-results.d.ts.map +1 -0
- package/dist/tools/tool-results.js +39 -0
- package/dist/tools/tool-results.js.map +1 -0
- package/dist/tools/with-tool-errors.d.ts +12 -6
- package/dist/tools/with-tool-errors.d.ts.map +1 -1
- package/dist/tools/with-tool-errors.js +12 -6
- package/dist/tools/with-tool-errors.js.map +1 -1
- package/dist/types/app.d.ts +10 -7
- package/dist/types/app.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/meta.d.ts +73 -56
- package/dist/types/meta.d.ts.map +1 -1
- package/dist/types/meta.js +49 -53
- package/dist/types/meta.js.map +1 -1
- package/package.json +13 -6
- package/dist/tools/app-resource-uri.d.ts +0 -28
- package/dist/tools/app-resource-uri.d.ts.map +0 -1
- package/dist/tools/app-resource-uri.js +0 -30
- package/dist/tools/app-resource-uri.js.map +0 -1
- package/dist/tools/tool-call-name.d.ts +0 -53
- package/dist/tools/tool-call-name.d.ts.map +0 -1
- package/dist/tools/tool-call-name.js +0 -92
- package/dist/tools/tool-call-name.js.map +0 -1
|
@@ -1,110 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { StepRegistry } from "../registry/step-registry.js";
|
|
4
|
-
import { WidgetRegistry } from "../registry/widget-registry.js";
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { MCPServer, registerViews, } from "mcp-use";
|
|
5
3
|
import { createOrgGateMiddleware } from "../middleware/org-gate.js";
|
|
6
4
|
import { createRoleFilterMiddleware } from "../middleware/role-filter.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
import { installToolkit } from "./install-toolkit.js";
|
|
6
|
+
/**
|
|
7
|
+
* Read a bundle file, failing soft: a missing file logs a warning and yields
|
|
8
|
+
* an empty string so a dev server can boot before the first bundle build —
|
|
9
|
+
* matching the old missing-`htmlPath` behaviour. Views then render an empty
|
|
10
|
+
* document until the server restarts with a built bundle.
|
|
11
|
+
*/
|
|
12
|
+
async function readBundleFile(filePath, label) {
|
|
13
|
+
try {
|
|
14
|
+
return await fs.readFile(filePath, "utf-8");
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
console.warn(`[createFrameworkApp] could not read the app bundle ${label} at ${filePath}; ` +
|
|
18
|
+
`views will render empty until the bundle is built and the server restarts.`);
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
17
22
|
export async function createFrameworkApp(options) {
|
|
23
|
+
// `baseUrl` is deliberately absent: mcp-use 2.x resolves the serving origin
|
|
24
|
+
// from the request (or the MCP_URL env var) and injects it into the view
|
|
25
|
+
// resource CSP itself.
|
|
18
26
|
const baseConfig = {
|
|
19
27
|
name: options.name,
|
|
20
28
|
version: options.version ?? "0.1.0",
|
|
21
29
|
description: options.description,
|
|
22
30
|
host: options.host ?? "localhost",
|
|
23
|
-
baseUrl: options.baseUrl,
|
|
24
31
|
};
|
|
25
32
|
// `serverOptions` is statically disjoint from `baseConfig` (its type Omits
|
|
26
33
|
// every toolkit-owned key); the spread order is defense-in-depth so the
|
|
27
34
|
// toolkit's first-class options always win at runtime.
|
|
35
|
+
// `ServerConfig<TUser>` is conditional on TUser (`[TUser] extends [never]`
|
|
36
|
+
// selects between `oauth?: undefined` and a required `oauth`). TypeScript
|
|
37
|
+
// cannot evaluate that against a still-generic TUser inside this
|
|
38
|
+
// implementation signature, so the constructor arg is cast here. The two
|
|
39
|
+
// public overloads above are what callers see, and they carry the real
|
|
40
|
+
// guarantee.
|
|
28
41
|
const server = options.oauth
|
|
29
|
-
? new MCPServer({
|
|
42
|
+
? new MCPServer({
|
|
43
|
+
...options.serverOptions,
|
|
44
|
+
...baseConfig,
|
|
45
|
+
oauth: options.oauth,
|
|
46
|
+
})
|
|
30
47
|
: new MCPServer({ ...options.serverOptions, ...baseConfig });
|
|
48
|
+
// The registrars are typed against the OAuth-less `MCPServer`; a
|
|
49
|
+
// `MCPServer<TUser>` differs only in the `ctx.auth` its callbacks receive,
|
|
50
|
+
// which none of them read.
|
|
51
|
+
const serverForRegistrars = server;
|
|
52
|
+
// Collect every view name bound during boot so the registry can be primed
|
|
53
|
+
// once at the end (mcp-use accepts `view` bindings before priming — they
|
|
54
|
+
// are validated lazily — but priming itself is one-shot and must happen
|
|
55
|
+
// before the first request). Every bound name resolves to the shared app
|
|
56
|
+
// bundle: that IS the toolkit's architecture — one bundle whose widget map
|
|
57
|
+
// decides what renders. Wrapping `server.tool` covers plugin registrations
|
|
58
|
+
// without an API change; `never` keeps the checked assignment sound under
|
|
59
|
+
// parameter contravariance (the wrapper only forwards the callback).
|
|
60
|
+
const boundViews = new Set();
|
|
61
|
+
const originalTool = serverForRegistrars.tool.bind(serverForRegistrars);
|
|
62
|
+
const wrappedTool = (definition, callback) => {
|
|
63
|
+
if (definition.view?.name)
|
|
64
|
+
boundViews.add(definition.view.name);
|
|
65
|
+
return originalTool(definition, callback);
|
|
66
|
+
};
|
|
67
|
+
serverForRegistrars.tool = wrappedTool;
|
|
31
68
|
const orgGateId = options.middleware?.orgGate;
|
|
32
69
|
if (orgGateId) {
|
|
70
|
+
// The middleware is typed structurally on purpose so it stays host-
|
|
71
|
+
// agnostic; mcp-use 2.x types `ctx.auth` as its own `AuthInfo`, which is
|
|
72
|
+
// not mutually assignable with that shape. Only `auth.user` is read.
|
|
33
73
|
server.use("mcp:*", createOrgGateMiddleware(orgGateId));
|
|
34
74
|
}
|
|
35
|
-
// Capture the `tools/call` tool name from the JSON-RPC envelope at the HTTP
|
|
36
|
-
// layer. mcp-use 1.28 populates `mcp:tools/call` middleware's `ctx.params`
|
|
37
|
-
// with the tool *arguments*, not `{ name, arguments }`, so the role filter
|
|
38
|
-
// can't read the name from there. The resolver is request-scoped via
|
|
39
|
-
// `getRequestContext()` and is safe to install unconditionally.
|
|
40
|
-
const resolveToolName = installToolCallNameCapture(server);
|
|
41
75
|
const roleFilter = options.middleware?.roleFilter;
|
|
42
76
|
if (roleFilter && Object.keys(roleFilter).length > 0) {
|
|
43
77
|
const { toolsList, toolsCall } = createRoleFilterMiddleware(roleFilter, {
|
|
44
|
-
resolveToolName,
|
|
45
|
-
// Batch-aware: a JSON-RPC batch envelope can carry several tools/call
|
|
46
|
-
// requests; the guard must check all of them, not just the first.
|
|
47
|
-
resolveToolNames: resolveToolName.all,
|
|
48
78
|
failClosed: options.middleware?.roleFilterFailClosed ?? false,
|
|
49
79
|
});
|
|
80
|
+
// Cast for the same reason as the org gate above.
|
|
50
81
|
server.use("mcp:tools/list", toolsList);
|
|
51
82
|
server.use("mcp:tools/call", toolsCall);
|
|
52
83
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
for (const plugin of allPlugins) {
|
|
60
|
-
plugin.registerTools?.(server);
|
|
61
|
-
}
|
|
62
|
-
// Per-app step configuration: each plugin's `appConfig` keyed by app name.
|
|
63
|
-
// A plugin may inject closures here (e.g. a typed `callTool`) — the pipeline
|
|
64
|
-
// executor pre-binds the per-request user context on any `callTool` it finds
|
|
65
|
-
// (see `pipeline-executor.ts:bindAppConfig`).
|
|
66
|
-
const appConfigs = Object.fromEntries(allPlugins.map((p) => [p.definition.name, p.appConfig ?? {}]));
|
|
67
|
-
const appConfig = options.appConfig ?? {
|
|
68
|
-
activeApps: allPlugins.map((p) => ({ app: p.definition.name, config: {} })),
|
|
69
|
-
pipelines: {},
|
|
70
|
-
};
|
|
71
|
-
// Derive a content-hashed resource URI when one isn't pinned, so each build
|
|
72
|
-
// busts the host's widget-bundle cache (a fixed URI would keep serving a
|
|
73
|
-
// stale bundle across restarts). `deriveAppResourceUri` warns and falls back
|
|
74
|
-
// to a stable dev URI when the bundle file is missing.
|
|
75
|
-
const resourceUri = options.app.resourceUri ??
|
|
76
|
-
deriveAppResourceUri({ appName: options.name, htmlPath: options.app.htmlPath });
|
|
77
|
-
registerFrameworkTools(server, {
|
|
78
|
-
stepRegistry,
|
|
79
|
-
widgetRegistry,
|
|
80
|
-
config: appConfig,
|
|
81
|
-
appConfigs,
|
|
82
|
-
plugins: allPlugins,
|
|
83
|
-
resourceUri,
|
|
84
|
-
htmlPath: options.app.htmlPath,
|
|
84
|
+
// Everything toolkit-owned goes through the same core `installToolkit`
|
|
85
|
+
// uses standalone — this wrapper only adds server construction, middleware
|
|
86
|
+
// wiring, and the inline bundle priming below. Anything the wrapper can do
|
|
87
|
+
// must work through `installToolkit` on a user-owned server too.
|
|
88
|
+
installToolkit(serverForRegistrars, {
|
|
89
|
+
modules: options.plugins,
|
|
85
90
|
refreshToolName: options.app.refreshToolName,
|
|
86
|
-
// Advertise builder availability in the view payload so the iframe shell
|
|
87
|
-
// shows its Build affordance only when the catalogue/dashboard tools below
|
|
88
|
-
// are actually registered.
|
|
89
|
-
builderAvailable: options.app.builder ?? false,
|
|
90
|
-
// Feeds the widget-resource CSP (`_meta.ui.csp` + `openai/widgetCSP`):
|
|
91
|
-
// the baseUrl origin is auto-injected next to any explicit `app.csp`.
|
|
92
|
-
baseUrl: options.baseUrl,
|
|
93
91
|
csp: options.app.csp,
|
|
92
|
+
builder: options.app.builder,
|
|
93
|
+
catalogueToolName: options.app.catalogueToolName,
|
|
94
|
+
dashboardStore: options.app.dashboardStore,
|
|
95
|
+
appConfig: options.appConfig,
|
|
94
96
|
});
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
registerDashboardTools(server, { store: dashboardStore, widgetRegistry });
|
|
97
|
+
// Prime the view registry LAST, once every registrar and plugin has bound
|
|
98
|
+
// its views. One inline entry per bound name, all sharing the same bundle
|
|
99
|
+
// strings — mcp-use synthesizes the view document, serves the resource, and
|
|
100
|
+
// emits the `_meta.ui` wire keys (CSP included) from here on.
|
|
101
|
+
if (boundViews.size > 0) {
|
|
102
|
+
const js = await readBundleFile(options.app.bundle.jsPath, "module");
|
|
103
|
+
const css = options.app.bundle.cssPath
|
|
104
|
+
? await readBundleFile(options.app.bundle.cssPath, "stylesheet")
|
|
105
|
+
: "";
|
|
106
|
+
const entry = { kind: "inline", js, css };
|
|
107
|
+
const manifest = Object.fromEntries([...boundViews].map((name) => [name, entry]));
|
|
108
|
+
serverForRegistrars[registerViews](manifest);
|
|
108
109
|
}
|
|
109
110
|
return server;
|
|
110
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-framework-app.js","sourceRoot":"","sources":["../../src/tools/create-framework-app.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-framework-app.js","sourceRoot":"","sources":["../../src/tools/create-framework-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,EACL,SAAS,EACT,aAAa,GAId,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAIzE,OAAO,EAAE,cAAc,EAAE,MAAM,s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getToolRegistrar } from "./register-widget-tool.js";
|
|
4
4
|
export type { WidgetToolConfig, WidgetToolVisibility } from "./register-widget-tool.js";
|
|
5
5
|
export { withToolErrors } from "./with-tool-errors.js";
|
|
6
|
-
export {
|
|
6
|
+
export { textResult, objectResult, errorResult } from "./tool-results.js";
|
|
7
|
+
export { registerFrameworkTools, RENDER_VIEW_NAME } from "./register-framework-tools.js";
|
|
7
8
|
export type { RegisterFrameworkToolsOptions, AppResourceCsp } from "./register-framework-tools.js";
|
|
8
9
|
export { registerCatalogueTool } from "./register-catalogue-tool.js";
|
|
9
10
|
export type { RegisterCatalogueToolOptions } from "./register-catalogue-tool.js";
|
|
10
11
|
export { registerDashboardTools } from "./register-dashboard-tools.js";
|
|
11
12
|
export type { RegisterDashboardToolsOptions } from "./register-dashboard-tools.js";
|
|
13
|
+
export { installToolkit } from "./install-toolkit.js";
|
|
14
|
+
export type { InstallToolkitOptions, InstalledToolkit } from "./install-toolkit.js";
|
|
12
15
|
export { createFrameworkApp } from "./create-framework-app.js";
|
|
13
16
|
export type { CreateFrameworkAppOptions } from "./create-framework-app.js";
|
|
14
|
-
export { deriveAppResourceUri } from "./app-resource-uri.js";
|
|
15
|
-
export type { DeriveAppResourceUriInput } from "./app-resource-uri.js";
|
|
16
17
|
export { createBackendRegistry, withBackend, BackendNotSelectedError, UnknownBackendError, DEFAULT_BACKEND_SESSION_TTL_MS, } from "./backend-registry.js";
|
|
17
18
|
export type { BackendRegistry, BackendEntry, ResolvedBackend, CreateBackendRegistryOptions, } from "./backend-registry.js";
|
|
18
|
-
export { installToolCallNameCapture, extractToolCallName, extractToolCallNames, } from "./tool-call-name.js";
|
|
19
|
-
export type { ToolNameResolver, ToolNameCapture } from "./tool-call-name.js";
|
|
20
19
|
export { createInMemoryDashboardStore, createFileSystemDashboardStore, DashboardOwnershipError, resolveSavedRecord, parseDashboardRecord, DASHBOARD_SCHEMA_VERSION, } from "../framework/dashboard-store.js";
|
|
21
20
|
export type { DashboardStore, DashboardRecord, DashboardSaveInput, DashboardSummary, DashboardListFilter, FileSystemDashboardStoreOptions, } from "../framework/dashboard-store.js";
|
|
22
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AACrE,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AACrE,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACxF,YAAY,EAAE,6BAA6B,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,YAAY,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,YAAY,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EACV,eAAe,EACf,YAAY,EACZ,eAAe,EACf,4BAA4B,GAC7B,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,iCAAiC,CAAA"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { createToolRegistrar } from "./register-tool.js";
|
|
2
2
|
export { createWidgetToolRegistrar } from "./register-widget-tool.js";
|
|
3
3
|
export { withToolErrors } from "./with-tool-errors.js";
|
|
4
|
-
export {
|
|
4
|
+
export { textResult, objectResult, errorResult } from "./tool-results.js";
|
|
5
|
+
export { registerFrameworkTools, RENDER_VIEW_NAME } from "./register-framework-tools.js";
|
|
5
6
|
export { registerCatalogueTool } from "./register-catalogue-tool.js";
|
|
6
7
|
export { registerDashboardTools } from "./register-dashboard-tools.js";
|
|
8
|
+
export { installToolkit } from "./install-toolkit.js";
|
|
7
9
|
export { createFrameworkApp } from "./create-framework-app.js";
|
|
8
|
-
export { deriveAppResourceUri } from "./app-resource-uri.js";
|
|
9
10
|
export { createBackendRegistry, withBackend, BackendNotSelectedError, UnknownBackendError, DEFAULT_BACKEND_SESSION_TTL_MS, } from "./backend-registry.js";
|
|
10
|
-
export { installToolCallNameCapture, extractToolCallName, extractToolCallNames, } from "./tool-call-name.js";
|
|
11
11
|
// Dashboard-store implementations are server-side (the filesystem impl
|
|
12
12
|
// imports `node:fs`). Consumers wire them through `createFrameworkApp`'s
|
|
13
13
|
// `app.dashboardStore`.
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAExF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,uBAAuB,CAAA;AAQ9B,uEAAuE;AACvE,yEAAyE;AACzE,wBAAwB;AACxB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type MCPServer } from "mcp-use";
|
|
2
|
+
import { StepRegistry } from "../registry/step-registry.js";
|
|
3
|
+
import { WidgetRegistry } from "../registry/widget-registry.js";
|
|
4
|
+
import { type DashboardStore } from "../framework/dashboard-store.js";
|
|
5
|
+
import type { AppConfig, AppDefinition, AppPlugin } from "../types/index.js";
|
|
6
|
+
import type { AppResourceCsp } from "../types/meta.js";
|
|
7
|
+
export interface InstallToolkitOptions {
|
|
8
|
+
/**
|
|
9
|
+
* App definitions contributing steps + widgets to the pipeline registries —
|
|
10
|
+
* the lightweight input when all a project wants is `render-view` and the
|
|
11
|
+
* composition features on top of its own tools. For modules that also
|
|
12
|
+
* register tools of their own, use {@link modules}.
|
|
13
|
+
*/
|
|
14
|
+
apps?: AppDefinition[];
|
|
15
|
+
/**
|
|
16
|
+
* Full module bundles ({@link AppPlugin}): an app definition plus optional
|
|
17
|
+
* `registerTools` / `registerWidgetTools` hooks and per-app step config.
|
|
18
|
+
* `registerTools` runs before the framework tools, `registerWidgetTools`
|
|
19
|
+
* inside them (receiving the CSP meta defaults).
|
|
20
|
+
*/
|
|
21
|
+
modules?: AppPlugin[];
|
|
22
|
+
/** Override the refresh tool name (default: `refresh-view`). */
|
|
23
|
+
refreshToolName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Additional CSP origins advertised on the view resources (`_meta.ui.csp`)
|
|
26
|
+
* and widget tools (`openai/widgetCSP`). The server origin is appended by
|
|
27
|
+
* mcp-use itself at emission time.
|
|
28
|
+
*/
|
|
29
|
+
csp?: AppResourceCsp;
|
|
30
|
+
/**
|
|
31
|
+
* Opt into the visual in-iframe builder platform: registers
|
|
32
|
+
* `get-builder-catalogue` plus the dashboard CRUD quartet, and advertises
|
|
33
|
+
* `builderAvailable` in every view payload. Defaults to `false` (lean).
|
|
34
|
+
*/
|
|
35
|
+
builder?: boolean;
|
|
36
|
+
/** Override the catalogue tool name; only relevant with {@link builder}. */
|
|
37
|
+
catalogueToolName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Persistence for the dashboard CRUD tools; defaults to an in-memory store.
|
|
40
|
+
* Only relevant with {@link builder}.
|
|
41
|
+
*/
|
|
42
|
+
dashboardStore?: DashboardStore;
|
|
43
|
+
/** Overrides the active-apps/pipelines config derived from apps + modules. */
|
|
44
|
+
appConfig?: AppConfig;
|
|
45
|
+
}
|
|
46
|
+
/** The registries {@link installToolkit} built — for advanced composition. */
|
|
47
|
+
export interface InstalledToolkit {
|
|
48
|
+
stepRegistry: StepRegistry;
|
|
49
|
+
widgetRegistry: WidgetRegistry;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Install the toolkit's composition features on an existing `MCPServer` —
|
|
53
|
+
* the "standard mcp-use project, toolkit on top" entry point.
|
|
54
|
+
*
|
|
55
|
+
* The server stays yours: you construct it, register your own tools and
|
|
56
|
+
* middleware, run it through the mcp-use CLI (`mcp-use dev` / `build` /
|
|
57
|
+
* `start`) or embed it yourself. This call adds the framework surface on
|
|
58
|
+
* top: `get-framework-manifest`, `render-view` (bound to its own view),
|
|
59
|
+
* the app-only `refresh-view`, each module's widget tools, and — with
|
|
60
|
+
* `builder: true` — the catalogue + dashboard tools.
|
|
61
|
+
*
|
|
62
|
+
* View delivery follows however the server is run:
|
|
63
|
+
*
|
|
64
|
+
* - **mcp-use CLI** (the standard path): create `views/render-view/view.tsx`
|
|
65
|
+
* (plus `views/<tool>/view.tsx` per model-visible widget tool) rendering
|
|
66
|
+
* `McpToolkitApp` with the widget map — the CLI discovers, builds, and
|
|
67
|
+
* serves them by convention; nothing to wire here.
|
|
68
|
+
* - **Own process with an own bundle**: use `createFrameworkApp`, the
|
|
69
|
+
* batteries-included wrapper that composes this function with server
|
|
70
|
+
* construction and inline bundle priming.
|
|
71
|
+
*
|
|
72
|
+
* A half-wired setup cannot fail silently: mcp-use validates at mount (first
|
|
73
|
+
* request) that every `view`-bound tool has a primed view, and rejects with a
|
|
74
|
+
* message pointing at the CLI otherwise.
|
|
75
|
+
*/
|
|
76
|
+
export declare function installToolkit(server: MCPServer, options?: InstallToolkitOptions): InstalledToolkit;
|
|
77
|
+
//# sourceMappingURL=install-toolkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-toolkit.d.ts","sourceRoot":"","sources":["../../src/tools/install-toolkit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAKtD,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,EAAE,CAAA;IACtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,CAAA;IACrB,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,YAAY,CAAA;IAC1B,cAAc,EAAE,cAAc,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,qBAA0B,GAClC,gBAAgB,CA6DlB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { loadApps } from "../registry/app-loader.js";
|
|
2
|
+
import { StepRegistry } from "../registry/step-registry.js";
|
|
3
|
+
import { WidgetRegistry } from "../registry/widget-registry.js";
|
|
4
|
+
import { createInMemoryDashboardStore } from "../framework/dashboard-store.js";
|
|
5
|
+
import { registerFrameworkTools } from "./register-framework-tools.js";
|
|
6
|
+
import { registerCatalogueTool } from "./register-catalogue-tool.js";
|
|
7
|
+
import { registerDashboardTools } from "./register-dashboard-tools.js";
|
|
8
|
+
/**
|
|
9
|
+
* Install the toolkit's composition features on an existing `MCPServer` —
|
|
10
|
+
* the "standard mcp-use project, toolkit on top" entry point.
|
|
11
|
+
*
|
|
12
|
+
* The server stays yours: you construct it, register your own tools and
|
|
13
|
+
* middleware, run it through the mcp-use CLI (`mcp-use dev` / `build` /
|
|
14
|
+
* `start`) or embed it yourself. This call adds the framework surface on
|
|
15
|
+
* top: `get-framework-manifest`, `render-view` (bound to its own view),
|
|
16
|
+
* the app-only `refresh-view`, each module's widget tools, and — with
|
|
17
|
+
* `builder: true` — the catalogue + dashboard tools.
|
|
18
|
+
*
|
|
19
|
+
* View delivery follows however the server is run:
|
|
20
|
+
*
|
|
21
|
+
* - **mcp-use CLI** (the standard path): create `views/render-view/view.tsx`
|
|
22
|
+
* (plus `views/<tool>/view.tsx` per model-visible widget tool) rendering
|
|
23
|
+
* `McpToolkitApp` with the widget map — the CLI discovers, builds, and
|
|
24
|
+
* serves them by convention; nothing to wire here.
|
|
25
|
+
* - **Own process with an own bundle**: use `createFrameworkApp`, the
|
|
26
|
+
* batteries-included wrapper that composes this function with server
|
|
27
|
+
* construction and inline bundle priming.
|
|
28
|
+
*
|
|
29
|
+
* A half-wired setup cannot fail silently: mcp-use validates at mount (first
|
|
30
|
+
* request) that every `view`-bound tool has a primed view, and rejects with a
|
|
31
|
+
* message pointing at the CLI otherwise.
|
|
32
|
+
*/
|
|
33
|
+
export function installToolkit(server, options = {}) {
|
|
34
|
+
const stepRegistry = new StepRegistry();
|
|
35
|
+
const widgetRegistry = new WidgetRegistry();
|
|
36
|
+
const apps = options.apps ?? [];
|
|
37
|
+
const modules = options.modules ?? [];
|
|
38
|
+
// Step/widget ids are author-controlled, so a collision is a real bug and
|
|
39
|
+
// must fail loud (hard throw).
|
|
40
|
+
loadApps([...apps, ...modules.map((m) => m.definition)], stepRegistry, widgetRegistry);
|
|
41
|
+
for (const module of modules) {
|
|
42
|
+
module.registerTools?.(server);
|
|
43
|
+
}
|
|
44
|
+
// Per-app step configuration: each module's `appConfig` keyed by app name.
|
|
45
|
+
// A module may inject closures here (e.g. a typed `callTool`) — the pipeline
|
|
46
|
+
// executor pre-binds the per-request user context on any `callTool` it finds
|
|
47
|
+
// (see `pipeline-executor.ts:bindAppConfig`).
|
|
48
|
+
const appConfigs = Object.fromEntries(modules.map((m) => [m.definition.name, m.appConfig ?? {}]));
|
|
49
|
+
const appConfig = options.appConfig ?? {
|
|
50
|
+
activeApps: [
|
|
51
|
+
...apps.map((a) => ({ app: a.name, config: {} })),
|
|
52
|
+
...modules.map((m) => ({ app: m.definition.name, config: {} })),
|
|
53
|
+
],
|
|
54
|
+
pipelines: {},
|
|
55
|
+
};
|
|
56
|
+
registerFrameworkTools(server, {
|
|
57
|
+
stepRegistry,
|
|
58
|
+
widgetRegistry,
|
|
59
|
+
config: appConfig,
|
|
60
|
+
appConfigs,
|
|
61
|
+
plugins: modules,
|
|
62
|
+
refreshToolName: options.refreshToolName,
|
|
63
|
+
// Advertise builder availability in the view payload so the iframe shell
|
|
64
|
+
// shows its Build affordance only when the catalogue/dashboard tools below
|
|
65
|
+
// are actually registered.
|
|
66
|
+
builderAvailable: options.builder ?? false,
|
|
67
|
+
csp: options.csp,
|
|
68
|
+
});
|
|
69
|
+
// The visual builder platform is opt-in: the catalogue (its data source)
|
|
70
|
+
// and the dashboard CRUD tools (its persistence) are registered together
|
|
71
|
+
// only when `builder` is true. Lean servers leave it off so render-view /
|
|
72
|
+
// the widget core stay the entire surface.
|
|
73
|
+
if (options.builder) {
|
|
74
|
+
registerCatalogueTool(server, {
|
|
75
|
+
stepRegistry,
|
|
76
|
+
widgetRegistry,
|
|
77
|
+
appConfigs,
|
|
78
|
+
toolName: options.catalogueToolName,
|
|
79
|
+
});
|
|
80
|
+
const dashboardStore = options.dashboardStore ?? createInMemoryDashboardStore();
|
|
81
|
+
registerDashboardTools(server, { store: dashboardStore, widgetRegistry });
|
|
82
|
+
}
|
|
83
|
+
return { stepRegistry, widgetRegistry };
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=install-toolkit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-toolkit.js","sourceRoot":"","sources":["../../src/tools/install-toolkit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,4BAA4B,EAAuB,MAAM,iCAAiC,CAAA;AAGnG,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAgDtE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,cAAc,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E,EAAE;KACd,CAAA;IAED,sBAAsB,CAAC,MAAM,EAAE;QAC7B,YAAY;QACZ,cAAc;QACd,MAAM,EAAE,SAAS;QACjB,UAAU;QACV,OAAO,EAAE,OAAO;QAChB,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,yEAAyE;QACzE,2EAA2E;QAC3E,2BAA2B;QAC3B,gBAAgB,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;QAC1C,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAA;IAEF,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,2CAA2C;IAC3C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,qBAAqB,CAAC,MAAM,EAAE;YAC5B,YAAY;YACZ,cAAc;YACd,UAAU;YACV,QAAQ,EAAE,OAAO,CAAC,iBAAiB;SACpC,CAAC,CAAA;QAEF,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,4BAA4B,EAAE,CAAA;QAC/E,sBAAsB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAA;AACzC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MCPServer } from "mcp-use
|
|
1
|
+
import { type MCPServer } from "mcp-use";
|
|
2
2
|
import type { StepRegistry } from "../registry/step-registry.js";
|
|
3
3
|
import type { WidgetRegistry } from "../registry/widget-registry.js";
|
|
4
4
|
export interface RegisterCatalogueToolOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-catalogue-tool.d.ts","sourceRoot":"","sources":["../../src/tools/register-catalogue-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"register-catalogue-tool.d.ts","sourceRoot":"","sources":["../../src/tools/register-catalogue-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,YAAY,CAAA;IAC1B,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACnD,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,4BAA4B,GACpC,IAAI,CAsBN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getBuilderCatalogue } from "../framework/catalogue.js";
|
|
3
|
-
import { APP_ONLY_META } from "../types/meta.js";
|
|
4
3
|
const stepRefSchema = z.object({
|
|
5
4
|
id: z.string(),
|
|
6
5
|
step: z.string(),
|
|
@@ -30,8 +29,8 @@ export function registerCatalogueTool(server, options) {
|
|
|
30
29
|
name: toolName,
|
|
31
30
|
title: "Get Builder Catalogue",
|
|
32
31
|
description: "App-only. Returns the live pipeline context plus the reachable / unreachable widgets, available steps and key catalogue for the current keys + steps. Used by the in-iframe LayoutBuilder.",
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
inputSchema: catalogueSchema,
|
|
33
|
+
visibility: "app",
|
|
35
34
|
}, async (params, ctx) => {
|
|
36
35
|
return getBuilderCatalogue({
|
|
37
36
|
input: { keys: params.keys, steps: params.steps },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-catalogue-tool.js","sourceRoot":"","sources":["../../src/tools/register-catalogue-tool.ts"],"names":[],"mappings":"AACA,OA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QAC9B,WAAW,EACT,4LAA4L;QAC9L,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,KAAK;KAClB,EACD,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QACpB,OAAO,mBAAmB,CAAC;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;YACjD,YAAY;YACZ,cAAc;YACd,UAAU;YACV,GAAG,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE;SACpC,CAAC,CAAA;IACJ,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MCPServer } from "mcp-use
|
|
1
|
+
import { type MCPServer } from "mcp-use";
|
|
2
2
|
import type { DashboardStore } from "../framework/dashboard-store.js";
|
|
3
3
|
import type { WidgetRegistry } from "../registry/widget-registry.js";
|
|
4
4
|
export interface RegisterDashboardToolsOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-dashboard-tools.d.ts","sourceRoot":"","sources":["../../src/tools/register-dashboard-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"register-dashboard-tools.d.ts","sourceRoot":"","sources":["../../src/tools/register-dashboard-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,cAAc,CAAA;IACrB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AA8BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,6BAA6B,GACrC,IAAI,CA0HN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { object } from "mcp-use/server";
|
|
2
1
|
import { z } from "zod";
|
|
2
|
+
import { objectResult } from "./tool-results.js";
|
|
3
3
|
import { collectLayoutWidgets } from "../framework/view-builders.js";
|
|
4
4
|
import { layoutSchema } from "../framework/layout-schemas.js";
|
|
5
5
|
const stepRefSchema = z.object({
|
|
@@ -49,7 +49,7 @@ export function registerDashboardTools(server, options) {
|
|
|
49
49
|
name: "save-dashboard",
|
|
50
50
|
title: "Save Dashboard",
|
|
51
51
|
description: "Persists a dashboard (render-view input bundle + name). Pass an existing `id` to update, omit to create. The builder UI's Save button invokes this tool.",
|
|
52
|
-
|
|
52
|
+
inputSchema: saveSchema,
|
|
53
53
|
}, async (params, ctx) => {
|
|
54
54
|
// Warn (never reject) on unknown widget ids — usually a typo. A save is
|
|
55
55
|
// deliberately never blocked on a cosmetic layout mistake; the unknown
|
|
@@ -91,13 +91,13 @@ export function registerDashboardTools(server, options) {
|
|
|
91
91
|
annotations: { readOnlyHint: true },
|
|
92
92
|
}, async (_params, ctx) => {
|
|
93
93
|
const items = await store.list({ userId: extractUserId(ctx) });
|
|
94
|
-
return
|
|
94
|
+
return objectResult({ items });
|
|
95
95
|
});
|
|
96
96
|
server.tool({
|
|
97
97
|
name: "load-dashboard",
|
|
98
98
|
title: "Load Dashboard",
|
|
99
99
|
description: "Returns the full dashboard bundle. The returned `{ keys, steps, layout, title }` fields can be handed straight to `render-view`.",
|
|
100
|
-
|
|
100
|
+
inputSchema: idSchema,
|
|
101
101
|
annotations: { readOnlyHint: true },
|
|
102
102
|
}, async ({ id }, ctx) => {
|
|
103
103
|
const record = await store.get(id, { userId: extractUserId(ctx) });
|
|
@@ -125,13 +125,13 @@ export function registerDashboardTools(server, options) {
|
|
|
125
125
|
isError: true,
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return objectResult(record);
|
|
129
129
|
});
|
|
130
130
|
server.tool({
|
|
131
131
|
name: "delete-dashboard",
|
|
132
132
|
title: "Delete Dashboard",
|
|
133
133
|
description: "Permanently removes a dashboard by id.",
|
|
134
|
-
|
|
134
|
+
inputSchema: idSchema,
|
|
135
135
|
}, async ({ id }, ctx) => {
|
|
136
136
|
const deleted = await store.delete(id, { userId: extractUserId(ctx) });
|
|
137
137
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-dashboard-tools.js","sourceRoot":"","sources":["../../src/tools/register-dashboard-tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"register-dashboard-tools.js","sourceRoot":"","sources":["../../src/tools/register-dashboard-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAc7D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+DAA+D,CAAC;IAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IAC1E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,E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