@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.
Files changed (78) hide show
  1. package/README.md +104 -1
  2. package/dist/{authorize-Chb9Sb1f.d.ts → authorize-8crkySbp.d.ts} +1 -1
  3. package/dist/{authorize-Ba1deW5O.d.cts → authorize-BZdUmD37.d.cts} +1 -1
  4. package/dist/{base-D7ei8TjY.d.cts → base-CChLZaEN.d.cts} +1 -1
  5. package/dist/{base-D-lvtqSA.d.ts → base-DQPu0cno.d.ts} +1 -1
  6. package/dist/cli/check-server.cjs +61 -0
  7. package/dist/cli/check-server.d.cts +1 -0
  8. package/dist/cli/check-server.d.ts +1 -0
  9. package/dist/cli/check-server.js +62 -0
  10. package/dist/cli/extract-manifest.cjs +1 -1
  11. package/dist/cli/extract-manifest.js +1 -1
  12. package/dist/{cors-BuPvEjxu.cjs → cors-Ct-kdMcl.cjs} +1 -1
  13. package/dist/{cors-D9LajKfo.js → cors-Ct8SFh-_.js} +1 -1
  14. package/dist/diagnostic-ClI2_5MW.js +11 -0
  15. package/dist/diagnostic-DRKjgCsW.d.cts +12 -0
  16. package/dist/diagnostic-DRKjgCsW.d.ts +12 -0
  17. package/dist/diagnostic-ol9IE9Dl.cjs +16 -0
  18. package/dist/{errors-BEl2IOnx.js → errors-Cul5Uyfw.js} +3 -2
  19. package/dist/{errors-BlSu6Nrn.cjs → errors-ebgNFNvm.cjs} +3 -2
  20. package/dist/format-DDzvc92Z.cjs +41 -0
  21. package/dist/format-DKEuO8Tn.js +30 -0
  22. package/dist/hooks-BOdDe251.js +353 -0
  23. package/dist/hooks-xQl3EkDa.cjs +382 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.cts +2 -2
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +1 -1
  28. package/dist/{io-B72X5KDG.d.ts → io-4N9Hcw0w.d.ts} +1 -1
  29. package/dist/{io-foChTR9t.d.cts → io-Be8y8E2V.d.cts} +1 -1
  30. package/dist/{io-BpxqVag8.cjs → io-Bf4Narx6.cjs} +17 -5
  31. package/dist/{io-DFsll31O.js → io-VMIaguRH.js} +14 -2
  32. package/dist/{mcp-DMMqfwKm.cjs → mcp-By6C2M4i.cjs} +156 -70
  33. package/dist/{mcp-B1wBn_X-.js → mcp-DWxIy07i.js} +154 -68
  34. package/dist/{package-Bt33FsvP.cjs → package-CBMX__7C.cjs} +1 -1
  35. package/dist/{package-BWLBCBmc.js → package-Ci4yKJUI.js} +1 -1
  36. package/dist/protocols/mcp/index.cjs +1 -1
  37. package/dist/protocols/mcp/index.d.cts +3 -3
  38. package/dist/protocols/mcp/index.d.ts +3 -3
  39. package/dist/protocols/mcp/index.js +1 -1
  40. package/dist/protocols/oauth-metadata.cjs +1 -1
  41. package/dist/protocols/oauth-metadata.d.cts +3 -3
  42. package/dist/protocols/oauth-metadata.d.ts +3 -3
  43. package/dist/protocols/oauth-metadata.js +1 -1
  44. package/dist/stacks/supabase/index.cjs +2 -2
  45. package/dist/stacks/supabase/index.d.cts +1 -1
  46. package/dist/stacks/supabase/index.d.ts +1 -1
  47. package/dist/stacks/supabase/index.js +2 -2
  48. package/dist/stacks/supabase/vite.cjs +40 -19
  49. package/dist/stacks/supabase/vite.d.cts +1 -1
  50. package/dist/stacks/supabase/vite.d.ts +1 -1
  51. package/dist/stacks/supabase/vite.js +34 -13
  52. package/dist/stacks/tanstack/index.cjs +2 -2
  53. package/dist/stacks/tanstack/index.d.cts +2 -2
  54. package/dist/stacks/tanstack/index.d.ts +2 -2
  55. package/dist/stacks/tanstack/index.js +2 -2
  56. package/dist/stacks/tanstack/vite.cjs +33 -25
  57. package/dist/stacks/tanstack/vite.d.cts +1 -1
  58. package/dist/stacks/tanstack/vite.d.ts +1 -1
  59. package/dist/stacks/tanstack/vite.js +26 -18
  60. package/dist/testing/index.cjs +46 -0
  61. package/dist/testing/index.d.cts +10 -0
  62. package/dist/testing/index.d.ts +10 -0
  63. package/dist/testing/index.js +44 -0
  64. package/dist/testing/server.cjs +197 -0
  65. package/dist/testing/server.d.cts +31 -0
  66. package/dist/testing/server.d.ts +31 -0
  67. package/dist/testing/server.js +195 -0
  68. package/dist/tool-result-teeTDoM1.js +70 -0
  69. package/dist/tool-result-yqOfZUOP.cjs +87 -0
  70. package/dist/{types-srTXYLoX.d.cts → types-CyDJi9Jb.d.cts} +7 -1
  71. package/dist/{types-srTXYLoX.d.ts → types-CyDJi9Jb.d.ts} +7 -1
  72. package/package.json +40 -4
  73. package/skill-imports.d.cts +1 -0
  74. package/skill-imports.d.ts +11 -0
  75. package/dist/fs-errors-CWNzOV75.cjs +0 -11
  76. package/dist/fs-errors-PA2t1TIp.js +0 -6
  77. package/dist/supabase-config-CakTU8YF.js +0 -26
  78. package/dist/supabase-config-Dz7dnUv0.cjs +0 -31
@@ -0,0 +1,353 @@
1
+ import { t as COMPILED_SKILL_KIND } from "./format-DKEuO8Tn.js";
2
+ import { lstatSync, readFileSync, readdirSync } from "node:fs";
3
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import { createHash } from "node:crypto";
5
+ import { JSON_SCHEMA, load } from "js-yaml";
6
+ //#region src/core/fs-errors.ts
7
+ function isFileMissing(err) {
8
+ return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
9
+ }
10
+ //#endregion
11
+ //#region src/core/supabase-config.ts
12
+ const SUPABASE_CONFIG_RELATIVE_PATH = "supabase/config.toml";
13
+ function readSupabaseProjectRef(projectRoot) {
14
+ let content;
15
+ try {
16
+ content = readFileSync(join(projectRoot, SUPABASE_CONFIG_RELATIVE_PATH), "utf8");
17
+ } catch (err) {
18
+ if (isFileMissing(err)) return void 0;
19
+ throw err;
20
+ }
21
+ for (const raw of content.split(/\r?\n/)) {
22
+ const line = raw.trim();
23
+ if (line.length === 0 || line.startsWith("#")) continue;
24
+ if (line.startsWith("[")) break;
25
+ const match = /^project_id\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(line);
26
+ if (match) {
27
+ const value = match[1] ?? match[2] ?? "";
28
+ return value.length > 0 ? value : void 0;
29
+ }
30
+ }
31
+ }
32
+ //#endregion
33
+ //#region src/skills/frontmatter.ts
34
+ const NAME_RE = /^[\p{Ll}\p{Lo}\p{N}]+(?:-[\p{Ll}\p{Lo}\p{N}]+)*$/u;
35
+ function assertJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
36
+ if (value === null || typeof value === "string" || typeof value === "boolean") return;
37
+ if (typeof value === "number" && Number.isFinite(value) && !Object.is(value, -0)) {
38
+ if (!Number.isInteger(value) || Number.isSafeInteger(value)) return;
39
+ }
40
+ if (typeof value !== "object" || value === null || ancestors.has(value)) throw new Error("frontmatter must contain finite JSON values without cycles or unsafe integers");
41
+ ancestors.add(value);
42
+ for (const child of Object.values(value)) assertJsonValue(child, ancestors);
43
+ ancestors.delete(value);
44
+ }
45
+ function parseFrontmatter(text, fileAbs) {
46
+ const body = text.startsWith("") ? text.slice(1) : text;
47
+ const match = /^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(body);
48
+ if (!match) throw new Error(`@lovable.dev/mcp-js: ${fileAbs} must start with YAML frontmatter delimited by ---`);
49
+ let parsed;
50
+ try {
51
+ parsed = load(match[1], {
52
+ schema: JSON_SCHEMA,
53
+ filename: fileAbs
54
+ });
55
+ } catch (err) {
56
+ throw new Error(`@lovable.dev/mcp-js: invalid SKILL.md frontmatter in ${fileAbs}: ${err.message}`);
57
+ }
58
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(`@lovable.dev/mcp-js: SKILL.md frontmatter must be a mapping in ${fileAbs}`);
59
+ try {
60
+ assertJsonValue(parsed);
61
+ } catch (error) {
62
+ throw new Error(`@lovable.dev/mcp-js: invalid frontmatter in ${fileAbs}: ${error.message}`);
63
+ }
64
+ return parsed;
65
+ }
66
+ function validateIdentity(frontmatter, rootAbs, skillPath) {
67
+ const { name, description } = frontmatter;
68
+ if (typeof name !== "string" || Array.from(name).length > 64 || !NAME_RE.test(name)) throw new Error(`@lovable.dev/mcp-js: invalid skill name ${JSON.stringify(name)} in ${rootAbs}/SKILL.md`);
69
+ if (name !== basename(rootAbs)) throw new Error(`@lovable.dev/mcp-js: skill name "${name}" must equal its directory name "${basename(rootAbs)}"`);
70
+ if (typeof description !== "string" || description.trim().length === 0 || Array.from(description).length > 1024) throw new Error(`@lovable.dev/mcp-js: skill description must be a 1-1024 character string in ${rootAbs}/SKILL.md`);
71
+ if (skillPath.split("/").some((part) => !part || part === "." || part === ".." || /[\\\s]/u.test(part) || Array.from(part).some((char) => char < " ")) || skillPath.split("/").at(-1) !== name) throw new Error(`@lovable.dev/mcp-js: skill path must end in ${name} and contain nonempty directory segments: ${skillPath}`);
72
+ }
73
+ function validateOptionalFields(frontmatter, rootAbs) {
74
+ for (const field of [
75
+ "license",
76
+ "compatibility",
77
+ "allowed-tools"
78
+ ]) if (frontmatter[field] !== void 0 && typeof frontmatter[field] !== "string") throw new Error(`@lovable.dev/mcp-js: ${field} must be a string in ${rootAbs}/SKILL.md`);
79
+ if (typeof frontmatter.compatibility === "string" && (!frontmatter.compatibility.trim() || Array.from(frontmatter.compatibility).length > 500)) throw new Error(`@lovable.dev/mcp-js: compatibility must be 1-500 characters in ${rootAbs}/SKILL.md`);
80
+ const metadata = frontmatter.metadata;
81
+ if (metadata !== void 0 && (metadata === null || typeof metadata !== "object" || Array.isArray(metadata) || Object.values(metadata).some((value) => typeof value !== "string"))) throw new Error(`@lovable.dev/mcp-js: metadata must map strings to strings in ${rootAbs}/SKILL.md`);
82
+ }
83
+ function readSkillFrontmatter(text, rootAbs, skillPath) {
84
+ const frontmatter = parseFrontmatter(text, join(rootAbs, "SKILL.md"));
85
+ validateIdentity(frontmatter, rootAbs, skillPath);
86
+ validateOptionalFields(frontmatter, rootAbs);
87
+ return frontmatter;
88
+ }
89
+ //#endregion
90
+ //#region src/skills/compile.ts
91
+ function mimeTypeFor(path) {
92
+ const lower = path.toLowerCase();
93
+ if (lower.endsWith(".md") || lower.endsWith(".markdown")) return "text/markdown";
94
+ if (lower.endsWith(".json")) return "application/json";
95
+ if (lower.endsWith(".yaml") || lower.endsWith(".yml")) return "application/yaml";
96
+ if (lower.endsWith(".csv")) return "text/csv";
97
+ return "text/plain";
98
+ }
99
+ function compareBytes(a, b) {
100
+ return Buffer.compare(Buffer.from(a, "utf8"), Buffer.from(b, "utf8"));
101
+ }
102
+ function approvedHiddenFiles(allowHidden) {
103
+ const allowed = new Set(allowHidden);
104
+ for (const path of allowed) {
105
+ const segments = path.split("/");
106
+ if (segments.some((part) => !part || part === "." || part === "..") || !segments.some((part) => part.startsWith(".")) || Array.from(path).some((char) => "\\:*?[]".includes(char) || char < " " || char === "")) throw new Error(`@lovable.dev/mcp-js: allowHidden requires exact relative hidden-file paths, not directories or globs: ${path}`);
107
+ }
108
+ return allowed;
109
+ }
110
+ function walk(rootAbs, allowHidden) {
111
+ const files = [];
112
+ const dirs = [rootAbs];
113
+ const allowed = approvedHiddenFiles(allowHidden);
114
+ const visit = (dirAbs, relPrefix) => {
115
+ for (const entry of readdirSync(dirAbs)) {
116
+ const abs = join(dirAbs, entry);
117
+ const rel = relPrefix ? `${relPrefix}/${entry}` : entry;
118
+ const stat = lstatSync(abs);
119
+ if (stat.isSymbolicLink()) throw new Error(`@lovable.dev/mcp-js: skill files must not be symlinks: ${abs}`);
120
+ if (rel.split("/").some((part) => part.startsWith(".")) && !(stat.isDirectory() ? allowHidden.some((path) => path.startsWith(`${rel}/`)) : allowed.has(rel))) throw new Error(`@lovable.dev/mcp-js: hidden skill entry ${rel} is not approved for publication; remove it or add an exact allowHidden=<relative-file-path> to the ?skill import`);
121
+ if (stat.isDirectory()) {
122
+ dirs.push(abs);
123
+ visit(abs, rel);
124
+ } else if (stat.isFile()) files.push(rel);
125
+ else throw new Error(`@lovable.dev/mcp-js: unsupported skill file type: ${abs}`);
126
+ }
127
+ };
128
+ visit(rootAbs, "");
129
+ for (const path of allowed) if (!files.includes(path)) throw new Error(`@lovable.dev/mcp-js: allowHidden entry does not name a skill file: ${path}`);
130
+ return {
131
+ files,
132
+ dirs
133
+ };
134
+ }
135
+ function encodeUri(skillPath, relPath) {
136
+ const segments = [...skillPath.split("/"), ...relPath.split("/")].map((segment) => encodeURIComponent(segment));
137
+ return new URL(`skill://${segments.join("/")}`).href;
138
+ }
139
+ function decodeSkillFile(bytes, abs) {
140
+ let text;
141
+ try {
142
+ text = new TextDecoder("utf-8", {
143
+ fatal: true,
144
+ ignoreBOM: true
145
+ }).decode(bytes);
146
+ } catch {
147
+ throw new Error(`@lovable.dev/mcp-js: skill file is not UTF-8 text (unsupported in this release): ${abs}`);
148
+ }
149
+ for (const char of text) if (char < " " && char !== " " && char !== "\n" && char !== "\r" || char === "") throw new Error(`@lovable.dev/mcp-js: skill file contains binary control characters: ${abs}`);
150
+ return text;
151
+ }
152
+ function compileSkillDirectory(dirInput, skillPath = basename(resolve(dirInput)), allowHidden = []) {
153
+ const rootAbs = resolve(dirInput);
154
+ for (let path = rootAbs;; path = dirname(path)) {
155
+ if (lstatSync(path).isSymbolicLink()) throw new Error(`@lovable.dev/mcp-js: skill paths must not be symlinks: ${path}`);
156
+ if (dirname(path) === path) break;
157
+ }
158
+ const rootStat = lstatSync(rootAbs);
159
+ if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) throw new Error(`@lovable.dev/mcp-js: ?skill import must name a real directory: ${rootAbs}`);
160
+ const { files: relPaths, dirs } = walk(rootAbs, allowHidden);
161
+ if (!relPaths.includes("SKILL.md")) throw new Error(`@lovable.dev/mcp-js: ${rootAbs} has no SKILL.md`);
162
+ relPaths.sort((a, b) => a === "SKILL.md" ? -1 : b === "SKILL.md" ? 1 : compareBytes(a, b));
163
+ const decoder = new TextDecoder("utf-8", {
164
+ fatal: true,
165
+ ignoreBOM: true
166
+ });
167
+ const skillBytes = readFileSync(join(rootAbs, "SKILL.md"));
168
+ const frontmatter = readSkillFrontmatter((() => {
169
+ try {
170
+ return decoder.decode(skillBytes);
171
+ } catch {
172
+ throw new Error(`@lovable.dev/mcp-js: ${join(rootAbs, "SKILL.md")} is not valid UTF-8`);
173
+ }
174
+ })(), rootAbs, skillPath);
175
+ let totalBytes = 0;
176
+ const files = relPaths.map((path) => {
177
+ const abs = join(rootAbs, path);
178
+ const bytes = path === "SKILL.md" ? skillBytes : readFileSync(abs);
179
+ totalBytes += bytes.byteLength;
180
+ const text = decodeSkillFile(bytes, abs);
181
+ return {
182
+ path,
183
+ uri: encodeUri(skillPath, path),
184
+ mimeType: mimeTypeFor(path),
185
+ text,
186
+ size: bytes.byteLength,
187
+ digest: `sha256:${createHash("sha256").update(bytes).digest("hex")}`
188
+ };
189
+ });
190
+ const uri = encodeUri(skillPath, "SKILL.md");
191
+ const skill = {
192
+ kind: COMPILED_SKILL_KIND,
193
+ uri,
194
+ rootUri: uri.slice(0, -9),
195
+ frontmatter,
196
+ files
197
+ };
198
+ const report = [`[@lovable.dev/mcp-js] skill ${uri} (${files.length} files, ${totalBytes} bytes) — every file below is published to authorized MCP clients:`, ...files.map((file) => ` ${file.uri} ${file.size} B ${file.digest}`)].join("\n");
199
+ return {
200
+ skill,
201
+ watchFiles: relPaths.map((path) => join(rootAbs, path)),
202
+ watchDirs: dirs,
203
+ report
204
+ };
205
+ }
206
+ function skillModuleSource(compilation) {
207
+ return `export default JSON.parse(${JSON.stringify(JSON.stringify(compilation.skill))});\n`;
208
+ }
209
+ //#endregion
210
+ //#region src/skills/imports.ts
211
+ const SKILL_IMPORT_FILTER = /[?&]skill$/;
212
+ function skillImportId(directory, spec) {
213
+ const options = spec.skillPath === void 0 ? [] : [`path=${encodeURIComponent(spec.skillPath)}`];
214
+ for (const path of [...spec.allowHidden].sort()) options.push(`allowHidden=${encodeURIComponent(path)}`);
215
+ return `${directory}?${[...options, "skill"].join("&")}`;
216
+ }
217
+ function parseOption(option, id) {
218
+ const equals = option.indexOf("=");
219
+ const key = option.slice(0, equals);
220
+ if (equals < 0 || key !== "path" && key !== "allowHidden") throw new Error(`@lovable.dev/mcp-js: unknown ?skill import option: ${option}`);
221
+ try {
222
+ return [key, decodeURIComponent(option.slice(equals + 1))];
223
+ } catch {
224
+ throw new Error(`@lovable.dev/mcp-js: invalid percent encoding in ?skill import: ${id}`);
225
+ }
226
+ }
227
+ function parseSkillImport(id) {
228
+ const queryStart = id.lastIndexOf("?");
229
+ if (queryStart < 0 || /[\r\n\u2028\u2029]/.test(id)) return void 0;
230
+ const query = id.slice(queryStart + 1);
231
+ if (query !== "skill" && !query.endsWith("&skill")) return void 0;
232
+ const options = query === "skill" ? [] : query.slice(0, -6).split("&");
233
+ let skillPath;
234
+ const allowHidden = [];
235
+ for (const option of options) {
236
+ const [key, value] = parseOption(option, id);
237
+ if (key === "path") {
238
+ if (skillPath !== void 0) throw new Error("@lovable.dev/mcp-js: duplicate path in ?skill import");
239
+ skillPath = value;
240
+ } else {
241
+ if (allowHidden.includes(value)) throw new Error(`@lovable.dev/mcp-js: duplicate allowHidden entry: ${value}`);
242
+ allowHidden.push(value);
243
+ }
244
+ }
245
+ return {
246
+ directory: id.slice(0, queryStart),
247
+ skillPath,
248
+ allowHidden
249
+ };
250
+ }
251
+ //#endregion
252
+ //#region src/skills/hooks.ts
253
+ const VIRTUAL_PREFIX = "\0lovable-mcp-skill:";
254
+ const ESBUILD_NAMESPACE = "lovable-mcp-skill";
255
+ function resolveSkillDir(spec, baseDir) {
256
+ if (!spec.startsWith(".") && !isAbsolute(spec)) return void 0;
257
+ return resolve(baseDir, spec);
258
+ }
259
+ function isUnder(dir, file) {
260
+ return file === dir || file.startsWith(dir + sep);
261
+ }
262
+ function invalidateModule(server, id) {
263
+ for (const environment of Object.values(server.environments ?? {})) {
264
+ const mod = environment.moduleGraph.getModuleById(id);
265
+ if (mod) environment.moduleGraph.invalidateModule(mod);
266
+ }
267
+ const legacy = server.moduleGraph.getModuleById(id);
268
+ if (legacy) server.moduleGraph.invalidateModule(legacy);
269
+ }
270
+ function skillImportVitePlugin(options = {}) {
271
+ const report = options.report ?? ((text) => console.info(text));
272
+ const dirsById = /* @__PURE__ */ new Map();
273
+ let devServer;
274
+ const invalidateFor = (file) => {
275
+ if (!devServer) return;
276
+ const abs = resolve(file);
277
+ for (const [id, dir] of dirsById) {
278
+ if (!isUnder(dir, abs)) continue;
279
+ invalidateModule(devServer, id);
280
+ }
281
+ };
282
+ return {
283
+ name: "@lovable.dev/mcp-js/skill-import",
284
+ resolveId: {
285
+ order: "pre",
286
+ handler(source, importer) {
287
+ const spec = parseSkillImport(source);
288
+ if (spec === void 0) return null;
289
+ const baseDir = importer ? dirname(importer.replace(/[?#].*$/, "")) : process.cwd();
290
+ const dir = resolveSkillDir(spec.directory, baseDir);
291
+ if (dir === void 0) throw new Error(`@lovable.dev/mcp-js: ?skill imports must be relative or absolute paths, got ${source}`);
292
+ return VIRTUAL_PREFIX + skillImportId(dir, spec);
293
+ }
294
+ },
295
+ load: { handler(id) {
296
+ if (!id.startsWith(VIRTUAL_PREFIX)) return null;
297
+ const spec = parseSkillImport(id.slice(19));
298
+ const dir = spec.directory;
299
+ dirsById.set(id, dir);
300
+ devServer?.watcher.add(dir);
301
+ const compilation = compileSkillDirectory(dir, spec.skillPath, spec.allowHidden);
302
+ for (const file of compilation.watchFiles) this.addWatchFile(file);
303
+ report(compilation.report);
304
+ return skillModuleSource(compilation);
305
+ } },
306
+ configureServer(server) {
307
+ devServer = server;
308
+ server.watcher.on("add", invalidateFor);
309
+ server.watcher.on("change", invalidateFor);
310
+ server.watcher.on("unlink", invalidateFor);
311
+ server.watcher.on("unlinkDir", invalidateFor);
312
+ options.onServer?.(server);
313
+ }
314
+ };
315
+ }
316
+ function skillImportEsbuildPlugin(onCompile, onDirectory) {
317
+ return {
318
+ name: "lovable-mcp-skill-import",
319
+ setup(pluginBuild) {
320
+ const workingDir = pluginBuild.initialOptions.absWorkingDir ?? process.cwd();
321
+ pluginBuild.onResolve({ filter: SKILL_IMPORT_FILTER }, (args) => {
322
+ const spec = parseSkillImport(args.path);
323
+ if (spec === void 0) return void 0;
324
+ const dir = resolveSkillDir(spec.directory, args.resolveDir);
325
+ if (dir === void 0) return { errors: [{ text: `?skill imports must be relative or absolute paths, got ${args.path}` }] };
326
+ onDirectory?.(dir);
327
+ return {
328
+ path: skillImportId(relative(workingDir, dir).split(sep).join("/"), spec),
329
+ namespace: ESBUILD_NAMESPACE
330
+ };
331
+ });
332
+ pluginBuild.onLoad({
333
+ filter: /.*/,
334
+ namespace: ESBUILD_NAMESPACE
335
+ }, (args) => {
336
+ const spec = parseSkillImport(args.path);
337
+ const compilation = compileSkillDirectory(resolve(workingDir, spec.directory), spec.skillPath, spec.allowHidden);
338
+ onCompile(compilation);
339
+ return {
340
+ contents: skillModuleSource(compilation),
341
+ loader: "js",
342
+ watchFiles: [...compilation.watchFiles],
343
+ watchDirs: [...compilation.watchDirs]
344
+ };
345
+ });
346
+ }
347
+ };
348
+ }
349
+ function isSkillImportInput(input) {
350
+ return input.startsWith(`${ESBUILD_NAMESPACE}:`);
351
+ }
352
+ //#endregion
353
+ export { isFileMissing as a, readSupabaseProjectRef as i, skillImportEsbuildPlugin as n, skillImportVitePlugin as r, isSkillImportInput as t };