@dforge-core/dforge-mcp 0.2.44 → 0.2.45

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +1 -1
  3. package/dist/server.js +109 -84
  4. package/package.json +3 -3
  5. package/resources/docs/conventions.md +17 -14
  6. package/resources/docs/dsl-reference.md +15 -5
  7. package/resources/schemas/entity.schema.json +1 -1
  8. package/resources/schemas/registers.schema.json +8 -3
  9. package/skills/dforge-mcp-author/SKILL.md +3 -2
  10. package/skills/dforge-mcp-author/examples/column-security/entities/product.json +1 -1
  11. package/skills/dforge-mcp-author/examples/column-security/manifest.json +0 -1
  12. package/skills/dforge-mcp-author/examples/column-security/security/roles.json +2 -2
  13. package/skills/dforge-mcp-author/references/action-dsl.md +20 -7
  14. package/skills/dforge-mcp-author/references/conventions.md +7 -1
  15. package/skills/dforge-mcp-author/references/field-types.md +3 -2
  16. package/skills/dforge-mcp-author/references/formulas.md +5 -1
  17. package/skills/dforge-mcp-author/references/print-templates.md +5 -2
  18. package/skills/dforge-mcp-author/references/queries.md +1 -1
  19. package/skills/dforge-mcp-author/references/registers.md +18 -3
  20. package/skills/dforge-mcp-author/references/reports.md +4 -1
  21. package/skills/dforge-mcp-author/references/schema-import.md +1 -1
  22. package/skills/dforge-mcp-author/references/security.md +1 -1
  23. package/skills/dforge-mcp-author/references/translations.md +38 -15
  24. package/skills/dforge-mcp-author/references/validation-checklist.md +2 -3
  25. package/skills/dforge-module-build/SKILL.md +10 -1
  26. package/skills/dforge-module-ship/SKILL.md +31 -3
  27. package/skills/dforge-mcp-author/examples/column-security/translations/en-US.json +0 -35
@@ -162,8 +162,8 @@ For each action:
162
162
 
163
163
  ## Translations
164
164
 
165
- - [ ] `translations/en-US.json` exists
166
- - [ ] Has `entities` section with `label`, `desc`, and `fields` for every entity
165
+ - [ ] **No** `translations/en.json` / `en-*.json` — install skips them. English is each definition's own short label (entity/field/role/setting `description`, view/menu/action/report `label`)
166
+ - [ ] Each `translations/<locale>.json` (one per `supportedLocales` entry) has an `entities` section with `label`, `desc`, and `fields` for every entity
167
167
  - [ ] Every field (including trait-provided: `created_date`, `last_updated`, etc.) has a `label`
168
168
  - [ ] Has `views` section with labels for every data view
169
169
  - [ ] Has `menus` section matching the `ui/menus.json` structure
@@ -172,7 +172,6 @@ For each action:
172
172
  - [ ] (Optional) Constraint messages localized under `entities.<e>.constraints.<c>.message` — opt-in; a missing override for a declared `supportedLocales` entry warns (surfaced by `dforge_module_validate` and at install) but does not fail install
173
173
  - [ ] Has `settings` section with labels for every setting (if settings exist)
174
174
  - [ ] Has `folders` section with label for the root folder
175
- - [ ] Additional language files (if any) have the same structure as `en-US.json`
176
175
  - [ ] Manifest `supportedLocales` lists every non-English locale that has a `translations/<locale>.json` file (English is not listed)
177
176
 
178
177
  ## Versioning
@@ -36,12 +36,15 @@ flags, or column patterns.
36
36
  | Suggest a value when another field is edited (a reaction), incl. from a bridge module | `dforge://reference/reactions` | `dforge://schema/entity`, `dforge://schema/deps` |
37
37
  | Add a trait | `dforge://reference/traits` | — |
38
38
  | Add a number sequence | `dforge://reference/number-sequences` | — |
39
+ | Add an accumulation register (`A` column, `registers.json`) | `dforge://reference/registers` | `dforge://schema/registers` |
40
+ | Edit the manifest (version, `supportedLocales`, dependencies, `entities` map) | `dforge://reference/manifest` | `dforge://schema/manifest` |
39
41
  | Add a grid / list view | `dforge://reference/data-views`, `dforge://example/ui/data_views.json` | — |
40
42
  | Add a matrix (pivot) view | `dforge://reference/data-views` (§Matrix), `dforge://example/matrix-budget/ui/data_views.json`, `dforge://example/matrix-budget/entities/budget_line.json` | — |
41
43
  | Add kanban / calendar / tree-grid / master-detail | `dforge://reference/data-views` | `dforge://schema/data-views` |
42
44
  | Hide columns from a user type (column-level security) | `dforge://reference/security` (§Column-level security), `dforge://example/column-security/entities/product.json`, `dforge://example/column-security/ui/folders.json` | — |
43
45
  | Add a menu | `dforge://reference/menus`, `dforge://example/ui/menus.json` | — |
44
46
  | Add an action | `dforge://reference/action-dsl`, `dforge://example/logic/actions/mark_done.dsl`, `dforge://example/ui/actions.json` | `dforge://docs/dsl` |
47
+ | Email a file the script builds, or ship saved values / a PDF preview for an action's dialog | `dforge://reference/action-dsl` (§Email and §PDF and file output: `sendEmail` attachments, `attachText`, `attachBase64`; §Registering the action: `paramSets`, `previewTemplate`) | `dforge://docs/dsl` |
45
48
  | Share helpers between actions, or call another module's functions | `dforge://reference/action-dsl` (§Function libraries): `logic/functions/*.dsl`, imports in `deps/<module>.json` | `dforge://schema/deps` |
46
49
  | Add a trigger | — | `dforge://schema/triggers`; condition syntax in `dforge://docs/dsl` |
47
50
  | Add a scheduled job | `dforge://reference/jobs` | `dforge://schema/jobs` |
@@ -115,6 +118,10 @@ Enough to author inline; load the linked reference for the full detail.
115
118
  - **Manifest:** non-English locales go in `supportedLocales` (`ll-CC`, never
116
119
  `en`/`en-US`); there is no `translations` manifest key. `security` has both
117
120
  `roles` and `folders`. → `manifest`
121
+ - **English is the definitions' text:** install skips `translations/en*.json`, so
122
+ never create one. Give every entity, field, role and setting a short
123
+ `description` and every view, menu, action and report a short `label` — that
124
+ is what the English UI shows. → `translations`
118
125
  - **Seed data:** explicit numeric PKs under `{entity}_id`; parents before
119
126
  children via the `NN-` prefix. Use `dforge_seed_add`.
120
127
 
@@ -160,6 +167,7 @@ approval, then patch. Reach for the **composite tools first**:
160
167
  - roll-up total → `dforge_entity_rollup_add`
161
168
  - status column → `dforge_entity_status_add`
162
169
  - plain scalar → `dforge_entity_field_add`
170
+ - change an existing field (label, flags, type, …) → `dforge_entity_field_modify`
163
171
 
164
172
  **Field batching rule** — the only Phase 1 exception to one-at-a-time. A field
165
173
  is batchable only if ALL of: scalar primitive (string/integer/decimal/boolean/
@@ -285,7 +293,8 @@ stated trigger; every report's params sit on a dataset.
285
293
  ## Phase 4 — Polish (mostly optional)
286
294
 
287
295
  - **Settings** — `dforge_setting_add` per configurable value the user asked for.
288
- - **Translations** — run **`dforge_translation_sync`**. It generates every
296
+ - **Translations** — only for the locales in `supportedLocales`; English needs
297
+ no file. Run **`dforge_translation_sync`**. It generates every
289
298
  required key from the module's own contents, never overwrites existing
290
299
  translated text, and fills the **role labels that are completeness-enforced at
291
300
  install**. Run it after any entity/view/role change, and always before Phase 6.
@@ -78,9 +78,9 @@ formula column shape; flags letters (`V I E M H` only); every entity has a
78
78
  default grid and `dataSources` at root with `"order"` as a string array; menu
79
79
  leaves use `dataViewCode` and bare icon names; every entity in at least one
80
80
  role's rights; action `script` values are bare filenames; seed PKs numeric with
81
- parents first; a `translations/<locale>.json` for every `supportedLocales` entry
82
- **plus** the `en-US` base, each carrying a label for every trait-provided field
83
- and every role.
81
+ parents first; a `translations/<locale>.json` for every `supportedLocales` entry,
82
+ each carrying a label for every trait-provided field and every role. No English
83
+ file — install skips `en*.json`; English is the definitions' own short labels.
84
84
 
85
85
  If translations are thin, run **`dforge_translation_sync`** now rather than
86
86
  hand-patching — it fills exactly the keys install requires.
@@ -156,6 +156,34 @@ package — fix the referenced files, report what changed, and immediately re-ru
156
156
  validate → pack → install. Keep sign-off for product/design choices or genuinely
157
157
  ambiguous fixes.
158
158
 
159
+ **If install hangs, or fails with a bare HTTP 500 or 400 "deadlock":** look for
160
+ a lock before touching the module. An install's `ALTER TABLE` waits behind any
161
+ open transaction on the module's tables — an idle `psql` session, an ad hoc
162
+ read left open, a script that never commits — and waits without a message,
163
+ for an hour or more. Check `pg_stat_activity` for a blocked `ALTER` and the
164
+ session holding it. Never install while scripts hold transactions on the
165
+ module's tables; run ad hoc scripts in autocommit.
166
+
167
+ **If install times out on the client while rebuilding a register cache:** the
168
+ server goes on and finishes (an analytic cache over 1.5 million postings took
169
+ about 18 minutes). Check the server log or the cache before installing again.
170
+
171
+ **Same version installed "successfully" but nothing changed:** a re-install of
172
+ the same `version` is skipped (`isEmpty: true`). Bump the version, or pass
173
+ `--force` on a dev tenant.
174
+
175
+ **Local dev stack pitfalls:**
176
+ - After installing into a local docker setup, restart `dforge-api` if the UI
177
+ still shows the old metadata; its cache can stay stale.
178
+ - The tenant URL is `http://<tenant>._.localhost:5179`. `<tenant>.localhost`
179
+ and `<tenant>_.localhost` sign into **another** tenant.
180
+ - "no token for tenant X": the CLI session expired (a token lasts about an
181
+ hour). Run `dforge-cli auth login --url <tenant url>`.
182
+ - "tenant at db_schema_version … is ahead of this binary" after rebuilding the
183
+ platform: install through the server with `--url`.
184
+ - Don't keep scaffold copies of a module (same `code`, another `moduleId`)
185
+ anywhere a folder publish can pick them up.
186
+
159
187
  **If install fails on auth (401/403) or connectivity (refused):** that is
160
188
  credentials/connectivity, NOT a module defect. Tell the user to verify
161
189
  `DFORGE_URL` and `DFORGE_TOKEN`. **Do not backtrack** to earlier phases.
@@ -1,35 +0,0 @@
1
- {
2
- "entities": {
3
- "product": {
4
- "label": "Product",
5
- "fields": {
6
- "name": { "label": "Product Name" },
7
- "sku": { "label": "SKU" },
8
- "quantity": { "label": "Quantity On Hand" },
9
- "cost_price": { "label": "Cost Price" },
10
- "sale_price": { "label": "Sale Price" },
11
- "margin": { "label": "Margin" }
12
- }
13
- }
14
- },
15
- "folders": {
16
- "warehouse": { "label": "Warehouse" },
17
- "finance": { "label": "Finance" }
18
- },
19
- "roles": {
20
- "column_security.storekeeper": { "label": "Storekeeper" },
21
- "column_security.accountant": { "label": "Accountant" }
22
- },
23
- "views": {
24
- "product_grid": { "label": "Products" }
25
- },
26
- "menus": {
27
- "product_menu": {
28
- "label": "Products",
29
- "items": {
30
- "catalog": { "label": "Catalog" },
31
- "all_products": { "label": "Products" }
32
- }
33
- }
34
- }
35
- }