@dypai-ai/mcp 1.5.28 → 1.5.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dypai-ai/mcp",
3
- "version": "1.5.28",
3
+ "version": "1.5.29",
4
4
  "description": "DYPAI MCP Server — AI agent toolkit for building and deploying full-stack apps",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,16 +1,28 @@
1
1
  /**
2
- * Cloud backend compiler client — calls Core API snapshot compile routes.
2
+ * Cloud backend compiler client — calls MCP Cloud tool backend_compile_snapshot.
3
+ * MCP local never talks to Core API or the compiler MS directly for Flow compile.
3
4
  */
4
5
 
5
- import { api } from "../api.js"
6
+ import { proxyToolCall } from "../tools/proxy.js"
6
7
  import { collectBackendSnapshotFromDypaiDir } from "./backendSnapshot.js"
7
8
 
8
- function compilerBasePath(projectId) {
9
- return `/api/engine/${encodeURIComponent(projectId)}/backend/snapshot`
9
+ const COMMAND_MAP = {
10
+ validate: "validate",
11
+ list: "list",
12
+ resolve: "resolve",
13
+ "push-payload": "push-payload",
14
+ "push-payloads": "push-payloads",
15
+ "generate-types": "generate-types",
10
16
  }
11
17
 
12
- async function postSnapshotRoute(projectId, route, body) {
13
- return api.post(`${compilerBasePath(projectId)}/${route}`, body)
18
+ async function compileSnapshot(projectId, command, files, endpoint = undefined) {
19
+ const args = {
20
+ project_id: projectId,
21
+ command: COMMAND_MAP[command] || command,
22
+ files,
23
+ }
24
+ if (endpoint) args.endpoint = endpoint
25
+ return proxyToolCall("backend_compile_snapshot", args)
14
26
  }
15
27
 
16
28
  export async function buildSnapshotPayload(dypaiRootDir, projectRoot = null) {
@@ -18,27 +30,27 @@ export async function buildSnapshotPayload(dypaiRootDir, projectRoot = null) {
18
30
  }
19
31
 
20
32
  export async function cloudValidateSnapshot(projectId, files) {
21
- return postSnapshotRoute(projectId, "validate", { files })
33
+ return compileSnapshot(projectId, "validate", files)
22
34
  }
23
35
 
24
36
  export async function cloudListEffectiveEntries(projectId, files) {
25
- return postSnapshotRoute(projectId, "list", { files })
37
+ return compileSnapshot(projectId, "list", files)
26
38
  }
27
39
 
28
40
  export async function cloudResolveEffectiveEndpoint(projectId, files, endpoint) {
29
- return postSnapshotRoute(projectId, "resolve", { files, endpoint })
41
+ return compileSnapshot(projectId, "resolve", files, endpoint)
30
42
  }
31
43
 
32
44
  export async function cloudBuildPushPayload(projectId, files, endpoint) {
33
- return postSnapshotRoute(projectId, "push-payload", { files, endpoint })
45
+ return compileSnapshot(projectId, "push-payload", files, endpoint)
34
46
  }
35
47
 
36
48
  export async function cloudBuildEffectivePushPayloads(projectId, files) {
37
- return postSnapshotRoute(projectId, "effective-push-payloads", { files })
49
+ return compileSnapshot(projectId, "push-payloads", files)
38
50
  }
39
51
 
40
52
  export async function cloudGenerateTypes(projectId, files) {
41
- return postSnapshotRoute(projectId, "generate-types", { files })
53
+ return compileSnapshot(projectId, "generate-types", files)
42
54
  }
43
55
 
44
56
  export async function compileFromDypaiDir(projectId, dypaiRootDir, projectRoot = null) {
@@ -42,6 +42,7 @@ export const MCP_TOOLS_REMOVED = new Set([
42
42
  "search_design_patterns",
43
43
  "search_project_templates",
44
44
  "search_workflow_templates",
45
+ "backend_compile_snapshot",
45
46
  ]);
46
47
 
47
48
  /** Local-only ship/deploy tools — excluded from Studio allowlists, not from local. */