@dforge-core/dforge-mcp 0.2.28 → 0.2.30

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.
@@ -160,5 +160,5 @@ VS Code with the [dForge extension](https://github.com/dforge-core/dforge-editor
160
160
  - [dforge-module-design](../skills/dforge-module-design/SKILL.md) — Phase 0, including the intake guardrails and gap scans
161
161
  - [dforge-module-build](../skills/dforge-module-build/SKILL.md) — Phases 1-5, the loading-policy table, core-rules cheat sheet, and the deterministic backtrack protocol
162
162
  - [dforge-module-ship](../skills/dforge-module-ship/SKILL.md) — Phase 6 and the install-fix loop
163
- - [README.md](../README.md) — full tool reference (34 tools) + maintainer docs
163
+ - [README.md](../README.md) — full tool reference (35 tools) + maintainer docs
164
164
  - [iash44/dForge-core](https://github.com/iash44/dForge-core) — the platform itself: source of truth for the schemas + DSL conventions
package/package.json CHANGED
@@ -1,49 +1,47 @@
1
1
  {
2
- "name": "@dforge-core/dforge-mcp",
3
- "version": "0.2.28",
4
- "description": "MCP server for dForge module authoring. Exposes 34 scaffold/patch/validate/pack/install tools and schema resources so AI agents (Claude Code, Cursor, Zed) can create and ship dForge modules.",
5
- "license": "MIT",
6
- "homepage": "https://github.com/iash44/dForge-core",
7
- "packageManager": "pnpm@11.22.0+sha512.1ff870c4c6133dfd88fb2afc46dd13d47f09c9794b438c6fdb47ca98caf3bc16381ee0be93a091b8e3824cf01f889f46d7d9e20910fb0be1ab0fb5baa80dd621",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/dforge-core/dforge-mcp.git"
11
- },
12
- "bin": {
13
- "dforge-mcp": "dist/server.js",
14
- "dforge-install-skills": "scripts/install-skills.mjs"
15
- },
16
- "files": [
17
- "dist/",
18
- "docs/",
19
- "resources/",
20
- "skills/",
21
- "scripts/install-skills.mjs",
22
- "README.md",
23
- "CHANGELOG.md"
24
- ],
25
- "main": "dist/server.js",
26
- "engines": {
27
- "node": ">=18"
28
- },
29
- "scripts": {
30
- "build": "tsup",
31
- "sync-schemas": "node scripts/vendor-schemas.cjs",
32
- "prepublishOnly": "node scripts/vendor-schemas.cjs && tsup",
33
- "typecheck": "tsc --noEmit",
34
- "test": "vitest run",
35
- "install-skills": "node scripts/install-skills.mjs"
36
- },
37
- "dependencies": {
38
- "@dforge-core/dforge-cli": "^0.2.22",
39
- "@dforge-core/metadata": "^0.0.29",
40
- "@modelcontextprotocol/sdk": "^1.30.0",
41
- "zod": "^4.4.3"
42
- },
43
- "devDependencies": {
44
- "@types/node": "^26.2.0",
45
- "tsup": "^8.5.1",
46
- "typescript": "^6.0.3",
47
- "vitest": "^4.1.10"
48
- }
49
- }
2
+ "name": "@dforge-core/dforge-mcp",
3
+ "version": "0.2.30",
4
+ "description": "MCP server for dForge module authoring. Exposes 35 scaffold/patch/validate/pack/install tools and schema resources so AI agents (Claude Code, Cursor, Zed) can create and ship dForge modules.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/iash44/dForge-core",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/dforge-core/dforge-mcp.git"
10
+ },
11
+ "bin": {
12
+ "dforge-mcp": "dist/server.js",
13
+ "dforge-install-skills": "scripts/install-skills.mjs"
14
+ },
15
+ "files": [
16
+ "dist/",
17
+ "docs/",
18
+ "resources/",
19
+ "skills/",
20
+ "scripts/install-skills.mjs",
21
+ "README.md",
22
+ "CHANGELOG.md"
23
+ ],
24
+ "main": "dist/server.js",
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "dependencies": {
29
+ "@dforge-core/dforge-cli": "^0.2.23",
30
+ "@dforge-core/metadata": "^0.0.30",
31
+ "@modelcontextprotocol/sdk": "^1.30.0",
32
+ "zod": "^4.4.3"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^26.2.0",
36
+ "tsup": "^8.5.1",
37
+ "typescript": "^6.0.3",
38
+ "vitest": "^4.1.10"
39
+ },
40
+ "scripts": {
41
+ "build": "tsup",
42
+ "sync-schemas": "node scripts/vendor-schemas.cjs",
43
+ "typecheck": "tsc --noEmit",
44
+ "test": "vitest run",
45
+ "install-skills": "node scripts/install-skills.mjs"
46
+ }
47
+ }
@@ -565,10 +565,12 @@ A **domain** is a reusable, named semantic type: a base datatype, a control, siz
565
565
  - Each entry in `rights` maps entity code → rights string
566
566
  - Rights characters: `S` (Select), `I` (Insert), `U` (Update), `D` (Delete), `C` (Clone) for entities, and `E` (Execute) for actions, reports, and folder access (e.g. `"action:create_quote": "E"`). The roles JSON schema enforces `^[SIUDCE]*$`.
567
567
  - Every entity should appear in every role (even if only `"S"` for read-only)
568
+ - A role that inserts or updates an entity needs `S` on the target of each editable lookup on it — including another module's entity, keyed `module.entity` (`"parties.party": "S"`). Without it the lookup is hidden from the create and edit forms, and a required one makes the record unsaveable. `module validate` and `module pack` warn about it
568
569
 
569
570
  **Common Mistakes:**
570
571
  - ❌ `"entityRights": { ... }` → ✅ Use `"rights": { ... }`
571
572
  - ❌ Omitting entities from a role → Entity will be inaccessible to that role
573
+ - ❌ Granting only your own entities when a lookup points at a dependency's → the lookup vanishes from the form
572
574
 
573
575
  ### 6. Seed Data (`seed-data/*.json`)
574
576
 
@@ -0,0 +1,101 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://dforge.dev/schemas/diagram.schema.json",
4
+ "title": "dForge Diagram",
5
+ "description": "One named entity diagram of a dForge module: docs/diagrams/<code>.json, the file name being the diagram's code. A diagram draws a chosen subset of entities, so a large module can be read one area at a time. Design-time only: the platform installs the module without reading it.",
6
+ "type": "object",
7
+ "required": ["entities"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "label": {
13
+ "type": "string",
14
+ "description": "Diagram display name. Defaults to the diagram code."
15
+ },
16
+ "description": {
17
+ "type": "string",
18
+ "description": "What part of the model the diagram covers."
19
+ },
20
+ "entities": {
21
+ "type": "object",
22
+ "description": "Entity key → placement. A key is the entity code as the module's manifest names it, or `module.entity` for an entity of a dependency — the same form a field link's `entity` takes. A key no entity has yet is a planned entity, drawn as a name only. An empty object places the entity automatically.",
23
+ "propertyNames": {
24
+ "minLength": 1
25
+ },
26
+ "additionalProperties": {
27
+ "$ref": "#/$defs/diagramEntity"
28
+ }
29
+ },
30
+ "showBoundary": {
31
+ "type": "boolean",
32
+ "description": "Also draw the entities outside the diagram that its entities reference or are referenced by, as header-only stubs, so relations leaving the diagram stay visible. Default: true."
33
+ },
34
+ "detail": {
35
+ "type": "string",
36
+ "enum": ["conceptual", "keys", "full"],
37
+ "description": "How much of each entity to draw: `conceptual` — the name only, relations drawn entity to entity; `keys` — primary and foreign key columns; `full` — every column. Default: full."
38
+ },
39
+ "relations": {
40
+ "type": "array",
41
+ "description": "Relations drawn by hand, for entities with no foreign key between them yet — a planned entity, or one not built that far. Where a real foreign key links the same two entities, the key is drawn and the relation is not.",
42
+ "items": {
43
+ "$ref": "#/$defs/diagramRelation"
44
+ }
45
+ }
46
+ },
47
+ "additionalProperties": false,
48
+ "$defs": {
49
+ "diagramEntity": {
50
+ "type": "object",
51
+ "properties": {
52
+ "x": {
53
+ "type": "number",
54
+ "description": "Left edge of the entity node, in diagram units. Set together with `y`; both omitted means automatic placement."
55
+ },
56
+ "y": {
57
+ "type": "number",
58
+ "description": "Top edge of the entity node, in diagram units. Set together with `x`."
59
+ },
60
+ "label": {
61
+ "type": "string",
62
+ "description": "Display name of a planned entity. An existing entity shows its own label, and this is ignored."
63
+ },
64
+ "description": {
65
+ "type": "string",
66
+ "description": "What a planned entity will hold. An existing entity shows its own description, and this is ignored."
67
+ }
68
+ },
69
+ "dependencies": {
70
+ "x": ["y"],
71
+ "y": ["x"]
72
+ },
73
+ "additionalProperties": false
74
+ },
75
+ "diagramRelation": {
76
+ "type": "object",
77
+ "required": ["from", "to"],
78
+ "properties": {
79
+ "from": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "description": "Entity key of the many side — the entity that will carry the foreign key."
83
+ },
84
+ "to": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "description": "Entity key of the one side — the entity referenced."
88
+ },
89
+ "label": {
90
+ "type": "string",
91
+ "description": "Verb read from `from` to `to`, e.g. `placed by`."
92
+ },
93
+ "required": {
94
+ "type": "boolean",
95
+ "description": "Every `from` row must have a `to` row. Default: false."
96
+ }
97
+ },
98
+ "additionalProperties": false
99
+ }
100
+ }
101
+ }
@@ -36,7 +36,7 @@
36
36
  "description": "SQL SELECT statement for view-backed entities (isView=true). Executed as CREATE OR REPLACE VIEW during module install."
37
37
  },
38
38
  "toString": {
39
- "description": "Display pattern using column placeholders, e.g. \"{first_name} {last_name}\". Optional in extension entities (with `extends`). No `type` constraint here because `toString` collides with Object.prototype.toString in JSON validators — they read the inherited function and reject it, even when the property is absent from the JSON."
39
+ "description": "Display pattern using column placeholders, e.g. \"{first_name} {last_name}\" — the caption of a record wherever it is referenced. Every `{placeholder}` must name a field of the entity (trait columns included) and not a set; pack and install fail otherwise. Omitted, the install generates one from the fields and warns. Not declared on extension entities (with `extends`). No `type` constraint here because `toString` collides with Object.prototype.toString in JSON validators — they read the inherited function and reject it, even when the property is absent from the JSON."
40
40
  },
41
41
  "comments": {
42
42
  "type": "boolean",
@@ -68,7 +68,7 @@ Full descriptions are on the tools themselves — this is the map.
68
68
  | UI | `dforge_view_add`, `dforge_view_modify`, `dforge_menu_add`, `dforge_report_add` |
69
69
  | Polish | `dforge_setting_add`, `dforge_translation_sync`, `dforge_seed_add` |
70
70
  | Security | `dforge_role_add`, `dforge_role_right_set`, `dforge_folder_add` |
71
- | Cross-cutting | `dforge_dependency_add` |
71
+ | Cross-cutting | `dforge_dependency_add`, `dforge_diagram_add` |
72
72
 
73
73
  **Composite tools first.** A relation, a roll-up, and a status column each span
74
74
  several coordinated keys, and hand-assembling them from `entity_field_add` is
@@ -284,7 +284,9 @@ stated trigger; every report's params sit on a dataset.
284
284
  3. **Reflect the role list back** before computing rights. Get confirmation.
285
285
  4. **Show the rights matrix as a table** (rows = entities/actions/reports,
286
286
  columns = roles, cells = rights strings), each cell explained by the verb it
287
- maps to. Get sign-off.
287
+ maps to. Get sign-off. Include a row for every dependency entity a lookup
288
+ points at: a role that inserts or updates the lookup's entity needs
289
+ `"module.entity": "S"` on the target, or the lookup vanishes from the form.
288
290
  5. **Column-level security only when the intake asks for it.** Roles grant rights
289
291
  per entity, not per field. When a user type must not see specific *columns*
290
292
  (salaries, cost prices, personal data), that is an **entity view**: declare