@ng-forge/dynamic-form-mcp 0.10.0-next.1 → 0.10.0-next.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.
- package/bin/ng-forge-mcp.d.ts +1 -5
- package/bin/ng-forge-mcp.d.ts.map +1 -1
- package/bin/ng-forge-mcp.js +5 -3
- package/package.json +6 -6
- package/src/index.d.ts +0 -1
- package/src/index.d.ts.map +1 -1
- package/src/index.js +5 -3
- package/src/registry/addons.d.ts +1 -10
- package/src/registry/addons.d.ts.map +1 -1
- package/src/registry/documentation.d.ts +1 -6
- package/src/registry/documentation.d.ts.map +1 -1
- package/src/registry/field-types.d.ts +1 -6
- package/src/registry/field-types.d.ts.map +1 -1
- package/src/registry/index.d.ts +16 -51
- package/src/registry/index.d.ts.map +1 -1
- package/src/registry/instructions.d.ts +2 -7
- package/src/registry/instructions.d.ts.map +1 -1
- package/src/registry/ui-adapters.d.ts +1 -6
- package/src/registry/ui-adapters.d.ts.map +1 -1
- package/src/registry/validators.d.ts +1 -6
- package/src/registry/validators.d.ts.map +1 -1
- package/src/registry/wrappers.d.ts +1 -17
- package/src/registry/wrappers.d.ts.map +1 -1
- package/src/resources/documentation.resource.d.ts +1 -6
- package/src/resources/documentation.resource.d.ts.map +1 -1
- package/src/resources/examples.resource.d.ts +1 -5
- package/src/resources/examples.resource.d.ts.map +1 -1
- package/src/resources/field-types.resource.d.ts +1 -5
- package/src/resources/field-types.resource.d.ts.map +1 -1
- package/src/resources/index.d.ts +2 -8
- package/src/resources/index.d.ts.map +1 -1
- package/src/resources/instructions.resource.d.ts +1 -5
- package/src/resources/instructions.resource.d.ts.map +1 -1
- package/src/resources/schemas.resource.d.ts +1 -6
- package/src/resources/schemas.resource.d.ts.map +1 -1
- package/src/resources/ui-adapters.resource.d.ts +1 -5
- package/src/resources/ui-adapters.resource.d.ts.map +1 -1
- package/src/resources/validators.resource.d.ts +1 -5
- package/src/resources/validators.resource.d.ts.map +1 -1
- package/src/resources/wrappers.resource.d.ts +1 -6
- package/src/resources/wrappers.resource.d.ts.map +1 -1
- package/src/server.d.ts +3 -15
- package/src/server.d.ts.map +1 -1
- package/src/services/doc-fetcher.d.ts +3 -16
- package/src/services/doc-fetcher.d.ts.map +1 -1
- package/src/services/topic-mapper.d.ts +2 -10
- package/src/services/topic-mapper.d.ts.map +1 -1
- package/src/tools/data/lookup-topics.d.ts +3 -12
- package/src/tools/data/lookup-topics.d.ts.map +1 -1
- package/src/tools/examples.tool.d.ts +4 -18
- package/src/tools/examples.tool.d.ts.map +1 -1
- package/src/tools/index.d.ts +2 -32
- package/src/tools/index.d.ts.map +1 -1
- package/src/tools/lookup.tool.d.ts +1 -12
- package/src/tools/lookup.tool.d.ts.map +1 -1
- package/src/tools/scaffold.tool.d.ts +1 -8
- package/src/tools/scaffold.tool.d.ts.map +1 -1
- package/src/tools/search.tool.d.ts +1 -6
- package/src/tools/search.tool.d.ts.map +1 -1
- package/src/tools/validate.tool.d.ts +1 -11
- package/src/tools/validate.tool.d.ts.map +1 -1
- package/src/utils/ast-extractor.d.ts +7 -35
- package/src/utils/ast-extractor.d.ts.map +1 -1
package/bin/ng-forge-mcp.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-mcp.d.ts","sourceRoot":"","sources":["../../../../packages/dynamic-form-mcp/bin/ng-forge-mcp.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"ng-forge-mcp.d.ts","sourceRoot":"","sources":["../../../../packages/dynamic-form-mcp/bin/ng-forge-mcp.ts"],"names":[],"mappings":";AACA,8BAA8B"}
|
package/bin/ng-forge-mcp.js
CHANGED
|
@@ -394,7 +394,7 @@ var FIELD_TYPES = [
|
|
|
394
394
|
fields: {
|
|
395
395
|
name: "fields",
|
|
396
396
|
type: "GroupAllowedChildren[]",
|
|
397
|
-
description: "Child fields in the group. Allowed: rows, leaf fields (NOT pages or other groups)",
|
|
397
|
+
description: "Child fields in the group. Allowed: rows, arrays, leaf fields (NOT pages or other groups)",
|
|
398
398
|
required: true
|
|
399
399
|
}
|
|
400
400
|
},
|
|
@@ -404,6 +404,7 @@ var FIELD_TYPES = [
|
|
|
404
404
|
notAllowedIn: ["group"],
|
|
405
405
|
canContain: [
|
|
406
406
|
"row",
|
|
407
|
+
"array",
|
|
407
408
|
"input",
|
|
408
409
|
"textarea",
|
|
409
410
|
"select",
|
|
@@ -2563,6 +2564,7 @@ Every field MUST have:
|
|
|
2563
2564
|
|
|
2564
2565
|
- \`key\`: Identifier, unique within its group scope (the same leaf key may repeat inside different groups, e.g. \`createA.name\` and \`createB.name\`). Page/row/array containers do not introduce a scope. Buttons (which don't bind to form values) don't need unique keys.
|
|
2565
2566
|
- **DOM id / data-testid composition:** keys are joined with \`_\` through group ancestors to form the rendered DOM id. A leaf \`street\` inside group \`address\` renders as \`id="address_street"\`. Inside an array item, the item index is appended after: \`id="address_street_0"\`. Use this exact form for \`for=\`, \`aria-describedby\`, \`aria-labelledby\`, or CSS selectors that target group-nested fields.
|
|
2567
|
+
- **Form-level prefix (multiple forms on one page):** set \`options.idPrefix\` to scope every id to a form instance \u2014 it becomes the OUTERMOST segment: \`{idPrefix}_{group}_{key}_{index}\` (e.g. \`billing_address_street_0\`). When omitted, a lone form stays unprefixed, but if two or more forms are mounted at once the library auto-prefixes each (\`df-1\`, \`df-2\`, \u2026) so their ids don't collide. Account for an explicit prefix when writing \`for=\`/\`aria-*\`/selectors.
|
|
2566
2568
|
- **Avoid \`_\` in keys when they could collide with a group-prefixed id.** A top-level key \`foo_bar\` and a leaf \`bar\` inside group \`foo\` would both render as \`id="foo_bar"\`. The validator catches this collision at boot, but it's easier to just not put \`_\` in keys that share a name with an existing group + leaf pair.
|
|
2567
2569
|
- \`type\`: One of the registered field types
|
|
2568
2570
|
- \`label\`: Human-readable label (for accessibility)
|
|
@@ -7392,7 +7394,7 @@ Included in form value but not rendered.
|
|
|
7392
7394
|
- Adding \`label\` to group (not allowed)
|
|
7393
7395
|
- Using non-hidden logic types on group (only \`hidden\` is supported, apply other logic types to child fields instead)
|
|
7394
7396
|
|
|
7395
|
-
**Can contain:** rows, leaf fields (NOT pages, NOT nested groups)`
|
|
7397
|
+
**Can contain:** rows, arrays, leaf fields (NOT pages, NOT nested groups)`
|
|
7396
7398
|
},
|
|
7397
7399
|
row: {
|
|
7398
7400
|
brief: `\`\`\`typescript
|
|
@@ -8807,7 +8809,7 @@ provideDynamicForm({
|
|
|
8807
8809
|
| Container | Label? | Logic? | Allowed Children | Notes |
|
|
8808
8810
|
|-----------|--------|--------|------------------|-------|
|
|
8809
8811
|
| page | NO | YES (hidden only) | rows, groups, arrays, leaf fields, buttons | Nav buttons go INSIDE |
|
|
8810
|
-
| group | NO | YES (hidden only) | rows, leaf fields (NOT pages, groups) | Creates nested object |
|
|
8812
|
+
| group | NO | YES (hidden only) | rows, arrays, leaf fields (NOT pages, groups) | Creates nested object |
|
|
8811
8813
|
| array | NO | YES (hidden only) | rows, groups, leaf fields (NOT pages, arrays) | Two APIs: \`template\`+\`value\` (simplified) or \`fields\` (full) |
|
|
8812
8814
|
| row | NO | YES (hidden only) | groups, arrays, containers, nested rows, hidden fields, leaf fields (NOT pages) | Layout only |
|
|
8813
8815
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/dynamic-form-mcp",
|
|
3
|
-
"version": "0.10.0-next.
|
|
3
|
+
"version": "0.10.0-next.3",
|
|
4
4
|
"description": "MCP server for ng-forge dynamic forms - AI-assisted form schema generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"zod": "^3.25.76"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@ng-forge/dynamic-forms": "^0.10.0-next.
|
|
55
|
-
"@ng-forge/dynamic-forms-bootstrap": "^0.10.0-next.
|
|
56
|
-
"@ng-forge/dynamic-forms-ionic": "^0.10.0-next.
|
|
57
|
-
"@ng-forge/dynamic-forms-material": "^0.10.0-next.
|
|
58
|
-
"@ng-forge/dynamic-forms-primeng": "^0.10.0-next.
|
|
54
|
+
"@ng-forge/dynamic-forms": "^0.10.0-next.3",
|
|
55
|
+
"@ng-forge/dynamic-forms-bootstrap": "^0.10.0-next.3",
|
|
56
|
+
"@ng-forge/dynamic-forms-ionic": "^0.10.0-next.3",
|
|
57
|
+
"@ng-forge/dynamic-forms-material": "^0.10.0-next.3",
|
|
58
|
+
"@ng-forge/dynamic-forms-primeng": "^0.10.0-next.3",
|
|
59
59
|
"tsx": "^4.19.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/dynamic-form-mcp/src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/dynamic-form-mcp/src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGxF,YAAY,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEjH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGxF,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -392,7 +392,7 @@ var FIELD_TYPES = [
|
|
|
392
392
|
fields: {
|
|
393
393
|
name: "fields",
|
|
394
394
|
type: "GroupAllowedChildren[]",
|
|
395
|
-
description: "Child fields in the group. Allowed: rows, leaf fields (NOT pages or other groups)",
|
|
395
|
+
description: "Child fields in the group. Allowed: rows, arrays, leaf fields (NOT pages or other groups)",
|
|
396
396
|
required: true
|
|
397
397
|
}
|
|
398
398
|
},
|
|
@@ -402,6 +402,7 @@ var FIELD_TYPES = [
|
|
|
402
402
|
notAllowedIn: ["group"],
|
|
403
403
|
canContain: [
|
|
404
404
|
"row",
|
|
405
|
+
"array",
|
|
405
406
|
"input",
|
|
406
407
|
"textarea",
|
|
407
408
|
"select",
|
|
@@ -2593,6 +2594,7 @@ Every field MUST have:
|
|
|
2593
2594
|
|
|
2594
2595
|
- \`key\`: Identifier, unique within its group scope (the same leaf key may repeat inside different groups, e.g. \`createA.name\` and \`createB.name\`). Page/row/array containers do not introduce a scope. Buttons (which don't bind to form values) don't need unique keys.
|
|
2595
2596
|
- **DOM id / data-testid composition:** keys are joined with \`_\` through group ancestors to form the rendered DOM id. A leaf \`street\` inside group \`address\` renders as \`id="address_street"\`. Inside an array item, the item index is appended after: \`id="address_street_0"\`. Use this exact form for \`for=\`, \`aria-describedby\`, \`aria-labelledby\`, or CSS selectors that target group-nested fields.
|
|
2597
|
+
- **Form-level prefix (multiple forms on one page):** set \`options.idPrefix\` to scope every id to a form instance \u2014 it becomes the OUTERMOST segment: \`{idPrefix}_{group}_{key}_{index}\` (e.g. \`billing_address_street_0\`). When omitted, a lone form stays unprefixed, but if two or more forms are mounted at once the library auto-prefixes each (\`df-1\`, \`df-2\`, \u2026) so their ids don't collide. Account for an explicit prefix when writing \`for=\`/\`aria-*\`/selectors.
|
|
2596
2598
|
- **Avoid \`_\` in keys when they could collide with a group-prefixed id.** A top-level key \`foo_bar\` and a leaf \`bar\` inside group \`foo\` would both render as \`id="foo_bar"\`. The validator catches this collision at boot, but it's easier to just not put \`_\` in keys that share a name with an existing group + leaf pair.
|
|
2597
2599
|
- \`type\`: One of the registered field types
|
|
2598
2600
|
- \`label\`: Human-readable label (for accessibility)
|
|
@@ -7469,7 +7471,7 @@ Included in form value but not rendered.
|
|
|
7469
7471
|
- Adding \`label\` to group (not allowed)
|
|
7470
7472
|
- Using non-hidden logic types on group (only \`hidden\` is supported, apply other logic types to child fields instead)
|
|
7471
7473
|
|
|
7472
|
-
**Can contain:** rows, leaf fields (NOT pages, NOT nested groups)`
|
|
7474
|
+
**Can contain:** rows, arrays, leaf fields (NOT pages, NOT nested groups)`
|
|
7473
7475
|
},
|
|
7474
7476
|
row: {
|
|
7475
7477
|
brief: `\`\`\`typescript
|
|
@@ -8884,7 +8886,7 @@ provideDynamicForm({
|
|
|
8884
8886
|
| Container | Label? | Logic? | Allowed Children | Notes |
|
|
8885
8887
|
|-----------|--------|--------|------------------|-------|
|
|
8886
8888
|
| page | NO | YES (hidden only) | rows, groups, arrays, leaf fields, buttons | Nav buttons go INSIDE |
|
|
8887
|
-
| group | NO | YES (hidden only) | rows, leaf fields (NOT pages, groups) | Creates nested object |
|
|
8889
|
+
| group | NO | YES (hidden only) | rows, arrays, leaf fields (NOT pages, groups) | Creates nested object |
|
|
8888
8890
|
| array | NO | YES (hidden only) | rows, groups, leaf fields (NOT pages, arrays) | Two APIs: \`template\`+\`value\` (simplified) or \`fields\` (full) |
|
|
8889
8891
|
| row | NO | YES (hidden only) | groups, arrays, containers, nested rows, hidden fields, leaf fields (NOT pages) | Layout only |
|
|
8890
8892
|
|
package/src/registry/addons.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Addon Registry Data
|
|
3
|
-
*
|
|
4
|
-
* Canonical source of addon kind metadata for the MCP server. Addons render
|
|
5
|
-
* inside a field's slot (typically `prefix` / `suffix`) — icons, buttons,
|
|
6
|
-
* inline text, custom templates, custom components.
|
|
7
|
-
*
|
|
8
|
-
* Manually authored for MVP; auto-extraction from `AddonKindDefinition.schema`
|
|
9
|
-
* fragments is a follow-up.
|
|
10
|
-
*/
|
|
1
|
+
/** Addon Registry Data */
|
|
11
2
|
import type { PropertyInfo } from './index.js';
|
|
12
3
|
export interface AddonKindInfo {
|
|
13
4
|
/** Discriminant matching `addon.kind` in form configs. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addons.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/addons.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"addons.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/addons.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/D,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,cAAc,EAAE,MAAM,CAAC;CACxB;AA6BD,eAAO,MAAM,WAAW,EAAE,aAAa,EA4YtC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/D,gCAAgC;IAChC,KAAK,EAAE,CAAC,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC;IACxC,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAQD,eAAO,MAAM,mBAAmB,EAAE,qBAAqB,EAqBtD,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Documentation Registry Data
|
|
3
|
-
*
|
|
4
|
-
* Maps documentation topics to their online URLs at ng-forge.com.
|
|
5
|
-
* Replaces the previously bundled docs.json with links to the live documentation site.
|
|
6
|
-
*/
|
|
1
|
+
/** Documentation Registry Data */
|
|
7
2
|
export interface DocPage {
|
|
8
3
|
id: string;
|
|
9
4
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentation.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/documentation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"documentation.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/documentation.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAIlC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,EAgIlC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Field Type Registry Data
|
|
3
|
-
*
|
|
4
|
-
* Canonical source of field type metadata for the MCP server.
|
|
5
|
-
* Previously generated as field-types.json by generate-registry.ts.
|
|
6
|
-
*/
|
|
1
|
+
/** Field Type Registry Data */
|
|
7
2
|
import type { FieldTypeInfo } from './index.js';
|
|
8
3
|
export declare const FIELD_TYPES: FieldTypeInfo[];
|
|
9
4
|
//# sourceMappingURL=field-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-types.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/field-types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"field-types.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/field-types.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,aAAa,EA8qBtC,CAAC"}
|
package/src/registry/index.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registry module for field type, validator, and UI adapter metadata
|
|
3
|
-
*
|
|
4
|
-
* This module provides access to field types, validators, and UI adapters
|
|
5
|
-
* defined as TypeScript data in the registry source files.
|
|
6
|
-
*/
|
|
1
|
+
/** Registry module for field type, validator, and UI adapter metadata */
|
|
7
2
|
export interface PropertyInfo {
|
|
8
3
|
name: string;
|
|
9
4
|
type: string;
|
|
@@ -81,65 +76,35 @@ import { type DocPage } from './documentation.js';
|
|
|
81
76
|
import { WRAPPER_AUTHORING_CONTRACT } from './wrappers.js';
|
|
82
77
|
export { WRAPPER_AUTHORING_CONTRACT };
|
|
83
78
|
export type { DocPage };
|
|
84
|
-
/**
|
|
85
|
-
* Get all available field types
|
|
86
|
-
*/
|
|
79
|
+
/** Get all available field types */
|
|
87
80
|
export declare function getFieldTypes(): FieldTypeInfo[];
|
|
88
|
-
/**
|
|
89
|
-
* Get a specific field type by name
|
|
90
|
-
*/
|
|
81
|
+
/** Get a specific field type by name */
|
|
91
82
|
export declare function getFieldType(type: string): FieldTypeInfo | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* Get field types by category
|
|
94
|
-
*/
|
|
83
|
+
/** Get field types by category */
|
|
95
84
|
export declare function getFieldTypesByCategory(category: 'value' | 'container' | 'button' | 'display'): FieldTypeInfo[];
|
|
96
|
-
/**
|
|
97
|
-
* Get all available validators
|
|
98
|
-
*/
|
|
85
|
+
/** Get all available validators */
|
|
99
86
|
export declare function getValidators(): ValidatorInfo[];
|
|
100
|
-
/**
|
|
101
|
-
* Get a specific validator by type
|
|
102
|
-
*/
|
|
87
|
+
/** Get a specific validator by type */
|
|
103
88
|
export declare function getValidator(type: string): ValidatorInfo | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Get validators by category
|
|
106
|
-
*/
|
|
89
|
+
/** Get validators by category */
|
|
107
90
|
export declare function getValidatorsByCategory(category: 'built-in' | 'custom' | 'async' | 'http'): ValidatorInfo[];
|
|
108
|
-
/**
|
|
109
|
-
* Get all UI adapters
|
|
110
|
-
*/
|
|
91
|
+
/** Get all UI adapters */
|
|
111
92
|
export declare function getUIAdapters(): UIAdapterInfo[];
|
|
112
|
-
/**
|
|
113
|
-
* Get a specific UI adapter by library name
|
|
114
|
-
*/
|
|
93
|
+
/** Get a specific UI adapter by library name */
|
|
115
94
|
export declare function getUIAdapter(library: 'material' | 'bootstrap' | 'primeng' | 'ionic'): UIAdapterInfo | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* Get UI adapter field type configuration
|
|
118
|
-
*/
|
|
95
|
+
/** Get UI adapter field type configuration */
|
|
119
96
|
export declare function getUIAdapterFieldType(library: 'material' | 'bootstrap' | 'primeng' | 'ionic', fieldType: string): UIAdapterFieldType | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* Get all wrappers
|
|
122
|
-
*/
|
|
97
|
+
/** Get all wrappers */
|
|
123
98
|
export declare function getWrappers(): WrapperInfo[];
|
|
124
|
-
/**
|
|
125
|
-
* Get a specific wrapper by type
|
|
126
|
-
*/
|
|
99
|
+
/** Get a specific wrapper by type */
|
|
127
100
|
export declare function getWrapper(type: string): WrapperInfo | undefined;
|
|
128
|
-
/**
|
|
129
|
-
* Get wrappers by category
|
|
130
|
-
*/
|
|
101
|
+
/** Get wrappers by category */
|
|
131
102
|
export declare function getWrappersByCategory(category: 'core' | 'demo' | 'adapter'): WrapperInfo[];
|
|
132
|
-
/**
|
|
133
|
-
* Get all documentation pages
|
|
134
|
-
*/
|
|
103
|
+
/** Get all documentation pages */
|
|
135
104
|
export declare function getDocPages(): DocPage[];
|
|
136
|
-
/**
|
|
137
|
-
* Get a specific documentation page by ID
|
|
138
|
-
*/
|
|
105
|
+
/** Get a specific documentation page by ID */
|
|
139
106
|
export declare function getDocPage(id: string): DocPage | undefined;
|
|
140
|
-
/**
|
|
141
|
-
* Get documentation pages by category
|
|
142
|
-
*/
|
|
107
|
+
/** Get documentation pages by category */
|
|
143
108
|
export declare function getDocPagesByCategory(category: string): DocPage[];
|
|
144
109
|
import { AddonKindInfo, FieldAddonSupportInfo } from './addons.js';
|
|
145
110
|
export type { AddonKindInfo, FieldAddonSupportInfo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,wHAAwH;IACxH,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,gJAAgJ;IAChJ,YAAY,EAAE,UAAU,GAAG,WAAW,CAAC;IACvC,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,wGAAwG;IACxG,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC;;;OAGG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAKD,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAY,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,YAAY,EAAE,OAAO,EAAE,CAAC;AAExB,oCAAoC;AACpC,wBAAgB,aAAa,IAAI,aAAa,EAAE,CAE/C;AAED,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpE;AAED,kCAAkC;AAClC,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,EAAE,CAE/G;AAED,mCAAmC;AACnC,wBAAgB,aAAa,IAAI,aAAa,EAAE,CAE/C;AAED,uCAAuC;AACvC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpE;AAED,iCAAiC;AACjC,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,EAAE,CAE3G;AAED,0BAA0B;AAC1B,wBAAgB,aAAa,IAAI,aAAa,EAAE,CAE/C;AAED,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,CAE/G;AAED,8CAA8C;AAC9C,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,EACvD,SAAS,EAAE,MAAM,GAChB,kBAAkB,GAAG,SAAS,CAGhC;AAED,uBAAuB;AACvB,wBAAgB,WAAW,IAAI,WAAW,EAAE,CAE3C;AAED,qCAAqC;AACrC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEhE;AAED,+BAA+B;AAC/B,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,EAAE,CAE1F;AAED,kCAAkC;AAClC,wBAAgB,WAAW,IAAI,OAAO,EAAE,CAEvC;AAED,8CAA8C;AAC9C,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE1D;AAED,0CAA0C;AAC1C,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAEjE;AAED,OAAO,EAAe,aAAa,EAAuB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAErG,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAC;AAErD,uCAAuC;AACvC,wBAAgB,aAAa,IAAI,aAAa,EAAE,CAE/C;AAED,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpE;AAED,6DAA6D;AAC7D,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,EAAE,CAErF;AAED,gDAAgD;AAChD,wBAAgB,oBAAoB,IAAI,qBAAqB,EAAE,CAE9D;AAED,uDAAuD;AACvD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAE5F"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ng-forge Best Practices
|
|
3
|
-
*
|
|
4
|
-
* This content is served via the ng-forge://instructions resource
|
|
5
|
-
* to guide AI assistants in generating FormConfig objects.
|
|
6
|
-
*/
|
|
7
|
-
export declare const INSTRUCTIONS = "# ng-forge Dynamic Forms - Best Practices\n\nYou MUST follow these practices when generating FormConfig objects for ng-forge.\n\n## Core Principles\n\n1. **Configuration-driven**: ng-forge wraps Angular Reactive Forms. Define structure declaratively via `FormConfig`, not imperatively.\n2. **Type-safe**: Use TypeScript interfaces for form values. The library provides full type inference.\n3. **Validation-first**: Always include validation and user-friendly error messages.\n\n## FormConfig Structure\n\n```typescript\nconst config: FormConfig = {\n // Optional: Default validation messages for all fields\n defaultValidationMessages: {\n required: 'This field is required',\n email: 'Please enter a valid email',\n minLength: 'Must be at least {{requiredLength}} characters',\n },\n // Required: Array of field definitions\n fields: [\n // ... field definitions\n ],\n};\n```\n\n## Field Definition Rules\n\n### Required Properties\n\nEvery field MUST have:\n\n- `key`: Identifier, unique within its group scope (the same leaf key may repeat inside different groups, e.g. `createA.name` and `createB.name`). Page/row/array containers do not introduce a scope. Buttons (which don't bind to form values) don't need unique keys.\n - **DOM id / data-testid composition:** keys are joined with `_` through group ancestors to form the rendered DOM id. A leaf `street` inside group `address` renders as `id=\"address_street\"`. Inside an array item, the item index is appended after: `id=\"address_street_0\"`. Use this exact form for `for=`, `aria-describedby`, `aria-labelledby`, or CSS selectors that target group-nested fields.\n - **Avoid `_` in keys when they could collide with a group-prefixed id.** A top-level key `foo_bar` and a leaf `bar` inside group `foo` would both render as `id=\"foo_bar\"`. The validator catches this collision at boot, but it's easier to just not put `_` in keys that share a name with an existing group + leaf pair.\n- `type`: One of the registered field types\n- `label`: Human-readable label (for accessibility)\n\n### Value Fields\n\nFor fields that collect user input (`input`, `textarea`, `select`, `checkbox`, `radio`, `datepicker`, `toggle`, `slider`):\n\n```typescript\n{\n key: 'email',\n type: 'input',\n label: 'Email Address',\n required: true, // Shorthand validator\n email: true, // Shorthand validator\n placeholder: 'user@example.com', // Field-level, not inside props\n validationMessages: { // Always provide clear messages\n required: 'Email is required',\n email: 'Please enter a valid email'\n },\n props: {\n type: 'email', // HTML input type\n hint: 'We will never share your email' // UI library specific\n }\n}\n```\n\n### Select/Radio Fields\n\nMUST include `options` array:\n\n```typescript\n{\n key: 'country',\n type: 'select',\n label: 'Country',\n required: true,\n placeholder: 'Select a country',\n options: [\n { value: 'us', label: 'United States' },\n { value: 'uk', label: 'United Kingdom' }\n ]\n}\n```\n\n### Container Fields\n\n#### Row (Horizontal Layout)\n\nUse for side-by-side fields. Row fields do NOT create nested values - children are flat.\n\n```typescript\n{\n key: 'nameRow',\n type: 'row',\n fields: [\n { key: 'firstName', type: 'input', label: 'First', col: 6 },\n { key: 'lastName', type: 'input', label: 'Last', col: 6 }\n ]\n}\n// Result: { firstName: '...', lastName: '...' }\n```\n\nUse `col` property (1-12) to control column widths.\n\n#### Group (Nested Object)\n\nUse when you need nested object structure in form values:\n\n```typescript\n{\n key: 'address',\n type: 'group',\n fields: [\n { key: 'street', type: 'input', label: 'Street' },\n { key: 'city', type: 'input', label: 'City' }\n ]\n}\n// Result: { address: { street: '...', city: '...' } }\n```\n\n#### Array (Repeatable Items)\n\nUse for dynamic lists. Each item is wrapped in a `<div class=\"df-array-item\">` with `role=\"group\"` and `aria-label=\"Item N\"` for accessibility. Use `--df-array-item-gap` CSS variable to control spacing between items.\n\n```typescript\n{\n key: 'contacts',\n type: 'array',\n // \u26A0\uFE0F NO label property on arrays!\n fields: [\n {\n key: 'contact',\n type: 'group',\n fields: [\n { key: 'name', type: 'input', label: 'Name', required: true },\n { key: 'phone', type: 'input', label: 'Phone', required: true }\n ]\n }\n ]\n}\n// Result: { contacts: [{ name: '...', phone: '...' }, ...] }\n```\n\n#### Page (Multi-step Forms)\n\nUse for wizard-style forms:\n\n```typescript\n{\n fields: [\n {\n key: 'step1',\n type: 'page',\n fields: [\n { key: 'name', type: 'input', label: 'Name' },\n { key: 'next', type: 'next', label: 'Continue' },\n ],\n },\n {\n key: 'step2',\n type: 'page',\n fields: [\n { key: 'prev', type: 'previous', label: 'Back' },\n { key: 'submit', type: 'submit', label: 'Submit' },\n ],\n },\n ];\n}\n```\n\n## Validation\n\n### Shorthand Validators (Preferred)\n\nUse shorthand properties directly on field definitions:\n\n```typescript\n{\n key: 'age',\n type: 'input',\n label: 'Age',\n required: true,\n min: 18,\n max: 120,\n validationMessages: {\n required: 'Age is required',\n min: 'Must be at least {{min}}',\n max: 'Cannot exceed {{max}}'\n }\n}\n```\n\nAvailable shorthands: `required`, `email`, `min`, `max`, `minLength`, `maxLength`, `pattern`\n\n### Nullable Values\n\nValue fields and checked fields (`checkbox`, `toggle`) accept a `nullable?: boolean` flag. When `true`:\n\n- `value` accepts `null` in addition to the field's normal value type.\n- An omitted `value` resolves to `null` (instead of the type-specific empty default like `''`, `NaN`, `false`, or `[]`).\n- Orthogonal to `required`. `nullable` declares that the **model** accepts `null`; `required` is a **validation** constraint. Angular's `Validators.required` treats `null` as invalid, so a field that is both `nullable` and `required` will fail required-validation when the value is `null` \u2014 the two flags describe different layers (data shape vs. validation), not conflicting semantics.\n- Map OpenAPI `nullable: true` (3.0) or `type: [T, null]` (3.1) to this flag.\n- Container fields (`group`, `array`, `row`, `page`) do NOT support `nullable` \u2014 their null semantics are ambiguous.\n\n```typescript\n{\n key: 'middleName',\n type: 'input',\n label: 'Middle Name',\n nullable: true,\n value: null, // valid; default-resolves to null\n}\n\n{\n key: 'active',\n type: 'checkbox',\n label: 'Active',\n nullable: true,\n value: null, // undecided checkbox state \u2014 model permits null, UI renders unchecked\n}\n```\n\nRead-side caveat: a user clearing a text input reads back as `\"\"`, not `null` \u2014 this is a DOM/Web IDL contract, identical to classic Reactive Forms. `nullable` is a contract for accepted values, not a guarantee of emitted ones.\n\n### Validation Messages\n\nALWAYS provide validation messages. Use template variables:\n\n- `{{requiredLength}}` - for minLength/maxLength\n- `{{min}}`, `{{max}}` - for min/max\n- `{{requiredPattern}}` - for pattern\n\n## Conditional Logic\n\nUse `logic` array for conditional behavior:\n\n```typescript\n{\n key: 'businessName',\n type: 'input',\n label: 'Business Name',\n logic: [\n {\n type: 'hidden',\n condition: {\n type: 'fieldValue',\n fieldPath: 'accountType',\n operator: 'notEquals',\n value: 'business'\n }\n },\n {\n type: 'required',\n condition: {\n type: 'fieldValue',\n fieldPath: 'accountType',\n operator: 'equals',\n value: 'business'\n }\n }\n ]\n}\n```\n\n### Logic Types\n\n- `hidden` - Show/hide field\n- `disabled` - Enable/disable field\n- `required` - Conditional requirement\n\n### Condition Types\n\n#### Field Value Condition\n\nCompares a specific field's value:\n\n```typescript\n{\n type: 'fieldValue',\n fieldPath: 'accountType',\n operator: 'equals',\n value: 'business'\n}\n```\n\n#### Comparison Operators\n\n- `equals`, `notEquals`\n- `greater`, `less`, `greaterOrEqual`, `lessOrEqual`\n- `contains`, `startsWith`, `endsWith`, `matches`\n\n#### JavaScript Condition\n\nEvaluates a JavaScript expression with access to `formValue`, `fieldValue`, `externalData`:\n\n```typescript\n{\n type: 'javascript',\n expression: 'formValue.items.length > 0'\n}\n```\n\n#### Custom Condition\n\nInvokes a registered custom function by name:\n\n```typescript\n{\n type: 'custom',\n functionName: 'myCustomCheck'\n}\n```\n\nRegister functions via `customFnConfig.customFunctions`.\n\n> **TypeScript-authored configs:** the same surface also accepts an inline `fn: CustomFunction` instead of `functionName` (XOR with `functionName`, code-only \u2014 not JSON-serializable). The MCP server emits `functionName` exclusively; consumers writing configs in TS may prefer `fn` when they don't need JSON round-tripping. Same caveat applies to async conditions (`asyncFn`), function derivations (`fn`), async function derivations (`asyncFn`), and validators (`fn`).\n\n#### Async Custom Condition\n\nInvokes a registered async function that returns `Promise<boolean>` or `Observable<boolean>`:\n\n```typescript\n{\n type: 'async',\n asyncFunctionName: 'checkPermission',\n pendingValue: false, // value while async resolution is pending (default: false)\n debounceMs: 300 // debounce for re-evaluation (default: 300)\n}\n```\n\nRegister functions via `customFnConfig.asyncConditions`. The function receives an `EvaluationContext` with access to `formValue`, `fieldValue`, and `externalData`.\n\n#### HTTP Condition\n\nEvaluates based on an HTTP response from a remote server. Fully declarative and JSON-serializable:\n\n```typescript\n{\n type: 'http',\n http: {\n url: '/api/permissions',\n method: 'GET',\n queryParams: {\n userId: 'formValue.userId',\n role: 'formValue.role'\n }\n },\n responseExpression: 'response.canEdit', // extract boolean from response (default: !!response)\n pendingValue: false, // value while HTTP request is in-flight (default: false)\n cacheDurationMs: 30000, // cache duration in ms (default: 30000)\n debounceMs: 300 // debounce for re-evaluation (default: 300)\n}\n```\n\nUse HTTP conditions when visibility, disabled state, or required state depends on server-side data (e.g., permissions, feature flags, inventory checks). The request re-evaluates reactively when dependent form values change.\n\n#### Logical Combinators\n\nCombine conditions with `and` (all must be true) or `or` (at least one must be true):\n\n```typescript\n{\n type: 'and',\n conditions: [\n { type: 'fieldValue', fieldPath: 'country', operator: 'equals', value: 'US' },\n { type: 'fieldValue', fieldPath: 'age', operator: 'greaterOrEqual', value: 18 }\n ]\n}\n```\n\n## UI Library Integration\n\nng-forge supports multiple UI libraries. Configure in `app.config.ts`:\n\n```typescript\nimport { provideDynamicForm } from '@ng-forge/dynamic-forms';\nimport { withMaterialFields } from '@ng-forge/dynamic-forms-material';\n\nexport const appConfig = {\n providers: [provideDynamicForm(...withMaterialFields())],\n};\n```\n\nAvailable adapters:\n\n- `@ng-forge/dynamic-forms-material` - Angular Material\n- `@ng-forge/dynamic-forms-bootstrap` - Bootstrap 5\n- `@ng-forge/dynamic-forms-primeng` - PrimeNG\n- `@ng-forge/dynamic-forms-ionic` - Ionic\n\n### Style Defaults (opt-in)\n\nEach adapter ships an opinionated Sass partial with host-framework colors/typography. Library SCSS uses `var(--df-name, structural-fallback)` so forms render usefully without any opt-in \u2014 only opt in if you want the adapter-themed look.\n\n```scss\n@use '@ng-forge/dynamic-forms-material/styles/defaults' as df;\n\n:root {\n @include df.apply-material-form-defaults;\n}\n```\n\nSubstitute `material` for `bootstrap`, `primeng`, or `ionic`. Material also ships `form-material-defaults-dark` for dark-mode hint/error colors. Ionic ships `apply-ionic-legacy-error-styles` that pairs with `withLegacyStatusClasses()` (see below).\n\n## Provider Features\n\n`provideDynamicForm()` accepts optional `with*` feature configurators alongside the adapter field bundle:\n\n### `withLegacyStatusClasses()` \u2014 opt into legacy ng-* CSS classes\n\nBy default, Angular Signal Forms uses its modern class strategy. If your CSS targets `.ng-touched`, `.ng-invalid`, `.ng-dirty`, etc. on form-bound elements, add this feature to wire up the compat-class strategy:\n\n```typescript\nimport { provideDynamicForm, withLegacyStatusClasses } from '@ng-forge/dynamic-forms';\nimport { withMaterialFields } from '@ng-forge/dynamic-forms-material';\n\nexport const appConfig = {\n providers: [\n provideDynamicForm(\n ...withMaterialFields(),\n withLegacyStatusClasses(),\n ),\n ],\n};\n```\n\nRecommended when consuming Ionic's `apply-ionic-legacy-error-styles` mixin, when using Bootstrap themes that style `is-invalid.ng-touched`, or any custom CSS that depends on the `ng-*` classes.\n\n### Other built-in features\n\n- `withLoggerConfig(options?)` \u2014 configure or disable the dynamic-form logger\n- `withEventFormValue()` \u2014 attach the current form value to every dispatched event\n- `withValueExclusionDefaults(options)` \u2014 set form-wide value exclusion defaults\n- `withValidationExecutionDefaults(options)` \u2014 set form-wide validation execution defaults (e.g. defer until touched)\n\nAll features are exported from `@ng-forge/dynamic-forms`.\n\n## Common Patterns\n\n### Always End with Submit Button\n\n```typescript\n{ type: 'submit', key: 'submit', label: 'Submit', props: { color: 'primary' } }\n```\n\n### Use Text Fields for Headings\n\n```typescript\n{ key: 'sectionTitle', type: 'text', label: 'Personal Info', props: { elementType: 'h3' } }\n```\n\n### Input Types via Props\n\n```typescript\n// Email input\n{ key: 'email', type: 'input', props: { type: 'email' } }\n\n// Password input\n{ key: 'password', type: 'input', props: { type: 'password' } }\n\n// Number input\n{ key: 'age', type: 'input', props: { type: 'number' } }\n\n// Phone input\n{ key: 'phone', type: 'input', props: { type: 'tel' } }\n```\n\n## Anti-patterns to Avoid\n\n1. **Missing labels** - Always include labels for accessibility\n2. **Missing validation messages** - Users need clear feedback\n3. **Duplicate keys within a group scope** - Keys must be unique within the same group. Same key in different groups is fine (different scoped paths). Buttons are exempt.\n4. **Select without options** - Select/radio fields must have options\n5. **Array without fields** - Array fields need a fields template\n6. **Group without fields** - Group fields need child fields\n7. **min > max** - Ensure min values are less than max values\n\n## CRITICAL: UI Library Differences\n\nDifferent UI libraries support different properties. Always validate against the correct library using `ngforge_validate_form_config` with the appropriate `uiIntegration` parameter.\n\n### Property Differences by Library\n\n| Property | Material | Bootstrap | PrimeNG | Ionic |\n|----------|----------|-----------|---------|-------|\n| `appearance` | \u2713 (fill, outline) | \u2717 | \u2717 | \u2713 (fill, outline) |\n| `subscriptSizing` | \u2713 | \u2717 | \u2717 | \u2717 |\n| `floatLabel` | \u2713 (auto, always, never) | \u2717 | \u2717 | \u2717 |\n| `hideRequiredMarker` | \u2713 | \u2717 | \u2717 | \u2717 |\n| `hint` | \u2713 | \u2713 (as `helpText`) | \u2713 | \u2713 |\n\n### Container Fields\n\nContainer fields (`page`, `group`, `row`) do NOT support these properties:\n- `label` - Use `text` field type for headings instead\n- `required`, `email`, `min`, `max`, etc. - Validation is for leaf fields only\n\n### Common Mistakes to Avoid\n\n1. **Using `expressions` on fields** - This property is NOT supported on standard fields. Use `derivation` for computed values or `logic` for conditional behavior.\n\n2. **Adding `label` to container fields** - Pages, groups, and rows don't have labels:\n ```typescript\n // \u274C WRONG\n { key: 'address', type: 'group', label: 'Address', fields: [...] }\n\n // \u2705 CORRECT - Use a text field for the heading\n { key: 'addressTitle', type: 'text', label: 'Address', props: { elementType: 'h3' } }\n { key: 'address', type: 'group', fields: [...] }\n ```\n\n3. **Adding `id` to FormConfig** - The root FormConfig does not accept an `id` property.\n\n4. **Putting slider min/max in props** - For slider fields, `min`, `max`, and `step` are field-level properties:\n ```typescript\n // \u274C WRONG\n { key: 'volume', type: 'slider', label: 'Volume', props: { min: 0, max: 100 } }\n\n // \u2705 CORRECT\n { key: 'volume', type: 'slider', label: 'Volume', min: 0, max: 100 }\n ```\n\n5. **Using unsupported field types** - Each UI library supports specific field types. Use `ngforge_get_field_schema` to see available types.\n\n## Validation Before Use\n\nAlways validate your FormConfig using the `ngforge_validate_form_config` tool before using it. This tool uses the actual TypeScript/Zod schemas, so if validation passes, the config will work correctly at runtime.\n\n```typescript\n// Always specify the UI integration you're using\nngforge_validate_form_config({\n uiIntegration: 'material', // or 'bootstrap', 'primeng', 'ionic'\n config: { fields: [...] }\n})\n```\n\nTo understand what properties are supported for each field type, use `ngforge_get_field_schema`:\n\n```typescript\nngforge_get_field_schema({ uiIntegration: 'material' })\n```\n";
|
|
1
|
+
/** ng-forge Best Practices */
|
|
2
|
+
export declare const INSTRUCTIONS = "# ng-forge Dynamic Forms - Best Practices\n\nYou MUST follow these practices when generating FormConfig objects for ng-forge.\n\n## Core Principles\n\n1. **Configuration-driven**: ng-forge wraps Angular Reactive Forms. Define structure declaratively via `FormConfig`, not imperatively.\n2. **Type-safe**: Use TypeScript interfaces for form values. The library provides full type inference.\n3. **Validation-first**: Always include validation and user-friendly error messages.\n\n## FormConfig Structure\n\n```typescript\nconst config: FormConfig = {\n // Optional: Default validation messages for all fields\n defaultValidationMessages: {\n required: 'This field is required',\n email: 'Please enter a valid email',\n minLength: 'Must be at least {{requiredLength}} characters',\n },\n // Required: Array of field definitions\n fields: [\n // ... field definitions\n ],\n};\n```\n\n## Field Definition Rules\n\n### Required Properties\n\nEvery field MUST have:\n\n- `key`: Identifier, unique within its group scope (the same leaf key may repeat inside different groups, e.g. `createA.name` and `createB.name`). Page/row/array containers do not introduce a scope. Buttons (which don't bind to form values) don't need unique keys.\n - **DOM id / data-testid composition:** keys are joined with `_` through group ancestors to form the rendered DOM id. A leaf `street` inside group `address` renders as `id=\"address_street\"`. Inside an array item, the item index is appended after: `id=\"address_street_0\"`. Use this exact form for `for=`, `aria-describedby`, `aria-labelledby`, or CSS selectors that target group-nested fields.\n - **Form-level prefix (multiple forms on one page):** set `options.idPrefix` to scope every id to a form instance \u2014 it becomes the OUTERMOST segment: `{idPrefix}_{group}_{key}_{index}` (e.g. `billing_address_street_0`). When omitted, a lone form stays unprefixed, but if two or more forms are mounted at once the library auto-prefixes each (`df-1`, `df-2`, \u2026) so their ids don't collide. Account for an explicit prefix when writing `for=`/`aria-*`/selectors.\n - **Avoid `_` in keys when they could collide with a group-prefixed id.** A top-level key `foo_bar` and a leaf `bar` inside group `foo` would both render as `id=\"foo_bar\"`. The validator catches this collision at boot, but it's easier to just not put `_` in keys that share a name with an existing group + leaf pair.\n- `type`: One of the registered field types\n- `label`: Human-readable label (for accessibility)\n\n### Value Fields\n\nFor fields that collect user input (`input`, `textarea`, `select`, `checkbox`, `radio`, `datepicker`, `toggle`, `slider`):\n\n```typescript\n{\n key: 'email',\n type: 'input',\n label: 'Email Address',\n required: true, // Shorthand validator\n email: true, // Shorthand validator\n placeholder: 'user@example.com', // Field-level, not inside props\n validationMessages: { // Always provide clear messages\n required: 'Email is required',\n email: 'Please enter a valid email'\n },\n props: {\n type: 'email', // HTML input type\n hint: 'We will never share your email' // UI library specific\n }\n}\n```\n\n### Select/Radio Fields\n\nMUST include `options` array:\n\n```typescript\n{\n key: 'country',\n type: 'select',\n label: 'Country',\n required: true,\n placeholder: 'Select a country',\n options: [\n { value: 'us', label: 'United States' },\n { value: 'uk', label: 'United Kingdom' }\n ]\n}\n```\n\n### Container Fields\n\n#### Row (Horizontal Layout)\n\nUse for side-by-side fields. Row fields do NOT create nested values - children are flat.\n\n```typescript\n{\n key: 'nameRow',\n type: 'row',\n fields: [\n { key: 'firstName', type: 'input', label: 'First', col: 6 },\n { key: 'lastName', type: 'input', label: 'Last', col: 6 }\n ]\n}\n// Result: { firstName: '...', lastName: '...' }\n```\n\nUse `col` property (1-12) to control column widths.\n\n#### Group (Nested Object)\n\nUse when you need nested object structure in form values:\n\n```typescript\n{\n key: 'address',\n type: 'group',\n fields: [\n { key: 'street', type: 'input', label: 'Street' },\n { key: 'city', type: 'input', label: 'City' }\n ]\n}\n// Result: { address: { street: '...', city: '...' } }\n```\n\n#### Array (Repeatable Items)\n\nUse for dynamic lists. Each item is wrapped in a `<div class=\"df-array-item\">` with `role=\"group\"` and `aria-label=\"Item N\"` for accessibility. Use `--df-array-item-gap` CSS variable to control spacing between items.\n\n```typescript\n{\n key: 'contacts',\n type: 'array',\n // \u26A0\uFE0F NO label property on arrays!\n fields: [\n {\n key: 'contact',\n type: 'group',\n fields: [\n { key: 'name', type: 'input', label: 'Name', required: true },\n { key: 'phone', type: 'input', label: 'Phone', required: true }\n ]\n }\n ]\n}\n// Result: { contacts: [{ name: '...', phone: '...' }, ...] }\n```\n\n#### Page (Multi-step Forms)\n\nUse for wizard-style forms:\n\n```typescript\n{\n fields: [\n {\n key: 'step1',\n type: 'page',\n fields: [\n { key: 'name', type: 'input', label: 'Name' },\n { key: 'next', type: 'next', label: 'Continue' },\n ],\n },\n {\n key: 'step2',\n type: 'page',\n fields: [\n { key: 'prev', type: 'previous', label: 'Back' },\n { key: 'submit', type: 'submit', label: 'Submit' },\n ],\n },\n ];\n}\n```\n\n## Validation\n\n### Shorthand Validators (Preferred)\n\nUse shorthand properties directly on field definitions:\n\n```typescript\n{\n key: 'age',\n type: 'input',\n label: 'Age',\n required: true,\n min: 18,\n max: 120,\n validationMessages: {\n required: 'Age is required',\n min: 'Must be at least {{min}}',\n max: 'Cannot exceed {{max}}'\n }\n}\n```\n\nAvailable shorthands: `required`, `email`, `min`, `max`, `minLength`, `maxLength`, `pattern`\n\n### Nullable Values\n\nValue fields and checked fields (`checkbox`, `toggle`) accept a `nullable?: boolean` flag. When `true`:\n\n- `value` accepts `null` in addition to the field's normal value type.\n- An omitted `value` resolves to `null` (instead of the type-specific empty default like `''`, `NaN`, `false`, or `[]`).\n- Orthogonal to `required`. `nullable` declares that the **model** accepts `null`; `required` is a **validation** constraint. Angular's `Validators.required` treats `null` as invalid, so a field that is both `nullable` and `required` will fail required-validation when the value is `null` \u2014 the two flags describe different layers (data shape vs. validation), not conflicting semantics.\n- Map OpenAPI `nullable: true` (3.0) or `type: [T, null]` (3.1) to this flag.\n- Container fields (`group`, `array`, `row`, `page`) do NOT support `nullable` \u2014 their null semantics are ambiguous.\n\n```typescript\n{\n key: 'middleName',\n type: 'input',\n label: 'Middle Name',\n nullable: true,\n value: null, // valid; default-resolves to null\n}\n\n{\n key: 'active',\n type: 'checkbox',\n label: 'Active',\n nullable: true,\n value: null, // undecided checkbox state \u2014 model permits null, UI renders unchecked\n}\n```\n\nRead-side caveat: a user clearing a text input reads back as `\"\"`, not `null` \u2014 this is a DOM/Web IDL contract, identical to classic Reactive Forms. `nullable` is a contract for accepted values, not a guarantee of emitted ones.\n\n### Validation Messages\n\nALWAYS provide validation messages. Use template variables:\n\n- `{{requiredLength}}` - for minLength/maxLength\n- `{{min}}`, `{{max}}` - for min/max\n- `{{requiredPattern}}` - for pattern\n\n## Conditional Logic\n\nUse `logic` array for conditional behavior:\n\n```typescript\n{\n key: 'businessName',\n type: 'input',\n label: 'Business Name',\n logic: [\n {\n type: 'hidden',\n condition: {\n type: 'fieldValue',\n fieldPath: 'accountType',\n operator: 'notEquals',\n value: 'business'\n }\n },\n {\n type: 'required',\n condition: {\n type: 'fieldValue',\n fieldPath: 'accountType',\n operator: 'equals',\n value: 'business'\n }\n }\n ]\n}\n```\n\n### Logic Types\n\n- `hidden` - Show/hide field\n- `disabled` - Enable/disable field\n- `required` - Conditional requirement\n\n### Condition Types\n\n#### Field Value Condition\n\nCompares a specific field's value:\n\n```typescript\n{\n type: 'fieldValue',\n fieldPath: 'accountType',\n operator: 'equals',\n value: 'business'\n}\n```\n\n#### Comparison Operators\n\n- `equals`, `notEquals`\n- `greater`, `less`, `greaterOrEqual`, `lessOrEqual`\n- `contains`, `startsWith`, `endsWith`, `matches`\n\n#### JavaScript Condition\n\nEvaluates a JavaScript expression with access to `formValue`, `fieldValue`, `externalData`:\n\n```typescript\n{\n type: 'javascript',\n expression: 'formValue.items.length > 0'\n}\n```\n\n#### Custom Condition\n\nInvokes a registered custom function by name:\n\n```typescript\n{\n type: 'custom',\n functionName: 'myCustomCheck'\n}\n```\n\nRegister functions via `customFnConfig.customFunctions`.\n\n> **TypeScript-authored configs:** the same surface also accepts an inline `fn: CustomFunction` instead of `functionName` (XOR with `functionName`, code-only \u2014 not JSON-serializable). The MCP server emits `functionName` exclusively; consumers writing configs in TS may prefer `fn` when they don't need JSON round-tripping. Same caveat applies to async conditions (`asyncFn`), function derivations (`fn`), async function derivations (`asyncFn`), and validators (`fn`).\n\n#### Async Custom Condition\n\nInvokes a registered async function that returns `Promise<boolean>` or `Observable<boolean>`:\n\n```typescript\n{\n type: 'async',\n asyncFunctionName: 'checkPermission',\n pendingValue: false, // value while async resolution is pending (default: false)\n debounceMs: 300 // debounce for re-evaluation (default: 300)\n}\n```\n\nRegister functions via `customFnConfig.asyncConditions`. The function receives an `EvaluationContext` with access to `formValue`, `fieldValue`, and `externalData`.\n\n#### HTTP Condition\n\nEvaluates based on an HTTP response from a remote server. Fully declarative and JSON-serializable:\n\n```typescript\n{\n type: 'http',\n http: {\n url: '/api/permissions',\n method: 'GET',\n queryParams: {\n userId: 'formValue.userId',\n role: 'formValue.role'\n }\n },\n responseExpression: 'response.canEdit', // extract boolean from response (default: !!response)\n pendingValue: false, // value while HTTP request is in-flight (default: false)\n cacheDurationMs: 30000, // cache duration in ms (default: 30000)\n debounceMs: 300 // debounce for re-evaluation (default: 300)\n}\n```\n\nUse HTTP conditions when visibility, disabled state, or required state depends on server-side data (e.g., permissions, feature flags, inventory checks). The request re-evaluates reactively when dependent form values change.\n\n#### Logical Combinators\n\nCombine conditions with `and` (all must be true) or `or` (at least one must be true):\n\n```typescript\n{\n type: 'and',\n conditions: [\n { type: 'fieldValue', fieldPath: 'country', operator: 'equals', value: 'US' },\n { type: 'fieldValue', fieldPath: 'age', operator: 'greaterOrEqual', value: 18 }\n ]\n}\n```\n\n## UI Library Integration\n\nng-forge supports multiple UI libraries. Configure in `app.config.ts`:\n\n```typescript\nimport { provideDynamicForm } from '@ng-forge/dynamic-forms';\nimport { withMaterialFields } from '@ng-forge/dynamic-forms-material';\n\nexport const appConfig = {\n providers: [provideDynamicForm(...withMaterialFields())],\n};\n```\n\nAvailable adapters:\n\n- `@ng-forge/dynamic-forms-material` - Angular Material\n- `@ng-forge/dynamic-forms-bootstrap` - Bootstrap 5\n- `@ng-forge/dynamic-forms-primeng` - PrimeNG\n- `@ng-forge/dynamic-forms-ionic` - Ionic\n\n### Style Defaults (opt-in)\n\nEach adapter ships an opinionated Sass partial with host-framework colors/typography. Library SCSS uses `var(--df-name, structural-fallback)` so forms render usefully without any opt-in \u2014 only opt in if you want the adapter-themed look.\n\n```scss\n@use '@ng-forge/dynamic-forms-material/styles/defaults' as df;\n\n:root {\n @include df.apply-material-form-defaults;\n}\n```\n\nSubstitute `material` for `bootstrap`, `primeng`, or `ionic`. Material also ships `form-material-defaults-dark` for dark-mode hint/error colors. Ionic ships `apply-ionic-legacy-error-styles` that pairs with `withLegacyStatusClasses()` (see below).\n\n## Provider Features\n\n`provideDynamicForm()` accepts optional `with*` feature configurators alongside the adapter field bundle:\n\n### `withLegacyStatusClasses()` \u2014 opt into legacy ng-* CSS classes\n\nBy default, Angular Signal Forms uses its modern class strategy. If your CSS targets `.ng-touched`, `.ng-invalid`, `.ng-dirty`, etc. on form-bound elements, add this feature to wire up the compat-class strategy:\n\n```typescript\nimport { provideDynamicForm, withLegacyStatusClasses } from '@ng-forge/dynamic-forms';\nimport { withMaterialFields } from '@ng-forge/dynamic-forms-material';\n\nexport const appConfig = {\n providers: [\n provideDynamicForm(\n ...withMaterialFields(),\n withLegacyStatusClasses(),\n ),\n ],\n};\n```\n\nRecommended when consuming Ionic's `apply-ionic-legacy-error-styles` mixin, when using Bootstrap themes that style `is-invalid.ng-touched`, or any custom CSS that depends on the `ng-*` classes.\n\n### Other built-in features\n\n- `withLoggerConfig(options?)` \u2014 configure or disable the dynamic-form logger\n- `withEventFormValue()` \u2014 attach the current form value to every dispatched event\n- `withValueExclusionDefaults(options)` \u2014 set form-wide value exclusion defaults\n- `withValidationExecutionDefaults(options)` \u2014 set form-wide validation execution defaults (e.g. defer until touched)\n\nAll features are exported from `@ng-forge/dynamic-forms`.\n\n## Common Patterns\n\n### Always End with Submit Button\n\n```typescript\n{ type: 'submit', key: 'submit', label: 'Submit', props: { color: 'primary' } }\n```\n\n### Use Text Fields for Headings\n\n```typescript\n{ key: 'sectionTitle', type: 'text', label: 'Personal Info', props: { elementType: 'h3' } }\n```\n\n### Input Types via Props\n\n```typescript\n// Email input\n{ key: 'email', type: 'input', props: { type: 'email' } }\n\n// Password input\n{ key: 'password', type: 'input', props: { type: 'password' } }\n\n// Number input\n{ key: 'age', type: 'input', props: { type: 'number' } }\n\n// Phone input\n{ key: 'phone', type: 'input', props: { type: 'tel' } }\n```\n\n## Anti-patterns to Avoid\n\n1. **Missing labels** - Always include labels for accessibility\n2. **Missing validation messages** - Users need clear feedback\n3. **Duplicate keys within a group scope** - Keys must be unique within the same group. Same key in different groups is fine (different scoped paths). Buttons are exempt.\n4. **Select without options** - Select/radio fields must have options\n5. **Array without fields** - Array fields need a fields template\n6. **Group without fields** - Group fields need child fields\n7. **min > max** - Ensure min values are less than max values\n\n## CRITICAL: UI Library Differences\n\nDifferent UI libraries support different properties. Always validate against the correct library using `ngforge_validate_form_config` with the appropriate `uiIntegration` parameter.\n\n### Property Differences by Library\n\n| Property | Material | Bootstrap | PrimeNG | Ionic |\n|----------|----------|-----------|---------|-------|\n| `appearance` | \u2713 (fill, outline) | \u2717 | \u2717 | \u2713 (fill, outline) |\n| `subscriptSizing` | \u2713 | \u2717 | \u2717 | \u2717 |\n| `floatLabel` | \u2713 (auto, always, never) | \u2717 | \u2717 | \u2717 |\n| `hideRequiredMarker` | \u2713 | \u2717 | \u2717 | \u2717 |\n| `hint` | \u2713 | \u2713 (as `helpText`) | \u2713 | \u2713 |\n\n### Container Fields\n\nContainer fields (`page`, `group`, `row`) do NOT support these properties:\n- `label` - Use `text` field type for headings instead\n- `required`, `email`, `min`, `max`, etc. - Validation is for leaf fields only\n\n### Common Mistakes to Avoid\n\n1. **Using `expressions` on fields** - This property is NOT supported on standard fields. Use `derivation` for computed values or `logic` for conditional behavior.\n\n2. **Adding `label` to container fields** - Pages, groups, and rows don't have labels:\n ```typescript\n // \u274C WRONG\n { key: 'address', type: 'group', label: 'Address', fields: [...] }\n\n // \u2705 CORRECT - Use a text field for the heading\n { key: 'addressTitle', type: 'text', label: 'Address', props: { elementType: 'h3' } }\n { key: 'address', type: 'group', fields: [...] }\n ```\n\n3. **Adding `id` to FormConfig** - The root FormConfig does not accept an `id` property.\n\n4. **Putting slider min/max in props** - For slider fields, `min`, `max`, and `step` are field-level properties:\n ```typescript\n // \u274C WRONG\n { key: 'volume', type: 'slider', label: 'Volume', props: { min: 0, max: 100 } }\n\n // \u2705 CORRECT\n { key: 'volume', type: 'slider', label: 'Volume', min: 0, max: 100 }\n ```\n\n5. **Using unsupported field types** - Each UI library supports specific field types. Use `ngforge_get_field_schema` to see available types.\n\n## Validation Before Use\n\nAlways validate your FormConfig using the `ngforge_validate_form_config` tool before using it. This tool uses the actual TypeScript/Zod schemas, so if validation passes, the config will work correctly at runtime.\n\n```typescript\n// Always specify the UI integration you're using\nngforge_validate_form_config({\n uiIntegration: 'material', // or 'bootstrap', 'primeng', 'ionic'\n config: { fields: [...] }\n})\n```\n\nTo understand what properties are supported for each field type, use `ngforge_get_field_schema`:\n\n```typescript\nngforge_get_field_schema({ uiIntegration: 'material' })\n```\n";
|
|
8
3
|
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/instructions.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,eAAO,MAAM,YAAY,myjBA0hBxB,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI Adapter Registry Data
|
|
3
|
-
*
|
|
4
|
-
* Canonical source of UI adapter metadata for the MCP server.
|
|
5
|
-
* Previously generated as ui-adapters.json by generate-registry.ts.
|
|
6
|
-
*/
|
|
1
|
+
/** UI Adapter Registry Data */
|
|
7
2
|
import type { UIAdapterInfo } from './index.js';
|
|
8
3
|
export declare const UI_ADAPTERS: UIAdapterInfo[];
|
|
9
4
|
//# sourceMappingURL=ui-adapters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-adapters.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/ui-adapters.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ui-adapters.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/ui-adapters.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,aAAa,EA0VtC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validator Registry Data
|
|
3
|
-
*
|
|
4
|
-
* Canonical source of validator metadata for the MCP server.
|
|
5
|
-
* Previously generated as validators.json by generate-registry.ts.
|
|
6
|
-
*/
|
|
1
|
+
/** Validator Registry Data */
|
|
7
2
|
import type { ValidatorInfo } from './index.js';
|
|
8
3
|
export declare const VALIDATORS: ValidatorInfo[];
|
|
9
4
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/validators.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/validators.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,UAAU,EAAE,aAAa,EAsPrC,CAAC"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper Registry Data
|
|
3
|
-
*
|
|
4
|
-
* Canonical source of wrapper metadata for the MCP server.
|
|
5
|
-
*
|
|
6
|
-
* Wrappers decorate the rendered output of a field without changing the form
|
|
7
|
-
* data structure. They are composed as a chain: each wrapper exposes a
|
|
8
|
-
* `#fieldComponent` `ViewContainerRef` slot where the next wrapper (or the
|
|
9
|
-
* field itself) is rendered.
|
|
10
|
-
*
|
|
11
|
-
* Categories:
|
|
12
|
-
* - core — ships from `@ng-forge/dynamic-forms`, always available.
|
|
13
|
-
* - demo — ships from `@internal/examples-shared-ui` for the docs
|
|
14
|
-
* sandbox. NOT a library primitive — use as a pattern, not
|
|
15
|
-
* a dependency.
|
|
16
|
-
* - adapter — (reserved) would ship from a UI adapter library.
|
|
17
|
-
*/
|
|
1
|
+
/** Wrapper Registry Data */
|
|
18
2
|
import type { WrapperInfo } from './index.js';
|
|
19
3
|
/**
|
|
20
4
|
* Authoring-contract pitfalls that apply to every wrapper component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/wrappers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/registry/wrappers.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,stCAmByB,CAAC;AAEjE,eAAO,MAAM,QAAQ,EAAE,WAAW,EAwIjC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Documentation Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes ng-forge documentation as MCP resources.
|
|
5
|
-
* Fetches live content from ng-forge.com with fallback to static links.
|
|
6
|
-
*/
|
|
1
|
+
/** Documentation Resource */
|
|
7
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
3
|
export declare function registerDocumentationResource(server: McpServer): void;
|
|
9
4
|
//# sourceMappingURL=documentation.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentation.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/documentation.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"documentation.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/documentation.resource.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoIrE"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Examples Resource
|
|
3
|
-
*
|
|
4
|
-
* Provides curated FormConfig examples for common use cases.
|
|
5
|
-
*/
|
|
1
|
+
/** Examples Resource */
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
3
|
export declare function registerExamplesResource(server: McpServer): void;
|
|
8
4
|
//# sourceMappingURL=examples.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examples.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/examples.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"examples.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/examples.resource.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAqBpE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgHhE"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Field Types Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes available ng-forge field types and their configurations.
|
|
5
|
-
*/
|
|
1
|
+
/** Field Types Resource */
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
3
|
export declare function registerFieldTypesResource(server: McpServer): void;
|
|
8
4
|
//# sourceMappingURL=field-types.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-types.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/field-types.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"field-types.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/field-types.resource.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkHlE"}
|
package/src/resources/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Resources Registration
|
|
3
|
-
*
|
|
4
|
-
* Registers all available resources with the MCP server.
|
|
5
|
-
*/
|
|
1
|
+
/** MCP Resources Registration */
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
-
/**
|
|
8
|
-
* Register all MCP resources
|
|
9
|
-
*/
|
|
3
|
+
/** Register all MCP resources */
|
|
10
4
|
export declare function registerResources(server: McpServer): void;
|
|
11
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUpE,iCAAiC;AACjC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CASzD"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Instructions Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes ng-forge best practices and usage guidelines for AI assistants.
|
|
5
|
-
*/
|
|
1
|
+
/** Instructions Resource */
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
3
|
export declare function registerInstructionsResource(server: McpServer): void;
|
|
8
4
|
//# sourceMappingURL=instructions.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/instructions.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/instructions.resource.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAYpE"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schemas Resource
|
|
3
|
-
*
|
|
4
|
-
* Provides a lightweight index pointing to tools for schema access.
|
|
5
|
-
* Actual schemas are accessed via tools to control context size.
|
|
6
|
-
*/
|
|
1
|
+
/** Schemas Resource */
|
|
7
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
3
|
export declare function registerSchemasResource(server: McpServer): void;
|
|
9
4
|
//# sourceMappingURL=schemas.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/schemas.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schemas.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/schemas.resource.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8C/D"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI Adapters Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes UI library-specific field configurations for Material, Bootstrap, PrimeNG, and Ionic.
|
|
5
|
-
*/
|
|
1
|
+
/** UI Adapters Resource */
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
3
|
export declare function registerUIAdaptersResource(server: McpServer): void;
|
|
8
4
|
//# sourceMappingURL=ui-adapters.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-adapters.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/ui-adapters.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ui-adapters.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/ui-adapters.resource.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmGlE"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validators Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes available ng-forge validators and their configurations.
|
|
5
|
-
*/
|
|
1
|
+
/** Validators Resource */
|
|
6
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
3
|
export declare function registerValidatorsResource(server: McpServer): void;
|
|
8
4
|
//# sourceMappingURL=validators.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/validators.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validators.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/validators.resource.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkIlE"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrappers Resource
|
|
3
|
-
*
|
|
4
|
-
* Exposes registered ng-forge wrappers (field decorators). Includes the built-in
|
|
5
|
-
* core wrappers plus demo wrappers shipped with the examples-shared-ui package.
|
|
6
|
-
*/
|
|
1
|
+
/** Wrappers Resource */
|
|
7
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
3
|
export declare function registerWrappersResource(server: McpServer): void;
|
|
9
4
|
//# sourceMappingURL=wrappers.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrappers.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/wrappers.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wrappers.resource.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/resources/wrappers.resource.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoHhE"}
|
package/src/server.d.ts
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Server for ng-forge dynamic forms
|
|
3
|
-
*
|
|
4
|
-
* Provides AI assistants with tools and resources for:
|
|
5
|
-
* - Field type discovery
|
|
6
|
-
* - Form schema generation
|
|
7
|
-
* - Validation configuration
|
|
8
|
-
* - Expression building
|
|
9
|
-
*/
|
|
1
|
+
/** MCP Server for ng-forge dynamic forms */
|
|
10
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
11
3
|
declare const SERVER_NAME = "ng-forge-mcp";
|
|
12
4
|
declare const SERVER_VERSION: string;
|
|
13
|
-
/**
|
|
14
|
-
* Create and configure the MCP server
|
|
15
|
-
*/
|
|
5
|
+
/** Create and configure the MCP server */
|
|
16
6
|
export declare function createServer(): McpServer;
|
|
17
|
-
/**
|
|
18
|
-
* Run the MCP server with stdio transport
|
|
19
|
-
*/
|
|
7
|
+
/** Run the MCP server with stdio transport */
|
|
20
8
|
export declare function runStdioServer(): Promise<void>;
|
|
21
9
|
export { SERVER_NAME, SERVER_VERSION };
|
|
22
10
|
//# sourceMappingURL=server.d.ts.map
|
package/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../packages/dynamic-form-mcp/src/server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../packages/dynamic-form-mcp/src/server.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,QAAA,MAAM,WAAW,iBAAiB,CAAC;AACnC,QAAA,MAAM,cAAc,QAAsB,CAAC;AAE3C,0CAA0C;AAC1C,wBAAgB,YAAY,IAAI,SAAS,CAaxC;AAED,8CAA8C;AAC9C,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAIpD;AAED,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Documentation Fetcher Service
|
|
3
|
-
*
|
|
4
|
-
* Fetches and caches live documentation from ng-forge.com.
|
|
5
|
-
* Uses native fetch (Node >=20) with in-memory caching and TTL.
|
|
6
|
-
*
|
|
7
|
-
* Fetches:
|
|
8
|
-
* - llms.txt: Documentation index
|
|
9
|
-
* - llms-full.txt: Full documentation content, parsed into sections
|
|
10
|
-
*/
|
|
1
|
+
/** Documentation Fetcher Service */
|
|
11
2
|
/**
|
|
12
3
|
* Fetch the llms.txt documentation index.
|
|
13
4
|
* Returns null if fetch fails.
|
|
@@ -23,12 +14,8 @@ export declare function fetchAllSections(): Promise<Map<string, string> | null>;
|
|
|
23
14
|
* Returns null if fetch fails or section not found.
|
|
24
15
|
*/
|
|
25
16
|
export declare function fetchDocSection(path: string): Promise<string | null>;
|
|
26
|
-
/**
|
|
27
|
-
* Clear all caches. Useful for testing or forcing a refresh.
|
|
28
|
-
*/
|
|
17
|
+
/** Clear all caches. Useful for testing or forcing a refresh. */
|
|
29
18
|
export declare function clearCache(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Set cache TTL in milliseconds.
|
|
32
|
-
*/
|
|
19
|
+
/** Set cache TTL in milliseconds. */
|
|
33
20
|
export declare function setCacheTtl(ttlMs: number): void;
|
|
34
21
|
//# sourceMappingURL=doc-fetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-fetcher.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/services/doc-fetcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"doc-fetcher.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/services/doc-fetcher.ts"],"names":[],"mappings":"AAAA,oCAAoC;AA8DpC;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAU5D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAa5E;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG1E;AAED,iEAAiE;AACjE,wBAAgB,UAAU,IAAI,IAAI,CAGjC;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE/C"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Topic-to-Section Mapper
|
|
3
|
-
*
|
|
4
|
-
* Maps MCP TOPICS keys to llms-full.txt section paths.
|
|
5
|
-
* Some topics map to multiple sections (concatenated when fetched).
|
|
6
|
-
* Topics with no website equivalent (MCP-specific patterns) return null.
|
|
7
|
-
*/
|
|
1
|
+
/** Topic-to-Section Mapper */
|
|
8
2
|
/**
|
|
9
3
|
* Get the section paths for a topic.
|
|
10
4
|
* Returns null for MCP-only topics (should use hardcoded fallback).
|
|
11
5
|
* Returns undefined for unknown topics.
|
|
12
6
|
*/
|
|
13
7
|
export declare function getTopicSections(topic: string): string[] | null | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Check if a topic is MCP-specific (no website equivalent).
|
|
16
|
-
*/
|
|
8
|
+
/** Check if a topic is MCP-specific (no website equivalent). */
|
|
17
9
|
export declare function isMcpOnlyTopic(topic: string): boolean;
|
|
18
10
|
//# sourceMappingURL=topic-mapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic-mapper.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/services/topic-mapper.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"topic-mapper.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/services/topic-mapper.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAkF9B;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAK3E;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Documentation content for the ngforge_lookup tool.
|
|
5
|
-
* Extracted from lookup.tool.ts for better maintainability.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Topic-specific documentation content.
|
|
9
|
-
*/
|
|
1
|
+
/** Lookup Topics Data */
|
|
2
|
+
/** Topic-specific documentation content. */
|
|
10
3
|
export declare const TOPICS: Record<string, {
|
|
11
4
|
brief: string;
|
|
12
5
|
full: string;
|
|
@@ -16,8 +9,6 @@ export declare const TOPICS: Record<string, {
|
|
|
16
9
|
* Used by the enhanced `list` output and the search tool.
|
|
17
10
|
*/
|
|
18
11
|
export declare const TOPIC_DESCRIPTIONS: Record<string, string>;
|
|
19
|
-
/**
|
|
20
|
-
* Topic aliases for flexible lookup.
|
|
21
|
-
*/
|
|
12
|
+
/** Topic aliases for flexible lookup. */
|
|
22
13
|
export declare const TOPIC_ALIASES: Record<string, string>;
|
|
23
14
|
//# sourceMappingURL=lookup-topics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lookup-topics.d.ts","sourceRoot":"","sources":["../../../../../../packages/dynamic-form-mcp/src/tools/data/lookup-topics.ts"],"names":[],"mappings":"AAAA,yBAAyB;AAEzB,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAq/ElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiDrD,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4IhD,CAAC"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified Examples Tool
|
|
3
|
-
*
|
|
4
|
-
* Consolidated working code patterns tool that absorbs:
|
|
5
|
-
* - get-example.tool.ts (complete and mega examples)
|
|
6
|
-
* - explain-feature.tool.ts (conceptual explanations)
|
|
7
|
-
*
|
|
8
|
-
* Single tool for "Show me how to do X"
|
|
9
|
-
*/
|
|
1
|
+
/** Unified Examples Tool */
|
|
10
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
11
|
-
/**
|
|
12
|
-
* Pattern definitions with minimal, brief, full, and explained content.
|
|
13
|
-
*/
|
|
3
|
+
/** Pattern definitions with minimal, brief, full, and explained content. */
|
|
14
4
|
export declare const PATTERNS: Record<string, {
|
|
15
5
|
description: string;
|
|
16
6
|
minimal: string;
|
|
@@ -18,13 +8,9 @@ export declare const PATTERNS: Record<string, {
|
|
|
18
8
|
full: string;
|
|
19
9
|
explained: string;
|
|
20
10
|
}>;
|
|
21
|
-
/**
|
|
22
|
-
* Complete multi-page form example.
|
|
23
|
-
*/
|
|
11
|
+
/** Complete multi-page form example. */
|
|
24
12
|
export declare const COMPLETE_EXAMPLE = "# Complete Multi-Page Form Example\n\nThis is a **complete, copy-pasteable** form configuration that demonstrates:\n- Multi-page navigation\n- Value derivation (computed fields - self-targeting)\n- Conditional visibility (using logic blocks - NO hideWhen/showWhen shorthand)\n- Validation (required, email, minLength)\n- Groups for nested data\n- Various field types\n\n```typescript\nimport { FormConfig } from '@ng-forge/dynamic-forms';\n\nconst formConfig = {\n fields: [\n // ========== PAGE 1: Personal Info ==========\n {\n key: 'personalInfo',\n type: 'page',\n fields: [\n { key: 'header1', type: 'text', label: 'Personal Information', props: { elementType: 'h2' } },\n {\n key: 'nameRow',\n type: 'row',\n fields: [\n { key: 'firstName', type: 'input', label: 'First Name', required: true, minLength: 2, col: 6 },\n { key: 'lastName', type: 'input', label: 'Last Name', required: true, minLength: 2, col: 6 }\n ]\n },\n {\n key: 'fullName',\n type: 'input',\n label: 'Full Name',\n readonly: true,\n // Shorthand derivation - no targetField needed, derivation is on the target field itself\n derivation: '(formValue.firstName || \"\") + \" \" + (formValue.lastName || \"\")'\n },\n { key: 'email', type: 'input', label: 'Email', required: true, email: true, props: { type: 'email' } },\n { key: 'next1', type: 'next', label: 'Continue' }\n ]\n },\n // ========== PAGE 2: Address ==========\n {\n key: 'addressPage',\n type: 'page',\n fields: [\n { key: 'header2', type: 'text', label: 'Address', props: { elementType: 'h2' } },\n {\n key: 'address',\n type: 'group',\n fields: [\n { key: 'street', type: 'input', label: 'Street', required: true },\n {\n key: 'cityRow',\n type: 'row',\n fields: [\n { key: 'city', type: 'input', label: 'City', required: true, col: 6 },\n {\n key: 'state',\n type: 'select',\n label: 'State',\n required: true,\n col: 6,\n options: [\n { label: 'California', value: 'CA' },\n { label: 'New York', value: 'NY' },\n { label: 'Texas', value: 'TX' }\n ]\n }\n ]\n }\n ]\n },\n {\n key: 'navRow2',\n type: 'row',\n fields: [\n { key: 'back2', type: 'previous', label: 'Back', col: 6 },\n { key: 'next2', type: 'next', label: 'Continue', col: 6 }\n ]\n }\n ]\n },\n // ========== PAGE 3: Preferences ==========\n {\n key: 'prefsPage',\n type: 'page',\n fields: [\n { key: 'header3', type: 'text', label: 'Preferences', props: { elementType: 'h2' } },\n {\n key: 'accountType',\n type: 'radio',\n label: 'Account Type',\n required: true,\n options: [\n { label: 'Personal', value: 'personal' },\n { label: 'Business', value: 'business' }\n ]\n },\n {\n key: 'companyName',\n type: 'input',\n label: 'Company Name',\n logic: [\n { type: 'hidden', condition: { type: 'fieldValue', fieldPath: 'accountType', operator: 'notEquals', value: 'business' } },\n { type: 'required', condition: { type: 'fieldValue', fieldPath: 'accountType', operator: 'equals', value: 'business' } }\n ]\n },\n { key: 'acceptTerms', type: 'checkbox', label: 'I accept the terms', required: true },\n {\n key: 'navRow3',\n type: 'row',\n fields: [\n { key: 'back3', type: 'previous', label: 'Back', col: 6 },\n { key: 'submitBtn', type: 'submit', label: 'Submit', col: 6 }\n ]\n }\n ]\n }\n ]\n} as const satisfies FormConfig;\n```\n\n## Form Output Shape\n\n```typescript\n{\n firstName: string;\n lastName: string;\n fullName: string; // Computed via derivation\n email: string;\n address: { // Nested from group\n street: string;\n city: string;\n state: string;\n };\n accountType: 'personal' | 'business';\n companyName?: string; // Only present when accountType is 'business'\n acceptTerms: boolean;\n}\n```";
|
|
25
|
-
/**
|
|
26
|
-
* Mega kitchen sink example (abbreviated - full version exists in get-example.tool.ts).
|
|
27
|
-
*/
|
|
13
|
+
/** Mega kitchen sink example (abbreviated - full version exists in get-example.tool.ts). */
|
|
28
14
|
export declare const MEGA_EXAMPLE = "# Kitchen Sink Mega Example\n\nThis example demonstrates **EVERY feature** of ng-forge dynamic forms.\n\n**NOTE:** This is a comprehensive reference. For getting started, use the `complete` pattern instead.\n\n```typescript\nimport { FormConfig } from '@ng-forge/dynamic-forms';\n\nconst megaFormConfig = {\n fields: [\n // ========== PAGE 1: All Field Types ==========\n {\n key: 'fieldTypesPage',\n type: 'page',\n fields: [\n { key: 'pageHeader', type: 'text', label: 'All Field Types Demo', props: { elementType: 'h1' } },\n\n // TEXT INPUTS\n { key: 'textInput', type: 'input', label: 'Text Input', placeholder: 'Type here' },\n { key: 'emailInput', type: 'input', label: 'Email', email: true, props: { type: 'email' } },\n { key: 'passwordInput', type: 'input', label: 'Password', minLength: 8, props: { type: 'password' } },\n { key: 'numberInput', type: 'input', label: 'Number', min: 0, max: 100, props: { type: 'number' } },\n\n // SELECT & OPTIONS\n {\n key: 'selectField',\n type: 'select',\n label: 'Select (single)',\n options: [\n { label: 'Option A', value: 'a' },\n { label: 'Option B', value: 'b' }\n ]\n },\n {\n key: 'radioField',\n type: 'radio',\n label: 'Radio Group',\n options: [\n { label: 'Yes', value: true },\n { label: 'No', value: false }\n ]\n },\n {\n key: 'multiCheckbox',\n type: 'multi-checkbox',\n label: 'Multi-Checkbox',\n options: [\n { label: 'Red', value: 'red' },\n { label: 'Green', value: 'green' },\n { label: 'Blue', value: 'blue' }\n ]\n },\n\n // BOOLEAN FIELDS\n { key: 'checkboxField', type: 'checkbox', label: 'Single Checkbox' },\n { key: 'toggleField', type: 'toggle', label: 'Toggle Switch' },\n\n // NUMERIC FIELDS\n { key: 'sliderField', type: 'slider', label: 'Slider', minValue: 0, maxValue: 100, step: 5, value: 50 },\n\n // DATE FIELDS\n { key: 'datepickerField', type: 'datepicker', label: 'Date Picker' },\n\n // TEXT AREA\n { key: 'textareaField', type: 'textarea', label: 'Textarea', props: { rows: 4 } },\n\n // HIDDEN\n { key: 'hiddenField', type: 'hidden', value: 'secret-value' },\n\n { key: 'toLogicPage', type: 'next', label: 'Next: Logic Demo' }\n ]\n },\n\n // ========== PAGE 2: Logic Types ==========\n {\n key: 'logicPage',\n type: 'page',\n fields: [\n { key: 'logicHeader', type: 'text', label: 'Logic Types Demo', props: { elementType: 'h1' } },\n\n // DERIVATION\n {\n key: 'sourceA',\n type: 'input',\n label: 'Source A',\n value: '10'\n },\n {\n key: 'sourceB',\n type: 'input',\n label: 'Source B',\n value: '20'\n },\n {\n key: 'derived',\n type: 'input',\n label: 'Derived (A + B)',\n readonly: true,\n // Self-targeting derivation - no targetField needed\n derivation: 'parseInt(formValue.sourceA || 0) + parseInt(formValue.sourceB || 0)'\n },\n\n // CONDITIONAL VISIBILITY\n {\n key: 'showExtra',\n type: 'checkbox',\n label: 'Show extra field'\n },\n {\n key: 'extraField',\n type: 'input',\n label: 'Extra Field',\n logic: [{\n type: 'hidden',\n condition: { type: 'fieldValue', fieldPath: 'showExtra', operator: 'notEquals', value: true }\n }]\n },\n\n // CONDITIONAL REQUIRED\n {\n key: 'makeRequired',\n type: 'checkbox',\n label: 'Make field required'\n },\n {\n key: 'conditionalRequired',\n type: 'input',\n label: 'Conditionally Required',\n logic: [{\n type: 'required',\n condition: { type: 'fieldValue', fieldPath: 'makeRequired', operator: 'equals', value: true }\n }]\n },\n\n {\n key: 'logicNav',\n type: 'row',\n fields: [\n { key: 'backToFields', type: 'previous', label: 'Back', col: 6 },\n { key: 'toContainers', type: 'next', label: 'Next: Containers', col: 6 }\n ]\n }\n ]\n },\n\n // ========== PAGE 3: Containers ==========\n {\n key: 'containersPage',\n type: 'page',\n fields: [\n { key: 'containersHeader', type: 'text', label: 'Containers Demo', props: { elementType: 'h1' } },\n\n // ROW\n {\n key: 'demoRow',\n type: 'row',\n fields: [\n { key: 'col4', type: 'input', label: 'Col 4', col: 4 },\n { key: 'col4b', type: 'input', label: 'Col 4', col: 4 },\n { key: 'col4c', type: 'input', label: 'Col 4', col: 4 }\n ]\n },\n\n // GROUP\n {\n key: 'demoGroup',\n type: 'group',\n fields: [\n { key: 'groupText', type: 'text', label: 'Nested Group:', props: { elementType: 'h3' } },\n { key: 'nestedField1', type: 'input', label: 'Nested Field 1' },\n { key: 'nestedField2', type: 'input', label: 'Nested Field 2' }\n ]\n },\n\n // ARRAY (Simplified API - recommended)\n {\n key: 'itemsHeader', type: 'text', label: 'Dynamic Array:', props: { elementType: 'h3' }\n },\n {\n key: 'demoArray',\n type: 'array',\n template: [\n { key: 'itemName', type: 'input', label: 'Item Name' },\n { key: 'itemQty', type: 'input', label: 'Qty', props: { type: 'number' } }\n ],\n value: [{ itemName: 'Widget', itemQty: '5' }],\n addButton: { label: 'Add Item' }\n },\n\n {\n key: 'containersNav',\n type: 'row',\n fields: [\n { key: 'backToLogic', type: 'previous', label: 'Back', col: 6 },\n { key: 'submitFinal', type: 'submit', label: 'Submit', col: 6 }\n ]\n }\n ]\n }\n ]\n} as const satisfies FormConfig;\n```\n\n## Features Demonstrated\n\n- **All field types:** input, select, radio, checkbox, multi-checkbox, textarea, toggle, slider, datepicker, text, hidden\n- **All container types:** page, row, group, array\n- **All button types:** submit, next, previous, auto-generated add/remove (simplified array)\n- **Logic types:** hidden, required, derivation\n- **Condition types:** fieldValue with operators\n- **Layout:** col property for grid widths";
|
|
29
15
|
export declare function registerExamplesTool(server: McpServer): void;
|
|
30
16
|
//# sourceMappingURL=examples.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examples.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/examples.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"examples.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/examples.tool.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,EAAE,MAAM,CAC3B,MAAM,EACN;IACE,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CA+sDF,CAAC;AA6JF,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,4/IA4ItB,CAAC;AAER,4FAA4F;AAC5F,eAAO,MAAM,YAAY,yqNAmNkB,CAAC;AAoC5C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+G5D"}
|
package/src/tools/index.d.ts
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tools Registration
|
|
3
|
-
*
|
|
4
|
-
* Registers all available tools with the MCP server.
|
|
5
|
-
*
|
|
6
|
-
* 5 tools with zero overlap, each serving a single clear purpose:
|
|
7
|
-
*
|
|
8
|
-
* | Tool | Purpose | One-liner |
|
|
9
|
-
* |-------------------|----------------|-------------------------|
|
|
10
|
-
* | ngforge_lookup | Documentation | "Tell me about X" |
|
|
11
|
-
* | ngforge_examples | Working code | "Show me how to do X" |
|
|
12
|
-
* | ngforge_validate | Verification | "Is my config correct?" |
|
|
13
|
-
* | ngforge_scaffold | Generation | "Generate a skeleton" |
|
|
14
|
-
* | ngforge_search | Discovery | "Find topics about X" |
|
|
15
|
-
*
|
|
16
|
-
* RECOMMENDED WORKFLOW:
|
|
17
|
-
* 1. ngforge_lookup topic="workflow" - START HERE: tool usage guide
|
|
18
|
-
* 2. ngforge_search query="your question" - Find relevant topics by keyword
|
|
19
|
-
* 3. ngforge_lookup topic="golden-path" - Get form structure templates
|
|
20
|
-
* 4. ngforge_lookup topic="<field-type>" - Get syntax for specific fields
|
|
21
|
-
* 5. ngforge_validate - Validate your config (catches all errors)
|
|
22
|
-
*
|
|
23
|
-
* For working code examples:
|
|
24
|
-
* - ngforge_examples pattern="complete" - Full multi-page form
|
|
25
|
-
* - ngforge_examples pattern="minimal-conditional" - Minimal conditional example
|
|
26
|
-
*
|
|
27
|
-
* For generating skeletons:
|
|
28
|
-
* - ngforge_scaffold pages=2 arrays=["contacts"] groups=["address"]
|
|
29
|
-
*/
|
|
1
|
+
/** MCP Tools Registration */
|
|
30
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
31
|
-
/**
|
|
32
|
-
* Register all MCP tools (5 total)
|
|
33
|
-
*/
|
|
3
|
+
/** Register all MCP tools (5 total) */
|
|
34
4
|
export declare function registerTools(server: McpServer): void;
|
|
35
5
|
//# sourceMappingURL=index.d.ts.map
|
package/src/tools/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAerD"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified Lookup Tool
|
|
3
|
-
*
|
|
4
|
-
* Consolidated documentation tool that absorbs:
|
|
5
|
-
* - quick-lookup.tool.ts (primary content source)
|
|
6
|
-
* - get-field-info.tool.ts (field documentation + placement rules)
|
|
7
|
-
* - get-api-reference.tool.ts (logic-matrix, context-api content)
|
|
8
|
-
* - get-cheatsheet.tool.ts (comprehensive reference)
|
|
9
|
-
* - get-field-schema.tool.ts (JSON schema for depth=schema)
|
|
10
|
-
*
|
|
11
|
-
* Single tool for "Tell me about X"
|
|
12
|
-
*/
|
|
1
|
+
/** Unified Lookup Tool */
|
|
13
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
3
|
export declare function registerLookupTool(server: McpServer): void;
|
|
15
4
|
//# sourceMappingURL=lookup.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/lookup.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lookup.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/lookup.tool.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkmBpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6F1D"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scaffold Tool (NEW)
|
|
3
|
-
*
|
|
4
|
-
* Generates valid FormConfig skeletons based on parameters.
|
|
5
|
-
* Produces copy-paste ready code with proper structure.
|
|
6
|
-
*
|
|
7
|
-
* Single tool for "Generate a skeleton for X"
|
|
8
|
-
*/
|
|
1
|
+
/** Scaffold Tool (NEW) */
|
|
9
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
3
|
export declare function registerScaffoldTool(server: McpServer): void;
|
|
11
4
|
//# sourceMappingURL=scaffold.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/scaffold.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"scaffold.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/scaffold.tool.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsUpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8E5D"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified Search Tool
|
|
3
|
-
*
|
|
4
|
-
* Free-text keyword search across all TOPICS and PATTERNS.
|
|
5
|
-
* Bridges the discoverability gap — find content without knowing exact topic names.
|
|
6
|
-
*/
|
|
1
|
+
/** Unified Search Tool */
|
|
7
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
3
|
export declare function registerSearchTool(server: McpServer): void;
|
|
9
4
|
//# sourceMappingURL=search.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/search.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"search.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/search.tool.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA8LpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiD1D"}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified Validation Tool
|
|
3
|
-
*
|
|
4
|
-
* Consolidated validation tool that absorbs:
|
|
5
|
-
* - validate-file.tool.ts (TypeScript file validation with AST extraction)
|
|
6
|
-
* - validate-form-config.tool.ts (JSON config validation)
|
|
7
|
-
* - validate-field.tool.ts (single field validation)
|
|
8
|
-
*
|
|
9
|
-
* Single tool for "Is my config correct?"
|
|
10
|
-
* Auto-detects if config is a file path or JSON object.
|
|
11
|
-
*/
|
|
1
|
+
/** Unified Validation Tool */
|
|
12
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
3
|
export declare function registerValidateTool(server: McpServer): void;
|
|
14
4
|
//# sourceMappingURL=validate.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/validate.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validate.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/validate.tool.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA+TpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2J5D"}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AST Extractor Utility
|
|
3
|
-
*
|
|
4
|
-
* Uses ts-morph for robust TypeScript parsing to extract FormConfig objects.
|
|
5
|
-
* Handles complex patterns that regex + new Function() cannot:
|
|
6
|
-
* - new Date() constructors
|
|
7
|
-
* - Function references and arrow functions
|
|
8
|
-
* - Regex literals
|
|
9
|
-
* - External variable references
|
|
10
|
-
* - Method calls like Math.floor()
|
|
11
|
-
*/
|
|
1
|
+
/** AST Extractor Utility */
|
|
12
2
|
/**
|
|
13
3
|
* Placeholder date used when encountering `new Date()` expressions.
|
|
14
4
|
* Since dates are runtime values, we substitute a fixed ISO string for validation.
|
|
@@ -20,9 +10,7 @@ export declare const DATE_PLACEHOLDER = "2024-01-01T00:00:00.000Z";
|
|
|
20
10
|
*/
|
|
21
11
|
export declare const MAX_SOURCE_TEXT_LENGTH = 50;
|
|
22
12
|
import { SourceFile, Node, ObjectLiteralExpression } from 'ts-morph';
|
|
23
|
-
/**
|
|
24
|
-
* A candidate FormConfig object found in the source file.
|
|
25
|
-
*/
|
|
13
|
+
/** A candidate FormConfig object found in the source file. */
|
|
26
14
|
export interface FormConfigCandidate {
|
|
27
15
|
/** Variable or property name */
|
|
28
16
|
name: string;
|
|
@@ -33,9 +21,7 @@ export interface FormConfigCandidate {
|
|
|
33
21
|
/** How this candidate was detected */
|
|
34
22
|
matchReason: 'type-annotation' | 'satisfies' | 'as-cast' | 'structural';
|
|
35
23
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Warning about a non-serializable value that was replaced with a placeholder.
|
|
38
|
-
*/
|
|
24
|
+
/** Warning about a non-serializable value that was replaced with a placeholder. */
|
|
39
25
|
export interface ExtractionWarning {
|
|
40
26
|
/** Path to the property, e.g., "fields[0].props.maxDate" */
|
|
41
27
|
path: string;
|
|
@@ -46,18 +32,14 @@ export interface ExtractionWarning {
|
|
|
46
32
|
/** What was substituted */
|
|
47
33
|
placeholder: string | number | boolean | null;
|
|
48
34
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Error that occurred during extraction.
|
|
51
|
-
*/
|
|
35
|
+
/** Error that occurred during extraction. */
|
|
52
36
|
export interface ExtractionError {
|
|
53
37
|
/** Path to the property */
|
|
54
38
|
path: string;
|
|
55
39
|
/** Error message */
|
|
56
40
|
message: string;
|
|
57
41
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Result of extracting an AST node to JSON.
|
|
60
|
-
*/
|
|
42
|
+
/** Result of extracting an AST node to JSON. */
|
|
61
43
|
export interface ExtractionResult {
|
|
62
44
|
/** The extracted JSON-safe object */
|
|
63
45
|
value: unknown;
|
|
@@ -66,19 +48,9 @@ export interface ExtractionResult {
|
|
|
66
48
|
/** Fatal issues (couldn't extract) */
|
|
67
49
|
errors: ExtractionError[];
|
|
68
50
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Create a ts-morph Project and parse source code.
|
|
71
|
-
*/
|
|
51
|
+
/** Create a ts-morph Project and parse source code. */
|
|
72
52
|
export declare function createSourceFile(source: string, fileName?: string): SourceFile;
|
|
73
|
-
/**
|
|
74
|
-
* Find all potential FormConfig objects in a source file.
|
|
75
|
-
*
|
|
76
|
-
* Uses multiple detection strategies (in order of precedence):
|
|
77
|
-
* 1. Type annotation: `const x: FormConfig = {...}` or `const x: SomeFormConfig = {...}`
|
|
78
|
-
* 2. Satisfies: `const x = {...} satisfies FormConfig` or `{...} as const satisfies SomeConfig`
|
|
79
|
-
* 3. As cast: `const x = {...} as FormConfig`
|
|
80
|
-
* 4. Structural: Any object with `fields` array containing form-like objects
|
|
81
|
-
*/
|
|
53
|
+
/** Find all potential FormConfig objects in a source file. */
|
|
82
54
|
export declare function findFormConfigCandidates(sourceFile: SourceFile): FormConfigCandidate[];
|
|
83
55
|
/**
|
|
84
56
|
* Extract an AST node to a JSON-safe object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-extractor.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/utils/ast-extractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ast-extractor.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/utils/ast-extractor.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,OAAO,EAEL,UAAU,EACV,IAAI,EACJ,uBAAuB,EAKxB,MAAM,UAAU,CAAC;AAElB,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,aAAa,EAAE,uBAAuB,CAAC;IACvC,sCAAsC;IACtC,WAAW,EAAE,iBAAiB,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;CACzE;AAED,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC/C;AAED,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,sCAAsC;IACtC,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,SAAY,GAAG,UAAU,CAGjF;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAuFtF;AA8GD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,SAAK,GAAG,gBAAgB,CAOrE"}
|