@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
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.generateTeamsAiCustomApiFiles = generateTeamsAiCustomApiFiles;
6
+ const tslib_1 = require("tslib");
7
+ const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
8
+ const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
10
+ const path_1 = tslib_1.__importDefault(require("path"));
11
+ const util = tslib_1.__importStar(require("util"));
12
+ const featureFlags_1 = require("../../../common/featureFlags");
13
+ const localizeUtils_1 = require("../../../common/localizeUtils");
14
+ const constants_1 = require("../../../question/constants");
15
+ const supportedLanguages = [constants_1.ProgrammingLanguage.TS, constants_1.ProgrammingLanguage.JS, constants_1.ProgrammingLanguage.PY];
16
+ function isRecord(value) {
17
+ return typeof value === "object" && value !== null && !Array.isArray(value);
18
+ }
19
+ function operationId(operation) {
20
+ if (!operation.operationId) {
21
+ throw new Error("The selected OpenAPI operation has no operationId.");
22
+ }
23
+ return operation.operationId;
24
+ }
25
+ function isOperationObject(value) {
26
+ return isRecord(value);
27
+ }
28
+ function parseOperations(spec) {
29
+ const operations = [];
30
+ for (const [pathUrl, pathItem] of Object.entries(spec.paths ?? {})) {
31
+ if (!pathItem) {
32
+ continue;
33
+ }
34
+ for (const method of m365_spec_parser_1.ConstantString.AllOperationMethods) {
35
+ const operation = isRecord(pathItem) ? pathItem[method] : undefined;
36
+ if (isOperationObject(operation)) {
37
+ operations.push({
38
+ pathUrl,
39
+ method,
40
+ operation,
41
+ auth: m365_spec_parser_1.Utils.getAuthArray(operation.security, spec).length > 0,
42
+ });
43
+ }
44
+ }
45
+ }
46
+ return operations;
47
+ }
48
+ async function updateInstructions(spec, language, appFolder) {
49
+ if (!supportedLanguages.includes(language)) {
50
+ return;
51
+ }
52
+ const emptyArgs = `{ "path": null, "body": null, "query": null }`;
53
+ const description = spec.info.description ? `. ${spec.info.description}` : ".";
54
+ const prompt = `The following is a conversation with an AI assistant.\n` +
55
+ `The assistant can help to call APIs for the open api spec file${description}\n` +
56
+ `If the API doesn't require parameters, invoke it with default JSON object ${emptyArgs}.\n\n`;
57
+ await fs_extra_1.default.writeFile(path_1.default.join(appFolder, "instructions.txt"), prompt, "utf8");
58
+ }
59
+ function errorMessage(error) {
60
+ return error instanceof Error ? error.message : String(error);
61
+ }
62
+ async function updateAdaptiveCards(operations, language, destinationPath) {
63
+ const warnings = [];
64
+ if (!supportedLanguages.includes(language)) {
65
+ return warnings;
66
+ }
67
+ const cardsFolder = path_1.default.join(destinationPath, "src", "adaptiveCards");
68
+ await fs_extra_1.default.ensureDir(cardsFolder);
69
+ for (const item of operations) {
70
+ const id = operationId(item.operation);
71
+ const name = id.replace(/[^a-zA-Z0-9]/g, "_");
72
+ try {
73
+ const [card, jsonPath, jsonData, generateWarnings] = m365_spec_parser_1.AdaptiveCardGenerator.generateAdaptiveCard(item.operation, true, 5);
74
+ if (jsonPath !== "$" &&
75
+ isRecord(card) &&
76
+ Array.isArray(card.body) &&
77
+ isRecord(card.body[0]) &&
78
+ card.body[0].$data) {
79
+ card.body[0].$data = `\${${jsonPath}}`;
80
+ }
81
+ await fs_extra_1.default.writeFile(path_1.default.join(cardsFolder, `${name}.json`), JSON.stringify(card, null, 2));
82
+ await fs_extra_1.default.writeFile(path_1.default.join(cardsFolder, `${name}.data.json`), JSON.stringify(jsonData, null, 2));
83
+ for (const warning of generateWarnings) {
84
+ warnings.push({
85
+ type: m365_spec_parser_1.WarningType.GenerateJsonDataFailed,
86
+ content: util.format("Failed to create the adaptive card mock data for API '%s': %s. Mitigation: Not required but you can manually add it to the adaptiveCards folder.", id, warning.content),
87
+ data: id,
88
+ });
89
+ }
90
+ }
91
+ catch (error) {
92
+ warnings.push({
93
+ type: m365_spec_parser_1.WarningType.GenerateCardFailed,
94
+ content: (0, localizeUtils_1.getLocalizedString)("core.copilotPlugin.scaffold.summary.warning.generate.ac.failed", id, errorMessage(error)),
95
+ data: id,
96
+ });
97
+ }
98
+ }
99
+ return warnings;
100
+ }
101
+ function filteredSchema(value) {
102
+ if (!isRecord(value)) {
103
+ return {};
104
+ }
105
+ const result = {};
106
+ if (typeof value.type === "string") {
107
+ result.type = value.type;
108
+ }
109
+ if (typeof value.description === "string") {
110
+ result.description = value.description;
111
+ }
112
+ if (value.type === "object" && isRecord(value.properties)) {
113
+ const properties = {};
114
+ for (const [name, property] of Object.entries(value.properties)) {
115
+ properties[name] = filteredSchema(property);
116
+ }
117
+ result.properties = properties;
118
+ if (Array.isArray(value.required)) {
119
+ result.required = value.required.filter((name) => typeof name === "string");
120
+ }
121
+ }
122
+ else if (value.type === "array" && value.items !== undefined) {
123
+ result.items = filteredSchema(value.items);
124
+ }
125
+ return result;
126
+ }
127
+ function functionParameters(operation) {
128
+ const properties = {};
129
+ const required = [];
130
+ for (const parameter of operation.parameters ?? []) {
131
+ if (!isRecord(parameter) ||
132
+ typeof parameter.name !== "string" ||
133
+ typeof parameter.in !== "string") {
134
+ continue;
135
+ }
136
+ const parameterGroup = properties[parameter.in] ?? {
137
+ type: "object",
138
+ properties: {},
139
+ required: [],
140
+ };
141
+ const groupProperties = parameterGroup.properties;
142
+ const groupRequired = parameterGroup.required;
143
+ if (!isRecord(groupProperties) || !Array.isArray(groupRequired)) {
144
+ continue;
145
+ }
146
+ groupProperties[parameter.name] = {
147
+ ...filteredSchema(parameter.schema),
148
+ description: typeof parameter.description === "string" ? parameter.description : "",
149
+ };
150
+ if (parameter.required === true) {
151
+ groupRequired.push(parameter.name);
152
+ if (!required.includes(parameter.in)) {
153
+ required.push(parameter.in);
154
+ }
155
+ }
156
+ properties[parameter.in] = parameterGroup;
157
+ }
158
+ const requestBody = operation.requestBody;
159
+ if (isRecord(requestBody) && isRecord(requestBody.content)) {
160
+ const jsonContent = requestBody.content["application/json"];
161
+ if (isRecord(jsonContent) && isRecord(jsonContent.schema)) {
162
+ properties.body = {
163
+ ...filteredSchema(jsonContent.schema),
164
+ description: typeof requestBody.description === "string" ? requestBody.description : "",
165
+ };
166
+ if (requestBody.required === true) {
167
+ required.push("body");
168
+ }
169
+ }
170
+ }
171
+ return { type: "object", properties, required };
172
+ }
173
+ async function updateFunctions(operations, appFolder) {
174
+ const functions = {};
175
+ for (const item of operations) {
176
+ const id = operationId(item.operation);
177
+ functions[id] = {
178
+ name: id,
179
+ description: item.operation.description ?? item.operation.summary,
180
+ parameters: functionParameters(item.operation),
181
+ };
182
+ }
183
+ await fs_extra_1.default.writeFile(path_1.default.join(appFolder, "functions.json"), JSON.stringify(functions, null, 2));
184
+ }
185
+ const functionDefinitionCode = {
186
+ javascript: `.function(
187
+ functionDefs.{{operationId}}.name,
188
+ functionDefs.{{operationId}}.description,
189
+ functionDefs.{{operationId}}.parameters,
190
+ async (parameter) => {
191
+ const result = await functionHandlers.{{operationId}}Handler(parameter);
192
+ if(result) {
193
+ await send(result);
194
+ return "result showed";
195
+ } else {
196
+ return "no result";
197
+ }
198
+ }
199
+ )`,
200
+ typescript: `.function(
201
+ functionDefs.{{operationId}}.name,
202
+ functionDefs.{{operationId}}.description,
203
+ functionDefs.{{operationId}}.parameters,
204
+ async (parameter) => {
205
+ const result = await functionHandlers.{{operationId}}Handler(parameter);
206
+ if(result) {
207
+ await send(result);
208
+ return "result showed";
209
+ } else {
210
+ return "no result";
211
+ }
212
+ }
213
+ )`,
214
+ python: `.with_function(
215
+ Function(
216
+ name=function_defs["{{operationId}}"]["name"],
217
+ description=function_defs["{{operationId}}"]["description"],
218
+ parameter_schema=function_defs["{{operationId}}"]["parameters"],
219
+ handler=make_handler({{operationId}}, ctx)
220
+ )
221
+ )`,
222
+ };
223
+ const functionHandlerCode = {
224
+ javascript: `const {{operationId}}Handler = async (
225
+ parameters
226
+ ) => {
227
+ const client = await api.getClient();
228
+ // Add authentication configuration for the client
229
+ const apiPath = client.paths["{{pathUrl}}"];
230
+ if (apiPath && apiPath.{{method}}) {
231
+ const result = await apiPath.{{method}}(parameters.path, parameters.body, {
232
+ params: parameters.query,
233
+ });
234
+ if (!result || !result.data) {
235
+ throw new Error("Get empty result from api call.");
236
+ }
237
+ const cardName = "{{operationId}}".replace(/[^a-zA-Z0-9]/g, "_");
238
+ const cardTemplatePath = path.join(__dirname, '../adaptiveCards', cardName + '.json');
239
+ if (await fs.exists(cardTemplatePath)){
240
+ const card = generateAdaptiveCard(cardTemplatePath, result);
241
+ return card;
242
+ } else {
243
+ return JSON.stringify(result.data);
244
+ }
245
+ } else {
246
+ return "";
247
+ }
248
+
249
+ };
250
+
251
+ module.exports = { {{operationId}}Handler };`,
252
+ typescript: `export const {{operationId}}Handler = async (
253
+ parameter: any
254
+ ) => {
255
+ const client = await api.getClient();
256
+ // Add authentication configuration for the client
257
+ const apiPath = client.paths["{{pathUrl}}"];
258
+ if (apiPath && apiPath.{{method}}) {
259
+ const result = await apiPath.{{method}}(parameter.path, parameter.body, {
260
+ params: parameter.query,
261
+ });
262
+ if (!result || !result.data) {
263
+ throw new Error("Get empty result from api call.");
264
+ }
265
+ const cardName = "{{operationId}}".replace(/[^a-zA-Z0-9]/g, "_");
266
+ const cardTemplatePath = path.join(__dirname, '../adaptiveCards', cardName + '.json');
267
+ if (await fs.exists(cardTemplatePath)){
268
+ const card = generateAdaptiveCard(cardTemplatePath, result);
269
+ return card;
270
+ } else {
271
+ return JSON.stringify(result.data);
272
+ }
273
+ } else {
274
+ return "";
275
+ }
276
+
277
+ };`,
278
+ python: `async def {{operationId}}(
279
+ parameters,
280
+ ):
281
+ path = getattr(parameters, "path", {})
282
+ body = getattr(parameters, "body", None)
283
+ query = getattr(parameters, "query", {}) or {}
284
+ resp = client.{{operationId}}(**path, json=body, _headers={}, _params=query, _cookies={})
285
+
286
+ if resp.status_code != 200:
287
+ return resp.reason
288
+ else:
289
+ card_template_path = os.path.join(current_dir, 'adaptiveCards/{{operationId}}.json')
290
+ if not os.path.exists(card_template_path):
291
+ json_resoponse_str = resp.text
292
+ return json_resoponse_str
293
+ else:
294
+ with open(card_template_path) as card_template_file:
295
+ adaptive_card_template = card_template_file.read()
296
+
297
+ renderer = AdaptiveCardRenderer(adaptive_card_template)
298
+
299
+ json_resoponse_str = resp.text
300
+ rendered_card_str = renderer.render(json_resoponse_str)
301
+ rendered_card_json = json.loads(rendered_card_str)
302
+ return AdaptiveCard.model_validate(rendered_card_json)
303
+ `,
304
+ };
305
+ function renderCode(template, item) {
306
+ const id = operationId(item.operation);
307
+ return template
308
+ .replace(/{{operationId}}/g, id)
309
+ .replace(/{{pathUrl}}/g, item.pathUrl)
310
+ .replace(/{{method}}/g, item.method);
311
+ }
312
+ async function updateJavaScriptOrTypeScript(operations, language, destinationPath, openapiSpecFileName) {
313
+ const isJavaScript = language === constants_1.ProgrammingLanguage.JS;
314
+ const appFolder = path_1.default.join(destinationPath, "src", "app");
315
+ const appPath = path_1.default.join(appFolder, isJavaScript ? "app.js" : "app.ts");
316
+ const handlersPath = path_1.default.join(appFolder, isJavaScript ? "handlers.js" : "handlers.ts");
317
+ const definitionTemplate = isJavaScript
318
+ ? functionDefinitionCode.javascript
319
+ : functionDefinitionCode.typescript;
320
+ const handlerTemplate = isJavaScript
321
+ ? functionHandlerCode.javascript
322
+ : functionHandlerCode.typescript;
323
+ const definitions = operations.map((item) => renderCode(definitionTemplate, item));
324
+ const handlers = operations.map((item) => {
325
+ const withAuth = item.auth
326
+ ? handlerTemplate.replace("// Add authentication configuration for the client", "addAuthConfig(client);")
327
+ : handlerTemplate.replace("// Add authentication configuration for the client", "");
328
+ return renderCode(withAuth, item);
329
+ });
330
+ const app = await fs_extra_1.default.readFile(appPath, "utf8");
331
+ await fs_extra_1.default.writeFile(appPath, app.replace("// Replace with function definition code", `${definitions.join("\n")};`));
332
+ const handlersFile = await fs_extra_1.default.readFile(handlersPath, "utf8");
333
+ await fs_extra_1.default.writeFile(handlersPath, handlersFile
334
+ .replace("{{OPENAPI_SPEC_PATH}}", openapiSpecFileName)
335
+ .replace("// Replace with function handler code", handlers.join("\t\t\n")));
336
+ }
337
+ async function updatePython(operations, destinationPath, openapiSpecFileName) {
338
+ const appPath = path_1.default.join(destinationPath, "src", "app.py");
339
+ const handlersPath = path_1.default.join(destinationPath, "src", "handlers.py");
340
+ const definitions = operations.map((item) => renderCode(functionDefinitionCode.python, item));
341
+ const handlers = operations.map((item) => renderCode(functionHandlerCode.python, item));
342
+ const operationIds = operations.map((item) => operationId(item.operation));
343
+ const app = await fs_extra_1.default.readFile(appPath, "utf8");
344
+ await fs_extra_1.default.writeFile(appPath, app
345
+ .replace("// Replace with function definition code", `prompt${definitions.join("")}`)
346
+ .replace("//Replace with functions to be imported", operationIds.join(", ")));
347
+ const handlersFile = await fs_extra_1.default.readFile(handlersPath, "utf8");
348
+ await fs_extra_1.default.writeFile(handlersPath, handlersFile
349
+ .replace("{{OPENAPI_SPEC_PATH}}", openapiSpecFileName)
350
+ .replace("// Replace with function handler code", handlers.join("\t\t\n")));
351
+ }
352
+ async function updateCode(operations, language, destinationPath, openapiSpecFileName) {
353
+ if (language === constants_1.ProgrammingLanguage.PY) {
354
+ await updatePython(operations, destinationPath, openapiSpecFileName);
355
+ }
356
+ else if (language === constants_1.ProgrammingLanguage.JS || language === constants_1.ProgrammingLanguage.TS) {
357
+ await updateJavaScriptOrTypeScript(operations, language, destinationPath, openapiSpecFileName);
358
+ }
359
+ }
360
+ async function updatePromptSuggestions(operations, destinationPath) {
361
+ const commands = operations
362
+ .map((item) => item.operation.summary ?? item.operation.description)
363
+ .filter((description) => description !== undefined)
364
+ .slice(0, 10)
365
+ .map((description) => ({
366
+ title: description.slice(0, 32),
367
+ description: description.slice(0, 128),
368
+ }));
369
+ const manifest = await teamsfx_api_1.TeamsManifestWrapper.read(path_1.default.join(destinationPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName));
370
+ manifest.setFirstBotCommandSuggestions(commands, featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.CEAEnabled));
371
+ await manifest.save();
372
+ }
373
+ /** Generate the post-render Teams AI files declared by the custom API scenario. */
374
+ async function generateTeamsAiCustomApiFiles(spec, language, destinationPath, openapiSpecFileName) {
375
+ const appFolder = path_1.default.join(destinationPath, "src", language === constants_1.ProgrammingLanguage.PY ? "" : "app");
376
+ await fs_extra_1.default.ensureDir(appFolder);
377
+ await updateInstructions(spec, language, appFolder);
378
+ const operations = parseOperations(spec);
379
+ const warnings = await updateAdaptiveCards(operations, language, destinationPath);
380
+ await updateFunctions(operations, appFolder);
381
+ await updateCode(operations, language, destinationPath, openapiSpecFileName);
382
+ await updatePromptSuggestions(operations, destinationPath);
383
+ return warnings;
384
+ }
385
+ //# sourceMappingURL=openApiCustomApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiCustomApi.js","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/openApiCustomApi.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAsdlC,sEAmBC;;AAveD,kEAMqC;AACrC,wDAIgC;AAChC,gEAA0B;AAE1B,wDAAwB;AACxB,mDAA6B;AAC7B,+DAAgF;AAChF,iEAAmE;AACnE,2DAAkE;AASlE,MAAM,kBAAkB,GA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0,0 +1,41 @@
1
+ import { ExpressionRuntimePort, WhitelistFn } from "../expression/evaluateExpression";
2
+ /** Derive a stable MCP server namespace from a URL host. */
3
+ export declare function deriveMcpServerName(url: string): string;
4
+ /** Whitelist fn `mcpNamespace(url)` — the rendered `ai-plugin.json` namespace. */
5
+ export declare const mcpNamespace: WhitelistFn;
6
+ /** Whitelist fn `mcpAuthRef(url)` for the deferred auth env-ref placeholder. */
7
+ export declare const mcpAuthRef: WhitelistFn;
8
+ /** Whitelist fn `safeProjectNameLowerCase(appName)` for package names. */
9
+ export declare const safeProjectNameLowerCase: WhitelistFn;
10
+ /** Whitelist fn `pathDelimiter()` for PATH-like launch configuration values. */
11
+ export declare const pathDelimiter: WhitelistFn;
12
+ /** Whitelist fn `contains(csv, item)` — `"true"` when a multiSelect answer selects `item`. */
13
+ export declare const contains: WhitelistFn;
14
+ /** Whitelist fn `officeAddinManifestScope(host)` — the single-host manifest scope literal. */
15
+ export declare const officeAddinManifestScope: WhitelistFn;
16
+ /**
17
+ * Whitelist fn `officeAddinManifestScopes(csv)` — the multiSelect host set rendered
18
+ * as the inner body of a manifest `scopes` JSON array. Pre-joins so the array stays
19
+ * valid for any host subset (v3 parity: no trailing-comma breakage).
20
+ */
21
+ export declare const officeAddinManifestScopes: WhitelistFn;
22
+ /**
23
+ * Whitelist fn `officeAddinLaunchConfigurations(csv)` — the inner body of the
24
+ * `.vscode/launch.json` `configurations` array, limited to the selected hosts.
25
+ */
26
+ export declare const officeAddinLaunchConfigurations: WhitelistFn;
27
+ /**
28
+ * Whitelist fn `officeAddinLaunchCompounds(csv)` — the inner body of the
29
+ * `.vscode/launch.json` `compounds` array, limited to the selected hosts.
30
+ */
31
+ export declare const officeAddinLaunchCompounds: WhitelistFn;
32
+ /**
33
+ * Whitelist fn `officeAddinDebugScripts(csv)` — the `start:desktop:<host>` npm
34
+ * script entries for the selected hosts, each on its own line with a trailing comma.
35
+ */
36
+ export declare const officeAddinDebugScripts: WhitelistFn;
37
+ /** Whitelist fn `officeAddinDebugApp(csv)` — the default `app_to_debug` host. */
38
+ export declare const officeAddinDebugApp: WhitelistFn;
39
+ /** Build the real pure expression runtime port. */
40
+ export declare function createExpressionPort(flagReader?: (name: string) => boolean): ExpressionRuntimePort;
41
+ //# sourceMappingURL=whitelist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whitelist.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/whitelist.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAStF,4DAA4D;AAC5D,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASvD;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,EAAE,WAA+D,CAAC;AAE3F,gFAAgF;AAChF,eAAO,MAAM,UAAU,EAAE,WAC6C,CAAC;AAEvE,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,EAAE,WACa,CAAC;AAErD,gFAAgF;AAChF,eAAO,MAAM,aAAa,EAAE,WAA0C,CAAC;AAqBvE,8FAA8F;AAC9F,eAAO,MAAM,QAAQ,EAAE,WACqB,CAAC;AAE7C,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,EAAE,WAC+B,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAKvC,CAAC;AA8CF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE,WAiC7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAgBxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAOtB,CAAC;AAEjB,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,EAAE,WACL,CAAC;AAsB9B,mDAAmD;AACnD,wBAAgB,oBAAoB,CAClC,UAAU,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAuB,GACpD,qBAAqB,CAKvB"}
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.officeAddinDebugApp = exports.officeAddinDebugScripts = exports.officeAddinLaunchCompounds = exports.officeAddinLaunchConfigurations = exports.officeAddinManifestScopes = exports.officeAddinManifestScope = exports.contains = exports.pathDelimiter = exports.safeProjectNameLowerCase = exports.mcpAuthRef = exports.mcpNamespace = void 0;
6
+ exports.deriveMcpServerName = deriveMcpServerName;
7
+ exports.createExpressionPort = createExpressionPort;
8
+ const tslib_1 = require("tslib");
9
+ const path = tslib_1.__importStar(require("path"));
10
+ const featureFlags_1 = require("../../common/featureFlags");
11
+ /** Closed v4 render-context function whitelist. See build-render-context spec. */
12
+ const NAMESPACE_FALLBACK = "mcpServer";
13
+ const NAMESPACE_MAX_LENGTH = 10;
14
+ /** Derive a stable MCP server namespace from a URL host. */
15
+ function deriveMcpServerName(url) {
16
+ let host = "";
17
+ try {
18
+ host = new URL(url).host;
19
+ }
20
+ catch {
21
+ host = "";
22
+ }
23
+ const alphanumeric = host.replace(/[^a-zA-Z0-9]/g, "").substring(0, NAMESPACE_MAX_LENGTH);
24
+ return alphanumeric.length > 0 ? alphanumeric : NAMESPACE_FALLBACK;
25
+ }
26
+ /** Whitelist fn `mcpNamespace(url)` — the rendered `ai-plugin.json` namespace. */
27
+ const mcpNamespace = (url) => deriveMcpServerName(url);
28
+ exports.mcpNamespace = mcpNamespace;
29
+ /** Whitelist fn `mcpAuthRef(url)` for the deferred auth env-ref placeholder. */
30
+ const mcpAuthRef = (url) => "${{MCP_DA_AUTH_ID_" + deriveMcpServerName(url).toUpperCase() + "}}";
31
+ exports.mcpAuthRef = mcpAuthRef;
32
+ /** Whitelist fn `safeProjectNameLowerCase(appName)` for package names. */
33
+ const safeProjectNameLowerCase = (appName) => appName.replace(/[^0-9a-zA-Z]/g, "").toLowerCase();
34
+ exports.safeProjectNameLowerCase = safeProjectNameLowerCase;
35
+ /** Whitelist fn `pathDelimiter()` for PATH-like launch configuration values. */
36
+ const pathDelimiter = () => path.delimiter;
37
+ exports.pathDelimiter = pathDelimiter;
38
+ /** Office add-in manifest requirement scope for each host id. */
39
+ const OFFICE_ADDIN_HOST_SCOPE = {
40
+ outlook: "mail",
41
+ excel: "workbook",
42
+ word: "document",
43
+ powerpoint: "presentation",
44
+ };
45
+ /** Stable host order for a deterministic multi-scope render. */
46
+ const OFFICE_ADDIN_HOST_ORDER = ["mail", "workbook", "document", "presentation"];
47
+ /** Parse a comma-joined multiSelect answer into its selected ids. */
48
+ function parseCsv(csv) {
49
+ return csv
50
+ .split(",")
51
+ .map((item) => item.trim())
52
+ .filter((item) => item.length > 0);
53
+ }
54
+ /** Whitelist fn `contains(csv, item)` — `"true"` when a multiSelect answer selects `item`. */
55
+ const contains = (csv, item) => parseCsv(csv).includes(item) ? "true" : "";
56
+ exports.contains = contains;
57
+ /** Whitelist fn `officeAddinManifestScope(host)` — the single-host manifest scope literal. */
58
+ const officeAddinManifestScope = (host) => `"${OFFICE_ADDIN_HOST_SCOPE[host] ?? OFFICE_ADDIN_HOST_SCOPE.word}"`;
59
+ exports.officeAddinManifestScope = officeAddinManifestScope;
60
+ /**
61
+ * Whitelist fn `officeAddinManifestScopes(csv)` — the multiSelect host set rendered
62
+ * as the inner body of a manifest `scopes` JSON array. Pre-joins so the array stays
63
+ * valid for any host subset (v3 parity: no trailing-comma breakage).
64
+ */
65
+ const officeAddinManifestScopes = (csv) => {
66
+ const selected = new Set(parseCsv(csv).map((host) => OFFICE_ADDIN_HOST_SCOPE[host]));
67
+ const scopes = OFFICE_ADDIN_HOST_ORDER.filter((scope) => selected.has(scope));
68
+ const body = scopes.length > 0 ? scopes : [OFFICE_ADDIN_HOST_SCOPE.word];
69
+ return body.map((scope) => `"${scope}"`).join(",\n ");
70
+ };
71
+ exports.officeAddinManifestScopes = officeAddinManifestScopes;
72
+ /**
73
+ * Debug launch surface for the Office task-pane template.
74
+ *
75
+ * These functions pre-join the `.vscode/launch.json` and `package.json` host
76
+ * entries instead of the `{{#HostOutlook}}` Mustache sections the manifest uses.
77
+ * The manifest's optional blocks each sit next to a guaranteed-present sibling
78
+ * (the default permission / runtime / ribbon), so a section can carry its own
79
+ * trailing comma safely. The launch configs, compounds, and debug scripts are
80
+ * *fully* optional arrays — every element depends on a host that may be
81
+ * deselected — so there is no anchor element to absorb a trailing comma, and
82
+ * flat Mustache cannot suppress the comma after the last selected block. A
83
+ * comma `join` over the selected hosts is the only comma-correct option, which
84
+ * only a function (not a template) can express.
85
+ *
86
+ * This mirrors how v3 handles the same files: rather than editing JSON text, v3
87
+ * scaffolds all hosts and then `Array.filter`s the parsed `configurations` /
88
+ * `compounds` / `scripts` and re-serializes (officeAddin generator `post`). v4
89
+ * has no post-render file mutation, so the equivalent filtered-list-to-string
90
+ * happens here at render time instead.
91
+ */
92
+ const OFFICE_ADDIN_HOST_LABEL = {
93
+ word: "Word",
94
+ excel: "Excel",
95
+ powerpoint: "PowerPoint",
96
+ outlook: "Outlook",
97
+ };
98
+ const OFFICE_ADDIN_LAUNCH_HOST_ORDER = ["word", "excel", "powerpoint", "outlook"];
99
+ /** Selected hosts in canonical order, defaulting to word when nothing is selected. */
100
+ function selectedLaunchHosts(csv) {
101
+ const selected = new Set(parseCsv(csv));
102
+ const hosts = OFFICE_ADDIN_LAUNCH_HOST_ORDER.filter((host) => selected.has(host));
103
+ return hosts.length > 0 ? hosts : ["word"];
104
+ }
105
+ /** Indent a multi-line JSON fragment so it nests under the given column. */
106
+ function indentJson(json, spaces) {
107
+ const pad = " ".repeat(spaces);
108
+ return json
109
+ .split("\n")
110
+ .map((line) => (line.length > 0 ? pad + line : line))
111
+ .join("\n");
112
+ }
113
+ /**
114
+ * Whitelist fn `officeAddinLaunchConfigurations(csv)` — the inner body of the
115
+ * `.vscode/launch.json` `configurations` array, limited to the selected hosts.
116
+ */
117
+ const officeAddinLaunchConfigurations = (csv) => {
118
+ const blocks = selectedLaunchHosts(csv).flatMap((host) => {
119
+ const label = OFFICE_ADDIN_HOST_LABEL[host];
120
+ return [
121
+ `{
122
+ "name": "${label} Desktop Host",
123
+ "type": "node-terminal",
124
+ "request": "launch",
125
+ "command": "npm run start:desktop:${host}",
126
+ "cwd": "\${workspaceFolder}",
127
+ "preLaunchTask": "Install",
128
+ "postDebugTask": "Stop Debug",
129
+ "presentation": {
130
+ "hidden": true
131
+ }
132
+ }`,
133
+ `{
134
+ "name": "${label} Desktop Attach (Edge Chromium)",
135
+ "type": "msedge",
136
+ "request": "attach",
137
+ "port": 9229,
138
+ "timeout": 600000,
139
+ "webRoot": "\${workspaceRoot}",
140
+ "presentation": {
141
+ "hidden": true
142
+ }
143
+ }`,
144
+ ];
145
+ });
146
+ return blocks
147
+ .map((block) => indentJson(block, 4))
148
+ .join(",\n")
149
+ .trimStart();
150
+ };
151
+ exports.officeAddinLaunchConfigurations = officeAddinLaunchConfigurations;
152
+ /**
153
+ * Whitelist fn `officeAddinLaunchCompounds(csv)` — the inner body of the
154
+ * `.vscode/launch.json` `compounds` array, limited to the selected hosts.
155
+ */
156
+ const officeAddinLaunchCompounds = (csv) => {
157
+ const blocks = selectedLaunchHosts(csv).map((host) => {
158
+ const label = OFFICE_ADDIN_HOST_LABEL[host];
159
+ return `{
160
+ "name": "${label} Desktop (Edge Chromium)",
161
+ "configurations": [
162
+ "${label} Desktop Host",
163
+ "${label} Desktop Attach (Edge Chromium)"
164
+ ],
165
+ "stopAll": true
166
+ }`;
167
+ });
168
+ return blocks
169
+ .map((block) => indentJson(block, 4))
170
+ .join(",\n")
171
+ .trimStart();
172
+ };
173
+ exports.officeAddinLaunchCompounds = officeAddinLaunchCompounds;
174
+ /**
175
+ * Whitelist fn `officeAddinDebugScripts(csv)` — the `start:desktop:<host>` npm
176
+ * script entries for the selected hosts, each on its own line with a trailing comma.
177
+ */
178
+ const officeAddinDebugScripts = (csv) => selectedLaunchHosts(csv)
179
+ .map((host) => ` "start:desktop:${host}": "office-addin-debugging start appPackage/manifest.json desktop --app ${host}",`)
180
+ .join("\n")
181
+ .trimStart();
182
+ exports.officeAddinDebugScripts = officeAddinDebugScripts;
183
+ /** Whitelist fn `officeAddinDebugApp(csv)` — the default `app_to_debug` host. */
184
+ const officeAddinDebugApp = (csv) => selectedLaunchHosts(csv)[0];
185
+ exports.officeAddinDebugApp = officeAddinDebugApp;
186
+ /** The closed function whitelist; an author cannot extend it (ADR-0016 decision 3). */
187
+ const WHITELIST = new Map([
188
+ ["mcpNamespace", exports.mcpNamespace],
189
+ ["mcpAuthRef", exports.mcpAuthRef],
190
+ ["safeProjectNameLowerCase", exports.safeProjectNameLowerCase],
191
+ ["pathDelimiter", exports.pathDelimiter],
192
+ ["contains", exports.contains],
193
+ ["officeAddinManifestScope", exports.officeAddinManifestScope],
194
+ ["officeAddinManifestScopes", exports.officeAddinManifestScopes],
195
+ ["officeAddinLaunchConfigurations", exports.officeAddinLaunchConfigurations],
196
+ ["officeAddinLaunchCompounds", exports.officeAddinLaunchCompounds],
197
+ ["officeAddinDebugScripts", exports.officeAddinDebugScripts],
198
+ ["officeAddinDebugApp", exports.officeAddinDebugApp],
199
+ ]);
200
+ /** Default feature-flag reader: an env-backed truthy check (`"true"` / `"1"`). */
201
+ function envFlagReader(name) {
202
+ return (0, featureFlags_1.readBooleanFeatureFlag)(name);
203
+ }
204
+ /** Build the real pure expression runtime port. */
205
+ function createExpressionPort(flagReader = envFlagReader) {
206
+ return {
207
+ functions: (name) => WHITELIST.get(name),
208
+ flags: (name) => flagReader(name),
209
+ };
210
+ }
211
+ //# sourceMappingURL=whitelist.js.map