@lovable.dev/mcp-js 4.0.0-rc.0 → 4.0.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/README.md +104 -1
- package/dist/{authorize-Chb9Sb1f.d.ts → authorize-8crkySbp.d.ts} +1 -1
- package/dist/{authorize-Ba1deW5O.d.cts → authorize-BZdUmD37.d.cts} +1 -1
- package/dist/{base-D7ei8TjY.d.cts → base-CChLZaEN.d.cts} +1 -1
- package/dist/{base-D-lvtqSA.d.ts → base-DQPu0cno.d.ts} +1 -1
- package/dist/cli/check-server.cjs +61 -0
- package/dist/cli/check-server.d.cts +1 -0
- package/dist/cli/check-server.d.ts +1 -0
- package/dist/cli/check-server.js +62 -0
- package/dist/cli/extract-manifest.cjs +1 -1
- package/dist/cli/extract-manifest.js +1 -1
- package/dist/{cors-BuPvEjxu.cjs → cors-Ct-kdMcl.cjs} +1 -1
- package/dist/{cors-D9LajKfo.js → cors-Ct8SFh-_.js} +1 -1
- package/dist/diagnostic-ClI2_5MW.js +11 -0
- package/dist/diagnostic-DRKjgCsW.d.cts +12 -0
- package/dist/diagnostic-DRKjgCsW.d.ts +12 -0
- package/dist/diagnostic-ol9IE9Dl.cjs +16 -0
- package/dist/{errors-BEl2IOnx.js → errors-Cul5Uyfw.js} +3 -2
- package/dist/{errors-BlSu6Nrn.cjs → errors-ebgNFNvm.cjs} +3 -2
- package/dist/format-DDzvc92Z.cjs +41 -0
- package/dist/format-DKEuO8Tn.js +30 -0
- package/dist/hooks-BOdDe251.js +353 -0
- package/dist/hooks-xQl3EkDa.cjs +382 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{io-B72X5KDG.d.ts → io-4N9Hcw0w.d.ts} +1 -1
- package/dist/{io-foChTR9t.d.cts → io-Be8y8E2V.d.cts} +1 -1
- package/dist/{io-BpxqVag8.cjs → io-Bf4Narx6.cjs} +17 -5
- package/dist/{io-DFsll31O.js → io-VMIaguRH.js} +14 -2
- package/dist/{mcp-DMMqfwKm.cjs → mcp-By6C2M4i.cjs} +156 -70
- package/dist/{mcp-B1wBn_X-.js → mcp-DWxIy07i.js} +154 -68
- package/dist/{package-Bt33FsvP.cjs → package-CBMX__7C.cjs} +1 -1
- package/dist/{package-BWLBCBmc.js → package-Ci4yKJUI.js} +1 -1
- package/dist/protocols/mcp/index.cjs +1 -1
- package/dist/protocols/mcp/index.d.cts +3 -3
- package/dist/protocols/mcp/index.d.ts +3 -3
- package/dist/protocols/mcp/index.js +1 -1
- package/dist/protocols/oauth-metadata.cjs +1 -1
- package/dist/protocols/oauth-metadata.d.cts +3 -3
- package/dist/protocols/oauth-metadata.d.ts +3 -3
- package/dist/protocols/oauth-metadata.js +1 -1
- package/dist/stacks/supabase/index.cjs +2 -2
- package/dist/stacks/supabase/index.d.cts +1 -1
- package/dist/stacks/supabase/index.d.ts +1 -1
- package/dist/stacks/supabase/index.js +2 -2
- package/dist/stacks/supabase/vite.cjs +40 -19
- package/dist/stacks/supabase/vite.d.cts +1 -1
- package/dist/stacks/supabase/vite.d.ts +1 -1
- package/dist/stacks/supabase/vite.js +34 -13
- package/dist/stacks/tanstack/index.cjs +2 -2
- package/dist/stacks/tanstack/index.d.cts +2 -2
- package/dist/stacks/tanstack/index.d.ts +2 -2
- package/dist/stacks/tanstack/index.js +2 -2
- package/dist/stacks/tanstack/vite.cjs +33 -25
- package/dist/stacks/tanstack/vite.d.cts +1 -1
- package/dist/stacks/tanstack/vite.d.ts +1 -1
- package/dist/stacks/tanstack/vite.js +26 -18
- package/dist/testing/index.cjs +46 -0
- package/dist/testing/index.d.cts +10 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.js +44 -0
- package/dist/testing/server.cjs +197 -0
- package/dist/testing/server.d.cts +31 -0
- package/dist/testing/server.d.ts +31 -0
- package/dist/testing/server.js +195 -0
- package/dist/tool-result-teeTDoM1.js +70 -0
- package/dist/tool-result-yqOfZUOP.cjs +87 -0
- package/dist/{types-srTXYLoX.d.cts → types-CyDJi9Jb.d.cts} +7 -1
- package/dist/{types-srTXYLoX.d.ts → types-CyDJi9Jb.d.ts} +7 -1
- package/package.json +40 -4
- package/skill-imports.d.cts +1 -0
- package/skill-imports.d.ts +11 -0
- package/dist/fs-errors-CWNzOV75.cjs +0 -11
- package/dist/fs-errors-PA2t1TIp.js +0 -6
- package/dist/supabase-config-CakTU8YF.js +0 -26
- package/dist/supabase-config-Dz7dnUv0.cjs +0 -31
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { n as schemaFromDefinition } from "./schema-DBTR1XbM.js";
|
|
2
|
+
import { safeParseAsync } from "zod/v4/core";
|
|
3
|
+
//#region src/core/tool-result.ts
|
|
4
|
+
function normalizeResourceLinkIcon(icon) {
|
|
5
|
+
if (typeof icon.sizes !== "string") return icon;
|
|
6
|
+
const { sizes, ...rest } = icon;
|
|
7
|
+
const normalized = sizes.trim();
|
|
8
|
+
return normalized === "" ? rest : {
|
|
9
|
+
...rest,
|
|
10
|
+
sizes: normalized.split(/\s+/)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function normalizeToolContent(content) {
|
|
14
|
+
return (content ?? []).map((block) => {
|
|
15
|
+
if (block.type !== "resource_link" || block.icons === void 0) return block;
|
|
16
|
+
return {
|
|
17
|
+
...block,
|
|
18
|
+
icons: block.icons.map(normalizeResourceLinkIcon)
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function outputValidationError(text) {
|
|
23
|
+
return {
|
|
24
|
+
content: [{
|
|
25
|
+
type: "text",
|
|
26
|
+
text
|
|
27
|
+
}],
|
|
28
|
+
isError: true
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function isJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
|
|
32
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") return true;
|
|
33
|
+
if (typeof value === "number") return Number.isFinite(value);
|
|
34
|
+
if (typeof value !== "object" || ancestors.has(value)) return false;
|
|
35
|
+
const prototype = Object.getPrototypeOf(value);
|
|
36
|
+
if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) return false;
|
|
37
|
+
ancestors.add(value);
|
|
38
|
+
const valid = (Array.isArray(value) ? value : Object.values(value).filter((entry) => entry !== void 0)).every((entry) => isJsonValue(entry, ancestors));
|
|
39
|
+
ancestors.delete(value);
|
|
40
|
+
return valid;
|
|
41
|
+
}
|
|
42
|
+
async function finalizeToolResult(tool, result) {
|
|
43
|
+
const content = normalizeToolContent(result.content);
|
|
44
|
+
let structuredContent = result.structuredContent;
|
|
45
|
+
if (tool.outputSchema && !result.isError) {
|
|
46
|
+
if (structuredContent === void 0) return outputValidationError(`Output validation error: Tool ${tool.name} has an output schema but no structured content was provided`);
|
|
47
|
+
try {
|
|
48
|
+
const parsed = await safeParseAsync(schemaFromDefinition(tool.outputSchema, false), structuredContent);
|
|
49
|
+
if (!parsed.success) return outputValidationError(`Output validation error: Invalid structured content for tool ${tool.name}: ${parsed.error.message}`);
|
|
50
|
+
structuredContent = parsed.data;
|
|
51
|
+
} catch {
|
|
52
|
+
return outputValidationError(`Output validation error: Could not validate structured content for tool ${tool.name}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (structuredContent !== void 0 && !isJsonValue(structuredContent)) {
|
|
56
|
+
if (!result.isError) return outputValidationError(`Output validation error: Tool ${tool.name} returned a non-JSON structured value`);
|
|
57
|
+
structuredContent = void 0;
|
|
58
|
+
}
|
|
59
|
+
if (structuredContent !== void 0 && (structuredContent === null || typeof structuredContent !== "object" || Array.isArray(structuredContent)) && !content.some((block) => block.type === "text")) content.push({
|
|
60
|
+
type: "text",
|
|
61
|
+
text: JSON.stringify(structuredContent)
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
content,
|
|
65
|
+
structuredContent,
|
|
66
|
+
isError: result.isError
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { isJsonValue as n, normalizeToolContent as r, finalizeToolResult as t };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const require_schema = require("./schema-CjFpqCEP.cjs");
|
|
2
|
+
let zod_v4_core = require("zod/v4/core");
|
|
3
|
+
//#region src/core/tool-result.ts
|
|
4
|
+
function normalizeResourceLinkIcon(icon) {
|
|
5
|
+
if (typeof icon.sizes !== "string") return icon;
|
|
6
|
+
const { sizes, ...rest } = icon;
|
|
7
|
+
const normalized = sizes.trim();
|
|
8
|
+
return normalized === "" ? rest : {
|
|
9
|
+
...rest,
|
|
10
|
+
sizes: normalized.split(/\s+/)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function normalizeToolContent(content) {
|
|
14
|
+
return (content ?? []).map((block) => {
|
|
15
|
+
if (block.type !== "resource_link" || block.icons === void 0) return block;
|
|
16
|
+
return {
|
|
17
|
+
...block,
|
|
18
|
+
icons: block.icons.map(normalizeResourceLinkIcon)
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function outputValidationError(text) {
|
|
23
|
+
return {
|
|
24
|
+
content: [{
|
|
25
|
+
type: "text",
|
|
26
|
+
text
|
|
27
|
+
}],
|
|
28
|
+
isError: true
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function isJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
|
|
32
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") return true;
|
|
33
|
+
if (typeof value === "number") return Number.isFinite(value);
|
|
34
|
+
if (typeof value !== "object" || ancestors.has(value)) return false;
|
|
35
|
+
const prototype = Object.getPrototypeOf(value);
|
|
36
|
+
if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) return false;
|
|
37
|
+
ancestors.add(value);
|
|
38
|
+
const valid = (Array.isArray(value) ? value : Object.values(value).filter((entry) => entry !== void 0)).every((entry) => isJsonValue(entry, ancestors));
|
|
39
|
+
ancestors.delete(value);
|
|
40
|
+
return valid;
|
|
41
|
+
}
|
|
42
|
+
async function finalizeToolResult(tool, result) {
|
|
43
|
+
const content = normalizeToolContent(result.content);
|
|
44
|
+
let structuredContent = result.structuredContent;
|
|
45
|
+
if (tool.outputSchema && !result.isError) {
|
|
46
|
+
if (structuredContent === void 0) return outputValidationError(`Output validation error: Tool ${tool.name} has an output schema but no structured content was provided`);
|
|
47
|
+
try {
|
|
48
|
+
const parsed = await (0, zod_v4_core.safeParseAsync)(require_schema.schemaFromDefinition(tool.outputSchema, false), structuredContent);
|
|
49
|
+
if (!parsed.success) return outputValidationError(`Output validation error: Invalid structured content for tool ${tool.name}: ${parsed.error.message}`);
|
|
50
|
+
structuredContent = parsed.data;
|
|
51
|
+
} catch {
|
|
52
|
+
return outputValidationError(`Output validation error: Could not validate structured content for tool ${tool.name}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (structuredContent !== void 0 && !isJsonValue(structuredContent)) {
|
|
56
|
+
if (!result.isError) return outputValidationError(`Output validation error: Tool ${tool.name} returned a non-JSON structured value`);
|
|
57
|
+
structuredContent = void 0;
|
|
58
|
+
}
|
|
59
|
+
if (structuredContent !== void 0 && (structuredContent === null || typeof structuredContent !== "object" || Array.isArray(structuredContent)) && !content.some((block) => block.type === "text")) content.push({
|
|
60
|
+
type: "text",
|
|
61
|
+
text: JSON.stringify(structuredContent)
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
content,
|
|
65
|
+
structuredContent,
|
|
66
|
+
isError: result.isError
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
Object.defineProperty(exports, "finalizeToolResult", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function() {
|
|
73
|
+
return finalizeToolResult;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "isJsonValue", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function() {
|
|
79
|
+
return isJsonValue;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "normalizeToolContent", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function() {
|
|
85
|
+
return normalizeToolContent;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
@@ -180,6 +180,11 @@ interface MetricsOptions {
|
|
|
180
180
|
/** Either the bare on/off toggle or the full options object. */
|
|
181
181
|
type MetricsConfig = boolean | MetricsOptions;
|
|
182
182
|
//#endregion
|
|
183
|
+
//#region src/skills/format.d.ts
|
|
184
|
+
interface Skill {
|
|
185
|
+
readonly __skill: never;
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
183
188
|
//#region src/core/types.d.ts
|
|
184
189
|
/** A Zod 4 schema, from Classic or Mini. */
|
|
185
190
|
type ZodSchema = $ZodType;
|
|
@@ -391,6 +396,7 @@ type McpDefinitionInput<TAppContext = undefined> = {
|
|
|
391
396
|
*/
|
|
392
397
|
readonly instructions: string;
|
|
393
398
|
readonly tools: readonly (AnyAppContextToolDefinition<TAppContext> | StaticToolDefinition)[];
|
|
399
|
+
readonly skills?: readonly Skill[];
|
|
394
400
|
/**
|
|
395
401
|
* Usage-metrics emission (runtime telemetry), on by default. `false` opts out;
|
|
396
402
|
* `{ endpoint, headers }` sends to your own OTLP collector. Self-disables at
|
|
@@ -405,4 +411,4 @@ type McpDefinition<TAppContext = unknown> = Omit<McpDefinitionInput<TAppContext>
|
|
|
405
411
|
readonly [McpDefinitionBrand]: never;
|
|
406
412
|
};
|
|
407
413
|
//#endregion
|
|
408
|
-
export {
|
|
414
|
+
export { AuthContext as A, ToolVisibilityContext as C, Skill as D, ZodSchema as E, JwtClaims as F, McpAuthConfig as I, McpProtocolEra as M, ProgressUpdate as N, MetricsConfig as O, ToolContext as P, ToolHandlerResult as S, ZodRawShape as T, ResourceLinkIcon as _, ContentBlock as a, ToolContent as b, EmbeddedResource as c, JsonValue as d, JsonValueInput as f, ResourceLink as g, McpDefinitionInput as h, ContentAnnotations as i, McpClientInfo as j, MetricsOptions as k, EmbeddedTextResource as l, McpDefinition as m, AppContextToolDefinitionInput as n, CreateAppContextInput as o, McpAllowedOrigins as p, AudioContent as r, EmbeddedBlobResource as s, AppContextToolDefinition as t, ImageContent as u, TextContent as v, ZodOutputSchema as w, ToolDefinition as x, ToolAnnotations as y };
|
|
@@ -180,6 +180,11 @@ interface MetricsOptions {
|
|
|
180
180
|
/** Either the bare on/off toggle or the full options object. */
|
|
181
181
|
type MetricsConfig = boolean | MetricsOptions;
|
|
182
182
|
//#endregion
|
|
183
|
+
//#region src/skills/format.d.ts
|
|
184
|
+
interface Skill {
|
|
185
|
+
readonly __skill: never;
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
183
188
|
//#region src/core/types.d.ts
|
|
184
189
|
/** A Zod 4 schema, from Classic or Mini. */
|
|
185
190
|
type ZodSchema = $ZodType;
|
|
@@ -391,6 +396,7 @@ type McpDefinitionInput<TAppContext = undefined> = {
|
|
|
391
396
|
*/
|
|
392
397
|
readonly instructions: string;
|
|
393
398
|
readonly tools: readonly (AnyAppContextToolDefinition<TAppContext> | StaticToolDefinition)[];
|
|
399
|
+
readonly skills?: readonly Skill[];
|
|
394
400
|
/**
|
|
395
401
|
* Usage-metrics emission (runtime telemetry), on by default. `false` opts out;
|
|
396
402
|
* `{ endpoint, headers }` sends to your own OTLP collector. Self-disables at
|
|
@@ -405,4 +411,4 @@ type McpDefinition<TAppContext = unknown> = Omit<McpDefinitionInput<TAppContext>
|
|
|
405
411
|
readonly [McpDefinitionBrand]: never;
|
|
406
412
|
};
|
|
407
413
|
//#endregion
|
|
408
|
-
export {
|
|
414
|
+
export { AuthContext as A, ToolVisibilityContext as C, Skill as D, ZodSchema as E, JwtClaims as F, McpAuthConfig as I, McpProtocolEra as M, ProgressUpdate as N, MetricsConfig as O, ToolContext as P, ToolHandlerResult as S, ZodRawShape as T, ResourceLinkIcon as _, ContentBlock as a, ToolContent as b, EmbeddedResource as c, JsonValue as d, JsonValueInput as f, ResourceLink as g, McpDefinitionInput as h, ContentAnnotations as i, McpClientInfo as j, MetricsOptions as k, EmbeddedTextResource as l, McpDefinition as m, AppContextToolDefinitionInput as n, CreateAppContextInput as o, McpAllowedOrigins as p, AudioContent as r, EmbeddedBlobResource as s, AppContextToolDefinition as t, ImageContent as u, TextContent as v, ZodOutputSchema as w, ToolDefinition as x, ToolAnnotations as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/mcp-js",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
"module": "./dist/index.js",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"exports": {
|
|
25
|
+
"./skill-imports": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./skill-imports.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"require": {
|
|
30
|
+
"types": "./skill-imports.d.cts"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
25
33
|
".": {
|
|
26
34
|
"import": {
|
|
27
35
|
"types": "./dist/index.d.ts",
|
|
@@ -82,6 +90,26 @@
|
|
|
82
90
|
"default": "./dist/stacks/supabase/index.cjs"
|
|
83
91
|
}
|
|
84
92
|
},
|
|
93
|
+
"./testing": {
|
|
94
|
+
"import": {
|
|
95
|
+
"types": "./dist/testing/index.d.ts",
|
|
96
|
+
"default": "./dist/testing/index.js"
|
|
97
|
+
},
|
|
98
|
+
"require": {
|
|
99
|
+
"types": "./dist/testing/index.d.cts",
|
|
100
|
+
"default": "./dist/testing/index.cjs"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"./testing/server": {
|
|
104
|
+
"import": {
|
|
105
|
+
"types": "./dist/testing/server.d.ts",
|
|
106
|
+
"default": "./dist/testing/server.js"
|
|
107
|
+
},
|
|
108
|
+
"require": {
|
|
109
|
+
"types": "./dist/testing/server.d.cts",
|
|
110
|
+
"default": "./dist/testing/server.cjs"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
85
113
|
"./stacks/supabase/vite": {
|
|
86
114
|
"import": {
|
|
87
115
|
"types": "./dist/stacks/supabase/vite.d.ts",
|
|
@@ -94,10 +122,13 @@
|
|
|
94
122
|
}
|
|
95
123
|
},
|
|
96
124
|
"bin": {
|
|
125
|
+
"lovable-mcp-check": "./dist/cli/check-server.cjs",
|
|
97
126
|
"lovable-mcp-extract-manifest": "./dist/cli/extract-manifest.js"
|
|
98
127
|
},
|
|
99
128
|
"files": [
|
|
100
|
-
"dist"
|
|
129
|
+
"dist",
|
|
130
|
+
"skill-imports.d.ts",
|
|
131
|
+
"skill-imports.d.cts"
|
|
101
132
|
],
|
|
102
133
|
"keywords": [
|
|
103
134
|
"mcp",
|
|
@@ -108,15 +139,19 @@
|
|
|
108
139
|
],
|
|
109
140
|
"license": "MIT",
|
|
110
141
|
"dependencies": {
|
|
142
|
+
"@modelcontextprotocol/client": "2.3.0",
|
|
143
|
+
"@modelcontextprotocol/core": "2.3.0",
|
|
111
144
|
"@modelcontextprotocol/server": "2.0.0",
|
|
112
145
|
"esbuild": "^0.27.0",
|
|
113
|
-
"jose": "^6.2.2"
|
|
146
|
+
"jose": "^6.2.2",
|
|
147
|
+
"js-yaml": "^4.3.2"
|
|
114
148
|
},
|
|
115
149
|
"peerDependencies": {
|
|
116
150
|
"vite": ">=5.0.0 <9.0.0",
|
|
117
151
|
"zod": "^3.25.76 || ^4.0.0"
|
|
118
152
|
},
|
|
119
153
|
"devDependencies": {
|
|
154
|
+
"@types/js-yaml": "^4.0.9",
|
|
120
155
|
"@types/node": "22.13.13",
|
|
121
156
|
"rimraf": "^5.0.0",
|
|
122
157
|
"tsdown": "^0.22.5",
|
|
@@ -134,7 +169,8 @@
|
|
|
134
169
|
"format:check": "oxfmt --check src/ tests/",
|
|
135
170
|
"lint": "oxfmt --check src/ tests/ && oxlint -c ../../oxlint.config.ts src/ tests/",
|
|
136
171
|
"lint:fix": "oxfmt --write src/ tests/ && oxlint -c ../../oxlint.config.ts --fix src/ tests/",
|
|
137
|
-
"test": "vitest run --project unit && npm run test:package:zod",
|
|
172
|
+
"test": "vitest run --project unit && npm run test:package:zod && node tests/package/testing-kit.mjs",
|
|
173
|
+
"test:package:testing": "npm run build && node tests/package/testing-kit.mjs",
|
|
138
174
|
"test:package:zod": "npm run build && node tests/package/zod-compat.mjs",
|
|
139
175
|
"test:watch": "vitest --project unit",
|
|
140
176
|
"example:tanstack:install": "bun link && cd example/tanstack && bun install && bun link @lovable.dev/mcp-js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path="./skill-imports.d.ts" />
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare module "*?skill" {
|
|
2
|
+
import type { Skill } from "@lovable.dev/mcp-js";
|
|
3
|
+
const skill: Skill;
|
|
4
|
+
export default skill;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare module "*&skill" {
|
|
8
|
+
import type { Skill } from "@lovable.dev/mcp-js";
|
|
9
|
+
const skill: Skill;
|
|
10
|
+
export default skill;
|
|
11
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/core/fs-errors.ts
|
|
2
|
-
function isFileMissing(err) {
|
|
3
|
-
return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
|
|
4
|
-
}
|
|
5
|
-
//#endregion
|
|
6
|
-
Object.defineProperty(exports, "isFileMissing", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return isFileMissing;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { t as isFileMissing } from "./fs-errors-PA2t1TIp.js";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
//#region src/core/supabase-config.ts
|
|
5
|
-
const SUPABASE_CONFIG_RELATIVE_PATH = "supabase/config.toml";
|
|
6
|
-
function readSupabaseProjectRef(projectRoot) {
|
|
7
|
-
let content;
|
|
8
|
-
try {
|
|
9
|
-
content = readFileSync(join(projectRoot, SUPABASE_CONFIG_RELATIVE_PATH), "utf8");
|
|
10
|
-
} catch (err) {
|
|
11
|
-
if (isFileMissing(err)) return void 0;
|
|
12
|
-
throw err;
|
|
13
|
-
}
|
|
14
|
-
for (const raw of content.split(/\r?\n/)) {
|
|
15
|
-
const line = raw.trim();
|
|
16
|
-
if (line.length === 0 || line.startsWith("#")) continue;
|
|
17
|
-
if (line.startsWith("[")) break;
|
|
18
|
-
const match = /^project_id\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(line);
|
|
19
|
-
if (match) {
|
|
20
|
-
const value = match[1] ?? match[2] ?? "";
|
|
21
|
-
return value.length > 0 ? value : void 0;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { readSupabaseProjectRef as t };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const require_fs_errors = require("./fs-errors-CWNzOV75.cjs");
|
|
2
|
-
let node_fs = require("node:fs");
|
|
3
|
-
let node_path = require("node:path");
|
|
4
|
-
//#region src/core/supabase-config.ts
|
|
5
|
-
const SUPABASE_CONFIG_RELATIVE_PATH = "supabase/config.toml";
|
|
6
|
-
function readSupabaseProjectRef(projectRoot) {
|
|
7
|
-
let content;
|
|
8
|
-
try {
|
|
9
|
-
content = (0, node_fs.readFileSync)((0, node_path.join)(projectRoot, SUPABASE_CONFIG_RELATIVE_PATH), "utf8");
|
|
10
|
-
} catch (err) {
|
|
11
|
-
if (require_fs_errors.isFileMissing(err)) return void 0;
|
|
12
|
-
throw err;
|
|
13
|
-
}
|
|
14
|
-
for (const raw of content.split(/\r?\n/)) {
|
|
15
|
-
const line = raw.trim();
|
|
16
|
-
if (line.length === 0 || line.startsWith("#")) continue;
|
|
17
|
-
if (line.startsWith("[")) break;
|
|
18
|
-
const match = /^project_id\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(line);
|
|
19
|
-
if (match) {
|
|
20
|
-
const value = match[1] ?? match[2] ?? "";
|
|
21
|
-
return value.length > 0 ? value : void 0;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
Object.defineProperty(exports, "readSupabaseProjectRef", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function() {
|
|
29
|
-
return readSupabaseProjectRef;
|
|
30
|
-
}
|
|
31
|
-
});
|