@ng-forge/dynamic-form-mcp 0.5.2 → 0.6.1

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 (38) hide show
  1. package/README.md +1 -1
  2. package/bin/ng-forge-mcp.js +2277 -744
  3. package/package.json +7 -7
  4. package/src/index.js +2277 -745
  5. package/src/registry/documentation.d.ts +14 -0
  6. package/src/registry/documentation.d.ts.map +1 -0
  7. package/src/registry/field-types.d.ts +9 -0
  8. package/src/registry/field-types.d.ts.map +1 -0
  9. package/src/registry/index.d.ts +10 -16
  10. package/src/registry/index.d.ts.map +1 -1
  11. package/src/registry/instructions.d.ts +1 -1
  12. package/src/registry/instructions.d.ts.map +1 -1
  13. package/src/registry/ui-adapters.d.ts +9 -0
  14. package/src/registry/ui-adapters.d.ts.map +1 -0
  15. package/src/registry/validators.d.ts +9 -0
  16. package/src/registry/validators.d.ts.map +1 -0
  17. package/src/resources/documentation.resource.d.ts +2 -1
  18. package/src/resources/documentation.resource.d.ts.map +1 -1
  19. package/src/services/doc-fetcher.d.ts +34 -0
  20. package/src/services/doc-fetcher.d.ts.map +1 -0
  21. package/src/services/topic-mapper.d.ts +18 -0
  22. package/src/services/topic-mapper.d.ts.map +1 -0
  23. package/src/tools/data/lookup-topics.d.ts +5 -0
  24. package/src/tools/data/lookup-topics.d.ts.map +1 -1
  25. package/src/tools/examples.tool.d.ts +18 -0
  26. package/src/tools/examples.tool.d.ts.map +1 -1
  27. package/src/tools/index.d.ts +8 -6
  28. package/src/tools/index.d.ts.map +1 -1
  29. package/src/tools/lookup.tool.d.ts.map +1 -1
  30. package/src/tools/scaffold.tool.d.ts.map +1 -1
  31. package/src/tools/search.tool.d.ts +9 -0
  32. package/src/tools/search.tool.d.ts.map +1 -0
  33. package/src/tools/validate.tool.d.ts.map +1 -1
  34. package/src/registry/api-reference.json +0 -510
  35. package/src/registry/docs.json +0 -236
  36. package/src/registry/field-types.json +0 -490
  37. package/src/registry/ui-adapters.json +0 -225
  38. package/src/registry/validators.json +0 -158
@@ -1,510 +0,0 @@
1
- {
2
- "version": "1.0.0",
3
- "description": "ng-forge Dynamic Forms API Reference - Compact format optimized for LLM consumption",
4
- "logicMatrix": {
5
- "description": "Logic support per field type. Y=supported, N=not supported",
6
- "columns": ["hidden", "disabled", "required", "readonly", "derivation"],
7
- "fields": {
8
- "page": ["Y", "N", "N", "N", "N"],
9
- "group": ["N", "N", "N", "N", "N"],
10
- "row": ["N", "N", "N", "N", "N"],
11
- "array": ["N", "N", "N", "N", "N"],
12
- "input": ["Y", "Y", "Y", "Y", "Y"],
13
- "select": ["Y", "Y", "Y", "Y", "Y"],
14
- "checkbox": ["Y", "Y", "Y", "Y", "Y"],
15
- "radio": ["Y", "Y", "Y", "Y", "Y"],
16
- "multi-checkbox": ["Y", "Y", "Y", "Y", "Y"],
17
- "textarea": ["Y", "Y", "Y", "Y", "Y"],
18
- "datepicker": ["Y", "Y", "Y", "Y", "Y"],
19
- "toggle": ["Y", "Y", "Y", "Y", "Y"],
20
- "slider": ["Y", "Y", "Y", "Y", "Y"],
21
- "hidden": ["N", "N", "N", "N", "N"],
22
- "text": ["Y", "N", "N", "N", "N"],
23
- "button": ["Y", "Y", "N", "N", "N"],
24
- "submit": ["Y", "Y", "N", "N", "N"],
25
- "next": ["Y", "Y", "N", "N", "N"],
26
- "previous": ["Y", "Y", "N", "N", "N"]
27
- }
28
- },
29
- "containerRules": {
30
- "page": {
31
- "hasLabel": false,
32
- "supportsLogic": true,
33
- "logicTypes": ["hidden"],
34
- "allowedChildren": [
35
- "row",
36
- "group",
37
- "array",
38
- "input",
39
- "select",
40
- "checkbox",
41
- "radio",
42
- "multi-checkbox",
43
- "textarea",
44
- "datepicker",
45
- "toggle",
46
- "slider",
47
- "hidden",
48
- "text",
49
- "button",
50
- "submit",
51
- "next",
52
- "previous"
53
- ],
54
- "notAllowedChildren": ["page"],
55
- "notes": "Nav buttons (next/previous) go INSIDE page. ALL top-level fields must be pages if using multi-page mode."
56
- },
57
- "group": {
58
- "hasLabel": false,
59
- "supportsLogic": false,
60
- "allowedChildren": [
61
- "row",
62
- "input",
63
- "select",
64
- "checkbox",
65
- "radio",
66
- "multi-checkbox",
67
- "textarea",
68
- "datepicker",
69
- "toggle",
70
- "slider",
71
- "hidden",
72
- "text",
73
- "button",
74
- "submit"
75
- ],
76
- "notAllowedChildren": ["page", "group"],
77
- "notes": "Creates nested object in form value. Use 'fields', NOT 'children' or 'template'."
78
- },
79
- "row": {
80
- "hasLabel": false,
81
- "supportsLogic": false,
82
- "allowedChildren": [
83
- "group",
84
- "array",
85
- "input",
86
- "select",
87
- "checkbox",
88
- "radio",
89
- "multi-checkbox",
90
- "textarea",
91
- "datepicker",
92
- "toggle",
93
- "slider",
94
- "text",
95
- "button",
96
- "submit"
97
- ],
98
- "notAllowedChildren": ["page", "row", "hidden"],
99
- "notes": "Layout only. Use 'col' (1-12) on children. Hidden fields NOT allowed inside rows."
100
- },
101
- "array": {
102
- "hasLabel": false,
103
- "supportsLogic": false,
104
- "allowedChildren": [
105
- "row",
106
- "group",
107
- "input",
108
- "select",
109
- "checkbox",
110
- "radio",
111
- "multi-checkbox",
112
- "textarea",
113
- "datepicker",
114
- "toggle",
115
- "slider",
116
- "text"
117
- ],
118
- "notAllowedChildren": ["page", "array", "hidden"],
119
- "notes": "Use 'fields' (NOT 'template'). No minItems/maxItems properties."
120
- }
121
- },
122
- "fieldReference": {
123
- "input": {
124
- "category": "value",
125
- "valueType": "string | number",
126
- "fieldLevelProps": [
127
- "key",
128
- "type",
129
- "label",
130
- "value",
131
- "required",
132
- "email",
133
- "min",
134
- "max",
135
- "minLength",
136
- "maxLength",
137
- "pattern",
138
- "disabled",
139
- "readonly",
140
- "hidden",
141
- "col",
142
- "logic",
143
- "validators",
144
- "validationMessages"
145
- ],
146
- "propsObject": ["type", "placeholder", "appearance", "hint"],
147
- "copyPaste": "{ type: 'input', key: 'name', label: 'Name', value: '' }",
148
- "copyPasteEmail": "{ type: 'input', key: 'email', label: 'Email', required: true, email: true, props: { type: 'email' } }",
149
- "copyPasteNumber": "{ type: 'input', key: 'age', label: 'Age', value: '', meta: { inputmode: 'numeric' } }"
150
- },
151
- "select": {
152
- "category": "value",
153
- "valueType": "T | T[]",
154
- "fieldLevelProps": [
155
- "key",
156
- "type",
157
- "label",
158
- "value",
159
- "options",
160
- "required",
161
- "disabled",
162
- "readonly",
163
- "hidden",
164
- "col",
165
- "logic",
166
- "validators",
167
- "validationMessages"
168
- ],
169
- "propsObject": ["multiple", "placeholder", "appearance"],
170
- "copyPaste": "{ type: 'select', key: 'country', label: 'Country', options: [{ value: 'us', label: 'USA' }], value: 'us' }",
171
- "pitfall": "options goes at FIELD level, NOT inside props"
172
- },
173
- "radio": {
174
- "category": "value",
175
- "valueType": "T",
176
- "fieldLevelProps": [
177
- "key",
178
- "type",
179
- "label",
180
- "value",
181
- "options",
182
- "required",
183
- "disabled",
184
- "readonly",
185
- "hidden",
186
- "col",
187
- "logic",
188
- "validators",
189
- "validationMessages"
190
- ],
191
- "propsObject": [],
192
- "copyPaste": "{ type: 'radio', key: 'gender', label: 'Gender', options: [{ value: 'm', label: 'Male' }, { value: 'f', label: 'Female' }] }",
193
- "pitfall": "options goes at FIELD level, NOT inside props"
194
- },
195
- "checkbox": {
196
- "category": "value",
197
- "valueType": "boolean",
198
- "fieldLevelProps": [
199
- "key",
200
- "type",
201
- "label",
202
- "value",
203
- "required",
204
- "disabled",
205
- "readonly",
206
- "hidden",
207
- "col",
208
- "logic",
209
- "validators",
210
- "validationMessages"
211
- ],
212
- "propsObject": ["color"],
213
- "copyPaste": "{ type: 'checkbox', key: 'accept', label: 'Accept terms', value: false }"
214
- },
215
- "multi-checkbox": {
216
- "category": "value",
217
- "valueType": "T[]",
218
- "fieldLevelProps": [
219
- "key",
220
- "type",
221
- "label",
222
- "value",
223
- "options",
224
- "required",
225
- "disabled",
226
- "readonly",
227
- "hidden",
228
- "col",
229
- "logic",
230
- "validators",
231
- "validationMessages"
232
- ],
233
- "propsObject": [],
234
- "copyPaste": "{ type: 'multi-checkbox', key: 'tags', label: 'Tags', options: [{ value: 'a', label: 'A' }], value: [] }",
235
- "pitfall": "value is an array, options at FIELD level"
236
- },
237
- "textarea": {
238
- "category": "value",
239
- "valueType": "string",
240
- "fieldLevelProps": [
241
- "key",
242
- "type",
243
- "label",
244
- "value",
245
- "required",
246
- "minLength",
247
- "maxLength",
248
- "disabled",
249
- "readonly",
250
- "hidden",
251
- "col",
252
- "logic",
253
- "validators",
254
- "validationMessages"
255
- ],
256
- "propsObject": ["rows", "placeholder", "appearance"],
257
- "copyPaste": "{ type: 'textarea', key: 'bio', label: 'Bio', props: { rows: 4 } }"
258
- },
259
- "datepicker": {
260
- "category": "value",
261
- "valueType": "Date | string",
262
- "fieldLevelProps": [
263
- "key",
264
- "type",
265
- "label",
266
- "value",
267
- "required",
268
- "disabled",
269
- "readonly",
270
- "hidden",
271
- "col",
272
- "logic",
273
- "validators",
274
- "validationMessages"
275
- ],
276
- "propsObject": ["minDate", "maxDate", "startView", "appearance"],
277
- "copyPaste": "{ type: 'datepicker', key: 'dob', label: 'Date of Birth', value: undefined }"
278
- },
279
- "toggle": {
280
- "category": "value",
281
- "valueType": "boolean",
282
- "fieldLevelProps": [
283
- "key",
284
- "type",
285
- "label",
286
- "value",
287
- "required",
288
- "disabled",
289
- "readonly",
290
- "hidden",
291
- "col",
292
- "logic",
293
- "validators",
294
- "validationMessages"
295
- ],
296
- "propsObject": ["color"],
297
- "copyPaste": "{ type: 'toggle', key: 'notify', label: 'Enable notifications', value: false }"
298
- },
299
- "slider": {
300
- "category": "value",
301
- "valueType": "number",
302
- "fieldLevelProps": [
303
- "key",
304
- "type",
305
- "label",
306
- "value",
307
- "minValue",
308
- "maxValue",
309
- "step",
310
- "required",
311
- "disabled",
312
- "readonly",
313
- "hidden",
314
- "col",
315
- "logic",
316
- "validators",
317
- "validationMessages"
318
- ],
319
- "propsObject": ["thumbLabel", "tickInterval", "color"],
320
- "copyPaste": "{ type: 'slider', key: 'rating', label: 'Rating', minValue: 1, maxValue: 10, step: 1, value: 5 }",
321
- "pitfall": "Use minValue/maxValue/step at FIELD level, NOT min/max in props"
322
- },
323
- "hidden": {
324
- "category": "value",
325
- "valueType": "T",
326
- "fieldLevelProps": ["key", "type", "value"],
327
- "propsObject": [],
328
- "copyPaste": "{ type: 'hidden', key: 'userId', value: '123' }",
329
- "doesNotSupport": ["logic", "validators", "required", "label"]
330
- },
331
- "text": {
332
- "category": "display",
333
- "valueType": null,
334
- "fieldLevelProps": ["key", "type", "label", "hidden", "col", "logic"],
335
- "propsObject": ["elementType"],
336
- "copyPaste": "{ type: 'text', key: 'title', label: 'Section Title', props: { elementType: 'h2' } }",
337
- "notes": "Content goes in 'label', NOT in props.content"
338
- },
339
- "group": {
340
- "category": "container",
341
- "valueType": "object",
342
- "fieldLevelProps": ["key", "type", "fields"],
343
- "propsObject": [],
344
- "copyPaste": "{ type: 'group', key: 'address', fields: [{ type: 'input', key: 'city', label: 'City' }] }",
345
- "doesNotSupport": ["label", "logic"]
346
- },
347
- "row": {
348
- "category": "container",
349
- "valueType": null,
350
- "fieldLevelProps": ["key", "type", "fields"],
351
- "propsObject": [],
352
- "copyPaste": "{ type: 'row', key: 'nameRow', fields: [{ type: 'input', key: 'first', label: 'First', col: 6 }, { type: 'input', key: 'last', label: 'Last', col: 6 }] }",
353
- "doesNotSupport": ["label", "logic"]
354
- },
355
- "array": {
356
- "category": "container",
357
- "valueType": "T[]",
358
- "fieldLevelProps": ["key", "type", "fields"],
359
- "propsObject": [],
360
- "copyPaste": "{ type: 'array', key: 'contacts', fields: [{ type: 'group', key: 'item', fields: [{ type: 'input', key: 'name', label: 'Name' }] }] }",
361
- "doesNotSupport": ["label", "logic", "minItems", "maxItems", "template"]
362
- },
363
- "page": {
364
- "category": "container",
365
- "valueType": null,
366
- "fieldLevelProps": ["key", "type", "fields", "logic"],
367
- "propsObject": [],
368
- "copyPaste": "{ type: 'page', key: 'step1', fields: [{ type: 'input', key: 'name', label: 'Name' }, { type: 'next', key: 'next', label: 'Next' }] }",
369
- "doesNotSupport": ["label", "title"],
370
- "notes": "Only supports hidden logic. Nav buttons go INSIDE each page."
371
- },
372
- "button": {
373
- "category": "button",
374
- "valueType": null,
375
- "fieldLevelProps": ["key", "type", "label", "event", "hidden", "disabled", "col", "logic"],
376
- "propsObject": [],
377
- "copyPaste": "{ type: 'button', key: 'custom', label: 'Custom', event: MyCustomEvent }",
378
- "pitfall": "Generic button REQUIRES 'event' property. Use submit/next/previous instead for common actions."
379
- },
380
- "submit": {
381
- "category": "button",
382
- "valueType": null,
383
- "fieldLevelProps": ["key", "type", "label", "hidden", "disabled", "col", "logic"],
384
- "propsObject": [],
385
- "copyPaste": "{ type: 'submit', key: 'submit', label: 'Submit' }"
386
- },
387
- "next": {
388
- "category": "button",
389
- "valueType": null,
390
- "fieldLevelProps": ["key", "type", "label", "hidden", "disabled", "col", "logic"],
391
- "propsObject": [],
392
- "copyPaste": "{ type: 'next', key: 'next', label: 'Next' }",
393
- "notes": "Must be placed INSIDE a page's fields array"
394
- },
395
- "previous": {
396
- "category": "button",
397
- "valueType": null,
398
- "fieldLevelProps": ["key", "type", "label", "hidden", "disabled", "col", "logic"],
399
- "propsObject": [],
400
- "copyPaste": "{ type: 'previous', key: 'back', label: 'Back' }",
401
- "notes": "Must be placed INSIDE a page's fields array"
402
- }
403
- },
404
- "validators": {
405
- "shorthand": {
406
- "description": "Use directly on field (no validators array needed)",
407
- "list": ["required", "email", "min", "max", "minLength", "maxLength", "pattern"]
408
- },
409
- "fullSyntax": {
410
- "description": "Use in validators array for custom logic",
411
- "types": {
412
- "required": "{ type: 'required' }",
413
- "email": "{ type: 'email' }",
414
- "min": "{ type: 'min', value: 0 }",
415
- "max": "{ type: 'max', value: 100 }",
416
- "minLength": "{ type: 'minLength', value: 3 }",
417
- "maxLength": "{ type: 'maxLength', value: 50 }",
418
- "pattern": "{ type: 'pattern', value: '^[A-Z]+$' }",
419
- "custom": "{ type: 'custom', expression: 'fieldValue !== formValue.other', kind: 'errorKind' }",
420
- "customAsync": "{ type: 'customAsync', functionName: 'checkAvailability' }",
421
- "customHttp": "{ type: 'customHttp', functionName: 'validateOnServer' }"
422
- }
423
- },
424
- "errorMessages": {
425
- "description": "Custom messages go in validationMessages at FIELD level, NOT in validator config",
426
- "example": "validationMessages: { required: 'This is required', customKind: 'Custom error' }"
427
- }
428
- },
429
- "logic": {
430
- "types": ["hidden", "disabled", "required", "readonly", "derivation"],
431
- "conditions": {
432
- "fieldValue": "{ type: 'fieldValue', fieldPath: 'field.path', operator: 'equals', value: 'x' }",
433
- "javascript": "{ type: 'javascript', expression: 'formValue.age >= 18' }",
434
- "and": "{ type: 'and', conditions: [...] }",
435
- "or": "{ type: 'or', conditions: [...] }",
436
- "true": "{ type: 'true' }",
437
- "false": "{ type: 'false' }"
438
- },
439
- "operators": [
440
- "equals",
441
- "notEquals",
442
- "greater",
443
- "greaterOrEquals",
444
- "less",
445
- "lessOrEquals",
446
- "contains",
447
- "notContains",
448
- "startsWith",
449
- "endsWith",
450
- "empty",
451
- "notEmpty"
452
- ],
453
- "buttonConditions": ["formInvalid", "formSubmitting", "pageInvalid"],
454
- "derivationExample": "{ key: 'fullName', derivation: 'formValue.first + \" \" + formValue.last' }",
455
- "expressionVariables": {
456
- "formValue": "Complete form value object",
457
- "fieldValue": "Current field's value"
458
- }
459
- },
460
- "typeInference": {
461
- "recommended": "const config = { fields: [...] } as const satisfies FormConfig;",
462
- "pitfall1": "const config: FormConfig = {...} // Loses type inference - InferFormValue returns Record<string, unknown>",
463
- "pitfall2": "const config = {...} satisfies FormConfig // Without 'as const', arrays are mutable, inference breaks",
464
- "correct": "const config = { fields: [...] } as const satisfies FormConfig;\ntype Value = InferFormValue<typeof config>; // Exact shape!"
465
- },
466
- "arrayButtons": {
467
- "description": "Button types for adding/removing array items (provided by UI adapter packages)",
468
- "addArrayItem": {
469
- "copyPaste": "{ type: 'addArrayItem', key: 'addItem', label: 'Add', arrayKey: 'myArray' }",
470
- "fieldLevelProps": ["key", "type", "label", "arrayKey", "hidden", "disabled", "col", "logic"],
471
- "pitfall": "arrayKey goes at FIELD level, NOT in props"
472
- },
473
- "removeArrayItem": {
474
- "copyPaste": "{ type: 'removeArrayItem', key: 'removeItem', label: 'Remove' }",
475
- "fieldLevelProps": ["key", "type", "label", "hidden", "disabled", "col", "logic"],
476
- "notes": "Place inside array template. arrayKey is inferred from parent array."
477
- }
478
- },
479
- "contextApi": {
480
- "description": "CRITICAL: Different APIs for validators vs expressions!",
481
- "expressions": {
482
- "usedIn": ["logic[].expression", "derivation.expression", "javascript conditions"],
483
- "variables": {
484
- "formValue": "formValue.fieldName or formValue.path.to.field",
485
- "fieldValue": "Current field's value"
486
- },
487
- "example": "expression: 'formValue.password === fieldValue'"
488
- },
489
- "validators": {
490
- "usedIn": ["customFnConfig.validators (registered functions)"],
491
- "api": "Angular FieldContext",
492
- "methods": {
493
- "ctx.value()": "Current field value",
494
- "ctx.valueOf('path' as never)": "Value at path (requires cast)",
495
- "ctx.state": "Field state (errors, touched, dirty)",
496
- "ctx.stateOf('path' as never)": "State at path"
497
- },
498
- "example": "const password = ctx.valueOf('password' as never);",
499
- "pitfall": "Do NOT use formValue in validators - use ctx.valueOf()"
500
- }
501
- },
502
- "commonPitfalls": [
503
- "Container fields (group, row, array) do NOT support logic - apply to children instead",
504
- "options/minValue/maxValue/arrayKey go at FIELD level, NOT in props",
505
- "Validators use ctx.value() and ctx.valueOf(), NOT formValue",
506
- "Type annotation (: FormConfig) loses inference - use 'as const satisfies'",
507
- "Generic button type requires 'event' property - use submit/next/previous instead",
508
- "Array fields use 'fields' property, NOT 'template'"
509
- ]
510
- }