@webiny/mcp 6.3.0 → 6.4.0-beta.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/agents/kiro.js CHANGED
@@ -1,39 +1,28 @@
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
1
  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"
2
+ import { printDone, webinyHintBlock, writeHintFile, writeMcpConfig } from "./shared.js";
3
+ const preset = {
4
+ slug: "kiro",
5
+ displayName: "Kiro",
6
+ configFile: ".kiro/settings/mcp.json",
7
+ hintFile: "AGENTS.md"
17
8
  };
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
- });
9
+ async function init({ ui, cwd }) {
10
+ ui.info("Setting up for Kiro...");
11
+ writeMcpConfig({
12
+ ui,
13
+ configPath: join(cwd, ".kiro/settings/mcp.json")
14
+ });
15
+ writeHintFile({
16
+ ui,
17
+ hintPath: join(cwd, "AGENTS.md"),
18
+ content: webinyHintBlock({
19
+ heading: "## Webiny"
20
+ })
21
+ });
22
+ printDone({
23
+ ui
24
+ });
37
25
  }
26
+ export { init, preset };
38
27
 
39
28
  //# sourceMappingURL=kiro.js.map
@@ -1 +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":[]}
1
+ {"version":3,"file":"agents/kiro.js","sources":["../../src/agents/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"],"names":["preset","init","ui","cwd","writeMcpConfig","join","writeHintFile","webinyHintBlock","printDone"],"mappings":";;AAcO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,UAAU;AACd;AAOO,eAAeC,KAAK,EAAEC,EAAE,EAAEC,GAAG,EAAc;IAC9CD,GAAG,IAAI,CAAC;IAERE,eAAe;QACXF;QACA,YAAYG,KAAKF,KAAK;IAC1B;IAEAG,cAAc;QACVJ;QACA,UAAUG,KAAKF,KAAK;QACpB,SAASI,gBAAgB;YAAE,SAAS;QAAY;IACpD;IAEAC,UAAU;QAAEN;IAAG;AACnB"}
@@ -1,83 +1,60 @@
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";
1
+ import { existsSync, readFileSync, writeFileSync } from "fs";
18
2
  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"
3
+ import { printDone, webinyHintBlock, writeHintFile } from "./shared.js";
4
+ const preset = {
5
+ slug: "opencode",
6
+ displayName: "OpenCode",
7
+ configFile: "opencode.json",
8
+ configNote: "uses 'mcp' not 'mcpServers'",
9
+ hintFile: "AGENTS.md"
26
10
  };
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
- });
11
+ async function init({ ui, cwd }) {
12
+ ui.info("Setting up for OpenCode...");
13
+ writeOpenCodeMcpConfig({
14
+ ui,
15
+ configPath: join(cwd, "opencode.json")
16
+ });
17
+ writeHintFile({
18
+ ui,
19
+ hintPath: join(cwd, "AGENTS.md"),
20
+ content: webinyHintBlock({
21
+ heading: "## Webiny"
22
+ })
23
+ });
24
+ printDone({
25
+ ui
26
+ });
46
27
  }
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);
28
+ function writeOpenCodeMcpConfig({ ui, configPath }) {
29
+ const entry = {
30
+ type: "local",
31
+ command: [
32
+ "npx",
33
+ "webiny-mcp",
34
+ "serve",
35
+ "--additional-skills=./my-skills"
36
+ ],
37
+ enabled: true
38
+ };
39
+ let config = {
40
+ $schema: "https://opencode.ai/config.json",
41
+ mcp: {}
42
+ };
43
+ if (existsSync(configPath)) try {
44
+ config = JSON.parse(readFileSync(configPath, "utf8"));
45
+ config.mcp ??= {};
46
+ } catch {
47
+ ui.warning("Could not parse %s — will overwrite.", configPath);
48
+ }
49
+ if (config.mcp.webiny) {
50
+ ui.info("%s already has a %s entry — skipping.", configPath, "webiny");
51
+ return false;
71
52
  }
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;
53
+ config.mcp.webiny = entry;
54
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
55
+ ui.success("Registered Webiny MCP server in %s", configPath);
56
+ return true;
81
57
  }
58
+ export { init, preset };
82
59
 
83
60
  //# sourceMappingURL=opencode.js.map
@@ -1 +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,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,4BAA4B,CAAC;EAErCC,sBAAsB,CAAC;IAAEH,EAAE;IAAEI,UAAU,EAAEf,IAAI,CAACY,GAAG,EAAE,eAAe;EAAE,CAAC,CAAC;EAEtEX,aAAa,CAAC;IACVU,EAAE;IACFK,QAAQ,EAAEhB,IAAI,CAACY,GAAG,EAAE,WAAW,CAAC;IAChCK,OAAO,EAAEf,eAAe,CAAC;MAAEgB,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEFf,SAAS,CAAC;IAAEQ;EAAG,CAAC,CAAC;AACrB;;AAEA;AACA;AACA;;AAOA,SAASG,sBAAsBA,CAAC;EAAEH,EAAE;EAAEI;AAAyC,CAAC,EAAW;EACvF,MAAMI,KAAK,GAAG;IACVC,IAAI,EAAE,OAAO;IACbC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,iCAAiC,CAAC;IAC1EC,OAAO,EAAE;EACb,CAAC;EAED,IAAIC,MAA0D,GAAG;IAC7DC,OAAO,EAAE,iCAAiC;IAC1CC,GAAG,EAAE,CAAC;EACV,CAAC;EAED,IAAI1B,UAAU,CAACgB,UAAU,CAAC,EAAE;IACxB,IAAI;MACAQ,MAAM,GAAGG,IAAI,CAACC,KAAK,CAAC9B,YAAY,CAACkB,UAAU,EAAE,MAAM,CAAC,CAAC;MACrDQ,MAAM,CAACE,GAAG,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC,MAAM;MACJd,EAAE,CAACiB,OAAO,CAAC,sCAAsC,EAAEb,UAAU,CAAC;IAClE;EACJ;EAEA,IAAIQ,MAAM,CAACE,GAAG,CAACI,MAAM,EAAE;IACnBlB,EAAE,CAACE,IAAI,CAAC,uCAAuC,EAAEE,UAAU,EAAE,QAAQ,CAAC;IACtE,OAAO,KAAK;EAChB;EAEAQ,MAAM,CAACE,GAAG,CAACI,MAAM,GAAGV,KAAK;EACzBrB,aAAa,CAACiB,UAAU,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":[]}
1
+ {"version":3,"file":"agents/opencode.js","sources":["../../src/agents/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"],"names":["preset","init","ui","cwd","writeOpenCodeMcpConfig","join","writeHintFile","webinyHintBlock","printDone","configPath","entry","config","existsSync","JSON","readFileSync","writeFileSync"],"mappings":";;;AAsBO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,UAAU;AACd;AAOO,eAAeC,KAAK,EAAEC,EAAE,EAAEC,GAAG,EAAc;IAC9CD,GAAG,IAAI,CAAC;IAERE,uBAAuB;QAAEF;QAAI,YAAYG,KAAKF,KAAK;IAAiB;IAEpEG,cAAc;QACVJ;QACA,UAAUG,KAAKF,KAAK;QACpB,SAASI,gBAAgB;YAAE,SAAS;QAAY;IACpD;IAEAC,UAAU;QAAEN;IAAG;AACnB;AAWA,SAASE,uBAAuB,EAAEF,EAAE,EAAEO,UAAU,EAAgC;IAC5E,MAAMC,QAAQ;QACV,MAAM;QACN,SAAS;YAAC;YAAO;YAAc;YAAS;SAAkC;QAC1E,SAAS;IACb;IAEA,IAAIC,SAA6D;QAC7D,SAAS;QACT,KAAK,CAAC;IACV;IAEA,IAAIC,WAAWH,aACX,IAAI;QACAE,SAASE,KAAK,KAAK,CAACC,aAAaL,YAAY;QAC7CE,OAAO,GAAG,KAAK,CAAC;IACpB,EAAE,OAAM;QACJT,GAAG,OAAO,CAAC,wCAAwCO;IACvD;IAGJ,IAAIE,OAAO,GAAG,CAAC,MAAM,EAAE;QACnBT,GAAG,IAAI,CAAC,yCAAyCO,YAAY;QAC7D,OAAO;IACX;IAEAE,OAAO,GAAG,CAAC,MAAM,GAAGD;IACpBK,cAAcN,YAAYI,KAAK,SAAS,CAACF,QAAQ,MAAM,KAAK;IAC5DT,GAAG,OAAO,CAAC,sCAAsCO;IACjD,OAAO;AACX"}
package/agents/shared.js CHANGED
@@ -1,124 +1,73 @@
1
- /**
2
- * Shared helpers for agent adapters.
3
- */
4
-
5
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
6
2
  import { dirname } from "path";
7
-
8
- // ---------------------------------------------------------------------------
9
- // MCP config helpers
10
- // ---------------------------------------------------------------------------
11
-
12
- /**
13
- * Write (or patch) an MCP server registration into a JSON config file.
14
- *
15
- * All agents use the same JSON shape — only the file path differs:
16
- * {
17
- * "mcpServers": {
18
- * "webiny": { "command": "npx", "args": ["webiny-mcp", "serve"] }
19
- * }
20
- * }
21
- */
22
- export function writeMcpConfig({
23
- ui,
24
- configPath
25
- }) {
26
- ensureDir(configPath);
27
- const entry = {
28
- command: "npx",
29
- args: ["webiny-mcp", "serve", "--additional-skills=./my-skills"]
30
- };
31
- let config = {
32
- mcpServers: {}
33
- };
34
- if (existsSync(configPath)) {
35
- try {
36
- config = JSON.parse(readFileSync(configPath, "utf8"));
37
- config.mcpServers ??= {};
38
- } catch {
39
- ui.warning(`Could not parse %s — will overwrite.`, configPath);
3
+ function writeMcpConfig({ ui, configPath }) {
4
+ ensureDir(configPath);
5
+ const entry = {
6
+ command: "npx",
7
+ args: [
8
+ "webiny-mcp",
9
+ "serve",
10
+ "--additional-skills=./my-skills"
11
+ ]
12
+ };
13
+ let config = {
14
+ mcpServers: {}
15
+ };
16
+ if (existsSync(configPath)) try {
17
+ config = JSON.parse(readFileSync(configPath, "utf8"));
18
+ config.mcpServers ??= {};
19
+ } catch {
20
+ ui.warning("Could not parse %s — will overwrite.", configPath);
40
21
  }
41
- }
42
- if (config.mcpServers.webiny) {
43
- ui.info(`%s already has a %s entry — skipping.`, configPath, "webiny");
44
- return false;
45
- }
46
- config.mcpServers.webiny = entry;
47
- writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
48
- ui.success(`Registered Webiny MCP server in %s`, configPath);
49
- return true;
50
- }
51
-
52
- // ---------------------------------------------------------------------------
53
- // Hint file helpers
54
- // ---------------------------------------------------------------------------
55
-
56
- /**
57
- * Append Webiny instructions to a markdown hint file (CLAUDE.md,
58
- * copilot-instructions.md, etc.) if not already present.
59
- */
60
- export function writeHintFile({
61
- ui,
62
- hintPath,
63
- content,
64
- marker = "list_webiny_skills"
65
- }) {
66
- ensureDir(hintPath);
67
- if (existsSync(hintPath)) {
68
- const existing = readFileSync(hintPath, "utf8");
69
- if (existing.includes(marker)) {
70
- ui.info(`%s already contains Webiny instructions — skipping.`, hintPath);
71
- return false;
22
+ if (config.mcpServers.webiny) {
23
+ ui.info("%s already has a %s entry — skipping.", configPath, "webiny");
24
+ return false;
72
25
  }
73
- writeFileSync(hintPath, existing.trimEnd() + "\n\n" + content.trim() + "\n");
74
- } else {
75
- writeFileSync(hintPath, content.trim() + "\n");
76
- }
77
- ui.success(`Wrote Webiny instructions to ${hintPath}`);
78
- return true;
26
+ config.mcpServers.webiny = entry;
27
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
28
+ ui.success("Registered Webiny MCP server in %s", configPath);
29
+ return true;
79
30
  }
80
-
81
- // ---------------------------------------------------------------------------
82
- // Common hint block (same concept across all agents, slightly different wrapping)
83
- // ---------------------------------------------------------------------------
84
-
85
- export function webinyHintBlock({
86
- heading = "## Webiny",
87
- prefix = ""
88
- } = {}) {
89
- return [heading, "", `${prefix}This project uses the Webiny framework.`, `${prefix}A \`webiny\` MCP server is available.`, `${prefix}When helping with Webiny-related tasks:`, `${prefix}1. Call \`list_webiny_skills\` to see available skills.`, `${prefix}2. Call \`get_webiny_skill\` with the relevant topic before writing code.`, ""].join("\n");
31
+ function writeHintFile({ ui, hintPath, content, marker = "list_webiny_skills" }) {
32
+ ensureDir(hintPath);
33
+ if (existsSync(hintPath)) {
34
+ const existing = readFileSync(hintPath, "utf8");
35
+ if (existing.includes(marker)) {
36
+ ui.info("%s already contains Webiny instructions — skipping.", hintPath);
37
+ return false;
38
+ }
39
+ writeFileSync(hintPath, existing.trimEnd() + "\n\n" + content.trim() + "\n");
40
+ } else writeFileSync(hintPath, content.trim() + "\n");
41
+ ui.success(`Wrote Webiny instructions to ${hintPath}`);
42
+ return true;
90
43
  }
91
-
92
- // ---------------------------------------------------------------------------
93
- // Done message
94
- // ---------------------------------------------------------------------------
95
-
96
- export function printDone({
97
- ui,
98
- extra
99
- }) {
100
- ui.emptyLine();
101
- if (extra) {
102
- ui.warning(extra);
103
- }
104
- ui.info("Restart your agent/editor session if it is already running.");
105
- ui.emptyLine();
106
- ui.info("To test the MCP server directly:");
107
- ui.info(" %s", "npx @modelcontextprotocol/inspector npx webiny-mcp serve");
108
- ui.emptyLine();
44
+ function webinyHintBlock({ heading = "## Webiny", prefix = "" } = {}) {
45
+ return [
46
+ heading,
47
+ "",
48
+ `${prefix}This project uses the Webiny framework.`,
49
+ `${prefix}A \`webiny\` MCP server is available.`,
50
+ `${prefix}When helping with Webiny-related tasks:`,
51
+ `${prefix}1. Call \`list_webiny_skills\` to see available skills.`,
52
+ `${prefix}2. Call \`get_webiny_skill\` with the relevant topic before writing code.`,
53
+ ""
54
+ ].join("\n");
55
+ }
56
+ function printDone({ ui, extra }) {
57
+ ui.emptyLine();
58
+ if (extra) ui.warning(extra);
59
+ ui.info("Restart your agent/editor session if it is already running.");
60
+ ui.emptyLine();
61
+ ui.info("To test the MCP server directly:");
62
+ ui.info(" %s", "npx @modelcontextprotocol/inspector npx webiny-mcp serve");
63
+ ui.emptyLine();
109
64
  }
110
-
111
- // ---------------------------------------------------------------------------
112
- // Internal
113
- // ---------------------------------------------------------------------------
114
-
115
65
  function ensureDir(filePath) {
116
- const dir = dirname(filePath);
117
- if (!existsSync(dir)) {
118
- mkdirSync(dir, {
119
- recursive: true
66
+ const dir = dirname(filePath);
67
+ if (!existsSync(dir)) mkdirSync(dir, {
68
+ recursive: true
120
69
  });
121
- }
122
70
  }
71
+ export { printDone, webinyHintBlock, writeHintFile, writeMcpConfig };
123
72
 
124
73
  //# sourceMappingURL=shared.js.map
@@ -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 { 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":"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","ignoreList":[]}
1
+ {"version":3,"file":"agents/shared.js","sources":["../../src/agents/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"],"names":["writeMcpConfig","ui","configPath","ensureDir","entry","config","existsSync","JSON","readFileSync","writeFileSync","writeHintFile","hintPath","content","marker","existing","webinyHintBlock","heading","prefix","printDone","extra","filePath","dir","dirname","mkdirSync"],"mappings":";;AA2BO,SAASA,eAAe,EAAEC,EAAE,EAAEC,UAAU,EAAwB;IACnEC,UAAUD;IAEV,MAAME,QAAQ;QACV,SAAS;QACT,MAAM;YAAC;YAAc;YAAS;SAAkC;IACpE;IACA,IAAIC,SAAkD;QAAE,YAAY,CAAC;IAAE;IAEvE,IAAIC,WAAWJ,aACX,IAAI;QACAG,SAASE,KAAK,KAAK,CAACC,aAAaN,YAAY;QAC7CG,OAAO,UAAU,KAAK,CAAC;IAC3B,EAAE,OAAM;QACJJ,GAAG,OAAO,CAAC,wCAAwCC;IACvD;IAGJ,IAAIG,OAAO,UAAU,CAAC,MAAM,EAAE;QAC1BJ,GAAG,IAAI,CAAC,yCAAyCC,YAAY;QAC7D,OAAO;IACX;IAEAG,OAAO,UAAU,CAAC,MAAM,GAAGD;IAC3BK,cAAcP,YAAYK,KAAK,SAAS,CAACF,QAAQ,MAAM,KAAK;IAC5DJ,GAAG,OAAO,CAAC,sCAAsCC;IACjD,OAAO;AACX;AAiBO,SAASQ,cAAc,EAC1BT,EAAE,EACFU,QAAQ,EACRC,OAAO,EACPC,SAAS,oBAAoB,EACX;IAClBV,UAAUQ;IAEV,IAAIL,WAAWK,WAAW;QACtB,MAAMG,WAAWN,aAAaG,UAAU;QACxC,IAAIG,SAAS,QAAQ,CAACD,SAAS;YAC3BZ,GAAG,IAAI,CAAC,uDAAuDU;YAC/D,OAAO;QACX;QACAF,cAAcE,UAAUG,SAAS,OAAO,KAAK,SAASF,QAAQ,IAAI,KAAK;IAC3E,OACIH,cAAcE,UAAUC,QAAQ,IAAI,KAAK;IAG7CX,GAAG,OAAO,CAAC,CAAC,6BAA6B,EAAEU,UAAU;IACrD,OAAO;AACX;AAWO,SAASI,gBAAgB,EAC5BC,UAAU,WAAW,EACrBC,SAAS,EAAE,EACS,GAAG,CAAC,CAAC;IACzB,OAAO;QACHD;QACA;QACA,GAAGC,OAAO,uCAAuC,CAAC;QAClD,GAAGA,OAAO,qCAAqC,CAAC;QAChD,GAAGA,OAAO,uCAAuC,CAAC;QAClD,GAAGA,OAAO,uDAAuD,CAAC;QAClE,GAAGA,OAAO,yEAAyE,CAAC;QACpF;KACH,CAAC,IAAI,CAAC;AACX;AAWO,SAASC,UAAU,EAAEjB,EAAE,EAAEkB,KAAK,EAAmB;IACpDlB,GAAG,SAAS;IACZ,IAAIkB,OACAlB,GAAG,OAAO,CAACkB;IAEflB,GAAG,IAAI,CAAC;IACRA,GAAG,SAAS;IACZA,GAAG,IAAI,CAAC;IACRA,GAAG,IAAI,CAAC,QAAQ;IAChBA,GAAG,SAAS;AAChB;AAMA,SAASE,UAAUiB,QAAgB;IAC/B,MAAMC,MAAMC,QAAQF;IACpB,IAAI,CAACd,WAAWe,MACZE,UAAUF,KAAK;QAAE,WAAW;IAAK;AAEzC"}
package/agents/types.js CHANGED
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1,39 +1,28 @@
1
- /**
2
- * Agent adapter: Windsurf (Codeium)
3
- *
4
- * MCP config : .windsurf/mcp.json (project-level)
5
- * Hint file : .windsurf/rules/webiny.md
6
- *
7
- * Docs: https://docs.codeium.com/windsurf/mcp
8
- */
9
-
10
1
  import { join } from "path";
11
- import { writeMcpConfig, writeHintFile, webinyHintBlock, printDone } from "./shared.js";
12
- export const preset = {
13
- slug: "windsurf",
14
- displayName: "Windsurf",
15
- configFile: ".windsurf/mcp.json",
16
- hintFile: ".windsurf/rules/*.md"
2
+ import { printDone, webinyHintBlock, writeHintFile, writeMcpConfig } from "./shared.js";
3
+ const preset = {
4
+ slug: "windsurf",
5
+ displayName: "Windsurf",
6
+ configFile: ".windsurf/mcp.json",
7
+ hintFile: ".windsurf/rules/*.md"
17
8
  };
18
- export async function init({
19
- ui,
20
- cwd
21
- }) {
22
- ui.info("Setting up for Windsurf...");
23
- writeMcpConfig({
24
- ui,
25
- configPath: join(cwd, ".windsurf", "mcp.json")
26
- });
27
- writeHintFile({
28
- ui,
29
- hintPath: join(cwd, ".windsurf", "rules", "webiny.md"),
30
- content: webinyHintBlock({
31
- heading: "## Webiny"
32
- })
33
- });
34
- printDone({
35
- ui
36
- });
9
+ async function init({ ui, cwd }) {
10
+ ui.info("Setting up for Windsurf...");
11
+ writeMcpConfig({
12
+ ui,
13
+ configPath: join(cwd, ".windsurf", "mcp.json")
14
+ });
15
+ writeHintFile({
16
+ ui,
17
+ hintPath: join(cwd, ".windsurf", "rules", "webiny.md"),
18
+ content: webinyHintBlock({
19
+ heading: "## Webiny"
20
+ })
21
+ });
22
+ printDone({
23
+ ui
24
+ });
37
25
  }
26
+ export { init, preset };
38
27
 
39
28
  //# sourceMappingURL=windsurf.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["join","writeMcpConfig","writeHintFile","webinyHintBlock","printDone","preset","slug","displayName","configFile","hintFile","init","ui","cwd","info","configPath","hintPath","content","heading"],"sources":["windsurf.ts"],"sourcesContent":["/**\n * Agent adapter: Windsurf (Codeium)\n *\n * MCP config : .windsurf/mcp.json (project-level)\n * Hint file : .windsurf/rules/webiny.md\n *\n * Docs: https://docs.codeium.com/windsurf/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: \"windsurf\",\n displayName: \"Windsurf\",\n configFile: \".windsurf/mcp.json\",\n hintFile: \".windsurf/rules/*.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 Windsurf...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".windsurf\", \"mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".windsurf\", \"rules\", \"webiny.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,UAAU;EAChBC,WAAW,EAAE,UAAU;EACvBC,UAAU,EAAE,oBAAoB;EAChCC,QAAQ,EAAE;AACd,CAAC;AAOD,OAAO,eAAeC,IAAIA,CAAC;EAAEC,EAAE;EAAEC;AAAgB,CAAC,EAAiB;EAC/DD,EAAE,CAACE,IAAI,CAAC,4BAA4B,CAAC;EAErCZ,cAAc,CAAC;IACXU,EAAE;IACFG,UAAU,EAAEd,IAAI,CAACY,GAAG,EAAE,WAAW,EAAE,UAAU;EACjD,CAAC,CAAC;EAEFV,aAAa,CAAC;IACVS,EAAE;IACFI,QAAQ,EAAEf,IAAI,CAACY,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC;IACtDI,OAAO,EAAEb,eAAe,CAAC;MAAEc,OAAO,EAAE;IAAY,CAAC;EACrD,CAAC,CAAC;EAEFb,SAAS,CAAC;IAAEO;EAAG,CAAC,CAAC;AACrB","ignoreList":[]}
1
+ {"version":3,"file":"agents/windsurf.js","sources":["../../src/agents/windsurf.ts"],"sourcesContent":["/**\n * Agent adapter: Windsurf (Codeium)\n *\n * MCP config : .windsurf/mcp.json (project-level)\n * Hint file : .windsurf/rules/webiny.md\n *\n * Docs: https://docs.codeium.com/windsurf/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: \"windsurf\",\n displayName: \"Windsurf\",\n configFile: \".windsurf/mcp.json\",\n hintFile: \".windsurf/rules/*.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 Windsurf...\");\n\n writeMcpConfig({\n ui,\n configPath: join(cwd, \".windsurf\", \"mcp.json\")\n });\n\n writeHintFile({\n ui,\n hintPath: join(cwd, \".windsurf\", \"rules\", \"webiny.md\"),\n content: webinyHintBlock({ heading: \"## Webiny\" })\n });\n\n printDone({ ui });\n}\n"],"names":["preset","init","ui","cwd","writeMcpConfig","join","writeHintFile","webinyHintBlock","printDone"],"mappings":";;AAcO,MAAMA,SAAsB;IAC/B,MAAM;IACN,aAAa;IACb,YAAY;IACZ,UAAU;AACd;AAOO,eAAeC,KAAK,EAAEC,EAAE,EAAEC,GAAG,EAAc;IAC9CD,GAAG,IAAI,CAAC;IAERE,eAAe;QACXF;QACA,YAAYG,KAAKF,KAAK,aAAa;IACvC;IAEAG,cAAc;QACVJ;QACA,UAAUG,KAAKF,KAAK,aAAa,SAAS;QAC1C,SAASI,gBAAgB;YAAE,SAAS;QAAY;IACpD;IAEAC,UAAU;QAAEN;IAAG;AACnB"}
package/bin.js CHANGED
@@ -1,4 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  import "./cli.js";
3
-
4
- //# sourceMappingURL=bin.js.map