@microsoft/teamsfx-core 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (916) hide show
  1. package/build/client/aadAppClient.d.ts +0 -6
  2. package/build/client/aadAppClient.d.ts.map +1 -1
  3. package/build/client/aadAppClient.js +8 -6
  4. package/build/client/aadAppClient.js.map +1 -1
  5. package/build/client/graphClient.d.ts +4 -4
  6. package/build/client/graphClient.d.ts.map +1 -1
  7. package/build/client/graphClient.js +91 -23
  8. package/build/client/graphClient.js.map +1 -1
  9. package/build/client/teamsDevPortalClient.d.ts +2 -6
  10. package/build/client/teamsDevPortalClient.d.ts.map +1 -1
  11. package/build/client/teamsDevPortalClient.js +97 -120
  12. package/build/client/teamsDevPortalClient.js.map +1 -1
  13. package/build/client/teamsGraphClient.d.ts +20 -0
  14. package/build/client/teamsGraphClient.d.ts.map +1 -0
  15. package/build/client/teamsGraphClient.js +152 -0
  16. package/build/client/teamsGraphClient.js.map +1 -0
  17. package/build/common/accountUtils.d.ts +3 -2
  18. package/build/common/accountUtils.d.ts.map +1 -1
  19. package/build/common/accountUtils.js +7 -2
  20. package/build/common/accountUtils.js.map +1 -1
  21. package/build/common/constants.d.ts +5 -1
  22. package/build/common/constants.d.ts.map +1 -1
  23. package/build/common/constants.js +20 -5
  24. package/build/common/constants.js.map +1 -1
  25. package/build/common/daSpecParser.d.ts +2 -1
  26. package/build/common/daSpecParser.d.ts.map +1 -1
  27. package/build/common/daSpecParser.js +214 -21
  28. package/build/common/daSpecParser.js.map +1 -1
  29. package/build/common/featureFlags.d.ts +22 -5
  30. package/build/common/featureFlags.d.ts.map +1 -1
  31. package/build/common/featureFlags.js +40 -9
  32. package/build/common/featureFlags.js.map +1 -1
  33. package/build/common/fetchHelper.d.ts.map +1 -1
  34. package/build/common/fetchHelper.js +41 -3
  35. package/build/common/fetchHelper.js.map +1 -1
  36. package/build/common/globalVars.d.ts +1 -1
  37. package/build/common/globalVars.d.ts.map +1 -1
  38. package/build/common/globalVars.js.map +1 -1
  39. package/build/common/httpProxy.d.ts +21 -0
  40. package/build/common/httpProxy.d.ts.map +1 -0
  41. package/build/common/httpProxy.js +117 -0
  42. package/build/common/httpProxy.js.map +1 -0
  43. package/build/common/kiotaClient.d.ts +3 -3
  44. package/build/common/kiotaClient.d.ts.map +1 -1
  45. package/build/common/kiotaClient.js +10 -10
  46. package/build/common/kiotaClient.js.map +1 -1
  47. package/build/common/mcpToolFetcher.d.ts +90 -0
  48. package/build/common/mcpToolFetcher.d.ts.map +1 -0
  49. package/build/common/mcpToolFetcher.js +404 -0
  50. package/build/common/mcpToolFetcher.js.map +1 -0
  51. package/build/common/odrProvider.d.ts +43 -0
  52. package/build/common/odrProvider.d.ts.map +1 -0
  53. package/build/common/odrProvider.js +154 -0
  54. package/build/common/odrProvider.js.map +1 -0
  55. package/build/common/openApiParserOptions.d.ts +3 -0
  56. package/build/common/openApiParserOptions.d.ts.map +1 -0
  57. package/build/common/openApiParserOptions.js +61 -0
  58. package/build/common/openApiParserOptions.js.map +1 -0
  59. package/build/common/projectSettingsHelper.d.ts +0 -2
  60. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  61. package/build/common/projectSettingsHelper.js +1 -59
  62. package/build/common/projectSettingsHelper.js.map +1 -1
  63. package/build/common/retryHandler.d.ts +5 -0
  64. package/build/common/retryHandler.d.ts.map +1 -0
  65. package/build/common/retryHandler.js +27 -0
  66. package/build/common/retryHandler.js.map +1 -0
  67. package/build/common/samples.d.ts +1 -1
  68. package/build/common/samples.js +1 -1
  69. package/build/common/secretmasker/dict.d.ts.map +1 -1
  70. package/build/common/secretmasker/dict.js +5 -2
  71. package/build/common/secretmasker/dict.js.map +1 -1
  72. package/build/common/secretmasker/feature.js.map +1 -1
  73. package/build/common/teamsGraphApiNames.d.ts +10 -0
  74. package/build/common/teamsGraphApiNames.d.ts.map +1 -0
  75. package/build/common/teamsGraphApiNames.js +16 -0
  76. package/build/common/teamsGraphApiNames.js.map +1 -0
  77. package/build/common/telemetry.d.ts +6 -15
  78. package/build/common/telemetry.d.ts.map +1 -1
  79. package/build/common/telemetry.js +9 -20
  80. package/build/common/telemetry.js.map +1 -1
  81. package/build/common/templates-config.json +10 -3
  82. package/build/common/tools.d.ts +1 -1
  83. package/build/common/tools.d.ts.map +1 -1
  84. package/build/common/tools.js +6 -6
  85. package/build/common/tools.js.map +1 -1
  86. package/build/common/wrappedAxiosClient.d.ts +11 -2
  87. package/build/common/wrappedAxiosClient.d.ts.map +1 -1
  88. package/build/common/wrappedAxiosClient.js +147 -59
  89. package/build/common/wrappedAxiosClient.js.map +1 -1
  90. package/build/component/configManager/actionInjector.d.ts +16 -1
  91. package/build/component/configManager/actionInjector.d.ts.map +1 -1
  92. package/build/component/configManager/actionInjector.js +106 -1
  93. package/build/component/configManager/actionInjector.js.map +1 -1
  94. package/build/component/configManager/lifecycle.d.ts.map +1 -1
  95. package/build/component/configManager/lifecycle.js +9 -0
  96. package/build/component/configManager/lifecycle.js.map +1 -1
  97. package/build/component/configManager/parser.js.map +1 -1
  98. package/build/component/configManager/validator.d.ts.map +1 -1
  99. package/build/component/configManager/validator.js +2 -0
  100. package/build/component/configManager/validator.js.map +1 -1
  101. package/build/component/coordinator/index.d.ts.map +1 -1
  102. package/build/component/coordinator/index.js +13 -11
  103. package/build/component/coordinator/index.js.map +1 -1
  104. package/build/component/deps-checker/internal/dotnetChecker.js.map +1 -1
  105. package/build/component/deps-checker/internal/funcToolChecker.js +6 -7
  106. package/build/component/deps-checker/internal/funcToolChecker.js.map +1 -1
  107. package/build/component/deps-checker/internal/nodeChecker.js +1 -1
  108. package/build/component/deps-checker/internal/nodeChecker.js.map +1 -1
  109. package/build/component/deps-checker/internal/testToolChecker.js +13 -13
  110. package/build/component/deps-checker/internal/testToolChecker.js.map +1 -1
  111. package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
  112. package/build/component/developerPortalScaffoldUtils.js +5 -5
  113. package/build/component/developerPortalScaffoldUtils.js.map +1 -1
  114. package/build/component/driver/aad/utility/aadManifestHelper.d.ts +1 -1
  115. package/build/component/driver/aad/utility/aadManifestHelper.d.ts.map +1 -1
  116. package/build/component/driver/aad/utility/aadManifestHelper.js +7 -4
  117. package/build/component/driver/aad/utility/aadManifestHelper.js.map +1 -1
  118. package/build/component/driver/add/addWebPart.js +3 -3
  119. package/build/component/driver/add/addWebPart.js.map +1 -1
  120. package/build/component/driver/apiKey/create.d.ts.map +1 -1
  121. package/build/component/driver/apiKey/create.js +4 -4
  122. package/build/component/driver/apiKey/create.js.map +1 -1
  123. package/build/component/driver/apiKey/update.d.ts.map +1 -1
  124. package/build/component/driver/apiKey/update.js +4 -4
  125. package/build/component/driver/apiKey/update.js.map +1 -1
  126. package/build/component/driver/arm/util/handleError.js +5 -4
  127. package/build/component/driver/arm/util/handleError.js.map +1 -1
  128. package/build/component/driver/copilotAgent/interfaces/PublishArgs.d.ts +14 -0
  129. package/build/component/driver/copilotAgent/interfaces/PublishArgs.d.ts.map +1 -0
  130. package/build/component/driver/copilotAgent/interfaces/PublishArgs.js +5 -0
  131. package/build/component/driver/copilotAgent/interfaces/PublishArgs.js.map +1 -0
  132. package/build/component/driver/copilotAgent/publish.d.ts +16 -0
  133. package/build/component/driver/copilotAgent/publish.d.ts.map +1 -0
  134. package/build/component/driver/copilotAgent/publish.js +175 -0
  135. package/build/component/driver/copilotAgent/publish.js.map +1 -0
  136. package/build/component/driver/dcr/create.d.ts +10 -0
  137. package/build/component/driver/dcr/create.d.ts.map +1 -0
  138. package/build/component/driver/dcr/create.js +142 -0
  139. package/build/component/driver/dcr/create.js.map +1 -0
  140. package/build/component/driver/dcr/error/dcrNameTooLong.d.ts +5 -0
  141. package/build/component/driver/dcr/error/dcrNameTooLong.d.ts.map +1 -0
  142. package/build/component/driver/dcr/error/dcrNameTooLong.js +21 -0
  143. package/build/component/driver/dcr/error/dcrNameTooLong.js.map +1 -0
  144. package/build/component/driver/dcr/error/dcrWellKnownInvalid.d.ts +5 -0
  145. package/build/component/driver/dcr/error/dcrWellKnownInvalid.d.ts.map +1 -0
  146. package/build/component/driver/dcr/error/dcrWellKnownInvalid.js +21 -0
  147. package/build/component/driver/dcr/error/dcrWellKnownInvalid.js.map +1 -0
  148. package/build/component/driver/dcr/interface/createDcrArgs.d.ts +9 -0
  149. package/build/component/driver/dcr/interface/createDcrArgs.d.ts.map +1 -0
  150. package/build/component/driver/dcr/interface/createDcrArgs.js +5 -0
  151. package/build/component/driver/dcr/interface/createDcrArgs.js.map +1 -0
  152. package/build/component/driver/dcr/interface/createDcrOutputs.d.ts +7 -0
  153. package/build/component/driver/dcr/interface/createDcrOutputs.d.ts.map +1 -0
  154. package/build/component/driver/dcr/interface/createDcrOutputs.js +10 -0
  155. package/build/component/driver/dcr/interface/createDcrOutputs.js.map +1 -0
  156. package/build/component/driver/dcr/utility/constants.d.ts +7 -0
  157. package/build/component/driver/dcr/utility/constants.d.ts.map +1 -0
  158. package/build/component/driver/dcr/utility/constants.js +12 -0
  159. package/build/component/driver/dcr/utility/constants.js.map +1 -0
  160. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.d.ts +3 -1
  161. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.d.ts.map +1 -1
  162. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.js +12 -9
  163. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.js.map +1 -1
  164. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts +3 -0
  165. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
  166. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +38 -3
  167. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
  168. package/build/component/driver/devTool/httpClient.d.ts +4 -0
  169. package/build/component/driver/devTool/httpClient.d.ts.map +1 -1
  170. package/build/component/driver/devTool/httpClient.js +6 -3
  171. package/build/component/driver/devTool/httpClient.js.map +1 -1
  172. package/build/component/driver/index.d.ts +2 -0
  173. package/build/component/driver/index.d.ts.map +1 -1
  174. package/build/component/driver/index.js +2 -0
  175. package/build/component/driver/index.js.map +1 -1
  176. package/build/component/driver/m365/acquire.d.ts.map +1 -1
  177. package/build/component/driver/m365/acquire.js +4 -3
  178. package/build/component/driver/m365/acquire.js.map +1 -1
  179. package/build/component/driver/oauth/create.d.ts.map +1 -1
  180. package/build/component/driver/oauth/create.js +5 -4
  181. package/build/component/driver/oauth/create.js.map +1 -1
  182. package/build/component/driver/oauth/update.d.ts.map +1 -1
  183. package/build/component/driver/oauth/update.js +5 -5
  184. package/build/component/driver/oauth/update.js.map +1 -1
  185. package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
  186. package/build/component/driver/script/scriptDriver.js +3 -2
  187. package/build/component/driver/script/scriptDriver.js.map +1 -1
  188. package/build/component/driver/share/utils.d.ts.map +1 -1
  189. package/build/component/driver/share/utils.js +9 -7
  190. package/build/component/driver/share/utils.js.map +1 -1
  191. package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
  192. package/build/component/driver/teamsApp/appStudio.js +1 -1
  193. package/build/component/driver/teamsApp/appStudio.js.map +1 -1
  194. package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
  195. package/build/component/driver/teamsApp/configure.js +7 -0
  196. package/build/component/driver/teamsApp/configure.js.map +1 -1
  197. package/build/component/driver/teamsApp/constants.d.ts +9 -3
  198. package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
  199. package/build/component/driver/teamsApp/constants.js +11 -4
  200. package/build/component/driver/teamsApp/constants.js.map +1 -1
  201. package/build/component/driver/teamsApp/create.d.ts.map +1 -1
  202. package/build/component/driver/teamsApp/create.js +19 -1
  203. package/build/component/driver/teamsApp/create.js.map +1 -1
  204. package/build/component/driver/teamsApp/createAppPackage.d.ts +3 -0
  205. package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
  206. package/build/component/driver/teamsApp/createAppPackage.js +130 -11
  207. package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
  208. package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts +10 -0
  209. package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts.map +1 -0
  210. package/build/component/driver/teamsApp/interfaces/DcrRegistration.js +5 -0
  211. package/build/component/driver/teamsApp/interfaces/DcrRegistration.js.map +1 -0
  212. package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts +4 -0
  213. package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts.map +1 -1
  214. package/build/component/driver/teamsApp/interfaces/OauthRegistration.js.map +1 -1
  215. package/build/component/driver/teamsApp/interfaces/ValidationResult.d.ts +6 -0
  216. package/build/component/driver/teamsApp/interfaces/ValidationResult.d.ts.map +1 -1
  217. package/build/component/driver/teamsApp/publishAppPackage.d.ts +0 -2
  218. package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
  219. package/build/component/driver/teamsApp/publishAppPackage.js +19 -60
  220. package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
  221. package/build/component/driver/teamsApp/syncManifest.d.ts +3 -3
  222. package/build/component/driver/teamsApp/syncManifest.d.ts.map +1 -1
  223. package/build/component/driver/teamsApp/syncManifest.js +8 -8
  224. package/build/component/driver/teamsApp/syncManifest.js.map +1 -1
  225. package/build/component/driver/teamsApp/teamsappMgr.d.ts +4 -0
  226. package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -1
  227. package/build/component/driver/teamsApp/teamsappMgr.js +6 -3
  228. package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -1
  229. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts +2 -0
  230. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts.map +1 -1
  231. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js +120 -5
  232. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
  233. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +1 -1
  234. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
  235. package/build/component/driver/teamsApp/utils/ManifestUtils.js +10 -2
  236. package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
  237. package/build/component/driver/teamsApp/utils/McpCertVerification.d.ts +17 -0
  238. package/build/component/driver/teamsApp/utils/McpCertVerification.d.ts.map +1 -0
  239. package/build/component/driver/teamsApp/utils/McpCertVerification.js +72 -0
  240. package/build/component/driver/teamsApp/utils/McpCertVerification.js.map +1 -0
  241. package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts.map +1 -1
  242. package/build/component/driver/teamsApp/utils/PluginManifestUtils.js +1 -1
  243. package/build/component/driver/teamsApp/utils/PluginManifestUtils.js.map +1 -1
  244. package/build/component/driver/teamsApp/utils/telemetry.d.ts +1 -0
  245. package/build/component/driver/teamsApp/utils/telemetry.d.ts.map +1 -1
  246. package/build/component/driver/teamsApp/utils/telemetry.js +1 -0
  247. package/build/component/driver/teamsApp/utils/telemetry.js.map +1 -1
  248. package/build/component/driver/teamsApp/utils/utils.d.ts +1 -4
  249. package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
  250. package/build/component/driver/teamsApp/utils/utils.js +3 -25
  251. package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
  252. package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
  253. package/build/component/driver/teamsApp/validate.js +16 -5
  254. package/build/component/driver/teamsApp/validate.js.map +1 -1
  255. package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
  256. package/build/component/driver/teamsApp/validateAppPackage.js +7 -0
  257. package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
  258. package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
  259. package/build/component/driver/typeSpec/compile.d.ts.map +1 -1
  260. package/build/component/driver/typeSpec/compile.js +23 -7
  261. package/build/component/driver/typeSpec/compile.js.map +1 -1
  262. package/build/component/driver/typeSpec/error/typeSpecCompileError.d.ts +5 -0
  263. package/build/component/driver/typeSpec/error/typeSpecCompileError.d.ts.map +1 -0
  264. package/build/component/driver/typeSpec/error/typeSpecCompileError.js +21 -0
  265. package/build/component/driver/typeSpec/error/typeSpecCompileError.js.map +1 -0
  266. package/build/component/generator/combinedProject/generator.d.ts.map +1 -1
  267. package/build/component/generator/combinedProject/generator.js +9 -1
  268. package/build/component/generator/combinedProject/generator.js.map +1 -1
  269. package/build/component/generator/declarativeAgent/generator.d.ts +7 -0
  270. package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
  271. package/build/component/generator/declarativeAgent/generator.js +23 -15
  272. package/build/component/generator/declarativeAgent/generator.js.map +1 -1
  273. package/build/component/generator/declarativeAgent/helper.d.ts +52 -0
  274. package/build/component/generator/declarativeAgent/helper.d.ts.map +1 -1
  275. package/build/component/generator/declarativeAgent/helper.js +469 -63
  276. package/build/component/generator/declarativeAgent/helper.js.map +1 -1
  277. package/build/component/generator/defaultGenerator.d.ts.map +1 -1
  278. package/build/component/generator/defaultGenerator.js +17 -1
  279. package/build/component/generator/defaultGenerator.js.map +1 -1
  280. package/build/component/generator/error.d.ts +3 -0
  281. package/build/component/generator/error.d.ts.map +1 -1
  282. package/build/component/generator/error.js +7 -1
  283. package/build/component/generator/error.js.map +1 -1
  284. package/build/component/generator/generatorAction.d.ts +12 -1
  285. package/build/component/generator/generatorAction.d.ts.map +1 -1
  286. package/build/component/generator/generatorAction.js +16 -8
  287. package/build/component/generator/generatorAction.js.map +1 -1
  288. package/build/component/generator/officeAddin/generator.d.ts +13 -0
  289. package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
  290. package/build/component/generator/officeAddin/generator.js +159 -35
  291. package/build/component/generator/officeAddin/generator.js.map +1 -1
  292. package/build/component/generator/officeAddin/helperMethods.d.ts +4 -0
  293. package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
  294. package/build/component/generator/officeAddin/helperMethods.js +6 -3
  295. package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
  296. package/build/component/generator/openApiSpec/customEngineAgentGenerator.d.ts +8 -0
  297. package/build/component/generator/openApiSpec/customEngineAgentGenerator.d.ts.map +1 -1
  298. package/build/component/generator/openApiSpec/customEngineAgentGenerator.js +9 -4
  299. package/build/component/generator/openApiSpec/customEngineAgentGenerator.js.map +1 -1
  300. package/build/component/generator/openApiSpec/helper.d.ts +2 -3
  301. package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
  302. package/build/component/generator/openApiSpec/helper.js +19 -57
  303. package/build/component/generator/openApiSpec/helper.js.map +1 -1
  304. package/build/component/generator/openPlugin/authorParser.d.ts +8 -0
  305. package/build/component/generator/openPlugin/authorParser.d.ts.map +1 -0
  306. package/build/component/generator/openPlugin/authorParser.js +49 -0
  307. package/build/component/generator/openPlugin/authorParser.js.map +1 -0
  308. package/build/component/generator/openPlugin/deterministicId.d.ts +6 -0
  309. package/build/component/generator/openPlugin/deterministicId.d.ts.map +1 -0
  310. package/build/component/generator/openPlugin/deterministicId.js +31 -0
  311. package/build/component/generator/openPlugin/deterministicId.js.map +1 -0
  312. package/build/component/generator/openPlugin/exporter.d.ts +18 -0
  313. package/build/component/generator/openPlugin/exporter.d.ts.map +1 -0
  314. package/build/component/generator/openPlugin/exporter.js +233 -0
  315. package/build/component/generator/openPlugin/exporter.js.map +1 -0
  316. package/build/component/generator/openPlugin/iconStrategy.d.ts +8 -0
  317. package/build/component/generator/openPlugin/iconStrategy.d.ts.map +1 -0
  318. package/build/component/generator/openPlugin/iconStrategy.js +62 -0
  319. package/build/component/generator/openPlugin/iconStrategy.js.map +1 -0
  320. package/build/component/generator/openPlugin/importer.d.ts +25 -0
  321. package/build/component/generator/openPlugin/importer.d.ts.map +1 -0
  322. package/build/component/generator/openPlugin/importer.js +140 -0
  323. package/build/component/generator/openPlugin/importer.js.map +1 -0
  324. package/build/component/generator/openPlugin/mapper.d.ts +6 -0
  325. package/build/component/generator/openPlugin/mapper.d.ts.map +1 -0
  326. package/build/component/generator/openPlugin/mapper.js +141 -0
  327. package/build/component/generator/openPlugin/mapper.js.map +1 -0
  328. package/build/component/generator/openPlugin/parser.d.ts +3 -0
  329. package/build/component/generator/openPlugin/parser.d.ts.map +1 -0
  330. package/build/component/generator/openPlugin/parser.js +153 -0
  331. package/build/component/generator/openPlugin/parser.js.map +1 -0
  332. package/build/component/generator/openPlugin/placeholderPng.d.ts +6 -0
  333. package/build/component/generator/openPlugin/placeholderPng.d.ts.map +1 -0
  334. package/build/component/generator/openPlugin/placeholderPng.js +71 -0
  335. package/build/component/generator/openPlugin/placeholderPng.js.map +1 -0
  336. package/build/component/generator/openPlugin/textUtils.d.ts +12 -0
  337. package/build/component/generator/openPlugin/textUtils.d.ts.map +1 -0
  338. package/build/component/generator/openPlugin/textUtils.js +43 -0
  339. package/build/component/generator/openPlugin/textUtils.js.map +1 -0
  340. package/build/component/generator/openPlugin/types.d.ts +128 -0
  341. package/build/component/generator/openPlugin/types.d.ts.map +1 -0
  342. package/build/component/generator/openPlugin/types.js.map +1 -0
  343. package/build/component/generator/other/tdpGenerator.d.ts +1 -0
  344. package/build/component/generator/other/tdpGenerator.d.ts.map +1 -1
  345. package/build/component/generator/other/tdpGenerator.js +24 -2
  346. package/build/component/generator/other/tdpGenerator.js.map +1 -1
  347. package/build/component/generator/spfx/utils/constants.d.ts +1 -1
  348. package/build/component/generator/spfx/utils/constants.js +1 -1
  349. package/build/component/generator/spfx/utils/utils.js +1 -1
  350. package/build/component/generator/spfx/utils/utils.js.map +1 -1
  351. package/build/component/generator/templateHelper.d.ts +17 -2
  352. package/build/component/generator/templateHelper.d.ts.map +1 -1
  353. package/build/component/generator/templateHelper.js +36 -3
  354. package/build/component/generator/templateHelper.js.map +1 -1
  355. package/build/component/generator/templates/metadata/index.d.ts +15 -0
  356. package/build/component/generator/templates/metadata/index.d.ts.map +1 -1
  357. package/build/component/generator/templates/metadata/index.js +51 -5
  358. package/build/component/generator/templates/metadata/index.js.map +1 -1
  359. package/build/component/generator/templates/templateNames.d.ts +6 -3
  360. package/build/component/generator/templates/templateNames.d.ts.map +1 -1
  361. package/build/component/generator/templates/templateNames.js +7 -2
  362. package/build/component/generator/templates/templateNames.js.map +1 -1
  363. package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -1
  364. package/build/component/generator/templates/templateReplaceMap.js +4 -1
  365. package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
  366. package/build/component/generator/utils.d.ts.map +1 -1
  367. package/build/component/generator/utils.js +14 -8
  368. package/build/component/generator/utils.js.map +1 -1
  369. package/build/component/generator/v4MetadataSource.d.ts +16 -0
  370. package/build/component/generator/v4MetadataSource.d.ts.map +1 -0
  371. package/build/component/generator/v4MetadataSource.js +35 -0
  372. package/build/component/generator/v4MetadataSource.js.map +1 -0
  373. package/build/component/generator/v4TemplateBridge.d.ts +55 -0
  374. package/build/component/generator/v4TemplateBridge.d.ts.map +1 -0
  375. package/build/component/generator/v4TemplateBridge.js +224 -0
  376. package/build/component/generator/v4TemplateBridge.js.map +1 -0
  377. package/build/component/local/localCertificateManager.d.ts +16 -1
  378. package/build/component/local/localCertificateManager.d.ts.map +1 -1
  379. package/build/component/local/localCertificateManager.js +47 -31
  380. package/build/component/local/localCertificateManager.js.map +1 -1
  381. package/build/component/m365/constants.d.ts +2 -1
  382. package/build/component/m365/constants.d.ts.map +1 -1
  383. package/build/component/m365/constants.js +1 -0
  384. package/build/component/m365/constants.js.map +1 -1
  385. package/build/component/m365/launchHelper.d.ts.map +1 -1
  386. package/build/component/m365/launchHelper.js +7 -2
  387. package/build/component/m365/launchHelper.js.map +1 -1
  388. package/build/component/m365/packageService.d.ts +7 -0
  389. package/build/component/m365/packageService.d.ts.map +1 -1
  390. package/build/component/m365/packageService.js +79 -13
  391. package/build/component/m365/packageService.js.map +1 -1
  392. package/build/component/m365/serviceConstant.d.ts.map +1 -1
  393. package/build/component/m365/serviceConstant.js +24 -4
  394. package/build/component/m365/serviceConstant.js.map +1 -1
  395. package/build/component/middleware/envMW.d.ts.map +1 -1
  396. package/build/component/middleware/envMW.js +5 -0
  397. package/build/component/middleware/envMW.js.map +1 -1
  398. package/build/component/provisionUtils.d.ts.map +1 -1
  399. package/build/component/provisionUtils.js +5 -2
  400. package/build/component/provisionUtils.js.map +1 -1
  401. package/build/component/utils/ResourceGroupHelper.d.ts +4 -0
  402. package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
  403. package/build/component/utils/ResourceGroupHelper.js +8 -4
  404. package/build/component/utils/ResourceGroupHelper.js.map +1 -1
  405. package/build/component/utils/charsetUtils.js +3 -3
  406. package/build/component/utils/charsetUtils.js.map +1 -1
  407. package/build/component/utils/envUtil.d.ts.map +1 -1
  408. package/build/component/utils/envUtil.js +2 -2
  409. package/build/component/utils/envUtil.js.map +1 -1
  410. package/build/component/utils/fileOperation.d.ts +9 -0
  411. package/build/component/utils/fileOperation.d.ts.map +1 -1
  412. package/build/component/utils/fileOperation.js +31 -17
  413. package/build/component/utils/fileOperation.js.map +1 -1
  414. package/build/component/utils/mcpAuthScaffolder.d.ts +137 -0
  415. package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -0
  416. package/build/component/utils/mcpAuthScaffolder.js +200 -0
  417. package/build/component/utils/mcpAuthScaffolder.js.map +1 -0
  418. package/build/component/utils/mcpToolFetcher.d.ts +2 -0
  419. package/build/component/utils/mcpToolFetcher.d.ts.map +1 -0
  420. package/build/component/utils/mcpToolFetcher.js +7 -0
  421. package/build/component/utils/mcpToolFetcher.js.map +1 -0
  422. package/build/component/utils/metadataGraphPermssion.d.ts +4 -0
  423. package/build/component/utils/metadataGraphPermssion.d.ts.map +1 -1
  424. package/build/component/utils/metadataGraphPermssion.js +7 -4
  425. package/build/component/utils/metadataGraphPermssion.js.map +1 -1
  426. package/build/component/utils/odrProvider.d.ts +1 -48
  427. package/build/component/utils/odrProvider.d.ts.map +1 -1
  428. package/build/component/utils/odrProvider.js +2 -94
  429. package/build/component/utils/odrProvider.js.map +1 -1
  430. package/build/core/FxCore.d.ts +45 -13
  431. package/build/core/FxCore.d.ts.map +1 -1
  432. package/build/core/FxCore.declarativeAgent.d.ts +45 -1
  433. package/build/core/FxCore.declarativeAgent.d.ts.map +1 -1
  434. package/build/core/FxCore.declarativeAgent.js +747 -56
  435. package/build/core/FxCore.declarativeAgent.js.map +1 -1
  436. package/build/core/FxCore.js +462 -305
  437. package/build/core/FxCore.js.map +1 -1
  438. package/build/core/FxCore.openPlugin.d.ts +23 -0
  439. package/build/core/FxCore.openPlugin.d.ts.map +1 -0
  440. package/build/core/FxCore.openPlugin.js +131 -0
  441. package/build/core/FxCore.openPlugin.js.map +1 -0
  442. package/build/core/collaborator.d.ts.map +1 -1
  443. package/build/core/createFrontDoorAdapters.d.ts +39 -0
  444. package/build/core/createFrontDoorAdapters.d.ts.map +1 -0
  445. package/build/core/createFrontDoorAdapters.js +210 -0
  446. package/build/core/createFrontDoorAdapters.js.map +1 -0
  447. package/build/core/createProjectFrontDoor.d.ts +49 -0
  448. package/build/core/createProjectFrontDoor.d.ts.map +1 -0
  449. package/build/core/createProjectFrontDoor.js +351 -0
  450. package/build/core/createProjectFrontDoor.js.map +1 -0
  451. package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
  452. package/build/core/middleware/concurrentLocker.js +7 -10
  453. package/build/core/middleware/concurrentLocker.js.map +1 -1
  454. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  455. package/build/core/middleware/errorHandler.js +9 -0
  456. package/build/core/middleware/errorHandler.js.map +1 -1
  457. package/build/core/middleware/fileLocker.js +6 -6
  458. package/build/core/middleware/fileLocker.js.map +1 -1
  459. package/build/core/middleware/utils/v3MigrationUtils.d.ts +1 -34
  460. package/build/core/middleware/utils/v3MigrationUtils.d.ts.map +1 -1
  461. package/build/core/middleware/utils/v3MigrationUtils.js +6 -245
  462. package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
  463. package/build/core/modifyProjectFrontDoor.d.ts +27 -0
  464. package/build/core/modifyProjectFrontDoor.d.ts.map +1 -0
  465. package/build/core/modifyProjectFrontDoor.js +149 -0
  466. package/build/core/modifyProjectFrontDoor.js.map +1 -0
  467. package/build/core/v4ArtifactSnapshot.d.ts +5 -0
  468. package/build/core/v4ArtifactSnapshot.d.ts.map +1 -0
  469. package/build/core/v4ArtifactSnapshot.js +23 -0
  470. package/build/core/v4ArtifactSnapshot.js.map +1 -0
  471. package/build/error/common.d.ts.map +1 -1
  472. package/build/error/common.js +3 -0
  473. package/build/error/common.js.map +1 -1
  474. package/build/error/teamsApp.d.ts +3 -0
  475. package/build/error/teamsApp.d.ts.map +1 -1
  476. package/build/error/teamsApp.js +15 -1
  477. package/build/error/teamsApp.js.map +1 -1
  478. package/build/error/teamsGraph.d.ts +5 -0
  479. package/build/error/teamsGraph.d.ts.map +1 -0
  480. package/build/error/teamsGraph.js +24 -0
  481. package/build/error/teamsGraph.js.map +1 -0
  482. package/build/index.d.ts +5 -2
  483. package/build/index.d.ts.map +1 -1
  484. package/build/index.js +15 -2
  485. package/build/index.js.map +1 -1
  486. package/build/question/constants.d.ts +1 -0
  487. package/build/question/constants.d.ts.map +1 -1
  488. package/build/question/constants.js +15 -8
  489. package/build/question/constants.js.map +1 -1
  490. package/build/question/create.d.ts +18 -0
  491. package/build/question/create.d.ts.map +1 -1
  492. package/build/question/create.js +121 -14
  493. package/build/question/create.js.map +1 -1
  494. package/build/question/index.d.ts +1 -1
  495. package/build/question/index.d.ts.map +1 -1
  496. package/build/question/index.js +4 -4
  497. package/build/question/index.js.map +1 -1
  498. package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
  499. package/build/question/inputs/AddPluginInputs.d.ts +17 -5
  500. package/build/question/inputs/AddPluginInputs.d.ts.map +1 -1
  501. package/build/question/inputs/AddSkillInputs.d.ts +10 -0
  502. package/build/question/inputs/AddSkillInputs.d.ts.map +1 -0
  503. package/build/question/inputs/AddSkillInputs.js +5 -0
  504. package/build/question/inputs/AddSkillInputs.js.map +1 -0
  505. package/build/question/inputs/CreateProjectInputs.d.ts +19 -1
  506. package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
  507. package/build/question/inputs/ExportOpenPluginInputs.d.ts +10 -0
  508. package/build/question/inputs/ExportOpenPluginInputs.d.ts.map +1 -0
  509. package/build/question/inputs/ExportOpenPluginInputs.js +5 -0
  510. package/build/question/inputs/ExportOpenPluginInputs.js.map +1 -0
  511. package/build/question/inputs/ImportOpenPluginInputs.d.ts +28 -0
  512. package/build/question/inputs/ImportOpenPluginInputs.d.ts.map +1 -0
  513. package/build/question/inputs/ImportOpenPluginInputs.js +5 -0
  514. package/build/question/inputs/ImportOpenPluginInputs.js.map +1 -0
  515. package/build/question/inputs/index.d.ts +4 -1
  516. package/build/question/inputs/index.d.ts.map +1 -1
  517. package/build/question/inputs/index.js +4 -1
  518. package/build/question/inputs/index.js.map +1 -1
  519. package/build/question/options/AddPluginOptions.d.ts.map +1 -1
  520. package/build/question/options/AddPluginOptions.js +38 -6
  521. package/build/question/options/AddPluginOptions.js.map +1 -1
  522. package/build/question/options/AddSkillOptions.d.ts +4 -0
  523. package/build/question/options/AddSkillOptions.d.ts.map +1 -0
  524. package/build/question/options/AddSkillOptions.js +47 -0
  525. package/build/question/options/AddSkillOptions.js.map +1 -0
  526. package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
  527. package/build/question/options/CreateProjectOptions.js +53 -1
  528. package/build/question/options/CreateProjectOptions.js.map +1 -1
  529. package/build/question/options/ExportOpenPluginOptions.d.ts +4 -0
  530. package/build/question/options/ExportOpenPluginOptions.d.ts.map +1 -0
  531. package/build/question/options/ExportOpenPluginOptions.js +29 -0
  532. package/build/question/options/ExportOpenPluginOptions.js.map +1 -0
  533. package/build/question/options/ImportOpenPluginOptions.d.ts +4 -0
  534. package/build/question/options/ImportOpenPluginOptions.d.ts.map +1 -0
  535. package/build/question/options/ImportOpenPluginOptions.js +54 -0
  536. package/build/question/options/ImportOpenPluginOptions.js.map +1 -0
  537. package/build/question/options/index.d.ts +3 -0
  538. package/build/question/options/index.d.ts.map +1 -1
  539. package/build/question/options/index.js +3 -0
  540. package/build/question/options/index.js.map +1 -1
  541. package/build/question/other.d.ts +1 -1
  542. package/build/question/other.d.ts.map +1 -1
  543. package/build/question/other.js +195 -17
  544. package/build/question/other.js.map +1 -1
  545. package/build/question/questionNames.d.ts +14 -1
  546. package/build/question/questionNames.d.ts.map +1 -1
  547. package/build/question/questionNames.js +13 -0
  548. package/build/question/questionNames.js.map +1 -1
  549. package/build/question/scaffold/commonNodes.d.ts.map +1 -1
  550. package/build/question/scaffold/commonNodes.js +14 -2
  551. package/build/question/scaffold/commonNodes.js.map +1 -1
  552. package/build/question/scaffold/constructNode.d.ts +3 -1
  553. package/build/question/scaffold/constructNode.d.ts.map +1 -1
  554. package/build/question/scaffold/constructNode.js +55 -2
  555. package/build/question/scaffold/constructNode.js.map +1 -1
  556. package/build/question/scaffold/vsc/CapabilityOptions.d.ts +3 -5
  557. package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
  558. package/build/question/scaffold/vsc/CapabilityOptions.js +46 -46
  559. package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
  560. package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts +2 -0
  561. package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts.map +1 -1
  562. package/build/question/scaffold/vsc/ProjectTypeOptions.js +9 -0
  563. package/build/question/scaffold/vsc/ProjectTypeOptions.js.map +1 -1
  564. package/build/question/scaffold/vsc/createRootNode.d.ts.map +1 -1
  565. package/build/question/scaffold/vsc/createRootNode.js +3 -0
  566. package/build/question/scaffold/vsc/createRootNode.js.map +1 -1
  567. package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
  568. package/build/question/scaffold/vsc/daProjectTypeNode.js +1 -6
  569. package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
  570. package/build/question/scaffold/vsc/rootNode.d.ts.map +1 -1
  571. package/build/question/scaffold/vsc/rootNode.js +17 -4
  572. package/build/question/scaffold/vsc/rootNode.js.map +1 -1
  573. package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +66 -0
  574. package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
  575. package/build/question/scaffold/vsc/teamsProjectTypeNode.js +408 -21
  576. package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
  577. package/build/question/share.js +3 -2
  578. package/build/question/share.js.map +1 -1
  579. package/build/ui/visitor.d.ts.map +1 -1
  580. package/build/ui/visitor.js +10 -0
  581. package/build/ui/visitor.js.map +1 -1
  582. package/build/v4/buildTarget/parseSelector.d.ts +35 -0
  583. package/build/v4/buildTarget/parseSelector.d.ts.map +1 -0
  584. package/build/v4/buildTarget/parseSelector.js +226 -0
  585. package/build/v4/buildTarget/parseSelector.js.map +1 -0
  586. package/build/v4/buildTarget/resolveBuildTarget.d.ts +85 -0
  587. package/build/v4/buildTarget/resolveBuildTarget.d.ts.map +1 -0
  588. package/build/v4/buildTarget/resolveBuildTarget.js +260 -0
  589. package/build/v4/buildTarget/resolveBuildTarget.js.map +1 -0
  590. package/build/v4/collectInputs/collectInputs.d.ts +151 -0
  591. package/build/v4/collectInputs/collectInputs.d.ts.map +1 -0
  592. package/build/v4/collectInputs/collectInputs.js +533 -0
  593. package/build/v4/collectInputs/collectInputs.js.map +1 -0
  594. package/build/v4/distribution/bundledFloor.d.ts +11 -0
  595. package/build/v4/distribution/bundledFloor.d.ts.map +1 -0
  596. package/build/v4/distribution/bundledFloor.js +114 -0
  597. package/build/v4/distribution/bundledFloor.js.map +1 -0
  598. package/build/v4/distribution/createQuestions.d.ts +6 -0
  599. package/build/v4/distribution/createQuestions.d.ts.map +1 -0
  600. package/build/v4/distribution/createQuestions.js +61 -0
  601. package/build/v4/distribution/createQuestions.js.map +1 -0
  602. package/build/v4/distribution/createSelector.d.ts +15 -0
  603. package/build/v4/distribution/createSelector.d.ts.map +1 -0
  604. package/build/v4/distribution/createSelector.js +115 -0
  605. package/build/v4/distribution/createSelector.js.map +1 -0
  606. package/build/v4/distribution/declarativePackage.d.ts +14 -0
  607. package/build/v4/distribution/declarativePackage.d.ts.map +1 -0
  608. package/build/v4/distribution/declarativePackage.js +165 -0
  609. package/build/v4/distribution/declarativePackage.js.map +1 -0
  610. package/build/v4/distribution/packageDir.d.ts +15 -0
  611. package/build/v4/distribution/packageDir.d.ts.map +1 -0
  612. package/build/v4/distribution/packageDir.js +101 -0
  613. package/build/v4/distribution/packageDir.js.map +1 -0
  614. package/build/v4/distribution/questionFragments.d.ts +11 -0
  615. package/build/v4/distribution/questionFragments.d.ts.map +1 -0
  616. package/build/v4/distribution/questionFragments.js +130 -0
  617. package/build/v4/distribution/questionFragments.js.map +1 -0
  618. package/build/v4/distribution/templateArtifacts.d.ts +61 -0
  619. package/build/v4/distribution/templateArtifacts.d.ts.map +1 -0
  620. package/build/v4/distribution/templateArtifacts.js +459 -0
  621. package/build/v4/distribution/templateArtifacts.js.map +1 -0
  622. package/build/v4/distribution/templateConfig.d.ts +43 -0
  623. package/build/v4/distribution/templateConfig.d.ts.map +1 -0
  624. package/build/v4/distribution/templateConfig.js +70 -0
  625. package/build/v4/distribution/templateConfig.js.map +1 -0
  626. package/build/v4/distribution/templatePackage.d.ts +6 -0
  627. package/build/v4/distribution/templatePackage.d.ts.map +1 -0
  628. package/build/v4/distribution/templatePackage.js +63 -0
  629. package/build/v4/distribution/templatePackage.js.map +1 -0
  630. package/build/v4/distribution/templateSource.d.ts +66 -0
  631. package/build/v4/distribution/templateSource.d.ts.map +1 -0
  632. package/build/v4/distribution/templateSource.js +233 -0
  633. package/build/v4/distribution/templateSource.js.map +1 -0
  634. package/build/v4/distribution/templateSourcePort.d.ts +27 -0
  635. package/build/v4/distribution/templateSourcePort.d.ts.map +1 -0
  636. package/build/v4/distribution/templateSourcePort.js +175 -0
  637. package/build/v4/distribution/templateSourcePort.js.map +1 -0
  638. package/build/v4/engineVersion.d.ts +7 -0
  639. package/build/v4/engineVersion.d.ts.map +1 -0
  640. package/build/v4/engineVersion.js +12 -0
  641. package/build/v4/engineVersion.js.map +1 -0
  642. package/build/v4/expression/evaluateExpression.d.ts +55 -0
  643. package/build/v4/expression/evaluateExpression.d.ts.map +1 -0
  644. package/build/v4/expression/evaluateExpression.js +338 -0
  645. package/build/v4/expression/evaluateExpression.js.map +1 -0
  646. package/build/v4/index.d.ts +41 -0
  647. package/build/v4/index.d.ts.map +1 -0
  648. package/build/v4/index.js +46 -0
  649. package/build/v4/index.js.map +1 -0
  650. package/build/v4/inspection/scaffoldCatalog.d.ts +28 -0
  651. package/build/v4/inspection/scaffoldCatalog.d.ts.map +1 -0
  652. package/build/v4/inspection/scaffoldCatalog.js +66 -0
  653. package/build/v4/inspection/scaffoldCatalog.js.map +1 -0
  654. package/build/v4/inspection/scaffoldMetadataSource.d.ts +6 -0
  655. package/build/v4/inspection/scaffoldMetadataSource.d.ts.map +1 -0
  656. package/build/v4/inspection/scaffoldMetadataSource.js +78 -0
  657. package/build/v4/inspection/scaffoldMetadataSource.js.map +1 -0
  658. package/build/v4/mcp/mcpAuthAction.d.ts +36 -0
  659. package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -0
  660. package/build/v4/mcp/mcpAuthAction.js +177 -0
  661. package/build/v4/mcp/mcpAuthAction.js.map +1 -0
  662. package/build/v4/mcp/mcpAuthScaffold.d.ts +37 -0
  663. package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -0
  664. package/build/v4/mcp/mcpAuthScaffold.js +162 -0
  665. package/build/v4/mcp/mcpAuthScaffold.js.map +1 -0
  666. package/build/v4/mcp/mcpStaticTools.d.ts +17 -0
  667. package/build/v4/mcp/mcpStaticTools.d.ts.map +1 -0
  668. package/build/v4/mcp/mcpStaticTools.js +70 -0
  669. package/build/v4/mcp/mcpStaticTools.js.map +1 -0
  670. package/build/v4/model/dataModel.d.ts +27 -0
  671. package/build/v4/model/dataModel.d.ts.map +1 -0
  672. package/build/v4/model/dataModel.js +5 -0
  673. package/build/v4/model/dataModel.js.map +1 -0
  674. package/build/v4/pipeline/runScaffoldPipeline.d.ts +101 -0
  675. package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -0
  676. package/build/v4/pipeline/runScaffoldPipeline.js +212 -0
  677. package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -0
  678. package/build/v4/providers/createOptionsProviders.d.ts +11 -0
  679. package/build/v4/providers/createOptionsProviders.d.ts.map +1 -0
  680. package/build/v4/providers/createOptionsProviders.js +268 -0
  681. package/build/v4/providers/createOptionsProviders.js.map +1 -0
  682. package/build/v4/renderContext/buildRenderContext.d.ts +24 -0
  683. package/build/v4/renderContext/buildRenderContext.d.ts.map +1 -0
  684. package/build/v4/renderContext/buildRenderContext.js +75 -0
  685. package/build/v4/renderContext/buildRenderContext.js.map +1 -0
  686. package/build/v4/runtime/generalSensitivityLabel.d.ts +5 -0
  687. package/build/v4/runtime/generalSensitivityLabel.d.ts.map +1 -0
  688. package/build/v4/runtime/generalSensitivityLabel.js +36 -0
  689. package/build/v4/runtime/generalSensitivityLabel.js.map +1 -0
  690. package/build/v4/runtime/inMemoryRuntime.d.ts +21 -0
  691. package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -0
  692. package/build/v4/runtime/inMemoryRuntime.js +43 -0
  693. package/build/v4/runtime/inMemoryRuntime.js.map +1 -0
  694. package/build/v4/runtime/packageParse.d.ts +13 -0
  695. package/build/v4/runtime/packageParse.d.ts.map +1 -0
  696. package/build/v4/runtime/packageParse.js +235 -0
  697. package/build/v4/runtime/packageParse.js.map +1 -0
  698. package/build/v4/runtime/realRuntime.d.ts +11 -0
  699. package/build/v4/runtime/realRuntime.d.ts.map +1 -0
  700. package/build/v4/runtime/realRuntime.js +64 -0
  701. package/build/v4/runtime/realRuntime.js.map +1 -0
  702. package/build/v4/runtime/renderMustache.d.ts +7 -0
  703. package/build/v4/runtime/renderMustache.d.ts.map +1 -0
  704. package/build/v4/runtime/renderMustache.js +54 -0
  705. package/build/v4/runtime/renderMustache.js.map +1 -0
  706. package/build/v4/runtime/runtimeRegistry.d.ts +28 -0
  707. package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -0
  708. package/build/v4/runtime/runtimeRegistry.js +165 -0
  709. package/build/v4/runtime/runtimeRegistry.js.map +1 -0
  710. package/build/v4/runtime/scaffold.d.ts +31 -0
  711. package/build/v4/runtime/scaffold.d.ts.map +1 -0
  712. package/build/v4/runtime/scaffold.js +34 -0
  713. package/build/v4/runtime/scaffold.js.map +1 -0
  714. package/build/v4/runtime/scaffoldFromPackageDir.d.ts +7 -0
  715. package/build/v4/runtime/scaffoldFromPackageDir.d.ts.map +1 -0
  716. package/build/v4/runtime/scaffoldFromPackageDir.js +43 -0
  717. package/build/v4/runtime/scaffoldFromPackageDir.js.map +1 -0
  718. package/build/v4/runtime/selectLanguageContent.d.ts +7 -0
  719. package/build/v4/runtime/selectLanguageContent.d.ts.map +1 -0
  720. package/build/v4/runtime/selectLanguageContent.js +39 -0
  721. package/build/v4/runtime/selectLanguageContent.js.map +1 -0
  722. package/build/v4/runtime/steps/daAction.d.ts +6 -0
  723. package/build/v4/runtime/steps/daAction.d.ts.map +1 -0
  724. package/build/v4/runtime/steps/daAction.js +41 -0
  725. package/build/v4/runtime/steps/daAction.js.map +1 -0
  726. package/build/v4/runtime/steps/daSensitivity.d.ts +14 -0
  727. package/build/v4/runtime/steps/daSensitivity.d.ts.map +1 -0
  728. package/build/v4/runtime/steps/daSensitivity.js +50 -0
  729. package/build/v4/runtime/steps/daSensitivity.js.map +1 -0
  730. package/build/v4/runtime/steps/mcpAuth.d.ts +13 -0
  731. package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -0
  732. package/build/v4/runtime/steps/mcpAuth.js +90 -0
  733. package/build/v4/runtime/steps/mcpAuth.js.map +1 -0
  734. package/build/v4/runtime/steps/mcpLocal.d.ts +6 -0
  735. package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -0
  736. package/build/v4/runtime/steps/mcpLocal.js +93 -0
  737. package/build/v4/runtime/steps/mcpLocal.js.map +1 -0
  738. package/build/v4/runtime/steps/mcpStatic.d.ts +10 -0
  739. package/build/v4/runtime/steps/mcpStatic.d.ts.map +1 -0
  740. package/build/v4/runtime/steps/mcpStatic.js +182 -0
  741. package/build/v4/runtime/steps/mcpStatic.js.map +1 -0
  742. package/build/v4/runtime/steps/metaOs.d.ts +10 -0
  743. package/build/v4/runtime/steps/metaOs.d.ts.map +1 -0
  744. package/build/v4/runtime/steps/metaOs.js +422 -0
  745. package/build/v4/runtime/steps/metaOs.js.map +1 -0
  746. package/build/v4/runtime/steps/officeAddin.d.ts +4 -0
  747. package/build/v4/runtime/steps/officeAddin.d.ts.map +1 -0
  748. package/build/v4/runtime/steps/officeAddin.js +168 -0
  749. package/build/v4/runtime/steps/officeAddin.js.map +1 -0
  750. package/build/v4/runtime/steps/openApi.d.ts +6 -0
  751. package/build/v4/runtime/steps/openApi.d.ts.map +1 -0
  752. package/build/v4/runtime/steps/openApi.js +389 -0
  753. package/build/v4/runtime/steps/openApi.js.map +1 -0
  754. package/build/v4/runtime/steps/openApiCustomApi.d.ts +5 -0
  755. package/build/v4/runtime/steps/openApiCustomApi.d.ts.map +1 -0
  756. package/build/v4/runtime/steps/openApiCustomApi.js +385 -0
  757. package/build/v4/runtime/steps/openApiCustomApi.js.map +1 -0
  758. package/build/v4/runtime/whitelist.d.ts +41 -0
  759. package/build/v4/runtime/whitelist.d.ts.map +1 -0
  760. package/build/v4/runtime/whitelist.js +211 -0
  761. package/build/v4/runtime/whitelist.js.map +1 -0
  762. package/build/v4/runtime/withTempDirectory.d.ts +10 -0
  763. package/build/v4/runtime/withTempDirectory.d.ts.map +1 -0
  764. package/build/v4/runtime/withTempDirectory.js +41 -0
  765. package/build/v4/runtime/withTempDirectory.js.map +1 -0
  766. package/build/v4/surface/createFloorTail.d.ts +12 -0
  767. package/build/v4/surface/createFloorTail.d.ts.map +1 -0
  768. package/build/v4/surface/createFloorTail.js +138 -0
  769. package/build/v4/surface/createFloorTail.js.map +1 -0
  770. package/build/v4/surface/createInputs.d.ts +51 -0
  771. package/build/v4/surface/createInputs.d.ts.map +1 -0
  772. package/build/v4/surface/createInputs.js +153 -0
  773. package/build/v4/surface/createInputs.js.map +1 -0
  774. package/build/v4/surface/createSelectorWalk.d.ts +26 -0
  775. package/build/v4/surface/createSelectorWalk.d.ts.map +1 -0
  776. package/build/v4/surface/createSelectorWalk.js +143 -0
  777. package/build/v4/surface/createSelectorWalk.js.map +1 -0
  778. package/build/v4/surface/deriveCreateOptions.d.ts +5 -0
  779. package/build/v4/surface/deriveCreateOptions.d.ts.map +1 -0
  780. package/build/v4/surface/deriveCreateOptions.js +212 -0
  781. package/build/v4/surface/deriveCreateOptions.js.map +1 -0
  782. package/build/v4/surface/localizePrompt.d.ts +11 -0
  783. package/build/v4/surface/localizePrompt.d.ts.map +1 -0
  784. package/build/v4/surface/localizePrompt.js +32 -0
  785. package/build/v4/surface/localizePrompt.js.map +1 -0
  786. package/build/v4/surface/modifySelectorWalk.d.ts +12 -0
  787. package/build/v4/surface/modifySelectorWalk.d.ts.map +1 -0
  788. package/build/v4/surface/modifySelectorWalk.js +115 -0
  789. package/build/v4/surface/modifySelectorWalk.js.map +1 -0
  790. package/build/v4/surface/uiPromptUI.d.ts +5 -0
  791. package/build/v4/surface/uiPromptUI.d.ts.map +1 -0
  792. package/build/v4/surface/uiPromptUI.js +220 -0
  793. package/build/v4/surface/uiPromptUI.js.map +1 -0
  794. package/build/v4/validation/capabilityCatalog.d.ts +8 -0
  795. package/build/v4/validation/capabilityCatalog.d.ts.map +1 -0
  796. package/build/v4/validation/capabilityCatalog.js +62 -0
  797. package/build/v4/validation/capabilityCatalog.js.map +1 -0
  798. package/build/v4/validation/templateArchiveValidation.d.ts +15 -0
  799. package/build/v4/validation/templateArchiveValidation.d.ts.map +1 -0
  800. package/build/v4/validation/templateArchiveValidation.js +297 -0
  801. package/build/v4/validation/templateArchiveValidation.js.map +1 -0
  802. package/build/v4/validation/validateTemplatePackage.d.ts +83 -0
  803. package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -0
  804. package/build/v4/validation/validateTemplatePackage.js +313 -0
  805. package/build/v4/validation/validateTemplatePackage.js.map +1 -0
  806. package/build/v4/validators/createInputValidators.d.ts +7 -0
  807. package/build/v4/validators/createInputValidators.d.ts.map +1 -0
  808. package/build/v4/validators/createInputValidators.js +77 -0
  809. package/build/v4/validators/createInputValidators.js.map +1 -0
  810. package/build/v4/validators/mcpCredentialValidators.d.ts +5 -0
  811. package/build/v4/validators/mcpCredentialValidators.d.ts.map +1 -0
  812. package/build/v4/validators/mcpCredentialValidators.js +13 -0
  813. package/build/v4/validators/mcpCredentialValidators.js.map +1 -0
  814. package/build/v4/validators/mcpServerUrlValidator.d.ts +9 -0
  815. package/build/v4/validators/mcpServerUrlValidator.d.ts.map +1 -0
  816. package/build/v4/validators/mcpServerUrlValidator.js +15 -0
  817. package/build/v4/validators/mcpServerUrlValidator.js.map +1 -0
  818. package/package.json +46 -97
  819. package/resource/package.nls.cs.json +1176 -1095
  820. package/resource/package.nls.de.json +1176 -1095
  821. package/resource/package.nls.es.json +1176 -1095
  822. package/resource/package.nls.fr.json +1176 -1095
  823. package/resource/package.nls.it.json +1176 -1095
  824. package/resource/package.nls.ja.json +1176 -1095
  825. package/resource/package.nls.json +116 -28
  826. package/resource/package.nls.ko.json +1176 -1095
  827. package/resource/package.nls.pl.json +1176 -1095
  828. package/resource/package.nls.pt-BR.json +1176 -1095
  829. package/resource/package.nls.ru.json +1176 -1095
  830. package/resource/package.nls.tr.json +1176 -1095
  831. package/resource/package.nls.zh-Hans.json +1176 -1095
  832. package/resource/package.nls.zh-Hant.json +1176 -1095
  833. package/resource/templates/package.nls.cs.json +39 -24
  834. package/resource/templates/package.nls.de.json +37 -22
  835. package/resource/templates/package.nls.es.json +35 -20
  836. package/resource/templates/package.nls.fr.json +45 -30
  837. package/resource/templates/package.nls.it.json +42 -27
  838. package/resource/templates/package.nls.ja.json +35 -20
  839. package/resource/templates/package.nls.json +27 -12
  840. package/resource/templates/package.nls.ko.json +33 -18
  841. package/resource/templates/package.nls.pl.json +38 -23
  842. package/resource/templates/package.nls.pt-BR.json +34 -19
  843. package/resource/templates/package.nls.ru.json +33 -18
  844. package/resource/templates/package.nls.tr.json +38 -23
  845. package/resource/templates/package.nls.zh-Hans.json +44 -29
  846. package/resource/templates/package.nls.zh-Hant.json +45 -30
  847. package/resource/templates/package.nls.zh-cn.json +7 -8
  848. package/resource/templates/package.nls.zh-tw.json +7 -8
  849. package/resource/yaml-schema/v1.11/yaml.schema.json +3 -0
  850. package/resource/yaml-schema/v1.12/yaml.schema.json +2132 -0
  851. package/resource/yaml-schema/v1.13/yaml.schema.json +2193 -0
  852. package/resource/yaml-schema/yaml.schema.json +127 -2
  853. package/templates/configs/playground/typescript/.vscode/tasks.json +1 -1
  854. package/templates/fallback/common.zip +0 -0
  855. package/templates/fallback/csharp.zip +0 -0
  856. package/templates/fallback/js.zip +0 -0
  857. package/templates/fallback/python.zip +0 -0
  858. package/templates/fallback/ts.zip +0 -0
  859. package/templates/metadata/allTemplates.json +32 -16
  860. package/templates/metadata/defaultGeneratorTemplates.json +8 -0
  861. package/templates/metadata.zip +0 -0
  862. package/templates/ui/ceaNode.json +30 -0
  863. package/templates/ui/tdpNode.json +13 -14
  864. package/templates/ui/teamsNode.json +124 -0
  865. package/templates/ui/wizardNode.json +56 -46
  866. package/templates/v4/create-selector.json +392 -0
  867. package/templates/v4/floor.json +3 -0
  868. package/templates/v4/modify-selector.json +78 -0
  869. package/templates/v4/templates-metadata.zip +0 -0
  870. package/templates/v4/templates.zip +0 -0
  871. package/build/core/middleware/projectMigratorV3.d.ts +0 -39
  872. package/build/core/middleware/projectMigratorV3.d.ts.map +0 -1
  873. package/build/core/middleware/projectMigratorV3.js +0 -694
  874. package/build/core/middleware/projectMigratorV3.js.map +0 -1
  875. package/build/core/middleware/projectVersionChecker.d.ts +0 -3
  876. package/build/core/middleware/projectVersionChecker.d.ts.map +0 -1
  877. package/build/core/middleware/projectVersionChecker.js +0 -60
  878. package/build/core/middleware/projectVersionChecker.js.map +0 -1
  879. package/build/core/middleware/types.d.ts +0 -9
  880. package/build/core/middleware/types.d.ts.map +0 -1
  881. package/build/core/middleware/types.js.map +0 -1
  882. package/build/core/middleware/utils/MigrationUtils.d.ts +0 -13
  883. package/build/core/middleware/utils/MigrationUtils.d.ts.map +0 -1
  884. package/build/core/middleware/utils/MigrationUtils.js +0 -212
  885. package/build/core/middleware/utils/MigrationUtils.js.map +0 -1
  886. package/build/core/middleware/utils/appYmlGenerator.d.ts +0 -34
  887. package/build/core/middleware/utils/appYmlGenerator.d.ts.map +0 -1
  888. package/build/core/middleware/utils/appYmlGenerator.js +0 -158
  889. package/build/core/middleware/utils/appYmlGenerator.js.map +0 -1
  890. package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts +0 -65
  891. package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts.map +0 -1
  892. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js +0 -61
  893. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js.map +0 -1
  894. package/build/core/middleware/utils/debug/constants.d.ts +0 -20
  895. package/build/core/middleware/utils/debug/constants.d.ts.map +0 -1
  896. package/build/core/middleware/utils/debug/constants.js +0 -28
  897. package/build/core/middleware/utils/debug/constants.js.map +0 -1
  898. package/build/core/middleware/utils/debug/debugMigrationContext.d.ts +0 -14
  899. package/build/core/middleware/utils/debug/debugMigrationContext.d.ts.map +0 -1
  900. package/build/core/middleware/utils/debug/debugMigrationContext.js +0 -23
  901. package/build/core/middleware/utils/debug/debugMigrationContext.js.map +0 -1
  902. package/build/core/middleware/utils/debug/debugV3MigrationUtils.d.ts +0 -37
  903. package/build/core/middleware/utils/debug/debugV3MigrationUtils.d.ts.map +0 -1
  904. package/build/core/middleware/utils/debug/debugV3MigrationUtils.js +0 -291
  905. package/build/core/middleware/utils/debug/debugV3MigrationUtils.js.map +0 -1
  906. package/build/core/middleware/utils/debug/taskMigrator.d.ts +0 -22
  907. package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +0 -1
  908. package/build/core/middleware/utils/debug/taskMigrator.js +0 -935
  909. package/build/core/middleware/utils/debug/taskMigrator.js.map +0 -1
  910. package/build/core/middleware/utils/migrationContext.d.ts +0 -32
  911. package/build/core/middleware/utils/migrationContext.d.ts.map +0 -1
  912. package/build/core/middleware/utils/migrationContext.js +0 -104
  913. package/build/core/middleware/utils/migrationContext.js.map +0 -1
  914. package/templates/configs/local/typescript/.gitignore +0 -1
  915. package/templates/configs/playground/typescript/.gitignore +0 -4
  916. /package/build/{core/middleware → component/generator/openPlugin}/types.js +0 -0
@@ -2,22 +2,91 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.FxCoreDeclarativeAgentPart = void 0;
5
+ exports.FxCoreDeclarativeAgentPart = exports.fxCoreDeclarativeAgentDeps = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const hooks_1 = require("@feathersjs/hooks");
8
+ const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
8
9
  const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
- const axios_1 = tslib_1.__importDefault(require("axios"));
10
10
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
11
11
  const path = tslib_1.__importStar(require("path"));
12
+ const daSpecParser_1 = require("../common/daSpecParser");
13
+ const featureFlags_1 = require("../common/featureFlags");
12
14
  const globalVars_1 = require("../common/globalVars");
13
15
  const localizeUtils_1 = require("../common/localizeUtils");
14
- const actionInjector_1 = require("../component/configManager/actionInjector");
16
+ const telemetry_1 = require("../common/telemetry");
17
+ const versionMetadata_1 = require("../common/versionMetadata");
15
18
  const constants_1 = require("../component/constants");
19
+ const errors_1 = require("../component/driver/teamsApp/errors");
20
+ const results_1 = require("../component/driver/teamsApp/results");
21
+ const CopilotGptManifestUtils_1 = require("../component/driver/teamsApp/utils/CopilotGptManifestUtils");
22
+ const ManifestUtils_1 = require("../component/driver/teamsApp/utils/ManifestUtils");
23
+ const PluginManifestUtils_1 = require("../component/driver/teamsApp/utils/PluginManifestUtils");
24
+ const utils_1 = require("../component/driver/teamsApp/utils/utils");
25
+ const declarativeAgentHelperModule = tslib_1.__importStar(require("../component/generator/declarativeAgent/helper"));
26
+ const helper_1 = require("../component/generator/declarativeAgent/helper");
27
+ const generator_1 = require("../component/generator/generator");
28
+ const openApiSpecHelperModule = tslib_1.__importStar(require("../component/generator/openApiSpec/helper"));
29
+ const helper_2 = require("../component/generator/openApiSpec/helper");
30
+ const v4TemplateBridge_1 = require("../component/generator/v4TemplateBridge");
16
31
  const questionMW_1 = require("../component/middleware/questionMW");
32
+ const common_1 = require("../component/utils/common");
33
+ const mcpAuthScaffolder_1 = require("../component/utils/mcpAuthScaffolder");
17
34
  const pathUtils_1 = require("../component/utils/pathUtils");
35
+ const common_2 = require("../error/common");
18
36
  const constants_2 = require("../question/constants");
37
+ const teamsProjectTypeNode_1 = require("../question/scaffold/vsc/teamsProjectTypeNode");
19
38
  const concurrentLocker_1 = require("./middleware/concurrentLocker");
20
39
  const errorHandler_1 = require("./middleware/errorHandler");
40
+ const modifyProjectFrontDoor_1 = require("./modifyProjectFrontDoor");
41
+ const v4ArtifactSnapshot_1 = require("./v4ArtifactSnapshot");
42
+ function targetRelativePath(projectPath, filePath) {
43
+ const absolute = path.isAbsolute(filePath) ? filePath : path.resolve(projectPath, filePath);
44
+ return path.relative(projectPath, absolute).replace(/\\/g, "/");
45
+ }
46
+ async function scaffoldAddMcpServerFromV4(options) {
47
+ const context = {
48
+ name: options.appName,
49
+ language: "common",
50
+ platform: options.platform,
51
+ destination: options.projectPath,
52
+ logProvider: globalVars_1.TOOLS.logProvider,
53
+ onActionError: generator_1.templateDefaultOnActionError,
54
+ };
55
+ try {
56
+ const source = await (0, v4TemplateBridge_1.scaffoldDeclarativeFromV4Channel)(context, { kind: "modify", templateId: options.templateId }, {
57
+ mcpServerUrl: options.mcpServerUrl,
58
+ teamsManifestPath: targetRelativePath(options.projectPath, options.teamsManifestPath),
59
+ authType: options.authType,
60
+ }, { appName: options.appName, language: "common" }, undefined, undefined, options.resolvedPackage);
61
+ if (source.warning) {
62
+ globalVars_1.TOOLS.logProvider.warning(source.warning);
63
+ }
64
+ // Like the shipped add-action flow, this path has no scaffolding summary to fall back on,
65
+ // so an m365agents.yml left with auth placeholders has to be said out loud — otherwise
66
+ // provision fails later with an opaque error.
67
+ for (const warning of context.warnings ?? []) {
68
+ if (mcpAuthScaffolder_1.MCP_AUTH_PLACEHOLDER_WARNING_TYPES.includes(warning.type)) {
69
+ void globalVars_1.TOOLS.ui.showMessage("warn", warning.content, false);
70
+ }
71
+ }
72
+ }
73
+ catch (error) {
74
+ return (0, teamsfx_api_1.err)((0, common_2.assembleError)(error));
75
+ }
76
+ return (0, teamsfx_api_1.ok)(undefined);
77
+ }
78
+ // Non-translatable CLI command template used in warning messages
79
+ const mcpAddActionHint = "atk add action --api-plugin-type mcp --mcp-da-server-url <server-url> --mcp-tools-file-path <path-to-tools-json> --interactive false";
80
+ exports.fxCoreDeclarativeAgentDeps = {
81
+ addExistingPlugin: declarativeAgentHelperModule.addExistingPlugin,
82
+ createNewActionPluginManifest: declarativeAgentHelperModule.createNewActionPluginManifest,
83
+ deriveMCPServerNameFromUrl: helper_1.deriveMCPServerNameFromUrl,
84
+ generateFromApiSpec: openApiSpecHelperModule.generateFromApiSpec,
85
+ generateScaffoldingSummary: openApiSpecHelperModule.generateScaffoldingSummary,
86
+ modifyProjectFrontDoor: modifyProjectFrontDoor_1.modifyProjectFrontDoor,
87
+ resolveV4TemplateArtifactSnapshot: v4ArtifactSnapshot_1.resolveV4TemplateArtifactSnapshot,
88
+ scaffoldAddMcpServerFromV4,
89
+ };
21
90
  class FxCoreDeclarativeAgentPart {
22
91
  async updateActionWithMCP(inputs) {
23
92
  const context = (0, globalVars_1.createContext)();
@@ -25,7 +94,31 @@ class FxCoreDeclarativeAgentPart {
25
94
  if (!projectPath) {
26
95
  throw new Error("projectPath is undefined"); // should never happen
27
96
  }
28
- const aiPluginFilePath = inputs[constants_2.QuestionNames.PluginManifestFilePath];
97
+ let aiPluginFilePath = inputs[constants_2.QuestionNames.PluginManifestFilePath];
98
+ // If the user picked the "Create a new ai-plugin.json" option in the question,
99
+ // the value will be the sentinel. Generate a fresh skeleton manifest under
100
+ // appPackage using the file name from the follow-up text question and
101
+ // register it as a new action of the declarative agent before continuing
102
+ // with the regular update flow.
103
+ if (aiPluginFilePath === teamsProjectTypeNode_1.CreateNewPluginManifestSentinel) {
104
+ const desiredFileName = inputs[constants_2.QuestionNames.NewPluginManifestFileName] || "ai-plugin.json";
105
+ const teamsManifestPath = path.join(projectPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName);
106
+ const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(teamsManifestPath);
107
+ if (manifestRes.isErr()) {
108
+ return (0, teamsfx_api_1.err)(manifestRes.error);
109
+ }
110
+ const declarativeAgentRelativePath = manifestRes.value?.copilotAgents?.declarativeAgents?.[0]?.file;
111
+ if (!declarativeAgentRelativePath) {
112
+ return (0, teamsfx_api_1.err)(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.TeamsAppRequiredPropertyMissingError.name, errors_1.AppStudioError.TeamsAppRequiredPropertyMissingError.message("declarativeAgents", teamsManifestPath)));
113
+ }
114
+ const declarativeAgentManifestPath = path.join(projectPath, teamsfx_api_1.AppPackageFolderName, declarativeAgentRelativePath);
115
+ const createRes = await declarativeAgentHelperModule.createNewActionPluginManifest(projectPath, desiredFileName, declarativeAgentManifestPath);
116
+ if (createRes.isErr()) {
117
+ return (0, teamsfx_api_1.err)(createRes.error);
118
+ }
119
+ aiPluginFilePath = createRes.value.pluginManifestPath;
120
+ inputs[constants_2.QuestionNames.PluginManifestFilePath] = aiPluginFilePath;
121
+ }
29
122
  if (!(await fs_extra_1.default.pathExists(aiPluginFilePath))) {
30
123
  const error = new teamsfx_api_1.SystemError("MCPForDAPluginManifestNotFound", "PluginManifestNotFound", (0, localizeUtils_1.getDefaultString)("core.MCPForDA.pluginManifestNotFound", aiPluginFilePath), (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.pluginManifestNotFound", aiPluginFilePath));
31
124
  return (0, teamsfx_api_1.err)(error);
@@ -35,46 +128,12 @@ class FxCoreDeclarativeAgentPart {
35
128
  const serverName = inputs[constants_2.QuestionNames.MCPForDAServerName];
36
129
  const mcpAuth = inputs[constants_2.QuestionNames.MCPForDAAuth];
37
130
  const authType = inputs[constants_2.QuestionNames.MCPForDAAuthType];
38
- let oauthAuthorizationUrl = undefined;
39
- let oauthTokenUrl = undefined;
40
- let oauthRefreshUrl = undefined;
131
+ let mcpAuthEndpoints = {};
41
132
  let registrationId = undefined;
42
133
  if (mcpAuth === "OAuthPluginVault") {
43
134
  try {
44
135
  registrationId = `MCP_DA_AUTH_ID_${serverName.toUpperCase()}`;
45
- if (authType === "oauth") {
46
- let wellKnownMetadataUrl = inputs[constants_2.QuestionNames.MCPForDAAuthWellKnownUrl];
47
- if (!wellKnownMetadataUrl) {
48
- const mcpAuthMetadataUrl = inputs[constants_2.QuestionNames.MCPForDAAuthMetadataUrl];
49
- if (!mcpAuthMetadataUrl) {
50
- throw new Error((0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthMetadataUrlNotFound"));
51
- }
52
- const response = await axios_1.default.get(mcpAuthMetadataUrl);
53
- if (response.status === 200 &&
54
- response.data &&
55
- response.data.authorization_servers &&
56
- response.data.authorization_servers.length > 0) {
57
- const mcpServerMetadataUrl = response.data.authorization_servers?.[0];
58
- // Transform the URL to the proper OAuth authorization server metadata endpoint
59
- // According to RFC 8414, the well-known endpoint should be constructed as:
60
- // https://{domain}/.well-known/oauth-authorization-server{path}
61
- const serverUrl = new URL(mcpServerMetadataUrl);
62
- wellKnownMetadataUrl = `${serverUrl.protocol}//${serverUrl.host}/.well-known/oauth-authorization-server${serverUrl.pathname}`;
63
- }
64
- else {
65
- throw new Error((0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpServerMetadataUrlNotFound"));
66
- }
67
- }
68
- const metadataResponse = await axios_1.default.get(wellKnownMetadataUrl);
69
- if (metadataResponse.status === 200) {
70
- oauthAuthorizationUrl = metadataResponse.data.authorization_endpoint;
71
- oauthTokenUrl = metadataResponse.data.token_endpoint;
72
- oauthRefreshUrl = metadataResponse.data.refresh_endpoint;
73
- }
74
- if (!oauthAuthorizationUrl || !oauthTokenUrl) {
75
- throw new Error((0, localizeUtils_1.getLocalizedString)("core.MCPForDA.authUrlNotFound"));
76
- }
77
- }
136
+ mcpAuthEndpoints = await (0, mcpAuthScaffolder_1.resolveMCPAuthEndpoints)(authType, inputs);
78
137
  }
79
138
  catch (error) {
80
139
  void context.userInteraction.showMessage("error", (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthMetadataMissingError", error.message), false);
@@ -90,14 +149,20 @@ class FxCoreDeclarativeAgentPart {
90
149
  const error = new teamsfx_api_1.UserError("MCPForDAPreFetchToolsNotFound", "PreFetchToolsNotFound", (0, localizeUtils_1.getDefaultString)("core.MCPForDA.preFetchToolsNotFound"), (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.preFetchToolsNotFound"));
91
150
  return (0, teamsfx_api_1.err)(error);
92
151
  }
152
+ const pluginFunctions = Array.isArray(aiPluginContent.functions)
153
+ ? aiPluginContent.functions
154
+ : [];
155
+ const pluginRuntimes = Array.isArray(aiPluginContent.runtimes) ? aiPluginContent.runtimes : [];
93
156
  const toolsSelectedPrevious = [];
94
- aiPluginContent.runtimes
95
- .filter((runtime) => (runtime.type === "RemoteMCPServer" && runtime.spec.url === mcpServerUrl) ||
157
+ pluginRuntimes
158
+ .filter((runtime) => (runtime.type === "RemoteMCPServer" && runtime.spec?.url === mcpServerUrl) ||
96
159
  runtime.type === "LocalPlugin")
97
160
  .forEach((runtime) => {
98
- toolsSelectedPrevious.push(...runtime.run_for_functions);
161
+ if (Array.isArray(runtime.run_for_functions)) {
162
+ toolsSelectedPrevious.push(...runtime.run_for_functions);
163
+ }
99
164
  });
100
- aiPluginContent.functions = aiPluginContent.functions.filter((func) => !toolsSelectedPrevious.includes(func.name));
165
+ aiPluginContent.functions = pluginFunctions.filter((func) => !toolsSelectedPrevious.includes(func.name));
101
166
  aiPluginContent.functions = [
102
167
  ...aiPluginContent.functions,
103
168
  ...mcpToolsDetail
@@ -122,9 +187,9 @@ class FxCoreDeclarativeAgentPart {
122
187
  }
123
188
  }),
124
189
  ];
125
- const matchedRuntime = aiPluginContent.runtimes.find((runtime) => runtime.type === "RemoteMCPServer" && runtime.spec.url === mcpServerUrl);
126
- aiPluginContent.runtimes = aiPluginContent.runtimes.filter((runtime) => (runtime.type !== "RemoteMCPServer" && runtime.type !== "LocalPlugin") ||
127
- runtime.spec.url !== mcpServerUrl);
190
+ const matchedRuntime = pluginRuntimes.find((runtime) => runtime.type === "RemoteMCPServer" && runtime.spec?.url === mcpServerUrl);
191
+ aiPluginContent.runtimes = pluginRuntimes.filter((runtime) => (runtime.type !== "RemoteMCPServer" && runtime.type !== "LocalPlugin") ||
192
+ runtime.spec?.url !== mcpServerUrl);
128
193
  if (inputs[constants_2.QuestionNames.MCPLocalServerIdentifier] != null) {
129
194
  aiPluginContent.runtimes.push({
130
195
  type: "LocalPlugin",
@@ -167,19 +232,29 @@ class FxCoreDeclarativeAgentPart {
167
232
  },
168
233
  },
169
234
  run_for_functions: mcpToolsSelected,
170
- auth: mcpAuth === "OAuthPluginVault" && !!registrationId
171
- ? {
172
- type: "OAuthPluginVault",
173
- reference_id: `$\{\{${registrationId}\}\}`,
174
- }
175
- : {
176
- type: "None",
177
- },
235
+ auth: (0, mcpAuthScaffolder_1.deriveMCPManifestOAuth)(authType, registrationId) ?? {
236
+ type: "None",
237
+ },
178
238
  });
179
239
  }
180
240
  if (mcpAuth === "OAuthPluginVault" && !!registrationId) {
181
241
  // insert oauth info in teamsapp.yaml
182
- await actionInjector_1.ActionInjector.injectCreateOAuthActionForMCP(pathUtils_1.pathUtils.getYmlFilePath(projectPath), authType, serverName, registrationId, mcpServerUrl, oauthAuthorizationUrl, oauthTokenUrl, oauthRefreshUrl);
242
+ const injectResult = await (0, mcpAuthScaffolder_1.injectMCPAuthActionToYml)({
243
+ ymlPath: pathUtils_1.pathUtils.getYmlFilePath(projectPath),
244
+ authType,
245
+ authName: serverName,
246
+ registrationId,
247
+ mcpServerUrl,
248
+ endpoints: mcpAuthEndpoints,
249
+ });
250
+ // This flow has no scaffolding summary to fall back on, so surface the placeholders
251
+ // directly — otherwise provision fails later with an opaque error.
252
+ if (injectResult.wellKnownUrlPlaceholderUsed) {
253
+ void context.userInteraction.showMessage("warn", (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthDcrPlaceholderWarning"), false);
254
+ }
255
+ if (injectResult.oauthUrlPlaceholderUsed) {
256
+ void context.userInteraction.showMessage("warn", (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthOAuthPlaceholderWarning"), false);
257
+ }
183
258
  }
184
259
  void context.userInteraction
185
260
  .showMessage("info", (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.updatePluginManifest", aiPluginFilePathRelative), false, "Provision")
@@ -196,6 +271,611 @@ class FxCoreDeclarativeAgentPart {
196
271
  provisionResources(_inputs) {
197
272
  throw new Error("Method not implemented.");
198
273
  }
274
+ // These methods will be implemented by FxCore
275
+ parseAuthNameAndScheme(_listResult, _inputs) {
276
+ throw new Error("Method not implemented.");
277
+ }
278
+ // eslint-disable-next-line @typescript-eslint/require-await
279
+ async updateAuthActionInYaml(_authName, _authScheme, _projectPath, _apSpecPath, _pluginManifestPath, _forceToAddNew) {
280
+ throw new Error("Method not implemented.");
281
+ }
282
+ /**
283
+ * Add plugin
284
+ */
285
+ async addPlugin(inputs) {
286
+ if (!inputs.projectPath) {
287
+ throw new Error("projectPath is undefined"); // should never happen
288
+ }
289
+ const projectPath = inputs.projectPath;
290
+ const context = (0, globalVars_1.createContext)();
291
+ const isGenerateFromApiSpec = inputs[constants_2.QuestionNames.ActionType] === constants_2.ActionStartOptions.apiSpec().id;
292
+ const isGenerateFromMCP = inputs[constants_2.QuestionNames.ActionType] === constants_2.ActionStartOptions.mcp().id;
293
+ const useMCPDTModifyFlow = isGenerateFromMCP && featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.MCPForDADT);
294
+ // VS Code MCP "Add Action" flow: aligned with the "DA with MCP" scaffolding
295
+ // behavior. Only the MCP server URL is collected from the user. The toolkit
296
+ // writes the URL into .vscode/mcp.json and signals the caller to open the
297
+ // file and surface the "start MCP server / Fetch Action" notification, which
298
+ // already exists for the scaffolding flow. The actual plugin manifest and DA
299
+ // action are produced later by the "Update Action with MCP" command.
300
+ //
301
+ // The CLI flow (below) keeps the original non-interactive behavior of
302
+ // probing the MCP server, fetching tools and writing ai-plugin.json + yaml
303
+ // OAuth registration, since the CLI has no equivalent notification UX.
304
+ //
305
+ // Under the Dynamic Tool Discovery (DT) flag this early redirect is skipped
306
+ // so that VS Code runs the same inline scaffolder as the CLI. DT owns the
307
+ // generated content shape; it must not depend on the global v4 feature flag.
308
+ if (isGenerateFromMCP && inputs.platform === teamsfx_api_1.Platform.VSCode && !useMCPDTModifyFlow) {
309
+ return await this.addPluginFromMCP(inputs, context);
310
+ }
311
+ // VS Code MCP inline flow (DT on) skips the Teams-manifest picker; infer
312
+ // the path from `projectPath/appPackage/manifest.json` to match the leaner
313
+ // `updateActionWithMCP` UX. CLI and non-MCP flows still supply ManifestPath
314
+ // via the question tree / `--manifest-file`.
315
+ const teamsManifestPath = inputs[constants_2.QuestionNames.ManifestPath] ??
316
+ path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName);
317
+ const appPackageFolder = path.dirname(teamsManifestPath);
318
+ // validate the project is valid for adding plugin
319
+ const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(teamsManifestPath);
320
+ if (manifestRes.isErr()) {
321
+ return (0, teamsfx_api_1.err)(manifestRes.error);
322
+ }
323
+ const teamsManifest = manifestRes.value;
324
+ const declarativeGpt = teamsManifest.copilotExtensions
325
+ ? teamsManifest.copilotExtensions.declarativeCopilots?.[0]
326
+ : teamsManifest.copilotAgents?.declarativeAgents?.[0];
327
+ if (!declarativeGpt?.file) {
328
+ return (0, teamsfx_api_1.err)(results_1.AppStudioResultFactory.UserError(errors_1.AppStudioError.TeamsAppRequiredPropertyMissingError.name, errors_1.AppStudioError.TeamsAppRequiredPropertyMissingError.message("declarativeAgents", teamsManifestPath)));
329
+ }
330
+ if (useMCPDTModifyFlow && featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.V4Enabled)) {
331
+ const entryParams = {
332
+ teamsManifestPath: targetRelativePath(projectPath, teamsManifestPath),
333
+ };
334
+ const mcpServerUrl = inputs[constants_2.QuestionNames.MCPForDAServerUrl];
335
+ if (typeof mcpServerUrl === "string") {
336
+ entryParams.mcpServerUrl = mcpServerUrl;
337
+ }
338
+ const authType = inputs[constants_2.QuestionNames.MCPForDAAuthType];
339
+ if (typeof authType === "string") {
340
+ entryParams.authType = authType;
341
+ }
342
+ const appName = teamsManifest.name.short.replace("${{APP_NAME_SUFFIX}}", "");
343
+ return await exports.fxCoreDeclarativeAgentDeps.modifyProjectFrontDoor(inputs, { addCapability: "add-action", actionSource: "mcp" }, entryParams, {
344
+ resolveArtifactSnapshot: exports.fxCoreDeclarativeAgentDeps.resolveV4TemplateArtifactSnapshot,
345
+ scaffoldV4: async (frontDoorInputs, target, answers, resolvedPackage) => {
346
+ const resolvedMcpServerUrl = answers.mcpServerUrl;
347
+ const resolvedTeamsManifestPath = answers.teamsManifestPath;
348
+ const resolvedAuthType = answers.authType;
349
+ if (typeof resolvedMcpServerUrl !== "string" ||
350
+ typeof resolvedTeamsManifestPath !== "string" ||
351
+ typeof resolvedAuthType !== "string") {
352
+ return (0, teamsfx_api_1.err)(new teamsfx_api_1.SystemError({
353
+ source: "FxCore",
354
+ name: "InvalidAddMcpServerAnswers",
355
+ message: "The MCP add-action inputs are incomplete.",
356
+ }));
357
+ }
358
+ return await exports.fxCoreDeclarativeAgentDeps.scaffoldAddMcpServerFromV4({
359
+ templateId: target.templateId,
360
+ projectPath,
361
+ platform: frontDoorInputs.platform,
362
+ teamsManifestPath: resolvedTeamsManifestPath,
363
+ appName,
364
+ mcpServerUrl: resolvedMcpServerUrl,
365
+ authType: resolvedAuthType,
366
+ resolvedPackage,
367
+ });
368
+ },
369
+ });
370
+ }
371
+ const gptManifestFilePathRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.getManifestPath(teamsManifestPath);
372
+ if (gptManifestFilePathRes.isErr()) {
373
+ return (0, teamsfx_api_1.err)(gptManifestFilePathRes.error);
374
+ }
375
+ const declarativeCopilotManifestPath = gptManifestFilePathRes.value;
376
+ const declarativeCopilotManifesRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.readCopilotGptManifestFile(declarativeCopilotManifestPath);
377
+ if (declarativeCopilotManifesRes.isErr()) {
378
+ return (0, teamsfx_api_1.err)(declarativeCopilotManifesRes.error);
379
+ }
380
+ const declarativeCopilotManifest = declarativeCopilotManifesRes.value;
381
+ const mcpAuthTypeChoice = inputs[constants_2.QuestionNames.MCPForDAAuthType];
382
+ const mcpTouchesYml = isGenerateFromMCP && mcpAuthTypeChoice && mcpAuthTypeChoice !== "none";
383
+ let confirmMessage = (0, localizeUtils_1.getLocalizedString)(isGenerateFromMCP
384
+ ? mcpTouchesYml
385
+ ? "core.addApi.confirm.mcp.teamsYaml"
386
+ : "core.addApi.confirm.mcp"
387
+ : "core.addApi.confirm", path.relative(inputs.projectPath, appPackageFolder), ...(mcpTouchesYml ? [versionMetadata_1.MetadataV4.configFile] : []));
388
+ // Will be used if generating from API spec
389
+ let specParser = undefined;
390
+ let authNameAndSchemes = [];
391
+ if (isGenerateFromApiSpec) {
392
+ specParser = new m365_spec_parser_1.SpecParser(inputs[constants_2.QuestionNames.ApiSpecLocation].trim(), (0, helper_2.getParserOptions)(m365_spec_parser_1.ProjectType.Copilot, true));
393
+ const listResult = await (0, daSpecParser_1.listAPIInfo)(inputs[constants_2.QuestionNames.ApiSpecLocation].trim());
394
+ authNameAndSchemes = this.parseAuthNameAndScheme(listResult, inputs);
395
+ if (authNameAndSchemes.length > 0) {
396
+ const doesLocalYamlPathExists = await fs_extra_1.default.pathExists(path.join(inputs.projectPath, versionMetadata_1.MetadataV3.localConfigFile));
397
+ confirmMessage = doesLocalYamlPathExists
398
+ ? (0, localizeUtils_1.getLocalizedString)("core.addApi.confirm.localTeamsYaml", path.relative(inputs.projectPath, appPackageFolder), versionMetadata_1.MetadataV4.localConfigFile, versionMetadata_1.MetadataV4.configFile)
399
+ : (0, localizeUtils_1.getLocalizedString)("core.addApi.confirm.teamsYaml", path.relative(inputs.projectPath, appPackageFolder), versionMetadata_1.MetadataV4.configFile);
400
+ }
401
+ }
402
+ // confirm
403
+ // VS Code MCP inline flow (DT on) skips the confirmation modal to match
404
+ // the leaner `updateActionWithMCP` UX; writes happen as soon as the last
405
+ // required answer is provided. CLI interactive and other flows still show it.
406
+ const skipConfirmModal = useMCPDTModifyFlow && inputs.platform === teamsfx_api_1.Platform.VSCode;
407
+ if (!skipConfirmModal) {
408
+ const confirmRes = await context.userInteraction.showMessage("warn", confirmMessage, true, (0, localizeUtils_1.getLocalizedString)("core.addApi.continue"));
409
+ if (confirmRes.isErr()) {
410
+ return (0, teamsfx_api_1.err)(confirmRes.error);
411
+ }
412
+ else if (confirmRes.value !== (0, localizeUtils_1.getLocalizedString)("core.addApi.continue")) {
413
+ return (0, teamsfx_api_1.err)(new common_2.UserCancelError());
414
+ }
415
+ }
416
+ // find the next available action id
417
+ let actionId = "";
418
+ let suffix = 1;
419
+ actionId = `action_${suffix}`;
420
+ const existingActionIds = declarativeCopilotManifest.actions?.map((action) => action.id);
421
+ while (existingActionIds?.includes(actionId)) {
422
+ suffix += 1;
423
+ actionId = `action_${suffix}`;
424
+ }
425
+ let destinationPluginManifestPath;
426
+ // generate files
427
+ if (isGenerateFromApiSpec && specParser) {
428
+ destinationPluginManifestPath =
429
+ await CopilotGptManifestUtils_1.copilotGptManifestUtils.getDefaultNextAvailablePluginManifestPath(appPackageFolder, undefined);
430
+ const destinationApiSpecPath = await PluginManifestUtils_1.pluginManifestUtils.getDefaultNextAvailableApiSpecPath(inputs[constants_2.QuestionNames.ApiSpecLocation].trim(), path.join(appPackageFolder, teamsfx_api_1.DefaultApiSpecFolderName));
431
+ const generateRes = await openApiSpecHelperModule.generateFromApiSpec(specParser, teamsManifestPath, inputs, context, teamsfx_api_1.Stage.addPlugin, m365_spec_parser_1.ProjectType.Copilot, {
432
+ destinationApiSpecFilePath: destinationApiSpecPath,
433
+ pluginManifestFilePath: destinationPluginManifestPath,
434
+ }, inputs[constants_2.QuestionNames.ApiSpecLocation].trim());
435
+ if (generateRes.isErr()) {
436
+ return (0, teamsfx_api_1.err)(generateRes.error);
437
+ }
438
+ const warnings = generateRes.value.warnings;
439
+ if (warnings && warnings.length > 0) {
440
+ const warnSummary = await openApiSpecHelperModule.generateScaffoldingSummary(warnings, manifestRes.value, path.relative(inputs.projectPath, destinationApiSpecPath), path.relative(inputs.projectPath, destinationPluginManifestPath), inputs.projectPath);
441
+ context.logProvider.info(warnSummary + "\n");
442
+ }
443
+ const addActionRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.addAction(declarativeCopilotManifestPath, actionId, (0, utils_1.normalizePath)(path.relative(appPackageFolder, destinationPluginManifestPath), true));
444
+ if (addActionRes.isErr()) {
445
+ return (0, teamsfx_api_1.err)(addActionRes.error);
446
+ }
447
+ for (const authNameAndScheme of authNameAndSchemes) {
448
+ await this.updateAuthActionInYaml(authNameAndScheme.authName, authNameAndScheme.authScheme, inputs.projectPath, destinationApiSpecPath, destinationPluginManifestPath);
449
+ }
450
+ }
451
+ else if (isGenerateFromMCP) {
452
+ // CLI MCP action: create ai-plugin.json with MCP runtime config.
453
+ // (VS Code path is handled earlier by addPluginFromMCP.)
454
+ const mcpServerUrl = inputs[constants_2.QuestionNames.MCPForDAServerUrl];
455
+ const toolsFilePath = inputs[constants_2.QuestionNames.MCPToolsFilePath];
456
+ const mcpWarnings = [];
457
+ // Validate: --mcp-da-server-url is required for MCP actions
458
+ if (!mcpServerUrl) {
459
+ return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError(teamsfx_api_1.Stage.addPlugin, "MissingMCPServerUrl", (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.missingServerUrl"), (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.missingServerUrl")));
460
+ }
461
+ // Dynamic Tool Discovery flow: write a URL-only plugin manifest directly
462
+ // and reuse the shared MCP auth injector. DT owns the generated content
463
+ // and must NOT depend on the v4 modify front door. The runtime carries
464
+ // only the MCP server URL (dynamic discovery is the host default) — no
465
+ // static tools list, no `mcp_tool_description`, no
466
+ // `enable_dynamic_discovery`.
467
+ if (useMCPDTModifyFlow) {
468
+ const authType = inputs[constants_2.QuestionNames.MCPForDAAuthType];
469
+ // Name the plugin namespace + oauth/register action after the MCP server
470
+ // URL (shared verbatim with the create flow via deriveMCPNamespaceFromUrl
471
+ // / deriveMCPRegistrationIdFromUrl). This keeps one registration per
472
+ // server: re-adding the same server reuses the same `oauth/register`
473
+ // (idempotent on registrationId), while a different server gets its own.
474
+ const namespace = (0, helper_1.deriveMCPNamespaceFromUrl)(mcpServerUrl);
475
+ const registrationId = (0, helper_1.deriveMCPRegistrationIdFromUrl)(mcpServerUrl);
476
+ destinationPluginManifestPath =
477
+ await CopilotGptManifestUtils_1.copilotGptManifestUtils.getDefaultNextAvailablePluginManifestPath(appPackageFolder, undefined);
478
+ const pluginManifest = {
479
+ $schema: "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.4/schema.json",
480
+ schema_version: "v2.4",
481
+ name_for_human: manifestRes.value.name?.short ?? path.basename(projectPath),
482
+ description_for_human: "Action powered by MCP server",
483
+ contact_email: "publisher-email@example.com",
484
+ namespace,
485
+ functions: [],
486
+ runtimes: [
487
+ {
488
+ type: "RemoteMCPServer",
489
+ spec: { url: mcpServerUrl },
490
+ run_for_functions: ["*"],
491
+ auth: (0, mcpAuthScaffolder_1.deriveMCPManifestOAuth)(authType, registrationId) ?? { type: "None" },
492
+ },
493
+ ],
494
+ };
495
+ if (authType && authType !== "none") {
496
+ // Uppercased server name drives the credential env-var suffix
497
+ // (`MCP_DA_OAUTH_CLIENT_ID_<NAME>` ...). Shared with the create flow so
498
+ // a created project and a re-add of the same server reuse the same vars.
499
+ const serverName = (0, helper_1.deriveMCPServerNameFromUrl)(mcpServerUrl).toUpperCase();
500
+ // The add question tree does not collect the auth-server metadata /
501
+ // well-known URL, so — mirroring the create flow — probe the MCP
502
+ // server to discover it when the caller didn't pass one. The result
503
+ // feeds resolveMCPAuthEndpoints so oauth/register + dcr/register get
504
+ // real authorization/token/well-known URLs. Only oauth / oauth-dynamic
505
+ // consume metadata; entra-sso resolves no endpoints, so skip the
506
+ // (10s-timeout) probe for it.
507
+ const needsMetadataProbe = authType === "oauth" || authType === "oauth-dynamic";
508
+ if (needsMetadataProbe && !inputs[constants_2.QuestionNames.MCPForDAAuthMetadataUrl]) {
509
+ try {
510
+ const { probeMCPServerAuth } = await Promise.resolve().then(() => tslib_1.__importStar(require("../component/utils/mcpToolFetcher")));
511
+ const authProbe = await probeMCPServerAuth(mcpServerUrl);
512
+ if (authProbe.authMetadataUrl) {
513
+ inputs[constants_2.QuestionNames.MCPForDAAuthMetadataUrl] = authProbe.authMetadataUrl;
514
+ }
515
+ // Same advisory warning the create flow raises on its DT branch: this branch
516
+ // never fetches tools, so a URL that is not an MCP endpoint would otherwise
517
+ // leave no trace — endpoint discovery falls back to the host and the action
518
+ // looks complete.
519
+ if (authProbe.endpointStatus === "notEndpoint") {
520
+ mcpWarnings.push({
521
+ type: "mcpServerUrlNotAnEndpoint",
522
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpServerUrlNotAnEndpoint", mcpServerUrl, String(authProbe.responseStatus)),
523
+ });
524
+ }
525
+ }
526
+ catch {
527
+ // best-effort probe; endpoint resolution below tolerates undefined
528
+ }
529
+ }
530
+ // Endpoint resolution is best-effort and MUST NOT block the
531
+ // oauth/register injection: an unreachable server or missing metadata
532
+ // leaves endpoints empty and the injector still writes the action
533
+ // (with placeholder URLs) so the developer can fill them in later.
534
+ let endpoints = {};
535
+ try {
536
+ endpoints = await (0, mcpAuthScaffolder_1.resolveMCPAuthEndpoints)(authType, inputs);
537
+ }
538
+ catch (error) {
539
+ mcpWarnings.push({
540
+ type: "mcpAuthMetadataError",
541
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthMetadataMissingError", error.message),
542
+ });
543
+ }
544
+ try {
545
+ const ymlPath = pathUtils_1.pathUtils.getYmlFilePath(inputs.projectPath);
546
+ if (ymlPath) {
547
+ const injectResult = await (0, mcpAuthScaffolder_1.injectMCPAuthActionToYml)({
548
+ ymlPath,
549
+ authType,
550
+ authName: namespace,
551
+ registrationId,
552
+ mcpServerUrl,
553
+ endpoints,
554
+ persistCredentialEnvRefs: true,
555
+ serverName,
556
+ scopes: inputs[constants_2.QuestionNames.MCPForDAScopes],
557
+ });
558
+ if (injectResult.wellKnownUrlPlaceholderUsed) {
559
+ mcpWarnings.push({
560
+ type: "mcpAuthDcrWellKnownUrlPlaceholder",
561
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthDcrPlaceholderWarning"),
562
+ });
563
+ }
564
+ if (injectResult.oauthUrlPlaceholderUsed) {
565
+ mcpWarnings.push({
566
+ type: "mcpAuthOAuthUrlPlaceholder",
567
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthOAuthPlaceholderWarning"),
568
+ });
569
+ }
570
+ }
571
+ }
572
+ catch (error) {
573
+ mcpWarnings.push({
574
+ type: "mcpAuthMetadataError",
575
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthMetadataMissingError", error.message),
576
+ });
577
+ }
578
+ // Persist the client id / secret / scopes the user entered into env
579
+ // files so the `${{...}}` refs stamped above resolve at provision time.
580
+ // No-op for oauth-dynamic / none. Mirrors the create flow.
581
+ try {
582
+ await (0, mcpAuthScaffolder_1.persistMCPAuthCredentialEnvVars)({
583
+ projectPath,
584
+ authType,
585
+ serverName,
586
+ clientId: inputs[constants_2.QuestionNames.MCPForDAClientId],
587
+ clientSecret: inputs[constants_2.QuestionNames.MCPForDAClientSecret],
588
+ scopes: inputs[constants_2.QuestionNames.MCPForDAScopes],
589
+ });
590
+ }
591
+ catch (error) {
592
+ mcpWarnings.push({
593
+ type: "mcpAuthEnvPersistError",
594
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthMetadataMissingError", error.message),
595
+ });
596
+ }
597
+ }
598
+ await fs_extra_1.default.ensureFile(destinationPluginManifestPath);
599
+ await fs_extra_1.default.writeJSON(destinationPluginManifestPath, pluginManifest, { spaces: 4 });
600
+ const addActionRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.addAction(declarativeCopilotManifestPath, actionId, (0, utils_1.normalizePath)(path.relative(appPackageFolder, destinationPluginManifestPath), true));
601
+ if (addActionRes.isErr()) {
602
+ return (0, teamsfx_api_1.err)(addActionRes.error);
603
+ }
604
+ for (const warning of mcpWarnings) {
605
+ context.logProvider.warning(warning.content);
606
+ }
607
+ }
608
+ else {
609
+ // Load tools from file if provided and not yet loaded
610
+ const existingTools = inputs[constants_2.QuestionNames.MCPForDAAvailableTools];
611
+ if (toolsFilePath && (!existingTools || existingTools.length === 0)) {
612
+ try {
613
+ const { readMCPToolsFromFile } = await Promise.resolve().then(() => tslib_1.__importStar(require("../component/utils/mcpToolFetcher")));
614
+ const fileTools = await readMCPToolsFromFile(toolsFilePath);
615
+ inputs[constants_2.QuestionNames.MCPForDAAvailableTools] = fileTools;
616
+ if (!inputs[constants_2.QuestionNames.MCPForDAPreFetchTools]) {
617
+ inputs[constants_2.QuestionNames.MCPForDAPreFetchTools] = fileTools.map((t) => t.name);
618
+ }
619
+ }
620
+ catch {
621
+ mcpWarnings.push({
622
+ type: "mcpToolsFileReadError",
623
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.toolsFileReadError", toolsFilePath, mcpAddActionHint),
624
+ });
625
+ }
626
+ }
627
+ // Probe auth if tools were loaded from file but auth not yet detected
628
+ if (inputs[constants_2.QuestionNames.MCPForDAAvailableTools]?.length > 0 &&
629
+ !inputs[constants_2.QuestionNames.MCPForDAAuth] &&
630
+ mcpServerUrl) {
631
+ try {
632
+ const { probeMCPServerAuth } = await Promise.resolve().then(() => tslib_1.__importStar(require("../component/utils/mcpToolFetcher")));
633
+ const authProbe = await probeMCPServerAuth(mcpServerUrl);
634
+ if (authProbe.requiresAuth) {
635
+ inputs[constants_2.QuestionNames.MCPForDAAuth] = "OAuthPluginVault";
636
+ if (authProbe.authMetadataUrl) {
637
+ inputs[constants_2.QuestionNames.MCPForDAAuthMetadataUrl] = authProbe.authMetadataUrl;
638
+ }
639
+ }
640
+ }
641
+ catch {
642
+ // Auth probe failed - continue without auth
643
+ }
644
+ }
645
+ // Auto-fetch tools if not yet loaded (CLI flow for no-auth servers)
646
+ const currentTools = inputs[constants_2.QuestionNames.MCPForDAAvailableTools];
647
+ if ((!currentTools || currentTools.length === 0) && mcpServerUrl) {
648
+ try {
649
+ const { fetchMCPTools } = await Promise.resolve().then(() => tslib_1.__importStar(require("../component/utils/mcpToolFetcher")));
650
+ const result = await fetchMCPTools(mcpServerUrl);
651
+ if (!result.requiresAuth && result.tools.length > 0) {
652
+ inputs[constants_2.QuestionNames.MCPForDAAvailableTools] = result.tools;
653
+ if (!inputs[constants_2.QuestionNames.MCPForDAPreFetchTools]) {
654
+ inputs[constants_2.QuestionNames.MCPForDAPreFetchTools] = result.tools.map((t) => t.name);
655
+ }
656
+ }
657
+ else if (result.requiresAuth) {
658
+ // Store auth metadata for later use
659
+ inputs[constants_2.QuestionNames.MCPForDAAuth] = "OAuthPluginVault";
660
+ if (result.authMetadataUrl) {
661
+ inputs[constants_2.QuestionNames.MCPForDAAuthMetadataUrl] = result.authMetadataUrl;
662
+ }
663
+ mcpWarnings.push({
664
+ type: "mcpAuthRequired",
665
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.authRequired", mcpServerUrl, mcpAddActionHint),
666
+ });
667
+ }
668
+ else {
669
+ mcpWarnings.push({
670
+ type: "mcpNoToolsFetched",
671
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.noToolsFetched", mcpServerUrl, mcpAddActionHint),
672
+ });
673
+ }
674
+ }
675
+ catch {
676
+ mcpWarnings.push({
677
+ type: "mcpFetchError",
678
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.fetchError", mcpServerUrl, mcpAddActionHint),
679
+ });
680
+ }
681
+ }
682
+ // If no tools available (auth required or fetch failed), skip creating plugin - just warn
683
+ const mcpTools = inputs[constants_2.QuestionNames.MCPForDAAvailableTools];
684
+ const mcpToolsSelected = inputs[constants_2.QuestionNames.MCPForDAPreFetchTools] || [];
685
+ if (!mcpTools || mcpTools.length === 0 || mcpToolsSelected.length === 0) {
686
+ if (mcpWarnings.length > 0) {
687
+ for (const warning of mcpWarnings) {
688
+ context.logProvider.warning(warning.content);
689
+ }
690
+ }
691
+ return (0, teamsfx_api_1.ok)(undefined);
692
+ }
693
+ destinationPluginManifestPath =
694
+ await CopilotGptManifestUtils_1.copilotGptManifestUtils.getDefaultNextAvailablePluginManifestPath(appPackageFolder, undefined);
695
+ const pluginManifest = {
696
+ $schema: "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.4/schema.json",
697
+ schema_version: "v2.4",
698
+ name_for_human: "MCP Action",
699
+ description_for_human: "Action powered by MCP server",
700
+ contact_email: "publisher-email@example.com",
701
+ namespace: "mcpAction",
702
+ functions: [],
703
+ runtimes: [],
704
+ };
705
+ if (mcpTools && mcpTools.length > 0 && mcpToolsSelected.length > 0) {
706
+ const selectedTools = mcpTools.filter((tool) => mcpToolsSelected.includes(tool.name));
707
+ pluginManifest.functions = selectedTools.map((tool) => ({
708
+ name: tool.name,
709
+ description: tool.description || "",
710
+ }));
711
+ // Write mcp-tools file with full tool definitions (no field filtering)
712
+ const mcpToolsFile = `mcp-tools-${suffix}.json`;
713
+ const mcpToolsOutputPath = path.join(appPackageFolder, mcpToolsFile);
714
+ await fs_extra_1.default.writeJSON(mcpToolsOutputPath, { tools: selectedTools }, { spaces: 4 });
715
+ pluginManifest.runtimes = [
716
+ {
717
+ type: "RemoteMCPServer",
718
+ spec: {
719
+ url: mcpServerUrl,
720
+ mcp_tool_description: {
721
+ file: mcpToolsFile,
722
+ },
723
+ },
724
+ run_for_functions: pluginManifest.functions.map((f) => f.name),
725
+ },
726
+ ];
727
+ // Auth handling
728
+ const mcpAuth = inputs[constants_2.QuestionNames.MCPForDAAuth];
729
+ if (mcpAuth === "OAuthPluginVault") {
730
+ const authType = inputs[constants_2.QuestionNames.MCPForDAAuthType];
731
+ if (!authType) {
732
+ return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError(teamsfx_api_1.Stage.addPlugin, "MissingMCPAuthType", (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.missingAuthType"), (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.missingAuthType")));
733
+ }
734
+ const registrationId = `MCP_DA_AUTH_ID_${actionId.toUpperCase()}`;
735
+ const manifestOAuth = (0, mcpAuthScaffolder_1.deriveMCPManifestOAuth)(authType, registrationId);
736
+ if (manifestOAuth) {
737
+ pluginManifest.runtimes[0].auth = manifestOAuth;
738
+ }
739
+ // Resolve OAuth metadata and inject oauth/register into m365agents.yml
740
+ try {
741
+ const endpoints = await (0, mcpAuthScaffolder_1.resolveMCPAuthEndpoints)(authType, inputs);
742
+ const ymlPath = pathUtils_1.pathUtils.getYmlFilePath(inputs.projectPath);
743
+ if (ymlPath) {
744
+ const injectResult = await (0, mcpAuthScaffolder_1.injectMCPAuthActionToYml)({
745
+ ymlPath,
746
+ authType,
747
+ authName: actionId,
748
+ registrationId,
749
+ mcpServerUrl,
750
+ endpoints,
751
+ });
752
+ if (injectResult.wellKnownUrlPlaceholderUsed) {
753
+ mcpWarnings.push({
754
+ type: "mcpAuthDcrWellKnownUrlPlaceholder",
755
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthDcrPlaceholderWarning"),
756
+ });
757
+ }
758
+ if (injectResult.oauthUrlPlaceholderUsed) {
759
+ mcpWarnings.push({
760
+ type: "mcpAuthOAuthUrlPlaceholder",
761
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthOAuthPlaceholderWarning"),
762
+ });
763
+ }
764
+ }
765
+ }
766
+ catch (error) {
767
+ mcpWarnings.push({
768
+ type: "mcpAuthMetadataError",
769
+ content: (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.mcpAuthMetadataMissingError", error.message),
770
+ });
771
+ }
772
+ }
773
+ }
774
+ await fs_extra_1.default.ensureFile(destinationPluginManifestPath);
775
+ await fs_extra_1.default.writeJSON(destinationPluginManifestPath, pluginManifest, { spaces: 4 });
776
+ const addActionRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.addAction(declarativeCopilotManifestPath, actionId, (0, utils_1.normalizePath)(path.relative(appPackageFolder, destinationPluginManifestPath), true));
777
+ if (addActionRes.isErr()) {
778
+ return (0, teamsfx_api_1.err)(addActionRes.error);
779
+ }
780
+ // Surface warnings for CLI
781
+ if (mcpWarnings.length > 0) {
782
+ for (const warning of mcpWarnings) {
783
+ context.logProvider.warning(warning.content);
784
+ }
785
+ }
786
+ }
787
+ // An unreplaced placeholder guarantees a provision failure later, and the output channel
788
+ // is easy to miss — more so here, where the action is about to report success. Raise this
789
+ // one case to a notification, as the create flow does.
790
+ const placeholderWarning = mcpWarnings.find((warning) => warning.type === "mcpAuthDcrWellKnownUrlPlaceholder" ||
791
+ warning.type === "mcpAuthOAuthUrlPlaceholder");
792
+ if (placeholderWarning && inputs.platform === teamsfx_api_1.Platform.VSCode) {
793
+ const openYml = (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.openYmlFile");
794
+ const ymlPath = pathUtils_1.pathUtils.getYmlFilePath(inputs.projectPath);
795
+ void context.userInteraction
796
+ .showMessage("warn", placeholderWarning.content, false, openYml)
797
+ .then((userRes) => {
798
+ if (userRes.isOk() && userRes.value === openYml && ymlPath) {
799
+ void globalVars_1.TOOLS?.ui?.openFile?.(ymlPath);
800
+ }
801
+ });
802
+ }
803
+ }
804
+ else {
805
+ const addPluginRes = await declarativeAgentHelperModule.addExistingPlugin(declarativeCopilotManifestPath, inputs[constants_2.QuestionNames.PluginManifestFilePath].trim(), inputs[constants_2.QuestionNames.PluginOpenApiSpecFilePath].trim(), actionId, context, teamsfx_api_1.Stage.addPlugin);
806
+ if (addPluginRes.isErr()) {
807
+ return (0, teamsfx_api_1.err)(addPluginRes.error);
808
+ }
809
+ destinationPluginManifestPath = addPluginRes.value.destinationPluginManifestPath;
810
+ const warningMessage = (0, common_1.outputScaffoldingWarningMessage)(addPluginRes.value.warnings);
811
+ context.logProvider.info(warningMessage);
812
+ }
813
+ if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
814
+ const successMessage = (0, localizeUtils_1.getLocalizedString)("core.addPlugin.success.vsc", actionId);
815
+ const viewPluginManifest = (0, localizeUtils_1.getLocalizedString)("core.addPlugin.success.viewPluginManifest");
816
+ void context.userInteraction
817
+ .showMessage("info", successMessage, false, viewPluginManifest)
818
+ .then((userRes) => {
819
+ if (userRes.isOk() && userRes.value === viewPluginManifest) {
820
+ context.telemetryReporter.sendTelemetryEvent(telemetry_1.TelemetryEvent.ViewPluginManifestAfterAdded);
821
+ void globalVars_1.TOOLS?.ui?.openFile?.(destinationPluginManifestPath);
822
+ }
823
+ });
824
+ }
825
+ else {
826
+ const successMessage = (0, localizeUtils_1.getLocalizedString)("core.addPlugin.success", actionId, destinationPluginManifestPath);
827
+ void context.userInteraction.showMessage("info", successMessage, false);
828
+ }
829
+ return (0, teamsfx_api_1.ok)(undefined);
830
+ }
831
+ /**
832
+ * Adds an MCP server entry to the project's `.vscode/mcp.json` and returns
833
+ * a marker so the caller (vscode-extension) can open the file and surface
834
+ * the same "start MCP server / Fetch Action" notification used by the
835
+ * "DA with MCP" scaffolding flow.
836
+ */
837
+ async addPluginFromMCP(inputs, context) {
838
+ const projectPath = inputs.projectPath;
839
+ const mcpServerUrl = inputs[constants_2.QuestionNames.MCPForDAServerUrl]?.trim();
840
+ if (!mcpServerUrl) {
841
+ return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError(teamsfx_api_1.Stage.addPlugin, "MissingMCPServerUrl", (0, localizeUtils_1.getDefaultString)("core.MCPForDA.missingServerUrl"), (0, localizeUtils_1.getLocalizedString)("core.MCPForDA.missingServerUrl")));
842
+ }
843
+ // Derive a server entry name from the URL host using the same logic as the
844
+ // "DA with MCP" scaffolding template variable `ServerName`.
845
+ const serverName = (0, helper_1.deriveMCPServerNameFromUrl)(mcpServerUrl);
846
+ const mcpConfigDir = path.join(projectPath, ".vscode");
847
+ const mcpConfigPath = path.join(mcpConfigDir, "mcp.json");
848
+ let mcpConfig = { servers: {} };
849
+ if (await fs_extra_1.default.pathExists(mcpConfigPath)) {
850
+ try {
851
+ const existing = (await fs_extra_1.default.readJSON(mcpConfigPath));
852
+ if (existing && typeof existing === "object") {
853
+ mcpConfig = {
854
+ ...existing,
855
+ servers: existing.servers && typeof existing.servers === "object" ? existing.servers : {},
856
+ };
857
+ }
858
+ }
859
+ catch {
860
+ // Existing file is unreadable/invalid JSON — overwrite with a fresh config.
861
+ mcpConfig = { servers: {} };
862
+ }
863
+ }
864
+ // Ensure unique server entry name to avoid overwriting an existing one.
865
+ let uniqueName = serverName;
866
+ let suffix = 1;
867
+ while (Object.prototype.hasOwnProperty.call(mcpConfig.servers, uniqueName)) {
868
+ uniqueName = `${serverName}${suffix++}`;
869
+ }
870
+ mcpConfig.servers[uniqueName] = {
871
+ type: "http",
872
+ url: mcpServerUrl,
873
+ };
874
+ await fs_extra_1.default.ensureDir(mcpConfigDir);
875
+ await fs_extra_1.default.writeJSON(mcpConfigPath, mcpConfig, { spaces: 2 });
876
+ context.logProvider.info(`MCP server "${uniqueName}" added to ${path.relative(projectPath, mcpConfigPath)}.`);
877
+ return (0, teamsfx_api_1.ok)({ kind: "mcp", mcpConfigPath });
878
+ }
199
879
  }
200
880
  exports.FxCoreDeclarativeAgentPart = FxCoreDeclarativeAgentPart;
201
881
  tslib_1.__decorate([
@@ -209,4 +889,15 @@ tslib_1.__decorate([
209
889
  tslib_1.__metadata("design:paramtypes", [Object]),
210
890
  tslib_1.__metadata("design:returntype", Promise)
211
891
  ], FxCoreDeclarativeAgentPart.prototype, "updateActionWithMCP", null);
892
+ tslib_1.__decorate([
893
+ (0, hooks_1.hooks)([
894
+ (0, globalVars_1.ErrorContextMW)({ component: "FxCore", stage: teamsfx_api_1.Stage.addPlugin }),
895
+ errorHandler_1.ErrorHandlerMW,
896
+ (0, questionMW_1.QuestionMW)("addPlugin"),
897
+ concurrentLocker_1.ConcurrentLockerMW,
898
+ ]),
899
+ tslib_1.__metadata("design:type", Function),
900
+ tslib_1.__metadata("design:paramtypes", [Object]),
901
+ tslib_1.__metadata("design:returntype", Promise)
902
+ ], FxCoreDeclarativeAgentPart.prototype, "addPlugin", null);
212
903
  //# sourceMappingURL=FxCore.declarativeAgent.js.map