@dypai-ai/mcp 1.1.0 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dypai-ai/mcp",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
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",
package/src/index.js CHANGED
@@ -37,12 +37,12 @@ import { bulkUpsertTool } from "./tools/bulk-upsert.js"
37
37
  // for the agent. The implementation still lives at ./tools/sync/describe.js
38
38
  // in case we want to resurrect it as a read-only peek for multi-project flows.
39
39
  import { dypaiPullTool, dypaiDiffTool, dypaiPushTool, dypaiValidateTool, dypaiTestEndpointTool } from "./tools/sync/index.js"
40
- // dypaiCodegenTool is intentionally NOT imported here codegen runs
41
- // automatically on dypai_pull / dypai_push / schema-affecting execute_sql.
42
- // The standalone tool would duplicate that path and could confuse the agent
43
- // into calling it needlessly. The helper `regenerateTypes` in ./tools/codegen.js
44
- // is still used internally by those triggers.
45
- // import { dypaiCodegenTool } from "./tools/codegen.js"
40
+ // Codegen removed from v1 entirelyneither the standalone tool nor the
41
+ // auto-triggers on pull/push/DDL are wired in. The agent reads dypai/schema.sql
42
+ // and endpoint YAMLs directly and casts at the frontend edge when needed
43
+ // (same mental model as using raw Supabase without the CLI-generated types).
44
+ // The ./tools/codegen.js file is preserved on disk in case v2 re-introduces a
45
+ // leaner version that only emits the Database type without wrappers.
46
46
  import { proxyToolCall } from "./tools/proxy.js"
47
47
  import { enrichSuccess, enrichError } from "./tools/enrich.js"
48
48
  import { maybeRefreshSchemaAfterExecuteSql } from "./tools/sql-side-effects.js"
@@ -75,32 +75,21 @@ const LOCAL_TOOLS = [
75
75
  dypaiPushTool,
76
76
  dypaiTestEndpointTool,
77
77
  // dypaiTestTool (YAML test-suite runner) — hidden until v2. See import comment above.
78
- // dypaiCodegenTool hiddenruns automatically on pull/push/DDL.
78
+ // dypaiCodegenTool removed from v1 see codegen import comment above.
79
79
  ]
80
80
 
81
81
  const localToolMap = new Map(LOCAL_TOOLS.map(t => [t.name, t]))
82
82
 
83
- // ── Remote tools (loaded from MCP server at startup) ────────────────────────
84
-
85
- // Fallback definitions in case remote MCP is unreachable
86
- const FALLBACK_REMOTE_TOOLS = [
87
- { name: "list_projects", description: "List all your projects.", inputSchema: { type: "object", properties: {}, required: [] } },
88
- { name: "get_project", description: "Get project details.", inputSchema: { type: "object", properties: { project_id: { type: "string" } }, required: ["project_id"] } },
89
- { name: "create_project", description: "Create a new project (free plan).", inputSchema: { type: "object", properties: { name: { type: "string" } }, required: ["name"] } },
90
- { name: "execute_sql", description: "Run SQL on the project's database.", inputSchema: { type: "object", properties: { project_id: { type: "string" }, sql: { type: "string" } }, required: ["sql"] } },
91
- { name: "create_endpoint", description: "Create an API endpoint.", inputSchema: { type: "object", properties: { project_id: { type: "string" }, name: { type: "string" }, method: { type: "string" }, workflow_code: { type: "object" } }, required: ["name", "method", "workflow_code"] } },
92
- { name: "update_endpoint", description: "Update an endpoint.", inputSchema: { type: "object", properties: { project_id: { type: "string" }, name: { type: "string" } }, required: ["name"] } },
93
- { name: "delete_endpoint", description: "Delete an endpoint.", inputSchema: { type: "object", properties: { project_id: { type: "string" }, name: { type: "string" } }, required: ["name"] } },
94
- { name: "manage_users", description: "Manage auth users.", inputSchema: { type: "object", properties: { project_id: { type: "string" }, operation: { type: "string" } }, required: ["operation"] } },
95
- { name: "manage_roles", description: "Manage roles.", inputSchema: { type: "object", properties: { project_id: { type: "string" }, operation: { type: "string" } }, required: ["operation"] } },
96
- { name: "list_buckets", description: "List storage buckets.", inputSchema: { type: "object", properties: { project_id: { type: "string" } }, required: [] } },
97
- { name: "search_docs", description: "Search documentation.", inputSchema: { type: "object", properties: { query: { type: "string" } }, required: ["query"] } },
98
- { name: "search_workflow_templates", description: "Search workflow templates.", inputSchema: { type: "object", properties: { query: { type: "string" } }, required: ["query"] } },
99
- { name: "search_project_templates", description: "Search project starter templates.", inputSchema: { type: "object", properties: { query: { type: "string" } }, required: ["query"] } },
100
- { name: "search_nodes", description: "Search workflow nodes.", inputSchema: { type: "object", properties: { query: { type: "string" } }, required: ["query"] } },
101
- ]
102
-
103
- // Descriptions match the remote MCP server (dypai-mcp) exactly
83
+ // ── Remote tools (proxied to the remote MCP server) ────────────────────────
84
+ //
85
+ // The catalog below is the authoritative agent-facing contract. It doesn't
86
+ // auto-sync from the remote — we define it here so tool descriptions stay
87
+ // stable across remote deploys and so the git-first flow is discoverable
88
+ // even when the remote's own tool descriptions drift.
89
+ //
90
+ // If the remote is unreachable, tool CALLS will fail at invoke time (the
91
+ // proxy surfaces the error); the tool LIST stays the same so the agent
92
+ // still sees a coherent catalog.
104
93
  const REMOTE_TOOLS = [
105
94
  // ── Project ───────────────────────────────────────────────────────────────
106
95
  { name: "list_projects", description: "Lists all projects you have access to across your organizations. Returns project id, name, description, organization, subscription plan, and status. Use this as the first step to discover which projects are available, then pass project_id to other tools.", inputSchema: { type: "object", properties: { organization_id: { type: "string", description: "Optional. Filter projects by organization UUID." } }, required: [] } },
@@ -162,7 +151,7 @@ const SERVER_INSTRUCTIONS = `You are building full-stack applications on the DYP
162
151
 
163
152
  ## Getting Started
164
153
  1. Call list_projects() to find your project_id (skip if you already know it).
165
- 2. **ALWAYS CALL dypai_pull FIRST** on any project you haven't worked on in this session. It materializes ./dypai/ (endpoints, SQL, prompts, code, schema.sql, node-catalog.json, realtime.yaml), regenerates TS types under src/dypai/, and returns an \`overview\` block with endpoint groups, credentials, and tool-enabled endpoints — everything you need to orient yourself in one call.
154
+ 2. **ALWAYS CALL dypai_pull FIRST** on any project you haven't worked on in this session. It materializes ./dypai/ (endpoints, SQL, prompts, code, schema.sql, node-catalog.json, realtime.yaml) and returns an \`overview\` block with endpoint groups, credentials, and tool-enabled endpoints — everything you need to orient yourself in one call.
166
155
  3. BEFORE implementing an unfamiliar feature, call search_docs with the topic (e.g. "auth", "upload files", "realtime", "stripe").
167
156
  4. Build backend first, then frontend.
168
157
 
@@ -251,7 +240,7 @@ When you hit a red flag, replace the JS node. When the JS legitimately does more
251
240
  - dypai/tests/*.test.yaml — reserved for the v2 suite runner; leave empty for now
252
241
  - dypai/dypai.config.yaml — project identity (don't hand-edit)
253
242
  - dypai/.dypai/ — local cache (gitignored)
254
- - src/dypai/ — auto-generated TS types (Database + typed api wrapper). Auto-refreshed on pull/push/DDL.
243
+ - src/dypai/ — NOT auto-generated. If you want TS types for row shapes in the frontend, define them manually based on dypai/schema.sql (a codegen helper may return in a future version).
255
244
  - All *_file paths inside YAML are relative to dypai/ root (not to the YAML file).
256
245
 
257
246
  ## Build Frontend
@@ -13,7 +13,8 @@ import { writeFile } from "fs/promises"
13
13
  import { join, isAbsolute, dirname, delimiter } from "path"
14
14
  import { homedir } from "os"
15
15
  import { dumpPublicSchema } from "./sync/schema-dump.js"
16
- import { regenerateTypes } from "./codegen.js"
16
+ // Codegen removed from v1. If we reintroduce TS type generation we'd call it here.
17
+ // import { regenerateTypes } from "./codegen.js"
17
18
 
18
19
  // Matches CREATE/ALTER/DROP/TRUNCATE/RENAME on TABLE — the only DDL shapes we
19
20
  // currently reflect in schema.sql. CREATE INDEX / FUNCTION / TYPE are skipped.
@@ -79,16 +80,9 @@ export async function maybeRefreshSchemaAfterExecuteSql(args, result) {
79
80
  const target = join(dypaiDir, "schema.sql")
80
81
  await writeFile(target, newSchema, "utf8")
81
82
 
82
- // Schema changed → frontend TS types need to follow. Best-effort.
83
- let codegen
84
- try { codegen = await regenerateTypes(dypaiDir) }
85
- catch (e) { codegen = { skipped: true, reason: e.message } }
86
-
87
83
  return {
88
84
  refreshed: true,
89
85
  path: target,
90
- types_regenerated: !!codegen?.regenerated,
91
- types_output: codegen?.output_dir,
92
86
  }
93
87
  } catch (e) {
94
88
  // Don't fail the execute_sql call itself — just report the side-effect failure.
@@ -19,7 +19,10 @@ import YAML from "yaml"
19
19
  import { proxyToolCall } from "../proxy.js"
20
20
  import { serializeEndpoint } from "./codec.js"
21
21
  import { dumpPublicSchema } from "./schema-dump.js"
22
- import { regenerateTypes } from "../codegen.js"
22
+ // Codegen was removed from v1 — the agent reads dypai/schema.sql + endpoint YAMLs
23
+ // directly instead of relying on auto-generated TS types. The codegen.js file
24
+ // still lives on disk in case we resurface it later with a leaner design.
25
+ // import { regenerateTypes } from "../codegen.js"
23
26
 
24
27
  /**
25
28
  * Resolve a user-supplied out_dir. When an IDE spawns this MCP over stdio, the
@@ -352,10 +355,7 @@ export const dypaiPullTool = {
352
355
  }
353
356
  await writeFileEnsured(join(outDir, ".dypai", "state.json"), JSON.stringify(state, null, 2) + "\n")
354
357
 
355
- // Auto-regenerate TS types for the frontend (src/dypai/). Non-fatal on failure.
356
- let codegen
357
- try { codegen = await regenerateTypes(outDir) }
358
- catch (e) { codegen = { skipped: true, reason: e.message } }
358
+ // Codegen removed from v1. If we reintroduce it, this is where it wires in.
359
359
 
360
360
  // Compact overview — replaces what dypai_describe used to print, but
361
361
  // derived from the data we already have in memory (zero extra queries).
@@ -397,9 +397,6 @@ export const dypaiPullTool = {
397
397
  output_dir: outDir,
398
398
  out_dir_resolved_via: outDirSource,
399
399
  overview,
400
- codegen: codegen?.regenerated
401
- ? { output_dir: codegen.output_dir, files: codegen.files_written.length }
402
- : (codegen?.reason || undefined),
403
400
  errors: errors.length ? errors : undefined,
404
401
  warning: suspiciousWarning || undefined,
405
402
  hint: errors.length
@@ -21,7 +21,8 @@ import {
21
21
  localToCanonical,
22
22
  } from "./planner.js"
23
23
  import { runValidation } from "./validate.js"
24
- import { regenerateTypes } from "../codegen.js"
24
+ // Codegen removed from v1 — see pull.js note.
25
+ // import { regenerateTypes } from "../codegen.js"
25
26
 
26
27
  // ─── Apply helpers ─────────────────────────────────────────────────────────
27
28
 
@@ -357,18 +358,6 @@ export const dypaiPushTool = {
357
358
  errors.push({ op: "realtime", error: e.message })
358
359
  }
359
360
 
360
- const changedNames = [
361
- ...applied.created,
362
- ...applied.updated.map(u => u.name),
363
- ]
364
-
365
- // Regenerate TS types if endpoints changed (input/output schemas may have shifted).
366
- let codegen
367
- if (changedNames.length > 0) {
368
- try { codegen = await regenerateTypes(rootDir) }
369
- catch (e) { codegen = { skipped: true, reason: e.message } }
370
- }
371
-
372
361
  return {
373
362
  success: errors.length === 0,
374
363
  applied: true,
@@ -379,9 +368,6 @@ export const dypaiPushTool = {
379
368
  unchanged: plan.unchanged.length,
380
369
  errors: errors.length,
381
370
  realtime: realtime || { skipped: true, reason: "no realtime.yaml" },
382
- codegen: codegen?.regenerated
383
- ? { files: codegen.files_written.length }
384
- : (codegen?.reason || "no changes to regenerate"),
385
371
  },
386
372
  details: applied,
387
373
  errors: errors.length ? errors : undefined,