@cubis/foundry 0.3.68 → 0.3.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/cli/core.js +95 -2
  2. package/dist/cli/core.js.map +1 -1
  3. package/dist/cli/init/execute.js +6 -4
  4. package/dist/cli/init/execute.js.map +1 -1
  5. package/dist/cli/init/prompts.js +5 -0
  6. package/dist/cli/init/prompts.js.map +1 -1
  7. package/mcp/dist/index.js +37 -8
  8. package/mcp/src/cbxConfig/index.ts +6 -1
  9. package/mcp/src/cbxConfig/serviceConfig.ts +38 -3
  10. package/mcp/src/cbxConfig/types.ts +6 -0
  11. package/mcp/src/gateway/config.ts +69 -8
  12. package/mcp/src/gateway/manager.ts +17 -6
  13. package/mcp/src/gateway/types.ts +1 -1
  14. package/mcp/src/server.ts +18 -13
  15. package/mcp/src/tools/playwrightGetStatus.ts +60 -0
  16. package/mcp/src/tools/registry.test.ts +26 -8
  17. package/mcp/src/tools/registry.ts +29 -2
  18. package/mcp/src/tools/routeResolve.ts +1 -1
  19. package/mcp/src/upstream/passthrough.ts +69 -8
  20. package/package.json +1 -1
  21. package/src/cli/core.ts +100 -5
  22. package/src/cli/init/execute.ts +14 -5
  23. package/src/cli/init/prompts.ts +5 -0
  24. package/src/cli/init/types.ts +1 -1
  25. package/workflows/skills/generated/skill-catalog.json +806 -103
  26. package/workflows/skills/playwright-e2e/SKILL.md +21 -5
  27. package/workflows/skills/playwright-e2e/references/locator-trace-flake-checklist.md +28 -0
  28. package/workflows/skills/skills_index.json +802 -99
  29. package/workflows/workflows/agent-environment-setup/manifest.json +65 -9
  30. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/backend-specialist.md +6 -0
  31. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/code-archaeologist.md +7 -0
  32. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/database-architect.md +6 -0
  33. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/debugger.md +7 -0
  34. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/devops-engineer.md +6 -0
  35. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/documentation-writer.md +4 -0
  36. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/frontend-specialist.md +6 -0
  37. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/game-developer.md +1 -0
  38. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/mobile-developer.md +6 -0
  39. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/orchestrator.md +8 -0
  40. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/penetration-tester.md +4 -0
  41. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/performance-optimizer.md +4 -0
  42. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/product-manager.md +1 -0
  43. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/project-planner.md +8 -0
  44. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/qa-automation-engineer.md +1 -0
  45. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/researcher.md +5 -0
  46. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/security-auditor.md +6 -0
  47. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/seo-specialist.md +1 -0
  48. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/sre-engineer.md +6 -0
  49. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/test-engineer.md +5 -0
  50. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/validator.md +1 -0
  51. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/vercel-expert.md +1 -0
  52. package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +1 -1
  53. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/backend-specialist.md +6 -0
  54. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/code-archaeologist.md +7 -0
  55. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/database-architect.md +6 -0
  56. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/debugger.md +7 -0
  57. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/devops-engineer.md +6 -0
  58. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/documentation-writer.md +4 -0
  59. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/frontend-specialist.md +6 -0
  60. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/game-developer.md +1 -0
  61. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/mobile-developer.md +6 -0
  62. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/orchestrator.md +8 -0
  63. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/penetration-tester.md +4 -0
  64. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/performance-optimizer.md +4 -0
  65. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/product-manager.md +1 -0
  66. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/project-planner.md +8 -0
  67. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/qa-automation-engineer.md +1 -0
  68. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/researcher.md +5 -0
  69. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/security-auditor.md +6 -0
  70. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/seo-specialist.md +1 -0
  71. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/sre-engineer.md +6 -0
  72. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/test-engineer.md +5 -0
  73. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/validator.md +1 -0
  74. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/vercel-expert.md +1 -0
  75. package/workflows/workflows/agent-environment-setup/platforms/claude/rules/CLAUDE.md +77 -63
  76. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/playwright-e2e/SKILL.md +21 -5
  77. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/playwright-e2e/references/locator-trace-flake-checklist.md +28 -0
  78. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/skills_index.json +802 -99
  79. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/backend-specialist.md +6 -0
  80. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/code-archaeologist.md +7 -0
  81. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/database-architect.md +6 -0
  82. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/debugger.md +7 -0
  83. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/devops-engineer.md +6 -0
  84. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/documentation-writer.md +4 -0
  85. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/frontend-specialist.md +6 -0
  86. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/game-developer.md +1 -0
  87. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/mobile-developer.md +6 -0
  88. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/orchestrator.md +8 -0
  89. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/penetration-tester.md +4 -0
  90. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/performance-optimizer.md +4 -0
  91. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/product-manager.md +1 -0
  92. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/project-planner.md +8 -0
  93. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/qa-automation-engineer.md +1 -0
  94. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/researcher.md +5 -0
  95. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/security-auditor.md +6 -0
  96. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/seo-specialist.md +1 -0
  97. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/sre-engineer.md +6 -0
  98. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/test-engineer.md +5 -0
  99. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/validator.md +1 -0
  100. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/vercel-expert.md +1 -0
  101. package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +1 -1
  102. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/backend-specialist.md +5 -0
  103. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/code-archaeologist.md +5 -0
  104. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/database-architect.md +5 -0
  105. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/debugger.md +5 -0
  106. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/devops-engineer.md +5 -0
  107. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/documentation-writer.md +3 -0
  108. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/frontend-specialist.md +5 -0
  109. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/mobile-developer.md +5 -0
  110. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/orchestrator.md +6 -0
  111. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/penetration-tester.md +3 -0
  112. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/performance-optimizer.md +3 -0
  113. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/project-planner.md +6 -0
  114. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/researcher.md +3 -0
  115. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/security-auditor.md +5 -0
  116. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/sre-engineer.md +5 -0
  117. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/test-engineer.md +3 -0
  118. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +87 -82
  119. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/playwright-e2e/SKILL.md +21 -5
  120. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/playwright-e2e/references/locator-trace-flake-checklist.md +28 -0
  121. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/skills_index.json +802 -99
  122. package/workflows/workflows/agent-environment-setup/shared/agents/backend-specialist.md +6 -0
  123. package/workflows/workflows/agent-environment-setup/shared/agents/code-archaeologist.md +7 -0
  124. package/workflows/workflows/agent-environment-setup/shared/agents/database-architect.md +6 -0
  125. package/workflows/workflows/agent-environment-setup/shared/agents/debugger.md +7 -0
  126. package/workflows/workflows/agent-environment-setup/shared/agents/devops-engineer.md +6 -0
  127. package/workflows/workflows/agent-environment-setup/shared/agents/documentation-writer.md +4 -0
  128. package/workflows/workflows/agent-environment-setup/shared/agents/frontend-specialist.md +6 -0
  129. package/workflows/workflows/agent-environment-setup/shared/agents/game-developer.md +1 -0
  130. package/workflows/workflows/agent-environment-setup/shared/agents/mobile-developer.md +6 -0
  131. package/workflows/workflows/agent-environment-setup/shared/agents/orchestrator.md +8 -0
  132. package/workflows/workflows/agent-environment-setup/shared/agents/penetration-tester.md +4 -0
  133. package/workflows/workflows/agent-environment-setup/shared/agents/performance-optimizer.md +4 -0
  134. package/workflows/workflows/agent-environment-setup/shared/agents/product-manager.md +1 -0
  135. package/workflows/workflows/agent-environment-setup/shared/agents/project-planner.md +8 -0
  136. package/workflows/workflows/agent-environment-setup/shared/agents/qa-automation-engineer.md +1 -0
  137. package/workflows/workflows/agent-environment-setup/shared/agents/researcher.md +5 -0
  138. package/workflows/workflows/agent-environment-setup/shared/agents/security-auditor.md +6 -0
  139. package/workflows/workflows/agent-environment-setup/shared/agents/seo-specialist.md +1 -0
  140. package/workflows/workflows/agent-environment-setup/shared/agents/sre-engineer.md +6 -0
  141. package/workflows/workflows/agent-environment-setup/shared/agents/test-engineer.md +5 -0
  142. package/workflows/workflows/agent-environment-setup/shared/agents/validator.md +1 -0
  143. package/workflows/workflows/agent-environment-setup/shared/agents/vercel-expert.md +1 -0
  144. package/workflows/workflows/agent-environment-setup/shared/rules/STEERING.md +27 -4
  145. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/antigravity.md +18 -3
  146. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/claude.md +12 -4
  147. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/codex.md +12 -2
  148. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/copilot.md +13 -3
  149. package/workflows/skills/react-best-practices/docs/AGENTS.md +0 -2934
  150. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/react-best-practices/docs/AGENTS.md +0 -2934
  151. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/AGENTS.md +0 -25
  152. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/react-best-practices/docs/AGENTS.md +0 -2934
@@ -6,10 +6,11 @@ export function buildInitExecutionPlan({ selections, dryRun, overwrite, target,
6
6
  const wantsPostman = hasMcpSelection(selections.selectedMcps, "postman");
7
7
  const wantsStitch = hasMcpSelection(selections.selectedMcps, "stitch");
8
8
  const wantsFoundry = hasMcpSelection(selections.selectedMcps, "cubis-foundry");
9
+ const wantsPlaywright = hasMcpSelection(selections.selectedMcps, "playwright");
9
10
  for (const platform of selections.platforms) {
10
11
  const stitchSupported = platform === "antigravity";
11
12
  const stitchEnabled = wantsStitch && stitchSupported;
12
- const hasAnyMcp = wantsPostman || stitchEnabled || wantsFoundry;
13
+ const hasAnyMcp = wantsPostman || stitchEnabled || wantsFoundry || wantsPlaywright;
13
14
  const warnings = [];
14
15
  if (wantsStitch && !stitchSupported) {
15
16
  warnings.push(`Stitch is not supported on '${platform}'. It will be skipped for this platform.`);
@@ -26,10 +27,11 @@ export function buildInitExecutionPlan({ selections, dryRun, overwrite, target,
26
27
  target,
27
28
  postman: wantsPostman,
28
29
  stitch: stitchEnabled,
30
+ playwright: wantsPlaywright,
29
31
  stitchDefaultForAntigravity: false,
30
32
  mcpScope: selections.mcpScope,
31
33
  foundryMcp: wantsFoundry,
32
- mcpToolSync: wantsPostman || stitchEnabled,
34
+ mcpToolSync: wantsPostman || stitchEnabled || wantsPlaywright,
33
35
  mcpRuntime: hasAnyMcp ? selections.mcpRuntime : "local",
34
36
  mcpFallback: "local",
35
37
  mcpBuildLocal: hasAnyMcp ? selections.mcpBuildLocal : false,
@@ -58,10 +60,10 @@ export function formatInitSummary(selections) {
58
60
  `- Skill profile: ${selections.skillProfile}`,
59
61
  `- Skills scope: ${selections.skillsScope}`,
60
62
  `- MCP scope: ${selections.mcpScope}`,
61
- `- MCP runtime: ${selections.mcpRuntime}${selections.mcpRuntime === "docker" ? selections.mcpBuildLocal ? " (build local image)" : " (pull image)" : ""}`,
63
+ `- MCP runtime: ${selections.mcpRuntime}${selections.mcpRuntime === "docker" ? (selections.mcpBuildLocal ? " (build local image)" : " (pull image)") : ""}`,
62
64
  `- MCP selections: ${selections.selectedMcps.length > 0 ? selections.selectedMcps.join(", ") : "(none)"}`,
63
65
  `- Postman mode: ${postmanSelected ? selections.postmanMode : "(not selected)"}`,
64
- `- Postman workspace: ${postmanSelected ? selections.postmanWorkspaceId === null ? "null" : selections.postmanWorkspaceId : "(not selected)"}`,
66
+ `- Postman workspace: ${postmanSelected ? (selections.postmanWorkspaceId === null ? "null" : selections.postmanWorkspaceId) : "(not selected)"}`,
65
67
  ].join("\n");
66
68
  }
67
69
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/cli/init/execute.ts"],"names":[],"mappings":"AAOA,SAAS,eAAe,CAAC,YAAyB,EAAE,KAAgB;IAClE,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EACrC,UAAU,EACV,MAAM,EACN,SAAS,EACT,MAAM,GAMP;IACC,MAAM,SAAS,GAA4B,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACzE,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,eAAe,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,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3J,qBAAqB,UAAU,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACzG,mBAAmB,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,EAAE;QAChF,wBAAwB,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,kBAAkB,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE;KACjJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -67,6 +67,11 @@ export async function promptInitMcpSelection(defaultMcps) {
67
67
  value: "stitch",
68
68
  checked: defaultMcps.includes("stitch"),
69
69
  },
70
+ {
71
+ name: "Playwright",
72
+ value: "playwright",
73
+ checked: defaultMcps.includes("playwright"),
74
+ },
70
75
  ],
71
76
  });
72
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/cli/init/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AASxE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,SAAS,EACT,aAAa,GAId;IACC,OAAO,MAAM,CAAC;QACZ,OAAO,EAAE,yBAAyB;QAClC,OAAO,EAAE,aAAa;QACtB,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACpC,IAAI,EAAE,QAAQ;YACd,KAAK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B;QAC9D,aAAa,EAAE,MAAM,KAAK,oBAAoB;KAC/C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAe;IACxD,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC;QAC3B,OAAO;QACP,IAAI,EAAE,GAAG;KACV,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,UAAU,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAAe;IAC/D,OAAO,OAAO,CAAC;QACb,OAAO,EAAE,GAAG,OAAO,mCAAmC;QACtD,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;AACL,CAAC"}
package/mcp/dist/index.js CHANGED
@@ -2434,6 +2434,31 @@ async function withUpstreamClient({
2434
2434
  await client.close();
2435
2435
  }
2436
2436
  }
2437
+ function isCallToolResult(result) {
2438
+ return Array.isArray(
2439
+ result.content
2440
+ );
2441
+ }
2442
+ function normalizeUpstreamToolResult(result) {
2443
+ if (isCallToolResult(result)) {
2444
+ return result;
2445
+ }
2446
+ return {
2447
+ content: [
2448
+ {
2449
+ type: "text",
2450
+ text: JSON.stringify(
2451
+ {
2452
+ toolResult: result.toolResult
2453
+ },
2454
+ null,
2455
+ 2
2456
+ )
2457
+ }
2458
+ ],
2459
+ _meta: result._meta
2460
+ };
2461
+ }
2437
2462
  async function persistCatalog(catalog) {
2438
2463
  if (!catalog.configPath) return;
2439
2464
  const catalogDir = resolveCatalogDir(catalog.configPath);
@@ -2563,10 +2588,12 @@ async function callUpstreamTool({
2563
2588
  return withUpstreamClient({
2564
2589
  url: auth.mcpUrl,
2565
2590
  headers: auth.headers,
2566
- fn: async (client) => client.callTool({
2567
- name,
2568
- arguments: argumentsValue
2569
- })
2591
+ fn: async (client) => normalizeUpstreamToolResult(
2592
+ await client.callTool({
2593
+ name,
2594
+ arguments: argumentsValue
2595
+ })
2596
+ )
2570
2597
  });
2571
2598
  }
2572
2599
 
@@ -2631,7 +2658,10 @@ async function createServer({
2631
2658
  const registeredDynamicToolNames = /* @__PURE__ */ new Set();
2632
2659
  for (const catalog of [upstreamCatalogs.postman, upstreamCatalogs.stitch]) {
2633
2660
  for (const tool of catalog.tools) {
2634
- const registrationNames = [tool.namespacedName, ...tool.aliasNames || []];
2661
+ const registrationNames = [
2662
+ tool.namespacedName,
2663
+ ...tool.aliasNames || []
2664
+ ];
2635
2665
  const uniqueRegistrationNames = [...new Set(registrationNames)];
2636
2666
  for (const registrationName of uniqueRegistrationNames) {
2637
2667
  if (registeredDynamicToolNames.has(registrationName)) {
@@ -2648,7 +2678,7 @@ async function createServer({
2648
2678
  inputSchema: dynamicSchema,
2649
2679
  annotations: {}
2650
2680
  },
2651
- async (args) => {
2681
+ async (args, _extra) => {
2652
2682
  try {
2653
2683
  const result = await callUpstreamTool({
2654
2684
  service: catalog.service,
@@ -2657,9 +2687,8 @@ async function createServer({
2657
2687
  scope: defaultConfigScope
2658
2688
  });
2659
2689
  return {
2660
- // SDK content is typed broadly; cast to the expected array shape.
2690
+ ...result,
2661
2691
  content: result.content ?? [],
2662
- structuredContent: result.structuredContent,
2663
2692
  isError: Boolean(result.isError)
2664
2693
  };
2665
2694
  } catch (error) {
@@ -5,6 +5,7 @@ export type {
5
5
  ConfigScope,
6
6
  PostmanConfig,
7
7
  StitchConfig,
8
+ PlaywrightConfig,
8
9
  CbxConfig,
9
10
  EffectiveConfig,
10
11
  } from "./types.js";
@@ -20,4 +21,8 @@ export {
20
21
  redactConfig,
21
22
  } from "./reader.js";
22
23
  export { writeConfigField, ensureConfigExists } from "./writer.js";
23
- export { parsePostmanState, parseStitchState } from "./serviceConfig.js";
24
+ export {
25
+ parsePostmanState,
26
+ parseStitchState,
27
+ parsePlaywrightState,
28
+ } from "./serviceConfig.js";
@@ -24,6 +24,8 @@ export interface CredentialServiceState {
24
24
 
25
25
  const DEFAULT_POSTMAN_URL = "https://mcp.postman.com/minimal";
26
26
  const DEFAULT_STITCH_URL = "https://stitch.googleapis.com/mcp";
27
+ const DEFAULT_PLAYWRIGHT_PORT = 8931;
28
+ const DEFAULT_PLAYWRIGHT_URL = `http://localhost:${DEFAULT_PLAYWRIGHT_PORT}/mcp`;
27
29
  const DEFAULT_PROFILE_NAME = "default";
28
30
  const DEFAULT_POSTMAN_ENV_VAR = "POSTMAN_API_KEY";
29
31
  const DEFAULT_STITCH_ENV_VAR = "STITCH_API_KEY";
@@ -33,7 +35,10 @@ function asRecord(value: unknown): Record<string, unknown> | null {
33
35
  return value as Record<string, unknown>;
34
36
  }
35
37
 
36
- function normalizeName(value: unknown, fallback = DEFAULT_PROFILE_NAME): string {
38
+ function normalizeName(
39
+ value: unknown,
40
+ fallback = DEFAULT_PROFILE_NAME,
41
+ ): string {
37
42
  const normalized = typeof value === "string" ? value.trim() : "";
38
43
  return normalized || fallback;
39
44
  }
@@ -114,7 +119,8 @@ export function parseStitchState(config: CbxConfig): CredentialServiceState {
114
119
  apiKeyEnvVar: normalizeEnvVar(profile.apiKeyEnvVar, fallbackEnvVar),
115
120
  url: normalizeOptionalString(profile.url),
116
121
  hasInlineApiKey:
117
- typeof profile.apiKey === "string" && profile.apiKey.trim().length > 0,
122
+ typeof profile.apiKey === "string" &&
123
+ profile.apiKey.trim().length > 0,
118
124
  });
119
125
  }
120
126
  } else if (asRecord(rawProfiles)) {
@@ -128,7 +134,8 @@ export function parseStitchState(config: CbxConfig): CredentialServiceState {
128
134
  apiKeyEnvVar: normalizeEnvVar(profile.apiKeyEnvVar, fallbackEnvVar),
129
135
  url: normalizeOptionalString(profile.url),
130
136
  hasInlineApiKey:
131
- typeof profile.apiKey === "string" && profile.apiKey.trim().length > 0,
137
+ typeof profile.apiKey === "string" &&
138
+ profile.apiKey.trim().length > 0,
132
139
  });
133
140
  }
134
141
  }
@@ -155,3 +162,31 @@ export function parseStitchState(config: CbxConfig): CredentialServiceState {
155
162
  useSystemGcloud: Boolean(section.useSystemGcloud),
156
163
  };
157
164
  }
165
+
166
+ export interface PlaywrightServiceState {
167
+ mcpUrl: string;
168
+ port: number;
169
+ }
170
+
171
+ export function parsePlaywrightState(
172
+ config: CbxConfig,
173
+ ): PlaywrightServiceState {
174
+ const section = asRecord(config.playwright) ?? {};
175
+ const portRaw =
176
+ typeof section.port === "number" ? section.port : DEFAULT_PLAYWRIGHT_PORT;
177
+ const port =
178
+ Number.isFinite(portRaw) && portRaw > 0 && portRaw < 65536
179
+ ? portRaw
180
+ : DEFAULT_PLAYWRIGHT_PORT;
181
+ const envPort = process.env.PLAYWRIGHT_MCP_PORT
182
+ ? Number(process.env.PLAYWRIGHT_MCP_PORT)
183
+ : undefined;
184
+ const effectivePort =
185
+ envPort && Number.isFinite(envPort) && envPort > 0 && envPort < 65536
186
+ ? envPort
187
+ : port;
188
+ const mcpUrl =
189
+ normalizeOptionalString(section.mcpUrl) ??
190
+ `http://localhost:${effectivePort}/mcp`;
191
+ return { mcpUrl, port: effectivePort };
192
+ }
@@ -31,9 +31,15 @@ export interface StitchConfig {
31
31
  profiles?: ServiceProfile[] | Record<string, ServiceProfile>;
32
32
  }
33
33
 
34
+ export interface PlaywrightConfig {
35
+ mcpUrl?: string;
36
+ port?: number;
37
+ }
38
+
34
39
  export interface CbxConfig {
35
40
  postman?: PostmanConfig;
36
41
  stitch?: StitchConfig;
42
+ playwright?: PlaywrightConfig;
37
43
  [key: string]: unknown;
38
44
  }
39
45
 
@@ -8,10 +8,12 @@ import type {
8
8
  ServiceProfile,
9
9
  PostmanConfig,
10
10
  StitchConfig,
11
+ PlaywrightConfig,
11
12
  } from "../cbxConfig/types.js";
12
13
  import type { UpstreamConfig, UpstreamProvider } from "./types.js";
13
14
 
14
15
  const STITCH_DEFAULT_MCP_URL = "https://stitch.googleapis.com/mcp";
16
+ const PLAYWRIGHT_DEFAULT_PORT = 8931;
15
17
 
16
18
  interface ResolvedGatewayConfig {
17
19
  scope: ConfigScope | null;
@@ -87,7 +89,11 @@ function buildPostmanConfig(
87
89
  const profiles = normalizeProfiles(postman?.profiles);
88
90
  const active = selectActiveProfile(profiles, postman?.activeProfileName);
89
91
 
90
- const mcpUrl = firstString(postman?.mcpUrl, active?.profile.mcpUrl, active?.profile.url);
92
+ const mcpUrl = firstString(
93
+ postman?.mcpUrl,
94
+ active?.profile.mcpUrl,
95
+ active?.profile.url,
96
+ );
91
97
  if (!mcpUrl) {
92
98
  warnings.push("Postman MCP URL is not configured (postman.mcpUrl).");
93
99
  }
@@ -101,11 +107,15 @@ function buildPostmanConfig(
101
107
 
102
108
  const rawApiKeySet = !!firstString(active?.profile.apiKey);
103
109
  if (rawApiKeySet) {
104
- warnings.push("Postman profile apiKey is ignored; configure apiKeyEnvVar/tokenEnvVar alias instead.");
110
+ warnings.push(
111
+ "Postman profile apiKey is ignored; configure apiKeyEnvVar/tokenEnvVar alias instead.",
112
+ );
105
113
  }
106
114
 
107
115
  if (!authEnvVar) {
108
- warnings.push("Postman auth env var alias is missing (active profile apiKeyEnvVar/tokenEnvVar).");
116
+ warnings.push(
117
+ "Postman auth env var alias is missing (active profile apiKeyEnvVar/tokenEnvVar).",
118
+ );
109
119
  return {
110
120
  provider: "postman",
111
121
  mcpUrl,
@@ -155,15 +165,22 @@ function buildStitchConfig(
155
165
  firstString(stitch?.mcpUrl, active?.profile.mcpUrl, active?.profile.url) ??
156
166
  STITCH_DEFAULT_MCP_URL;
157
167
 
158
- const authEnvVar = firstString(active?.profile.apiKeyEnvVar, stitch?.apiKeyEnvVar);
168
+ const authEnvVar = firstString(
169
+ active?.profile.apiKeyEnvVar,
170
+ stitch?.apiKeyEnvVar,
171
+ );
159
172
 
160
173
  const rawApiKeySet = !!firstString(active?.profile.apiKey);
161
174
  if (rawApiKeySet) {
162
- warnings.push("Stitch profile apiKey is ignored; configure apiKeyEnvVar alias instead.");
175
+ warnings.push(
176
+ "Stitch profile apiKey is ignored; configure apiKeyEnvVar alias instead.",
177
+ );
163
178
  }
164
179
 
165
180
  if (!authEnvVar) {
166
- warnings.push("Stitch auth env var alias is missing (active profile apiKeyEnvVar).");
181
+ warnings.push(
182
+ "Stitch auth env var alias is missing (active profile apiKeyEnvVar).",
183
+ );
167
184
  return {
168
185
  provider: "stitch",
169
186
  mcpUrl,
@@ -200,6 +217,36 @@ function buildStitchConfig(
200
217
  };
201
218
  }
202
219
 
220
+ function buildPlaywrightConfig(
221
+ playwright: PlaywrightConfig | undefined,
222
+ scope: ConfigScope | null,
223
+ configPath: string | null,
224
+ ): UpstreamConfig {
225
+ const warnings: string[] = [];
226
+ const portRaw = playwright?.port ?? PLAYWRIGHT_DEFAULT_PORT;
227
+ const envPort = process.env.PLAYWRIGHT_MCP_PORT
228
+ ? Number(process.env.PLAYWRIGHT_MCP_PORT)
229
+ : undefined;
230
+ const effectivePort =
231
+ envPort && Number.isFinite(envPort) && envPort > 0 && envPort < 65536
232
+ ? envPort
233
+ : Number.isFinite(portRaw) && portRaw > 0 && portRaw < 65536
234
+ ? portRaw
235
+ : PLAYWRIGHT_DEFAULT_PORT;
236
+ const mcpUrl =
237
+ firstString(playwright?.mcpUrl) ?? `http://localhost:${effectivePort}/mcp`;
238
+
239
+ return {
240
+ provider: "playwright",
241
+ mcpUrl,
242
+ authHeader: {},
243
+ authEnvVar: null,
244
+ scope,
245
+ configPath,
246
+ warnings,
247
+ };
248
+ }
249
+
203
250
  export function resolveGatewayConfig(
204
251
  scope: ConfigScope | "auto" = "auto",
205
252
  ): ResolvedGatewayConfig {
@@ -230,6 +277,7 @@ export function resolveGatewayConfig(
230
277
  configPath: null,
231
278
  warnings: [warning],
232
279
  },
280
+ playwright: buildPlaywrightConfig(undefined, null, null),
233
281
  },
234
282
  };
235
283
  }
@@ -238,8 +286,21 @@ export function resolveGatewayConfig(
238
286
  scope: effective.scope,
239
287
  configPath: effective.path,
240
288
  providers: {
241
- postman: buildPostmanConfig(effective.config.postman, effective.scope, effective.path),
242
- stitch: buildStitchConfig(effective.config.stitch, effective.scope, effective.path),
289
+ postman: buildPostmanConfig(
290
+ effective.config.postman,
291
+ effective.scope,
292
+ effective.path,
293
+ ),
294
+ stitch: buildStitchConfig(
295
+ effective.config.stitch,
296
+ effective.scope,
297
+ effective.path,
298
+ ),
299
+ playwright: buildPlaywrightConfig(
300
+ effective.config.playwright,
301
+ effective.scope,
302
+ effective.path,
303
+ ),
243
304
  },
244
305
  };
245
306
  }
@@ -11,7 +11,12 @@ import type {
11
11
  UpstreamClientFactory,
12
12
  UpstreamCallResult,
13
13
  } from "./upstreamClient.js";
14
- import type { GatewayStatus, UpstreamProvider, UpstreamState, UpstreamTool } from "./types.js";
14
+ import type {
15
+ GatewayStatus,
16
+ UpstreamProvider,
17
+ UpstreamState,
18
+ UpstreamTool,
19
+ } from "./types.js";
15
20
 
16
21
  export interface GatewayManagerOptions {
17
22
  clientFactory?: UpstreamClientFactory;
@@ -72,13 +77,16 @@ function normalizeArgs(args: unknown): Record<string, unknown> {
72
77
 
73
78
  export class GatewayManager {
74
79
  private readonly clientFactory: UpstreamClientFactory;
75
- private readonly providerRuntime: Record<UpstreamProvider, ProviderRuntime> = {
76
- postman: { mcpUrl: null, headers: null, authEnvVar: null },
77
- stitch: { mcpUrl: null, headers: null, authEnvVar: null },
78
- };
80
+ private readonly providerRuntime: Record<UpstreamProvider, ProviderRuntime> =
81
+ {
82
+ postman: { mcpUrl: null, headers: null, authEnvVar: null },
83
+ stitch: { mcpUrl: null, headers: null, authEnvVar: null },
84
+ playwright: { mcpUrl: null, headers: null, authEnvVar: null },
85
+ };
79
86
  private readonly providerState: Record<UpstreamProvider, UpstreamState> = {
80
87
  postman: emptyProviderState("postman"),
81
88
  stitch: emptyProviderState("stitch"),
89
+ playwright: emptyProviderState("playwright"),
82
90
  };
83
91
 
84
92
  private scope: GatewayStatus["scope"] = null;
@@ -86,7 +94,8 @@ export class GatewayManager {
86
94
  private catalogDir = resolveCatalogDir(null, null);
87
95
 
88
96
  constructor(options?: GatewayManagerOptions) {
89
- this.clientFactory = options?.clientFactory ?? new SdkUpstreamClientFactory();
97
+ this.clientFactory =
98
+ options?.clientFactory ?? new SdkUpstreamClientFactory();
90
99
  }
91
100
 
92
101
  async initialize(): Promise<void> {
@@ -98,6 +107,7 @@ export class GatewayManager {
98
107
  await Promise.all([
99
108
  this.syncProvider("postman", resolved.providers.postman),
100
109
  this.syncProvider("stitch", resolved.providers.stitch),
110
+ this.syncProvider("playwright", resolved.providers.playwright),
101
111
  ]);
102
112
  }
103
113
 
@@ -114,6 +124,7 @@ export class GatewayManager {
114
124
  providers: {
115
125
  postman: this.providerState.postman,
116
126
  stitch: this.providerState.stitch,
127
+ playwright: this.providerState.playwright,
117
128
  },
118
129
  };
119
130
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type { ConfigScope } from "../cbxConfig/types.js";
6
6
 
7
- export type UpstreamProvider = "postman" | "stitch";
7
+ export type UpstreamProvider = "postman" | "stitch" | "playwright";
8
8
 
9
9
  export interface UpstreamTool {
10
10
  name: string;
package/mcp/src/server.ts CHANGED
@@ -2,10 +2,11 @@
2
2
  * Cubis Foundry MCP Server – server factory.
3
3
  *
4
4
  * Creates and configures the McpServer instance with built-in tools
5
- * (via declarative registry) plus dynamic Postman/Stitch passthrough namespaces.
5
+ * (via declarative registry) plus dynamic Postman/Stitch/Playwright passthrough namespaces.
6
6
  */
7
7
 
8
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
9
10
  import { z } from "zod";
10
11
  import type { ServerConfig } from "./config/schema.js";
11
12
  import type { ConfigScope } from "./cbxConfig/types.js";
@@ -30,7 +31,7 @@ function toolCallErrorResult({
30
31
  namespacedName,
31
32
  error,
32
33
  }: {
33
- service: "postman" | "stitch";
34
+ service: "postman" | "stitch" | "playwright";
34
35
  namespacedName: string;
35
36
  error: unknown;
36
37
  }) {
@@ -100,9 +101,16 @@ export async function createServer({
100
101
  const dynamicSchema = z.object({}).passthrough();
101
102
  const registeredDynamicToolNames = new Set<string>();
102
103
 
103
- for (const catalog of [upstreamCatalogs.postman, upstreamCatalogs.stitch]) {
104
+ for (const catalog of [
105
+ upstreamCatalogs.postman,
106
+ upstreamCatalogs.stitch,
107
+ upstreamCatalogs.playwright,
108
+ ]) {
104
109
  for (const tool of catalog.tools) {
105
- const registrationNames = [tool.namespacedName, ...(tool.aliasNames || [])];
110
+ const registrationNames = [
111
+ tool.namespacedName,
112
+ ...(tool.aliasNames || []),
113
+ ];
106
114
  const uniqueRegistrationNames = [...new Set(registrationNames)];
107
115
  for (const registrationName of uniqueRegistrationNames) {
108
116
  if (registeredDynamicToolNames.has(registrationName)) {
@@ -119,7 +127,10 @@ export async function createServer({
119
127
  inputSchema: dynamicSchema,
120
128
  annotations: {},
121
129
  },
122
- async (args: Record<string, unknown>) => {
130
+ async (
131
+ args: Record<string, unknown>,
132
+ _extra,
133
+ ): Promise<CallToolResult> => {
123
134
  try {
124
135
  const result = await callUpstreamTool({
125
136
  service: catalog.service,
@@ -131,14 +142,8 @@ export async function createServer({
131
142
  scope: defaultConfigScope,
132
143
  });
133
144
  return {
134
- // SDK content is typed broadly; cast to the expected array shape.
135
- content: (result.content ?? []) as Array<{
136
- type: string;
137
- [k: string]: unknown;
138
- }>,
139
- structuredContent: result.structuredContent as
140
- | Record<string, unknown>
141
- | undefined,
145
+ ...result,
146
+ content: result.content ?? [],
142
147
  isError: Boolean(result.isError),
143
148
  };
144
149
  } catch (error) {
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Cubis Foundry MCP Server – playwright_get_status tool.
3
+ *
4
+ * Returns the Playwright MCP upstream configuration status.
5
+ */
6
+
7
+ import { z } from "zod";
8
+ import {
9
+ parsePlaywrightState,
10
+ readEffectiveConfig,
11
+ } from "../cbxConfig/index.js";
12
+ import type { ConfigScope } from "../cbxConfig/types.js";
13
+ import { configNotFound } from "../utils/errors.js";
14
+
15
+ export const playwrightGetStatusName = "playwright_get_status";
16
+
17
+ export const playwrightGetStatusDescription =
18
+ "Get Playwright MCP upstream configuration status including URL and port.";
19
+
20
+ export const playwrightGetStatusSchema = z.object({
21
+ scope: z
22
+ .enum(["global", "project", "auto"])
23
+ .optional()
24
+ .describe(
25
+ "Config scope to read. Default: auto (project if exists, else global)",
26
+ ),
27
+ });
28
+
29
+ export function handlePlaywrightGetStatus(
30
+ args: z.infer<typeof playwrightGetStatusSchema>,
31
+ ) {
32
+ const scope = args.scope ?? "auto";
33
+ const effective = readEffectiveConfig(scope as ConfigScope | "auto");
34
+
35
+ if (!effective) {
36
+ configNotFound();
37
+ }
38
+
39
+ const playwright = parsePlaywrightState(effective.config);
40
+
41
+ return {
42
+ content: [
43
+ {
44
+ type: "text" as const,
45
+ text: JSON.stringify(
46
+ {
47
+ configured: Boolean(playwright.mcpUrl),
48
+ mcpUrl: playwright.mcpUrl,
49
+ port: playwright.port,
50
+ scope: effective.scope,
51
+ configPath: effective.path,
52
+ note: "Playwright MCP runs locally — no authentication required. Start with: npx @playwright/mcp --port <port>",
53
+ },
54
+ null,
55
+ 2,
56
+ ),
57
+ },
58
+ ],
59
+ };
60
+ }