@ng-forge/dynamic-form-mcp 0.9.0 → 0.10.0-next.2
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.js +32 -0
- package/package.json +6 -6
- package/src/index.js +32 -0
- package/src/tools/examples.tool.d.ts.map +1 -1
package/bin/ng-forge-mcp.js
CHANGED
|
@@ -11813,6 +11813,38 @@ logic: [{
|
|
|
11813
11813
|
}]
|
|
11814
11814
|
\`\`\`
|
|
11815
11815
|
|
|
11816
|
+
## Async Sources (HTTP / async functions)
|
|
11817
|
+
|
|
11818
|
+
Property derivations also support \`source: 'http'\` and \`source: 'asyncFunction'\` for server-driven property values \u2014 typically to populate a select's \`options\` from a backend endpoint.
|
|
11819
|
+
|
|
11820
|
+
\`\`\`typescript
|
|
11821
|
+
// HTTP-driven options
|
|
11822
|
+
logic: [{
|
|
11823
|
+
type: 'derivation',
|
|
11824
|
+
source: 'http',
|
|
11825
|
+
targetProperty: 'options',
|
|
11826
|
+
http: {
|
|
11827
|
+
url: '/api/streets/search',
|
|
11828
|
+
queryParams: { q: 'formValue.street' },
|
|
11829
|
+
},
|
|
11830
|
+
responseExpression: 'response.map(d => ({ value: d.id, label: d.name }))',
|
|
11831
|
+
dependsOn: ['street'], // required for HTTP
|
|
11832
|
+
trigger: 'debounced',
|
|
11833
|
+
debounceMs: 300,
|
|
11834
|
+
}]
|
|
11835
|
+
|
|
11836
|
+
// Async-function-driven options
|
|
11837
|
+
logic: [{
|
|
11838
|
+
type: 'derivation',
|
|
11839
|
+
source: 'asyncFunction',
|
|
11840
|
+
targetProperty: 'options',
|
|
11841
|
+
asyncFunctionName: 'fetchCities',
|
|
11842
|
+
dependsOn: ['country'], // required for asyncFunction
|
|
11843
|
+
}]
|
|
11844
|
+
\`\`\`
|
|
11845
|
+
|
|
11846
|
+
\`dependsOn\` is required (non-empty, no \`'*'\` wildcards) for both HTTP and asyncFunction sources \u2014 the collector throws otherwise to prevent runaway requests.
|
|
11847
|
+
|
|
11816
11848
|
## Array Field Support
|
|
11817
11849
|
|
|
11818
11850
|
Inside arrays, \`formValue\` is scoped to the current array item:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/dynamic-form-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-next.2",
|
|
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.
|
|
55
|
-
"@ng-forge/dynamic-forms-bootstrap": "^0.
|
|
56
|
-
"@ng-forge/dynamic-forms-ionic": "^0.
|
|
57
|
-
"@ng-forge/dynamic-forms-material": "^0.
|
|
58
|
-
"@ng-forge/dynamic-forms-primeng": "^0.
|
|
54
|
+
"@ng-forge/dynamic-forms": "^0.10.0-next.2",
|
|
55
|
+
"@ng-forge/dynamic-forms-bootstrap": "^0.10.0-next.2",
|
|
56
|
+
"@ng-forge/dynamic-forms-ionic": "^0.10.0-next.2",
|
|
57
|
+
"@ng-forge/dynamic-forms-material": "^0.10.0-next.2",
|
|
58
|
+
"@ng-forge/dynamic-forms-primeng": "^0.10.0-next.2",
|
|
59
59
|
"tsx": "^4.19.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/src/index.js
CHANGED
|
@@ -11890,6 +11890,38 @@ logic: [{
|
|
|
11890
11890
|
}]
|
|
11891
11891
|
\`\`\`
|
|
11892
11892
|
|
|
11893
|
+
## Async Sources (HTTP / async functions)
|
|
11894
|
+
|
|
11895
|
+
Property derivations also support \`source: 'http'\` and \`source: 'asyncFunction'\` for server-driven property values \u2014 typically to populate a select's \`options\` from a backend endpoint.
|
|
11896
|
+
|
|
11897
|
+
\`\`\`typescript
|
|
11898
|
+
// HTTP-driven options
|
|
11899
|
+
logic: [{
|
|
11900
|
+
type: 'derivation',
|
|
11901
|
+
source: 'http',
|
|
11902
|
+
targetProperty: 'options',
|
|
11903
|
+
http: {
|
|
11904
|
+
url: '/api/streets/search',
|
|
11905
|
+
queryParams: { q: 'formValue.street' },
|
|
11906
|
+
},
|
|
11907
|
+
responseExpression: 'response.map(d => ({ value: d.id, label: d.name }))',
|
|
11908
|
+
dependsOn: ['street'], // required for HTTP
|
|
11909
|
+
trigger: 'debounced',
|
|
11910
|
+
debounceMs: 300,
|
|
11911
|
+
}]
|
|
11912
|
+
|
|
11913
|
+
// Async-function-driven options
|
|
11914
|
+
logic: [{
|
|
11915
|
+
type: 'derivation',
|
|
11916
|
+
source: 'asyncFunction',
|
|
11917
|
+
targetProperty: 'options',
|
|
11918
|
+
asyncFunctionName: 'fetchCities',
|
|
11919
|
+
dependsOn: ['country'], // required for asyncFunction
|
|
11920
|
+
}]
|
|
11921
|
+
\`\`\`
|
|
11922
|
+
|
|
11923
|
+
\`dependsOn\` is required (non-empty, no \`'*'\` wildcards) for both HTTP and asyncFunction sources \u2014 the collector throws otherwise to prevent runaway requests.
|
|
11924
|
+
|
|
11893
11925
|
## Array Field Support
|
|
11894
11926
|
|
|
11895
11927
|
Inside arrays, \`formValue\` is scoped to the current array item:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examples.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/examples.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE;;GAEG;AACH,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+
|
|
1
|
+
{"version":3,"file":"examples.tool.d.ts","sourceRoot":"","sources":["../../../../../packages/dynamic-form-mcp/src/tools/examples.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE;;GAEG;AACH,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;;GAEG;AACH,eAAO,MAAM,gBAAgB,4/IA4ItB,CAAC;AAER;;GAEG;AACH,eAAO,MAAM,YAAY,yqNAmNkB,CAAC;AAoC5C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+G5D"}
|