@ng-forge/dynamic-form-mcp 0.6.0 → 0.7.0

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 (36) hide show
  1. package/bin/ng-forge-mcp.js +1146 -536
  2. package/package.json +6 -6
  3. package/src/index.js +1146 -537
  4. package/src/registry/documentation.d.ts +14 -0
  5. package/src/registry/documentation.d.ts.map +1 -0
  6. package/src/registry/field-types.d.ts +9 -0
  7. package/src/registry/field-types.d.ts.map +1 -0
  8. package/src/registry/index.d.ts +10 -16
  9. package/src/registry/index.d.ts.map +1 -1
  10. package/src/registry/instructions.d.ts +1 -1
  11. package/src/registry/instructions.d.ts.map +1 -1
  12. package/src/registry/ui-adapters.d.ts +9 -0
  13. package/src/registry/ui-adapters.d.ts.map +1 -0
  14. package/src/registry/validators.d.ts +9 -0
  15. package/src/registry/validators.d.ts.map +1 -0
  16. package/src/resources/documentation.resource.d.ts +2 -1
  17. package/src/resources/documentation.resource.d.ts.map +1 -1
  18. package/src/services/doc-fetcher.d.ts +34 -0
  19. package/src/services/doc-fetcher.d.ts.map +1 -0
  20. package/src/services/topic-mapper.d.ts +18 -0
  21. package/src/services/topic-mapper.d.ts.map +1 -0
  22. package/src/tools/data/lookup-topics.d.ts +5 -0
  23. package/src/tools/data/lookup-topics.d.ts.map +1 -1
  24. package/src/tools/examples.tool.d.ts +18 -0
  25. package/src/tools/examples.tool.d.ts.map +1 -1
  26. package/src/tools/index.d.ts +8 -6
  27. package/src/tools/index.d.ts.map +1 -1
  28. package/src/tools/lookup.tool.d.ts.map +1 -1
  29. package/src/tools/search.tool.d.ts +9 -0
  30. package/src/tools/search.tool.d.ts.map +1 -0
  31. package/src/tools/validate.tool.d.ts.map +1 -1
  32. package/src/registry/api-reference.json +0 -561
  33. package/src/registry/docs.json +0 -266
  34. package/src/registry/field-types.json +0 -502
  35. package/src/registry/ui-adapters.json +0 -225
  36. package/src/registry/validators.json +0 -210
@@ -1,225 +0,0 @@
1
- [
2
- {
3
- "library": "material",
4
- "package": "@ng-forge/dynamic-forms-material",
5
- "providerFunction": "withMaterialFields()",
6
- "fieldTypes": [
7
- {
8
- "type": "input",
9
- "componentName": "MatInputFieldComponent",
10
- "additionalProps": {
11
- "appearance": {
12
- "name": "appearance",
13
- "type": "'fill' | 'outline'",
14
- "description": "Material form field appearance",
15
- "required": false,
16
- "default": "outline"
17
- },
18
- "subscriptSizing": {
19
- "name": "subscriptSizing",
20
- "type": "'fixed' | 'dynamic'",
21
- "description": "Error/hint text sizing",
22
- "required": false,
23
- "default": "dynamic"
24
- },
25
- "hint": {
26
- "name": "hint",
27
- "type": "DynamicText",
28
- "description": "Hint text below the field",
29
- "required": false
30
- }
31
- }
32
- },
33
- {
34
- "type": "select",
35
- "componentName": "MatSelectFieldComponent",
36
- "additionalProps": {
37
- "appearance": {
38
- "name": "appearance",
39
- "type": "'fill' | 'outline'",
40
- "description": "Material form field appearance",
41
- "required": false,
42
- "default": "outline"
43
- }
44
- }
45
- },
46
- {
47
- "type": "checkbox",
48
- "componentName": "MatCheckboxFieldComponent",
49
- "additionalProps": {
50
- "color": {
51
- "name": "color",
52
- "type": "'primary' | 'accent' | 'warn'",
53
- "description": "Checkbox color theme",
54
- "required": false,
55
- "default": "primary"
56
- }
57
- }
58
- },
59
- {
60
- "type": "datepicker",
61
- "componentName": "MatDatepickerFieldComponent",
62
- "additionalProps": {
63
- "startView": {
64
- "name": "startView",
65
- "type": "'month' | 'year' | 'multi-year'",
66
- "description": "Initial calendar view",
67
- "required": false,
68
- "default": "month"
69
- }
70
- }
71
- }
72
- ]
73
- },
74
- {
75
- "library": "bootstrap",
76
- "package": "@ng-forge/dynamic-forms-bootstrap",
77
- "providerFunction": "withBootstrapFields()",
78
- "fieldTypes": [
79
- {
80
- "type": "input",
81
- "componentName": "BootstrapInputComponent",
82
- "additionalProps": {
83
- "size": {
84
- "name": "size",
85
- "type": "'sm' | 'lg'",
86
- "description": "Bootstrap input size",
87
- "required": false
88
- },
89
- "floating": {
90
- "name": "floating",
91
- "type": "boolean",
92
- "description": "Use floating labels",
93
- "required": false,
94
- "default": false
95
- }
96
- }
97
- },
98
- {
99
- "type": "select",
100
- "componentName": "BootstrapSelectComponent",
101
- "additionalProps": {
102
- "size": {
103
- "name": "size",
104
- "type": "'sm' | 'lg'",
105
- "description": "Bootstrap select size",
106
- "required": false
107
- }
108
- }
109
- }
110
- ]
111
- },
112
- {
113
- "library": "primeng",
114
- "package": "@ng-forge/dynamic-forms-primeng",
115
- "providerFunction": "withPrimeNGFields()",
116
- "fieldTypes": [
117
- {
118
- "type": "input",
119
- "componentName": "PrimeInputComponent",
120
- "additionalProps": {
121
- "variant": {
122
- "name": "variant",
123
- "type": "'outlined' | 'filled'",
124
- "description": "Input variant style",
125
- "required": false,
126
- "default": "outlined"
127
- }
128
- }
129
- },
130
- {
131
- "type": "select",
132
- "componentName": "PrimeDropdownComponent",
133
- "additionalProps": {
134
- "filter": {
135
- "name": "filter",
136
- "type": "boolean",
137
- "description": "Enable dropdown filtering",
138
- "required": false,
139
- "default": false
140
- },
141
- "showClear": {
142
- "name": "showClear",
143
- "type": "boolean",
144
- "description": "Show clear button",
145
- "required": false,
146
- "default": false
147
- }
148
- }
149
- },
150
- {
151
- "type": "datepicker",
152
- "componentName": "PrimeDatepickerComponent",
153
- "additionalProps": {
154
- "showIcon": {
155
- "name": "showIcon",
156
- "type": "boolean",
157
- "description": "Show calendar icon",
158
- "required": false,
159
- "default": true
160
- },
161
- "dateFormat": {
162
- "name": "dateFormat",
163
- "type": "string",
164
- "description": "Date format pattern",
165
- "required": false,
166
- "default": "mm/dd/yy"
167
- }
168
- }
169
- }
170
- ]
171
- },
172
- {
173
- "library": "ionic",
174
- "package": "@ng-forge/dynamic-forms-ionic",
175
- "providerFunction": "withIonicFields()",
176
- "fieldTypes": [
177
- {
178
- "type": "input",
179
- "componentName": "IonicInputComponent",
180
- "additionalProps": {
181
- "fill": {
182
- "name": "fill",
183
- "type": "'solid' | 'outline'",
184
- "description": "Input fill style",
185
- "required": false,
186
- "default": "solid"
187
- },
188
- "labelPlacement": {
189
- "name": "labelPlacement",
190
- "type": "'fixed' | 'stacked' | 'floating'",
191
- "description": "Label placement style",
192
- "required": false,
193
- "default": "floating"
194
- }
195
- }
196
- },
197
- {
198
- "type": "select",
199
- "componentName": "IonicSelectComponent",
200
- "additionalProps": {
201
- "interface": {
202
- "name": "interface",
203
- "type": "'alert' | 'action-sheet' | 'popover'",
204
- "description": "Selection interface style",
205
- "required": false,
206
- "default": "alert"
207
- }
208
- }
209
- },
210
- {
211
- "type": "toggle",
212
- "componentName": "IonicToggleComponent",
213
- "additionalProps": {
214
- "enableOnOffLabels": {
215
- "name": "enableOnOffLabels",
216
- "type": "boolean",
217
- "description": "Show on/off labels",
218
- "required": false,
219
- "default": false
220
- }
221
- }
222
- }
223
- ]
224
- }
225
- ]
@@ -1,210 +0,0 @@
1
- [
2
- {
3
- "type": "required",
4
- "category": "built-in",
5
- "description": "Validates that a field has a non-empty value",
6
- "parameters": {},
7
- "example": "{ type: 'required' }\n// or shorthand: required: true"
8
- },
9
- {
10
- "type": "email",
11
- "category": "built-in",
12
- "description": "Validates email format",
13
- "parameters": {},
14
- "example": "{ type: 'email' }\n// or shorthand: email: true"
15
- },
16
- {
17
- "type": "min",
18
- "category": "built-in",
19
- "description": "Validates minimum numeric value",
20
- "parameters": {
21
- "value": {
22
- "name": "value",
23
- "type": "number",
24
- "description": "Minimum allowed value",
25
- "required": true
26
- }
27
- },
28
- "example": "{ type: 'min', value: 0 }\n// or shorthand: min: 0"
29
- },
30
- {
31
- "type": "max",
32
- "category": "built-in",
33
- "description": "Validates maximum numeric value",
34
- "parameters": {
35
- "value": {
36
- "name": "value",
37
- "type": "number",
38
- "description": "Maximum allowed value",
39
- "required": true
40
- }
41
- },
42
- "example": "{ type: 'max', value: 100 }\n// or shorthand: max: 100"
43
- },
44
- {
45
- "type": "minLength",
46
- "category": "built-in",
47
- "description": "Validates minimum string length",
48
- "parameters": {
49
- "value": {
50
- "name": "value",
51
- "type": "number",
52
- "description": "Minimum string length",
53
- "required": true
54
- }
55
- },
56
- "example": "{ type: 'minLength', value: 3 }\n// or shorthand: minLength: 3"
57
- },
58
- {
59
- "type": "maxLength",
60
- "category": "built-in",
61
- "description": "Validates maximum string length",
62
- "parameters": {
63
- "value": {
64
- "name": "value",
65
- "type": "number",
66
- "description": "Maximum string length",
67
- "required": true
68
- }
69
- },
70
- "example": "{ type: 'maxLength', value: 100 }\n// or shorthand: maxLength: 100"
71
- },
72
- {
73
- "type": "pattern",
74
- "category": "built-in",
75
- "description": "Validates against a regular expression pattern",
76
- "parameters": {
77
- "value": {
78
- "name": "value",
79
- "type": "string | RegExp",
80
- "description": "Regular expression pattern",
81
- "required": true
82
- }
83
- },
84
- "example": "{ type: 'pattern', value: '^[A-Z][a-z]+$' }\n// or shorthand: pattern: '^[A-Z][a-z]+$'"
85
- },
86
- {
87
- "type": "custom",
88
- "category": "custom",
89
- "description": "Custom synchronous validator using registered function or expression. IMPORTANT: The validator returns { kind: 'errorKind' } on failure. The actual error MESSAGE is defined in 'validationMessages' at the FIELD level, NOT in the validator config.",
90
- "parameters": {
91
- "functionName": {
92
- "name": "functionName",
93
- "type": "string",
94
- "description": "Name of registered validator function",
95
- "required": false
96
- },
97
- "expression": {
98
- "name": "expression",
99
- "type": "string",
100
- "description": "JavaScript expression to evaluate",
101
- "required": false
102
- },
103
- "kind": {
104
- "name": "kind",
105
- "type": "string",
106
- "description": "Error kind returned when validation fails. This kind maps to a message in field-level validationMessages.",
107
- "required": false
108
- },
109
- "params": {
110
- "name": "params",
111
- "type": "Record<string, unknown>",
112
- "description": "Parameters to pass to validator function",
113
- "required": false
114
- }
115
- },
116
- "example": "// Expression-based custom validator with error message\n// The validator:\n{\n type: 'custom',\n expression: 'fieldValue === formValue.password',\n kind: 'passwordMismatch' // Just the error KIND, not the message\n}\n\n// COMPLETE FIELD with validationMessages at FIELD level:\n{\n key: 'confirmPassword',\n type: 'input',\n label: 'Confirm Password',\n props: { type: 'password' },\n validators: [\n { type: 'custom', expression: 'fieldValue === formValue.password', kind: 'passwordMismatch' }\n ],\n validationMessages: {\n passwordMismatch: 'Passwords do not match' // Message goes HERE at field level\n }\n}"
117
- },
118
- {
119
- "type": "async",
120
- "category": "async",
121
- "description": "Async validator using registered async function (resource-based). Register the function via customFnConfig.asyncValidators.",
122
- "parameters": {
123
- "functionName": {
124
- "name": "functionName",
125
- "type": "string",
126
- "description": "Name of registered async validator function",
127
- "required": true
128
- },
129
- "params": {
130
- "name": "params",
131
- "type": "Record<string, unknown>",
132
- "description": "Parameters to pass to validator function",
133
- "required": false
134
- }
135
- },
136
- "example": "{\n type: 'async',\n functionName: 'checkUsernameAvailability'\n}"
137
- },
138
- {
139
- "type": "customAsync",
140
- "category": "async",
141
- "description": "DEPRECATED — use type: 'async' instead. Async validator using registered async function.",
142
- "parameters": {
143
- "functionName": {
144
- "name": "functionName",
145
- "type": "string",
146
- "description": "Name of registered async validator function",
147
- "required": true
148
- },
149
- "params": {
150
- "name": "params",
151
- "type": "Record<string, unknown>",
152
- "description": "Parameters to pass to validator function",
153
- "required": false
154
- }
155
- },
156
- "example": "// DEPRECATED — use type: 'async' instead\n{\n type: 'customAsync',\n functionName: 'checkUsernameAvailability'\n}"
157
- },
158
- {
159
- "type": "customHttp",
160
- "category": "http",
161
- "description": "DEPRECATED — use type: 'http' with functionName instead. HTTP-based validator with automatic request cancellation.",
162
- "parameters": {
163
- "functionName": {
164
- "name": "functionName",
165
- "type": "string",
166
- "description": "Name of registered HTTP validator configuration",
167
- "required": true
168
- },
169
- "params": {
170
- "name": "params",
171
- "type": "Record<string, unknown>",
172
- "description": "Parameters to pass to HTTP validator",
173
- "required": false
174
- }
175
- },
176
- "example": "// DEPRECATED — use type: 'http' with functionName instead\n{\n type: 'customHttp',\n functionName: 'validateEmailExists'\n}"
177
- },
178
- {
179
- "type": "http",
180
- "category": "http",
181
- "description": "HTTP validator — supports two modes: (1) Declarative (fully JSON-serializable, no function registration) using http + responseMapping properties, or (2) Function-based using functionName to reference a registered HTTP validator function. Query param values and (optionally) body values are expressions evaluated against the form context. Response mapping uses validWhen (truthy = valid) and errorKind (maps to field-level validationMessages).",
182
- "parameters": {
183
- "functionName": {
184
- "name": "functionName",
185
- "type": "string",
186
- "description": "Name of registered HTTP validator function (function-based mode). Mutually exclusive with http + responseMapping.",
187
- "required": false
188
- },
189
- "http": {
190
- "name": "http",
191
- "type": "HttpRequestConfig",
192
- "description": "HTTP request configuration: { url, method?, queryParams?, body?, evaluateBodyExpressions?, headers?, debounceMs? }. queryParams values are expressions. When evaluateBodyExpressions is true, top-level string values in body are evaluated as expressions (shallow only). Required for declarative mode.",
193
- "required": false
194
- },
195
- "responseMapping": {
196
- "name": "responseMapping",
197
- "type": "HttpValidationResponseMapping",
198
- "description": "Response mapping: { validWhen, errorKind, errorParams? }. validWhen is an expression evaluated with { response } scope — truthy means valid. errorKind maps to field-level validationMessages. Required for declarative mode.",
199
- "required": false
200
- },
201
- "params": {
202
- "name": "params",
203
- "type": "Record<string, unknown>",
204
- "description": "Parameters to pass to HTTP validator function (function-based mode only).",
205
- "required": false
206
- }
207
- },
208
- "example": "// HTTP validator (fully JSON-serializable)\n{\n type: 'http',\n http: {\n url: '/api/validate-username',\n method: 'GET',\n queryParams: {\n username: 'fieldValue'\n }\n },\n responseMapping: {\n validWhen: 'response.available',\n errorKind: 'usernameTaken',\n errorParams: {\n suggestion: 'response.suggestion'\n }\n }\n}\n\n// COMPLETE FIELD with validationMessages at FIELD level:\n{\n key: 'username',\n type: 'input',\n label: 'Username',\n validators: [\n {\n type: 'http',\n http: {\n url: '/api/validate-username',\n method: 'GET',\n queryParams: { username: 'fieldValue' }\n },\n responseMapping: {\n validWhen: 'response.available',\n errorKind: 'usernameTaken',\n errorParams: { suggestion: 'response.suggestion' }\n }\n }\n ],\n validationMessages: {\n usernameTaken: 'Username is taken. Try {{suggestion}}'\n }\n}"
209
- }
210
- ]