d365fo-mcp 1.23.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/.github/copilot-instructions.md +11 -1
  2. package/README.md +243 -56
  3. package/dist/bridge/bridgeAdapter.d.ts +6 -1
  4. package/dist/bridge/bridgeAdapter.js +40 -13
  5. package/dist/bridge/bridgeClient.d.ts +1 -1
  6. package/dist/bridge/bridgeClient.js +11 -7
  7. package/dist/bridge/lineReader.d.ts +36 -0
  8. package/dist/bridge/lineReader.js +78 -0
  9. package/dist/cli/commands/doctor.d.ts +5 -0
  10. package/dist/cli/commands/doctor.js +15 -0
  11. package/dist/cli/commands/indexCmd.d.ts +15 -0
  12. package/dist/cli/commands/indexCmd.js +34 -1
  13. package/dist/cli/commands/session.d.ts +10 -0
  14. package/dist/cli/commands/session.js +97 -15
  15. package/dist/cli/commands/setup.js +2 -0
  16. package/dist/cli/index.js +3 -1
  17. package/dist/cli/session/analyze.d.ts +47 -4
  18. package/dist/cli/session/analyze.js +136 -32
  19. package/dist/cli/session/claudeCodeLog.d.ts +4 -0
  20. package/dist/cli/session/claudeCodeLog.js +228 -0
  21. package/dist/cli/session/copilotChatLog.js +1 -0
  22. package/dist/cli/session/sessionLog.d.ts +39 -5
  23. package/dist/cli/session/sessionLog.js +11 -7
  24. package/dist/config/settings.js +100 -4
  25. package/dist/index.js +1 -1
  26. package/dist/knowledge/formPatterns/catalog/subPatterns/customFilters.js +2 -2
  27. package/dist/knowledge/formPatterns/catalog/subPatterns/fields.js +13 -11
  28. package/dist/knowledge/formPatterns/catalog/subPatterns/toolbar.js +6 -6
  29. package/dist/knowledge/formPatterns/catalog/subPatterns/workspaceSections.d.ts +4 -3
  30. package/dist/knowledge/formPatterns/catalog/subPatterns/workspaceSections.js +14 -13
  31. package/dist/knowledge/formPatterns/catalog/topLevel/detailsMaster.js +2 -2
  32. package/dist/knowledge/formPatterns/catalog/topLevel/detailsTransaction.js +1 -1
  33. package/dist/knowledge/formPatterns/catalog/topLevel/dialog.js +7 -7
  34. package/dist/knowledge/formPatterns/catalog/topLevel/factBox.js +2 -2
  35. package/dist/knowledge/formPatterns/catalog/topLevel/listPage.js +1 -1
  36. package/dist/knowledge/formPatterns/catalog/topLevel/lookup.d.ts +0 -1
  37. package/dist/knowledge/formPatterns/catalog/topLevel/lookup.js +8 -20
  38. package/dist/knowledge/formPatterns/catalog/topLevel/simpleDetails.js +4 -4
  39. package/dist/knowledge/formPatterns/catalog/topLevel/simpleList.js +3 -2
  40. package/dist/knowledge/formPatterns/catalog/topLevel/simpleListDetails.js +2 -2
  41. package/dist/knowledge/formPatterns/catalog/topLevel/tableOfContents.js +1 -1
  42. package/dist/knowledge/formPatterns/catalog/topLevel/task.js +57 -12
  43. package/dist/knowledge/formPatterns/catalog/topLevel/wizard.js +1 -1
  44. package/dist/knowledge/formPatterns/index.js +1 -4
  45. package/dist/knowledge/formPatterns/platform.d.ts +87 -0
  46. package/dist/knowledge/formPatterns/platform.generated.d.ts +14 -0
  47. package/dist/knowledge/formPatterns/platform.generated.js +176 -0
  48. package/dist/knowledge/formPatterns/platform.js +149 -0
  49. package/dist/knowledge/formPatterns/platformDefaults.generated.d.ts +13 -0
  50. package/dist/knowledge/formPatterns/platformDefaults.generated.js +54 -0
  51. package/dist/metadata/binaryModelImport.d.ts +231 -0
  52. package/dist/metadata/binaryModelImport.js +360 -0
  53. package/dist/metadata/formPatternMiner.d.ts +6 -0
  54. package/dist/metadata/formPatternMiner.js +38 -11
  55. package/dist/metadata/labelParser.d.ts +12 -0
  56. package/dist/metadata/labelParser.js +27 -7
  57. package/dist/metadata/modelDescriptor.d.ts +31 -2
  58. package/dist/metadata/modelDescriptor.js +91 -20
  59. package/dist/metadata/modelInventory.d.ts +169 -0
  60. package/dist/metadata/modelInventory.js +494 -0
  61. package/dist/metadata/objectSourceSetting.d.ts +9 -0
  62. package/dist/metadata/objectSourceSetting.js +11 -0
  63. package/dist/metadata/startupIndexing.d.ts +2 -0
  64. package/dist/metadata/startupIndexing.js +30 -7
  65. package/dist/metadata/symbolIndex.d.ts +115 -19
  66. package/dist/metadata/symbolIndex.js +256 -83
  67. package/dist/metadata/xppDeclaration.d.ts +10 -0
  68. package/dist/metadata/xppDeclaration.js +1 -1
  69. package/dist/prompts/systemInstructions.js +13 -2
  70. package/dist/scripts/build-database.js +712 -230
  71. package/dist/scripts/build-fts.js +356 -89
  72. package/dist/scripts/extract-metadata.js +168 -18
  73. package/dist/scripts/startupIndexWorker.js +1399 -164
  74. package/dist/server/toolAnnotations.d.ts +4 -3
  75. package/dist/server/toolAnnotations.js +9 -6
  76. package/dist/server/toolSchemas/buildD365foProject.d.ts +9 -0
  77. package/dist/server/toolSchemas/buildD365foProject.js +13 -4
  78. package/dist/server/toolSchemas/d365foFile.js +5 -5
  79. package/dist/server/toolSchemas/getObjectInfo.d.ts +1 -1
  80. package/dist/server/toolSchemas/getObjectInfo.js +1 -1
  81. package/dist/server/toolSchemas/index.d.ts +5 -1
  82. package/dist/server/toolSchemas/labels.js +3 -3
  83. package/dist/server/toolSchemas/objectPatterns.js +1 -1
  84. package/dist/server/toolSchemas/runBpCheck.js +3 -3
  85. package/dist/server/toolSchemas/runSystestClass.js +2 -2
  86. package/dist/server/toolSchemas/search.js +1 -1
  87. package/dist/tools/analysis/analyzeCompleteness.js +11 -2
  88. package/dist/tools/analysis/entityXmlRules.d.ts +12 -0
  89. package/dist/tools/analysis/entityXmlRules.js +98 -0
  90. package/dist/tools/analysis/extensionSearch.d.ts +1 -1
  91. package/dist/tools/analysis/extensionSearch.js +5 -5
  92. package/dist/tools/analysis/findReferences.d.ts +22 -0
  93. package/dist/tools/analysis/findReferences.js +46 -8
  94. package/dist/tools/analysis/search.js +27 -16
  95. package/dist/tools/analysis/testClassContext.d.ts +37 -0
  96. package/dist/tools/analysis/testClassContext.js +64 -0
  97. package/dist/tools/analysis/validateFormPattern.d.ts +1 -1
  98. package/dist/tools/analysis/validateFormPattern.js +1 -1
  99. package/dist/tools/analysis/validateXpp.d.ts +6 -1
  100. package/dist/tools/analysis/validateXpp.js +24 -1
  101. package/dist/tools/d365foFile.js +68 -12
  102. package/dist/tools/generateObject.d.ts +1 -4
  103. package/dist/tools/generateObject.js +22 -1
  104. package/dist/tools/knowledge/analyzeExtensionPoints.js +5 -5
  105. package/dist/tools/knowledge/findCocExtensions.js +36 -5
  106. package/dist/tools/knowledge/findEventHandlers.js +3 -2
  107. package/dist/tools/knowledge/formPattern.d.ts +1 -1
  108. package/dist/tools/knowledge/formPattern.js +1 -1
  109. package/dist/tools/knowledge/methodSignature.js +7 -1
  110. package/dist/tools/knowledge/xppKnowledge.js +68 -7
  111. package/dist/tools/labels.d.ts +1 -1
  112. package/dist/tools/labels.js +6 -3
  113. package/dist/tools/readers/classInfo.js +16 -5
  114. package/dist/tools/readers/edtInfo.js +30 -7
  115. package/dist/tools/readers/enumInfo.js +22 -4
  116. package/dist/tools/readers/formInfo.js +3 -1
  117. package/dist/tools/readers/getLabelInfo.js +44 -3
  118. package/dist/tools/readers/getObjectInfo.js +2 -2
  119. package/dist/tools/readers/getWorkspaceInfo.js +18 -0
  120. package/dist/tools/readers/menuInfo.d.ts +42 -0
  121. package/dist/tools/readers/menuInfo.js +270 -0
  122. package/dist/tools/readers/modelInfo.d.ts +29 -0
  123. package/dist/tools/readers/modelInfo.js +184 -0
  124. package/dist/tools/readers/objectInfoRegistry.d.ts +1 -1
  125. package/dist/tools/readers/objectInfoRegistry.js +9 -2
  126. package/dist/tools/readers/objectXml.d.ts +9 -1
  127. package/dist/tools/readers/objectXml.js +48 -4
  128. package/dist/tools/readers/tableInfo.js +70 -5
  129. package/dist/tools/sdlc/bpChangedSince.d.ts +36 -0
  130. package/dist/tools/sdlc/bpChangedSince.js +132 -0
  131. package/dist/tools/sdlc/bpPipelineParity.d.ts +147 -0
  132. package/dist/tools/sdlc/bpPipelineParity.js +477 -0
  133. package/dist/tools/sdlc/buildProject.d.ts +37 -2
  134. package/dist/tools/sdlc/buildProject.js +583 -90
  135. package/dist/tools/sdlc/dbSync.d.ts +1 -0
  136. package/dist/tools/sdlc/dbSync.js +3 -0
  137. package/dist/tools/sdlc/formPatternGuard.d.ts +33 -0
  138. package/dist/tools/sdlc/formPatternGuard.js +73 -0
  139. package/dist/tools/sdlc/odataActionGuard.d.ts +2 -0
  140. package/dist/tools/sdlc/odataActionGuard.js +1 -1
  141. package/dist/tools/sdlc/runBpCheck.d.ts +5 -0
  142. package/dist/tools/sdlc/runBpCheck.js +113 -9
  143. package/dist/tools/sdlc/schemaChangeGuard.d.ts +26 -0
  144. package/dist/tools/sdlc/schemaChangeGuard.js +170 -0
  145. package/dist/tools/sdlc/sysTestRunner.d.ts +19 -8
  146. package/dist/tools/sdlc/sysTestRunner.js +335 -11
  147. package/dist/tools/sdlc/trace/contract.js +2 -1
  148. package/dist/tools/sdlc/udeDeploy.d.ts +102 -0
  149. package/dist/tools/sdlc/udeDeploy.js +492 -0
  150. package/dist/tools/sdlc/udeDeployPowerShell.d.ts +38 -0
  151. package/dist/tools/sdlc/udeDeployPowerShell.js +238 -0
  152. package/dist/tools/sdlc/udeEnvironmentStatus.d.ts +17 -0
  153. package/dist/tools/sdlc/udeEnvironmentStatus.js +118 -0
  154. package/dist/tools/sdlc/udeSyncScope.d.ts +15 -0
  155. package/dist/tools/sdlc/udeSyncScope.js +108 -0
  156. package/dist/tools/sdlc/udeSysTest.d.ts +121 -0
  157. package/dist/tools/sdlc/udeSysTest.js +408 -0
  158. package/dist/tools/sdlc/undoLastModification.js +30 -7
  159. package/dist/tools/sdlc/updateSymbolIndex.d.ts +11 -0
  160. package/dist/tools/sdlc/updateSymbolIndex.js +12 -1
  161. package/dist/tools/smart/codeGen.js +89 -47
  162. package/dist/tools/smart/generateSmartReport.d.ts +6 -0
  163. package/dist/tools/smart/generateSmartReport.js +33 -2
  164. package/dist/tools/smart/generateSmartTable.js +38 -24
  165. package/dist/tools/specs/d365foFileOpSpecs.d.ts +1 -0
  166. package/dist/tools/specs/d365foFileOpSpecs.js +267 -57
  167. package/dist/tools/specs/generateObjectOpSpecs.js +3 -0
  168. package/dist/tools/specs/labelsOpSpecs.js +21 -6
  169. package/dist/tools/specs/opSpecs.js +60 -2
  170. package/dist/tools/write/createD365File.d.ts +2 -0
  171. package/dist/tools/write/createD365File.js +184 -189
  172. package/dist/tools/write/createLabel.d.ts +8 -1
  173. package/dist/tools/write/createLabel.js +202 -32
  174. package/dist/tools/write/createObjectName.d.ts +52 -0
  175. package/dist/tools/write/createObjectName.js +110 -0
  176. package/dist/tools/write/createProject.js +5 -2
  177. package/dist/tools/write/dataEntityOps.d.ts +14 -1
  178. package/dist/tools/write/dataEntityOps.js +129 -3
  179. package/dist/tools/write/deleteD365File.js +2 -1
  180. package/dist/tools/write/deleteLabel.d.ts +36 -0
  181. package/dist/tools/write/deleteLabel.js +344 -0
  182. package/dist/tools/write/directXmlWriters.d.ts +168 -2
  183. package/dist/tools/write/directXmlWriters.js +573 -57
  184. package/dist/tools/write/extensionTargets.d.ts +108 -0
  185. package/dist/tools/write/extensionTargets.js +430 -0
  186. package/dist/tools/write/fieldTypeProvisioning.d.ts +78 -0
  187. package/dist/tools/write/fieldTypeProvisioning.js +304 -0
  188. package/dist/tools/write/formStructureOps.d.ts +28 -0
  189. package/dist/tools/write/formStructureOps.js +53 -0
  190. package/dist/tools/write/inlineIndexUpsert.js +4 -1
  191. package/dist/tools/write/inlineWriteVerification.d.ts +119 -2
  192. package/dist/tools/write/inlineWriteVerification.js +368 -8
  193. package/dist/tools/write/intrinsicMembers.d.ts +35 -0
  194. package/dist/tools/write/intrinsicMembers.js +162 -0
  195. package/dist/tools/write/methodXmlFallback.js +9 -1
  196. package/dist/tools/write/modelDependencyResolver.d.ts +16 -0
  197. package/dist/tools/write/modelDependencyResolver.js +34 -0
  198. package/dist/tools/write/modelLifecycle.d.ts +68 -0
  199. package/dist/tools/write/modelLifecycle.js +769 -0
  200. package/dist/tools/write/modifyD365File.d.ts +30 -0
  201. package/dist/tools/write/modifyD365File.js +150 -56
  202. package/dist/tools/write/preserveMetadataElements.d.ts +12 -6
  203. package/dist/tools/write/preserveMetadataElements.js +58 -16
  204. package/dist/tools/write/projectAction.js +62 -5
  205. package/dist/tools/write/referenceGroupControl.d.ts +40 -0
  206. package/dist/tools/write/referenceGroupControl.js +163 -0
  207. package/dist/tools/write/reportDesignXml.d.ts +21 -3
  208. package/dist/tools/write/reportDesignXml.js +4 -4
  209. package/dist/tools/write/reportRdlXml.d.ts +65 -0
  210. package/dist/tools/write/reportRdlXml.js +587 -0
  211. package/dist/tools/write/resolveReferences.d.ts +25 -1
  212. package/dist/tools/write/resolveReferences.js +68 -20
  213. package/dist/tools/write/resolveWriteTarget.d.ts +69 -0
  214. package/dist/tools/write/resolveWriteTarget.js +192 -0
  215. package/dist/tools/write/securityReferences.d.ts +29 -0
  216. package/dist/tools/write/securityReferences.js +123 -0
  217. package/dist/tools/write/serializerOmittedDefaults.d.ts +37 -0
  218. package/dist/tools/write/serializerOmittedDefaults.js +74 -0
  219. package/dist/tools/write/stagingTableProvisioning.d.ts +83 -0
  220. package/dist/tools/write/stagingTableProvisioning.js +312 -0
  221. package/dist/tools/write/tagsApply.d.ts +73 -0
  222. package/dist/tools/write/tagsApply.js +253 -0
  223. package/dist/tools/write/writeAnchorGuard.d.ts +3 -0
  224. package/dist/tools/write/writeAnchorGuard.js +4 -0
  225. package/dist/tools/xml/bpAccessPropertyModify.d.ts +41 -0
  226. package/dist/tools/xml/bpAccessPropertyModify.js +136 -0
  227. package/dist/tools/xml/createTablePropertyHonesty.d.ts +4 -1
  228. package/dist/tools/xml/createTablePropertyHonesty.js +63 -13
  229. package/dist/tools/xml/dataEntityStagingTableXml.d.ts +86 -0
  230. package/dist/tools/xml/dataEntityStagingTableXml.js +191 -0
  231. package/dist/tools/xml/dataEntityViewEdit.d.ts +20 -0
  232. package/dist/tools/xml/dataEntityViewEdit.js +122 -0
  233. package/dist/tools/xml/dataEntityXml.d.ts +4 -2
  234. package/dist/tools/xml/dataEntityXml.js +41 -8
  235. package/dist/tools/xml/edtRelationResolver.d.ts +29 -0
  236. package/dist/tools/xml/edtRelationResolver.js +73 -0
  237. package/dist/tools/xml/edtTableReferenceEdit.d.ts +59 -0
  238. package/dist/tools/xml/edtTableReferenceEdit.js +176 -0
  239. package/dist/tools/xml/entityComputedField.d.ts +54 -0
  240. package/dist/tools/xml/entityComputedField.js +153 -0
  241. package/dist/tools/xml/entityUnmappedField.d.ts +65 -0
  242. package/dist/tools/xml/entityUnmappedField.js +140 -0
  243. package/dist/tools/xml/formDataSourceDomain.d.ts +27 -0
  244. package/dist/tools/xml/formDataSourceDomain.js +71 -0
  245. package/dist/tools/xml/formRestructure.d.ts +56 -0
  246. package/dist/tools/xml/formRestructure.js +385 -0
  247. package/dist/tools/xml/generateD365Xml.d.ts +5 -1
  248. package/dist/tools/xml/generateD365Xml.js +51 -12
  249. package/dist/tools/xml/menuItemBpDefaults.d.ts +53 -0
  250. package/dist/tools/xml/menuItemBpDefaults.js +180 -0
  251. package/dist/tools/xml/menuPropertyUpsert.d.ts +52 -0
  252. package/dist/tools/xml/menuPropertyUpsert.js +205 -0
  253. package/dist/tools/xml/securityDutyRoleXml.d.ts +91 -0
  254. package/dist/tools/xml/securityDutyRoleXml.js +168 -3
  255. package/dist/tools/xml/surrogateForeignKey.d.ts +35 -0
  256. package/dist/tools/xml/surrogateForeignKey.js +88 -0
  257. package/dist/tools/xml/tableBpDefaults.d.ts +109 -0
  258. package/dist/tools/xml/tableBpDefaults.js +470 -0
  259. package/dist/tools/xml/tableFieldPropertyEdit.js +3 -1
  260. package/dist/tools/xml/tableFieldRemoval.d.ts +43 -0
  261. package/dist/tools/xml/tableFieldRemoval.js +203 -0
  262. package/dist/tools/xml/tableXml.js +12 -4
  263. package/dist/tools/xml/tagsEdit.d.ts +53 -0
  264. package/dist/tools/xml/tagsEdit.js +420 -0
  265. package/dist/utils/axFormDesignProperties.d.ts +8 -4
  266. package/dist/utils/axFormDesignProperties.js +17 -5
  267. package/dist/utils/axTablePropertyOrder.js +6 -0
  268. package/dist/utils/baseObjectXml.js +3 -48
  269. package/dist/utils/bpCreateDefaults.d.ts +79 -0
  270. package/dist/utils/bpCreateDefaults.js +140 -0
  271. package/dist/utils/configManager.d.ts +10 -1
  272. package/dist/utils/configManager.js +43 -17
  273. package/dist/utils/crossModelWriteGuard.d.ts +9 -0
  274. package/dist/utils/crossModelWriteGuard.js +28 -8
  275. package/dist/utils/customModelStore.d.ts +30 -0
  276. package/dist/utils/customModelStore.js +62 -0
  277. package/dist/utils/dataverseAuth.d.ts +37 -0
  278. package/dist/utils/dataverseAuth.js +194 -0
  279. package/dist/utils/dataverseTokenCache.d.ts +28 -0
  280. package/dist/utils/dataverseTokenCache.js +144 -0
  281. package/dist/utils/envListSetting.d.ts +52 -0
  282. package/dist/utils/envListSetting.js +118 -0
  283. package/dist/utils/formControlExpander.d.ts +29 -26
  284. package/dist/utils/formControlExpander.js +359 -83
  285. package/dist/utils/formControlMethodXml.d.ts +73 -0
  286. package/dist/utils/formControlMethodXml.js +190 -0
  287. package/dist/utils/formControlPropertyXml.js +20 -5
  288. package/dist/utils/formDataSourcePropertyXml.d.ts +71 -0
  289. package/dist/utils/formDataSourcePropertyXml.js +218 -0
  290. package/dist/utils/formExtensionControlXml.js +12 -1
  291. package/dist/utils/formPatternTemplates.d.ts +2 -0
  292. package/dist/utils/formPatternTemplates.js +55 -14
  293. package/dist/utils/integerText.d.ts +12 -0
  294. package/dist/utils/integerText.js +24 -0
  295. package/dist/utils/loadEnv.d.ts +27 -1
  296. package/dist/utils/loadEnv.js +86 -1
  297. package/dist/utils/menuFiles.d.ts +20 -0
  298. package/dist/utils/menuFiles.js +65 -0
  299. package/dist/utils/modelClassifier.d.ts +8 -2
  300. package/dist/utils/modelClassifier.js +21 -2
  301. package/dist/utils/objectFileLookup.d.ts +34 -0
  302. package/dist/utils/objectFileLookup.js +113 -0
  303. package/dist/utils/operationLocks.d.ts +11 -0
  304. package/dist/utils/operationLocks.js +93 -2
  305. package/dist/utils/packageResolver.d.ts +42 -8
  306. package/dist/utils/packageResolver.js +136 -26
  307. package/dist/utils/pathContainment.d.ts +23 -0
  308. package/dist/utils/pathContainment.js +24 -0
  309. package/dist/utils/payloadBudget.d.ts +12 -0
  310. package/dist/utils/payloadBudget.js +25 -0
  311. package/dist/utils/progressReporter.d.ts +10 -0
  312. package/dist/utils/progressReporter.js +16 -0
  313. package/dist/utils/smartXmlBuilder.js +24 -21
  314. package/dist/utils/subscriberAccessLevel.d.ts +4 -3
  315. package/dist/utils/subscriberAccessLevel.js +19 -5
  316. package/dist/utils/symbolLookup.d.ts +26 -0
  317. package/dist/utils/symbolLookup.js +31 -0
  318. package/dist/utils/toolProgressMessage.js +7 -2
  319. package/dist/utils/warningBaseline.d.ts +60 -0
  320. package/dist/utils/warningBaseline.js +92 -0
  321. package/dist/utils/xmlEscape.d.ts +20 -6
  322. package/dist/utils/xmlEscape.js +42 -7
  323. package/dist/utils/xppConfigProvider.d.ts +2 -0
  324. package/dist/utils/xppConfigProvider.js +1 -0
  325. package/dist/validation/formPatternValidator.d.ts +25 -13
  326. package/dist/validation/formPatternValidator.js +119 -298
  327. package/dist/validation/platformPatternMatcher.d.ts +49 -0
  328. package/dist/validation/platformPatternMatcher.js +375 -0
  329. package/dist/workspace/createdArtifactLedger.d.ts +16 -2
  330. package/dist/workspace/createdArtifactLedger.js +4 -2
  331. package/dist/workspace/projectFile.d.ts +44 -5
  332. package/dist/workspace/projectFile.js +271 -310
  333. package/dist/workspace/projectMembership.d.ts +21 -0
  334. package/dist/workspace/projectMembership.js +40 -0
  335. package/dist/workspace/rnrprojText.d.ts +57 -0
  336. package/dist/workspace/rnrprojText.js +236 -0
  337. package/dist/workspace/workspaceScanner.js +55 -13
  338. package/package.json +8 -1
  339. package/dist/knowledge/formPatterns/catalog/subPatterns/panels.d.ts +0 -9
  340. package/dist/knowledge/formPatterns/catalog/subPatterns/panels.js +0 -47
@@ -42,6 +42,7 @@ PowerShell / any terminal command **WILL HANG** in VS 2022 / VS 2026 MCP integra
42
42
  | Validate form XML against its pattern | `object_patterns(domain="form", action="validate", xml \| formName \| filePath)` — structural errors block form writes (FORM_PATTERN_ENFORCE) |
43
43
  | Resolve label / EDT / class refs | `validate_code(mode="references", code)` |
44
44
  | Build / BP / Sync | `build_d365fo_project(bpCheck: true, dbSync: true)` — ONE call compiles, runs the best-practice check and syncs AxDB |
45
+ | Deploy to a UDE environment (before running changed tests there) | `build_d365fo_project(deploy: true)` — compiles and deploys the model's package to the cloud runtime `run_systest_class` uses; add `dbSync: true` only after a table/view/data-entity/enum/EDT change (~20 min instead of ~3) |
45
46
  | Error diagnosis | `get_knowledge(kind="error", errorText)` |
46
47
  | Parameters for a `d365fo_file` operation / `generate_object` mode | `get_knowledge(kind="op-spec", topic="add-index" \| "table" \| "scaffold:form")` — those two tools keep their parameters OUT of the tool schema; look the contract up once for the operation you picked, then nest the values in `params` (`properties` for `action="create"`) |
47
48
 
@@ -56,9 +57,11 @@ PowerShell / any terminal command **WILL HANG** in VS 2022 / VS 2026 MCP integra
56
57
  2. **`d365fo_file` (action=create/modify) applies immediately** (no dry-run / preview). Describe the change in chat and wait for explicit user confirmation ("apply", "ok", "yes") before calling. Revert with `d365fo_file(action="undo")` (or pass `createBackup=true` to keep a `.bak`).
57
58
  3. **Never** use `replace_string_in_file`, `edit_file`, `apply_patch`, or any built-in file-write tool on `.xml` or `.xpp` files — **not even as a fallback** when `d365fo_file(action="modify")` fails. These bypass `IMetadataProvider` and corrupt VS 2022's in-memory model. If `d365fo_file(action="modify")` errors, STOP and report the error verbatim.
58
59
 
60
+ 4. **Tags (free-text label, e.g. a ticket key or a project name):** never hand-edit `<Tags>`. `properties.tags` on create, `tags` on add-*/modify-field/modify-enum-value, `modify-property propertyPath="Tags"` on an existing object (`tagsMode`=add|remove, empty value removes). `D365FO_DEFAULT_TAG` in the instance `.env` is applied to creates/adds without `tags`; `tags=""` opts out for one call.
61
+
59
62
  ### Build automation
60
63
 
61
- 4. Never run `build_d365fo_project()` automatically — only on explicit user request ("build", "compile", "check errors").
64
+ 4. Never run `build_d365fo_project()` automatically — only on explicit user request ("build", "compile", "check errors"). On UDE, a request to run a test whose code changed since the last deployment counts: tests run against deployed code, so build with `deploy: true` first. Say so before a full sync (`dbSync: true`).
62
65
 
63
66
  ### X++ correctness (BP-clean code)
64
67
 
@@ -82,6 +85,13 @@ PowerShell / any terminal command **WILL HANG** in VS 2022 / VS 2026 MCP integra
82
85
  11. **The post-write diff must be additive or narrowly targeted** — verify via `get_workspace_info(changes=true)` (or re-read with `get_object_info`) that no unrelated XML nodes (`<DataSources>`, `<Controls>`, methods, pattern metadata) disappeared. If they did, the edit failed: `d365fo_file(action="undo")`.
83
86
  12. **An example form named by the user is a pattern contract** — keep its pattern family and required scaffolding (datasources, ActionPane/Tab/grid/QuickFilter); missing pattern elements are a failed generation even if the XML is well-formed.
84
87
 
88
+ ### Scope discipline
89
+
90
+ - **Surface ambiguity, do not pick silently.** If the request has several plausible readings (which object, which extension mechanism, which model), name them and ask; state any assumption you do make.
91
+ - **Smallest change that does what was asked.** No extra fields, methods, parameters, classes or abstractions "for later". Match the style of the surrounding X++.
92
+ - **Touch only what the request needs.** Do not reformat, rename or "improve" adjacent code. Unrelated problems you notice (dead code, BP warnings in other objects) — mention them, do not fix them unasked. Clean up only what your own change made unused.
93
+ - **Define "done" before writing.** Say how it will be verified (`validate_code` clean, build clean, `run_systest_class` for the new behaviour) and check it before reporting success; if a check was skipped or failed, say so.
94
+
85
95
  ### Spending tool calls
86
96
 
87
97
  13. **Issue independent read-only calls together, in one step.** Every tool call re-reads the whole conversation, so a turn costs the round trip, not the tool. `get_object_info`, `search`, `labels`, `get_knowledge`, `object_patterns` and `find_references` have no side effects and never need to wait for each other — five lookups are one step, not five.
package/README.md CHANGED
@@ -1,11 +1,14 @@
1
+ <div align="center">
2
+
1
3
  # D365 F&O MCP Server
2
4
 
3
- <div align="center">
5
+ ### Grounded AI development for Dynamics 365 Finance & Operations
4
6
 
5
- **22 AI tools that know every X++ class, table, form, and EDT in your D365FO codebase**
7
+ **22 MCP tools that know every X++ class, table, form, EDT and label in *your* D365FO codebase —<br/>
8
+ so GitHub Copilot and Claude Code write X++ that compiles.**
6
9
 
7
10
  [![npm](https://img.shields.io/npm/v/d365fo-mcp.svg?logo=npm&color=cb3837)](https://www.npmjs.com/package/d365fo-mcp)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
9
12
  [![Node.js](https://img.shields.io/badge/node-%3E%3D24.0.0-brightgreen.svg)](https://nodejs.org/)
10
13
  [![TypeScript](https://img.shields.io/badge/TypeScript-7.0-blue.svg)](https://www.typescriptlang.org/)
11
14
  [![Tests](https://img.shields.io/badge/tests-5000%2B-brightgreen.svg)](docs/TESTING.md)
@@ -13,117 +16,301 @@
13
16
  [![Core coverage](https://img.shields.io/badge/core_coverage-100%25-brightgreen.svg)](eval/COVERAGE.md) [![Total coverage](https://img.shields.io/badge/total_coverage-100%25-lightgrey.svg)](eval/COVERAGE.md)
14
17
  <!-- coverage-badge:end -->
15
18
 
16
- *Grounded AI development for Dynamics 365 Finance & Operations — works with GitHub Copilot and Claude Code*
17
-
18
19
  [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_d365fo-0098FF?style=flat-square&logo=githubcopilot&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=d365fo&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22d365fo_server_url%22%2C%22description%22%3A%22D365FO%20MCP%20server%20URL%20(e.g.%20https%3A%2F%2Fyour-server.azurewebsites.net%2Fmcp%2F)%22%7D%5D&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22%24%7Binput%3Ad365fo_server_url%7D%22%7D)
19
20
  [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_d365fo-24bfa5?style=flat-square&logo=githubcopilot&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=d365fo&quality=insiders&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22d365fo_server_url%22%2C%22description%22%3A%22D365FO%20MCP%20server%20URL%20(e.g.%20https%3A%2F%2Fyour-server.azurewebsites.net%2Fmcp%2F)%22%7D%5D&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22%24%7Binput%3Ad365fo_server_url%7D%22%7D)
20
21
  [![Add to Cursor](https://img.shields.io/badge/Cursor-Add_d365fo-000000?style=flat-square&logo=cursor&logoColor=white)](https://cursor.com/install-mcp?name=d365fo&config=eyJ1cmwiOiJodHRwczovL3lvdXItc2VydmVyLmF6dXJld2Vic2l0ZXMubmV0L21jcC8ifQ%3D%3D)
21
22
 
22
- *These connect an editor to a server that is already deployed — see [Quick Start](#quick-start) if you still need to set one up.*
23
+ <sub>The install buttons connect an editor to a server that is already deployed — no server yet? Start with the [Quick start](#-quick-start).</sub>
24
+
25
+ [**Quick start**](#-quick-start) ·
26
+ [**How it works**](#-how-it-works) ·
27
+ [**What to ask**](#-what-to-ask) ·
28
+ [**Tools**](#-the-22-tools) ·
29
+ [**Docs**](#-documentation) ·
30
+ [**Changelog**](CHANGELOG.md)
23
31
 
24
32
  </div>
25
33
 
26
34
  ---
27
35
 
28
- ## Why
29
-
30
- AI assistants excel at C#, Python, and JavaScript. X++ is different: your D365FO codebase is private, deeply customized, and invisible to every model — so AI confidently generates code that doesn't compile.
36
+ ## 💡 Why
31
37
 
32
- This server pre-indexes your entire D365FO installation (580 000+ symbols across standard, ISV, and custom models) and exposes it as 22 specialized MCP tools (`axdb_sql` and `trace_d365fo` only once configured). Every signature, every CoC wrapper, every label, every form pattern — verified against your real metadata **before** the AI writes a single line.
38
+ AI assistants are excellent at C#, Python and JavaScript. X++ is different: your D365FO codebase is
39
+ private, deeply customized and invisible to every model — so the AI confidently writes code against
40
+ methods, fields and labels that do not exist, and it does not compile.
33
41
 
34
- ![Solution Architecture](docs/img/solution-architecture-diagram.svg)
42
+ This server pre-indexes your whole D365FO installation — **580 000+ symbols** across standard, ISV
43
+ and custom models, plus **20M+ label rows** — and puts it behind MCP tools. Every signature, every
44
+ existing CoC wrapper, every label and every form pattern is checked against *your* metadata
45
+ **before** the AI writes a line, and a write that cannot be proven is refused.
35
46
 
36
- | Task | Without this server | With this server |
37
- |------|--------------------|------------------|
38
- | Method signatures | Guessed → compile errors | Exact, from your codebase |
39
- | Existing CoC wrappers | Manual AOT search | `extension_info(mode="coc")` in < 50 ms |
40
- | New forms | Hand-written XML, broken patterns | Cloned from reference forms, validated against the pattern catalog |
41
- | Labels | Hardcoded strings | Right `@SYS`/`@MODULE` key found instantly |
42
- | Security chains | Hours of manual tracing | Role → Duty → Privilege → Entry Point in one call |
43
- | Generated code | Hallucinated fields and types | Every reference proven against the index, gated before write |
47
+ | | Without this server | With this server |
48
+ |---|---|---|
49
+ | **Method signatures** | Guessed → compile errors | Exact, read from your codebase |
50
+ | **Existing CoC wrappers** | Manual AOT search | `extension_info(mode="coc")` in < 50 ms |
51
+ | **New forms** | Hand-written XML, broken patterns | Cloned from a reference form, validated against the platform's pattern rules |
52
+ | **Labels** | Hardcoded strings | The right existing `@SYS` / `@Module` label, found instantly |
53
+ | **Security chains** | Hours of manual tracing | Role → Duty → Privilege → Entry point in one call |
54
+ | **Generated code** | Hallucinated fields and types | Every reference proven against the index, gated before write |
44
55
 
45
56
  ---
46
57
 
47
- ## Capabilities
58
+ ## 🧭 How it works
48
59
 
49
- | Feature | Description |
50
- |---|---|
51
- | 🔍 **Full-codebase intelligence** | 580K+ symbols indexed: classes, tables, forms, EDTs, enums, labels (20M+ rows), security artifacts — FTS5 search in < 10 ms |
52
- | 🛡️ **Grounded generation** | Fail-closed gates: `prepare` issues grounding tokens, `validate_code(mode="references")` proves every identifier, `validate_code(mode="syntax")` enforces best practices — hallucinated code never reaches disk |
53
- | 🧩 **Form pattern engine** | Complete catalog of Microsoft form patterns and sub-patterns: recommends the right pattern, clones reference forms with datasource re-binding, **deterministically expands** patterns that have no reference form, **auto-repairs** a form's missing required controls, validates structure and blocks invalid writes |
54
- | ✍️ **Safe metadata writes** | C# bridge uses Microsoft's own `IMetadataProvider` wherever it can express the object; the few types and ops it cannot go through structured XML writers with ambiguity guards — never blind string replacement. Automatic `.rnrproj` registration, one-call undo |
55
- | 🏗️ **SDLC integration** | MSBuild compilation with structured diagnostics, DB sync, xppbp best practices, SysTestRunner — all from chat. Optional `restartAos: true` refreshes the matching local IIS/IIS Express runtime after a successful build and requested sync. [Runtime restart](docs/AOS_RUNTIME_RESTART.md) |
56
- | 🗄️ **Optional AxDB SQL** | Off by default and not even published until configured: `axdb_sql` runs read-only, parameterized queries against AxDB on the development VM, so the agent can check what the code actually persisted. Windows authentication; one SELECT checked on the parsed T-SQL tree, inside a transaction that is always rolled back; no result cache. [Setup](docs/AXDB_SQL.md) |
57
- | ⏱️ **Optional performance trace** | Off by default and not published until enabled: `trace_d365fo` captures the AOS's ETW events (X++ method enter/exit, SQL latency) on the development VM while the agent — or you — reproduce a slow scenario, and analyses the capture: where the time goes per method, which statements run thousands of times from one caller. No timer code added to the application; parameter values never returned. [Setup and accuracy](docs/TRACE.md) |
58
- | 📐 **X++ knowledge base** | Queryable rules: select grammar, CoC authoring, financial dimensions, the posting engine (`LedgerVoucher`), number sequences, `SysExtension`, Electronic Reporting, AX2012→D365FO migration — prevents deprecated APIs |
60
+ <p align="center">
61
+ <img src="docs/img/architecture.svg" alt="Architecture: the AI agent calls the d365fo-mcp server over MCP; reads are served from SQLite symbol and label indexes, writes pass four grounding gates and go through the C# metadata bridge into the D365FO development VM, whose metadata is indexed at build time." width="100%"/>
62
+ </p>
59
63
 
60
- ### Pattern-grounded form development
64
+ 1. **Index** — the server extracts your AOT metadata once into two SQLite databases (symbols and
65
+ labels, FTS5 search in < 10 ms). On a D365FO VM the **C# metadata bridge** adds live reads
66
+ through Microsoft's own `IMetadataProvider` and compiler-resolved cross-references from
67
+ `DYNAMICSXREFDB`.
68
+ 2. **Ground** — before the agent writes anything, `prepare` hands it the real signatures, existing
69
+ extensions, naming rules and a short-lived **grounding token** for the target object.
70
+ 3. **Gate** — `validate_code` proves every type, field, method and label in the generated code and
71
+ checks the best-practice rules; forms are also checked against the platform's pattern rules.
72
+ Writes are **fail-closed**: anything unproven is blocked and the agent gets structured fixes.
73
+ 4. **Build** — the write lands through the bridge (or a validated XML writer where the provider
74
+ cannot express the object), is added to your `.rnrproj`, and can be compiled, BP-checked,
75
+ synced and unit-tested from the same chat.
61
76
 
62
- Forms are the hardest artifact to generate correctly — each pattern dictates required containers, ordering, and allowed sub-patterns. The form pattern engine makes it a guided pipeline:
77
+ A typical change, end to end:
63
78
 
64
79
  ```mermaid
65
80
  flowchart LR
66
- A["object_patterns<br/>(domain=form, action=analyze)"] --> B["object_patterns<br/>(domain=form, action=spec)"]
67
- B --> C["generate_object<br/>objectType=form, cloneFrom"]
68
- C --> D["object_patterns<br/>(domain=form, action=validate) FP001–FP010"]
69
- D -->|clean| E["d365fo_file<br/>(action=create) write + project"]
70
- D -->|errors| C
81
+ ask(["💬 Your prompt"]) --> prep["<b>prepare</b><br/>signatures · existing CoC<br/>grounding token"]
82
+ prep --> gen["Agent writes X++"]
83
+ gen --> val{"<b>validate_code</b><br/>references + BP"}
84
+ val -- "unproven identifier<br/>or BP error" --> gen
85
+ val -- "all proven" --> write["<b>d365fo_file</b><br/>write + .rnrproj"]
86
+ write --> build["<b>build_d365fo_project</b><br/>xppc · BP · DB sync"]
87
+ build -- "compile error" --> gen
88
+ build -- "green" --> done(["✅ Ready for review"])
89
+
90
+ classDef gate fill:#bc4c00,stroke:#bc4c00,color:#ffffff
91
+ classDef ok fill:#1a7f37,stroke:#1a7f37,color:#ffffff
92
+ class val gate
93
+ class done ok
71
94
  ```
72
95
 
73
- Structural violations (wrong order, missing container, disallowed control) **block the write** — recommendations only warn. Mined pattern statistics from your own environment ground every suggestion in reality.
96
+ <details>
97
+ <summary><b>Form development pipeline</b> — patterns are rules, not suggestions</summary>
98
+
99
+ <br/>
100
+
101
+ Forms are the hardest artifact to generate correctly: each pattern dictates required containers,
102
+ their order and the allowed sub-patterns. The form pattern engine turns that into a guided
103
+ pipeline, grounded in pattern statistics mined from your own environment:
104
+
105
+ ```mermaid
106
+ flowchart LR
107
+ A["<b>object_patterns</b><br/>analyze · recommend"] --> B["<b>object_patterns</b><br/>spec"]
108
+ B --> C["<b>generate_object</b><br/>scaffold · cloneFrom"]
109
+ C --> D{"<b>object_patterns</b><br/>validate"}
110
+ D -- "violations" --> C
111
+ D -- "clean" --> E["<b>d365fo_file</b><br/>create + .rnrproj"]
112
+
113
+ classDef gate fill:#bc4c00,stroke:#bc4c00,color:#ffffff
114
+ class D gate
115
+ ```
116
+
117
+ Violations the compiler would reject (wrong order, missing container, disallowed control)
118
+ **block the write**; recommendations only warn. Patterns without a reference form are expanded
119
+ deterministically, and a form's missing required controls can be repaired automatically.
120
+
121
+ </details>
74
122
 
75
123
  ---
76
124
 
77
- ## Quick Start
125
+ ## 🚀 Quick start
78
126
 
79
- > **From D365FO platform update 10.0.49 (PU74), Visual Studio 2026 is the supported IDE for X++ development** — Microsoft no longer supports VS 2022. Earlier platform versions still use VS 2022 ≥ 17.14. [Details](https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/whats-new-platform-updates-10-0-49)
127
+ > [!IMPORTANT]
128
+ > From D365FO platform update **10.0.49 (PU74)**, **Visual Studio 2026** is the supported IDE for
129
+ > X++ development — Microsoft no longer supports VS 2022 there. Earlier platform versions still use
130
+ > VS 2022 ≥ 17.14. [Details](https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/whats-new-platform-updates-10-0-49)
80
131
 
81
- **Installing on your own D365FO VM** — the usual case. One line in PowerShell installs Node.js if it is missing, installs the server from npm, and runs the setup wizard, which asks where the index should live and builds the C# bridge for you:
132
+ ### 🖥️ Install on your D365FO VM — the usual case
133
+
134
+ One line in PowerShell installs Node.js if it is missing, installs the server from npm and runs the
135
+ setup wizard, which asks where the index should live and builds the C# bridge for you:
82
136
 
83
137
  ```powershell
84
138
  irm https://raw.githubusercontent.com/dynamics365ninja/d365fo-mcp-server/main/install.ps1 | iex
85
139
  ```
86
140
 
87
- Already have Node.js 24+? Then the one-liner has nothing to bootstrap and you can skip it:
141
+ Already have Node.js 24+? Skip the bootstrap:
88
142
 
89
143
  ```powershell
90
144
  npm install -g d365fo-mcp
91
145
  d365fo-mcp setup
92
146
  ```
93
147
 
94
- Re-running either is safe. An installation made before the npm package existed is a git checkout, and both are left exactly where they are and updated in place.
148
+ Re-running either is safe. An installation made before the npm package existed is a git checkout;
149
+ both commands leave it where it is and update it in place.
150
+
151
+ ### 🔌 Connect to a server your team already runs
95
152
 
96
- **Your team already runs a shared server?** Then you install nothing — point your editor at it:
153
+ Nothing to install — point your editor at it (or use the install buttons at the top):
97
154
 
98
155
  ```powershell
99
156
  npx d365fo-mcp connect https://your-server.azurewebsites.net
100
157
  ```
101
158
 
102
- Both paths in full — prerequisites, editor configuration for every scenario, the required instruction file, and how to verify grounding actually works: **[docs/QUICK_START.md](docs/QUICK_START.md)**
159
+ ### ☁️ Deploy one shared server for the whole team
160
+
161
+ The metadata index lives in Blob Storage and downloads automatically on startup.
162
+
163
+ [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fdynamics365ninja%2Fd365fo-mcp-server%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Fazuredeploy.json)
164
+
165
+ Full guide, including the Azure DevOps pipelines that keep the index fresh:
166
+ [docs/SETUP_AZURE.md](docs/SETUP_AZURE.md).
167
+
168
+ > [!TIP]
169
+ > Every path ends with the **instruction file** (`CLAUDE.md` / `copilot-instructions.md`) that
170
+ > teaches the agent the grounding workflow, and a one-minute check that grounding really works.
171
+ > Both are in **[docs/QUICK_START.md](docs/QUICK_START.md)** — don't skip them.
172
+
173
+ <details>
174
+ <summary><b>Which deployment fits?</b> — local, shared or hybrid</summary>
175
+
176
+ <br/>
177
+
178
+ ```mermaid
179
+ flowchart LR
180
+ agent(["🤖 Copilot · Claude Code"])
181
+
182
+ subgraph cloud["☁️ Azure · shared, read-only"]
183
+ app["App Service<br/>search · knowledge · patterns"]
184
+ blob[("Blob Storage<br/>prebuilt index")]
185
+ end
186
+
187
+ subgraph vm["🖥️ Your D365FO VM"]
188
+ local["Local server<br/>full or write-only"]
189
+ bridge["C# bridge"]
190
+ pld[("PackagesLocalDirectory")]
191
+ end
192
+
193
+ pipe["Azure DevOps<br/>extract → build → upload"] --> blob
194
+ blob -- "download on startup" --> app
195
+ agent -- "search & read" --> app
196
+ agent -- "write · build · test" --> local
197
+ local --> bridge --> pld
198
+ ```
199
+
200
+ | Mode | Where | What it does |
201
+ |---|---|---|
202
+ | **Full** | your D365FO VM | Everything — search, generation, writes, build, tests. The simplest setup. |
203
+ | **Read-only** | Azure App Service | Shared index for the whole team; no writes, nothing installed on developer machines. |
204
+ | **Hybrid** | Azure + a local write-only companion | The team shares one index in Azure; each developer's VM only writes, builds and tests. |
205
+
206
+ Scenarios A–F in detail: [docs/SETUP.md](docs/SETUP.md) · server modes and tool profiles:
207
+ [docs/MCP_CONFIG.md](docs/MCP_CONFIG.md).
208
+
209
+ </details>
103
210
 
104
211
  ---
105
212
 
106
- ## Azure Deployment
213
+ ## 💬 What to ask
107
214
 
108
- One shared instance for the whole team — the metadata index lives in Blob Storage and downloads automatically on startup.
215
+ You never name tools — the agent picks them. Ask the way you would ask a colleague who knows the
216
+ codebase:
109
217
 
110
- [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fdynamics365ninja%2Fd365fo-mcp-server%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Fazuredeploy.json)
218
+ | You ask | The server |
219
+ |---|---|
220
+ | *"Add a CoC wrapper to `SalesLine.validateWrite` that blocks negative quantities"* | Reads the exact signature, lists existing wrappers, proves every reference, writes the extension class |
221
+ | *"Create a table `ContosoRentEquipmentTable` with a SimpleList form and labels in en-US and de"* | Checks names for collisions, reuses EDTs, picks the form pattern, creates labels, adds everything to the project |
222
+ | *"Who has access to the `VendPaymTerms` form?"* | Walks Role → Duty → Privilege → Entry point, including OLS policies |
223
+ | *"Is there a label for 'payment terms'?"* | Full-text search over every label file and language, custom models first |
224
+ | *"Where is `CustTable::find` called from?"* | Compiler-resolved cross-references from `DYNAMICSXREFDB` — every caller and reference type |
225
+ | *"Build the project, run BP and the SysTests"* | MSBuild with structured xppc diagnostics, xppbp, SysTestRunner — all from chat |
226
+
227
+ More real tool chains: [docs/USAGE_EXAMPLES.md](docs/USAGE_EXAMPLES.md).
228
+
229
+ ---
230
+
231
+ ## ✨ Capabilities
232
+
233
+ | | |
234
+ |---|---|
235
+ | 🔍 **Full-codebase intelligence** | Classes, tables, forms, EDTs, enums, security artifacts and 20M+ labels, indexed with FTS5 — search in < 10 ms. On a D365FO VM, live metadata and compiler cross-references through the C# bridge. |
236
+ | 🛡️ **Grounded generation** | Fail-closed gates: `prepare` issues grounding tokens, `validate_code` proves every identifier and enforces best-practice rules — hallucinated code never reaches disk. |
237
+ | 🧩 **Form pattern engine** | The full catalog of Microsoft form patterns and sub-patterns: recommends a pattern, clones reference forms with datasource re-binding, expands patterns that have no reference form, repairs missing required controls and blocks invalid writes. |
238
+ | ✍️ **Safe metadata writes** | Through Microsoft's own `IMetadataProvider` wherever it can express the object; structured XML writers with ambiguity guards for the rest — never blind string replacement. Automatic `.rnrproj` registration and one-call undo. |
239
+ | 🏷️ **Tags on writes** | `<Tags>` on created objects and added elements (`tags` argument or `D365FO_DEFAULT_TAG`), set or cleared on existing objects with `modify-property propertyPath="Tags"`. |
240
+ | 🏗️ **SDLC from chat** | MSBuild with structured diagnostics, DB sync, xppbp, SysTestRunner. Optional `restartAos: true` refreshes the local AOS after a build — [runtime restart](docs/AOS_RUNTIME_RESTART.md). |
241
+ | 📐 **X++ knowledge base** | Queryable rules for select grammar, CoC authoring, financial dimensions, `LedgerVoucher` posting, number sequences, `SysExtension`, Electronic Reporting and AX 2012 → D365FO migration — keeps deprecated APIs out. |
242
+
243
+ **Opt-in tools** — off by default and not even published until you configure them:
244
+
245
+ | | |
246
+ |---|---|
247
+ | 🗄️ **`axdb_sql`** | Read-only, parameterized queries against AxDB on the development VM, so the agent can check what the code actually persisted. Windows authentication, one SELECT validated on the parsed T-SQL tree, always rolled back. [Setup](docs/AXDB_SQL.md) |
248
+ | ⏱️ **`trace_d365fo`** | Captures the AOS's ETW events while a slow scenario is reproduced and shows where the time goes — per X++ method, and which SQL statements run thousands of times from one caller. No timer code added. [Setup and accuracy](docs/TRACE.md) |
249
+
250
+ ---
251
+
252
+ ## 🧰 The 22 tools
111
253
 
112
- Deployment guide: [docs/SETUP_AZURE.md](docs/SETUP_AZURE.md) — includes CI/CD pipeline automation
254
+ Several tools are unified behind a discriminator (`mode`, `action`, `domain`, `objectType`), so the
255
+ agent chooses from fewer, broader tools.
256
+
257
+ | Area | Tools |
258
+ |---|---|
259
+ | 🔍 **Discover** | `search` · `get_object_info` · `find_references` · `labels` |
260
+ | 🧠 **Understand** | `get_knowledge` · `analyze_code` · `extension_info` · `security_info` · `object_patterns` |
261
+ | 🛡️ **Ground & validate** | `prepare` · `validate_code` · `validate_object_naming` |
262
+ | ✍️ **Generate & write** | `generate_object` · `d365fo_file` · `update_symbol_index` |
263
+ | 🏗️ **Build & verify** | `build_d365fo_project` · `run_bp_check` · `run_systest_class` · `verify_d365fo_project` · `get_workspace_info` |
264
+ | 🧪 **Opt-in diagnostics** | `axdb_sql` · `trace_d365fo` |
265
+
266
+ Workspaces that already run other MCP servers can set `MCP_TOOL_PROFILE=core` to publish only the
267
+ 17-tool create-and-build loop. Every tool, parameter and example prompt:
268
+ **[docs/MCP_TOOLS.md](docs/MCP_TOOLS.md)**.
113
269
 
114
270
  ---
115
271
 
116
- ## Documentation
272
+ ## 🧪 How we keep it honest
273
+
274
+ Gates prove a *single* write is grounded. A self-improving **eval loop** checks that the server as a
275
+ whole keeps getting better at producing X++ that compiles, is BP-clean and matches the intended
276
+ metadata — on a real D365FO VM, against captured golden metadata and SysTest oracles.
277
+
278
+ ```mermaid
279
+ flowchart LR
280
+ impl["<b>Implementer agent</b><br/>runs eval cases on a VM<br/>through the grounded tools"] -- "run records" --> corpus[("Corpus")]
281
+ corpus -- "clustered failures" --> imp["<b>Improver agent</b><br/>reproduce → fix → PR"]
282
+ imp -- "human review & merge" --> srv["<b>d365fo-mcp</b><br/>tools · knowledge · validators"]
283
+ srv -. "next run tests the fix" .-> impl
284
+ ```
285
+
286
+ The coverage badges at the top count a topic only when the knowledge base teaches it, an eval case
287
+ with a captured golden proves it, and the tool path can build it — see
288
+ [eval/COVERAGE.md](eval/COVERAGE.md) and [docs/AGENT_EVAL_LOOP.md](docs/AGENT_EVAL_LOOP.md). The loop
289
+ opens pull requests; humans review and merge them.
290
+
291
+ ---
292
+
293
+ ## 📚 Documentation
294
+
295
+ The full map, grouped by audience: **[docs/README.md](docs/README.md)**.
117
296
 
118
297
  | Getting started | Reference | Operations |
119
- |-----------------|-----------|------------|
120
- | [Quick Start](docs/QUICK_START.md) — connect or install | [All 22 tools](docs/MCP_TOOLS.md) | [Azure deployment](docs/SETUP_AZURE.md) |
298
+ |---|---|---|
299
+ | [Quick start](docs/QUICK_START.md) — connect or install | [All 22 tools](docs/MCP_TOOLS.md) | [Azure deployment](docs/SETUP_AZURE.md) |
121
300
  | [Setup scenarios A–F](docs/SETUP.md) | [`.mcp.json` reference](docs/MCP_CONFIG.md) | [DevOps pipelines](docs/SETUP_AZURE.md#azure-devops-pipelines) |
122
- | [Claude Code setup](docs/SETUP.md#claude-code-cli) | [Configuration](docs/CONFIGURATION.md) | [Testing](docs/TESTING.md) |
123
- | [Usage examples](docs/USAGE_EXAMPLES.md) — real tool chains | [Architecture](docs/ARCHITECTURE.md) | [Custom / ISV models](docs/CUSTOM_EXTENSIONS.md) |
301
+ | [Claude Code setup](docs/SETUP.md#claude-code-cli) | [Configuration](docs/CONFIGURATION.md) | [Custom / ISV models](docs/CUSTOM_EXTENSIONS.md) |
302
+ | [Usage examples](docs/USAGE_EXAMPLES.md) — real tool chains | [Architecture](docs/ARCHITECTURE.md) | [Testing](docs/TESTING.md) |
124
303
  | [Changelog](CHANGELOG.md) | [Knowledge authoring](docs/KNOWLEDGE_AUTHORING.md) | [Coverage](eval/COVERAGE.md) — what the badge counts |
125
304
  | [Backlog](docs/BACKLOG.md) — deferred work | [New tool checklist](docs/NEW_TOOL_CHECKLIST.md) | [Eval loop](docs/AGENT_EVAL_LOOP.md) — the self-improvement harness |
126
305
 
127
- ## License
306
+ ## 🤝 Contributing & security
307
+
308
+ Issues and pull requests are welcome — read [CLAUDE.md](CLAUDE.md) for the repository conventions
309
+ (every user-visible change gets a [CHANGELOG](CHANGELOG.md) entry) and
310
+ [docs/NEW_TOOL_CHECKLIST.md](docs/NEW_TOOL_CHECKLIST.md) before adding a tool. Please report
311
+ vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
312
+
313
+ ## 📄 License
128
314
 
129
- MIT
315
+ Released under the [MIT License](LICENSE). By submitting a pull request you agree that your
316
+ contribution is licensed under the same MIT License.
@@ -589,7 +589,12 @@ declare function memberLine(m: {
589
589
  signature?: string;
590
590
  }): string;
591
591
  declare function formatCompletion(r: BridgeCompletionResult, prefix?: string): string;
592
- export declare function tryBridgeCocExtensions(bridge: XrefSource | undefined, baseClassName: string, methodName?: string): Promise<ToolResult | null>;
592
+ export declare function tryBridgeCocExtensions(bridge: XrefSource | undefined, baseClassName: string, methodName?: string,
593
+ /**
594
+ * Which of these extension classes belong to a binary ISV model, as lower-cased names. The
595
+ * cross-reference data cannot tell; the caller asks the symbol index. Omitted: none marked.
596
+ */
597
+ binaryIsvClasses?: (classNames: string[]) => ReadonlySet<string>): Promise<ToolResult | null>;
593
598
  export declare function tryBridgeEventHandlers(bridge: XrefSource | undefined, targetName: string, eventName?: string, handlerType?: string): Promise<ToolResult | null>;
594
599
  export declare function tryBridgeApiUsageCallers(bridge: XrefSource | undefined, apiName: string, limit?: number): Promise<ToolResult | null>;
595
600
  /**
@@ -27,10 +27,11 @@ import { debugLog } from '../utils/logger.js';
27
27
  import { xppMethodSourceForXml } from '../utils/xppFormat.js';
28
28
  import { ensureXppDocComment, ensureBlankLineBeforeClosingBrace } from '../utils/xppDocGen.js';
29
29
  import { parseXppDeclaration, parseXppClassHeader } from '../metadata/xppDeclaration.js';
30
+ import { BINARY_ISV_LIST_FOOTNOTE, BINARY_ISV_NOTE } from '../metadata/binaryModelImport.js';
30
31
  import { rankCustomFirst, isExactNameMatch } from '../utils/exactMatchRanking.js';
31
32
  import { COMPACT_METHODS_HINT, fullBodyHint } from '../utils/methodBodyHint.js';
32
33
  import { subscriberAccessLevelValue } from '../utils/subscriberAccessLevel.js';
33
- import { pageFields, fieldsHeading, fieldsFooter, createControlBudget, chargeControl, chargeSkippedSubtree, controlsFooter, } from '../utils/payloadBudget.js';
34
+ import { pageFields, fieldsHeading, fieldsFooter, createControlBudget, chargeControl, chargeSkippedSubtree, controlsFooter, methodOffsetPastEndNote, methodRangeText, } from '../utils/payloadBudget.js';
34
35
  import { xrefSourceLabel, isSqliteXref } from '../xref/xrefSource.js';
35
36
  import { XREF_SQLITE_COUNT_CAP } from '../xref/sqliteXrefProvider.js';
36
37
  // TABLE
@@ -154,9 +155,10 @@ function formatTable(t, methodOffset, fieldsOffset = 0, fieldFilter, render = {}
154
155
  const hasMore = page.offset + page.limit < total;
155
156
  out += `\n## Methods (${total} total`;
156
157
  if (total > page.limit) {
157
- out += `, showing ${page.offset + 1}–${Math.min(page.offset + page.limit, total)}`;
158
+ out += methodRangeText(page.offset, total, page.limit);
158
159
  }
159
160
  out += `)\n\n`;
161
+ out += methodOffsetPastEndNote(page.offset, total, page.limit);
160
162
  for (const m of visible) {
161
163
  if (page.includeSource) {
162
164
  out += `### ${m.name}\n\n`;
@@ -265,9 +267,10 @@ function formatClass(cls, compact, methodOffset) {
265
267
  const hasMore = methodOffset + CLASS_METHOD_PAGE_SIZE < total;
266
268
  out += `## Methods (${total} total`;
267
269
  if (total > CLASS_METHOD_PAGE_SIZE) {
268
- out += `, showing ${methodOffset + 1}–${Math.min(methodOffset + CLASS_METHOD_PAGE_SIZE, total)}`;
270
+ out += methodRangeText(methodOffset, total, CLASS_METHOD_PAGE_SIZE);
269
271
  }
270
272
  out += `)\n\n`;
273
+ out += methodOffsetPastEndNote(methodOffset, total, CLASS_METHOD_PAGE_SIZE);
271
274
  for (const m of visible) {
272
275
  if (compact) {
273
276
  out += `- \`${methodSignatureLine(m.name, m.source)}\`\n`;
@@ -1331,6 +1334,8 @@ const BRIDGE_MODIFY_OPS = new Set([
1331
1334
  // schema. Both this set AND XML_ONLY_MODIFY_PAIRS have to name it; either alone
1332
1335
  // still returns false. (eval case L2-object-delete-and-entry-point-cleanup)
1333
1336
  'remove-control', 'add-entry-point', 'remove-entry-point',
1337
+ // The duty and privilege lists of a role or duty: XML-only for the same reason.
1338
+ 'add-duty', 'remove-duty', 'add-privilege', 'remove-privilege',
1334
1339
  // AxIgnoreDiagnosticList is not an AOT object at all — MetadataWriteService has
1335
1340
  // no concept of it — so this is XML-only for the same structural reason as the
1336
1341
  // two above.
@@ -1343,6 +1348,9 @@ const BRIDGE_MODIFY_OPS = new Set([
1343
1348
  // No C# op adds a submenu: served by a direct-XML writer on a menu (already in
1344
1349
  // BRIDGE_MODIFY_TYPES) and, through XML_ONLY_MODIFY_PAIRS, on a menu extension.
1345
1350
  'add-submenu',
1351
+ // No C# op changes a control's parent: an AxForm's control tree is restructured by a
1352
+ // direct-XML writer (formRestructure.ts; form is already in BRIDGE_MODIFY_TYPES).
1353
+ 'move-control', 'wrap-controls',
1346
1354
  // No C# op exists for query ranges on entities — served entirely by a
1347
1355
  // direct-XML writer (data-entity is already in BRIDGE_MODIFY_TYPES).
1348
1356
  'add-query-range', 'remove-query-range',
@@ -1381,6 +1389,10 @@ const BRIDGE_MODIFY_TYPES = new Set([
1381
1389
  const XML_ONLY_MODIFY_PAIRS = {
1382
1390
  'add-entry-point': new Set(['security-privilege']),
1383
1391
  'remove-entry-point': new Set(['security-privilege']),
1392
+ 'add-duty': new Set(['security-role', 'security-role-extension']),
1393
+ 'remove-duty': new Set(['security-role', 'security-role-extension']),
1394
+ 'add-privilege': new Set(['security-role', 'security-role-extension', 'security-duty', 'security-duty-extension']),
1395
+ 'remove-privilege': new Set(['security-role', 'security-role-extension', 'security-duty', 'security-duty-extension']),
1384
1396
  'remove-diagnostic-suppression': new Set(['ignore-diagnostic-list']),
1385
1397
  'add-diagnostic-suppression': new Set(['ignore-diagnostic-list']),
1386
1398
  'add-module-reference': new Set(['model-descriptor']),
@@ -2688,21 +2700,34 @@ function formatCompletion(r, prefix) {
2688
2700
  return out;
2689
2701
  }
2690
2702
  // FIND COC EXTENSIONS via XREF (Phase 6)
2691
- export async function tryBridgeCocExtensions(bridge, baseClassName, methodName) {
2703
+ export async function tryBridgeCocExtensions(bridge, baseClassName, methodName,
2704
+ /**
2705
+ * Which of these extension classes belong to a binary ISV model, as lower-cased names. The
2706
+ * cross-reference data cannot tell; the caller asks the symbol index. Omitted: none marked.
2707
+ */
2708
+ binaryIsvClasses) {
2692
2709
  if (!bridge?.isReady || !bridge.xrefAvailable)
2693
2710
  return null;
2694
2711
  try {
2695
2712
  const result = await bridge.findExtensionClasses(baseClassName);
2696
2713
  if (!result)
2697
2714
  return null;
2698
- return { content: [{ type: 'text', text: formatCocExtensions(result, methodName, xrefSourceLabel(bridge)) }] };
2715
+ const binary = binaryIsvClasses?.(result.extensions.map(e => e.className)) ?? new Set();
2716
+ return { content: [{ type: 'text', text: formatCocExtensions(result, methodName, xrefSourceLabel(bridge), binary) }] };
2699
2717
  }
2700
2718
  catch (e) {
2701
2719
  recordBridgeFailure(`findExtensionClasses(${baseClassName})`, e);
2702
2720
  return null;
2703
2721
  }
2704
2722
  }
2705
- function formatCocExtensions(r, methodNameFilter, source) {
2723
+ function formatCocExtensions(r, methodNameFilter, source, binaryIsv) {
2724
+ const out = formatCocExtensionList(r, methodNameFilter, source, binaryIsv);
2725
+ // Every class the list counts is printed in one of its sections, so one marked class
2726
+ // anywhere in the result means one marked line above.
2727
+ const marked = r.extensions.some(e => binaryIsv.has(e.className.toLowerCase()));
2728
+ return marked ? `${out}${BINARY_ISV_LIST_FOOTNOTE}\n` : out;
2729
+ }
2730
+ function formatCocExtensionList(r, methodNameFilter, source, binaryIsv) {
2706
2731
  let out = `CoC Extensions of: ${r.baseClassName}\n`;
2707
2732
  out += `_Source: ${source}_\n\n`;
2708
2733
  if (r.count === 0) {
@@ -2722,7 +2747,7 @@ function formatCocExtensions(r, methodNameFilter, source) {
2722
2747
  const unique = [...byClassName.values()];
2723
2748
  if (!methodNameFilter) {
2724
2749
  out += `Found ${unique.length} extension class(es):\n\n`;
2725
- return out + formatCocGroups(unique);
2750
+ return out + formatCocGroups(unique, binaryIsv);
2726
2751
  }
2727
2752
  // With a method filter, "Found N … wrapping m" counts only the classes whose wrap list names
2728
2753
  // m. It used to count every class with an EMPTY list as well — a leftover from when the list
@@ -2744,18 +2769,18 @@ function formatCocExtensions(r, methodNameFilter, source) {
2744
2769
  others.push(ext);
2745
2770
  }
2746
2771
  out += `Found ${wrappers.length} extension class(es) wrapping "${methodNameFilter}":\n\n`;
2747
- out += formatCocGroups(wrappers);
2772
+ out += formatCocGroups(wrappers, binaryIsv);
2748
2773
  if (others.length > 0) {
2749
2774
  out += `Other extension classes of ${r.baseClassName} (no wrap of "${methodNameFilter}" recorded): ${others.length}\n\n`;
2750
- out += formatCocGroups(others);
2775
+ out += formatCocGroups(others, binaryIsv);
2751
2776
  }
2752
2777
  if (unknown.length > 0) {
2753
2778
  out += `Extension classes of ${r.baseClassName}, wraps unknown (the source sent no wrap list): ${unknown.length}\n\n`;
2754
- out += formatCocGroups(unknown);
2779
+ out += formatCocGroups(unknown, binaryIsv);
2755
2780
  }
2756
2781
  return out;
2757
2782
  }
2758
- function formatCocGroups(extensions) {
2783
+ function formatCocGroups(extensions, binaryIsv) {
2759
2784
  let out = '';
2760
2785
  // Grouped by the element each class actually extends, never pooled into one list. A name can
2761
2786
  // denote several objects at once — "SalesTable" is a table (14 extensions) AND a form (17),
@@ -2777,8 +2802,10 @@ function formatCocGroups(extensions) {
2777
2802
  out += `### ${describeXrefElement(element)} — ${exts.length}\n\n`;
2778
2803
  for (const ext of exts) {
2779
2804
  out += `- **${ext.className}**`;
2780
- if (ext.module)
2781
- out += ` (${ext.module})`;
2805
+ const binary = binaryIsv.has(ext.className.toLowerCase());
2806
+ if (ext.module || binary) {
2807
+ out += ` (${[ext.module, binary ? BINARY_ISV_NOTE : ''].filter(Boolean).join(', ')})`;
2808
+ }
2782
2809
  if (ext.wrappedMethods && ext.wrappedMethods.length > 0) {
2783
2810
  // Deliberately no `Uses 'next' keyword: ✓` line on THIS path, unlike the index /
2784
2811
  // filesystem path in findCocExtensions.ts. That one earns it — fsExtensionScanner
@@ -80,7 +80,7 @@ export interface BridgeClientOptions {
80
80
  }
81
81
  export declare class BridgeClient extends EventEmitter {
82
82
  private process;
83
- private buffer;
83
+ private lineReader;
84
84
  private requestId;
85
85
  private pending;
86
86
  private readyPayload;