@webiny/mcp 0.0.0-unstable.c27f4d8a31 → 0.0.0-unstable.e6f0dc8ca7
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/agents/claude.d.ts +4 -2
- package/agents/claude.js +6 -0
- package/agents/claude.js.map +1 -1
- package/agents/cline.d.ts +4 -2
- package/agents/cline.js +6 -0
- package/agents/cline.js.map +1 -1
- package/agents/copilot.d.ts +4 -2
- package/agents/copilot.js +8 -1
- package/agents/copilot.js.map +1 -1
- package/agents/cursor.d.ts +4 -2
- package/agents/cursor.js +6 -0
- package/agents/cursor.js.map +1 -1
- package/agents/discover.d.ts +3 -0
- package/agents/discover.js +29 -0
- package/agents/discover.js.map +1 -0
- package/agents/instructions.d.ts +3 -1
- package/agents/instructions.js +15 -2
- package/agents/instructions.js.map +1 -1
- package/agents/kiro.d.ts +17 -0
- package/agents/kiro.js +39 -0
- package/agents/kiro.js.map +1 -0
- package/agents/opencode.d.ts +24 -0
- package/agents/opencode.js +83 -0
- package/agents/opencode.js.map +1 -0
- package/agents/shared.d.ts +5 -5
- package/agents/shared.js +3 -3
- package/agents/shared.js.map +1 -1
- package/agents/types.d.ts +16 -0
- package/agents/types.js +3 -0
- package/agents/types.js.map +1 -0
- package/agents/windsurf.d.ts +4 -2
- package/agents/windsurf.js +6 -0
- package/agents/windsurf.js.map +1 -1
- package/bin.d.ts +2 -0
- package/bin.js +4 -0
- package/bin.js.map +1 -0
- package/cli/ConfigureMcp.d.ts +7 -14
- package/cli/ConfigureMcp.js +39 -52
- package/cli/ConfigureMcp.js.map +1 -1
- package/cli/McpServer.d.ts +3 -10
- package/cli/McpServer.js +81 -105
- package/cli/McpServer.js.map +1 -1
- package/cli.d.ts +1 -0
- package/cli.js +60 -0
- package/cli.js.map +1 -0
- package/index.d.ts +8 -1
- package/index.js +9 -1
- package/index.js.map +1 -1
- package/package.json +16 -25
- package/skills/admin/admin-architect/SKILL.md +580 -0
- package/skills/admin/admin-permissions/SKILL.md +313 -0
- package/skills/admin/form-model/SKILL.md +527 -0
- package/skills/admin/ui-extensions/SKILL.md +239 -0
- package/skills/admin/website-builder/page-settings/SKILL.md +216 -0
- package/skills/api/api-architect/SKILL.md +678 -0
- package/skills/api/custom-field-type/SKILL.md +263 -0
- package/skills/api/event-handler-pattern/SKILL.md +299 -0
- package/skills/api/graphql-api/SKILL.md +409 -0
- package/skills/api/http-route/SKILL.md +175 -0
- package/skills/api/permissions/SKILL.md +373 -0
- package/skills/api/use-case-pattern/SKILL.md +454 -0
- package/skills/api/v5-to-v6-migration/SKILL.md +765 -0
- package/skills/cli-extensions/SKILL.md +46 -48
- package/skills/configure-auth0/SKILL.md +4 -4
- package/skills/configure-okta/SKILL.md +3 -3
- package/skills/content-models/SKILL.md +450 -207
- package/skills/dependency-injection/SKILL.md +208 -221
- package/skills/full-stack-architect/SKILL.md +199 -0
- package/skills/generated/admin/SKILL.md +139 -0
- package/skills/generated/admin/aco/SKILL.md +28 -0
- package/skills/generated/admin/build-params/SKILL.md +33 -0
- package/skills/generated/admin/cms/SKILL.md +405 -0
- package/skills/generated/admin/configs/SKILL.md +23 -0
- package/skills/generated/admin/env-config/SKILL.md +30 -0
- package/skills/generated/admin/form/SKILL.md +145 -0
- package/skills/generated/admin/graphql-client/SKILL.md +23 -0
- package/skills/generated/admin/languages/SKILL.md +29 -0
- package/skills/generated/admin/lexical/SKILL.md +105 -0
- package/skills/generated/admin/local-storage/SKILL.md +42 -0
- package/skills/generated/admin/router/SKILL.md +48 -0
- package/skills/generated/admin/security/SKILL.md +96 -0
- package/skills/generated/admin/tenancy/SKILL.md +64 -0
- package/skills/generated/admin/ui/SKILL.md +513 -0
- package/skills/generated/admin/website-builder/SKILL.md +343 -0
- package/skills/generated/api/SKILL.md +139 -0
- package/skills/generated/api/aco/SKILL.md +202 -0
- package/skills/generated/api/build-params/SKILL.md +31 -0
- package/skills/generated/api/cms/SKILL.md +774 -0
- package/skills/generated/api/db/SKILL.md +34 -0
- package/skills/generated/api/event-publisher/SKILL.md +31 -0
- package/skills/generated/api/file-manager/SKILL.md +189 -0
- package/skills/generated/api/graphql/SKILL.md +61 -0
- package/skills/generated/api/key-value-store/SKILL.md +31 -0
- package/skills/generated/api/languages/SKILL.md +31 -0
- package/skills/generated/api/logger/SKILL.md +25 -0
- package/skills/generated/api/mailer/SKILL.md +74 -0
- package/skills/generated/api/opensearch/SKILL.md +39 -0
- package/skills/generated/api/scheduler/SKILL.md +112 -0
- package/skills/generated/api/security/SKILL.md +342 -0
- package/skills/generated/api/system/SKILL.md +34 -0
- package/skills/generated/api/tasks/SKILL.md +31 -0
- package/skills/generated/api/tenancy/SKILL.md +124 -0
- package/skills/generated/api/tenant-manager/SKILL.md +69 -0
- package/skills/generated/api/website-builder/SKILL.md +356 -0
- package/skills/generated/cli/SKILL.md +28 -0
- package/skills/generated/cli/command/SKILL.md +24 -0
- package/skills/generated/extensions/SKILL.md +43 -0
- package/skills/generated/infra/SKILL.md +187 -0
- package/skills/infrastructure-extensions/SKILL.md +4 -3
- package/skills/local-development/SKILL.md +3 -29
- package/skills/mailer-smtp/SKILL.md +98 -0
- package/skills/project-structure/SKILL.md +82 -57
- package/skills/webiny-sdk/SKILL.md +452 -110
- package/skills/website-builder/SKILL.md +238 -153
- package/ui.d.ts +24 -0
- package/ui.js +31 -0
- package/ui.js.map +1 -0
- package/Extension.d.ts +0 -2
- package/Extension.js +0 -11
- package/Extension.js.map +0 -1
- package/skills/admin-ui-extensions/SKILL.md +0 -267
- package/skills/api-custom-feature/SKILL.md +0 -195
- package/skills/custom-graphql-api/SKILL.md +0 -209
- package/skills/lifecycle-events/SKILL.md +0 -348
package/agents/claude.d.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Docs: https://docs.anthropic.com/en/docs/claude-code/mcp
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { IUi } from "../ui.js";
|
|
10
|
+
import type { AgentPreset } from "./types.js";
|
|
11
|
+
export declare const preset: AgentPreset;
|
|
10
12
|
interface InitParams {
|
|
11
|
-
ui:
|
|
13
|
+
ui: IUi;
|
|
12
14
|
cwd: string;
|
|
13
15
|
}
|
|
14
16
|
export declare function init({ ui, cwd }: InitParams): Promise<void>;
|
package/agents/claude.js
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
import { join } from "path";
|
|
11
11
|
import { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from "./shared.js";
|
|
12
|
+
export const preset = {
|
|
13
|
+
slug: "claude",
|
|
14
|
+
displayName: "Claude Code",
|
|
15
|
+
configFile: ".mcp.json",
|
|
16
|
+
hintFile: "CLAUDE.md"
|
|
17
|
+
};
|
|
12
18
|
export async function init({
|
|
13
19
|
ui,
|
|
14
20
|
cwd
|
package/agents/claude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["claude.ts"],"sourcesContent":["/**\n * Agent adapter: Claude Code\n *\n * MCP config : .mcp.json (project-level, checked into git)\n * Hint file : CLAUDE.md (Claude Code reads this automatically each session)\n *\n * Docs: https://docs.anthropic.com/en/docs/claude-code/mcp\n */\n\nimport { join } from \"path\";\nimport type {
|
|
1
|
+
{"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","hintFile","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["claude.ts"],"sourcesContent":["/**\n * Agent adapter: Claude Code\n *\n * MCP config : .mcp.json (project-level, checked into git)\n * Hint file : CLAUDE.md (Claude Code reads this automatically each session)\n *\n * Docs: https://docs.anthropic.com/en/docs/claude-code/mcp\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"claude\",\n displayName: \"Claude Code\",\n configFile: \".mcp.json\",\n hintFile: \"CLAUDE.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Claude Code...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \"CLAUDE.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElE,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,QAAQ;EACdC,WAAW,EAAE,aAAa;EAC1BC,UAAU,EAAE,WAAW;EACvBC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,+BAA+B,CAAC;EAExCZ,cAAc,CAAC;IACXU,EAAE;IACFG,UAAU,EAAEd,IAAI,CAACY,GAAG,EAAE,WAAW;EACrC,CAAC,CAAC;EAEFV,aAAa,CAAC;IACVS,EAAE;IACFI,QAAQ,EAAEf,IAAI,CAACY,GAAG,EAAE,WAAW,CAAC;IAChCI,OAAO,EAAEb,eAAe,CAAC;MAAEc,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEFb,SAAS,CAAC;IAAEO;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
|
package/agents/cline.d.ts
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Docs: https://docs.cline.bot/mcp-servers/configuring-mcp-servers
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { IUi } from "../ui.js";
|
|
12
|
+
import type { AgentPreset } from "./types.js";
|
|
13
|
+
export declare const preset: AgentPreset;
|
|
12
14
|
interface InitParams {
|
|
13
|
-
ui:
|
|
15
|
+
ui: IUi;
|
|
14
16
|
cwd: string;
|
|
15
17
|
}
|
|
16
18
|
export declare function init({ ui, cwd }: InitParams): Promise<void>;
|
package/agents/cline.js
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
import { join } from "path";
|
|
13
13
|
import { writeMcpConfig, printDone } from "./shared.js";
|
|
14
|
+
export const preset = {
|
|
15
|
+
slug: "cline",
|
|
16
|
+
displayName: "Cline",
|
|
17
|
+
configFile: ".vscode/cline_mcp_settings.json",
|
|
18
|
+
hintNote: "system prompt in settings"
|
|
19
|
+
};
|
|
14
20
|
export async function init({
|
|
15
21
|
ui,
|
|
16
22
|
cwd
|
package/agents/cline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["join","writeMcpConfig","printDone","init","ui","cwd","info","configPath","extra"],"sources":["cline.ts"],"sourcesContent":["/**\n * Agent adapter: Cline\n *\n * MCP config : .vscode/cline_mcp_settings.json (project-level)\n *\n * Cline reads instructions from its system prompt in settings,\n * so we only write the MCP config file.\n *\n * Docs: https://docs.cline.bot/mcp-servers/configuring-mcp-servers\n */\n\nimport { join } from \"path\";\nimport type {
|
|
1
|
+
{"version":3,"names":["join","writeMcpConfig","printDone","preset","slug","displayName","configFile","hintNote","init","ui","cwd","info","configPath","extra"],"sources":["cline.ts"],"sourcesContent":["/**\n * Agent adapter: Cline\n *\n * MCP config : .vscode/cline_mcp_settings.json (project-level)\n *\n * Cline reads instructions from its system prompt in settings,\n * so we only write the MCP config file.\n *\n * Docs: https://docs.cline.bot/mcp-servers/configuring-mcp-servers\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"cline\",\n displayName: \"Cline\",\n configFile: \".vscode/cline_mcp_settings.json\",\n hintNote: \"system prompt in settings\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Cline...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".vscode\", \"cline_mcp_settings.json\")\n });\n\n printDone({\n ui,\n extra: \"Add Webiny instructions to Cline's system prompt in settings manually.\"\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,SAAS;AAElC,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,OAAO;EACpBC,UAAU,EAAE,iCAAiC;EAC7CC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,yBAAyB,CAAC;EAElCV,cAAc,CAAC;IACXQ,EAAE;IACFG,UAAU,EAAEZ,IAAI,CAACU,GAAG,EAAE,SAAS,EAAE,yBAAyB;EAC9D,CAAC,CAAC;EAEFR,SAAS,CAAC;IACNO,EAAE;IACFI,KAAK,EAAE;EACX,CAAC,CAAC;AACN","ignoreList":[]}
|
package/agents/copilot.d.ts
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { IUi } from "../ui.js";
|
|
12
|
+
import type { AgentPreset } from "./types.js";
|
|
13
|
+
export declare const preset: AgentPreset;
|
|
12
14
|
interface InitParams {
|
|
13
|
-
ui:
|
|
15
|
+
ui: IUi;
|
|
14
16
|
cwd: string;
|
|
15
17
|
}
|
|
16
18
|
export declare function init({ ui, cwd }: InitParams): Promise<void>;
|
package/agents/copilot.js
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
import { join, dirname } from "path";
|
|
13
13
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
14
14
|
import { writeHintFile, webinyHintBlock, printDone } from "./shared.js";
|
|
15
|
+
export const preset = {
|
|
16
|
+
slug: "copilot",
|
|
17
|
+
displayName: "Copilot / VS Code",
|
|
18
|
+
configFile: ".vscode/mcp.json",
|
|
19
|
+
configNote: "uses 'servers', not 'mcpServers'",
|
|
20
|
+
hintFile: ".github/copilot-instructions.md"
|
|
21
|
+
};
|
|
15
22
|
function writeCopilotMcpConfig(ui, configPath) {
|
|
16
23
|
const dir = dirname(configPath);
|
|
17
24
|
if (!existsSync(dir)) {
|
|
@@ -21,7 +28,7 @@ function writeCopilotMcpConfig(ui, configPath) {
|
|
|
21
28
|
}
|
|
22
29
|
const entry = {
|
|
23
30
|
command: "npx",
|
|
24
|
-
args: ["webiny", "
|
|
31
|
+
args: ["webiny-mcp", "serve"]
|
|
25
32
|
};
|
|
26
33
|
let config = {
|
|
27
34
|
servers: {}
|
package/agents/copilot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["join","dirname","readFileSync","writeFileSync","existsSync","mkdirSync","writeHintFile","webinyHintBlock","printDone","writeCopilotMcpConfig","ui","configPath","dir","recursive","entry","command","args","config","servers","JSON","parse","warning","webiny","info","stringify","success","init","cwd","hintPath","content","heading"],"sources":["copilot.ts"],"sourcesContent":["/**\n * Agent adapter: GitHub Copilot / VS Code\n *\n * MCP config : .vscode/mcp.json (project-level)\n * Hint file : .github/copilot-instructions.md\n *\n * Note: VS Code uses \"servers\" as the top-level key, not \"mcpServers\".\n *\n * Docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers\n */\n\nimport { join, dirname } from \"path\";\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from \"fs\";\nimport type {
|
|
1
|
+
{"version":3,"names":["join","dirname","readFileSync","writeFileSync","existsSync","mkdirSync","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","configNote","hintFile","writeCopilotMcpConfig","ui","configPath","dir","recursive","entry","command","args","config","servers","JSON","parse","warning","webiny","info","stringify","success","init","cwd","hintPath","content","heading"],"sources":["copilot.ts"],"sourcesContent":["/**\n * Agent adapter: GitHub Copilot / VS Code\n *\n * MCP config : .vscode/mcp.json (project-level)\n * Hint file : .github/copilot-instructions.md\n *\n * Note: VS Code uses \"servers\" as the top-level key, not \"mcpServers\".\n *\n * Docs: https://code.visualstudio.com/docs/copilot/chat/mcp-servers\n */\n\nimport { join, dirname } from \"path\";\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from \"fs\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"copilot\",\n displayName: \"Copilot / VS Code\",\n configFile: \".vscode/mcp.json\",\n configNote: \"uses 'servers', not 'mcpServers'\",\n hintFile: \".github/copilot-instructions.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nfunction writeCopilotMcpConfig(ui: IUi, configPath: string): boolean {\n const dir = dirname(configPath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const entry = { command: \"npx\", args: [\"webiny-mcp\", \"serve\"] };\n let config: { servers: Record<string, unknown> } = { servers: {} };\n\n if (existsSync(configPath)) {\n try {\n config = JSON.parse(readFileSync(configPath, \"utf8\"));\n config.servers ??= {};\n } catch {\n ui.warning(`Could not parse %s — will overwrite.`, configPath);\n }\n }\n\n if (config.servers.webiny) {\n ui.info(`${configPath} already has a %s entry — skipping.`, \"webiny\");\n return false;\n }\n\n config.servers.webiny = entry;\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n ui.success(`Registered Webiny MCP server in %s`, configPath);\n return true;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for GitHub Copilot (VS Code)...\");\n\n writeCopilotMcpConfig(ui, join(cwd, \".vscode\", \"mcp.json\"));\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".github\", \"copilot-instructions.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,OAAO,QAAQ,MAAM;AACpC,SAASC,YAAY,EAAEC,aAAa,EAAEC,UAAU,EAAEC,SAAS,QAAQ,IAAI;AAGvE,SAASC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElD,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,SAAS;EACfC,WAAW,EAAE,mBAAmB;EAChCC,UAAU,EAAE,kBAAkB;EAC9BC,UAAU,EAAE,kCAAkC;EAC9CC,QAAQ,EAAE;AACd,CAAC;AAOD,SAASC,qBAAqBA,CAACC,EAAO,EAAEC,UAAkB,EAAW;EACjE,MAAMC,GAAG,GAAGjB,OAAO,CAACgB,UAAU,CAAC;EAC/B,IAAI,CAACb,UAAU,CAACc,GAAG,CAAC,EAAE;IAClBb,SAAS,CAACa,GAAG,EAAE;MAAEC,SAAS,EAAE;IAAK,CAAC,CAAC;EACvC;EAEA,MAAMC,KAAK,GAAG;IAAEC,OAAO,EAAE,KAAK;IAAEC,IAAI,EAAE,CAAC,YAAY,EAAE,OAAO;EAAE,CAAC;EAC/D,IAAIC,MAA4C,GAAG;IAAEC,OAAO,EAAE,CAAC;EAAE,CAAC;EAElE,IAAIpB,UAAU,CAACa,UAAU,CAAC,EAAE;IACxB,IAAI;MACAM,MAAM,GAAGE,IAAI,CAACC,KAAK,CAACxB,YAAY,CAACe,UAAU,EAAE,MAAM,CAAC,CAAC;MACrDM,MAAM,CAACC,OAAO,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,MAAM;MACJR,EAAE,CAACW,OAAO,CAAC,sCAAsC,EAAEV,UAAU,CAAC;IAClE;EACJ;EAEA,IAAIM,MAAM,CAACC,OAAO,CAACI,MAAM,EAAE;IACvBZ,EAAE,CAACa,IAAI,CAAC,GAAGZ,UAAU,qCAAqC,EAAE,QAAQ,CAAC;IACrE,OAAO,KAAK;EAChB;EAEAM,MAAM,CAACC,OAAO,CAACI,MAAM,GAAGR,KAAK;EAC7BjB,aAAa,CAACc,UAAU,EAAEQ,IAAI,CAACK,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;EACjEP,EAAE,CAACe,OAAO,CAAC,oCAAoC,EAAEd,UAAU,CAAC;EAC5D,OAAO,IAAI;AACf;AAEA,OAAO,eAAee,IAAIA,CAAC;EAAEhB,EAAE;EAAEiB;AAAgB,CAAC,EAAiB;EAC/DjB,EAAE,CAACa,IAAI,CAAC,4CAA4C,CAAC;EAErDd,qBAAqB,CAACC,EAAE,EAAEhB,IAAI,CAACiC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;EAE3D3B,aAAa,CAAC;IACVU,EAAE;IACFkB,QAAQ,EAAElC,IAAI,CAACiC,GAAG,EAAE,SAAS,EAAE,yBAAyB,CAAC;IACzDE,OAAO,EAAE5B,eAAe,CAAC;MAAE6B,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEF5B,SAAS,CAAC;IAAEQ;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
|
package/agents/cursor.d.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Docs: https://docs.cursor.com/context/model-context-protocol
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { IUi } from "../ui.js";
|
|
10
|
+
import type { AgentPreset } from "./types.js";
|
|
11
|
+
export declare const preset: AgentPreset;
|
|
10
12
|
interface InitParams {
|
|
11
|
-
ui:
|
|
13
|
+
ui: IUi;
|
|
12
14
|
cwd: string;
|
|
13
15
|
}
|
|
14
16
|
export declare function init({ ui, cwd }: InitParams): Promise<void>;
|
package/agents/cursor.js
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
import { join } from "path";
|
|
11
11
|
import { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from "./shared.js";
|
|
12
|
+
export const preset = {
|
|
13
|
+
slug: "cursor",
|
|
14
|
+
displayName: "Cursor",
|
|
15
|
+
configFile: ".cursor/mcp.json",
|
|
16
|
+
hintFile: ".cursor/rules/*.mdc"
|
|
17
|
+
};
|
|
12
18
|
export async function init({
|
|
13
19
|
ui,
|
|
14
20
|
cwd
|
package/agents/cursor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["cursor.ts"],"sourcesContent":["/**\n * Agent adapter: Cursor\n *\n * MCP config : .cursor/mcp.json (project-level)\n * Hint file : .cursor/rules/webiny.mdc\n *\n * Docs: https://docs.cursor.com/context/model-context-protocol\n */\n\nimport { join } from \"path\";\nimport type {
|
|
1
|
+
{"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","hintFile","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["cursor.ts"],"sourcesContent":["/**\n * Agent adapter: Cursor\n *\n * MCP config : .cursor/mcp.json (project-level)\n * Hint file : .cursor/rules/webiny.mdc\n *\n * Docs: https://docs.cursor.com/context/model-context-protocol\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"cursor\",\n displayName: \"Cursor\",\n configFile: \".cursor/mcp.json\",\n hintFile: \".cursor/rules/*.mdc\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Cursor...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".cursor\", \"mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".cursor\", \"rules\", \"webiny.mdc\"),\n content: webinyHintBlock({ heading: \"# Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElE,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,QAAQ;EACdC,WAAW,EAAE,QAAQ;EACrBC,UAAU,EAAE,kBAAkB;EAC9BC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,0BAA0B,CAAC;EAEnCZ,cAAc,CAAC;IACXU,EAAE;IACFG,UAAU,EAAEd,IAAI,CAACY,GAAG,EAAE,SAAS,EAAE,UAAU;EAC/C,CAAC,CAAC;EAEFV,aAAa,CAAC;IACVS,EAAE;IACFI,QAAQ,EAAEf,IAAI,CAACY,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC;IACrDI,OAAO,EAAEb,eAAe,CAAC;MAAEc,OAAO,EAAE;IAAW,CAAC;EACpD,CAAC,CAAC;EAEFb,SAAS,CAAC;IAAEO;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { readdirSync } from "fs";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, join } from "path";
|
|
4
|
+
let cache = null;
|
|
5
|
+
export async function discoverAgents() {
|
|
6
|
+
if (cache) {
|
|
7
|
+
return cache;
|
|
8
|
+
}
|
|
9
|
+
const agentsDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const files = readdirSync(agentsDir).filter(f => f.endsWith(".js") && !f.endsWith(".d.ts") && !f.endsWith(".js.map"));
|
|
11
|
+
const agents = new Map();
|
|
12
|
+
for (const file of files) {
|
|
13
|
+
const mod = await import(join(agentsDir, file));
|
|
14
|
+
if (mod.preset && typeof mod.init === "function") {
|
|
15
|
+
agents.set(mod.preset.slug, {
|
|
16
|
+
preset: mod.preset,
|
|
17
|
+
init: mod.init
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
cache = agents;
|
|
22
|
+
return agents;
|
|
23
|
+
}
|
|
24
|
+
export async function discoverPresets() {
|
|
25
|
+
const agents = await discoverAgents();
|
|
26
|
+
return Array.from(agents.values()).map(a => a.preset);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["readdirSync","fileURLToPath","dirname","join","cache","discoverAgents","agentsDir","import","meta","url","files","filter","f","endsWith","agents","Map","file","mod","preset","init","set","slug","discoverPresets","Array","from","values","map","a"],"sources":["discover.ts"],"sourcesContent":["import { readdirSync } from \"fs\";\nimport { fileURLToPath } from \"url\";\nimport { dirname, join } from \"path\";\nimport type { AgentPreset, AgentModule } from \"./types.js\";\n\nlet cache: Map<string, AgentModule> | null = null;\n\nexport async function discoverAgents(): Promise<Map<string, AgentModule>> {\n if (cache) {\n return cache;\n }\n\n const agentsDir = dirname(fileURLToPath(import.meta.url));\n const files = readdirSync(agentsDir).filter(\n f => f.endsWith(\".js\") && !f.endsWith(\".d.ts\") && !f.endsWith(\".js.map\")\n );\n\n const agents = new Map<string, AgentModule>();\n\n for (const file of files) {\n const mod = await import(join(agentsDir, file));\n if (mod.preset && typeof mod.init === \"function\") {\n agents.set(mod.preset.slug, { preset: mod.preset, init: mod.init });\n }\n }\n\n cache = agents;\n return agents;\n}\n\nexport async function discoverPresets(): Promise<AgentPreset[]> {\n const agents = await discoverAgents();\n return Array.from(agents.values()).map(a => a.preset);\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,IAAI;AAChC,SAASC,aAAa,QAAQ,KAAK;AACnC,SAASC,OAAO,EAAEC,IAAI,QAAQ,MAAM;AAGpC,IAAIC,KAAsC,GAAG,IAAI;AAEjD,OAAO,eAAeC,cAAcA,CAAA,EAAsC;EACtE,IAAID,KAAK,EAAE;IACP,OAAOA,KAAK;EAChB;EAEA,MAAME,SAAS,GAAGJ,OAAO,CAACD,aAAa,CAACM,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;EACzD,MAAMC,KAAK,GAAGV,WAAW,CAACM,SAAS,CAAC,CAACK,MAAM,CACvCC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAACD,CAAC,CAACC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAACD,CAAC,CAACC,QAAQ,CAAC,SAAS,CAC3E,CAAC;EAED,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAsB,CAAC;EAE7C,KAAK,MAAMC,IAAI,IAAIN,KAAK,EAAE;IACtB,MAAMO,GAAG,GAAG,MAAM,MAAM,CAACd,IAAI,CAACG,SAAS,EAAEU,IAAI,CAAC,CAAC;IAC/C,IAAIC,GAAG,CAACC,MAAM,IAAI,OAAOD,GAAG,CAACE,IAAI,KAAK,UAAU,EAAE;MAC9CL,MAAM,CAACM,GAAG,CAACH,GAAG,CAACC,MAAM,CAACG,IAAI,EAAE;QAAEH,MAAM,EAAED,GAAG,CAACC,MAAM;QAAEC,IAAI,EAAEF,GAAG,CAACE;MAAK,CAAC,CAAC;IACvE;EACJ;EAEAf,KAAK,GAAGU,MAAM;EACd,OAAOA,MAAM;AACjB;AAEA,OAAO,eAAeQ,eAAeA,CAAA,EAA2B;EAC5D,MAAMR,MAAM,GAAG,MAAMT,cAAc,CAAC,CAAC;EACrC,OAAOkB,KAAK,CAACC,IAAI,CAACV,MAAM,CAACW,MAAM,CAAC,CAAC,CAAC,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACT,MAAM,CAAC;AACzD","ignoreList":[]}
|
package/agents/instructions.d.ts
CHANGED
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP
|
|
5
5
|
* server in any agent not covered by the built-in adapters.
|
|
6
|
+
*
|
|
7
|
+
* The agent tables are auto-generated from preset metadata.
|
|
6
8
|
*/
|
|
7
|
-
export declare function printInstructions(): void
|
|
9
|
+
export declare function printInstructions(): Promise<void>;
|
package/agents/instructions.js
CHANGED
|
@@ -3,11 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP
|
|
5
5
|
* server in any agent not covered by the built-in adapters.
|
|
6
|
+
*
|
|
7
|
+
* The agent tables are auto-generated from preset metadata.
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
import { discoverPresets } from "./discover.js";
|
|
11
|
+
export async function printInstructions() {
|
|
12
|
+
const presets = await discoverPresets();
|
|
13
|
+
const configRows = presets.map(p => {
|
|
14
|
+
const note = p.configNote ? ` (${p.configNote})` : "";
|
|
15
|
+
return formatRow(p.displayName, p.configFile + note);
|
|
16
|
+
});
|
|
17
|
+
const hintRows = presets.filter(p => p.hintFile).map(p => formatRow(p.displayName, p.hintFile));
|
|
18
|
+
presets.filter(p => !p.hintFile && p.hintNote).forEach(p => hintRows.push(formatRow(p.displayName, p.hintNote)));
|
|
19
|
+
const lines = ["", "╔══════════════════════════════════════════════════════════════════╗", "║ Webiny MCP Server — Manual Setup Guide ║", "╚══════════════════════════════════════════════════════════════════╝", "", "The Webiny MCP server works with any agent that supports the Model", "Context Protocol (MCP) over stdio transport.", "", "── Step 1: Register the MCP server ───────────────────────────────", "", "Most agents accept a JSON config file. Add the following entry:", "", ' "webiny": {', ' "command": "npx",', ' "args": ["webiny-mcp", "serve"]', " }", "", "Where this config lives depends on your agent:", "", " Agent Config file", " ───────────────── ──────────────────────────────────────", ...configRows, "", "Full example (the most common shape):", "", " {", ' "mcpServers": {', ' "webiny": {', ' "command": "npx",', ' "args": ["webiny-mcp", "serve"]', " }", " }", " }", "", "── Step 2: Tell your agent about the MCP tools ───────────────────", "", "Add the following to your agent's instruction / rules file so it", "knows to reach for the Webiny tools automatically:", "", " ## Webiny", " This project uses the Webiny framework.", " A `webiny` MCP server is available.", " When helping with Webiny-related tasks:", " 1. Call `list_webiny_skills` to see available skills.", " 2. Call `get_webiny_skill` with the relevant topic before writing code.", "", "Where this instruction file lives:", "", " Agent Instruction file", " ───────────────── ──────────────────────────────────────", ...hintRows, "", "── Step 3: Verify the server starts ──────────────────────────────", "", "Test it with the MCP Inspector before relying on it in your agent:", "", " npx @modelcontextprotocol/inspector npx webiny-mcp server", "", "Connect, click 'List Tools', and confirm you see:", " • list_webiny_skills", " • get_webiny_skill", "", "── Need a built-in adapter for your agent? ───────────────────────", "", "Open an issue or PR at: https://github.com/webiny/webiny-js", "The adapter just needs to write the right config file — see", "mcp/agents/claude.ts as a reference (~20 lines).", ""];
|
|
10
20
|
process.stdout.write(lines.join("\n") + "\n");
|
|
11
21
|
}
|
|
22
|
+
function formatRow(agent, path) {
|
|
23
|
+
return ` ${agent.padEnd(17)} ${path}`;
|
|
24
|
+
}
|
|
12
25
|
|
|
13
26
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["printInstructions","lines","process","stdout","write","join"],"sources":["instructions.ts"],"sourcesContent":["/**\n * --instructions / --manual\n *\n * Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP\n * server in any agent not covered by the built-in adapters.\n */\n\nexport function printInstructions(): void {\n const lines = [\n \"\",\n \"╔══════════════════════════════════════════════════════════════════╗\",\n \"║ Webiny MCP Server — Manual Setup Guide ║\",\n \"╚══════════════════════════════════════════════════════════════════╝\",\n \"\",\n \"The Webiny MCP server works with any agent that supports the Model\",\n \"Context Protocol (MCP) over stdio transport.\",\n \"\",\n \"── Step 1: Register the MCP server ───────────────────────────────\",\n \"\",\n \"Most agents accept a JSON config file. Add the following entry:\",\n \"\",\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny\", \"
|
|
1
|
+
{"version":3,"names":["discoverPresets","printInstructions","presets","configRows","map","p","note","configNote","formatRow","displayName","configFile","hintRows","filter","hintFile","hintNote","forEach","push","lines","process","stdout","write","join","agent","path","padEnd"],"sources":["instructions.ts"],"sourcesContent":["/**\n * --instructions / --manual\n *\n * Prints a clear, copy-paste-friendly guide for wiring up the Webiny MCP\n * server in any agent not covered by the built-in adapters.\n *\n * The agent tables are auto-generated from preset metadata.\n */\n\nimport { discoverPresets } from \"./discover.js\";\n\nexport async function printInstructions(): Promise<void> {\n const presets = await discoverPresets();\n\n const configRows = presets.map(p => {\n const note = p.configNote ? ` (${p.configNote})` : \"\";\n return formatRow(p.displayName, p.configFile + note);\n });\n\n const hintRows = presets\n .filter(p => p.hintFile)\n .map(p => formatRow(p.displayName, p.hintFile!));\n presets\n .filter(p => !p.hintFile && p.hintNote)\n .forEach(p => hintRows.push(formatRow(p.displayName, p.hintNote!)));\n\n const lines = [\n \"\",\n \"╔══════════════════════════════════════════════════════════════════╗\",\n \"║ Webiny MCP Server — Manual Setup Guide ║\",\n \"╚══════════════════════════════════════════════════════════════════╝\",\n \"\",\n \"The Webiny MCP server works with any agent that supports the Model\",\n \"Context Protocol (MCP) over stdio transport.\",\n \"\",\n \"── Step 1: Register the MCP server ───────────────────────────────\",\n \"\",\n \"Most agents accept a JSON config file. Add the following entry:\",\n \"\",\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny-mcp\", \"serve\"]',\n \" }\",\n \"\",\n \"Where this config lives depends on your agent:\",\n \"\",\n \" Agent Config file\",\n \" ───────────────── ──────────────────────────────────────\",\n ...configRows,\n \"\",\n \"Full example (the most common shape):\",\n \"\",\n \" {\",\n ' \"mcpServers\": {',\n ' \"webiny\": {',\n ' \"command\": \"npx\",',\n ' \"args\": [\"webiny-mcp\", \"serve\"]',\n \" }\",\n \" }\",\n \" }\",\n \"\",\n \"── Step 2: Tell your agent about the MCP tools ───────────────────\",\n \"\",\n \"Add the following to your agent's instruction / rules file so it\",\n \"knows to reach for the Webiny tools automatically:\",\n \"\",\n \" ## Webiny\",\n \" This project uses the Webiny framework.\",\n \" A `webiny` MCP server is available.\",\n \" When helping with Webiny-related tasks:\",\n \" 1. Call `list_webiny_skills` to see available skills.\",\n \" 2. Call `get_webiny_skill` with the relevant topic before writing code.\",\n \"\",\n \"Where this instruction file lives:\",\n \"\",\n \" Agent Instruction file\",\n \" ───────────────── ──────────────────────────────────────\",\n ...hintRows,\n \"\",\n \"── Step 3: Verify the server starts ──────────────────────────────\",\n \"\",\n \"Test it with the MCP Inspector before relying on it in your agent:\",\n \"\",\n \" npx @modelcontextprotocol/inspector npx webiny-mcp server\",\n \"\",\n \"Connect, click 'List Tools', and confirm you see:\",\n \" • list_webiny_skills\",\n \" • get_webiny_skill\",\n \"\",\n \"── Need a built-in adapter for your agent? ───────────────────────\",\n \"\",\n \"Open an issue or PR at: https://github.com/webiny/webiny-js\",\n \"The adapter just needs to write the right config file — see\",\n \"mcp/agents/claude.ts as a reference (~20 lines).\",\n \"\"\n ];\n\n process.stdout.write(lines.join(\"\\n\") + \"\\n\");\n}\n\nfunction formatRow(agent: string, path: string): string {\n return ` ${agent.padEnd(17)} ${path}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe;AAExB,OAAO,eAAeC,iBAAiBA,CA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AoE,EACpE,EAAE,EACF,kEAAkE,EAClE,oDAAoD,EACpD,EAAE,EACF,aAAa,EACb,2CAA2C,EAC3C,uCAAuC,EACvC,2CAA2C,EAC3C,yDAAyD,EACzD,2EAA2E,EAC3E,EAAE,EACF,oCAAoC,EACpC,EAAE,EACF,uCAAuC,EACvC,6DAA6D,EAC7D,GAAGQ,QAAQ,EACX,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,6DAA6D,EAC7D,EAAE,EACF,mDAAmD,EACnD,wBAAwB,EACxB,sBAAsB,EACtB,EAAE,EACF,oEAAoE,EACpE,EAAE,EACF,6DAA6D,EAC7D,6DAA6D,EAC7D,kDAAkD,EAClD,EAAE,CACL;EAEDO,OAAO,CAACC,MAAM,CAACC,KAAK,CAACH,KAAK,CAACI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjD;AAEA,SAASb,SAASA,CAACc,KAAa,EAAEC,IAAY,EAAU;EACpD,OAAO,KAAKD,KAAK,CAACE,MAAM,CAAC,EAAE,CAAC,KAAKD,IAAI,EAAE;AAC3C","ignoreList":[]}
|
package/agents/kiro.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent adapter: Kiro
|
|
3
|
+
*
|
|
4
|
+
* MCP config : .kiro/settings/mcp.json (project-level, checked into git)
|
|
5
|
+
* Hint file : AGENTS.md (Claude Code reads this automatically each session)
|
|
6
|
+
*
|
|
7
|
+
* Docs: https://docs.anthropic.com/en/docs/claude-code/mcp
|
|
8
|
+
*/
|
|
9
|
+
import type { IUi } from "../ui.js";
|
|
10
|
+
import type { AgentPreset } from "./types.js";
|
|
11
|
+
export declare const preset: AgentPreset;
|
|
12
|
+
interface InitParams {
|
|
13
|
+
ui: IUi;
|
|
14
|
+
cwd: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function init({ ui, cwd }: InitParams): Promise<void>;
|
|
17
|
+
export {};
|
package/agents/kiro.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent adapter: Kiro
|
|
3
|
+
*
|
|
4
|
+
* MCP config : .kiro/settings/mcp.json (project-level, checked into git)
|
|
5
|
+
* Hint file : AGENTS.md (Claude Code reads this automatically each session)
|
|
6
|
+
*
|
|
7
|
+
* Docs: https://docs.anthropic.com/en/docs/claude-code/mcp
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { join } from "path";
|
|
11
|
+
import { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from "./shared.js";
|
|
12
|
+
export const preset = {
|
|
13
|
+
slug: "kiro",
|
|
14
|
+
displayName: "Kiro",
|
|
15
|
+
configFile: ".kiro/settings/mcp.json",
|
|
16
|
+
hintFile: "AGENTS.md"
|
|
17
|
+
};
|
|
18
|
+
export async function init({
|
|
19
|
+
ui,
|
|
20
|
+
cwd
|
|
21
|
+
}) {
|
|
22
|
+
ui.info("Setting up for Kiro...");
|
|
23
|
+
writeMcpConfig({
|
|
24
|
+
ui,
|
|
25
|
+
configPath: join(cwd, ".kiro/settings/mcp.json")
|
|
26
|
+
});
|
|
27
|
+
writeHintFile({
|
|
28
|
+
ui,
|
|
29
|
+
hintPath: join(cwd, "AGENTS.md"),
|
|
30
|
+
content: webinyHintBlock({
|
|
31
|
+
heading: "## Webiny"
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
printDone({
|
|
35
|
+
ui
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","hintFile","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["kiro.ts"],"sourcesContent":["/**\n * Agent adapter: Kiro\n *\n * MCP config : .kiro/settings/mcp.json (project-level, checked into git)\n * Hint file : AGENTS.md (Claude Code reads this automatically each session)\n *\n * Docs: https://docs.anthropic.com/en/docs/claude-code/mcp\n */\n\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"kiro\",\n displayName: \"Kiro\",\n configFile: \".kiro/settings/mcp.json\",\n hintFile: \"AGENTS.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for Kiro...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".kiro/settings/mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \"AGENTS.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,MAAM;AAG3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElE,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,MAAM;EACZC,WAAW,EAAE,MAAM;EACnBC,UAAU,EAAE,yBAAyB;EACrCC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,wBAAwB,CAAC;EAEjCZ,cAAc,CAAC;IACXU,EAAE;IACFG,UAAU,EAAEd,IAAI,CAACY,GAAG,EAAE,yBAAyB;EACnD,CAAC,CAAC;EAEFV,aAAa,CAAC;IACVS,EAAE;IACFI,QAAQ,EAAEf,IAAI,CAACY,GAAG,EAAE,WAAW,CAAC;IAChCI,OAAO,EAAEb,eAAe,CAAC;MAAEc,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEFb,SAAS,CAAC;IAAEO;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent adapter: OpenCode
|
|
3
|
+
*
|
|
4
|
+
* MCP config : opencode.json (project root)
|
|
5
|
+
* Hint file : AGENTS.md (OpenCode reads this automatically each session)
|
|
6
|
+
*
|
|
7
|
+
* OpenCode uses a different MCP config shape than other agents:
|
|
8
|
+
* {
|
|
9
|
+
* "mcp": {
|
|
10
|
+
* "webiny": { "type": "local", "command": ["npx", "webiny", "mcp-server"], "enabled": true }
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* Docs: https://opencode.ai/docs/mcp-servers/
|
|
15
|
+
*/
|
|
16
|
+
import type { IUi } from "../ui.js";
|
|
17
|
+
import type { AgentPreset } from "./types.js";
|
|
18
|
+
export declare const preset: AgentPreset;
|
|
19
|
+
interface InitParams {
|
|
20
|
+
ui: IUi;
|
|
21
|
+
cwd: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function init({ ui, cwd }: InitParams): Promise<void>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent adapter: OpenCode
|
|
3
|
+
*
|
|
4
|
+
* MCP config : opencode.json (project root)
|
|
5
|
+
* Hint file : AGENTS.md (OpenCode reads this automatically each session)
|
|
6
|
+
*
|
|
7
|
+
* OpenCode uses a different MCP config shape than other agents:
|
|
8
|
+
* {
|
|
9
|
+
* "mcp": {
|
|
10
|
+
* "webiny": { "type": "local", "command": ["npx", "webiny", "mcp-server"], "enabled": true }
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* Docs: https://opencode.ai/docs/mcp-servers/
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
18
|
+
import { join } from "path";
|
|
19
|
+
import { writeHintFile, webinyHintBlock, printDone } from "./shared.js";
|
|
20
|
+
export const preset = {
|
|
21
|
+
slug: "opencode",
|
|
22
|
+
displayName: "OpenCode",
|
|
23
|
+
configFile: "opencode.json",
|
|
24
|
+
configNote: "uses 'mcp' not 'mcpServers'",
|
|
25
|
+
hintFile: "AGENTS.md"
|
|
26
|
+
};
|
|
27
|
+
export async function init({
|
|
28
|
+
ui,
|
|
29
|
+
cwd
|
|
30
|
+
}) {
|
|
31
|
+
ui.info("Setting up for OpenCode...");
|
|
32
|
+
writeOpenCodeMcpConfig({
|
|
33
|
+
ui,
|
|
34
|
+
configPath: join(cwd, "opencode.json")
|
|
35
|
+
});
|
|
36
|
+
writeHintFile({
|
|
37
|
+
ui,
|
|
38
|
+
hintPath: join(cwd, "AGENTS.md"),
|
|
39
|
+
content: webinyHintBlock({
|
|
40
|
+
heading: "## Webiny"
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
printDone({
|
|
44
|
+
ui
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// OpenCode-specific MCP config writer
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
function writeOpenCodeMcpConfig({
|
|
53
|
+
ui,
|
|
54
|
+
configPath
|
|
55
|
+
}) {
|
|
56
|
+
const entry = {
|
|
57
|
+
type: "local",
|
|
58
|
+
command: ["npx", "webiny-mcp", "serve", "--additional-skills=./my-skills"],
|
|
59
|
+
enabled: true
|
|
60
|
+
};
|
|
61
|
+
let config = {
|
|
62
|
+
$schema: "https://opencode.ai/config.json",
|
|
63
|
+
mcp: {}
|
|
64
|
+
};
|
|
65
|
+
if (existsSync(configPath)) {
|
|
66
|
+
try {
|
|
67
|
+
config = JSON.parse(readFileSync(configPath, "utf8"));
|
|
68
|
+
config.mcp ??= {};
|
|
69
|
+
} catch {
|
|
70
|
+
ui.warning(`Could not parse %s — will overwrite.`, configPath);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (config.mcp.webiny) {
|
|
74
|
+
ui.info(`%s already has a %s entry — skipping.`, configPath, "webiny");
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
config.mcp.webiny = entry;
|
|
78
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
79
|
+
ui.success(`Registered Webiny MCP server in %s`, configPath);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["readFileSync","writeFileSync","existsSync","join","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","configNote","hintFile","init","ui","cwd","info","writeOpenCodeMcpConfig","configPath","hintPath","content","heading","entry","type","command","enabled","config","$schema","mcp","JSON","parse","warning","webiny","stringify","success"],"sources":["opencode.ts"],"sourcesContent":["/**\n * Agent adapter: OpenCode\n *\n * MCP config : opencode.json (project root)\n * Hint file : AGENTS.md (OpenCode reads this automatically each session)\n *\n * OpenCode uses a different MCP config shape than other agents:\n * {\n * \"mcp\": {\n * \"webiny\": { \"type\": \"local\", \"command\": [\"npx\", \"webiny\", \"mcp-server\"], \"enabled\": true }\n * }\n * }\n *\n * Docs: https://opencode.ai/docs/mcp-servers/\n */\n\nimport { readFileSync, writeFileSync, existsSync } from \"fs\";\nimport { join } from \"path\";\nimport type { IUi } from \"../ui.js\";\nimport type { AgentPreset } from \"./types.js\";\nimport { writeHintFile, webinyHintBlock, printDone } from \"./shared.js\";\n\nexport const preset: AgentPreset = {\n slug: \"opencode\",\n displayName: \"OpenCode\",\n configFile: \"opencode.json\",\n configNote: \"uses 'mcp' not 'mcpServers'\",\n hintFile: \"AGENTS.md\"\n};\n\ninterface InitParams {\n ui: IUi;\n cwd: string;\n}\n\nexport async function init({ ui, cwd }: InitParams): Promise<void> {\n ui.info(\"Setting up for OpenCode...\");\n\n writeOpenCodeMcpConfig({ ui, configPath: join(cwd, \"opencode.json\") });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \"AGENTS.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n\n// ---------------------------------------------------------------------------\n// OpenCode-specific MCP config writer\n// ---------------------------------------------------------------------------\n\ninterface WriteOpenCodeMcpConfigParams {\n ui: IUi;\n configPath: string;\n}\n\nfunction writeOpenCodeMcpConfig({ ui, configPath }: WriteOpenCodeMcpConfigParams): boolean {\n const entry = {\n type: \"local\",\n command: [\"npx\", \"webiny-mcp\", \"serve\", \"--additional-skills=./my-skills\"],\n enabled: true\n };\n\n let config: { $schema?: string; mcp: Record<string, unknown> } = {\n $schema: \"https://opencode.ai/config.json\",\n mcp: {}\n };\n\n if (existsSync(configPath)) {\n try {\n config = JSON.parse(readFileSync(configPath, \"utf8\"));\n config.mcp ??= {};\n } catch {\n ui.warning(`Could not parse %s — will overwrite.`, configPath);\n }\n }\n\n if (config.mcp.webiny) {\n ui.info(`%s already has a %s entry — skipping.`, configPath, \"webiny\");\n return false;\n }\n\n config.mcp.webiny = entry;\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n ui.success(`Registered Webiny MCP server in %s`, configPath);\n return true;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,EAAEC,aAAa,EAAEC,UAAU,QAAQ,IAAI;AAC5D,SAASC,IAAI,QAAQ,MAAM;AAG3B,SAASC,aAAa,EAAEC,eAAe,EAAEC,SAAS;AAElD,OAAO,MAAMC,MAAmB,GAAG;EAC/BC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,UAAU;EACvBC,UAAU,EAAE,eAAe;EAC3BC,UAAU,EAAE,6BAA6B;EACzCC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,C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,EAAEW,IAAI,CAACI,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;EACjEZ,EAAE,CAACoB,OAAO,CAAC,oCAAoC,EAAEhB,UAAU,CAAC;EAC5D,OAAO,IAAI;AACf","ignoreList":[]}
|
package/agents/shared.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helpers for agent adapters.
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { IUi } from "../ui.js";
|
|
5
5
|
interface WriteMcpConfigParams {
|
|
6
|
-
ui:
|
|
6
|
+
ui: IUi;
|
|
7
7
|
configPath: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -12,13 +12,13 @@ interface WriteMcpConfigParams {
|
|
|
12
12
|
* All agents use the same JSON shape — only the file path differs:
|
|
13
13
|
* {
|
|
14
14
|
* "mcpServers": {
|
|
15
|
-
* "webiny": { "command": "npx", "args": ["webiny", "
|
|
15
|
+
* "webiny": { "command": "npx", "args": ["webiny-mcp", "serve"] }
|
|
16
16
|
* }
|
|
17
17
|
* }
|
|
18
18
|
*/
|
|
19
19
|
export declare function writeMcpConfig({ ui, configPath }: WriteMcpConfigParams): boolean;
|
|
20
20
|
interface WriteHintFileParams {
|
|
21
|
-
ui:
|
|
21
|
+
ui: IUi;
|
|
22
22
|
hintPath: string;
|
|
23
23
|
content: string;
|
|
24
24
|
marker?: string;
|
|
@@ -34,7 +34,7 @@ interface WebinyHintBlockParams {
|
|
|
34
34
|
}
|
|
35
35
|
export declare function webinyHintBlock({ heading, prefix }?: WebinyHintBlockParams): string;
|
|
36
36
|
interface PrintDoneParams {
|
|
37
|
-
ui:
|
|
37
|
+
ui: IUi;
|
|
38
38
|
extra?: string;
|
|
39
39
|
}
|
|
40
40
|
export declare function printDone({ ui, extra }: PrintDoneParams): void;
|
package/agents/shared.js
CHANGED
|
@@ -15,7 +15,7 @@ import { dirname } from "path";
|
|
|
15
15
|
* All agents use the same JSON shape — only the file path differs:
|
|
16
16
|
* {
|
|
17
17
|
* "mcpServers": {
|
|
18
|
-
* "webiny": { "command": "npx", "args": ["webiny", "
|
|
18
|
+
* "webiny": { "command": "npx", "args": ["webiny-mcp", "serve"] }
|
|
19
19
|
* }
|
|
20
20
|
* }
|
|
21
21
|
*/
|
|
@@ -26,7 +26,7 @@ export function writeMcpConfig({
|
|
|
26
26
|
ensureDir(configPath);
|
|
27
27
|
const entry = {
|
|
28
28
|
command: "npx",
|
|
29
|
-
args: ["webiny", "
|
|
29
|
+
args: ["webiny-mcp", "serve", "--additional-skills=./my-skills"]
|
|
30
30
|
};
|
|
31
31
|
let config = {
|
|
32
32
|
mcpServers: {}
|
|
@@ -104,7 +104,7 @@ export function printDone({
|
|
|
104
104
|
ui.info("Restart your agent/editor session if it is already running.");
|
|
105
105
|
ui.emptyLine();
|
|
106
106
|
ui.info("To test the MCP server directly:");
|
|
107
|
-
ui.info(" %s", "npx @modelcontextprotocol/inspector npx webiny
|
|
107
|
+
ui.info(" %s", "npx @modelcontextprotocol/inspector npx webiny-mcp serve");
|
|
108
108
|
ui.emptyLine();
|
|
109
109
|
}
|
|
110
110
|
|
package/agents/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["readFileSync","writeFileSync","existsSync","mkdirSync","dirname","writeMcpConfig","ui","configPath","ensureDir","entry","command","args","config","mcpServers","JSON","parse","warning","webiny","info","stringify","success","writeHintFile","hintPath","content","marker","existing","includes","trimEnd","trim","webinyHintBlock","heading","prefix","join","printDone","extra","emptyLine","filePath","dir","recursive"],"sources":["shared.ts"],"sourcesContent":["/**\n * Shared helpers for agent adapters.\n */\n\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from \"fs\";\nimport { dirname } from \"path\";\nimport type {
|
|
1
|
+
{"version":3,"names":["readFileSync","writeFileSync","existsSync","mkdirSync","dirname","writeMcpConfig","ui","configPath","ensureDir","entry","command","args","config","mcpServers","JSON","parse","warning","webiny","info","stringify","success","writeHintFile","hintPath","content","marker","existing","includes","trimEnd","trim","webinyHintBlock","heading","prefix","join","printDone","extra","emptyLine","filePath","dir","recursive"],"sources":["shared.ts"],"sourcesContent":["/**\n * Shared helpers for agent adapters.\n */\n\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from \"fs\";\nimport { dirname } from \"path\";\nimport type { IUi } from \"../ui.js\";\n\n// ---------------------------------------------------------------------------\n// MCP config helpers\n// ---------------------------------------------------------------------------\n\ninterface WriteMcpConfigParams {\n ui: IUi;\n configPath: string;\n}\n\n/**\n * Write (or patch) an MCP server registration into a JSON config file.\n *\n * All agents use the same JSON shape — only the file path differs:\n * {\n * \"mcpServers\": {\n * \"webiny\": { \"command\": \"npx\", \"args\": [\"webiny-mcp\", \"serve\"] }\n * }\n * }\n */\nexport function writeMcpConfig({ ui, configPath }: WriteMcpConfigParams): boolean {\n ensureDir(configPath);\n\n const entry = {\n command: \"npx\",\n args: [\"webiny-mcp\", \"serve\", \"--additional-skills=./my-skills\"]\n };\n let config: { mcpServers: Record<string, unknown> } = { mcpServers: {} };\n\n if (existsSync(configPath)) {\n try {\n config = JSON.parse(readFileSync(configPath, \"utf8\"));\n config.mcpServers ??= {};\n } catch {\n ui.warning(`Could not parse %s — will overwrite.`, configPath);\n }\n }\n\n if (config.mcpServers.webiny) {\n ui.info(`%s already has a %s entry — skipping.`, configPath, \"webiny\");\n return false;\n }\n\n config.mcpServers.webiny = entry;\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n ui.success(`Registered Webiny MCP server in %s`, configPath);\n return true;\n}\n\n// ---------------------------------------------------------------------------\n// Hint file helpers\n// ---------------------------------------------------------------------------\n\ninterface WriteHintFileParams {\n ui: IUi;\n hintPath: string;\n content: string;\n marker?: string;\n}\n\n/**\n * Append Webiny instructions to a markdown hint file (CLAUDE.md,\n * copilot-instructions.md, etc.) if not already present.\n */\nexport function writeHintFile({\n ui,\n hintPath,\n content,\n marker = \"list_webiny_skills\"\n}: WriteHintFileParams): boolean {\n ensureDir(hintPath);\n\n if (existsSync(hintPath)) {\n const existing = readFileSync(hintPath, \"utf8\");\n if (existing.includes(marker)) {\n ui.info(`%s already contains Webiny instructions — skipping.`, hintPath);\n return false;\n }\n writeFileSync(hintPath, existing.trimEnd() + \"\\n\\n\" + content.trim() + \"\\n\");\n } else {\n writeFileSync(hintPath, content.trim() + \"\\n\");\n }\n\n ui.success(`Wrote Webiny instructions to ${hintPath}`);\n return true;\n}\n\n// ---------------------------------------------------------------------------\n// Common hint block (same concept across all agents, slightly different wrapping)\n// ---------------------------------------------------------------------------\n\ninterface WebinyHintBlockParams {\n heading?: string;\n prefix?: string;\n}\n\nexport function webinyHintBlock({\n heading = \"## Webiny\",\n prefix = \"\"\n}: WebinyHintBlockParams = {}): string {\n return [\n heading,\n \"\",\n `${prefix}This project uses the Webiny framework.`,\n `${prefix}A \\`webiny\\` MCP server is available.`,\n `${prefix}When helping with Webiny-related tasks:`,\n `${prefix}1. Call \\`list_webiny_skills\\` to see available skills.`,\n `${prefix}2. Call \\`get_webiny_skill\\` with the relevant topic before writing code.`,\n \"\"\n ].join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Done message\n// ---------------------------------------------------------------------------\n\ninterface PrintDoneParams {\n ui: IUi;\n extra?: string;\n}\n\nexport function printDone({ ui, extra }: PrintDoneParams): void {\n ui.emptyLine();\n if (extra) {\n ui.warning(extra);\n }\n ui.info(\"Restart your agent/editor session if it is already running.\");\n ui.emptyLine();\n ui.info(\"To test the MCP server directly:\");\n ui.info(\" %s\", \"npx @modelcontextprotocol/inspector npx webiny-mcp serve\");\n ui.emptyLine();\n}\n\n// ---------------------------------------------------------------------------\n// Internal\n// ---------------------------------------------------------------------------\n\nfunction ensureDir(filePath: string): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n}\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,YA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