@dypai-ai/mcp 1.1.0 → 1.2.0
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 +1 -1
- package/src/index.js +9 -9
- package/src/tools/sql-side-effects.js +2 -8
- package/src/tools/sync/pull.js +5 -8
- package/src/tools/sync/push.js +2 -16
package/package.json
CHANGED
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
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
// is
|
|
45
|
-
//
|
|
40
|
+
// Codegen removed from v1 entirely — neither 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,7 +75,7 @@ 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
|
|
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]))
|
|
@@ -162,7 +162,7 @@ const SERVER_INSTRUCTIONS = `You are building full-stack applications on the DYP
|
|
|
162
162
|
|
|
163
163
|
## Getting Started
|
|
164
164
|
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)
|
|
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) and returns an \`overview\` block with endpoint groups, credentials, and tool-enabled endpoints — everything you need to orient yourself in one call.
|
|
166
166
|
3. BEFORE implementing an unfamiliar feature, call search_docs with the topic (e.g. "auth", "upload files", "realtime", "stripe").
|
|
167
167
|
4. Build backend first, then frontend.
|
|
168
168
|
|
|
@@ -251,7 +251,7 @@ When you hit a red flag, replace the JS node. When the JS legitimately does more
|
|
|
251
251
|
- dypai/tests/*.test.yaml — reserved for the v2 suite runner; leave empty for now
|
|
252
252
|
- dypai/dypai.config.yaml — project identity (don't hand-edit)
|
|
253
253
|
- dypai/.dypai/ — local cache (gitignored)
|
|
254
|
-
- src/dypai/ — auto-generated TS types
|
|
254
|
+
- 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
255
|
- All *_file paths inside YAML are relative to dypai/ root (not to the YAML file).
|
|
256
256
|
|
|
257
257
|
## 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
|
-
|
|
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.
|
package/src/tools/sync/pull.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
//
|
|
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
|
package/src/tools/sync/push.js
CHANGED
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
localToCanonical,
|
|
22
22
|
} from "./planner.js"
|
|
23
23
|
import { runValidation } from "./validate.js"
|
|
24
|
-
|
|
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,
|