@dforge-core/dforge-mcp 0.1.0-rc.1 → 0.1.0-rc.3

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.
@@ -0,0 +1,99 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://dforge.dev/schemas/traits.schema.json",
4
+ "title": "dForge Trait Definitions",
5
+ "description": "Defines entity traits that expand into fields, references, and constraints during module install. Shipped as traits.json at module root.",
6
+ "type": "object",
7
+ "additionalProperties": {
8
+ "$ref": "#/$defs/traitDefinition"
9
+ },
10
+ "$defs": {
11
+ "traitDefinition": {
12
+ "type": "object",
13
+ "description": "A single trait definition",
14
+ "properties": {
15
+ "description": {
16
+ "type": "string",
17
+ "description": "Human-readable description of the trait"
18
+ },
19
+ "includes": {
20
+ "type": "array",
21
+ "items": { "type": "string" },
22
+ "description": "Other trait names to include (inherit fields from). Expanded recursively with circular reference protection."
23
+ },
24
+ "fields": {
25
+ "type": "object",
26
+ "description": "Field definitions to add to entities using this trait. Keys support {entity}/{Entity} placeholders for parametric names.",
27
+ "additionalProperties": {
28
+ "$ref": "#/$defs/traitField"
29
+ }
30
+ },
31
+ "references": {
32
+ "type": "object",
33
+ "description": "FK reference definitions to add. Keys support {Entity} placeholder.",
34
+ "additionalProperties": {
35
+ "$ref": "#/$defs/traitReference"
36
+ }
37
+ },
38
+ "constraints": {
39
+ "type": "object",
40
+ "description": "Constraint definitions to add. Keys support {Entity} placeholder (e.g. 'UQ_{Entity}_period_key')."
41
+ }
42
+ },
43
+ "additionalProperties": false
44
+ },
45
+ "traitField": {
46
+ "type": "object",
47
+ "description": "Field definition within a trait. Same shape as entity field definitions.",
48
+ "properties": {
49
+ "dbDatatype": { "type": "string" },
50
+ "columnType": { "type": "string" },
51
+ "fieldTypeCd": { "type": "string" },
52
+ "flags": { "type": "string" },
53
+ "isPk": { "type": "boolean" },
54
+ "isIdentity": { "type": "boolean" },
55
+ "isNullable": { "type": "boolean" },
56
+ "formula": { "type": "string" },
57
+ "orderNum": { "type": "integer" },
58
+ "description": { "type": "string", "description": "Supports {entity}/{Entity} placeholders" },
59
+ "maxLen": { "type": "integer" },
60
+ "link": {
61
+ "type": "object",
62
+ "properties": {
63
+ "entity": { "type": "string" },
64
+ "thisKey": { "type": "string" },
65
+ "otherKey": { "type": "string" }
66
+ },
67
+ "required": ["entity", "thisKey", "otherKey"],
68
+ "additionalProperties": false
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "traitReference": {
74
+ "type": "object",
75
+ "description": "FK reference definition within a trait",
76
+ "required": ["from", "to"],
77
+ "properties": {
78
+ "from": {
79
+ "type": "object",
80
+ "required": ["field"],
81
+ "properties": {
82
+ "field": { "type": "string" }
83
+ },
84
+ "additionalProperties": false
85
+ },
86
+ "to": {
87
+ "type": "object",
88
+ "required": ["entity", "field"],
89
+ "properties": {
90
+ "entity": { "type": "string" },
91
+ "field": { "type": "string" }
92
+ },
93
+ "additionalProperties": false
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "dForge Module Webhooks",
4
+ "description": "Webhook subscription definitions for a dForge module package (webhooks.json)",
5
+ "type": "object",
6
+ "required": ["subscriptions"],
7
+ "properties": {
8
+ "subscriptions": {
9
+ "type": "array",
10
+ "items": {
11
+ "type": "object",
12
+ "required": ["code", "description", "entity", "event"],
13
+ "properties": {
14
+ "code": {
15
+ "type": "string",
16
+ "maxLength": 100,
17
+ "pattern": "^[a-z][a-z0-9_]*$",
18
+ "description": "Unique identifier within the module"
19
+ },
20
+ "description": {
21
+ "type": "string",
22
+ "description": "Human-readable description"
23
+ },
24
+ "entity": {
25
+ "type": "string",
26
+ "description": "Entity code that triggers this webhook"
27
+ },
28
+ "event": {
29
+ "type": "string",
30
+ "enum": ["insert", "update", "delete", "status_change", "any"],
31
+ "description": "Event type that fires this webhook"
32
+ },
33
+ "condition": {
34
+ "type": "string",
35
+ "description": "Formula evaluated against the record. Webhook fires only if true."
36
+ },
37
+ "endpointUrl": {
38
+ "type": "string",
39
+ "format": "uri",
40
+ "description": "Default endpoint URL. Integration modules ship with this pre-configured; admin can override."
41
+ },
42
+ "secretCd": {
43
+ "type": "string",
44
+ "description": "Secret code for API key (from dforge.secret table, admin-configured)"
45
+ },
46
+ "payload": {
47
+ "type": "object",
48
+ "properties": {
49
+ "include": {
50
+ "type": "array",
51
+ "items": { "type": "string" },
52
+ "description": "Field codes to include. If omitted, include all visible fields."
53
+ },
54
+ "includeOld": {
55
+ "type": "boolean",
56
+ "default": false,
57
+ "description": "Include previous field values on update/status_change events"
58
+ }
59
+ },
60
+ "additionalProperties": false
61
+ },
62
+ "enabled": {
63
+ "type": "boolean",
64
+ "default": true,
65
+ "description": "Can be set to false to disable without removing"
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ }
70
+ }
71
+ },
72
+ "additionalProperties": false
73
+ }
@@ -23,14 +23,23 @@ You're authoring a dForge module via the `dforge-mcp` MCP server. dForge is a me
23
23
 
24
24
  ## Resources
25
25
 
26
- Read these *before* generating any module content so your output matches the canonical schema:
27
-
28
- - `dforge://schema/manifest` manifest.json shape (required fields, patterns)
29
- - `dforge://schema/entity` — entity JSON shape (fields, traits, refs)
30
- - `dforge://schema/data-view` — data view shape (viewType, dataSources)
31
- - `dforge://docs/conventions` — naming, FK+Reference pattern, traits, security model
32
-
33
- Load them when you start a session, not after a wrong guess.
26
+ Read these *before* generating any module content so your output matches the canonical schema. Don't memorise — load each on demand when you're about to write that kind of file.
27
+
28
+ | URI | What it covers |
29
+ |---|---|
30
+ | `dforge://schema/manifest` | manifest.json required fields, semver, dependencies, `entities` map, `tags` |
31
+ | `dforge://schema/entity` | entities/*.json `description`, `dbObject`, `toString`, `traits`, `fields` |
32
+ | `dforge://schema/data-views` | ui/data_views.json — `viewType` enum, `dataSources[]` (with per-source `filter` + `order`), `viewConfig` per view type, the canonical `filter` shape (`{c,o,v}` or `{g,i:[]}`) |
33
+ | `dforge://schema/folders` | ui/folders.json folder tree, per-entity view bindings, icon, color |
34
+ | `dforge://schema/menus` | ui/menus.json — menus + items (with nested `children` for sections), `itemType: V/D/R/null` |
35
+ | `dforge://schema/roles` | security/roles.json — role → entity → rights string (`SIUDC` or `E`) |
36
+ | `dforge://schema/jobs` | logic/jobs.json — cron + action binding for the scheduler |
37
+ | `dforge://schema/seed-data` | seed-data/*.json — initial rows inserted at install |
38
+ | `dforge://schema/settings` | settings.json — `fieldTypeCd`, `defaultValue`/`formula`, `params` per setting |
39
+ | `dforge://schema/reports` | ui/reports.json — `layout.panels[]`, `datasets` (Q/S types), filter reuse |
40
+ | `dforge://schema/traits` | reference for entity trait codes |
41
+ | `dforge://schema/webhooks` | ui/webhooks.json — outbound webhooks |
42
+ | `dforge://docs/conventions` | naming, FK+Reference pattern, traits cheat sheet, security model |
34
43
 
35
44
  ---
36
45