@lovable.dev/mcp-js 0.21.0-rc.0 → 0.21.0-rc.1
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/{chunk-VTIP6LMI.js → chunk-D32HYMP7.js} +19 -23
- package/dist/{chunk-NQZGVZ24.js → chunk-KI5LOYRQ.js} +1 -1
- package/dist/{chunk-2LLCWLQL.js → chunk-KKAXS2RA.js} +1 -1
- package/dist/{chunk-KYKL5ECH.js → chunk-MYVH5NU2.js} +1 -1
- package/dist/{chunk-XOCASA3L.js → chunk-V6LIWJJB.js} +1 -1
- package/dist/{chunk-M2TRF6OJ.js → chunk-ZFPENIDM.js} +1 -1
- package/dist/cli/extract-manifest.cjs +1 -1
- package/dist/cli/extract-manifest.js +3 -3
- package/dist/protocols/mcp/index.cjs +18 -22
- package/dist/protocols/mcp/index.js +3 -3
- package/dist/protocols/oauth-metadata.cjs +16 -20
- package/dist/protocols/oauth-metadata.js +3 -3
- package/dist/protocols/rest/index.cjs +18 -22
- package/dist/protocols/rest/index.js +4 -4
- package/dist/stacks/supabase/index.cjs +17 -21
- package/dist/stacks/supabase/index.js +6 -6
- package/dist/stacks/supabase/vite.cjs +1 -1
- package/dist/stacks/supabase/vite.js +1 -1
- package/dist/stacks/tanstack/index.cjs +17 -21
- package/dist/stacks/tanstack/index.js +6 -6
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-6DXGZZA4.js";
|
|
14
14
|
import {
|
|
15
15
|
version
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-V6LIWJJB.js";
|
|
17
17
|
|
|
18
18
|
// src/core/http.ts
|
|
19
19
|
var JSON_HEADERS = { "Content-Type": "application/json" };
|
|
@@ -325,32 +325,28 @@ function oauthMetadataUrlsForIssuer(issuer) {
|
|
|
325
325
|
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
326
326
|
}
|
|
327
327
|
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer, signal) {
|
|
328
|
+
const errors = [];
|
|
329
|
+
for (const url of metadataUrls) {
|
|
330
|
+
try {
|
|
331
|
+
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
332
|
+
} catch (err) {
|
|
333
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
334
|
+
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(error) });
|
|
335
|
+
errors.push(error);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const unreachable = errors.some((e) => e instanceof MetadataUnreachableError);
|
|
339
|
+
const detail = errors.map((e) => e.message).join("; ");
|
|
340
|
+
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
341
|
+
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
342
|
+
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
343
|
+
}
|
|
344
|
+
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
349
345
|
log.debug("oauth.discovery.fetch", { url });
|
|
350
346
|
let response;
|
|
351
347
|
try {
|
|
352
348
|
response = await fetch(url, {
|
|
353
|
-
signal: AbortSignal.
|
|
349
|
+
signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS),
|
|
354
350
|
redirect: "manual"
|
|
355
351
|
});
|
|
356
352
|
} catch (err) {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
methodNotAllowed,
|
|
11
11
|
nowMs,
|
|
12
12
|
withCors
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-D32HYMP7.js";
|
|
14
14
|
|
|
15
15
|
// src/protocols/rest/invoke-tool.ts
|
|
16
16
|
import { getParseErrorMessage, objectFromShape, safeParseAsync } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
buildMcpListing
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-MYVH5NU2.js";
|
|
5
|
+
import "../chunk-D32HYMP7.js";
|
|
6
6
|
import "../chunk-H37EB22A.js";
|
|
7
7
|
import "../chunk-6DXGZZA4.js";
|
|
8
8
|
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../chunk-Y3ZFPEQH.js";
|
|
11
11
|
import {
|
|
12
12
|
version
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-V6LIWJJB.js";
|
|
14
14
|
|
|
15
15
|
// src/manifest/io.ts
|
|
16
16
|
import { randomUUID } from "crypto";
|
|
@@ -189,32 +189,28 @@ function oauthMetadataUrlsForIssuer(issuer) {
|
|
|
189
189
|
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
190
190
|
}
|
|
191
191
|
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer, signal) {
|
|
192
|
+
const errors = [];
|
|
193
|
+
for (const url of metadataUrls) {
|
|
194
|
+
try {
|
|
195
|
+
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
196
|
+
} catch (err) {
|
|
197
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
198
|
+
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(error) });
|
|
199
|
+
errors.push(error);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const unreachable = errors.some((e) => e instanceof MetadataUnreachableError);
|
|
203
|
+
const detail = errors.map((e) => e.message).join("; ");
|
|
204
|
+
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
205
|
+
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
206
|
+
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
207
|
+
}
|
|
208
|
+
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
213
209
|
log.debug("oauth.discovery.fetch", { url });
|
|
214
210
|
let response;
|
|
215
211
|
try {
|
|
216
212
|
response = await fetch(url, {
|
|
217
|
-
signal: AbortSignal.
|
|
213
|
+
signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS),
|
|
218
214
|
redirect: "manual"
|
|
219
215
|
});
|
|
220
216
|
} catch (err) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMcpProtocolHandler
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-KKAXS2RA.js";
|
|
4
4
|
import "../../chunk-MA5H6PSF.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-D32HYMP7.js";
|
|
6
6
|
import "../../chunk-H37EB22A.js";
|
|
7
7
|
import "../../chunk-6DXGZZA4.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-V6LIWJJB.js";
|
|
9
9
|
export {
|
|
10
10
|
createMcpProtocolHandler
|
|
11
11
|
};
|
|
@@ -184,32 +184,28 @@ function oauthMetadataUrlsForIssuer(issuer) {
|
|
|
184
184
|
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
185
185
|
}
|
|
186
186
|
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
controller.abort();
|
|
197
|
-
return metadata;
|
|
198
|
-
} catch (aggregate) {
|
|
199
|
-
const causes = aggregate instanceof AggregateError ? aggregate.errors : [aggregate];
|
|
200
|
-
const unreachable = causes.some((c) => c instanceof MetadataUnreachableError);
|
|
201
|
-
const detail = causes.map((c) => c instanceof Error ? c.message : String(c)).join("; ");
|
|
202
|
-
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
203
|
-
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
204
|
-
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
187
|
+
const errors = [];
|
|
188
|
+
for (const url of metadataUrls) {
|
|
189
|
+
try {
|
|
190
|
+
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
191
|
+
} catch (err) {
|
|
192
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
193
|
+
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(error) });
|
|
194
|
+
errors.push(error);
|
|
195
|
+
}
|
|
205
196
|
}
|
|
197
|
+
const unreachable = errors.some((e) => e instanceof MetadataUnreachableError);
|
|
198
|
+
const detail = errors.map((e) => e.message).join("; ");
|
|
199
|
+
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
200
|
+
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
201
|
+
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
206
202
|
}
|
|
207
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer
|
|
203
|
+
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
208
204
|
log.debug("oauth.discovery.fetch", { url });
|
|
209
205
|
let response;
|
|
210
206
|
try {
|
|
211
207
|
response = await fetch(url, {
|
|
212
|
-
signal: AbortSignal.
|
|
208
|
+
signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS),
|
|
213
209
|
redirect: "manual"
|
|
214
210
|
});
|
|
215
211
|
} catch (err) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createOAuthProtectedResourceMetadataHandler
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-KI5LOYRQ.js";
|
|
4
|
+
import "../chunk-D32HYMP7.js";
|
|
5
5
|
import "../chunk-H37EB22A.js";
|
|
6
6
|
import "../chunk-6DXGZZA4.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-V6LIWJJB.js";
|
|
8
8
|
export {
|
|
9
9
|
createOAuthProtectedResourceMetadataHandler
|
|
10
10
|
};
|
|
@@ -199,32 +199,28 @@ function oauthMetadataUrlsForIssuer(issuer) {
|
|
|
199
199
|
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
200
200
|
}
|
|
201
201
|
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer, signal) {
|
|
202
|
+
const errors = [];
|
|
203
|
+
for (const url of metadataUrls) {
|
|
204
|
+
try {
|
|
205
|
+
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
206
|
+
} catch (err) {
|
|
207
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
208
|
+
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(error) });
|
|
209
|
+
errors.push(error);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const unreachable = errors.some((e) => e instanceof MetadataUnreachableError);
|
|
213
|
+
const detail = errors.map((e) => e.message).join("; ");
|
|
214
|
+
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
215
|
+
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
216
|
+
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
217
|
+
}
|
|
218
|
+
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
223
219
|
log.debug("oauth.discovery.fetch", { url });
|
|
224
220
|
let response;
|
|
225
221
|
try {
|
|
226
222
|
response = await fetch(url, {
|
|
227
|
-
signal: AbortSignal.
|
|
223
|
+
signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS),
|
|
228
224
|
redirect: "manual"
|
|
229
225
|
});
|
|
230
226
|
} catch (err) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createInvokeToolHandler
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-ZFPENIDM.js";
|
|
4
4
|
import {
|
|
5
5
|
createListToolsHandler
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-MYVH5NU2.js";
|
|
7
7
|
import "../../chunk-MA5H6PSF.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-D32HYMP7.js";
|
|
9
9
|
import "../../chunk-H37EB22A.js";
|
|
10
10
|
import "../../chunk-6DXGZZA4.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-V6LIWJJB.js";
|
|
12
12
|
export {
|
|
13
13
|
createInvokeToolHandler,
|
|
14
14
|
createListToolsHandler
|
|
@@ -174,7 +174,7 @@ function describeError(err) {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
// package.json
|
|
177
|
-
var version = "0.21.0-rc.
|
|
177
|
+
var version = "0.21.0-rc.1";
|
|
178
178
|
|
|
179
179
|
// src/metrics/otlp.ts
|
|
180
180
|
var SCOPE_NAME = "@lovable.dev/mcp-js";
|
|
@@ -481,32 +481,28 @@ function oauthMetadataUrlsForIssuer(issuer) {
|
|
|
481
481
|
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
482
482
|
}
|
|
483
483
|
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
controller.abort();
|
|
494
|
-
return metadata;
|
|
495
|
-
} catch (aggregate) {
|
|
496
|
-
const causes = aggregate instanceof AggregateError ? aggregate.errors : [aggregate];
|
|
497
|
-
const unreachable = causes.some((c) => c instanceof MetadataUnreachableError);
|
|
498
|
-
const detail = causes.map((c) => c instanceof Error ? c.message : String(c)).join("; ");
|
|
499
|
-
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
500
|
-
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
501
|
-
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
484
|
+
const errors = [];
|
|
485
|
+
for (const url of metadataUrls) {
|
|
486
|
+
try {
|
|
487
|
+
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
488
|
+
} catch (err) {
|
|
489
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
490
|
+
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(error) });
|
|
491
|
+
errors.push(error);
|
|
492
|
+
}
|
|
502
493
|
}
|
|
494
|
+
const unreachable = errors.some((e) => e instanceof MetadataUnreachableError);
|
|
495
|
+
const detail = errors.map((e) => e.message).join("; ");
|
|
496
|
+
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
497
|
+
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
498
|
+
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
503
499
|
}
|
|
504
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer
|
|
500
|
+
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
505
501
|
log.debug("oauth.discovery.fetch", { url });
|
|
506
502
|
let response;
|
|
507
503
|
try {
|
|
508
504
|
response = await fetch(url, {
|
|
509
|
-
signal: AbortSignal.
|
|
505
|
+
signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS),
|
|
510
506
|
redirect: "manual"
|
|
511
507
|
});
|
|
512
508
|
} catch (err) {
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
} from "../../chunk-UQK5UO6C.js";
|
|
4
4
|
import {
|
|
5
5
|
createMcpProtocolHandler
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-KKAXS2RA.js";
|
|
7
7
|
import {
|
|
8
8
|
createOAuthProtectedResourceMetadataHandler
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-KI5LOYRQ.js";
|
|
10
10
|
import {
|
|
11
11
|
createInvokeToolHandler
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-ZFPENIDM.js";
|
|
13
13
|
import {
|
|
14
14
|
createListToolsHandler
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-MYVH5NU2.js";
|
|
16
16
|
import "../../chunk-MA5H6PSF.js";
|
|
17
17
|
import {
|
|
18
18
|
assertResourcePathShape,
|
|
19
19
|
createRecorderForRuntime
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-D32HYMP7.js";
|
|
21
21
|
import {
|
|
22
22
|
trimTrailingSlash
|
|
23
23
|
} from "../../chunk-H37EB22A.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
FUNCTIONS_MOUNT_PREFIX,
|
|
29
29
|
assertFunctionName
|
|
30
30
|
} from "../../chunk-XQWJN6DC.js";
|
|
31
|
-
import "../../chunk-
|
|
31
|
+
import "../../chunk-V6LIWJJB.js";
|
|
32
32
|
|
|
33
33
|
// src/stacks/supabase/handler.ts
|
|
34
34
|
function deriveResourcePath(options) {
|
|
@@ -129,7 +129,7 @@ function describeError(err) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
// package.json
|
|
132
|
-
var version = "0.21.0-rc.
|
|
132
|
+
var version = "0.21.0-rc.1";
|
|
133
133
|
|
|
134
134
|
// src/metrics/otlp.ts
|
|
135
135
|
var SCOPE_NAME = "@lovable.dev/mcp-js";
|
|
@@ -457,32 +457,28 @@ function oauthMetadataUrlsForIssuer(issuer) {
|
|
|
457
457
|
return [...pathInsertedOAuthMetadataUrls(url, path), `${normalizedIssuer}/.well-known/openid-configuration`];
|
|
458
458
|
}
|
|
459
459
|
async function fetchFirstValidOAuthServerMetadata(metadataUrls, expectedIssuer) {
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
controller.abort();
|
|
470
|
-
return metadata;
|
|
471
|
-
} catch (aggregate) {
|
|
472
|
-
const causes = aggregate instanceof AggregateError ? aggregate.errors : [aggregate];
|
|
473
|
-
const unreachable = causes.some((c) => c instanceof MetadataUnreachableError);
|
|
474
|
-
const detail = causes.map((c) => c instanceof Error ? c.message : String(c)).join("; ");
|
|
475
|
-
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
476
|
-
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
477
|
-
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
460
|
+
const errors = [];
|
|
461
|
+
for (const url of metadataUrls) {
|
|
462
|
+
try {
|
|
463
|
+
return await fetchOAuthServerMetadata(url, expectedIssuer);
|
|
464
|
+
} catch (err) {
|
|
465
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
466
|
+
log.debug("oauth.discovery.attempt_failed", { url, ...describeError(error) });
|
|
467
|
+
errors.push(error);
|
|
468
|
+
}
|
|
478
469
|
}
|
|
470
|
+
const unreachable = errors.some((e) => e instanceof MetadataUnreachableError);
|
|
471
|
+
const detail = errors.map((e) => e.message).join("; ");
|
|
472
|
+
log.error("oauth.discovery.exhausted", { expectedIssuer, urlsTried: metadataUrls, errors: detail, unreachable });
|
|
473
|
+
const message = `failed to discover OAuth server metadata (${detail})`;
|
|
474
|
+
throw unreachable ? new MetadataUnreachableError(message) : new Error(message);
|
|
479
475
|
}
|
|
480
|
-
async function fetchOAuthServerMetadata(url, expectedIssuer
|
|
476
|
+
async function fetchOAuthServerMetadata(url, expectedIssuer) {
|
|
481
477
|
log.debug("oauth.discovery.fetch", { url });
|
|
482
478
|
let response;
|
|
483
479
|
try {
|
|
484
480
|
response = await fetch(url, {
|
|
485
|
-
signal: AbortSignal.
|
|
481
|
+
signal: AbortSignal.timeout(METADATA_FETCH_TIMEOUT_MS),
|
|
486
482
|
redirect: "manual"
|
|
487
483
|
});
|
|
488
484
|
} catch (err) {
|
|
@@ -3,23 +3,23 @@ import {
|
|
|
3
3
|
} from "../../chunk-UQK5UO6C.js";
|
|
4
4
|
import {
|
|
5
5
|
createMcpProtocolHandler
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-KKAXS2RA.js";
|
|
7
7
|
import {
|
|
8
8
|
createOAuthProtectedResourceMetadataHandler
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-KI5LOYRQ.js";
|
|
10
10
|
import {
|
|
11
11
|
createInvokeToolHandler
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-ZFPENIDM.js";
|
|
13
13
|
import {
|
|
14
14
|
createListToolsHandler
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-MYVH5NU2.js";
|
|
16
16
|
import "../../chunk-MA5H6PSF.js";
|
|
17
17
|
import {
|
|
18
18
|
createRecorderForRuntime
|
|
19
|
-
} from "../../chunk-
|
|
19
|
+
} from "../../chunk-D32HYMP7.js";
|
|
20
20
|
import "../../chunk-H37EB22A.js";
|
|
21
21
|
import "../../chunk-6DXGZZA4.js";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-V6LIWJJB.js";
|
|
23
23
|
|
|
24
24
|
// src/stacks/tanstack/handlers.ts
|
|
25
25
|
var STACK = "tanstack";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/mcp-js",
|
|
3
|
-
"version": "0.21.0-rc.
|
|
3
|
+
"version": "0.21.0-rc.1",
|
|
4
4
|
"description": "Author MCP servers for Lovable apps. Declare tools with defineTool, register them in defineMcp, and a framework adapter (TanStack or Supabase Edge Functions) emits the route(s) at build time.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|