@miragon/mcp-toolkit-core 1.2.0 → 2.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 +1 -1
- package/dist/tools/backend-registry.d.ts +22 -60
- package/dist/tools/backend-registry.d.ts.map +1 -1
- package/dist/tools/backend-registry.js +13 -82
- package/dist/tools/backend-registry.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Published to the public npm registry under the `@miragon` scope — no `.npmrc`
|
|
|
9
9
|
or token needed.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
pnpm add @miragon/mcp-toolkit-core mcp-use@2.
|
|
12
|
+
pnpm add @miragon/mcp-toolkit-core mcp-use@2.2.3 zod@4.4.3
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Peer versions are pinned exactly — install the versions above.
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default backend-selection TTL: how long a session's sticky pick survives
|
|
3
|
-
* without being re-set. `mcp-use` exposes no session-close hook to plugins, so
|
|
4
|
-
* without eviction the per-session selection map would grow with every MCP
|
|
5
|
-
* session that ever selected a backend. 24h comfortably outlives any real
|
|
6
|
-
* session.
|
|
7
|
-
*/
|
|
8
|
-
export declare const DEFAULT_BACKEND_SESSION_TTL_MS: number;
|
|
9
1
|
/** A single addressable backend: a stable `id`, its `client`, and free-form `meta`. */
|
|
10
2
|
export interface BackendEntry<TClient, TMeta = undefined> {
|
|
11
3
|
id: string;
|
|
@@ -19,47 +11,27 @@ export interface ResolvedBackend<TClient, TMeta = undefined> {
|
|
|
19
11
|
meta: TMeta | undefined;
|
|
20
12
|
}
|
|
21
13
|
export interface CreateBackendRegistryOptions {
|
|
22
|
-
/** Sticky-selection TTL in ms (default: {@link DEFAULT_BACKEND_SESSION_TTL_MS}). */
|
|
23
|
-
sessionTtlMs?: number;
|
|
24
14
|
/**
|
|
25
|
-
* Noun used in error messages
|
|
26
|
-
*
|
|
27
|
-
* `"backend"`.
|
|
15
|
+
* Noun used in error messages, e.g. `"engine"` → "No engine specified."
|
|
16
|
+
* Defaults to `"backend"`.
|
|
28
17
|
*/
|
|
29
18
|
label?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Resolves the current MCP session id, which keys the sticky per-session
|
|
32
|
-
* backend selection.
|
|
33
|
-
*
|
|
34
|
-
* **Required for multi-backend sticky selection since mcp-use 2.x.** The
|
|
35
|
-
* default returns `undefined` (see {@link defaultGetSessionId}), which makes
|
|
36
|
-
* every call fall back to the single default backend. Pass a resolver that
|
|
37
|
-
* reads the session off your tool handler's context —
|
|
38
|
-
* `(ctx) => ctx.session?.sessionId` — or off whatever your host keys
|
|
39
|
-
* sessions by.
|
|
40
|
-
*/
|
|
41
|
-
getSessionId?: () => string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Clock used for TTL bookkeeping, in ms. Defaults to `Date.now`. Injectable
|
|
44
|
-
* so tests can drive eviction deterministically.
|
|
45
|
-
*/
|
|
46
|
-
now?: () => number;
|
|
47
19
|
}
|
|
48
20
|
/**
|
|
49
|
-
* Thrown when a tool is invoked
|
|
50
|
-
*
|
|
21
|
+
* Thrown when a tool is invoked without an explicit backend id and the
|
|
22
|
+
* registry holds more than one backend.
|
|
51
23
|
*
|
|
52
24
|
* The message lists the available ids because the error path commonly only
|
|
53
25
|
* serialises `code` + `message` (the structured `availableIds` field may not
|
|
54
26
|
* reach the model) — naming them saves the model a discovery roundtrip before
|
|
55
|
-
* it can pick one
|
|
27
|
+
* it can pick one.
|
|
56
28
|
*/
|
|
57
29
|
export declare class BackendNotSelectedError extends Error {
|
|
58
30
|
readonly code: "BACKEND_NOT_SELECTED";
|
|
59
31
|
readonly availableIds: string[];
|
|
60
32
|
constructor(availableIds: string[], label: string);
|
|
61
33
|
}
|
|
62
|
-
/** Thrown when an
|
|
34
|
+
/** Thrown when an explicit id names a backend that isn't registered. */
|
|
63
35
|
export declare class UnknownBackendError extends Error {
|
|
64
36
|
readonly code: "UNKNOWN_BACKEND";
|
|
65
37
|
readonly requestedId: string;
|
|
@@ -67,37 +39,27 @@ export declare class UnknownBackendError extends Error {
|
|
|
67
39
|
constructor(requestedId: string, availableIds: string[], label: string);
|
|
68
40
|
}
|
|
69
41
|
/**
|
|
70
|
-
* A
|
|
42
|
+
* A stateless registry of interchangeable backends (Camunda engines, REST
|
|
71
43
|
* hosts, tenants, …). Resolves the backend for a tool call by precedence:
|
|
72
|
-
* 1. an explicit per-call `
|
|
73
|
-
* 2. otherwise
|
|
74
|
-
* 3. otherwise
|
|
75
|
-
* 4. otherwise throws {@link BackendNotSelectedError}.
|
|
44
|
+
* 1. an explicit per-call `id` wins,
|
|
45
|
+
* 2. otherwise, if exactly one backend is configured, that one,
|
|
46
|
+
* 3. otherwise throws {@link BackendNotSelectedError}.
|
|
76
47
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
48
|
+
* The registry deliberately keeps NO per-session selection state: MCP servers
|
|
49
|
+
* built on mcp-use 2.x serve HTTP statelessly (no session ids to key on), and
|
|
50
|
+
* in-memory selection state breaks behind any load balancer with more than one
|
|
51
|
+
* replica. A consumer that wants a sticky/default backend resolves that id
|
|
52
|
+
* itself — e.g. from a durable per-user profile — and passes it to `resolve`
|
|
53
|
+
* when the caller gave no explicit override.
|
|
79
54
|
*/
|
|
80
55
|
export interface BackendRegistry<TClient, TMeta = undefined> {
|
|
81
|
-
/** Resolve the backend for the current call (precedence:
|
|
82
|
-
resolve(
|
|
83
|
-
/** Pin `id` as the sticky selection for the current MCP session. */
|
|
84
|
-
select(id: string): void;
|
|
85
|
-
/** Clear the sticky selection for a given session id (no-op if none). */
|
|
86
|
-
clear(sessionId: string): void;
|
|
56
|
+
/** Resolve the backend for the current call (precedence: explicit id > single default). */
|
|
57
|
+
resolve(id?: string): ResolvedBackend<TClient, TMeta>;
|
|
87
58
|
/** List every registered backend (id + meta), in registration order. */
|
|
88
59
|
list(): {
|
|
89
60
|
id: string;
|
|
90
61
|
meta: TMeta | undefined;
|
|
91
62
|
}[];
|
|
92
|
-
/**
|
|
93
|
-
* The id sticky-selected for the current session, or `undefined` when none
|
|
94
|
-
* is selected (or the selection has outlived the TTL). Unlike {@link resolve},
|
|
95
|
-
* it never falls back to a single configured default and never throws — it
|
|
96
|
-
* reports only an explicit sticky selection, which is what a "what is
|
|
97
|
-
* currently selected?" reader needs: a select-tool's `current` action, or
|
|
98
|
-
* surfacing the active pick alongside `list`.
|
|
99
|
-
*/
|
|
100
|
-
getSelected(): string | undefined;
|
|
101
63
|
}
|
|
102
64
|
/**
|
|
103
65
|
* Builds a {@link BackendRegistry} from a non-empty list of backend entries.
|
|
@@ -108,10 +70,10 @@ export interface BackendRegistry<TClient, TMeta = undefined> {
|
|
|
108
70
|
export declare function createBackendRegistry<TClient, TMeta = undefined>(entries: BackendEntry<TClient, TMeta>[], opts?: CreateBackendRegistryOptions): BackendRegistry<TClient, TMeta>;
|
|
109
71
|
/**
|
|
110
72
|
* Lifts a handler written against a single resolved backend into one that
|
|
111
|
-
* resolves the backend from `registry` (
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
73
|
+
* resolves the backend from `registry` (explicit id > single default) before
|
|
74
|
+
* delegating. The id is read from `args[paramName]`, so a tool adds backend
|
|
75
|
+
* selection by spreading an optional `{ [paramName]: z.string() }` into its
|
|
76
|
+
* input schema and wrapping its handler in `withBackend(...)`.
|
|
115
77
|
*/
|
|
116
78
|
export declare function withBackend<TClient, TMeta, TArgs extends Record<string, unknown>, TResult>(registry: BackendRegistry<TClient, TMeta>, paramName: string, fn: (backend: ResolvedBackend<TClient, TMeta>, args: TArgs) => Promise<TResult>): (args: TArgs) => Promise<TResult>;
|
|
117
79
|
//# sourceMappingURL=backend-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend-registry.d.ts","sourceRoot":"","sources":["../../src/tools/backend-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"backend-registry.d.ts","sourceRoot":"","sources":["../../src/tools/backend-registry.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,WAAW,YAAY,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS;IACtD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,KAAK,CAAA;CACb;AAED,mDAAmD;AACnD,MAAM,WAAW,eAAe,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,KAAK,GAAG,SAAS,CAAA;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,EAAG,sBAAsB,CAAS;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;gBACnB,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM;CAQlD;AAED,wEAAwE;AACxE,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAG,iBAAiB,CAAS;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;gBACnB,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM;CAMvE;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS;IACzD,2FAA2F;IAC3F,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACrD,wEAAwE;IACxE,IAAI,IAAI;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,EAAE,CAAA;CAClD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,EAC9D,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EACvC,IAAI,GAAE,4BAAiC,GACtC,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,CAqCjC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EACxF,QAAQ,EAAE,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,EACzC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GAC9E,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAMnC"}
|
|
@@ -1,49 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* without eviction the per-session selection map would grow with every MCP
|
|
5
|
-
* session that ever selected a backend. 24h comfortably outlives any real
|
|
6
|
-
* session.
|
|
7
|
-
*/
|
|
8
|
-
export const DEFAULT_BACKEND_SESSION_TTL_MS = 24 * 60 * 60 * 1000;
|
|
9
|
-
/**
|
|
10
|
-
* Fallback session resolver: always `undefined`.
|
|
11
|
-
*
|
|
12
|
-
* Until mcp-use 2.x this read the `Mcp-Session-Id` header off an ambient Hono
|
|
13
|
-
* context that `mcp-use` propagated through AsyncLocalStorage. 2.x removed
|
|
14
|
-
* `getRequestContext()` — a request's context now only reaches code that is
|
|
15
|
-
* handed it, and the transport is session-less by default — so there is no
|
|
16
|
-
* ambient source left to read.
|
|
17
|
-
*
|
|
18
|
-
* Returning `undefined` keeps the documented fail-soft path: resolution falls
|
|
19
|
-
* back to the lone default backend, so single-backend setups are unaffected.
|
|
20
|
-
* **Sticky per-session selection across several backends now requires passing
|
|
21
|
-
* {@link CreateBackendRegistryOptions.getSessionId} explicitly** — from a tool
|
|
22
|
-
* handler, `(ctx) => ctx.session?.sessionId` is the 2.x equivalent.
|
|
23
|
-
*/
|
|
24
|
-
function defaultGetSessionId() {
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Thrown when a tool is invoked but no backend has been selected for the
|
|
29
|
-
* current MCP session and the registry holds more than one backend.
|
|
2
|
+
* Thrown when a tool is invoked without an explicit backend id and the
|
|
3
|
+
* registry holds more than one backend.
|
|
30
4
|
*
|
|
31
5
|
* The message lists the available ids because the error path commonly only
|
|
32
6
|
* serialises `code` + `message` (the structured `availableIds` field may not
|
|
33
7
|
* reach the model) — naming them saves the model a discovery roundtrip before
|
|
34
|
-
* it can pick one
|
|
8
|
+
* it can pick one.
|
|
35
9
|
*/
|
|
36
10
|
export class BackendNotSelectedError extends Error {
|
|
37
11
|
code = "BACKEND_NOT_SELECTED";
|
|
38
12
|
availableIds;
|
|
39
13
|
constructor(availableIds, label) {
|
|
40
|
-
super(`No ${label}
|
|
41
|
-
`
|
|
14
|
+
super(`No ${label} specified and more than one is configured. ` +
|
|
15
|
+
`Available ${label}s: ${availableIds.join(", ")}. Pass an explicit ${label} id.`);
|
|
42
16
|
this.name = "BackendNotSelectedError";
|
|
43
17
|
this.availableIds = availableIds;
|
|
44
18
|
}
|
|
45
19
|
}
|
|
46
|
-
/** Thrown when an
|
|
20
|
+
/** Thrown when an explicit id names a backend that isn't registered. */
|
|
47
21
|
export class UnknownBackendError extends Error {
|
|
48
22
|
code = "UNKNOWN_BACKEND";
|
|
49
23
|
requestedId;
|
|
@@ -73,31 +47,7 @@ export function createBackendRegistry(entries, opts = {}) {
|
|
|
73
47
|
byId.set(entry.id, entry);
|
|
74
48
|
}
|
|
75
49
|
const label = opts.label ?? "backend";
|
|
76
|
-
const ttlMs = opts.sessionTtlMs ?? DEFAULT_BACKEND_SESSION_TTL_MS;
|
|
77
|
-
const getSessionId = opts.getSessionId ?? defaultGetSessionId;
|
|
78
|
-
const now = opts.now ?? Date.now;
|
|
79
|
-
const sessionSelections = new Map();
|
|
80
50
|
const availableIds = () => [...byId.keys()];
|
|
81
|
-
const isExpired = (entry) => now() - entry.selectedAt > ttlMs;
|
|
82
|
-
const sweepExpired = () => {
|
|
83
|
-
for (const [sid, entry] of sessionSelections) {
|
|
84
|
-
if (isExpired(entry))
|
|
85
|
-
sessionSelections.delete(sid);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
const stickySelection = () => {
|
|
89
|
-
const sid = getSessionId();
|
|
90
|
-
if (!sid)
|
|
91
|
-
return undefined;
|
|
92
|
-
const entry = sessionSelections.get(sid);
|
|
93
|
-
if (!entry)
|
|
94
|
-
return undefined;
|
|
95
|
-
if (isExpired(entry)) {
|
|
96
|
-
sessionSelections.delete(sid);
|
|
97
|
-
return undefined;
|
|
98
|
-
}
|
|
99
|
-
return entry.id;
|
|
100
|
-
};
|
|
101
51
|
const get = (id) => {
|
|
102
52
|
const entry = byId.get(id);
|
|
103
53
|
if (!entry)
|
|
@@ -105,45 +55,26 @@ export function createBackendRegistry(entries, opts = {}) {
|
|
|
105
55
|
return { id: entry.id, client: entry.client, meta: entry.meta };
|
|
106
56
|
};
|
|
107
57
|
return {
|
|
108
|
-
resolve(
|
|
109
|
-
if (
|
|
110
|
-
return get(
|
|
111
|
-
const sticky = stickySelection();
|
|
112
|
-
if (sticky)
|
|
113
|
-
return get(sticky);
|
|
58
|
+
resolve(id) {
|
|
59
|
+
if (id)
|
|
60
|
+
return get(id);
|
|
114
61
|
if (byId.size === 1) {
|
|
115
62
|
const [only] = byId.values();
|
|
116
63
|
return { id: only.id, client: only.client, meta: only.meta };
|
|
117
64
|
}
|
|
118
65
|
throw new BackendNotSelectedError(availableIds(), label);
|
|
119
66
|
},
|
|
120
|
-
select(id) {
|
|
121
|
-
if (!byId.has(id))
|
|
122
|
-
throw new UnknownBackendError(id, availableIds(), label);
|
|
123
|
-
const sid = getSessionId();
|
|
124
|
-
if (!sid) {
|
|
125
|
-
throw new Error(`No active MCP session — cannot store a ${label} selection`);
|
|
126
|
-
}
|
|
127
|
-
sweepExpired();
|
|
128
|
-
sessionSelections.set(sid, { id, selectedAt: now() });
|
|
129
|
-
},
|
|
130
|
-
clear(sessionId) {
|
|
131
|
-
sessionSelections.delete(sessionId);
|
|
132
|
-
},
|
|
133
67
|
list() {
|
|
134
68
|
return [...byId.values()].map((entry) => ({ id: entry.id, meta: entry.meta }));
|
|
135
69
|
},
|
|
136
|
-
getSelected() {
|
|
137
|
-
return stickySelection();
|
|
138
|
-
},
|
|
139
70
|
};
|
|
140
71
|
}
|
|
141
72
|
/**
|
|
142
73
|
* Lifts a handler written against a single resolved backend into one that
|
|
143
|
-
* resolves the backend from `registry` (
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
74
|
+
* resolves the backend from `registry` (explicit id > single default) before
|
|
75
|
+
* delegating. The id is read from `args[paramName]`, so a tool adds backend
|
|
76
|
+
* selection by spreading an optional `{ [paramName]: z.string() }` into its
|
|
77
|
+
* input schema and wrapping its handler in `withBackend(...)`.
|
|
147
78
|
*/
|
|
148
79
|
export function withBackend(registry, paramName, fn) {
|
|
149
80
|
return (args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend-registry.js","sourceRoot":"","sources":["../../src/tools/backend-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backend-registry.js","sourceRoot":"","sources":["../../src/tools/backend-registry.ts"],"names":[],"mappings":"AAsBA;;;;;;;;GA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AAC,IAAI,EAAE,CAAC,CAAC,CAAA;QAChF,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,QAAyC,EACzC,SAAiB,EACjB,EAA+E;IAE/E,OAAO,CAAC,IAAW,EAAE,EAAE;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;QAChC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QACrF,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC1B,CAAC,CAAA;AACH,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { installToolkit } from "./install-toolkit.js";
|
|
|
14
14
|
export type { InstallToolkitOptions, InstalledToolkit } from "./install-toolkit.js";
|
|
15
15
|
export { createFrameworkApp } from "./create-framework-app.js";
|
|
16
16
|
export type { CreateFrameworkAppOptions } from "./create-framework-app.js";
|
|
17
|
-
export { createBackendRegistry, withBackend, BackendNotSelectedError, UnknownBackendError,
|
|
17
|
+
export { createBackendRegistry, withBackend, BackendNotSelectedError, UnknownBackendError, } from "./backend-registry.js";
|
|
18
18
|
export type { BackendRegistry, BackendEntry, ResolvedBackend, CreateBackendRegistryOptions, } from "./backend-registry.js";
|
|
19
19
|
export { createInMemoryDashboardStore, createFileSystemDashboardStore, DashboardOwnershipError, resolveSavedRecord, parseDashboardRecord, DASHBOARD_SCHEMA_VERSION, } from "./dashboard-store.js";
|
|
20
20
|
export type { DashboardStore, DashboardRecord, DashboardSaveInput, DashboardSummary, DashboardListFilter, FileSystemDashboardStoreOptions, } from "./dashboard-store.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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@ export { registerCatalogueTool } from "./register-catalogue-tool.js";
|
|
|
7
7
|
export { registerDashboardTools } from "./register-dashboard-tools.js";
|
|
8
8
|
export { installToolkit } from "./install-toolkit.js";
|
|
9
9
|
export { createFrameworkApp } from "./create-framework-app.js";
|
|
10
|
-
export { createBackendRegistry, withBackend, BackendNotSelectedError, UnknownBackendError,
|
|
10
|
+
export { createBackendRegistry, withBackend, BackendNotSelectedError, UnknownBackendError, } from "./backend-registry.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,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,
|
|
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,GACpB,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,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miragon/mcp-toolkit-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Framework runtime for MCP servers: plugin contract, step/widget registries, pipeline executor, render-view helpers.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"mcp-use": "2.
|
|
36
|
+
"mcp-use": "2.2.3",
|
|
37
37
|
"zod": "4.4.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/node": "26.1.2",
|
|
44
44
|
"@vitest/coverage-v8": "4.1.10",
|
|
45
45
|
"fast-check": "4.9.0",
|
|
46
|
-
"mcp-use": "2.
|
|
46
|
+
"mcp-use": "2.2.3",
|
|
47
47
|
"typescript": "6.0.3",
|
|
48
48
|
"vitest": "4.1.10",
|
|
49
49
|
"zod": "4.4.3"
|