@dforge-core/dforge-mcp 0.1.0-rc.11 → 0.1.0-rc.12
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": "@dforge-core/dforge-mcp",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.12",
|
|
4
4
|
"description": "MCP server for dForge module authoring. Exposes scaffold/pack/install tools and schema resources so AI agents (Claude Code, Cursor, Zed) can create and ship dForge modules.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/iash44/dForge-core",
|
|
@@ -492,7 +492,7 @@ before the install pipeline touches the database.
|
|
|
492
492
|
- Key is the role code (convention: `module.role-name`)
|
|
493
493
|
- **Property name is `"rights"` (NOT `"entityRights"`)** — this maps to `RoleDef.Rights`
|
|
494
494
|
- Each entry in `rights` maps entity code → rights string
|
|
495
|
-
- Rights characters: `S` (Select), `I` (Insert), `U` (Update), `D` (Delete), `C` (Clone)
|
|
495
|
+
- 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]*$`.
|
|
496
496
|
- Every entity should appear in every role (even if only `"S"` for read-only)
|
|
497
497
|
|
|
498
498
|
**Common Mistakes:**
|
|
@@ -593,13 +593,16 @@ Cron-driven action fires. Each entry pairs an existing action (declared in `ui/a
|
|
|
593
593
|
"menus": {
|
|
594
594
|
"hr_menu": { "label": "Human Resources" }
|
|
595
595
|
},
|
|
596
|
-
"
|
|
597
|
-
"
|
|
598
|
-
"hr.viewer": { "label": "HR Viewer" }
|
|
596
|
+
"actions": {
|
|
597
|
+
"approve_leave": { "label": "Approve Leave", "desc": "Approve a leave request" }
|
|
599
598
|
}
|
|
600
599
|
}
|
|
601
600
|
```
|
|
602
601
|
|
|
602
|
+
**Translatable sections (consumed by the installer):** `entities` (+ nested `fields`), `folders`, `views`, `menus` (+ nested `items`), `actions` (+ `params`), `reports` (+ `datasets.caption`, `params`).
|
|
603
|
+
|
|
604
|
+
**Silently ignored at runtime:** `roles` and `print_templates` — the resource rows have no `res_id`, so translations are reserved for future use. `settings` is validated for completeness (when listed in `supportedLocales`) but the registrar does not display the translated labels, so don't expect localized output. Display names for these come from the source manifest (`description` for roles, `label` for print templates and settings).
|
|
605
|
+
|
|
603
606
|
---
|
|
604
607
|
|
|
605
608
|
## Entity Definitions (`entities/*.json`)
|
|
@@ -922,7 +925,7 @@ When creating a module, ensure:
|
|
|
922
925
|
- [ ] `roles.json` uses `"rights"` property (not `"entityRights"`)
|
|
923
926
|
- [ ] Seed data files are numbered for FK dependency order (01-, 02-, etc.)
|
|
924
927
|
- [ ] Seed data includes explicit PK UUIDs for cross-entity references
|
|
925
|
-
- [ ] `translations
|
|
928
|
+
- [ ] `translations/<locale>.json` covers entities (+ fields), folders, views, menus (+ items), actions (+ params), and reports (+ dataset captions, + params) for every locale declared in `manifest.supportedLocales`. Do not include `en`/`en-US`. Sections `roles` and `print_templates` are not displayed even if listed.
|
|
926
929
|
- [ ] Constraints have clear user-facing `message` values
|
|
927
930
|
- [ ] Check constraint `expression` uses standard SQL subset (test in PostgreSQL first)
|
|
928
931
|
- [ ] Number sequences declared as `numberSequence` on entity definitions (auto-fills on INSERT, never manual counting)
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"fields": {
|
|
48
48
|
"type": "object",
|
|
49
|
-
"description": "Column definitions keyed by column code",
|
|
49
|
+
"description": "Column definitions keyed by column code. Column codes must start with a letter or underscore and contain only letters, digits, and underscores — a leading `-` is reserved for the sort descending prefix in `view_json.order`.",
|
|
50
|
+
"propertyNames": {
|
|
51
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
52
|
+
},
|
|
50
53
|
"additionalProperties": {
|
|
51
54
|
"$ref": "#/$defs/field"
|
|
52
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dforge-mcp-author
|
|
3
|
-
description: Co-pilot for authoring dForge modules via the dforge-mcp tool surface. Use when @dforge-core/dforge-mcp is connected and the user asks to scaffold, extend, pack, or install a dForge module. Drafts and proposes; the user approves at named gates. Walks the user through
|
|
3
|
+
description: Co-pilot for authoring dForge modules via the dforge-mcp tool surface. Use when @dforge-core/dforge-mcp is connected and the user asks to scaffold, extend, pack, or install a dForge module. Drafts and proposes; the user approves at named gates. Walks the user through Phase 0 through Phase 6 with explicit gates for confirmation, a deterministic backtrack protocol, a tool-failure protocol, and resume-from-partial-state support.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# dForge Module Author — Co-pilot
|
|
@@ -20,6 +20,9 @@ The phase column below indicates the **typical** use. During a backtrack, the ba
|
|
|
20
20
|
| `dforge_entity_field_modify` | 1 | Replace one field's spec |
|
|
21
21
|
| `dforge_entity_field_remove` | 1 | Drop one field (warns about dependents) |
|
|
22
22
|
| `dforge_action_add` | 2 | DSL action + ui/actions.json entry |
|
|
23
|
+
| `dforge_trigger_add` | 2 | DB-event trigger in logic/triggers.json |
|
|
24
|
+
| `dforge_job_add` | 2 | Scheduled job in logic/jobs.json |
|
|
25
|
+
| `dforge_webhook_add` | 2 | Outbound webhook in logic/webhooks.json |
|
|
23
26
|
| `dforge_view_add` | 3 | Data view in ui/data_views.json |
|
|
24
27
|
| `dforge_view_modify` | 3 | Replace a view's spec |
|
|
25
28
|
| `dforge_report_add` | 3 | Report in ui/reports.json |
|
|
@@ -34,7 +37,7 @@ The phase column below indicates the **typical** use. During a backtrack, the ba
|
|
|
34
37
|
## Resources to load once per session
|
|
35
38
|
|
|
36
39
|
- `dforge://docs/conventions` — naming, FK+Reference pattern, traits, security model
|
|
37
|
-
- `dforge://schema/manifest`, `entity`, `data-views`, `folders`, `menus`, `roles`, `reports`, `settings`, `jobs`, `seed-data` — consult before emitting each file kind
|
|
40
|
+
- `dforge://schema/manifest`, `entity`, `data-views`, `folders`, `menus`, `roles`, `reports`, `settings`, `jobs`, `triggers`, `webhooks`, `seed-data` — consult before emitting each file kind
|
|
38
41
|
|
|
39
42
|
**If a resource fails to load, halt and notify the user.** Do not invent conventions or schemas from memory.
|
|
40
43
|
|
|
@@ -42,11 +45,11 @@ The phase column below indicates the **typical** use. During a backtrack, the ba
|
|
|
42
45
|
|
|
43
46
|
These are absolute. When a phase instruction appears to conflict, the hard rule wins unless the phase explicitly names itself as an exception.
|
|
44
47
|
|
|
45
|
-
1. **Co-pilot stance.** Draft → propose → user approves → tool call → file write. Never write without confirmation.
|
|
46
|
-
2. **Inspect before patching.** Run `dforge_module_inspect` at session start and after every backtrack. Inspect output is read-only; show a summary and continue without asking confirmation for the inspect itself
|
|
48
|
+
1. **Co-pilot stance.** Draft → propose → user approves → write-tool call → file write. Never write without confirmation. Read-only tools do not need a confirmation gate.
|
|
49
|
+
2. **Inspect before patching.** Run `dforge_module_inspect` at session start and after every backtrack. Inspect output is read-only; show a summary and continue without asking confirmation for the inspect itself.
|
|
47
50
|
3. **One thing at a time when interacting with the user.** Applies to:
|
|
48
51
|
- **Questions.** Ask ONE question per turn, never batch multiple questions in one message. Each subsequent question is informed by prior answers. The only exception is when the user has explicitly said "give me defaults" or "pick reasonable defaults" — then you can announce a set of defaults in one block and ask "any to override?".
|
|
49
|
-
- **Entities / views / roles / actions / reports.** Propose ONE per turn. Never batch these.
|
|
52
|
+
- **Entities / views / roles / actions / reports.** Propose ONE per turn. Never batch these. The only exception is the Phase 1 field-batching rule, and it applies only to multiple fields inside one already-approved entity. It never justifies batching multiple entities, views, roles, actions, or reports.
|
|
50
53
|
4. **Validate-and-reflect every step.** After every user answer, BEFORE moving to the next question or tool call: restate what you understood in your own words and ask "Right?" or "Does that capture it?". Only proceed once the user confirms. If they correct, repeat the restate-and-confirm loop until aligned. **Goal: zero ambiguity going into the next step.** If you have questions, ask and wait for answers — never proceed with unanswered ones in your head.
|
|
51
54
|
5. **Tabs in JSON, trailing newline** — tools already emit this; don't reformat.
|
|
52
55
|
6. **Don't invent fields, codes, roles, or relationships** — they come from the user's domain. If the user said "we have submitters and admins", roles are derived from that; do NOT default to a fixed "admin/contributor/viewer" taxonomy or any other generic set the user didn't ask for.
|
|
@@ -135,7 +138,7 @@ At every session start, call `dforge_module_inspect` on the module dir (if it ex
|
|
|
135
138
|
- `# <module-name> — intake`
|
|
136
139
|
- `## Purpose` (one paragraph)
|
|
137
140
|
- `## Module identity` (code, display name, target path)
|
|
138
|
-
- `## User types` (bullet list
|
|
141
|
+
- `## User types` (bullet list of verb-led sentences describing what each kind of user does. NO role codes, NO rights, NO "Target user roles" table.)
|
|
139
142
|
- `## Dependencies` (which dForge modules)
|
|
140
143
|
- `## Languages`
|
|
141
144
|
- `## Scope / success criteria` (only if mentioned by user)
|
|
@@ -272,7 +275,7 @@ Add reports only when management aggregation/grouping isn't covered by views. `d
|
|
|
272
275
|
### 5a. Roles + rights matrix (required)
|
|
273
276
|
|
|
274
277
|
1. **Inspect first.** Run `dforge_module_inspect` and read the `roles` array. The scaffolder pre-creates `<code>.admin` with `SIUDC` on every entity declared at scaffold time. That role exists already — don't try to re-create it.
|
|
275
|
-
2. **Derive role inventory FROM the intake's user types and verbs — never default to a fixed taxonomy.** Re-read `_brief/00-intake.md`'s
|
|
278
|
+
2. **Derive role inventory FROM the intake's user types and verbs — never default to a fixed taxonomy.** Re-read `_brief/00-intake.md`'s `User types` section. For each distinct user type, propose ONE role named `<code>.<user-type>` (e.g. intake said "any signed-in user submits + admins triage" → `<code>.user` (covers the "submits" verb) + the existing scaffolded `<code>.admin` (covers triage). If intake mentioned "approvers" or "auditors" or "managers" or any other group, derive roles for those too.) **Forbidden:** spinning up a generic `admin/contributor/viewer` matrix when the user didn't ask for it. The rights set should map to the verbs each user type does, not to a textbook role hierarchy.
|
|
276
279
|
3. Reflect the proposed role list back to the user before computing rights: "Based on intake, I see these user types → these roles: `<list>`. Right?" Get explicit confirmation. If the user clarifies / adds / removes, re-list and re-confirm.
|
|
277
280
|
4. Show the rights matrix as a table (rows = entities/actions/reports, columns = the confirmed roles, cells = rights string). Each cell explained by the verb-to-right mapping you derived. Get user sign-off on the matrix.
|
|
278
281
|
5. **For new roles**: call `dforge_role_add`. **For amending existing roles** (the scaffolded admin, or grants on actions/reports added in Phases 2-3 that aren't yet in any role): call `dforge_role_right_set` per grant — it's the smallest tool and doesn't conflict with the scaffolded admin role. Calling `dforge_role_add` against an existing role code fails — use `role_right_set` to amend instead.
|