@microsoft/teamsfx-core 3.1.0 → 3.1.2-alpha.31d08fb48a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (973) 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 +3 -7
  10. package/build/client/teamsDevPortalClient.d.ts.map +1 -1
  11. package/build/client/teamsDevPortalClient.js +101 -122
  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/cancellation.d.ts +5 -0
  22. package/build/common/cancellation.d.ts.map +1 -0
  23. package/build/common/cancellation.js +17 -0
  24. package/build/common/cancellation.js.map +1 -0
  25. package/build/common/constants.d.ts +5 -1
  26. package/build/common/constants.d.ts.map +1 -1
  27. package/build/common/constants.js +20 -5
  28. package/build/common/constants.js.map +1 -1
  29. package/build/common/daSpecParser.d.ts +2 -1
  30. package/build/common/daSpecParser.d.ts.map +1 -1
  31. package/build/common/daSpecParser.js +214 -21
  32. package/build/common/daSpecParser.js.map +1 -1
  33. package/build/common/featureFlags.d.ts +22 -5
  34. package/build/common/featureFlags.d.ts.map +1 -1
  35. package/build/common/featureFlags.js +40 -9
  36. package/build/common/featureFlags.js.map +1 -1
  37. package/build/common/fetchHelper.d.ts.map +1 -1
  38. package/build/common/fetchHelper.js +41 -3
  39. package/build/common/fetchHelper.js.map +1 -1
  40. package/build/common/globalVars.d.ts +1 -1
  41. package/build/common/globalVars.d.ts.map +1 -1
  42. package/build/common/globalVars.js.map +1 -1
  43. package/build/common/httpProxy.d.ts +21 -0
  44. package/build/common/httpProxy.d.ts.map +1 -0
  45. package/build/common/httpProxy.js +117 -0
  46. package/build/common/httpProxy.js.map +1 -0
  47. package/build/common/kiotaClient.d.ts +3 -3
  48. package/build/common/kiotaClient.d.ts.map +1 -1
  49. package/build/common/kiotaClient.js +10 -10
  50. package/build/common/kiotaClient.js.map +1 -1
  51. package/build/common/mcpToolFetcher.d.ts +90 -0
  52. package/build/common/mcpToolFetcher.d.ts.map +1 -0
  53. package/build/common/mcpToolFetcher.js +424 -0
  54. package/build/common/mcpToolFetcher.js.map +1 -0
  55. package/build/common/odrProvider.d.ts +43 -0
  56. package/build/common/odrProvider.d.ts.map +1 -0
  57. package/build/common/odrProvider.js +154 -0
  58. package/build/common/odrProvider.js.map +1 -0
  59. package/build/common/openApiParserOptions.d.ts +3 -0
  60. package/build/common/openApiParserOptions.d.ts.map +1 -0
  61. package/build/common/openApiParserOptions.js +61 -0
  62. package/build/common/openApiParserOptions.js.map +1 -0
  63. package/build/common/permissionInterface.d.ts +12 -3
  64. package/build/common/permissionInterface.d.ts.map +1 -1
  65. package/build/common/permissionInterface.js +7 -1
  66. package/build/common/permissionInterface.js.map +1 -1
  67. package/build/common/projectSettingsHelper.d.ts +0 -2
  68. package/build/common/projectSettingsHelper.d.ts.map +1 -1
  69. package/build/common/projectSettingsHelper.js +1 -59
  70. package/build/common/projectSettingsHelper.js.map +1 -1
  71. package/build/common/retryHandler.d.ts +5 -0
  72. package/build/common/retryHandler.d.ts.map +1 -0
  73. package/build/common/retryHandler.js +27 -0
  74. package/build/common/retryHandler.js.map +1 -0
  75. package/build/common/samples.d.ts +1 -1
  76. package/build/common/samples.js +1 -1
  77. package/build/common/secretmasker/dict.d.ts.map +1 -1
  78. package/build/common/secretmasker/dict.js +5 -2
  79. package/build/common/secretmasker/dict.js.map +1 -1
  80. package/build/common/secretmasker/feature.js.map +1 -1
  81. package/build/common/teamsGraphApiNames.d.ts +10 -0
  82. package/build/common/teamsGraphApiNames.d.ts.map +1 -0
  83. package/build/common/teamsGraphApiNames.js +16 -0
  84. package/build/common/teamsGraphApiNames.js.map +1 -0
  85. package/build/common/telemetry.d.ts +6 -15
  86. package/build/common/telemetry.d.ts.map +1 -1
  87. package/build/common/telemetry.js +9 -20
  88. package/build/common/telemetry.js.map +1 -1
  89. package/build/common/templates-config.json +10 -3
  90. package/build/common/tools.d.ts +1 -1
  91. package/build/common/tools.d.ts.map +1 -1
  92. package/build/common/tools.js +6 -6
  93. package/build/common/tools.js.map +1 -1
  94. package/build/common/treatmentVariables.d.ts +5 -0
  95. package/build/common/treatmentVariables.d.ts.map +1 -0
  96. package/build/common/treatmentVariables.js +10 -0
  97. package/build/common/treatmentVariables.js.map +1 -0
  98. package/build/common/wrappedAxiosClient.d.ts +11 -2
  99. package/build/common/wrappedAxiosClient.d.ts.map +1 -1
  100. package/build/common/wrappedAxiosClient.js +147 -59
  101. package/build/common/wrappedAxiosClient.js.map +1 -1
  102. package/build/component/configManager/actionInjector.d.ts +16 -1
  103. package/build/component/configManager/actionInjector.d.ts.map +1 -1
  104. package/build/component/configManager/actionInjector.js +106 -1
  105. package/build/component/configManager/actionInjector.js.map +1 -1
  106. package/build/component/configManager/lifecycle.d.ts +2 -2
  107. package/build/component/configManager/lifecycle.d.ts.map +1 -1
  108. package/build/component/configManager/lifecycle.js +38 -9
  109. package/build/component/configManager/lifecycle.js.map +1 -1
  110. package/build/component/configManager/parser.js.map +1 -1
  111. package/build/component/configManager/validator.d.ts.map +1 -1
  112. package/build/component/configManager/validator.js +2 -0
  113. package/build/component/configManager/validator.js.map +1 -1
  114. package/build/component/coordinator/index.d.ts.map +1 -1
  115. package/build/component/coordinator/index.js +13 -11
  116. package/build/component/coordinator/index.js.map +1 -1
  117. package/build/component/deps-checker/internal/dotnetChecker.js.map +1 -1
  118. package/build/component/deps-checker/internal/funcToolChecker.js +6 -7
  119. package/build/component/deps-checker/internal/funcToolChecker.js.map +1 -1
  120. package/build/component/deps-checker/internal/nodeChecker.js +1 -1
  121. package/build/component/deps-checker/internal/nodeChecker.js.map +1 -1
  122. package/build/component/deps-checker/internal/testToolChecker.js +13 -13
  123. package/build/component/deps-checker/internal/testToolChecker.js.map +1 -1
  124. package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
  125. package/build/component/developerPortalScaffoldUtils.js +5 -5
  126. package/build/component/developerPortalScaffoldUtils.js.map +1 -1
  127. package/build/component/driver/aad/utility/aadManifestHelper.d.ts +1 -1
  128. package/build/component/driver/aad/utility/aadManifestHelper.d.ts.map +1 -1
  129. package/build/component/driver/aad/utility/aadManifestHelper.js +7 -4
  130. package/build/component/driver/aad/utility/aadManifestHelper.js.map +1 -1
  131. package/build/component/driver/add/addWebPart.js +3 -3
  132. package/build/component/driver/add/addWebPart.js.map +1 -1
  133. package/build/component/driver/apiKey/create.d.ts.map +1 -1
  134. package/build/component/driver/apiKey/create.js +4 -4
  135. package/build/component/driver/apiKey/create.js.map +1 -1
  136. package/build/component/driver/apiKey/update.d.ts.map +1 -1
  137. package/build/component/driver/apiKey/update.js +4 -4
  138. package/build/component/driver/apiKey/update.js.map +1 -1
  139. package/build/component/driver/arm/util/handleError.js +5 -4
  140. package/build/component/driver/arm/util/handleError.js.map +1 -1
  141. package/build/component/driver/botAadApp/create.js +1 -1
  142. package/build/component/driver/botAadApp/create.js.map +1 -1
  143. package/build/component/driver/copilotAgent/interfaces/PublishArgs.d.ts +14 -0
  144. package/build/component/driver/copilotAgent/interfaces/PublishArgs.d.ts.map +1 -0
  145. package/build/component/driver/copilotAgent/interfaces/PublishArgs.js +5 -0
  146. package/build/component/driver/copilotAgent/interfaces/PublishArgs.js.map +1 -0
  147. package/build/component/driver/copilotAgent/publish.d.ts +16 -0
  148. package/build/component/driver/copilotAgent/publish.d.ts.map +1 -0
  149. package/build/component/driver/copilotAgent/publish.js +175 -0
  150. package/build/component/driver/copilotAgent/publish.js.map +1 -0
  151. package/build/component/driver/dcr/create.d.ts +10 -0
  152. package/build/component/driver/dcr/create.d.ts.map +1 -0
  153. package/build/component/driver/dcr/create.js +142 -0
  154. package/build/component/driver/dcr/create.js.map +1 -0
  155. package/build/component/driver/dcr/error/dcrNameTooLong.d.ts +5 -0
  156. package/build/component/driver/dcr/error/dcrNameTooLong.d.ts.map +1 -0
  157. package/build/component/driver/dcr/error/dcrNameTooLong.js +21 -0
  158. package/build/component/driver/dcr/error/dcrNameTooLong.js.map +1 -0
  159. package/build/component/driver/dcr/error/dcrWellKnownInvalid.d.ts +5 -0
  160. package/build/component/driver/dcr/error/dcrWellKnownInvalid.d.ts.map +1 -0
  161. package/build/component/driver/dcr/error/dcrWellKnownInvalid.js +21 -0
  162. package/build/component/driver/dcr/error/dcrWellKnownInvalid.js.map +1 -0
  163. package/build/component/driver/dcr/interface/createDcrArgs.d.ts +9 -0
  164. package/build/component/driver/dcr/interface/createDcrArgs.d.ts.map +1 -0
  165. package/build/component/driver/dcr/interface/createDcrArgs.js +5 -0
  166. package/build/component/driver/dcr/interface/createDcrArgs.js.map +1 -0
  167. package/build/component/driver/dcr/interface/createDcrOutputs.d.ts +7 -0
  168. package/build/component/driver/dcr/interface/createDcrOutputs.d.ts.map +1 -0
  169. package/build/component/driver/dcr/interface/createDcrOutputs.js +10 -0
  170. package/build/component/driver/dcr/interface/createDcrOutputs.js.map +1 -0
  171. package/build/component/driver/dcr/utility/constants.d.ts +7 -0
  172. package/build/component/driver/dcr/utility/constants.d.ts.map +1 -0
  173. package/build/component/driver/dcr/utility/constants.js +12 -0
  174. package/build/component/driver/dcr/utility/constants.js.map +1 -0
  175. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.d.ts +3 -1
  176. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.d.ts.map +1 -1
  177. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.js +12 -9
  178. package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.js.map +1 -1
  179. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts +3 -0
  180. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
  181. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +39 -4
  182. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
  183. package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +2 -2
  184. package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
  185. package/build/component/driver/devTool/httpClient.d.ts +4 -0
  186. package/build/component/driver/devTool/httpClient.d.ts.map +1 -1
  187. package/build/component/driver/devTool/httpClient.js +6 -3
  188. package/build/component/driver/devTool/httpClient.js.map +1 -1
  189. package/build/component/driver/index.d.ts +2 -0
  190. package/build/component/driver/index.d.ts.map +1 -1
  191. package/build/component/driver/index.js +2 -0
  192. package/build/component/driver/index.js.map +1 -1
  193. package/build/component/driver/interface/buildAndDeployArgs.d.ts +1 -1
  194. package/build/component/driver/interface/buildAndDeployArgs.d.ts.map +1 -1
  195. package/build/component/driver/interface/commonArgs.d.ts +2 -1
  196. package/build/component/driver/interface/commonArgs.d.ts.map +1 -1
  197. package/build/component/driver/m365/acquire.d.ts.map +1 -1
  198. package/build/component/driver/m365/acquire.js +4 -3
  199. package/build/component/driver/m365/acquire.js.map +1 -1
  200. package/build/component/driver/oauth/create.d.ts.map +1 -1
  201. package/build/component/driver/oauth/create.js +5 -4
  202. package/build/component/driver/oauth/create.js.map +1 -1
  203. package/build/component/driver/oauth/update.d.ts.map +1 -1
  204. package/build/component/driver/oauth/update.js +5 -5
  205. package/build/component/driver/oauth/update.js.map +1 -1
  206. package/build/component/driver/script/baseBuildDriver.d.ts +1 -2
  207. package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
  208. package/build/component/driver/script/baseBuildDriver.js +0 -2
  209. package/build/component/driver/script/baseBuildDriver.js.map +1 -1
  210. package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
  211. package/build/component/driver/script/scriptDriver.js +3 -2
  212. package/build/component/driver/script/scriptDriver.js.map +1 -1
  213. package/build/component/driver/share/utils.d.ts.map +1 -1
  214. package/build/component/driver/share/utils.js +9 -7
  215. package/build/component/driver/share/utils.js.map +1 -1
  216. package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
  217. package/build/component/driver/teamsApp/appStudio.js +1 -1
  218. package/build/component/driver/teamsApp/appStudio.js.map +1 -1
  219. package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
  220. package/build/component/driver/teamsApp/configure.js +7 -0
  221. package/build/component/driver/teamsApp/configure.js.map +1 -1
  222. package/build/component/driver/teamsApp/constants.d.ts +9 -3
  223. package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
  224. package/build/component/driver/teamsApp/constants.js +11 -4
  225. package/build/component/driver/teamsApp/constants.js.map +1 -1
  226. package/build/component/driver/teamsApp/create.d.ts.map +1 -1
  227. package/build/component/driver/teamsApp/create.js +19 -1
  228. package/build/component/driver/teamsApp/create.js.map +1 -1
  229. package/build/component/driver/teamsApp/createAppPackage.d.ts +10 -0
  230. package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
  231. package/build/component/driver/teamsApp/createAppPackage.js +383 -70
  232. package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
  233. package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts +10 -0
  234. package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts.map +1 -0
  235. package/build/component/driver/teamsApp/interfaces/DcrRegistration.js +5 -0
  236. package/build/component/driver/teamsApp/interfaces/DcrRegistration.js.map +1 -0
  237. package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts +4 -0
  238. package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts.map +1 -1
  239. package/build/component/driver/teamsApp/interfaces/OauthRegistration.js.map +1 -1
  240. package/build/component/driver/teamsApp/interfaces/ValidationResult.d.ts +6 -0
  241. package/build/component/driver/teamsApp/interfaces/ValidationResult.d.ts.map +1 -1
  242. package/build/component/driver/teamsApp/publishAppPackage.d.ts +0 -2
  243. package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
  244. package/build/component/driver/teamsApp/publishAppPackage.js +19 -60
  245. package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
  246. package/build/component/driver/teamsApp/syncManifest.d.ts +3 -3
  247. package/build/component/driver/teamsApp/syncManifest.d.ts.map +1 -1
  248. package/build/component/driver/teamsApp/syncManifest.js +8 -8
  249. package/build/component/driver/teamsApp/syncManifest.js.map +1 -1
  250. package/build/component/driver/teamsApp/teamsappMgr.d.ts +6 -0
  251. package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -1
  252. package/build/component/driver/teamsApp/teamsappMgr.js +38 -3
  253. package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -1
  254. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts +2 -0
  255. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts.map +1 -1
  256. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js +120 -5
  257. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
  258. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +1 -1
  259. package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
  260. package/build/component/driver/teamsApp/utils/ManifestUtils.js +10 -2
  261. package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
  262. package/build/component/driver/teamsApp/utils/McpCertVerification.d.ts +17 -0
  263. package/build/component/driver/teamsApp/utils/McpCertVerification.d.ts.map +1 -0
  264. package/build/component/driver/teamsApp/utils/McpCertVerification.js +72 -0
  265. package/build/component/driver/teamsApp/utils/McpCertVerification.js.map +1 -0
  266. package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts.map +1 -1
  267. package/build/component/driver/teamsApp/utils/PluginManifestUtils.js +1 -1
  268. package/build/component/driver/teamsApp/utils/PluginManifestUtils.js.map +1 -1
  269. package/build/component/driver/teamsApp/utils/telemetry.d.ts +1 -0
  270. package/build/component/driver/teamsApp/utils/telemetry.d.ts.map +1 -1
  271. package/build/component/driver/teamsApp/utils/telemetry.js +1 -0
  272. package/build/component/driver/teamsApp/utils/telemetry.js.map +1 -1
  273. package/build/component/driver/teamsApp/utils/utils.d.ts +1 -4
  274. package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
  275. package/build/component/driver/teamsApp/utils/utils.js +3 -25
  276. package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
  277. package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
  278. package/build/component/driver/teamsApp/validate.js +16 -5
  279. package/build/component/driver/teamsApp/validate.js.map +1 -1
  280. package/build/component/driver/teamsApp/validateAppPackage.d.ts +13 -0
  281. package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
  282. package/build/component/driver/teamsApp/validateAppPackage.js +58 -1
  283. package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
  284. package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
  285. package/build/component/driver/typeSpec/compile.d.ts.map +1 -1
  286. package/build/component/driver/typeSpec/compile.js +23 -7
  287. package/build/component/driver/typeSpec/compile.js.map +1 -1
  288. package/build/component/driver/typeSpec/error/typeSpecCompileError.d.ts +5 -0
  289. package/build/component/driver/typeSpec/error/typeSpecCompileError.d.ts.map +1 -0
  290. package/build/component/driver/typeSpec/error/typeSpecCompileError.js +21 -0
  291. package/build/component/driver/typeSpec/error/typeSpecCompileError.js.map +1 -0
  292. package/build/component/driver/util/utils.d.ts.map +1 -1
  293. package/build/component/driver/util/utils.js +1 -0
  294. package/build/component/driver/util/utils.js.map +1 -1
  295. package/build/component/feature/sso.js +2 -2
  296. package/build/component/feature/sso.js.map +1 -1
  297. package/build/component/generator/combinedProject/generator.d.ts.map +1 -1
  298. package/build/component/generator/combinedProject/generator.js +9 -1
  299. package/build/component/generator/combinedProject/generator.js.map +1 -1
  300. package/build/component/generator/configFiles/configGenerator.js +1 -1
  301. package/build/component/generator/configFiles/configGenerator.js.map +1 -1
  302. package/build/component/generator/declarativeAgent/generator.d.ts +7 -0
  303. package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
  304. package/build/component/generator/declarativeAgent/generator.js +23 -15
  305. package/build/component/generator/declarativeAgent/generator.js.map +1 -1
  306. package/build/component/generator/declarativeAgent/helper.d.ts +52 -0
  307. package/build/component/generator/declarativeAgent/helper.d.ts.map +1 -1
  308. package/build/component/generator/declarativeAgent/helper.js +469 -63
  309. package/build/component/generator/declarativeAgent/helper.js.map +1 -1
  310. package/build/component/generator/defaultGenerator.d.ts.map +1 -1
  311. package/build/component/generator/defaultGenerator.js +17 -1
  312. package/build/component/generator/defaultGenerator.js.map +1 -1
  313. package/build/component/generator/error.d.ts +3 -0
  314. package/build/component/generator/error.d.ts.map +1 -1
  315. package/build/component/generator/error.js +7 -1
  316. package/build/component/generator/error.js.map +1 -1
  317. package/build/component/generator/generatorAction.d.ts +12 -1
  318. package/build/component/generator/generatorAction.d.ts.map +1 -1
  319. package/build/component/generator/generatorAction.js +16 -8
  320. package/build/component/generator/generatorAction.js.map +1 -1
  321. package/build/component/generator/officeAddin/generator.d.ts +13 -0
  322. package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
  323. package/build/component/generator/officeAddin/generator.js +159 -35
  324. package/build/component/generator/officeAddin/generator.js.map +1 -1
  325. package/build/component/generator/officeAddin/helperMethods.d.ts +4 -0
  326. package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
  327. package/build/component/generator/officeAddin/helperMethods.js +6 -3
  328. package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
  329. package/build/component/generator/openApiSpec/common.js +1 -1
  330. package/build/component/generator/openApiSpec/common.js.map +1 -1
  331. package/build/component/generator/openApiSpec/customEngineAgentGenerator.d.ts +8 -0
  332. package/build/component/generator/openApiSpec/customEngineAgentGenerator.d.ts.map +1 -1
  333. package/build/component/generator/openApiSpec/customEngineAgentGenerator.js +9 -4
  334. package/build/component/generator/openApiSpec/customEngineAgentGenerator.js.map +1 -1
  335. package/build/component/generator/openApiSpec/helper.d.ts +2 -3
  336. package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
  337. package/build/component/generator/openApiSpec/helper.js +22 -60
  338. package/build/component/generator/openApiSpec/helper.js.map +1 -1
  339. package/build/component/generator/openPlugin/authorParser.d.ts +8 -0
  340. package/build/component/generator/openPlugin/authorParser.d.ts.map +1 -0
  341. package/build/component/generator/openPlugin/authorParser.js +49 -0
  342. package/build/component/generator/openPlugin/authorParser.js.map +1 -0
  343. package/build/component/generator/openPlugin/deterministicId.d.ts +6 -0
  344. package/build/component/generator/openPlugin/deterministicId.d.ts.map +1 -0
  345. package/build/component/generator/openPlugin/deterministicId.js +31 -0
  346. package/build/component/generator/openPlugin/deterministicId.js.map +1 -0
  347. package/build/component/generator/openPlugin/exporter.d.ts +18 -0
  348. package/build/component/generator/openPlugin/exporter.d.ts.map +1 -0
  349. package/build/component/generator/openPlugin/exporter.js +233 -0
  350. package/build/component/generator/openPlugin/exporter.js.map +1 -0
  351. package/build/component/generator/openPlugin/iconStrategy.d.ts +8 -0
  352. package/build/component/generator/openPlugin/iconStrategy.d.ts.map +1 -0
  353. package/build/component/generator/openPlugin/iconStrategy.js +62 -0
  354. package/build/component/generator/openPlugin/iconStrategy.js.map +1 -0
  355. package/build/component/generator/openPlugin/importer.d.ts +25 -0
  356. package/build/component/generator/openPlugin/importer.d.ts.map +1 -0
  357. package/build/component/generator/openPlugin/importer.js +140 -0
  358. package/build/component/generator/openPlugin/importer.js.map +1 -0
  359. package/build/component/generator/openPlugin/mapper.d.ts +6 -0
  360. package/build/component/generator/openPlugin/mapper.d.ts.map +1 -0
  361. package/build/component/generator/openPlugin/mapper.js +141 -0
  362. package/build/component/generator/openPlugin/mapper.js.map +1 -0
  363. package/build/component/generator/openPlugin/parser.d.ts +3 -0
  364. package/build/component/generator/openPlugin/parser.d.ts.map +1 -0
  365. package/build/component/generator/openPlugin/parser.js +153 -0
  366. package/build/component/generator/openPlugin/parser.js.map +1 -0
  367. package/build/component/generator/openPlugin/placeholderPng.d.ts +6 -0
  368. package/build/component/generator/openPlugin/placeholderPng.d.ts.map +1 -0
  369. package/build/component/generator/openPlugin/placeholderPng.js +71 -0
  370. package/build/component/generator/openPlugin/placeholderPng.js.map +1 -0
  371. package/build/component/generator/openPlugin/textUtils.d.ts +12 -0
  372. package/build/component/generator/openPlugin/textUtils.d.ts.map +1 -0
  373. package/build/component/generator/openPlugin/textUtils.js +43 -0
  374. package/build/component/generator/openPlugin/textUtils.js.map +1 -0
  375. package/build/component/generator/openPlugin/types.d.ts +128 -0
  376. package/build/component/generator/openPlugin/types.d.ts.map +1 -0
  377. package/build/component/generator/openPlugin/types.js.map +1 -0
  378. package/build/component/generator/other/tdpGenerator.d.ts +1 -0
  379. package/build/component/generator/other/tdpGenerator.d.ts.map +1 -1
  380. package/build/component/generator/other/tdpGenerator.js +24 -2
  381. package/build/component/generator/other/tdpGenerator.js.map +1 -1
  382. package/build/component/generator/spfx/spfxGenerator.js +5 -5
  383. package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
  384. package/build/component/generator/spfx/utils/constants.d.ts +1 -1
  385. package/build/component/generator/spfx/utils/constants.js +1 -1
  386. package/build/component/generator/spfx/utils/utils.js +1 -1
  387. package/build/component/generator/spfx/utils/utils.js.map +1 -1
  388. package/build/component/generator/templateHelper.d.ts +17 -2
  389. package/build/component/generator/templateHelper.d.ts.map +1 -1
  390. package/build/component/generator/templateHelper.js +36 -3
  391. package/build/component/generator/templateHelper.js.map +1 -1
  392. package/build/component/generator/templates/metadata/index.d.ts +15 -0
  393. package/build/component/generator/templates/metadata/index.d.ts.map +1 -1
  394. package/build/component/generator/templates/metadata/index.js +51 -5
  395. package/build/component/generator/templates/metadata/index.js.map +1 -1
  396. package/build/component/generator/templates/templateNames.d.ts +6 -3
  397. package/build/component/generator/templates/templateNames.d.ts.map +1 -1
  398. package/build/component/generator/templates/templateNames.js +7 -2
  399. package/build/component/generator/templates/templateNames.js.map +1 -1
  400. package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -1
  401. package/build/component/generator/templates/templateReplaceMap.js +4 -1
  402. package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
  403. package/build/component/generator/utils.d.ts.map +1 -1
  404. package/build/component/generator/utils.js +14 -8
  405. package/build/component/generator/utils.js.map +1 -1
  406. package/build/component/generator/v4MetadataSource.d.ts +16 -0
  407. package/build/component/generator/v4MetadataSource.d.ts.map +1 -0
  408. package/build/component/generator/v4MetadataSource.js +35 -0
  409. package/build/component/generator/v4MetadataSource.js.map +1 -0
  410. package/build/component/generator/v4TemplateBridge.d.ts +55 -0
  411. package/build/component/generator/v4TemplateBridge.d.ts.map +1 -0
  412. package/build/component/generator/v4TemplateBridge.js +224 -0
  413. package/build/component/generator/v4TemplateBridge.js.map +1 -0
  414. package/build/component/local/localCertificateManager.d.ts +16 -1
  415. package/build/component/local/localCertificateManager.d.ts.map +1 -1
  416. package/build/component/local/localCertificateManager.js +47 -31
  417. package/build/component/local/localCertificateManager.js.map +1 -1
  418. package/build/component/m365/constants.d.ts +2 -1
  419. package/build/component/m365/constants.d.ts.map +1 -1
  420. package/build/component/m365/constants.js +1 -0
  421. package/build/component/m365/constants.js.map +1 -1
  422. package/build/component/m365/errors.d.ts +7 -0
  423. package/build/component/m365/errors.d.ts.map +1 -1
  424. package/build/component/m365/errors.js +16 -1
  425. package/build/component/m365/errors.js.map +1 -1
  426. package/build/component/m365/launchHelper.d.ts.map +1 -1
  427. package/build/component/m365/launchHelper.js +7 -2
  428. package/build/component/m365/launchHelper.js.map +1 -1
  429. package/build/component/m365/packageService.d.ts +11 -5
  430. package/build/component/m365/packageService.d.ts.map +1 -1
  431. package/build/component/m365/packageService.js +132 -109
  432. package/build/component/m365/packageService.js.map +1 -1
  433. package/build/component/m365/serviceConstant.d.ts.map +1 -1
  434. package/build/component/m365/serviceConstant.js +24 -14
  435. package/build/component/m365/serviceConstant.js.map +1 -1
  436. package/build/component/middleware/envMW.d.ts.map +1 -1
  437. package/build/component/middleware/envMW.js +5 -0
  438. package/build/component/middleware/envMW.js.map +1 -1
  439. package/build/component/middleware/questionMW.d.ts.map +1 -1
  440. package/build/component/middleware/questionMW.js +3 -0
  441. package/build/component/middleware/questionMW.js.map +1 -1
  442. package/build/component/provisionUtils.d.ts.map +1 -1
  443. package/build/component/provisionUtils.js +5 -2
  444. package/build/component/provisionUtils.js.map +1 -1
  445. package/build/component/utils/ResourceGroupHelper.d.ts +4 -0
  446. package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
  447. package/build/component/utils/ResourceGroupHelper.js +8 -4
  448. package/build/component/utils/ResourceGroupHelper.js.map +1 -1
  449. package/build/component/utils/charsetUtils.js +3 -3
  450. package/build/component/utils/charsetUtils.js.map +1 -1
  451. package/build/component/utils/envFunctionUtils.js +77 -22
  452. package/build/component/utils/envFunctionUtils.js.map +1 -1
  453. package/build/component/utils/envUtil.d.ts.map +1 -1
  454. package/build/component/utils/envUtil.js +2 -2
  455. package/build/component/utils/envUtil.js.map +1 -1
  456. package/build/component/utils/fileOperation.d.ts +9 -0
  457. package/build/component/utils/fileOperation.d.ts.map +1 -1
  458. package/build/component/utils/fileOperation.js +31 -17
  459. package/build/component/utils/fileOperation.js.map +1 -1
  460. package/build/component/utils/mcpAuthScaffolder.d.ts +137 -0
  461. package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -0
  462. package/build/component/utils/mcpAuthScaffolder.js +200 -0
  463. package/build/component/utils/mcpAuthScaffolder.js.map +1 -0
  464. package/build/component/utils/mcpToolFetcher.d.ts +2 -0
  465. package/build/component/utils/mcpToolFetcher.d.ts.map +1 -0
  466. package/build/component/utils/mcpToolFetcher.js +7 -0
  467. package/build/component/utils/mcpToolFetcher.js.map +1 -0
  468. package/build/component/utils/metadataGraphPermssion.d.ts +4 -0
  469. package/build/component/utils/metadataGraphPermssion.d.ts.map +1 -1
  470. package/build/component/utils/metadataGraphPermssion.js +7 -4
  471. package/build/component/utils/metadataGraphPermssion.js.map +1 -1
  472. package/build/component/utils/odrProvider.d.ts +1 -48
  473. package/build/component/utils/odrProvider.d.ts.map +1 -1
  474. package/build/component/utils/odrProvider.js +2 -94
  475. package/build/component/utils/odrProvider.js.map +1 -1
  476. package/build/core/FxCore.d.ts +49 -16
  477. package/build/core/FxCore.d.ts.map +1 -1
  478. package/build/core/FxCore.declarativeAgent.d.ts +45 -1
  479. package/build/core/FxCore.declarativeAgent.d.ts.map +1 -1
  480. package/build/core/FxCore.declarativeAgent.js +754 -56
  481. package/build/core/FxCore.declarativeAgent.js.map +1 -1
  482. package/build/core/FxCore.js +515 -325
  483. package/build/core/FxCore.js.map +1 -1
  484. package/build/core/FxCore.openPlugin.d.ts +23 -0
  485. package/build/core/FxCore.openPlugin.d.ts.map +1 -0
  486. package/build/core/FxCore.openPlugin.js +131 -0
  487. package/build/core/FxCore.openPlugin.js.map +1 -0
  488. package/build/core/FxCoreClient.d.ts +96 -0
  489. package/build/core/FxCoreClient.d.ts.map +1 -0
  490. package/build/core/FxCoreClient.js +159 -0
  491. package/build/core/FxCoreClient.js.map +1 -0
  492. package/build/core/collaborator.d.ts +1 -0
  493. package/build/core/collaborator.d.ts.map +1 -1
  494. package/build/core/collaborator.js +37 -0
  495. package/build/core/collaborator.js.map +1 -1
  496. package/build/core/createFrontDoorAdapters.d.ts +39 -0
  497. package/build/core/createFrontDoorAdapters.d.ts.map +1 -0
  498. package/build/core/createFrontDoorAdapters.js +244 -0
  499. package/build/core/createFrontDoorAdapters.js.map +1 -0
  500. package/build/core/createProjectFrontDoor.d.ts +49 -0
  501. package/build/core/createProjectFrontDoor.d.ts.map +1 -0
  502. package/build/core/createProjectFrontDoor.js +316 -0
  503. package/build/core/createProjectFrontDoor.js.map +1 -0
  504. package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
  505. package/build/core/middleware/concurrentLocker.js +7 -10
  506. package/build/core/middleware/concurrentLocker.js.map +1 -1
  507. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  508. package/build/core/middleware/errorHandler.js +9 -0
  509. package/build/core/middleware/errorHandler.js.map +1 -1
  510. package/build/core/middleware/fileLocker.js +6 -6
  511. package/build/core/middleware/fileLocker.js.map +1 -1
  512. package/build/core/middleware/utils/v3MigrationUtils.d.ts +1 -34
  513. package/build/core/middleware/utils/v3MigrationUtils.d.ts.map +1 -1
  514. package/build/core/middleware/utils/v3MigrationUtils.js +6 -245
  515. package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
  516. package/build/core/modifyProjectFrontDoor.d.ts +27 -0
  517. package/build/core/modifyProjectFrontDoor.d.ts.map +1 -0
  518. package/build/core/modifyProjectFrontDoor.js +148 -0
  519. package/build/core/modifyProjectFrontDoor.js.map +1 -0
  520. package/build/core/v4ArtifactSnapshot.d.ts +5 -0
  521. package/build/core/v4ArtifactSnapshot.d.ts.map +1 -0
  522. package/build/core/v4ArtifactSnapshot.js +23 -0
  523. package/build/core/v4ArtifactSnapshot.js.map +1 -0
  524. package/build/error/common.d.ts.map +1 -1
  525. package/build/error/common.js +3 -0
  526. package/build/error/common.js.map +1 -1
  527. package/build/error/teamsApp.d.ts +7 -1
  528. package/build/error/teamsApp.d.ts.map +1 -1
  529. package/build/error/teamsApp.js +34 -4
  530. package/build/error/teamsApp.js.map +1 -1
  531. package/build/error/teamsGraph.d.ts +5 -0
  532. package/build/error/teamsGraph.d.ts.map +1 -0
  533. package/build/error/teamsGraph.js +24 -0
  534. package/build/error/teamsGraph.js.map +1 -0
  535. package/build/index.d.ts +8 -4
  536. package/build/index.d.ts.map +1 -1
  537. package/build/index.js +21 -7
  538. package/build/index.js.map +1 -1
  539. package/build/question/constants.d.ts +1 -0
  540. package/build/question/constants.d.ts.map +1 -1
  541. package/build/question/constants.js +15 -8
  542. package/build/question/constants.js.map +1 -1
  543. package/build/question/create.d.ts +18 -0
  544. package/build/question/create.d.ts.map +1 -1
  545. package/build/question/create.js +121 -14
  546. package/build/question/create.js.map +1 -1
  547. package/build/question/index.d.ts +1 -1
  548. package/build/question/index.d.ts.map +1 -1
  549. package/build/question/index.js +4 -4
  550. package/build/question/index.js.map +1 -1
  551. package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
  552. package/build/question/inputs/AddPluginInputs.d.ts +17 -5
  553. package/build/question/inputs/AddPluginInputs.d.ts.map +1 -1
  554. package/build/question/inputs/AddSkillInputs.d.ts +10 -0
  555. package/build/question/inputs/AddSkillInputs.d.ts.map +1 -0
  556. package/build/question/inputs/AddSkillInputs.js +5 -0
  557. package/build/question/inputs/AddSkillInputs.js.map +1 -0
  558. package/build/question/inputs/CreateProjectInputs.d.ts +19 -1
  559. package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
  560. package/build/question/inputs/ExportOpenPluginInputs.d.ts +10 -0
  561. package/build/question/inputs/ExportOpenPluginInputs.d.ts.map +1 -0
  562. package/build/question/inputs/ExportOpenPluginInputs.js +5 -0
  563. package/build/question/inputs/ExportOpenPluginInputs.js.map +1 -0
  564. package/build/question/inputs/ImportOpenPluginInputs.d.ts +28 -0
  565. package/build/question/inputs/ImportOpenPluginInputs.d.ts.map +1 -0
  566. package/build/question/inputs/ImportOpenPluginInputs.js +5 -0
  567. package/build/question/inputs/ImportOpenPluginInputs.js.map +1 -0
  568. package/build/question/inputs/index.d.ts +4 -1
  569. package/build/question/inputs/index.d.ts.map +1 -1
  570. package/build/question/inputs/index.js +4 -1
  571. package/build/question/inputs/index.js.map +1 -1
  572. package/build/question/options/AddPluginOptions.d.ts.map +1 -1
  573. package/build/question/options/AddPluginOptions.js +38 -6
  574. package/build/question/options/AddPluginOptions.js.map +1 -1
  575. package/build/question/options/AddSkillOptions.d.ts +4 -0
  576. package/build/question/options/AddSkillOptions.d.ts.map +1 -0
  577. package/build/question/options/AddSkillOptions.js +47 -0
  578. package/build/question/options/AddSkillOptions.js.map +1 -0
  579. package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
  580. package/build/question/options/CreateProjectOptions.js +53 -1
  581. package/build/question/options/CreateProjectOptions.js.map +1 -1
  582. package/build/question/options/ExportOpenPluginOptions.d.ts +4 -0
  583. package/build/question/options/ExportOpenPluginOptions.d.ts.map +1 -0
  584. package/build/question/options/ExportOpenPluginOptions.js +29 -0
  585. package/build/question/options/ExportOpenPluginOptions.js.map +1 -0
  586. package/build/question/options/ImportOpenPluginOptions.d.ts +4 -0
  587. package/build/question/options/ImportOpenPluginOptions.d.ts.map +1 -0
  588. package/build/question/options/ImportOpenPluginOptions.js +54 -0
  589. package/build/question/options/ImportOpenPluginOptions.js.map +1 -0
  590. package/build/question/options/index.d.ts +3 -0
  591. package/build/question/options/index.d.ts.map +1 -1
  592. package/build/question/options/index.js +3 -0
  593. package/build/question/options/index.js.map +1 -1
  594. package/build/question/other.d.ts +1 -1
  595. package/build/question/other.d.ts.map +1 -1
  596. package/build/question/other.js +198 -17
  597. package/build/question/other.js.map +1 -1
  598. package/build/question/questionNames.d.ts +14 -1
  599. package/build/question/questionNames.d.ts.map +1 -1
  600. package/build/question/questionNames.js +13 -0
  601. package/build/question/questionNames.js.map +1 -1
  602. package/build/question/scaffold/commonNodes.d.ts.map +1 -1
  603. package/build/question/scaffold/commonNodes.js +14 -2
  604. package/build/question/scaffold/commonNodes.js.map +1 -1
  605. package/build/question/scaffold/constructNode.d.ts +3 -1
  606. package/build/question/scaffold/constructNode.d.ts.map +1 -1
  607. package/build/question/scaffold/constructNode.js +55 -2
  608. package/build/question/scaffold/constructNode.js.map +1 -1
  609. package/build/question/scaffold/vsc/CapabilityOptions.d.ts +3 -5
  610. package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
  611. package/build/question/scaffold/vsc/CapabilityOptions.js +46 -46
  612. package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
  613. package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts +2 -0
  614. package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts.map +1 -1
  615. package/build/question/scaffold/vsc/ProjectTypeOptions.js +9 -0
  616. package/build/question/scaffold/vsc/ProjectTypeOptions.js.map +1 -1
  617. package/build/question/scaffold/vsc/createRootNode.d.ts.map +1 -1
  618. package/build/question/scaffold/vsc/createRootNode.js +3 -0
  619. package/build/question/scaffold/vsc/createRootNode.js.map +1 -1
  620. package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
  621. package/build/question/scaffold/vsc/daProjectTypeNode.js +1 -6
  622. package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
  623. package/build/question/scaffold/vsc/rootNode.d.ts.map +1 -1
  624. package/build/question/scaffold/vsc/rootNode.js +17 -4
  625. package/build/question/scaffold/vsc/rootNode.js.map +1 -1
  626. package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +66 -0
  627. package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
  628. package/build/question/scaffold/vsc/teamsProjectTypeNode.js +408 -21
  629. package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
  630. package/build/question/share.js +3 -2
  631. package/build/question/share.js.map +1 -1
  632. package/build/ui/visitor.d.ts.map +1 -1
  633. package/build/ui/visitor.js +10 -0
  634. package/build/ui/visitor.js.map +1 -1
  635. package/build/v4/buildTarget/parseSelector.d.ts +35 -0
  636. package/build/v4/buildTarget/parseSelector.d.ts.map +1 -0
  637. package/build/v4/buildTarget/parseSelector.js +222 -0
  638. package/build/v4/buildTarget/parseSelector.js.map +1 -0
  639. package/build/v4/buildTarget/resolveBuildTarget.d.ts +82 -0
  640. package/build/v4/buildTarget/resolveBuildTarget.d.ts.map +1 -0
  641. package/build/v4/buildTarget/resolveBuildTarget.js +243 -0
  642. package/build/v4/buildTarget/resolveBuildTarget.js.map +1 -0
  643. package/build/v4/collectInputs/collectInputs.d.ts +151 -0
  644. package/build/v4/collectInputs/collectInputs.d.ts.map +1 -0
  645. package/build/v4/collectInputs/collectInputs.js +533 -0
  646. package/build/v4/collectInputs/collectInputs.js.map +1 -0
  647. package/build/v4/distribution/bundledFloor.d.ts +11 -0
  648. package/build/v4/distribution/bundledFloor.d.ts.map +1 -0
  649. package/build/v4/distribution/bundledFloor.js +114 -0
  650. package/build/v4/distribution/bundledFloor.js.map +1 -0
  651. package/build/v4/distribution/createQuestions.d.ts +6 -0
  652. package/build/v4/distribution/createQuestions.d.ts.map +1 -0
  653. package/build/v4/distribution/createQuestions.js +61 -0
  654. package/build/v4/distribution/createQuestions.js.map +1 -0
  655. package/build/v4/distribution/createSelector.d.ts +15 -0
  656. package/build/v4/distribution/createSelector.d.ts.map +1 -0
  657. package/build/v4/distribution/createSelector.js +115 -0
  658. package/build/v4/distribution/createSelector.js.map +1 -0
  659. package/build/v4/distribution/declarativePackage.d.ts +14 -0
  660. package/build/v4/distribution/declarativePackage.d.ts.map +1 -0
  661. package/build/v4/distribution/declarativePackage.js +165 -0
  662. package/build/v4/distribution/declarativePackage.js.map +1 -0
  663. package/build/v4/distribution/packageDir.d.ts +15 -0
  664. package/build/v4/distribution/packageDir.d.ts.map +1 -0
  665. package/build/v4/distribution/packageDir.js +101 -0
  666. package/build/v4/distribution/packageDir.js.map +1 -0
  667. package/build/v4/distribution/questionFragments.d.ts +11 -0
  668. package/build/v4/distribution/questionFragments.d.ts.map +1 -0
  669. package/build/v4/distribution/questionFragments.js +130 -0
  670. package/build/v4/distribution/questionFragments.js.map +1 -0
  671. package/build/v4/distribution/templateArtifacts.d.ts +61 -0
  672. package/build/v4/distribution/templateArtifacts.d.ts.map +1 -0
  673. package/build/v4/distribution/templateArtifacts.js +459 -0
  674. package/build/v4/distribution/templateArtifacts.js.map +1 -0
  675. package/build/v4/distribution/templateConfig.d.ts +43 -0
  676. package/build/v4/distribution/templateConfig.d.ts.map +1 -0
  677. package/build/v4/distribution/templateConfig.js +70 -0
  678. package/build/v4/distribution/templateConfig.js.map +1 -0
  679. package/build/v4/distribution/templatePackage.d.ts +6 -0
  680. package/build/v4/distribution/templatePackage.d.ts.map +1 -0
  681. package/build/v4/distribution/templatePackage.js +63 -0
  682. package/build/v4/distribution/templatePackage.js.map +1 -0
  683. package/build/v4/distribution/templateSource.d.ts +66 -0
  684. package/build/v4/distribution/templateSource.d.ts.map +1 -0
  685. package/build/v4/distribution/templateSource.js +233 -0
  686. package/build/v4/distribution/templateSource.js.map +1 -0
  687. package/build/v4/distribution/templateSourcePort.d.ts +27 -0
  688. package/build/v4/distribution/templateSourcePort.d.ts.map +1 -0
  689. package/build/v4/distribution/templateSourcePort.js +175 -0
  690. package/build/v4/distribution/templateSourcePort.js.map +1 -0
  691. package/build/v4/engineVersion.d.ts +7 -0
  692. package/build/v4/engineVersion.d.ts.map +1 -0
  693. package/build/v4/engineVersion.js +12 -0
  694. package/build/v4/engineVersion.js.map +1 -0
  695. package/build/v4/expression/evaluateExpression.d.ts +55 -0
  696. package/build/v4/expression/evaluateExpression.d.ts.map +1 -0
  697. package/build/v4/expression/evaluateExpression.js +338 -0
  698. package/build/v4/expression/evaluateExpression.js.map +1 -0
  699. package/build/v4/index.d.ts +41 -0
  700. package/build/v4/index.d.ts.map +1 -0
  701. package/build/v4/index.js +46 -0
  702. package/build/v4/index.js.map +1 -0
  703. package/build/v4/inspection/scaffoldCatalog.d.ts +28 -0
  704. package/build/v4/inspection/scaffoldCatalog.d.ts.map +1 -0
  705. package/build/v4/inspection/scaffoldCatalog.js +66 -0
  706. package/build/v4/inspection/scaffoldCatalog.js.map +1 -0
  707. package/build/v4/inspection/scaffoldMetadataSource.d.ts +6 -0
  708. package/build/v4/inspection/scaffoldMetadataSource.d.ts.map +1 -0
  709. package/build/v4/inspection/scaffoldMetadataSource.js +78 -0
  710. package/build/v4/inspection/scaffoldMetadataSource.js.map +1 -0
  711. package/build/v4/mcp/mcpAuthAction.d.ts +36 -0
  712. package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -0
  713. package/build/v4/mcp/mcpAuthAction.js +177 -0
  714. package/build/v4/mcp/mcpAuthAction.js.map +1 -0
  715. package/build/v4/mcp/mcpAuthScaffold.d.ts +37 -0
  716. package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -0
  717. package/build/v4/mcp/mcpAuthScaffold.js +162 -0
  718. package/build/v4/mcp/mcpAuthScaffold.js.map +1 -0
  719. package/build/v4/mcp/mcpStaticTools.d.ts +17 -0
  720. package/build/v4/mcp/mcpStaticTools.d.ts.map +1 -0
  721. package/build/v4/mcp/mcpStaticTools.js +70 -0
  722. package/build/v4/mcp/mcpStaticTools.js.map +1 -0
  723. package/build/v4/model/dataModel.d.ts +27 -0
  724. package/build/v4/model/dataModel.d.ts.map +1 -0
  725. package/build/v4/model/dataModel.js +5 -0
  726. package/build/v4/model/dataModel.js.map +1 -0
  727. package/build/v4/pipeline/runScaffoldPipeline.d.ts +101 -0
  728. package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -0
  729. package/build/v4/pipeline/runScaffoldPipeline.js +212 -0
  730. package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -0
  731. package/build/v4/providers/createOptionsProviders.d.ts +11 -0
  732. package/build/v4/providers/createOptionsProviders.d.ts.map +1 -0
  733. package/build/v4/providers/createOptionsProviders.js +268 -0
  734. package/build/v4/providers/createOptionsProviders.js.map +1 -0
  735. package/build/v4/renderContext/buildRenderContext.d.ts +24 -0
  736. package/build/v4/renderContext/buildRenderContext.d.ts.map +1 -0
  737. package/build/v4/renderContext/buildRenderContext.js +75 -0
  738. package/build/v4/renderContext/buildRenderContext.js.map +1 -0
  739. package/build/v4/runtime/generalSensitivityLabel.d.ts +5 -0
  740. package/build/v4/runtime/generalSensitivityLabel.d.ts.map +1 -0
  741. package/build/v4/runtime/generalSensitivityLabel.js +36 -0
  742. package/build/v4/runtime/generalSensitivityLabel.js.map +1 -0
  743. package/build/v4/runtime/inMemoryRuntime.d.ts +21 -0
  744. package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -0
  745. package/build/v4/runtime/inMemoryRuntime.js +43 -0
  746. package/build/v4/runtime/inMemoryRuntime.js.map +1 -0
  747. package/build/v4/runtime/packageParse.d.ts +13 -0
  748. package/build/v4/runtime/packageParse.d.ts.map +1 -0
  749. package/build/v4/runtime/packageParse.js +235 -0
  750. package/build/v4/runtime/packageParse.js.map +1 -0
  751. package/build/v4/runtime/realRuntime.d.ts +11 -0
  752. package/build/v4/runtime/realRuntime.d.ts.map +1 -0
  753. package/build/v4/runtime/realRuntime.js +64 -0
  754. package/build/v4/runtime/realRuntime.js.map +1 -0
  755. package/build/v4/runtime/renderMustache.d.ts +7 -0
  756. package/build/v4/runtime/renderMustache.d.ts.map +1 -0
  757. package/build/v4/runtime/renderMustache.js +54 -0
  758. package/build/v4/runtime/renderMustache.js.map +1 -0
  759. package/build/v4/runtime/runtimeRegistry.d.ts +28 -0
  760. package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -0
  761. package/build/v4/runtime/runtimeRegistry.js +165 -0
  762. package/build/v4/runtime/runtimeRegistry.js.map +1 -0
  763. package/build/v4/runtime/scaffold.d.ts +31 -0
  764. package/build/v4/runtime/scaffold.d.ts.map +1 -0
  765. package/build/v4/runtime/scaffold.js +34 -0
  766. package/build/v4/runtime/scaffold.js.map +1 -0
  767. package/build/v4/runtime/scaffoldFromPackageDir.d.ts +7 -0
  768. package/build/v4/runtime/scaffoldFromPackageDir.d.ts.map +1 -0
  769. package/build/v4/runtime/scaffoldFromPackageDir.js +43 -0
  770. package/build/v4/runtime/scaffoldFromPackageDir.js.map +1 -0
  771. package/build/v4/runtime/selectLanguageContent.d.ts +7 -0
  772. package/build/v4/runtime/selectLanguageContent.d.ts.map +1 -0
  773. package/build/v4/runtime/selectLanguageContent.js +39 -0
  774. package/build/v4/runtime/selectLanguageContent.js.map +1 -0
  775. package/build/v4/runtime/steps/daAction.d.ts +6 -0
  776. package/build/v4/runtime/steps/daAction.d.ts.map +1 -0
  777. package/build/v4/runtime/steps/daAction.js +41 -0
  778. package/build/v4/runtime/steps/daAction.js.map +1 -0
  779. package/build/v4/runtime/steps/daSensitivity.d.ts +14 -0
  780. package/build/v4/runtime/steps/daSensitivity.d.ts.map +1 -0
  781. package/build/v4/runtime/steps/daSensitivity.js +50 -0
  782. package/build/v4/runtime/steps/daSensitivity.js.map +1 -0
  783. package/build/v4/runtime/steps/mcpAuth.d.ts +13 -0
  784. package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -0
  785. package/build/v4/runtime/steps/mcpAuth.js +90 -0
  786. package/build/v4/runtime/steps/mcpAuth.js.map +1 -0
  787. package/build/v4/runtime/steps/mcpLocal.d.ts +6 -0
  788. package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -0
  789. package/build/v4/runtime/steps/mcpLocal.js +93 -0
  790. package/build/v4/runtime/steps/mcpLocal.js.map +1 -0
  791. package/build/v4/runtime/steps/mcpStatic.d.ts +10 -0
  792. package/build/v4/runtime/steps/mcpStatic.d.ts.map +1 -0
  793. package/build/v4/runtime/steps/mcpStatic.js +182 -0
  794. package/build/v4/runtime/steps/mcpStatic.js.map +1 -0
  795. package/build/v4/runtime/steps/metaOs.d.ts +10 -0
  796. package/build/v4/runtime/steps/metaOs.d.ts.map +1 -0
  797. package/build/v4/runtime/steps/metaOs.js +422 -0
  798. package/build/v4/runtime/steps/metaOs.js.map +1 -0
  799. package/build/v4/runtime/steps/officeAddin.d.ts +4 -0
  800. package/build/v4/runtime/steps/officeAddin.d.ts.map +1 -0
  801. package/build/v4/runtime/steps/officeAddin.js +168 -0
  802. package/build/v4/runtime/steps/officeAddin.js.map +1 -0
  803. package/build/v4/runtime/steps/openApi.d.ts +6 -0
  804. package/build/v4/runtime/steps/openApi.d.ts.map +1 -0
  805. package/build/v4/runtime/steps/openApi.js +389 -0
  806. package/build/v4/runtime/steps/openApi.js.map +1 -0
  807. package/build/v4/runtime/steps/openApiCustomApi.d.ts +5 -0
  808. package/build/v4/runtime/steps/openApiCustomApi.d.ts.map +1 -0
  809. package/build/v4/runtime/steps/openApiCustomApi.js +385 -0
  810. package/build/v4/runtime/steps/openApiCustomApi.js.map +1 -0
  811. package/build/v4/runtime/whitelist.d.ts +41 -0
  812. package/build/v4/runtime/whitelist.d.ts.map +1 -0
  813. package/build/v4/runtime/whitelist.js +211 -0
  814. package/build/v4/runtime/whitelist.js.map +1 -0
  815. package/build/v4/runtime/withTempDirectory.d.ts +10 -0
  816. package/build/v4/runtime/withTempDirectory.d.ts.map +1 -0
  817. package/build/v4/runtime/withTempDirectory.js +41 -0
  818. package/build/v4/runtime/withTempDirectory.js.map +1 -0
  819. package/build/v4/surface/createFloorTail.d.ts +12 -0
  820. package/build/v4/surface/createFloorTail.d.ts.map +1 -0
  821. package/build/v4/surface/createFloorTail.js +138 -0
  822. package/build/v4/surface/createFloorTail.js.map +1 -0
  823. package/build/v4/surface/createInputs.d.ts +51 -0
  824. package/build/v4/surface/createInputs.d.ts.map +1 -0
  825. package/build/v4/surface/createInputs.js +153 -0
  826. package/build/v4/surface/createInputs.js.map +1 -0
  827. package/build/v4/surface/createSelectorWalk.d.ts +26 -0
  828. package/build/v4/surface/createSelectorWalk.d.ts.map +1 -0
  829. package/build/v4/surface/createSelectorWalk.js +140 -0
  830. package/build/v4/surface/createSelectorWalk.js.map +1 -0
  831. package/build/v4/surface/deriveCreateOptions.d.ts +5 -0
  832. package/build/v4/surface/deriveCreateOptions.d.ts.map +1 -0
  833. package/build/v4/surface/deriveCreateOptions.js +212 -0
  834. package/build/v4/surface/deriveCreateOptions.js.map +1 -0
  835. package/build/v4/surface/localizePrompt.d.ts +11 -0
  836. package/build/v4/surface/localizePrompt.d.ts.map +1 -0
  837. package/build/v4/surface/localizePrompt.js +32 -0
  838. package/build/v4/surface/localizePrompt.js.map +1 -0
  839. package/build/v4/surface/modifySelectorWalk.d.ts +12 -0
  840. package/build/v4/surface/modifySelectorWalk.d.ts.map +1 -0
  841. package/build/v4/surface/modifySelectorWalk.js +112 -0
  842. package/build/v4/surface/modifySelectorWalk.js.map +1 -0
  843. package/build/v4/surface/uiPromptUI.d.ts +5 -0
  844. package/build/v4/surface/uiPromptUI.d.ts.map +1 -0
  845. package/build/v4/surface/uiPromptUI.js +220 -0
  846. package/build/v4/surface/uiPromptUI.js.map +1 -0
  847. package/build/v4/validation/capabilityCatalog.d.ts +8 -0
  848. package/build/v4/validation/capabilityCatalog.d.ts.map +1 -0
  849. package/build/v4/validation/capabilityCatalog.js +62 -0
  850. package/build/v4/validation/capabilityCatalog.js.map +1 -0
  851. package/build/v4/validation/templateArchiveValidation.d.ts +15 -0
  852. package/build/v4/validation/templateArchiveValidation.d.ts.map +1 -0
  853. package/build/v4/validation/templateArchiveValidation.js +297 -0
  854. package/build/v4/validation/templateArchiveValidation.js.map +1 -0
  855. package/build/v4/validation/validateTemplatePackage.d.ts +83 -0
  856. package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -0
  857. package/build/v4/validation/validateTemplatePackage.js +313 -0
  858. package/build/v4/validation/validateTemplatePackage.js.map +1 -0
  859. package/build/v4/validators/createInputValidators.d.ts +7 -0
  860. package/build/v4/validators/createInputValidators.d.ts.map +1 -0
  861. package/build/v4/validators/createInputValidators.js +77 -0
  862. package/build/v4/validators/createInputValidators.js.map +1 -0
  863. package/build/v4/validators/mcpCredentialValidators.d.ts +5 -0
  864. package/build/v4/validators/mcpCredentialValidators.d.ts.map +1 -0
  865. package/build/v4/validators/mcpCredentialValidators.js +13 -0
  866. package/build/v4/validators/mcpCredentialValidators.js.map +1 -0
  867. package/build/v4/validators/mcpServerUrlValidator.d.ts +9 -0
  868. package/build/v4/validators/mcpServerUrlValidator.d.ts.map +1 -0
  869. package/build/v4/validators/mcpServerUrlValidator.js +15 -0
  870. package/build/v4/validators/mcpServerUrlValidator.js.map +1 -0
  871. package/package.json +49 -100
  872. package/resource/package.nls.cs.json +1181 -1095
  873. package/resource/package.nls.de.json +1181 -1095
  874. package/resource/package.nls.es.json +1181 -1095
  875. package/resource/package.nls.fr.json +1181 -1095
  876. package/resource/package.nls.it.json +1181 -1095
  877. package/resource/package.nls.ja.json +1181 -1095
  878. package/resource/package.nls.json +125 -29
  879. package/resource/package.nls.ko.json +1181 -1095
  880. package/resource/package.nls.pl.json +1181 -1095
  881. package/resource/package.nls.pt-BR.json +1181 -1095
  882. package/resource/package.nls.ru.json +1181 -1095
  883. package/resource/package.nls.tr.json +1181 -1095
  884. package/resource/package.nls.zh-Hans.json +1181 -1095
  885. package/resource/package.nls.zh-Hant.json +1181 -1095
  886. package/resource/templates/package.nls.cs.json +39 -24
  887. package/resource/templates/package.nls.de.json +37 -22
  888. package/resource/templates/package.nls.es.json +35 -20
  889. package/resource/templates/package.nls.fr.json +45 -30
  890. package/resource/templates/package.nls.it.json +42 -27
  891. package/resource/templates/package.nls.ja.json +35 -20
  892. package/resource/templates/package.nls.json +27 -12
  893. package/resource/templates/package.nls.ko.json +33 -18
  894. package/resource/templates/package.nls.pl.json +38 -23
  895. package/resource/templates/package.nls.pt-BR.json +34 -19
  896. package/resource/templates/package.nls.ru.json +33 -18
  897. package/resource/templates/package.nls.tr.json +38 -23
  898. package/resource/templates/package.nls.zh-Hans.json +44 -29
  899. package/resource/templates/package.nls.zh-Hant.json +45 -30
  900. package/resource/templates/package.nls.zh-cn.json +7 -8
  901. package/resource/templates/package.nls.zh-tw.json +7 -8
  902. package/resource/yaml-schema/v1.11/yaml.schema.json +3 -0
  903. package/resource/yaml-schema/v1.12/yaml.schema.json +2132 -0
  904. package/resource/yaml-schema/v1.13/yaml.schema.json +2193 -0
  905. package/resource/yaml-schema/yaml.schema.json +128 -3
  906. package/templates/configs/playground/typescript/.vscode/tasks.json +1 -1
  907. package/templates/configs/remote/python/env/.env.dev +2 -1
  908. package/templates/configs/remote/python/m365agents.yml.tpl +1 -0
  909. package/templates/configs/remote/typescript/env/.env.dev +2 -1
  910. package/templates/configs/remote/typescript/m365agents.yml.tpl +1 -0
  911. package/templates/fallback/common.zip +0 -0
  912. package/templates/fallback/csharp.zip +0 -0
  913. package/templates/fallback/js.zip +0 -0
  914. package/templates/fallback/python.zip +0 -0
  915. package/templates/fallback/ts.zip +0 -0
  916. package/templates/metadata/allTemplates.json +32 -16
  917. package/templates/metadata/defaultGeneratorTemplates.json +8 -0
  918. package/templates/metadata.zip +0 -0
  919. package/templates/ui/ceaNode.json +30 -0
  920. package/templates/ui/tdpNode.json +13 -14
  921. package/templates/ui/teamsNode.json +124 -0
  922. package/templates/ui/wizardNode.json +56 -46
  923. package/templates/v4/create-selector.json +392 -0
  924. package/templates/v4/floor.json +3 -0
  925. package/templates/v4/modify-selector.json +78 -0
  926. package/templates/v4/templates-metadata.zip +0 -0
  927. package/templates/v4/templates.zip +0 -0
  928. package/build/core/middleware/projectMigratorV3.d.ts +0 -39
  929. package/build/core/middleware/projectMigratorV3.d.ts.map +0 -1
  930. package/build/core/middleware/projectMigratorV3.js +0 -694
  931. package/build/core/middleware/projectMigratorV3.js.map +0 -1
  932. package/build/core/middleware/projectVersionChecker.d.ts +0 -3
  933. package/build/core/middleware/projectVersionChecker.d.ts.map +0 -1
  934. package/build/core/middleware/projectVersionChecker.js +0 -60
  935. package/build/core/middleware/projectVersionChecker.js.map +0 -1
  936. package/build/core/middleware/types.d.ts +0 -9
  937. package/build/core/middleware/types.d.ts.map +0 -1
  938. package/build/core/middleware/types.js.map +0 -1
  939. package/build/core/middleware/utils/MigrationUtils.d.ts +0 -13
  940. package/build/core/middleware/utils/MigrationUtils.d.ts.map +0 -1
  941. package/build/core/middleware/utils/MigrationUtils.js +0 -212
  942. package/build/core/middleware/utils/MigrationUtils.js.map +0 -1
  943. package/build/core/middleware/utils/appYmlGenerator.d.ts +0 -34
  944. package/build/core/middleware/utils/appYmlGenerator.d.ts.map +0 -1
  945. package/build/core/middleware/utils/appYmlGenerator.js +0 -158
  946. package/build/core/middleware/utils/appYmlGenerator.js.map +0 -1
  947. package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts +0 -65
  948. package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts.map +0 -1
  949. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js +0 -61
  950. package/build/core/middleware/utils/debug/appLocalYmlGenerator.js.map +0 -1
  951. package/build/core/middleware/utils/debug/constants.d.ts +0 -20
  952. package/build/core/middleware/utils/debug/constants.d.ts.map +0 -1
  953. package/build/core/middleware/utils/debug/constants.js +0 -28
  954. package/build/core/middleware/utils/debug/constants.js.map +0 -1
  955. package/build/core/middleware/utils/debug/debugMigrationContext.d.ts +0 -14
  956. package/build/core/middleware/utils/debug/debugMigrationContext.d.ts.map +0 -1
  957. package/build/core/middleware/utils/debug/debugMigrationContext.js +0 -23
  958. package/build/core/middleware/utils/debug/debugMigrationContext.js.map +0 -1
  959. package/build/core/middleware/utils/debug/debugV3MigrationUtils.d.ts +0 -37
  960. package/build/core/middleware/utils/debug/debugV3MigrationUtils.d.ts.map +0 -1
  961. package/build/core/middleware/utils/debug/debugV3MigrationUtils.js +0 -291
  962. package/build/core/middleware/utils/debug/debugV3MigrationUtils.js.map +0 -1
  963. package/build/core/middleware/utils/debug/taskMigrator.d.ts +0 -22
  964. package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +0 -1
  965. package/build/core/middleware/utils/debug/taskMigrator.js +0 -935
  966. package/build/core/middleware/utils/debug/taskMigrator.js.map +0 -1
  967. package/build/core/middleware/utils/migrationContext.d.ts +0 -32
  968. package/build/core/middleware/utils/migrationContext.d.ts.map +0 -1
  969. package/build/core/middleware/utils/migrationContext.js +0 -104
  970. package/build/core/middleware/utils/migrationContext.js.map +0 -1
  971. package/templates/configs/local/typescript/.gitignore +0 -1
  972. package/templates/configs/playground/typescript/.gitignore +0 -4
  973. /package/build/{core/middleware → component/generator/openPlugin}/types.js +0 -0
@@ -13,6 +13,7 @@ const path = tslib_1.__importStar(require("path"));
13
13
  const semver_1 = tslib_1.__importDefault(require("semver"));
14
14
  const typedi_1 = require("typedi");
15
15
  const uuid = tslib_1.__importStar(require("uuid"));
16
+ const featureFlags_1 = require("../../../common/featureFlags");
16
17
  const globalVars_1 = require("../../../common/globalVars");
17
18
  const localizeUtils_1 = require("../../../common/localizeUtils");
18
19
  const common_1 = require("../../../error/common");
@@ -89,13 +90,9 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
89
90
  }
90
91
  for (const file of relativeFiles) {
91
92
  const filePath = path.resolve(appDirectory, file);
92
- if (!(await fs_extra_1.default.pathExists(filePath))) {
93
- const error = new common_1.FileNotFoundError(exports.actionName, filePath, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage");
94
- return (0, teamsfx_api_1.err)(error);
95
- }
96
- const fileRelativePath = path.relative(appDirectory, filePath);
97
- if (fileRelativePath.startsWith("..")) {
98
- return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(filePath));
93
+ const validationResult = await this.validateReferencedFile(filePath, appDirectory, file);
94
+ if (validationResult.isErr()) {
95
+ return (0, teamsfx_api_1.err)(validationResult.error);
99
96
  }
100
97
  }
101
98
  // pre-check existence
@@ -126,19 +123,22 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
126
123
  if (additionalLanguages && additionalLanguages.length > 0) {
127
124
  for (const language of additionalLanguages) {
128
125
  const file = language.file;
129
- const fileName = path.join(appDirectory, file);
130
- if (!(await fs_extra_1.default.pathExists(fileName))) {
131
- return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, fileName, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
126
+ const fileName = path.resolve(appDirectory, file);
127
+ const validationResult = await this.validateReferencedFile(fileName, appDirectory, file);
128
+ if (validationResult.isErr()) {
129
+ return (0, teamsfx_api_1.err)(validationResult.error);
132
130
  }
133
131
  }
134
132
  }
135
133
  if (defaultLanguageFile) {
136
- const fileName = path.join(appDirectory, defaultLanguageFile);
137
- if (!(await fs_extra_1.default.pathExists(fileName))) {
138
- return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, fileName, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
134
+ const fileName = path.resolve(appDirectory, defaultLanguageFile);
135
+ const validationResult = await this.validateReferencedFile(fileName, appDirectory, defaultLanguageFile);
136
+ if (validationResult.isErr()) {
137
+ return (0, teamsfx_api_1.err)(validationResult.error);
139
138
  }
140
139
  }
141
140
  const zip = new adm_zip_1.default();
141
+ const resolvedJsonFiles = new Map();
142
142
  zip.addFile(constants_1.Constants.MANIFEST_FILE, Buffer.from(JSON.stringify(manifest, null, 4)));
143
143
  // icon images, relative path
144
144
  for (const icon of relativeFiles) {
@@ -150,11 +150,10 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
150
150
  for (const language of additionalLanguages) {
151
151
  const file = language.file;
152
152
  const fileName = path.resolve(appDirectory, file);
153
- const relativePath = path.relative(appDirectory, fileName);
154
- if (relativePath.startsWith("..")) {
155
- return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(fileName));
156
- }
157
- const resolvedLocFileRes = await ManifestUtils_1.manifestUtils.resolveLocFile(fileName);
153
+ const realFileName = await fs_extra_1.default.realpath(fileName);
154
+ const realAppDirectory = await fs_extra_1.default.realpath(appDirectory);
155
+ const relativePath = path.relative(realAppDirectory, realFileName);
156
+ const resolvedLocFileRes = await ManifestUtils_1.manifestUtils.resolveLocFile(fileName, context);
158
157
  if (resolvedLocFileRes.isErr()) {
159
158
  return (0, teamsfx_api_1.err)(resolvedLocFileRes.error);
160
159
  }
@@ -165,11 +164,10 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
165
164
  }
166
165
  if (defaultLanguageFile) {
167
166
  const fileName = path.resolve(appDirectory, defaultLanguageFile);
168
- const relativePath = path.relative(appDirectory, fileName);
169
- if (relativePath.startsWith("..")) {
170
- return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(fileName));
171
- }
172
- const resolvedLocFileRes = await ManifestUtils_1.manifestUtils.resolveLocFile(fileName);
167
+ const realFileName = await fs_extra_1.default.realpath(fileName);
168
+ const realAppDirectory = await fs_extra_1.default.realpath(appDirectory);
169
+ const relativePath = path.relative(realAppDirectory, realFileName);
170
+ const resolvedLocFileRes = await ManifestUtils_1.manifestUtils.resolveLocFile(fileName, context);
173
171
  if (resolvedLocFileRes.isErr()) {
174
172
  return (0, teamsfx_api_1.err)(resolvedLocFileRes.error);
175
173
  }
@@ -180,7 +178,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
180
178
  // API ME, API specification and Adaptive card templates
181
179
  if (composeExtensionType == "apiBased" && apiSpecificationFile) {
182
180
  const apiSpecificationFilePath = path.resolve(appDirectory, apiSpecificationFile);
183
- const checkExistenceRes = await this.validateReferencedFile(apiSpecificationFilePath, appDirectory);
181
+ const checkExistenceRes = await this.validateReferencedFile(apiSpecificationFilePath, appDirectory, apiSpecificationFile);
184
182
  if (checkExistenceRes.isErr()) {
185
183
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
186
184
  }
@@ -192,7 +190,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
192
190
  for (const command of commands) {
193
191
  if (command.apiResponseRenderingTemplateFile) {
194
192
  const adaptiveCardFile = path.resolve(appDirectory, command.apiResponseRenderingTemplateFile);
195
- const checkExistenceRes = await this.validateReferencedFile(adaptiveCardFile, appDirectory);
193
+ const checkExistenceRes = await this.validateReferencedFile(adaptiveCardFile, appDirectory, command.apiResponseRenderingTemplateFile);
196
194
  if (checkExistenceRes.isErr()) {
197
195
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
198
196
  }
@@ -205,34 +203,41 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
205
203
  // Copilot GPT
206
204
  if (declarativeAgents?.length && declarativeAgents[0].file) {
207
205
  const declarativeAgentManifestFile = path.resolve(hasTTKGeneratedFolder ? generatedFolder : appDirectory, declarativeAgents[0].file);
208
- const checkExistenceRes = await this.validateReferencedFile(declarativeAgentManifestFile, appDirectory);
206
+ const checkExistenceRes = await this.validateReferencedFile(declarativeAgentManifestFile, appDirectory, declarativeAgents[0].file);
209
207
  if (checkExistenceRes.isErr()) {
210
208
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
211
209
  }
212
210
  const addFileWithVariableRes = await this.addFileWithVariable(zip, declarativeAgents[0].file, declarativeAgentManifestFile, envFunctionUtils_1.ManifestType.DeclarativeCopilotManifest, context, shouldwriteAllManifest
213
211
  ? path.join(jsonFileDir, path.relative(appDirectory, declarativeAgentManifestFile))
214
- : undefined);
212
+ : undefined, resolvedJsonFiles);
215
213
  if (addFileWithVariableRes.isErr()) {
216
214
  return (0, teamsfx_api_1.err)(addFileWithVariableRes.error);
217
215
  }
218
216
  const getCopilotGptRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.getManifest(declarativeAgentManifestFile, context);
219
217
  if (getCopilotGptRes.isOk()) {
218
+ const manifest = getCopilotGptRes.value;
219
+ if (manifest.actions !== undefined && !Array.isArray(manifest.actions)) {
220
+ return (0, teamsfx_api_1.err)(new common_1.InvalidActionInputError(exports.actionName, [`actions (in ${path.basename(declarativeAgentManifestFile)}) must be an array`], "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
221
+ }
222
+ if (manifest.capabilities !== undefined && !Array.isArray(manifest.capabilities)) {
223
+ return (0, teamsfx_api_1.err)(new common_1.InvalidActionInputError(exports.actionName, [`capabilities (in ${path.basename(declarativeAgentManifestFile)}) must be an array`], "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
224
+ }
220
225
  // Add action files
221
- if (getCopilotGptRes.value.actions) {
222
- const pluginFiles = getCopilotGptRes.value.actions.map((action) => action.file);
226
+ if (Array.isArray(manifest.actions)) {
227
+ const pluginFiles = manifest.actions.map((action) => action.file);
223
228
  for (const pluginFile of pluginFiles) {
224
229
  const pluginFileAbsolutePath = path.resolve(path.dirname(declarativeAgentManifestFile), pluginFile);
225
230
  const pluginFileRelativePath = path.relative(hasTTKGeneratedFolder ? generatedFolder : appDirectory, pluginFileAbsolutePath);
226
231
  const useForwardSlash = declarativeAgents[0].file.concat(pluginFile).includes("/");
227
- const addPluginRes = await this.addPlugin(zip, (0, utils_2.normalizePath)(pluginFileRelativePath, useForwardSlash), hasTTKGeneratedFolder ? generatedFolder : appDirectory, context, !shouldwriteAllManifest ? undefined : jsonFileDir, hasTTKGeneratedFolder ? appDirectory : undefined);
232
+ const addPluginRes = await this.addPlugin(zip, (0, utils_2.normalizePath)(pluginFileRelativePath, useForwardSlash), hasTTKGeneratedFolder ? generatedFolder : appDirectory, context, !shouldwriteAllManifest ? undefined : jsonFileDir, hasTTKGeneratedFolder ? appDirectory : undefined, resolvedJsonFiles, pluginFile);
228
233
  if (addPluginRes.isErr()) {
229
234
  return (0, teamsfx_api_1.err)(addPluginRes.error);
230
235
  }
231
236
  }
232
237
  }
233
238
  // Add embedded knowledge files
234
- if (getCopilotGptRes.value.capabilities) {
235
- const embeddedKnowledgeCapabilities = getCopilotGptRes.value.capabilities.filter((capability) => capability.name === teamsfx_api_1.DeclarativeCopilotCapabilityName.EmbeddedKnowledge);
239
+ if (Array.isArray(manifest.capabilities)) {
240
+ const embeddedKnowledgeCapabilities = manifest.capabilities.filter((capability) => capability.name === teamsfx_api_1.DeclarativeCopilotCapabilityName.EmbeddedKnowledge);
236
241
  if (embeddedKnowledgeCapabilities.length > 0) {
237
242
  const fileSet = new Set();
238
243
  for (const capability of embeddedKnowledgeCapabilities) {
@@ -250,7 +255,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
250
255
  for (const file of fileArr) {
251
256
  const knowledgeFileAbsolutePath = path.resolve(appDirectory, file);
252
257
  // check existence
253
- const checkExistenceRes = await this.validateReferencedFile(knowledgeFileAbsolutePath, appDirectory);
258
+ const checkExistenceRes = await this.validateReferencedFile(knowledgeFileAbsolutePath, appDirectory, file);
254
259
  if (checkExistenceRes.isErr()) {
255
260
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
256
261
  }
@@ -260,13 +265,96 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
260
265
  }
261
266
  }
262
267
  }
268
+ // Add agent skill directories (support both agent_skills and x-agent_skills)
269
+ if (featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.AgentSkillsManifest)) {
270
+ const agentSkills = getCopilotGptRes.value.agent_skills ||
271
+ getCopilotGptRes.value["x-agent_skills"];
272
+ if (agentSkills && Array.isArray(agentSkills)) {
273
+ for (const skill of agentSkills) {
274
+ if (skill.folder) {
275
+ // Resolve skill folder relative to appDirectory (not .generated/)
276
+ // since skill folders don't support env var substitution
277
+ const skillFolderAbsolutePath = path.resolve(appDirectory, skill.folder);
278
+ const checkExistenceRes = await this.validateReferencedFile(skillFolderAbsolutePath, appDirectory, skill.folder);
279
+ if (checkExistenceRes.isErr()) {
280
+ return (0, teamsfx_api_1.err)(checkExistenceRes.error);
281
+ }
282
+ const skillMdPath = path.join(skillFolderAbsolutePath, "SKILL.md");
283
+ if (!(await fs_extra_1.default.pathExists(skillMdPath))) {
284
+ return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, path.basename(skillMdPath), "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
285
+ }
286
+ await this.addLocalFolderRecursive(zip, skillFolderAbsolutePath, appDirectory);
287
+ }
288
+ }
289
+ }
290
+ }
263
291
  }
264
292
  else {
265
293
  return (0, teamsfx_api_1.err)(getCopilotGptRes.error);
266
294
  }
267
295
  }
268
- zip.writeZip(zipFileName);
269
- await this.writeJsonFile(teamsManifestJsonFileName, JSON.stringify(manifest, null, 4));
296
+ const teamsManifestAgentSkills = manifest
297
+ .agentSkills;
298
+ if (teamsManifestAgentSkills?.length) {
299
+ const addSkillsRes = await this.addAgentSkillFolders(zip, teamsManifestAgentSkills, appDirectory);
300
+ if (addSkillsRes.isErr()) {
301
+ return (0, teamsfx_api_1.err)(addSkillsRes.error);
302
+ }
303
+ }
304
+ const teamsManifestAgentConnectors = manifest.agentConnectors;
305
+ if (teamsManifestAgentConnectors?.length) {
306
+ const addConnectorsRes = await this.addAgentConnectorFiles(zip, teamsManifestAgentConnectors, appDirectory);
307
+ if (addConnectorsRes.isErr()) {
308
+ return (0, teamsfx_api_1.err)(addConnectorsRes.error);
309
+ }
310
+ }
311
+ if (resolvedJsonFiles.has(teamsManifestJsonFileName)) {
312
+ return (0, teamsfx_api_1.err)(new common_1.InvalidActionInputError(exports.actionName, ["outputFolder"], "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
313
+ }
314
+ resolvedJsonFiles.set(teamsManifestJsonFileName, JSON.stringify(manifest, null, 4));
315
+ const outputFileNames = [zipFileName, ...resolvedJsonFiles.keys()];
316
+ const canonicalOutputPaths = [];
317
+ let hasInvalidOutputPath = false;
318
+ for (const outputFileName of outputFileNames) {
319
+ let canonicalOutputPath;
320
+ try {
321
+ if (await this.isDirectory(outputFileName)) {
322
+ hasInvalidOutputPath = true;
323
+ break;
324
+ }
325
+ canonicalOutputPath = await this.getCanonicalDestinationPath(outputFileName);
326
+ }
327
+ catch (error) {
328
+ return (0, teamsfx_api_1.err)(new teamsApp_1.AppPackageFileSystemError(error, outputFileName));
329
+ }
330
+ if (canonicalOutputPaths.some((outputPath) => this.isPathContained(outputPath, canonicalOutputPath) ||
331
+ this.isPathContained(canonicalOutputPath, outputPath))) {
332
+ hasInvalidOutputPath = true;
333
+ break;
334
+ }
335
+ canonicalOutputPaths.push(canonicalOutputPath);
336
+ }
337
+ if (hasInvalidOutputPath) {
338
+ return (0, teamsfx_api_1.err)(new common_1.InvalidActionInputError(exports.actionName, ["outputZipPath", args.outputJsonPath ? "outputJsonPath" : "outputFolder"], "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
339
+ }
340
+ const stagedZipFileName = this.getStagedOutputPath(zipFileName);
341
+ const maxPackageSize = 10 * 1024 * 1024;
342
+ try {
343
+ zip.writeZip(stagedZipFileName);
344
+ const zipStats = await fs_extra_1.default.stat(stagedZipFileName);
345
+ if (zipStats.size > maxPackageSize) {
346
+ return (0, teamsfx_api_1.err)(new teamsApp_1.AppPackageSizeExceededError(zipStats.size, maxPackageSize));
347
+ }
348
+ await this.publishOutputs(stagedZipFileName, zipFileName, resolvedJsonFiles);
349
+ }
350
+ catch (error) {
351
+ return (0, teamsfx_api_1.err)(error instanceof teamsApp_1.AppPackageFileSystemError
352
+ ? error
353
+ : new teamsApp_1.AppPackageFileSystemError(error, zipFileName));
354
+ }
355
+ finally {
356
+ await fs_extra_1.default.remove(stagedZipFileName).catch(() => { });
357
+ }
270
358
  const builtSuccess = [
271
359
  { content: "(√)Done: ", color: teamsfx_api_1.Colors.BRIGHT_GREEN },
272
360
  { content: "App Package ", color: teamsfx_api_1.Colors.BRIGHT_WHITE },
@@ -298,16 +386,89 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
298
386
  return (0, teamsfx_api_1.ok)(undefined);
299
387
  }
300
388
  }
301
- async validateReferencedFile(file, directory) {
389
+ async validateReferencedFile(file, directory, originalReference) {
390
+ const displayDirectory = path.resolve(directory);
391
+ const resolvedFile = path.resolve(file);
392
+ const fileReference = originalReference ?? path.relative(displayDirectory, resolvedFile);
393
+ if (!this.isPathContained(directory, file)) {
394
+ return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(fileReference, resolvedFile, displayDirectory));
395
+ }
302
396
  if (!(await fs_extra_1.default.pathExists(file))) {
303
- return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, file, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
397
+ return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, path.basename(file), "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
398
+ }
399
+ let realFile;
400
+ let realDirectory;
401
+ try {
402
+ realFile = await fs_extra_1.default.realpath(file);
403
+ realDirectory = await fs_extra_1.default.realpath(directory);
404
+ }
405
+ catch (error) {
406
+ return (0, teamsfx_api_1.err)(new teamsApp_1.AppPackageFileSystemError(error, file));
407
+ }
408
+ if (!this.isPathContained(realDirectory, realFile)) {
409
+ return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(fileReference, realFile, displayDirectory));
304
410
  }
411
+ return (0, teamsfx_api_1.ok)(undefined);
412
+ }
413
+ isPathContained(directory, file) {
305
414
  const relativePath = path.relative(directory, file);
306
- if (relativePath.startsWith("..")) {
307
- return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(file));
415
+ return (relativePath === "" ||
416
+ (relativePath !== ".." &&
417
+ !relativePath.startsWith(`..${path.sep}`) &&
418
+ !path.isAbsolute(relativePath)));
419
+ }
420
+ async addAgentSkillFolders(zip, agentSkills, appDirectory) {
421
+ for (const skill of agentSkills) {
422
+ const skillFolderAbs = path.resolve(appDirectory, skill.folder);
423
+ const validationResult = await this.validateReferencedFile(skillFolderAbs, appDirectory, skill.folder);
424
+ if (validationResult.isErr()) {
425
+ return (0, teamsfx_api_1.err)(validationResult.error);
426
+ }
427
+ const skillMdPath = path.join(skillFolderAbs, "SKILL.md");
428
+ if (!(await fs_extra_1.default.pathExists(skillMdPath))) {
429
+ return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, path.basename(skillMdPath), "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
430
+ }
431
+ await this.addLocalFolderRecursive(zip, skillFolderAbs, appDirectory);
308
432
  }
309
433
  return (0, teamsfx_api_1.ok)(undefined);
310
434
  }
435
+ async addAgentConnectorFiles(zip, agentConnectors, appDirectory) {
436
+ for (const connector of agentConnectors) {
437
+ const mcpToolDescriptionFile = connector.toolSource?.remoteMcpServer?.mcpToolDescription?.file;
438
+ if (!mcpToolDescriptionFile) {
439
+ continue;
440
+ }
441
+ const mcpFileAbsolutePath = path.resolve(appDirectory, mcpToolDescriptionFile);
442
+ const checkExistenceRes = await this.validateReferencedFile(mcpFileAbsolutePath, appDirectory, mcpToolDescriptionFile);
443
+ if (checkExistenceRes.isErr()) {
444
+ return (0, teamsfx_api_1.err)(checkExistenceRes.error);
445
+ }
446
+ const dir = path.dirname(mcpToolDescriptionFile);
447
+ this.addFileInZip(zip, dir, mcpFileAbsolutePath);
448
+ }
449
+ return (0, teamsfx_api_1.ok)(undefined);
450
+ }
451
+ async addLocalFolderRecursive(zip, folderAbs, appDirectory) {
452
+ const entries = await fs_extra_1.default.readdir(folderAbs, { withFileTypes: true });
453
+ const realAppDirectory = await fs_extra_1.default.realpath(appDirectory);
454
+ for (const entry of entries) {
455
+ const entryAbs = path.join(folderAbs, entry.name);
456
+ if (entry.isSymbolicLink()) {
457
+ continue;
458
+ }
459
+ if (entry.isDirectory()) {
460
+ await this.addLocalFolderRecursive(zip, entryAbs, appDirectory);
461
+ }
462
+ else if (entry.isFile()) {
463
+ const realEntryAbs = await fs_extra_1.default.realpath(entryAbs);
464
+ if (!this.isPathContained(realAppDirectory, realEntryAbs)) {
465
+ continue;
466
+ }
467
+ const relDir = path.dirname(path.relative(appDirectory, entryAbs));
468
+ zip.addLocalFile(entryAbs, (0, utils_2.normalizePath)(relDir, true));
469
+ }
470
+ }
471
+ }
311
472
  /**
312
473
  * Add plugin file and plugin related files to zip.
313
474
  * @param zip zip
@@ -317,9 +478,9 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
317
478
  * @param outputDirectory optional. Folder where we should put the resolved manifest in.
318
479
  * @returns result of adding plugin file and plugin related files
319
480
  */
320
- async addPlugin(zip, pluginRelativePath, appDirectory, context, outputDirectory, defaultAppDirectry) {
481
+ async addPlugin(zip, pluginRelativePath, appDirectory, context, outputDirectory, defaultAppDirectry, resolvedJsonFiles, originalReference) {
321
482
  const pluginFile = path.resolve(appDirectory, pluginRelativePath);
322
- const checkExistenceRes = await this.validateReferencedFile(pluginFile, appDirectory);
483
+ const checkExistenceRes = await this.validateReferencedFile(pluginFile, appDirectory, originalReference ?? pluginRelativePath);
323
484
  if (checkExistenceRes.isErr()) {
324
485
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
325
486
  }
@@ -334,12 +495,16 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
334
495
  if (pluginFileContent.functions) {
335
496
  for (const func of pluginFileContent.functions) {
336
497
  if (func.capabilities?.response_semantics?.static_template?.file) {
337
- const staticTemplateFile = await this.getAdaptiveCardTemplateFile(context, pluginFile, func, appDirectory, defaultAppDirectry);
498
+ const staticTemplateFileResult = await this.getAdaptiveCardTemplateFile(context, pluginFile, func, appDirectory, defaultAppDirectry);
499
+ if (staticTemplateFileResult.isErr()) {
500
+ return (0, teamsfx_api_1.err)(staticTemplateFileResult.error);
501
+ }
502
+ const staticTemplateFile = staticTemplateFileResult.value;
338
503
  if (!staticTemplateFile) {
339
504
  continue;
340
505
  }
341
506
  if (Object.keys(func.capabilities.response_semantics.static_template).length > 1) {
342
- context.logProvider.warning((0, localizeUtils_1.getLocalizedString)("plugins.appstudio.createPackage.aiPlugin.overrideWarning", pluginFile, func.name));
507
+ context.logProvider.warning((0, localizeUtils_1.getLocalizedString)("plugins.appstudio.createPackage.aiPlugin.overrideWarning", path.basename(pluginFile), func.name));
343
508
  }
344
509
  const staticTemplateFileContent = await fs_extra_1.default.readJSON(staticTemplateFile);
345
510
  func.capabilities.response_semantics.static_template = staticTemplateFileContent;
@@ -358,22 +523,30 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
358
523
  if (containExternalAdaptiveCard) {
359
524
  await (0, utils_1.updateVersionForTeamsAppYamlFile)(context.projectPath);
360
525
  }
361
- if (namespaceContainsUnderscore || containExternalAdaptiveCard) {
362
- tempFolder = path.join(appDirectory, ".tmp");
363
- await fs_extra_1.default.ensureDir(tempFolder);
364
- tmpPluginFile = path.join(tempFolder, `tmp-ai-plugin-${uuid.v4().slice(0, 6)}.json`);
365
- const processedFunctionRes = await (0, envFunctionUtils_1.expandVariableWithFunction)(JSON.stringify(pluginFileContent), context, undefined, true, envFunctionUtils_1.ManifestType.PluginManifest, pluginFile);
366
- if (processedFunctionRes.isErr()) {
367
- return (0, teamsfx_api_1.err)(processedFunctionRes.error);
526
+ let addFileWithVariableRes;
527
+ try {
528
+ if (namespaceContainsUnderscore || containExternalAdaptiveCard) {
529
+ const processedFunctionRes = await (0, envFunctionUtils_1.expandVariableWithFunction)(JSON.stringify(pluginFileContent), context, undefined, true, envFunctionUtils_1.ManifestType.PluginManifest, pluginFile);
530
+ if (processedFunctionRes.isErr()) {
531
+ return (0, teamsfx_api_1.err)(processedFunctionRes.error);
532
+ }
533
+ pluginFileContent = JSON.parse(processedFunctionRes.value);
534
+ tempFolder = await fs_extra_1.default.mkdtemp(path.join(appDirectory, ".tmp-"));
535
+ const tempFolderValidation = await this.validateReferencedFile(tempFolder, appDirectory);
536
+ if (tempFolderValidation.isErr()) {
537
+ return (0, teamsfx_api_1.err)(tempFolderValidation.error);
538
+ }
539
+ tmpPluginFile = path.join(tempFolder, `tmp-ai-plugin-${uuid.v4().slice(0, 6)}.json`);
540
+ await fs_extra_1.default.writeJSON(tmpPluginFile, pluginFileContent, { spaces: 4 });
368
541
  }
369
- pluginFileContent = JSON.parse(processedFunctionRes.value);
370
- await fs_extra_1.default.writeJSON(tmpPluginFile, pluginFileContent, { spaces: 4 });
542
+ addFileWithVariableRes = await this.addFileWithVariable(zip, pluginRelativePath, tmpPluginFile, envFunctionUtils_1.ManifestType.PluginManifest, context, !outputDirectory
543
+ ? undefined
544
+ : path.join(outputDirectory, path.relative(appDirectory, pluginFile)), resolvedJsonFiles);
371
545
  }
372
- const addFileWithVariableRes = await this.addFileWithVariable(zip, pluginRelativePath, tmpPluginFile, envFunctionUtils_1.ManifestType.PluginManifest, context, !outputDirectory
373
- ? undefined
374
- : path.join(outputDirectory, path.relative(appDirectory, pluginFile)));
375
- if (containExternalAdaptiveCard && tmpPluginFile !== pluginFile && tempFolder) {
376
- await fs_extra_1.default.remove(tempFolder);
546
+ finally {
547
+ if (tempFolder) {
548
+ await fs_extra_1.default.remove(tempFolder);
549
+ }
377
550
  }
378
551
  if (addFileWithVariableRes.isErr()) {
379
552
  return (0, teamsfx_api_1.err)(addFileWithVariableRes.error);
@@ -403,7 +576,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
403
576
  if (runtime.type === "OpenApi" && runtime.spec?.url) {
404
577
  const specFile = path.resolve(path.dirname(pluginFilePath), runtime.spec.url);
405
578
  // add openapi spec
406
- const checkExistenceRes = await this.validateReferencedFile(specFile, appDirectory);
579
+ const checkExistenceRes = await this.validateReferencedFile(specFile, appDirectory, runtime.spec.url);
407
580
  if (checkExistenceRes.isErr()) {
408
581
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
409
582
  }
@@ -418,7 +591,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
418
591
  runtime.spec?.mcp_tool_description?.file) {
419
592
  const mcpFile = path.resolve(path.dirname(pluginFilePath), runtime.spec.mcp_tool_description.file);
420
593
  // add mcp tool description file
421
- const checkExistenceRes = await this.validateReferencedFile(mcpFile, appDirectory);
594
+ const checkExistenceRes = await this.validateReferencedFile(mcpFile, appDirectory, runtime.spec.mcp_tool_description.file);
422
595
  if (checkExistenceRes.isErr()) {
423
596
  return (0, teamsfx_api_1.err)(checkExistenceRes.error);
424
597
  }
@@ -429,8 +602,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
429
602
  }
430
603
  return (0, teamsfx_api_1.ok)(undefined);
431
604
  }
432
- async addFileWithVariable(zip, entryName, filePath, manifestType, context, outputPath // If outputPath exists, we will write down the file after replacing placeholders.
433
- ) {
605
+ async addFileWithVariable(zip, entryName, filePath, manifestType, context, outputPath, resolvedJsonFiles) {
434
606
  const expandedEnvVarResult = await CreateAppPackageDriver_1.expandEnvVars(filePath, context, manifestType);
435
607
  if (expandedEnvVarResult.isErr()) {
436
608
  return (0, teamsfx_api_1.err)(expandedEnvVarResult.error);
@@ -439,7 +611,11 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
439
611
  const attr = await fs_extra_1.default.stat(filePath);
440
612
  zip.addFile(entryName, Buffer.from(content), "", attr.mode);
441
613
  if (outputPath && path.extname(outputPath).toLowerCase() === ".json") {
442
- await this.writeJsonFile(`${outputPath.substring(0, outputPath.length - 5)}.${process.env.TEAMSFX_ENV}.json`, content);
614
+ const resolvedOutputPath = `${outputPath.substring(0, outputPath.length - 5)}.${process.env.TEAMSFX_ENV}.json`;
615
+ if (resolvedJsonFiles?.has(resolvedOutputPath)) {
616
+ return (0, teamsfx_api_1.err)(new common_1.InvalidActionInputError(exports.actionName, ["outputFolder"], "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
617
+ }
618
+ resolvedJsonFiles?.set(resolvedOutputPath, content);
443
619
  }
444
620
  return (0, teamsfx_api_1.ok)(undefined);
445
621
  }
@@ -451,26 +627,163 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
451
627
  await fs_extra_1.default.chmod(jsonFileName, 0o777);
452
628
  }
453
629
  await fs_extra_1.default.ensureDir(path.dirname(jsonFileName));
454
- await fs_extra_1.default.writeFile(jsonFileName, content);
630
+ await fs_extra_1.default.outputFile(jsonFileName, content);
455
631
  await fs_extra_1.default.chmod(jsonFileName, 0o444);
456
632
  }
633
+ getStagedOutputPath(outputPath) {
634
+ return path.join(path.dirname(outputPath), `.${path.basename(outputPath)}.${uuid.v4()}.tmp`);
635
+ }
636
+ async isDirectory(filePath) {
637
+ try {
638
+ return (await fs_extra_1.default.stat(filePath)).isDirectory();
639
+ }
640
+ catch (error) {
641
+ if (this.isFileNotFoundError(error)) {
642
+ return false;
643
+ }
644
+ throw error;
645
+ }
646
+ }
647
+ async getCanonicalDestinationPath(outputPath) {
648
+ try {
649
+ return await fs_extra_1.default.realpath(outputPath);
650
+ }
651
+ catch (error) {
652
+ if (!this.isFileNotFoundError(error)) {
653
+ throw error;
654
+ }
655
+ }
656
+ const missingDirectories = [];
657
+ let ancestor = path.dirname(outputPath);
658
+ while (true) {
659
+ try {
660
+ const realAncestor = await fs_extra_1.default.realpath(ancestor);
661
+ return path.join(realAncestor, ...missingDirectories, path.basename(outputPath));
662
+ }
663
+ catch (error) {
664
+ if (!this.isFileNotFoundError(error)) {
665
+ throw error;
666
+ }
667
+ const parent = path.dirname(ancestor);
668
+ if (parent === ancestor) {
669
+ throw error;
670
+ }
671
+ missingDirectories.unshift(path.basename(ancestor));
672
+ ancestor = parent;
673
+ }
674
+ }
675
+ }
676
+ async publishOutputs(stagedZipFile, outputZipFile, jsonFiles) {
677
+ const stagedJsonFiles = new Map();
678
+ const backupFiles = new Map();
679
+ const publishedFiles = [];
680
+ let publicationError;
681
+ try {
682
+ for (const [jsonFile, content] of jsonFiles) {
683
+ const stagedJsonFile = this.getStagedOutputPath(jsonFile);
684
+ stagedJsonFiles.set(jsonFile, stagedJsonFile);
685
+ await this.writeJsonFile(stagedJsonFile, content);
686
+ }
687
+ for (const [jsonFile, stagedJsonFile] of stagedJsonFiles) {
688
+ await this.backUpOutputFile(jsonFile, backupFiles);
689
+ await fs_extra_1.default.rename(stagedJsonFile, jsonFile);
690
+ publishedFiles.push(jsonFile);
691
+ }
692
+ await this.backUpOutputFile(outputZipFile, backupFiles);
693
+ await fs_extra_1.default.rename(stagedZipFile, outputZipFile);
694
+ publishedFiles.push(outputZipFile);
695
+ }
696
+ catch (error) {
697
+ let rollbackError;
698
+ for (const publishedFile of publishedFiles.reverse()) {
699
+ try {
700
+ await fs_extra_1.default.chmod(publishedFile, 0o777);
701
+ }
702
+ catch (cleanupError) {
703
+ if (!this.isFileNotFoundError(cleanupError)) {
704
+ rollbackError ??= cleanupError;
705
+ }
706
+ }
707
+ try {
708
+ await fs_extra_1.default.remove(publishedFile);
709
+ }
710
+ catch (cleanupError) {
711
+ rollbackError ??= cleanupError;
712
+ }
713
+ }
714
+ for (const [outputFile, backupFile] of Array.from(backupFiles.entries()).reverse()) {
715
+ try {
716
+ await fs_extra_1.default.rename(backupFile, outputFile);
717
+ }
718
+ catch (restoreError) {
719
+ rollbackError ??= restoreError;
720
+ }
721
+ }
722
+ if (rollbackError) {
723
+ publicationError = rollbackError;
724
+ }
725
+ else {
726
+ publicationError = error;
727
+ }
728
+ }
729
+ let stagedCleanupError;
730
+ for (const stagedJsonFile of stagedJsonFiles.values()) {
731
+ try {
732
+ await fs_extra_1.default.remove(stagedJsonFile);
733
+ }
734
+ catch (error) {
735
+ stagedCleanupError ??= error;
736
+ }
737
+ }
738
+ if (publicationError) {
739
+ throw new teamsApp_1.AppPackageFileSystemError(publicationError, outputZipFile);
740
+ }
741
+ if (stagedCleanupError) {
742
+ throw new teamsApp_1.AppPackageFileSystemError(stagedCleanupError, outputZipFile);
743
+ }
744
+ for (const backupFile of backupFiles.values()) {
745
+ await fs_extra_1.default.chmod(backupFile, 0o600).catch(() => { });
746
+ await fs_extra_1.default.remove(backupFile).catch(() => { });
747
+ }
748
+ }
749
+ async backUpOutputFile(outputFile, backupFiles) {
750
+ const backupFile = this.getStagedOutputPath(outputFile);
751
+ try {
752
+ await fs_extra_1.default.rename(outputFile, backupFile);
753
+ backupFiles.set(outputFile, backupFile);
754
+ }
755
+ catch (error) {
756
+ if (!this.isFileNotFoundError(error)) {
757
+ throw error;
758
+ }
759
+ }
760
+ }
761
+ isFileNotFoundError(error) {
762
+ return error instanceof Error && "code" in error && error.code === "ENOENT";
763
+ }
457
764
  async getAdaptiveCardTemplateFile(context, pluginFile, func, appDirectory, defaultAppDirectry) {
458
765
  let staticTemplateFile = path.resolve(defaultAppDirectry ?? path.dirname(pluginFile), func.capabilities.response_semantics.static_template.file);
459
- let checkExistenceRes = await this.validateReferencedFile(staticTemplateFile, defaultAppDirectry ?? appDirectory);
766
+ let checkExistenceRes = await this.validateReferencedFile(staticTemplateFile, defaultAppDirectry ?? appDirectory, func.capabilities.response_semantics.static_template.file);
460
767
  if (checkExistenceRes.isOk()) {
461
- return staticTemplateFile;
768
+ return (0, teamsfx_api_1.ok)(staticTemplateFile);
769
+ }
770
+ if (checkExistenceRes.error instanceof teamsApp_1.InvalidFileOutsideOfTheDirectotryError) {
771
+ return (0, teamsfx_api_1.err)(checkExistenceRes.error);
462
772
  }
463
773
  if (defaultAppDirectry) {
464
774
  // Try generated folder
465
775
  staticTemplateFile = path.resolve(appDirectory, func.capabilities.response_semantics.static_template.file);
466
- checkExistenceRes = await this.validateReferencedFile(staticTemplateFile, appDirectory);
776
+ checkExistenceRes = await this.validateReferencedFile(staticTemplateFile, appDirectory, func.capabilities.response_semantics.static_template.file);
467
777
  }
468
778
  if (checkExistenceRes.isErr()) {
469
- delete func.capabilities.response_semantics.static_template.file;
470
- context.logProvider.warning((0, localizeUtils_1.getLocalizedString)("plugins.appstudio.createPackage.aiPlugin.invalidFilePropertyWarning", pluginFile, func.name));
471
- return undefined;
779
+ if (checkExistenceRes.error instanceof teamsApp_1.InvalidFileOutsideOfTheDirectotryError) {
780
+ return (0, teamsfx_api_1.err)(checkExistenceRes.error);
781
+ }
782
+ delete func.capabilities.response_semantics.static_template;
783
+ context.logProvider.warning((0, localizeUtils_1.getLocalizedString)("plugins.appstudio.createPackage.aiPlugin.invalidFilePropertyWarning", path.basename(pluginFile), func.name));
784
+ return (0, teamsfx_api_1.ok)(undefined);
472
785
  }
473
- return staticTemplateFile;
786
+ return (0, teamsfx_api_1.ok)(staticTemplateFile);
474
787
  }
475
788
  };
476
789
  exports.CreateAppPackageDriver = CreateAppPackageDriver;