@dforge-core/dforge-mcp 0.1.1 → 0.1.2
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/CHANGELOG.md +34 -0
- package/README.md +4 -2
- package/dist/server.js +353 -310
- package/docs/creating-modules.md +4 -3
- package/package.json +1 -1
- package/skills/dforge-mcp-author/SKILL.md +16 -5
- package/skills/dforge-mcp-author/references/data-views.md +5 -3
- package/skills/dforge-mcp-author/references/validation-checklist.md +7 -6
package/docs/creating-modules.md
CHANGED
|
@@ -101,9 +101,10 @@ Settings (`dforge_setting_add`), translations, seed data — only if intake decl
|
|
|
101
101
|
|
|
102
102
|
### Phase 6 — Verify (required, non-skippable)
|
|
103
103
|
|
|
104
|
-
1. `
|
|
105
|
-
2. `
|
|
106
|
-
3.
|
|
104
|
+
1. `dforge_module_validate` → offline cross-reference validation. The AI fixes every error before packing.
|
|
105
|
+
2. `dforge_module_pack` → `.dforge` tarball.
|
|
106
|
+
3. `dforge_module_install` against your tenant (uses `DFORGE_URL` / `DFORGE_TOKEN` env or arg fallbacks). Runs the full server-side validator — the only real validator.
|
|
107
|
+
4. On module-defect failure, the AI reads the returned raw CLI `output`, fixes the referenced module files, and repeats validate → pack → install. It asks the user only for environment/tooling problems such as missing CLI, expired credentials, unreachable tenant/API, permissions, or a path outside the workspace.
|
|
107
108
|
|
|
108
109
|
---
|
|
109
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dforge-core/dforge-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
@@ -45,8 +45,8 @@ The phase column below indicates the **typical** use. During a backtrack, the ba
|
|
|
45
45
|
| `dforge_role_right_set` | 5 | Grant / revoke one right on one object |
|
|
46
46
|
| `dforge_folder_add` | 5 | Security folder (optional) |
|
|
47
47
|
| `dforge_dependency_add` | any | Add a dep on another module |
|
|
48
|
-
| `dforge_module_pack` | 6 | Produce .dforge tarball
|
|
49
|
-
| `dforge_module_install` | 6 | Install to tenant — the real validator |
|
|
48
|
+
| `dforge_module_pack` | 6 | Produce .dforge tarball via bundled dforge-cli, PATH fallback, or `DFORGE_CLI_BINARY` |
|
|
49
|
+
| `dforge_module_install` | 6 | Install to tenant — the real validator; returns raw CLI output for the install-fix loop |
|
|
50
50
|
|
|
51
51
|
**Phase 0 (0a–0d) is owned by `dforge_module_plan`.** Call `dforge_module_plan({ action: "check", moduleDir })` to start or resume Phase 0. The tool returns the current state and exact next steps. Do not call `dforge_module_create` until the tool reports `readyToScaffold: true` — the tool enforces this gate programmatically.
|
|
52
52
|
|
|
@@ -128,14 +128,15 @@ Always-on cheat-sheet — enough to author inline; load the linked `references/*
|
|
|
128
128
|
If any MCP tool returns an error at any time:
|
|
129
129
|
|
|
130
130
|
1. **Surface the raw error verbatim** to the user. Do not paraphrase.
|
|
131
|
-
2. **
|
|
132
|
-
3. **Ask the user to resolve
|
|
131
|
+
2. **Classify the error before asking the user for help.** If the raw output names a module/package defect, fix the module yourself using the smallest appropriate tool or direct file edit allowed by the host agent, then re-run the required validation loop. Do not ask the user to paste the error back to you — it is already in the tool result.
|
|
132
|
+
3. **Ask the user to resolve only environment/tooling issues** you cannot fix from module files: missing CLI, missing/expired credentials, unreachable tenant/API, permissions, or a bad module path outside the workspace.
|
|
133
133
|
4. **Do not advance the phase** until the failing tool succeeds.
|
|
134
134
|
|
|
135
135
|
Two specific tool errors have known causes worth distinguishing:
|
|
136
136
|
|
|
137
137
|
- **`dforge_module_pack` / `_install` reports "command not found" or PATH error**: dforge-cli isn't installed. Tell the user: "dforge-cli is not on your PATH. Install with `npm install -g @dforge-core/dforge-cli`, then re-run. Do not continue Phase 6 until resolved."
|
|
138
138
|
- **`dforge_module_install` reports HTTP 401/403 or connection refused**: this is auth/connectivity, NOT a module defect. Tell the user: "This appears to be a credentials or connectivity issue, not a module defect. Verify `DFORGE_URL` and `DFORGE_TOKEN` before re-running install." Do not backtrack to earlier phases.
|
|
139
|
+
- **`dforge_module_install` returns `ok: false` with validation/import/compile/schema output**: this is a module defect. Treat `output` as the source of truth, fix the referenced files, and run Phase 6 again from automated validation. Keep repeating until install succeeds or the remaining error is clearly environment/tooling.
|
|
139
140
|
|
|
140
141
|
## Resume-from-partial-state
|
|
141
142
|
|
|
@@ -416,7 +417,15 @@ Get user confirmation on both version strings before packing.
|
|
|
416
417
|
1. `dforge_module_pack` → produces `.dforge` tarball. (Blocked if any entity lacks a role granting Select — the Phase 5a gate; fix security coverage and re-run.)
|
|
417
418
|
2. `dforge_module_install` with `DFORGE_URL` / `DFORGE_TOKEN`. Runs the full server-side validator.
|
|
418
419
|
|
|
419
|
-
**
|
|
420
|
+
**Install-fix loop (mandatory):**
|
|
421
|
+
|
|
422
|
+
1. Call `dforge_module_install` yourself. Do not ask the user to run the install command for you.
|
|
423
|
+
2. If the result has `ok: false`, read the returned `output` in full. It is the raw CLI/server validator output and is the input for the next fix.
|
|
424
|
+
3. If the failure is a module defect, fix it yourself. Use this table to identify which phase to backtrack to, then apply the backtrack protocol with the smallest suitable tool or file edit.
|
|
425
|
+
4. Re-run Step 1 (`dforge_module_validate`), Step 2 (self-review for the touched area), Step 5 pack, and Step 5 install.
|
|
426
|
+
5. Repeat this loop until install succeeds or the remaining failure is clearly an environment/tooling issue from the Tool failure protocol.
|
|
427
|
+
|
|
428
|
+
Common module-defect patterns:
|
|
420
429
|
|
|
421
430
|
| Install error pattern | Backtrack to |
|
|
422
431
|
|---|---|
|
|
@@ -438,6 +447,8 @@ When a later phase exposes a problem in an earlier phase, follow steps 1–6 IN
|
|
|
438
447
|
|
|
439
448
|
**Multi-trigger rule (deterministic):** If multiple phases simultaneously expose gaps in earlier phases (e.g. Phase 3 needs a field; Phase 5 needs an action), resolve the **earliest-phase gap first**, complete its full backtrack, run `dforge_module_inspect`, then evaluate remaining gaps.
|
|
440
449
|
|
|
450
|
+
**Phase 6 install exception:** when `dforge_module_install` fails with a clear module defect (schema validation, missing file/key, translation completeness, DSL compile error, dependency contract, FK/seed/import error), do not ask the user for sign-off before the corrective patch. The server validator has already rejected the package, so fix the referenced files, report what changed, and immediately re-run validate → pack → install. Keep user sign-off for product/design choices or ambiguous fixes.
|
|
451
|
+
|
|
441
452
|
1. **Stop the current phase.** Don't paper over or improvise.
|
|
442
453
|
2. **Name the issue precisely.** "Phase 3 wants a kanban grouped by `lead_status`, but Phase 1 didn't define `lead_status` on entity `lead`."
|
|
443
454
|
3. **Identify the target phase + decision.** "Backtrack to Phase 1: add field `lead_status` to entity `lead`."
|
|
@@ -161,9 +161,11 @@ A pivot grid. The view's primary `dataSources` entity is the **cell** entity (on
|
|
|
161
161
|
|
|
162
162
|
**`rowAxis` / `colAxis`** — what the rows and columns are. Three `kind`s:
|
|
163
163
|
|
|
164
|
-
- `"dataset"` — axis values are an entity's records. `entity` + `labelField` required; optional `keyField` (defaults to the axis entity PK — what the cell's `rowKey`/`colKey` matches), `lockedField` (boolean column → that axis value's cells are read-only), `filter` (same `{c,o,v}` grammar as everywhere — scopes which axis records load), `hideEmpty` (**column axis only** — drop columns with no cell record in any row, e.g. periods with no postings; ignored if it would blank the whole grid), `sort` (`[{ col, dir }]`).
|
|
165
|
-
- `"dropdown"` — axis values are a dropdown/flags column's options.
|
|
166
|
-
- `"date"` — generated date window, **column axis only** (not valid on `rowAxis`). `kind` + `grain: "day"` + `window: "week"` (v1).
|
|
164
|
+
- `"dataset"` — axis values are an entity's records. `entity` + `labelField` required; optional `keyField` (defaults to the axis entity PK — what the cell's `rowKey`/`colKey` matches), `lockedField` (boolean column → that axis value's cells are read-only), `filter` (same `{c,o,v}` grammar as everywhere — scopes which axis records load), `hideEmpty` (**column axis only** — drop columns with no cell record in any row, e.g. periods with no postings; ignored if it would blank the whole grid), `rangeControl` (**column axis only** — show a From/To range control so the user can narrow the visible columns to a span; persists in view options; composes with `hideEmpty`), `sort` (`[{ col, dir }]`).
|
|
165
|
+
- `"dropdown"` — axis values are a dropdown/flags column's options. `kind` + `column` (an `"entity.column"` reference); optional `values` (`[...]` of option value codes — a subset + order of columns, chosen the way kanban lanes are; omit to show every option in field order). Codes line up by construction.
|
|
166
|
+
- `"date"` — generated date window, **column axis only** (not valid on `rowAxis`). `kind` + `grain: "day"` + `window: "week"` (v1). *Roadmap (designed, not built): arbitrary `range` (`{from, to}`) + `grain` (`day`/`week`/`month`/`quarter`/`year`), surfaced as a date-picker variant of the range bar — lets a time matrix generate its columns instead of needing seeded period records. Don't author against it yet.*
|
|
167
|
+
|
|
168
|
+
> **The matrix is source-agnostic.** A matrix is just config over generic entities: point the cell at *any* dated/keyed entity that fits your model — a pre-aggregated registry (e.g. `gl.balance_register`, fast but period-grained), raw dated movements (any-grain, heavier), or your own table. `gl` is a regular, replaceable module, not a platform requirement; nothing about the matrix knows or needs "gl". Choosing a pre-aggregated source vs raw rows (and the grain) is a per-view config decision, with the usual perf-vs-flexibility trade.
|
|
167
169
|
|
|
168
170
|
**`cell`** — the value-source record at each intersection. `entity` (must match the primary dataSource), `rowKey` / `colKey` (cell columns matching the row/column axis keys), `fields` (cell columns rendered in each cell). Optional: `cardinality: "one"` (v1 default), `editable`, `drill` (read-only cells become clickable → open the cell record and its child sets), `seedFromRow` (`{ cellField: rowAxisField }` copied into new cell records on insert), `seedCurrentUser` (cell fields set to the current user id on insert).
|
|
169
171
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Validation Checklist
|
|
2
2
|
|
|
3
|
-
Run through this checklist **before** declaring a module complete.
|
|
3
|
+
Run through this checklist **before** declaring a module complete. Always start with `dforge_module_validate` when the MCP server is connected; if you are outside MCP, use the current CLI equivalent: `dforge-cli module validate <moduleDir>`.
|
|
4
4
|
|
|
5
5
|
## Top install-blockers (scan first)
|
|
6
6
|
|
|
@@ -154,10 +154,11 @@ For each action:
|
|
|
154
154
|
|
|
155
155
|
## After validation
|
|
156
156
|
|
|
157
|
-
- [ ]
|
|
158
|
-
- [ ]
|
|
159
|
-
- [ ]
|
|
160
|
-
- [ ]
|
|
157
|
+
- [ ] Run `dforge_module_validate` and fix every `error` in `files["_validate.json"]`
|
|
158
|
+
- [ ] Run `dforge_module_pack` to build the `.dforge` file — it should succeed
|
|
159
|
+
- [ ] Run `dforge_module_install` against a real test tenant — this is the full server-side validator
|
|
160
|
+
- [ ] If `dforge_module_install` returns `ok: false`, read the returned `output`, fix the module defect it reports, then repeat validate → pack → install
|
|
161
|
+
- [ ] Stop and ask the user only for environment/tooling failures: missing CLI, missing/expired token, unreachable tenant/API, permissions, or a path outside the workspace
|
|
161
162
|
|
|
162
163
|
## Red flags during review
|
|
163
164
|
|
|
@@ -180,4 +181,4 @@ If you see any of these, stop and investigate:
|
|
|
180
181
|
|
|
181
182
|
## When the checklist passes
|
|
182
183
|
|
|
183
|
-
Tell the user what you built, summarize the entity model (e.g. "7 entities: contact, account, opportunity with its line items, quote with lines, activity, product"), list the data views and actions,
|
|
184
|
+
Tell the user what you built, summarize the entity model (e.g. "7 entities: contact, account, opportunity with its line items, quote with lines, activity, product"), list the data views and actions, describe the security roles, and run the Phase 6 install loop. The module is not complete until `dforge_module_install` succeeds against a real tenant.
|