@lovable.dev/mcp-js 0.17.0 → 0.19.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/dist/{recorder-qlzUKFxG.d.ts → base-C9rhAHZ0.d.ts} +3 -4
- package/dist/{chunk-WYXIX7XF.js → chunk-57ZH2WW5.js} +11 -12
- package/dist/{chunk-6TZNGFRM.js → chunk-5FX6IIQ6.js} +121 -136
- package/dist/{chunk-J5BTCP6T.js → chunk-CDZ7MBXC.js} +1 -1
- package/dist/{chunk-EL6YNP2R.js → chunk-CLXKPZZE.js} +13 -14
- package/dist/{chunk-VQQZAFRA.js → chunk-H37EB22A.js} +2 -10
- package/dist/{chunk-FW6YL5C5.js → chunk-OMWXY6WY.js} +8 -8
- package/dist/{chunk-H2HXKAMQ.js → chunk-UEOBGHXF.js} +2 -2
- package/dist/cli/extract-manifest.cjs +1 -1
- package/dist/cli/extract-manifest.js +4 -4
- package/dist/index.cjs +1 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/protocols/mcp/index.cjs +16 -272
- package/dist/protocols/mcp/index.d.cts +6 -5
- package/dist/protocols/mcp/index.d.ts +6 -5
- package/dist/protocols/mcp/index.js +4 -4
- package/dist/protocols/oauth-metadata.d.cts +1 -1
- package/dist/protocols/oauth-metadata.d.ts +1 -1
- package/dist/protocols/oauth-metadata.js +4 -4
- package/dist/protocols/rest/index.cjs +21 -277
- package/dist/protocols/rest/index.d.cts +6 -6
- package/dist/protocols/rest/index.d.ts +6 -6
- package/dist/protocols/rest/index.js +5 -5
- package/dist/stacks/supabase/index.cjs +178 -201
- package/dist/stacks/supabase/index.d.cts +1 -1
- package/dist/stacks/supabase/index.d.ts +1 -1
- package/dist/stacks/supabase/index.js +14 -14
- package/dist/stacks/supabase/vite.cjs +1 -1
- package/dist/stacks/supabase/vite.js +1 -1
- package/dist/stacks/tanstack/index.cjs +187 -209
- package/dist/stacks/tanstack/index.d.cts +1 -1
- package/dist/stacks/tanstack/index.d.ts +1 -1
- package/dist/stacks/tanstack/index.js +13 -10
- package/dist/{types-COY42xux.d.ts → types-CPkhCRxc.d.ts} +3 -3
- package/package.json +1 -1
|
@@ -57,18 +57,6 @@ function readEnvLevel() {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
var currentLevel = readEnvLevel() ?? "debug";
|
|
60
|
-
function setLogLevel(level) {
|
|
61
|
-
currentLevel = level;
|
|
62
|
-
}
|
|
63
|
-
function parseLogLevel(raw) {
|
|
64
|
-
const normalized = raw?.trim().toLowerCase();
|
|
65
|
-
return isLogLevel(normalized) ? normalized : void 0;
|
|
66
|
-
}
|
|
67
|
-
function applyLogLevelFromEnv(raw) {
|
|
68
|
-
const level = parseLogLevel(raw);
|
|
69
|
-
if (level)
|
|
70
|
-
setLogLevel(level);
|
|
71
|
-
}
|
|
72
60
|
function enabled(level) {
|
|
73
61
|
return LEVEL_RANK[level] <= LEVEL_RANK[currentLevel];
|
|
74
62
|
}
|
|
@@ -95,259 +83,15 @@ function describeError(err) {
|
|
|
95
83
|
return { value: String(err) };
|
|
96
84
|
}
|
|
97
85
|
|
|
98
|
-
// src/metrics/
|
|
99
|
-
var DEFAULT_METRICS_ENDPOINT = "https://api.lovable.dev/v1/app-mcp-usage";
|
|
100
|
-
var METRICS_API_KEY_ENV_VAR = "LOVABLE_API_KEY";
|
|
101
|
-
var METRICS_SAMPLE_RATE = 1;
|
|
102
|
-
var METRICS_FLUSH_INTERVAL_MS = 5e3;
|
|
103
|
-
var METRICS_MAX_BATCH_SIZE = 50;
|
|
104
|
-
function assertMetricsEndpoint(endpoint) {
|
|
105
|
-
let url;
|
|
106
|
-
try {
|
|
107
|
-
url = new URL(endpoint);
|
|
108
|
-
} catch {
|
|
109
|
-
throw new Error(`@lovable.dev/mcp-js: metrics.endpoint must be an absolute URL, got ${JSON.stringify(endpoint)}`);
|
|
110
|
-
}
|
|
111
|
-
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
|
112
|
-
throw new Error(`@lovable.dev/mcp-js: metrics.endpoint must be http(s), got ${JSON.stringify(endpoint)}`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function resolveMetricsConfig(config = true) {
|
|
116
|
-
const options = typeof config === "boolean" ? { enabled: config } : config;
|
|
117
|
-
const endpoint = options.endpoint ?? DEFAULT_METRICS_ENDPOINT;
|
|
118
|
-
assertMetricsEndpoint(endpoint);
|
|
119
|
-
return Object.freeze({
|
|
120
|
-
enabled: options.enabled ?? true,
|
|
121
|
-
endpoint,
|
|
122
|
-
headers: options.headers ?? {},
|
|
123
|
-
apiKeyEnvVar: METRICS_API_KEY_ENV_VAR,
|
|
124
|
-
sampleRate: METRICS_SAMPLE_RATE,
|
|
125
|
-
flushIntervalMs: METRICS_FLUSH_INTERVAL_MS,
|
|
126
|
-
maxBatchSize: METRICS_MAX_BATCH_SIZE
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// package.json
|
|
131
|
-
var version = "0.17.0";
|
|
132
|
-
|
|
133
|
-
// src/metrics/otlp.ts
|
|
134
|
-
var SCOPE_NAME = "@lovable.dev/mcp-js";
|
|
135
|
-
var EVENT_NAME = "mcp.tool.invocation";
|
|
136
|
-
var SEVERITY_INFO = 9;
|
|
137
|
-
function strAttr(key, value) {
|
|
138
|
-
return { key, value: { stringValue: value } };
|
|
139
|
-
}
|
|
140
|
-
function intAttr(key, value) {
|
|
141
|
-
return { key, value: { intValue: String(Math.round(value)) } };
|
|
142
|
-
}
|
|
143
|
-
function toLogRecord(rec) {
|
|
144
|
-
const attributes = [
|
|
145
|
-
strAttr("event.name", EVENT_NAME),
|
|
146
|
-
strAttr("mcp.method", rec.method),
|
|
147
|
-
strAttr("mcp.outcome", rec.outcome),
|
|
148
|
-
intAttr("mcp.duration_ms", rec.durationMs)
|
|
149
|
-
];
|
|
150
|
-
if (rec.tool !== null)
|
|
151
|
-
attributes.push(strAttr("mcp.tool", rec.tool));
|
|
152
|
-
if (rec.reqBytes !== void 0)
|
|
153
|
-
attributes.push(intAttr("mcp.request_size_bytes", rec.reqBytes));
|
|
154
|
-
if (rec.resBytes !== void 0)
|
|
155
|
-
attributes.push(intAttr("mcp.response_size_bytes", rec.resBytes));
|
|
156
|
-
return {
|
|
157
|
-
timeUnixNano: rec.timeUnixNano,
|
|
158
|
-
observedTimeUnixNano: rec.timeUnixNano,
|
|
159
|
-
severityNumber: SEVERITY_INFO,
|
|
160
|
-
severityText: "INFO",
|
|
161
|
-
body: { stringValue: EVENT_NAME },
|
|
162
|
-
attributes
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function buildLogsPayload(records, server) {
|
|
166
|
-
return JSON.stringify({
|
|
167
|
-
resourceLogs: [
|
|
168
|
-
{
|
|
169
|
-
resource: {
|
|
170
|
-
attributes: [
|
|
171
|
-
strAttr("service.name", server.name),
|
|
172
|
-
strAttr("service.version", server.version),
|
|
173
|
-
strAttr("telemetry.sdk.name", SCOPE_NAME),
|
|
174
|
-
strAttr("telemetry.sdk.version", version),
|
|
175
|
-
strAttr("telemetry.sdk.language", "webjs")
|
|
176
|
-
]
|
|
177
|
-
},
|
|
178
|
-
scopeLogs: [
|
|
179
|
-
{
|
|
180
|
-
scope: { name: SCOPE_NAME, version },
|
|
181
|
-
logRecords: records.map(toLogRecord)
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
]
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
function nowUnixNano() {
|
|
189
|
-
return `${Date.now()}000000`;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/metrics/recorder.ts
|
|
86
|
+
// src/metrics/impl/base.ts
|
|
193
87
|
function nowMs() {
|
|
194
88
|
return typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
195
89
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
recorder.record(ev);
|
|
199
|
-
}
|
|
200
|
-
var NOOP_RECORDER = {
|
|
201
|
-
record() {
|
|
202
|
-
},
|
|
203
|
-
async flush() {
|
|
204
|
-
}
|
|
205
|
-
};
|
|
90
|
+
var NOOP_RECORDER = { async emit() {
|
|
91
|
+
} };
|
|
206
92
|
function createNoopRecorder() {
|
|
207
93
|
return NOOP_RECORDER;
|
|
208
94
|
}
|
|
209
|
-
function readRuntimeEnv(name) {
|
|
210
|
-
try {
|
|
211
|
-
const denoEnv = globalThis.Deno?.env;
|
|
212
|
-
const value = denoEnv?.get?.(name);
|
|
213
|
-
if (value)
|
|
214
|
-
return value;
|
|
215
|
-
} catch {
|
|
216
|
-
}
|
|
217
|
-
try {
|
|
218
|
-
if (typeof process !== "undefined") {
|
|
219
|
-
const value = process.env?.[name];
|
|
220
|
-
if (value)
|
|
221
|
-
return value;
|
|
222
|
-
}
|
|
223
|
-
} catch {
|
|
224
|
-
}
|
|
225
|
-
return void 0;
|
|
226
|
-
}
|
|
227
|
-
var cloudflareEnvPromise;
|
|
228
|
-
async function readCloudflareEnv(name) {
|
|
229
|
-
try {
|
|
230
|
-
const moduleSpecifier = "cloudflare:workers";
|
|
231
|
-
cloudflareEnvPromise ??= import(
|
|
232
|
-
/* @vite-ignore */
|
|
233
|
-
moduleSpecifier
|
|
234
|
-
).then((m) => m.env).catch(() => void 0);
|
|
235
|
-
const env = await cloudflareEnvPromise;
|
|
236
|
-
const value = env?.[name];
|
|
237
|
-
return typeof value === "string" && value ? value : void 0;
|
|
238
|
-
} catch {
|
|
239
|
-
return void 0;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function probeWaitUntil() {
|
|
243
|
-
const fn = globalThis.EdgeRuntime?.waitUntil;
|
|
244
|
-
return typeof fn === "function" ? fn.bind(globalThis.EdgeRuntime) : void 0;
|
|
245
|
-
}
|
|
246
|
-
function createMetricsRecorder(ctx, deps = {}) {
|
|
247
|
-
const { config, server } = ctx;
|
|
248
|
-
applyLogLevelFromEnv(readRuntimeEnv(LOG_LEVEL_ENV_VAR));
|
|
249
|
-
if (!config.enabled)
|
|
250
|
-
return NOOP_RECORDER;
|
|
251
|
-
const doFetch = deps.fetch ?? globalThis.fetch;
|
|
252
|
-
if (!doFetch) {
|
|
253
|
-
log.warn("metrics.disabled_no_fetch", { endpoint: config.endpoint });
|
|
254
|
-
return NOOP_RECORDER;
|
|
255
|
-
}
|
|
256
|
-
const usesLovableEndpoint = config.endpoint === DEFAULT_METRICS_ENDPOINT;
|
|
257
|
-
const waitUntil = deps.waitUntil ?? probeWaitUntil();
|
|
258
|
-
const buffer = [];
|
|
259
|
-
let timer;
|
|
260
|
-
let lazyLogLevelApplied = false;
|
|
261
|
-
const applyLazyLogLevel = async () => {
|
|
262
|
-
if (lazyLogLevelApplied)
|
|
263
|
-
return;
|
|
264
|
-
lazyLogLevelApplied = true;
|
|
265
|
-
applyLogLevelFromEnv(await readCloudflareEnv(LOG_LEVEL_ENV_VAR));
|
|
266
|
-
};
|
|
267
|
-
let apiKey;
|
|
268
|
-
const resolveApiKey = async () => {
|
|
269
|
-
if (apiKey)
|
|
270
|
-
return apiKey;
|
|
271
|
-
apiKey = (deps.getApiKey ? deps.getApiKey() : readRuntimeEnv(config.apiKeyEnvVar)) ?? await readCloudflareEnv(config.apiKeyEnvVar);
|
|
272
|
-
return apiKey;
|
|
273
|
-
};
|
|
274
|
-
const schedule = (p) => {
|
|
275
|
-
if (waitUntil) {
|
|
276
|
-
try {
|
|
277
|
-
waitUntil(p);
|
|
278
|
-
return;
|
|
279
|
-
} catch (err) {
|
|
280
|
-
log.warn("metrics.wait_until_failed", describeError(err));
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
void p.catch(() => {
|
|
284
|
-
});
|
|
285
|
-
};
|
|
286
|
-
const baseHeaders = {};
|
|
287
|
-
if (!usesLovableEndpoint) {
|
|
288
|
-
for (const [key, value] of Object.entries(config.headers)) {
|
|
289
|
-
if (key.toLowerCase() !== "content-type")
|
|
290
|
-
baseHeaders[key] = value;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
baseHeaders["content-type"] = "application/json";
|
|
294
|
-
const flush = async () => {
|
|
295
|
-
void applyLazyLogLevel();
|
|
296
|
-
if (buffer.length === 0)
|
|
297
|
-
return;
|
|
298
|
-
const records = buffer.splice(0, buffer.length);
|
|
299
|
-
const dropped = records.length;
|
|
300
|
-
const headers = { ...baseHeaders };
|
|
301
|
-
if (usesLovableEndpoint) {
|
|
302
|
-
const key = await resolveApiKey();
|
|
303
|
-
if (!key) {
|
|
304
|
-
log.warn("metrics.disabled_no_api_key", {
|
|
305
|
-
envVar: config.apiKeyEnvVar,
|
|
306
|
-
endpoint: config.endpoint,
|
|
307
|
-
dropped
|
|
308
|
-
});
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
headers.authorization = `Bearer ${key}`;
|
|
312
|
-
}
|
|
313
|
-
try {
|
|
314
|
-
const res = await doFetch(config.endpoint, {
|
|
315
|
-
method: "POST",
|
|
316
|
-
headers,
|
|
317
|
-
body: buildLogsPayload(records, server),
|
|
318
|
-
keepalive: true
|
|
319
|
-
});
|
|
320
|
-
if (!res.ok) {
|
|
321
|
-
log.warn("metrics.flush_rejected", { status: res.status, dropped, endpoint: config.endpoint });
|
|
322
|
-
}
|
|
323
|
-
} catch (err) {
|
|
324
|
-
log.warn("metrics.flush_failed", { ...describeError(err), dropped, endpoint: config.endpoint });
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
const ensureTimer = () => {
|
|
328
|
-
if (timer !== void 0)
|
|
329
|
-
return;
|
|
330
|
-
timer = setInterval(() => schedule(flush()), config.flushIntervalMs);
|
|
331
|
-
timer.unref?.();
|
|
332
|
-
};
|
|
333
|
-
return {
|
|
334
|
-
record(ev) {
|
|
335
|
-
if (config.sampleRate < 1 && Math.random() >= config.sampleRate)
|
|
336
|
-
return;
|
|
337
|
-
buffer.push({ ...ev, timeUnixNano: nowUnixNano() });
|
|
338
|
-
ensureTimer();
|
|
339
|
-
if (buffer.length >= config.maxBatchSize)
|
|
340
|
-
schedule(flush());
|
|
341
|
-
},
|
|
342
|
-
flush
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
function createRecorderForRuntime(mcp) {
|
|
346
|
-
const config = resolveMetricsConfig(mcp.metrics);
|
|
347
|
-
if (!config.enabled)
|
|
348
|
-
return createNoopRecorder();
|
|
349
|
-
return createMetricsRecorder({ config, server: { name: mcp.name, version: mcp.version } });
|
|
350
|
-
}
|
|
351
95
|
|
|
352
96
|
// src/core/promise.ts
|
|
353
97
|
function cachedPromise(load, label) {
|
|
@@ -777,10 +521,10 @@ function assertRequiredScopes(auth, context) {
|
|
|
777
521
|
throw new OAuthTokenError(403, "insufficient_scope", "Additional OAuth scope is required");
|
|
778
522
|
}
|
|
779
523
|
}
|
|
780
|
-
function createRequestAuthorizer(mcp, options = {}
|
|
524
|
+
function createRequestAuthorizer(mcp, options = {}) {
|
|
781
525
|
const runtime = getOAuthRuntime(mcp, options);
|
|
782
526
|
return {
|
|
783
|
-
async authorize(request) {
|
|
527
|
+
async authorize(request, recorder) {
|
|
784
528
|
if (runtime.kind === "unconfigured")
|
|
785
529
|
return { ok: true };
|
|
786
530
|
const startedAt = nowMs();
|
|
@@ -796,7 +540,7 @@ function createRequestAuthorizer(mcp, options = {}, recorder) {
|
|
|
796
540
|
} catch (err) {
|
|
797
541
|
if (err instanceof OAuthConfigurationError) {
|
|
798
542
|
log.error("auth.config_error", { ...describeError(err), outcome: "500" });
|
|
799
|
-
recorder?.
|
|
543
|
+
await recorder?.emit({
|
|
800
544
|
tool: null,
|
|
801
545
|
method: "authorize",
|
|
802
546
|
outcome: "auth_config_error",
|
|
@@ -878,11 +622,11 @@ function buildMcpListing(mcp) {
|
|
|
878
622
|
}))
|
|
879
623
|
};
|
|
880
624
|
}
|
|
881
|
-
function createListToolsHandler(mcp, options = {}
|
|
625
|
+
function createListToolsHandler(mcp, options = {}) {
|
|
882
626
|
assertRestResourceBinding(mcp, options);
|
|
883
|
-
const authorizer = createRequestAuthorizer(mcp, options
|
|
884
|
-
const handle = async (request) => {
|
|
885
|
-
const authResult = await authorizer.authorize(request);
|
|
627
|
+
const authorizer = createRequestAuthorizer(mcp, options);
|
|
628
|
+
const handle = async (request, recorder) => {
|
|
629
|
+
const authResult = await authorizer.authorize(request, recorder);
|
|
886
630
|
if (!authResult.ok)
|
|
887
631
|
return authResult.response;
|
|
888
632
|
if (request.method !== "GET" && request.method !== "HEAD")
|
|
@@ -890,10 +634,10 @@ function createListToolsHandler(mcp, options = {}, recorder = createRecorderForR
|
|
|
890
634
|
const response = Response.json(buildMcpListing(mcp));
|
|
891
635
|
return request.method === "HEAD" ? headResponse(response) : response;
|
|
892
636
|
};
|
|
893
|
-
return async (request) => {
|
|
637
|
+
return async (request, recorder = createNoopRecorder()) => {
|
|
894
638
|
if (request.method === "OPTIONS")
|
|
895
639
|
return corsPreflightResponse("GET, HEAD, OPTIONS");
|
|
896
|
-
return withCors(await handle(request));
|
|
640
|
+
return withCors(await handle(request, recorder));
|
|
897
641
|
};
|
|
898
642
|
}
|
|
899
643
|
|
|
@@ -956,11 +700,11 @@ function isEmptyArgs(value) {
|
|
|
956
700
|
return false;
|
|
957
701
|
return Object.keys(value).length === 0;
|
|
958
702
|
}
|
|
959
|
-
function createInvokeToolHandler(mcp, options = {}
|
|
703
|
+
function createInvokeToolHandler(mcp, options = {}) {
|
|
960
704
|
assertRestResourceBinding(mcp, options);
|
|
961
|
-
const authorizer = createRequestAuthorizer(mcp, options
|
|
962
|
-
const handle = async (request, toolName) => {
|
|
963
|
-
const authResult = await authorizer.authorize(request);
|
|
705
|
+
const authorizer = createRequestAuthorizer(mcp, options);
|
|
706
|
+
const handle = async (request, toolName, recorder) => {
|
|
707
|
+
const authResult = await authorizer.authorize(request, recorder);
|
|
964
708
|
if (!authResult.ok)
|
|
965
709
|
return authResult.response;
|
|
966
710
|
if (request.method !== "POST")
|
|
@@ -1016,7 +760,7 @@ function createInvokeToolHandler(mcp, options = {}, recorder = createRecorderFor
|
|
|
1016
760
|
try {
|
|
1017
761
|
result = await tool.handler(args, new ToolContext(authResult.auth));
|
|
1018
762
|
} catch {
|
|
1019
|
-
|
|
763
|
+
await recorder.emit({
|
|
1020
764
|
tool: tool.name,
|
|
1021
765
|
method: "tools/call",
|
|
1022
766
|
outcome: "handler_error",
|
|
@@ -1028,7 +772,7 @@ function createInvokeToolHandler(mcp, options = {}, recorder = createRecorderFor
|
|
|
1028
772
|
});
|
|
1029
773
|
}
|
|
1030
774
|
if (result == null) {
|
|
1031
|
-
|
|
775
|
+
await recorder.emit({
|
|
1032
776
|
tool: tool.name,
|
|
1033
777
|
method: "tools/call",
|
|
1034
778
|
outcome: "handler_error",
|
|
@@ -1039,7 +783,7 @@ function createInvokeToolHandler(mcp, options = {}, recorder = createRecorderFor
|
|
|
1039
783
|
headers: JSON_HEADERS
|
|
1040
784
|
});
|
|
1041
785
|
}
|
|
1042
|
-
|
|
786
|
+
await recorder.emit({
|
|
1043
787
|
tool: tool.name,
|
|
1044
788
|
method: "tools/call",
|
|
1045
789
|
outcome: result.isError ? "tool_error" : "ok",
|
|
@@ -1051,10 +795,10 @@ function createInvokeToolHandler(mcp, options = {}, recorder = createRecorderFor
|
|
|
1051
795
|
isError: result.isError
|
|
1052
796
|
});
|
|
1053
797
|
};
|
|
1054
|
-
return async (request, toolName) => {
|
|
798
|
+
return async (request, toolName, recorder = createNoopRecorder()) => {
|
|
1055
799
|
if (request.method === "OPTIONS")
|
|
1056
800
|
return corsPreflightResponse("POST, OPTIONS");
|
|
1057
|
-
return withCors(await handle(request, toolName));
|
|
801
|
+
return withCors(await handle(request, toolName, recorder));
|
|
1058
802
|
};
|
|
1059
803
|
}
|
|
1060
804
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { M as McpRuntimeOptions } from '../../authorize-BMeXd_Sh.js';
|
|
2
|
-
import { d as McpDefinition } from '../../types-
|
|
3
|
-
import { M as MetricsRecorder } from '../../
|
|
2
|
+
import { d as McpDefinition } from '../../types-CPkhCRxc.js';
|
|
3
|
+
import { M as MetricsRecorder } from '../../base-C9rhAHZ0.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
type RestListToolsHandler = (request: Request) => Promise<Response>;
|
|
7
|
-
declare function createListToolsHandler(mcp: McpDefinition, options?: McpRuntimeOptions
|
|
6
|
+
type RestListToolsHandler = (request: Request, recorder?: MetricsRecorder) => Promise<Response>;
|
|
7
|
+
declare function createListToolsHandler(mcp: McpDefinition, options?: McpRuntimeOptions): RestListToolsHandler;
|
|
8
8
|
|
|
9
|
-
type RestInvokeToolHandler = (request: Request, toolName: string) => Promise<Response>;
|
|
10
|
-
declare function createInvokeToolHandler(mcp: McpDefinition, options?: McpRuntimeOptions
|
|
9
|
+
type RestInvokeToolHandler = (request: Request, toolName: string, recorder?: MetricsRecorder) => Promise<Response>;
|
|
10
|
+
declare function createInvokeToolHandler(mcp: McpDefinition, options?: McpRuntimeOptions): RestInvokeToolHandler;
|
|
11
11
|
|
|
12
12
|
export { type RestInvokeToolHandler, type RestListToolsHandler, createInvokeToolHandler, createListToolsHandler };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { M as McpRuntimeOptions } from '../../authorize-BMeXd_Sh.js';
|
|
2
|
-
import { d as McpDefinition } from '../../types-
|
|
3
|
-
import { M as MetricsRecorder } from '../../
|
|
2
|
+
import { d as McpDefinition } from '../../types-CPkhCRxc.js';
|
|
3
|
+
import { M as MetricsRecorder } from '../../base-C9rhAHZ0.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
type RestListToolsHandler = (request: Request) => Promise<Response>;
|
|
7
|
-
declare function createListToolsHandler(mcp: McpDefinition, options?: McpRuntimeOptions
|
|
6
|
+
type RestListToolsHandler = (request: Request, recorder?: MetricsRecorder) => Promise<Response>;
|
|
7
|
+
declare function createListToolsHandler(mcp: McpDefinition, options?: McpRuntimeOptions): RestListToolsHandler;
|
|
8
8
|
|
|
9
|
-
type RestInvokeToolHandler = (request: Request, toolName: string) => Promise<Response>;
|
|
10
|
-
declare function createInvokeToolHandler(mcp: McpDefinition, options?: McpRuntimeOptions
|
|
9
|
+
type RestInvokeToolHandler = (request: Request, toolName: string, recorder?: MetricsRecorder) => Promise<Response>;
|
|
10
|
+
declare function createInvokeToolHandler(mcp: McpDefinition, options?: McpRuntimeOptions): RestInvokeToolHandler;
|
|
11
11
|
|
|
12
12
|
export { type RestInvokeToolHandler, type RestListToolsHandler, createInvokeToolHandler, createListToolsHandler };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createInvokeToolHandler
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-57ZH2WW5.js";
|
|
4
4
|
import {
|
|
5
5
|
createListToolsHandler
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-OMWXY6WY.js";
|
|
7
7
|
import "../../chunk-MA5H6PSF.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-5FX6IIQ6.js";
|
|
9
|
+
import "../../chunk-H37EB22A.js";
|
|
10
10
|
import "../../chunk-6DXGZZA4.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-CDZ7MBXC.js";
|
|
12
12
|
export {
|
|
13
13
|
createInvokeToolHandler,
|
|
14
14
|
createListToolsHandler
|