@microsoft/teamsfx-core 3.0.15 → 3.0.16-alpha.3fe313aeb8.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 (398) hide show
  1. package/build/client/aadAppClient.d.ts.map +1 -1
  2. package/build/client/aadAppClient.js +6 -6
  3. package/build/client/aadAppClient.js.map +1 -1
  4. package/build/common/featureFlags.d.ts +0 -5
  5. package/build/common/featureFlags.d.ts.map +1 -1
  6. package/build/common/featureFlags.js +0 -5
  7. package/build/common/featureFlags.js.map +1 -1
  8. package/build/common/globalVars.d.ts.map +1 -1
  9. package/build/common/globalVars.js.map +1 -1
  10. package/build/common/httpProxy.d.ts +21 -0
  11. package/build/common/httpProxy.d.ts.map +1 -0
  12. package/build/common/httpProxy.js +117 -0
  13. package/build/common/httpProxy.js.map +1 -0
  14. package/build/common/mcpToolFetcher.d.ts +90 -0
  15. package/build/common/mcpToolFetcher.d.ts.map +1 -0
  16. package/build/common/mcpToolFetcher.js +404 -0
  17. package/build/common/mcpToolFetcher.js.map +1 -0
  18. package/build/common/odrProvider.d.ts +43 -0
  19. package/build/common/odrProvider.d.ts.map +1 -0
  20. package/build/common/odrProvider.js +154 -0
  21. package/build/common/odrProvider.js.map +1 -0
  22. package/build/common/openApiParserOptions.d.ts +3 -0
  23. package/build/common/openApiParserOptions.d.ts.map +1 -0
  24. package/build/common/openApiParserOptions.js +61 -0
  25. package/build/common/openApiParserOptions.js.map +1 -0
  26. package/build/common/secretmasker/dict.d.ts.map +1 -1
  27. package/build/common/secretmasker/dict.js +5 -2
  28. package/build/common/secretmasker/dict.js.map +1 -1
  29. package/build/common/secretmasker/feature.js.map +1 -1
  30. package/build/common/templates-config.json +4 -4
  31. package/build/component/configManager/lifecycle.d.ts.map +1 -1
  32. package/build/component/configManager/lifecycle.js +7 -5
  33. package/build/component/configManager/lifecycle.js.map +1 -1
  34. package/build/component/coordinator/index.d.ts.map +1 -1
  35. package/build/component/coordinator/index.js.map +1 -1
  36. package/build/component/deps-checker/internal/dotnetChecker.js.map +1 -1
  37. package/build/component/driver/botAadApp/create.js +1 -1
  38. package/build/component/driver/botAadApp/create.js.map +1 -1
  39. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts +3 -0
  40. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
  41. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +39 -4
  42. package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
  43. package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +2 -2
  44. package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
  45. package/build/component/driver/interface/buildAndDeployArgs.d.ts +1 -1
  46. package/build/component/driver/interface/buildAndDeployArgs.d.ts.map +1 -1
  47. package/build/component/driver/interface/commonArgs.d.ts +1 -1
  48. package/build/component/driver/interface/commonArgs.d.ts.map +1 -1
  49. package/build/component/driver/script/baseBuildDriver.d.ts +1 -2
  50. package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
  51. package/build/component/driver/script/baseBuildDriver.js +0 -2
  52. package/build/component/driver/script/baseBuildDriver.js.map +1 -1
  53. package/build/component/driver/script/scriptDriver.js +1 -1
  54. package/build/component/driver/script/scriptDriver.js.map +1 -1
  55. package/build/component/driver/teamsApp/create.d.ts.map +1 -1
  56. package/build/component/driver/teamsApp/create.js +3 -3
  57. package/build/component/driver/teamsApp/create.js.map +1 -1
  58. package/build/component/driver/teamsApp/createAppPackage.d.ts +1 -0
  59. package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
  60. package/build/component/driver/teamsApp/createAppPackage.js +23 -0
  61. package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
  62. package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
  63. package/build/component/driver/util/utils.js.map +1 -1
  64. package/build/component/feature/sso.js +2 -2
  65. package/build/component/feature/sso.js.map +1 -1
  66. package/build/component/generator/configFiles/configGenerator.js +1 -1
  67. package/build/component/generator/configFiles/configGenerator.js.map +1 -1
  68. package/build/component/generator/declarativeAgent/helper.d.ts.map +1 -1
  69. package/build/component/generator/declarativeAgent/helper.js +25 -2
  70. package/build/component/generator/declarativeAgent/helper.js.map +1 -1
  71. package/build/component/generator/generatorAction.d.ts +3 -1
  72. package/build/component/generator/generatorAction.d.ts.map +1 -1
  73. package/build/component/generator/generatorAction.js.map +1 -1
  74. package/build/component/generator/officeAddin/generator.d.ts +1 -0
  75. package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
  76. package/build/component/generator/officeAddin/generator.js +109 -2
  77. package/build/component/generator/officeAddin/generator.js.map +1 -1
  78. package/build/component/generator/openApiSpec/common.js +1 -1
  79. package/build/component/generator/openApiSpec/common.js.map +1 -1
  80. package/build/component/generator/openApiSpec/helper.d.ts +2 -3
  81. package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
  82. package/build/component/generator/openApiSpec/helper.js +22 -60
  83. package/build/component/generator/openApiSpec/helper.js.map +1 -1
  84. package/build/component/generator/spfx/spfxGenerator.js +5 -5
  85. package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
  86. package/build/component/generator/templateHelper.d.ts +10 -2
  87. package/build/component/generator/templateHelper.d.ts.map +1 -1
  88. package/build/component/generator/templateHelper.js +16 -3
  89. package/build/component/generator/templateHelper.js.map +1 -1
  90. package/build/component/generator/templates/metadata/index.d.ts +15 -0
  91. package/build/component/generator/templates/metadata/index.d.ts.map +1 -1
  92. package/build/component/generator/templates/metadata/index.js +39 -0
  93. package/build/component/generator/templates/metadata/index.js.map +1 -1
  94. package/build/component/generator/templates/templateNames.d.ts +2 -0
  95. package/build/component/generator/templates/templateNames.d.ts.map +1 -1
  96. package/build/component/generator/templates/templateNames.js +2 -0
  97. package/build/component/generator/templates/templateNames.js.map +1 -1
  98. package/build/component/generator/utils.d.ts.map +1 -1
  99. package/build/component/generator/utils.js +6 -0
  100. package/build/component/generator/utils.js.map +1 -1
  101. package/build/component/generator/v4TemplateBridge.d.ts +4 -1
  102. package/build/component/generator/v4TemplateBridge.d.ts.map +1 -1
  103. package/build/component/generator/v4TemplateBridge.js +19 -3
  104. package/build/component/generator/v4TemplateBridge.js.map +1 -1
  105. package/build/component/utils/envFunctionUtils.js +1 -1
  106. package/build/component/utils/envFunctionUtils.js.map +1 -1
  107. package/build/component/utils/envUtil.d.ts.map +1 -1
  108. package/build/component/utils/envUtil.js +2 -2
  109. package/build/component/utils/envUtil.js.map +1 -1
  110. package/build/component/utils/fileOperation.d.ts.map +1 -1
  111. package/build/component/utils/fileOperation.js +4 -1
  112. package/build/component/utils/fileOperation.js.map +1 -1
  113. package/build/component/utils/mcpAuthScaffolder.d.ts +28 -0
  114. package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -1
  115. package/build/component/utils/mcpAuthScaffolder.js +39 -4
  116. package/build/component/utils/mcpAuthScaffolder.js.map +1 -1
  117. package/build/component/utils/mcpToolFetcher.d.ts +1 -72
  118. package/build/component/utils/mcpToolFetcher.d.ts.map +1 -1
  119. package/build/component/utils/mcpToolFetcher.js +1 -227
  120. package/build/component/utils/mcpToolFetcher.js.map +1 -1
  121. package/build/component/utils/odrProvider.d.ts +1 -55
  122. package/build/component/utils/odrProvider.d.ts.map +1 -1
  123. package/build/component/utils/odrProvider.js +1 -101
  124. package/build/component/utils/odrProvider.js.map +1 -1
  125. package/build/core/FxCore.d.ts.map +1 -1
  126. package/build/core/FxCore.declarativeAgent.d.ts.map +1 -1
  127. package/build/core/FxCore.declarativeAgent.js +111 -4
  128. package/build/core/FxCore.declarativeAgent.js.map +1 -1
  129. package/build/core/FxCore.js +9 -11
  130. package/build/core/FxCore.js.map +1 -1
  131. package/build/core/createFrontDoorAdapters.d.ts +4 -27
  132. package/build/core/createFrontDoorAdapters.d.ts.map +1 -1
  133. package/build/core/createFrontDoorAdapters.js +55 -161
  134. package/build/core/createFrontDoorAdapters.js.map +1 -1
  135. package/build/core/createProjectFrontDoor.d.ts +10 -12
  136. package/build/core/createProjectFrontDoor.d.ts.map +1 -1
  137. package/build/core/createProjectFrontDoor.js +139 -137
  138. package/build/core/createProjectFrontDoor.js.map +1 -1
  139. package/build/core/modifyProjectFrontDoor.d.ts +0 -1
  140. package/build/core/modifyProjectFrontDoor.d.ts.map +1 -1
  141. package/build/core/modifyProjectFrontDoor.js +0 -3
  142. package/build/core/modifyProjectFrontDoor.js.map +1 -1
  143. package/build/index.d.ts +3 -2
  144. package/build/index.d.ts.map +1 -1
  145. package/build/index.js +9 -1
  146. package/build/index.js.map +1 -1
  147. package/build/question/create.d.ts.map +1 -1
  148. package/build/question/create.js +2 -1
  149. package/build/question/create.js.map +1 -1
  150. package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
  151. package/build/question/inputs/CreateProjectInputs.d.ts +4 -0
  152. package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
  153. package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
  154. package/build/question/options/CreateProjectOptions.js +14 -0
  155. package/build/question/options/CreateProjectOptions.js.map +1 -1
  156. package/build/question/other.d.ts.map +1 -1
  157. package/build/question/other.js +15 -2
  158. package/build/question/other.js.map +1 -1
  159. package/build/question/questionNames.d.ts +2 -0
  160. package/build/question/questionNames.d.ts.map +1 -1
  161. package/build/question/questionNames.js +2 -0
  162. package/build/question/questionNames.js.map +1 -1
  163. package/build/question/scaffold/constructNode.d.ts +3 -1
  164. package/build/question/scaffold/constructNode.d.ts.map +1 -1
  165. package/build/question/scaffold/constructNode.js +50 -0
  166. package/build/question/scaffold/constructNode.js.map +1 -1
  167. package/build/question/scaffold/vsc/CapabilityOptions.d.ts +2 -0
  168. package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
  169. package/build/question/scaffold/vsc/CapabilityOptions.js +16 -0
  170. package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
  171. package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +19 -1
  172. package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
  173. package/build/question/scaffold/vsc/teamsProjectTypeNode.js +39 -7
  174. package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
  175. package/build/v4/buildTarget/parseSelector.d.ts +6 -2
  176. package/build/v4/buildTarget/parseSelector.d.ts.map +1 -1
  177. package/build/v4/buildTarget/parseSelector.js +58 -49
  178. package/build/v4/buildTarget/parseSelector.js.map +1 -1
  179. package/build/v4/buildTarget/resolveBuildTarget.d.ts +21 -10
  180. package/build/v4/buildTarget/resolveBuildTarget.d.ts.map +1 -1
  181. package/build/v4/buildTarget/resolveBuildTarget.js +98 -70
  182. package/build/v4/buildTarget/resolveBuildTarget.js.map +1 -1
  183. package/build/v4/collectInputs/collectInputs.d.ts +51 -10
  184. package/build/v4/collectInputs/collectInputs.d.ts.map +1 -1
  185. package/build/v4/collectInputs/collectInputs.js +287 -91
  186. package/build/v4/collectInputs/collectInputs.js.map +1 -1
  187. package/build/v4/distribution/createQuestions.d.ts.map +1 -1
  188. package/build/v4/distribution/createQuestions.js +2 -29
  189. package/build/v4/distribution/createQuestions.js.map +1 -1
  190. package/build/v4/distribution/declarativePackage.d.ts.map +1 -1
  191. package/build/v4/distribution/declarativePackage.js +2 -30
  192. package/build/v4/distribution/declarativePackage.js.map +1 -1
  193. package/build/v4/distribution/questionFragments.d.ts +11 -0
  194. package/build/v4/distribution/questionFragments.d.ts.map +1 -0
  195. package/build/v4/distribution/questionFragments.js +130 -0
  196. package/build/v4/distribution/questionFragments.js.map +1 -0
  197. package/build/v4/engineVersion.d.ts +7 -0
  198. package/build/v4/engineVersion.d.ts.map +1 -0
  199. package/build/v4/engineVersion.js +12 -0
  200. package/build/v4/engineVersion.js.map +1 -0
  201. package/build/v4/expression/evaluateExpression.d.ts +13 -0
  202. package/build/v4/expression/evaluateExpression.d.ts.map +1 -1
  203. package/build/v4/expression/evaluateExpression.js +57 -0
  204. package/build/v4/expression/evaluateExpression.js.map +1 -1
  205. package/build/v4/index.d.ts +7 -0
  206. package/build/v4/index.d.ts.map +1 -1
  207. package/build/v4/index.js +7 -0
  208. package/build/v4/index.js.map +1 -1
  209. package/build/v4/inspection/scaffoldCatalog.d.ts +28 -0
  210. package/build/v4/inspection/scaffoldCatalog.d.ts.map +1 -0
  211. package/build/v4/inspection/scaffoldCatalog.js +66 -0
  212. package/build/v4/inspection/scaffoldCatalog.js.map +1 -0
  213. package/build/v4/inspection/scaffoldMetadataSource.d.ts +6 -0
  214. package/build/v4/inspection/scaffoldMetadataSource.d.ts.map +1 -0
  215. package/build/v4/inspection/scaffoldMetadataSource.js +78 -0
  216. package/build/v4/inspection/scaffoldMetadataSource.js.map +1 -0
  217. package/build/v4/mcp/mcpAuthAction.d.ts +36 -0
  218. package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -0
  219. package/build/v4/mcp/mcpAuthAction.js +177 -0
  220. package/build/v4/mcp/mcpAuthAction.js.map +1 -0
  221. package/build/v4/mcp/mcpAuthScaffold.d.ts +37 -0
  222. package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -0
  223. package/build/v4/mcp/mcpAuthScaffold.js +162 -0
  224. package/build/v4/mcp/mcpAuthScaffold.js.map +1 -0
  225. package/build/v4/model/dataModel.d.ts +1 -1
  226. package/build/v4/model/dataModel.d.ts.map +1 -1
  227. package/build/v4/pipeline/runScaffoldPipeline.d.ts +27 -5
  228. package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -1
  229. package/build/v4/pipeline/runScaffoldPipeline.js +64 -10
  230. package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -1
  231. package/build/v4/providers/createOptionsProviders.d.ts +11 -0
  232. package/build/v4/providers/createOptionsProviders.d.ts.map +1 -0
  233. package/build/v4/providers/createOptionsProviders.js +268 -0
  234. package/build/v4/providers/createOptionsProviders.js.map +1 -0
  235. package/build/v4/renderContext/buildRenderContext.d.ts.map +1 -1
  236. package/build/v4/renderContext/buildRenderContext.js +4 -6
  237. package/build/v4/renderContext/buildRenderContext.js.map +1 -1
  238. package/build/v4/runtime/generalSensitivityLabel.d.ts +5 -0
  239. package/build/v4/runtime/generalSensitivityLabel.d.ts.map +1 -0
  240. package/build/v4/runtime/generalSensitivityLabel.js +36 -0
  241. package/build/v4/runtime/generalSensitivityLabel.js.map +1 -0
  242. package/build/v4/runtime/inMemoryRuntime.d.ts +7 -1
  243. package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -1
  244. package/build/v4/runtime/inMemoryRuntime.js +25 -3
  245. package/build/v4/runtime/inMemoryRuntime.js.map +1 -1
  246. package/build/v4/runtime/packageParse.d.ts.map +1 -1
  247. package/build/v4/runtime/packageParse.js +64 -8
  248. package/build/v4/runtime/packageParse.js.map +1 -1
  249. package/build/v4/runtime/realRuntime.d.ts +3 -1
  250. package/build/v4/runtime/realRuntime.d.ts.map +1 -1
  251. package/build/v4/runtime/realRuntime.js +3 -2
  252. package/build/v4/runtime/realRuntime.js.map +1 -1
  253. package/build/v4/runtime/renderMustache.d.ts.map +1 -1
  254. package/build/v4/runtime/renderMustache.js +13 -4
  255. package/build/v4/runtime/renderMustache.js.map +1 -1
  256. package/build/v4/runtime/runtimeRegistry.d.ts +12 -3
  257. package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -1
  258. package/build/v4/runtime/runtimeRegistry.js +123 -17
  259. package/build/v4/runtime/runtimeRegistry.js.map +1 -1
  260. package/build/v4/runtime/scaffold.d.ts +1 -0
  261. package/build/v4/runtime/scaffold.d.ts.map +1 -1
  262. package/build/v4/runtime/scaffold.js +1 -20
  263. package/build/v4/runtime/scaffold.js.map +1 -1
  264. package/build/v4/runtime/steps/daAction.d.ts.map +1 -1
  265. package/build/v4/runtime/steps/daAction.js +3 -111
  266. package/build/v4/runtime/steps/daAction.js.map +1 -1
  267. package/build/v4/runtime/steps/daSensitivity.d.ts +14 -0
  268. package/build/v4/runtime/steps/daSensitivity.d.ts.map +1 -0
  269. package/build/v4/runtime/steps/daSensitivity.js +50 -0
  270. package/build/v4/runtime/steps/daSensitivity.js.map +1 -0
  271. package/build/v4/runtime/steps/mcpAuth.d.ts +5 -2
  272. package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -1
  273. package/build/v4/runtime/steps/mcpAuth.js +37 -66
  274. package/build/v4/runtime/steps/mcpAuth.js.map +1 -1
  275. package/build/v4/runtime/steps/mcpLocal.d.ts +0 -4
  276. package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -1
  277. package/build/v4/runtime/steps/mcpLocal.js +11 -31
  278. package/build/v4/runtime/steps/mcpLocal.js.map +1 -1
  279. package/build/v4/runtime/steps/mcpStatic.d.ts +1 -1
  280. package/build/v4/runtime/steps/mcpStatic.d.ts.map +1 -1
  281. package/build/v4/runtime/steps/mcpStatic.js +14 -32
  282. package/build/v4/runtime/steps/mcpStatic.js.map +1 -1
  283. package/build/v4/runtime/steps/metaOs.d.ts.map +1 -1
  284. package/build/v4/runtime/steps/metaOs.js +39 -51
  285. package/build/v4/runtime/steps/metaOs.js.map +1 -1
  286. package/build/v4/runtime/steps/officeAddin.d.ts.map +1 -1
  287. package/build/v4/runtime/steps/officeAddin.js +7 -12
  288. package/build/v4/runtime/steps/officeAddin.js.map +1 -1
  289. package/build/v4/runtime/steps/openApi.d.ts.map +1 -1
  290. package/build/v4/runtime/steps/openApi.js +85 -566
  291. package/build/v4/runtime/steps/openApi.js.map +1 -1
  292. package/build/v4/runtime/steps/openApiCustomApi.d.ts +5 -0
  293. package/build/v4/runtime/steps/openApiCustomApi.d.ts.map +1 -0
  294. package/build/v4/runtime/steps/openApiCustomApi.js +385 -0
  295. package/build/v4/runtime/steps/openApiCustomApi.js.map +1 -0
  296. package/build/v4/runtime/whitelist.d.ts +27 -0
  297. package/build/v4/runtime/whitelist.d.ts.map +1 -1
  298. package/build/v4/runtime/whitelist.js +156 -1
  299. package/build/v4/runtime/whitelist.js.map +1 -1
  300. package/build/v4/runtime/withTempDirectory.d.ts +10 -0
  301. package/build/v4/runtime/withTempDirectory.d.ts.map +1 -0
  302. package/build/v4/runtime/withTempDirectory.js +41 -0
  303. package/build/v4/runtime/withTempDirectory.js.map +1 -0
  304. package/build/v4/surface/createFloorTail.d.ts +12 -0
  305. package/build/v4/surface/createFloorTail.d.ts.map +1 -0
  306. package/build/v4/surface/createFloorTail.js +138 -0
  307. package/build/v4/surface/createFloorTail.js.map +1 -0
  308. package/build/v4/surface/createInputs.d.ts +25 -3
  309. package/build/v4/surface/createInputs.d.ts.map +1 -1
  310. package/build/v4/surface/createInputs.js +54 -431
  311. package/build/v4/surface/createInputs.js.map +1 -1
  312. package/build/v4/surface/createSelectorWalk.d.ts +8 -3
  313. package/build/v4/surface/createSelectorWalk.d.ts.map +1 -1
  314. package/build/v4/surface/createSelectorWalk.js +21 -14
  315. package/build/v4/surface/createSelectorWalk.js.map +1 -1
  316. package/build/v4/surface/deriveCreateOptions.d.ts.map +1 -1
  317. package/build/v4/surface/deriveCreateOptions.js +5 -2
  318. package/build/v4/surface/deriveCreateOptions.js.map +1 -1
  319. package/build/v4/surface/localizePrompt.d.ts +11 -0
  320. package/build/v4/surface/localizePrompt.d.ts.map +1 -0
  321. package/build/v4/surface/localizePrompt.js +32 -0
  322. package/build/v4/surface/localizePrompt.js.map +1 -0
  323. package/build/v4/surface/modifySelectorWalk.d.ts.map +1 -1
  324. package/build/v4/surface/modifySelectorWalk.js +0 -6
  325. package/build/v4/surface/modifySelectorWalk.js.map +1 -1
  326. package/build/v4/surface/uiPromptUI.d.ts.map +1 -1
  327. package/build/v4/surface/uiPromptUI.js +45 -45
  328. package/build/v4/surface/uiPromptUI.js.map +1 -1
  329. package/build/v4/validation/capabilityCatalog.d.ts +8 -0
  330. package/build/v4/validation/capabilityCatalog.d.ts.map +1 -0
  331. package/build/v4/validation/capabilityCatalog.js +62 -0
  332. package/build/v4/validation/capabilityCatalog.js.map +1 -0
  333. package/build/v4/validation/templateArchiveValidation.d.ts +15 -0
  334. package/build/v4/validation/templateArchiveValidation.d.ts.map +1 -0
  335. package/build/v4/validation/templateArchiveValidation.js +297 -0
  336. package/build/v4/validation/templateArchiveValidation.js.map +1 -0
  337. package/build/v4/validation/validateTemplatePackage.d.ts +21 -2
  338. package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -1
  339. package/build/v4/validation/validateTemplatePackage.js +155 -31
  340. package/build/v4/validation/validateTemplatePackage.js.map +1 -1
  341. package/build/v4/validators/createInputValidators.d.ts +7 -0
  342. package/build/v4/validators/createInputValidators.d.ts.map +1 -0
  343. package/build/v4/validators/createInputValidators.js +77 -0
  344. package/build/v4/validators/createInputValidators.js.map +1 -0
  345. package/build/v4/validators/mcpCredentialValidators.d.ts +5 -0
  346. package/build/v4/validators/mcpCredentialValidators.d.ts.map +1 -0
  347. package/build/v4/validators/mcpCredentialValidators.js +13 -0
  348. package/build/v4/validators/mcpCredentialValidators.js.map +1 -0
  349. package/build/v4/validators/mcpServerUrlValidator.d.ts +9 -0
  350. package/build/v4/validators/mcpServerUrlValidator.d.ts.map +1 -0
  351. package/build/v4/validators/mcpServerUrlValidator.js +15 -0
  352. package/build/v4/validators/mcpServerUrlValidator.js.map +1 -0
  353. package/package.json +29 -23
  354. package/resource/package.nls.cs.json +56 -54
  355. package/resource/package.nls.de.json +56 -54
  356. package/resource/package.nls.es.json +55 -53
  357. package/resource/package.nls.fr.json +56 -54
  358. package/resource/package.nls.it.json +55 -53
  359. package/resource/package.nls.ja.json +56 -54
  360. package/resource/package.nls.json +10 -3
  361. package/resource/package.nls.ko.json +56 -54
  362. package/resource/package.nls.pl.json +56 -54
  363. package/resource/package.nls.pt-BR.json +56 -54
  364. package/resource/package.nls.ru.json +56 -54
  365. package/resource/package.nls.tr.json +56 -54
  366. package/resource/package.nls.zh-Hans.json +56 -54
  367. package/resource/package.nls.zh-Hant.json +56 -54
  368. package/resource/templates/package.nls.cs.json +22 -9
  369. package/resource/templates/package.nls.de.json +22 -9
  370. package/resource/templates/package.nls.es.json +22 -9
  371. package/resource/templates/package.nls.fr.json +22 -9
  372. package/resource/templates/package.nls.it.json +22 -9
  373. package/resource/templates/package.nls.ja.json +22 -9
  374. package/resource/templates/package.nls.json +16 -3
  375. package/resource/templates/package.nls.ko.json +22 -9
  376. package/resource/templates/package.nls.pl.json +22 -9
  377. package/resource/templates/package.nls.pt-BR.json +22 -9
  378. package/resource/templates/package.nls.ru.json +22 -9
  379. package/resource/templates/package.nls.tr.json +22 -9
  380. package/resource/templates/package.nls.zh-Hans.json +22 -9
  381. package/resource/templates/package.nls.zh-Hant.json +22 -9
  382. package/resource/templates/package.nls.zh-cn.json +7 -1
  383. package/resource/templates/package.nls.zh-tw.json +7 -1
  384. package/templates/fallback/common.zip +0 -0
  385. package/templates/fallback/csharp.zip +0 -0
  386. package/templates/fallback/js.zip +0 -0
  387. package/templates/fallback/python.zip +0 -0
  388. package/templates/fallback/ts.zip +0 -0
  389. package/templates/metadata/allTemplates.json +16 -2
  390. package/templates/metadata.zip +0 -0
  391. package/templates/ui/wizardNode.json +24 -0
  392. package/templates/v4/create-selector.json +30 -5
  393. package/templates/v4/floor.json +1 -1
  394. package/templates/v4/modify-selector.json +1 -6
  395. package/templates/v4/templates-metadata.zip +0 -0
  396. package/templates/v4/templates.zip +0 -0
  397. package/templates/configs/local/typescript/.gitignore +0 -1
  398. package/templates/configs/playground/typescript/.gitignore +0 -4
@@ -7,6 +7,7 @@ exports.parseSelectorSpec = parseSelectorSpec;
7
7
  exports.parseSelectorPresentation = parseSelectorPresentation;
8
8
  const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
9
  const neverthrow_1 = require("neverthrow");
10
+ const evaluateExpression_1 = require("../expression/evaluateExpression");
10
11
  /** Parse raw selector JSON into routing and presentation projections. See resolve-build-target spec. */
11
12
  const SOURCE = "Scaffold";
12
13
  /** `UserError` name for malformed selector JSON. */
@@ -31,65 +32,54 @@ function stringArray(value) {
31
32
  }
32
33
  /** Membership test for the closed dispatch-engine set. */
33
34
  function isDispatchEngine(value) {
34
- return (value === "v4" || value === "v3" || value === "v3-core-method" || value === "surface-action");
35
- }
36
- /** Structural check for the authored `ExpressionNode` union. */
37
- function isExpressionNode(value) {
38
- if (!isRecord(value)) {
39
- return false;
40
- }
41
- return (typeof value.expr === "string" ||
42
- typeof value.from === "string" ||
43
- typeof value.featureFlag === "string" ||
44
- typeof value.capability === "string" ||
45
- isRecord(value.equals) ||
46
- isRecord(value.enum) ||
47
- Array.isArray(value.anyOf));
35
+ return value === "v4" || value === "surface-action";
48
36
  }
49
37
  /** Project one raw question onto `{ name, condition? }`. */
50
- function parseQuestion(raw) {
38
+ function parseQuestion(raw, index) {
51
39
  if (!isRecord(raw)) {
52
- return (0, neverthrow_1.err)(userError("a selector question must be an object"));
40
+ return (0, neverthrow_1.err)(userError(`selector question at index ${index} must be an object`));
53
41
  }
54
42
  const name = stringField(raw, "name");
55
43
  if (name === undefined) {
56
- return (0, neverthrow_1.err)(userError("a selector question must have a string 'name'"));
44
+ return (0, neverthrow_1.err)(userError(`selector question at index ${index} must have a string 'name'`));
57
45
  }
58
46
  const condition = raw.condition;
59
47
  if (condition === undefined) {
60
48
  return (0, neverthrow_1.ok)({ name });
61
49
  }
62
- if (!isExpressionNode(condition)) {
63
- return (0, neverthrow_1.err)(userError(`selector question '${name}' has a malformed 'condition'`));
50
+ if (!(0, evaluateExpression_1.isExpressionNode)(condition)) {
51
+ return (0, neverthrow_1.err)(userError(`selector question at index ${index} has a malformed 'condition'`));
64
52
  }
65
53
  return (0, neverthrow_1.ok)({ name, condition });
66
54
  }
67
55
  /** Project one raw route onto `{ when, engine, +engine-key? }`. */
68
- function parseRoute(raw) {
56
+ function parseRoute(raw, index) {
69
57
  if (!isRecord(raw)) {
70
- return (0, neverthrow_1.err)(userError("a selector route must be an object"));
58
+ return (0, neverthrow_1.err)(userError(`selector route at index ${index} must be an object`));
71
59
  }
72
60
  const when = stringField(raw, "when");
73
61
  if (when === undefined) {
74
- return (0, neverthrow_1.err)(userError("a selector route must have a string 'when'"));
62
+ return (0, neverthrow_1.err)(userError(`selector route at index ${index} must have a string 'when'`));
75
63
  }
76
64
  const engine = raw.engine;
77
65
  if (!isDispatchEngine(engine)) {
78
- return (0, neverthrow_1.err)(userError(`selector route '${when}' has an invalid 'engine'`));
66
+ return (0, neverthrow_1.err)(userError(`selector route at index ${index} has an invalid 'engine'`));
79
67
  }
80
68
  const route = { when, engine };
69
+ for (const key of ["templateId", "action"]) {
70
+ if (key in raw && typeof raw[key] !== "string") {
71
+ return (0, neverthrow_1.err)(userError(`selector route at index ${index} has a non-string '${key}'`));
72
+ }
73
+ }
74
+ if ("surfaces" in raw &&
75
+ (!Array.isArray(raw.surfaces) ||
76
+ !raw.surfaces.every((surface) => typeof surface === "string"))) {
77
+ return (0, neverthrow_1.err)(userError(`selector route at index ${index} has invalid 'surfaces'`));
78
+ }
81
79
  const templateId = stringField(raw, "templateId");
82
80
  if (templateId !== undefined) {
83
81
  route.templateId = templateId;
84
82
  }
85
- const v3Adapter = stringField(raw, "v3Adapter");
86
- if (v3Adapter !== undefined) {
87
- route.v3Adapter = v3Adapter;
88
- }
89
- const coreMethod = stringField(raw, "coreMethod");
90
- if (coreMethod !== undefined) {
91
- route.coreMethod = coreMethod;
92
- }
93
83
  const action = stringField(raw, "action");
94
84
  if (action !== undefined) {
95
85
  route.action = action;
@@ -112,16 +102,16 @@ function parseSelectorSpec(raw) {
112
102
  return (0, neverthrow_1.err)(userError("selector.json 'routes' must be an array"));
113
103
  }
114
104
  const questions = [];
115
- for (const rawQuestion of raw.questions) {
116
- const parsed = parseQuestion(rawQuestion);
105
+ for (let index = 0; index < raw.questions.length; index++) {
106
+ const parsed = parseQuestion(raw.questions[index], index);
117
107
  if (parsed.isErr()) {
118
108
  return (0, neverthrow_1.err)(parsed.error);
119
109
  }
120
110
  questions.push(parsed.value);
121
111
  }
122
112
  const routes = [];
123
- for (const rawRoute of raw.routes) {
124
- const parsed = parseRoute(rawRoute);
113
+ for (let index = 0; index < raw.routes.length; index++) {
114
+ const parsed = parseRoute(raw.routes[index], index);
125
115
  if (parsed.isErr()) {
126
116
  return (0, neverthrow_1.err)(parsed.error);
127
117
  }
@@ -130,17 +120,17 @@ function parseSelectorSpec(raw) {
130
120
  return (0, neverthrow_1.ok)({ questions, routes });
131
121
  }
132
122
  /** Project one raw option onto its presentation shape. */
133
- function parsePresentationOption(raw) {
123
+ function parsePresentationOption(raw, questionIndex, optionIndex) {
134
124
  if (!isRecord(raw)) {
135
- return (0, neverthrow_1.err)(userError("a selector option must be an object"));
125
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} option at index ${optionIndex} must be an object`));
136
126
  }
137
127
  const id = stringField(raw, "id");
138
128
  if (id === undefined) {
139
- return (0, neverthrow_1.err)(userError("a selector option must have a string 'id'"));
129
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} option at index ${optionIndex} must have a string 'id'`));
140
130
  }
141
131
  const label = stringField(raw, "label");
142
132
  if (label === undefined) {
143
- return (0, neverthrow_1.err)(userError(`selector option '${id}' must have a string 'label'`));
133
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} option at index ${optionIndex} must have a string 'label'`));
144
134
  }
145
135
  const option = { id, label };
146
136
  const detail = stringField(raw, "detail");
@@ -151,23 +141,31 @@ function parsePresentationOption(raw) {
151
141
  if (groupName !== undefined) {
152
142
  option.groupName = groupName;
153
143
  }
144
+ const iconPath = stringField(raw, "iconPath");
145
+ if (iconPath !== undefined) {
146
+ option.iconPath = iconPath;
147
+ }
148
+ const keyPrefix = stringField(raw, "keyPrefix");
149
+ if (keyPrefix !== undefined) {
150
+ option.keyPrefix = keyPrefix;
151
+ }
154
152
  const condition = raw.condition;
155
153
  if (condition !== undefined) {
156
- if (!isExpressionNode(condition)) {
157
- return (0, neverthrow_1.err)(userError(`selector option '${id}' has a malformed 'condition'`));
154
+ if (!(0, evaluateExpression_1.isExpressionNode)(condition)) {
155
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} option at index ${optionIndex} has a malformed 'condition'`));
158
156
  }
159
157
  option.condition = condition;
160
158
  }
161
159
  return (0, neverthrow_1.ok)(option);
162
160
  }
163
161
  /** Project one raw question onto its presentation shape. */
164
- function parsePresentationQuestion(raw) {
162
+ function parsePresentationQuestion(raw, questionIndex) {
165
163
  if (!isRecord(raw)) {
166
- return (0, neverthrow_1.err)(userError("a selector question must be an object"));
164
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} must be an object`));
167
165
  }
168
166
  const name = stringField(raw, "name");
169
167
  if (name === undefined) {
170
- return (0, neverthrow_1.err)(userError("a selector question must have a string 'name'"));
168
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} must have a string 'name'`));
171
169
  }
172
170
  const question = { name, staticOptions: [] };
173
171
  const title = stringField(raw, "title");
@@ -178,12 +176,23 @@ function parsePresentationQuestion(raw) {
178
176
  if (placeholder !== undefined) {
179
177
  question.placeholder = placeholder;
180
178
  }
179
+ const keyPrefix = stringField(raw, "keyPrefix");
180
+ if (keyPrefix !== undefined) {
181
+ question.keyPrefix = keyPrefix;
182
+ }
183
+ const condition = raw.condition;
184
+ if (condition !== undefined) {
185
+ if (!(0, evaluateExpression_1.isExpressionNode)(condition)) {
186
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} has a malformed 'condition'`));
187
+ }
188
+ question.condition = condition;
189
+ }
181
190
  if (raw.staticOptions !== undefined) {
182
191
  if (!Array.isArray(raw.staticOptions)) {
183
- return (0, neverthrow_1.err)(userError(`selector question '${name}' has a non-array 'staticOptions'`));
192
+ return (0, neverthrow_1.err)(userError(`selector question at index ${questionIndex} has a non-array 'staticOptions'`));
184
193
  }
185
- for (const rawOption of raw.staticOptions) {
186
- const parsed = parsePresentationOption(rawOption);
194
+ for (let optionIndex = 0; optionIndex < raw.staticOptions.length; optionIndex++) {
195
+ const parsed = parsePresentationOption(raw.staticOptions[optionIndex], questionIndex, optionIndex);
187
196
  if (parsed.isErr()) {
188
197
  return (0, neverthrow_1.err)(parsed.error);
189
198
  }
@@ -201,8 +210,8 @@ function parseSelectorPresentation(raw) {
201
210
  return (0, neverthrow_1.err)(userError("selector.json 'questions' must be an array"));
202
211
  }
203
212
  const questions = [];
204
- for (const rawQuestion of raw.questions) {
205
- const parsed = parsePresentationQuestion(rawQuestion);
213
+ for (let questionIndex = 0; questionIndex < raw.questions.length; questionIndex++) {
214
+ const parsed = parsePresentationQuestion(raw.questions[questionIndex], questionIndex);
206
215
  if (parsed.isErr()) {
207
216
  return (0, neverthrow_1.err)(parsed.error);
208
217
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parseSelector.js","sourceRoot":"","sources":["../../../src/v4/buildTarget/parseSelector.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAoHlC,8CA2BC;AA4FD,8DAgBC;AAzPD,wDAA4D;AAC5D,2CAA6C;AAI7C,wGAAwG;AAExG,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,oDAAoD;AACvC,QAAA,+BAA+B,GAAG,8BAA8B,CAAC;AAE9E,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO,IAAI,uBAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,uCAA+B,EAAE,OAAO,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,gFAAgF;AAChF,SAAS,WAAW,CAAC,MAA+B,EAAE,GAAW;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,4FAA4F;AAC5F,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,KAAK,C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,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,IAAA,gBAAG,EAAC,SAAS,CAAC,4CAA4C,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,KAAK,IAAI,aAAa,GAAG,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC;QAClF,MAAM,MAAM,GAAG,yBAAyB,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC;QACtF,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YACnB,OAAO,IAAA,gBAAG,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,IAAA,eAAE,EAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,15 +1,14 @@
1
1
  import { FxError } from "@microsoft/teamsfx-api";
2
2
  import { Result } from "neverthrow";
3
+ import { WalkHistoryEntry } from "../collectInputs/collectInputs";
3
4
  import { ExpressionNode } from "../expression/evaluateExpression";
4
- /** The four worlds dispatch can hand off to. */
5
- export type DispatchEngine = "v4" | "v3" | "v3-core-method" | "surface-action";
5
+ /** The worlds dispatch can hand off to. */
6
+ export type DispatchEngine = "v4" | "surface-action";
6
7
  /** One parsed `selector.json` route. */
7
8
  export interface SelectorRoute {
8
9
  when: string;
9
10
  engine: DispatchEngine;
10
11
  templateId?: string;
11
- v3Adapter?: string;
12
- coreMethod?: string;
13
12
  action?: string;
14
13
  surfaces?: string[];
15
14
  }
@@ -40,20 +39,26 @@ export interface RouteResolverPort {
40
39
  featureFlag(name: string): boolean;
41
40
  /** Membership test for the v4 world. */
42
41
  v4Registry(templateId: string): boolean;
43
- /** Membership test for the frozen v3 generator allow-list. */
44
- v3Registry(templateId: string): boolean;
45
- /** Membership test for the frozen v3 core-method allow-list. */
46
- v3CoreMethodRegistry(coreMethod: string): boolean;
47
42
  }
48
43
  /** The resolved dispatch outcome. */
49
44
  export interface BuildTarget {
50
- /** The v4/v3 template id, core method, or surface action id. */
45
+ /** The v4 template id, core method, or surface action id. */
51
46
  templateId: string;
52
47
  /** Which world dispatch hands off to. */
53
48
  engine: DispatchEngine;
54
49
  /** The Q1 dimension picks that produced this target. */
55
50
  answers?: Record<string, string>;
56
51
  }
52
+ /**
53
+ * A `BuildTarget` plus the Q1 walk state the front door retains for cross-phase
54
+ * back (a superset, so existing `BuildTarget` reads are unaffected). `history` is
55
+ * opaque to the front door — it is only handed back via `resume`; `promptCount`
56
+ * is the number of Q1 dimensions actually prompted (Q2's `baseStep`).
57
+ */
58
+ export interface SelectorWalkResult extends BuildTarget {
59
+ history: WalkHistoryEntry[];
60
+ promptCount: number;
61
+ }
57
62
  /** `UserError` name: a resolved/supplied `templateId` belongs to no world. */
58
63
  export declare const BUILD_TARGET_UNKNOWN_TEMPLATE = "BuildTargetUnknownTemplate";
59
64
  /** `UserError` name: a route carries the wrong engine-specific key set. */
@@ -66,6 +71,12 @@ export declare const BUILD_TARGET_NO_MATCHING_ROUTE = "BuildTargetNoMatchingRout
66
71
  export declare const BUILD_TARGET_MISSING_DIMENSION = "BuildTargetMissingDimension";
67
72
  /** `UserError` name: the user backed out of the first Q1 prompt. */
68
73
  export declare const BUILD_TARGET_WALK_CANCELLED = "BuildTargetWalkCancelled";
74
+ /** Validate only a selector route's engine-specific key shape. */
75
+ export declare function validateSelectorRouteShape(route: SelectorRoute): Result<void, FxError>;
69
76
  /** Resolve a create/modify selector walk into a dispatched `BuildTarget`. */
70
- export declare function resolveBuildTarget(selector: SelectorSpec, prefilled: Record<string, string>, interactive: boolean, port: RouteResolverPort): Promise<Result<BuildTarget, FxError>>;
77
+ export declare function resolveBuildTarget(selector: SelectorSpec, prefilled: Record<string, string>, interactive: boolean, port: RouteResolverPort, options?: {
78
+ resume?: {
79
+ history: WalkHistoryEntry[];
80
+ };
81
+ }): Promise<Result<SelectorWalkResult, FxError>>;
71
82
  //# sourceMappingURL=resolveBuildTarget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveBuildTarget.d.ts","sourceRoot":"","sources":["../../../src/v4/buildTarget/resolveBuildTarget.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAa,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAW,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,cAAc,EAKf,MAAM,kCAAkC,CAAC;AAM1C,gDAAgD;AAChD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAE/E,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,oEAAoE;AACpE,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,YAAY,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAQ/F;AAED,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EA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vB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAA;CAAO,GACzD,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,CA8B9C"}
@@ -4,9 +4,11 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.BUILD_TARGET_WALK_CANCELLED = exports.BUILD_TARGET_MISSING_DIMENSION = exports.BUILD_TARGET_NO_MATCHING_ROUTE = exports.BUILD_TARGET_DANGLING_V4_ROUTE = exports.BUILD_TARGET_MALFORMED_ROUTE = exports.BUILD_TARGET_UNKNOWN_TEMPLATE = void 0;
6
6
  exports.v4RouteRegistryFromSelector = v4RouteRegistryFromSelector;
7
+ exports.validateSelectorRouteShape = validateSelectorRouteShape;
7
8
  exports.resolveBuildTarget = resolveBuildTarget;
8
9
  const teamsfx_api_1 = require("@microsoft/teamsfx-api");
9
10
  const neverthrow_1 = require("neverthrow");
11
+ const collectInputs_1 = require("../collectInputs/collectInputs");
10
12
  const evaluateExpression_1 = require("../expression/evaluateExpression");
11
13
  /** v4 selector resolution. See resolve-build-target spec and ADR-0014. */
12
14
  const SOURCE = "Scaffold";
@@ -57,8 +59,6 @@ function buildScope(declared, answers) {
57
59
  function malformedRouteReason(r) {
58
60
  const has = {
59
61
  templateId: r.templateId !== undefined,
60
- v3Adapter: r.v3Adapter !== undefined,
61
- coreMethod: r.coreMethod !== undefined,
62
62
  action: r.action !== undefined,
63
63
  };
64
64
  switch (r.engine) {
@@ -66,42 +66,33 @@ function malformedRouteReason(r) {
66
66
  if (!has.templateId) {
67
67
  return "engine 'v4' requires 'templateId'";
68
68
  }
69
- if (has.v3Adapter || has.coreMethod || has.action) {
70
- return "engine 'v4' must not carry 'v3Adapter' / 'coreMethod' / 'action'";
71
- }
72
- return undefined;
73
- case "v3":
74
- if (!has.v3Adapter) {
75
- return "engine 'v3' requires 'v3Adapter'";
76
- }
77
- if (has.coreMethod || has.action) {
78
- return "engine 'v3' must not carry 'coreMethod' / 'action'";
79
- }
80
- return undefined;
81
- case "v3-core-method":
82
- if (!has.coreMethod) {
83
- return "engine 'v3-core-method' requires 'coreMethod'";
84
- }
85
- if (has.templateId || has.v3Adapter || has.action) {
86
- return "engine 'v3-core-method' must not carry 'templateId' / 'v3Adapter' / 'action'";
69
+ if (has.action) {
70
+ return "engine 'v4' must not carry 'action'";
87
71
  }
88
72
  return undefined;
89
73
  case "surface-action":
90
74
  if (!has.action) {
91
75
  return "engine 'surface-action' requires 'action'";
92
76
  }
93
- if (has.templateId || has.v3Adapter || has.coreMethod) {
94
- return "engine 'surface-action' must not carry 'templateId' / 'v3Adapter' / 'coreMethod'";
77
+ if (has.templateId) {
78
+ return "engine 'surface-action' must not carry 'templateId'";
95
79
  }
96
80
  return undefined;
97
81
  }
98
82
  }
83
+ /** Validate only a selector route's engine-specific key shape. */
84
+ function validateSelectorRouteShape(route) {
85
+ const reason = malformedRouteReason(route);
86
+ return reason === undefined
87
+ ? (0, neverthrow_1.ok)(undefined)
88
+ : (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `selector route has invalid shape: ${reason}`));
89
+ }
99
90
  /** Validate the routing table before matching any route. */
100
91
  function validateRoutes(routes, port) {
101
92
  for (const r of routes) {
102
- const reason = malformedRouteReason(r);
103
- if (reason !== undefined) {
104
- return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `route '${r.when}': ${reason}`));
93
+ const shape = validateSelectorRouteShape(r);
94
+ if (shape.isErr()) {
95
+ return (0, neverthrow_1.err)(shape.error);
105
96
  }
106
97
  if (r.engine === "v4" && r.templateId !== undefined && !port.v4Registry(r.templateId)) {
107
98
  return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_DANGLING_V4_ROUTE, `route '${r.when}' targets v4 templateId '${r.templateId}', but no descriptor for it is present`));
@@ -109,47 +100,93 @@ function validateRoutes(routes, port) {
109
100
  }
110
101
  return (0, neverthrow_1.ok)(undefined);
111
102
  }
112
- /** Walk Q1 with prefill support and back history for prompted dimensions. */
113
- async function walkWithPrefill(selector, prefilled, interactive, port) {
114
- const declared = selector.questions.map((q) => q.name);
115
- let answers = {};
116
- const history = [];
117
- let index = 0;
118
- while (index < selector.questions.length) {
119
- const q = selector.questions[index];
120
- if (q.condition !== undefined) {
121
- const gate = (0, evaluateExpression_1.evaluateExpression)(q.condition, buildScope(declared, answers), exprPort(port));
103
+ function selectorQuestions(selector) {
104
+ return selector.questions.map((question) => ({
105
+ name: question.name,
106
+ type: "singleSelect",
107
+ condition: question.condition,
108
+ }));
109
+ }
110
+ function selectorOptionsSchema(selector) {
111
+ const properties = {};
112
+ for (const question of selector.questions) {
113
+ properties[question.name] = {};
114
+ }
115
+ return { properties };
116
+ }
117
+ function q1PromptUi(interactive, port) {
118
+ return {
119
+ async ask(question, _options, step = 1) {
120
+ if (!interactive) {
121
+ return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MISSING_DIMENSION, `required dimension '${question.name}' was not provided (non-interactive)`));
122
+ }
123
+ const outcome = await port.prompt({ name: question.name, condition: question.condition }, step);
124
+ if (outcome.kind === "back" && step <= 1) {
125
+ return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_WALK_CANCELLED, "the create selector was cancelled"));
126
+ }
127
+ return (0, neverthrow_1.ok)(outcome);
128
+ },
129
+ askMulti() {
130
+ return Promise.resolve((0, neverthrow_1.err)(new teamsfx_api_1.SystemError({
131
+ source: SOURCE,
132
+ name: "BuildTargetMultiSelectUnsupported",
133
+ message: "selector dimensions do not support multi-select questions",
134
+ })));
135
+ },
136
+ };
137
+ }
138
+ function buildCollectPort(interactive, port) {
139
+ return {
140
+ ui: q1PromptUi(interactive, port),
141
+ optionsProvider: () => undefined,
142
+ validator: () => undefined,
143
+ evaluate: (node, scope) => (0, evaluateExpression_1.evaluateExpression)(node, scope, exprPort(port)),
144
+ };
145
+ }
146
+ function scalarAnswers(selector, answers, port) {
147
+ const normalized = {};
148
+ const declared = selector.questions.map((question) => question.name);
149
+ for (const question of selector.questions) {
150
+ if (question.condition !== undefined) {
151
+ const gate = (0, evaluateExpression_1.evaluateExpression)(question.condition, buildScope(declared, normalized), exprPort(port));
122
152
  if (gate.isErr()) {
123
153
  return (0, neverthrow_1.err)(gate.error);
124
154
  }
125
155
  if (gate.value !== true) {
126
- index++;
127
156
  continue;
128
157
  }
129
158
  }
130
- if (prefilled[q.name] !== undefined) {
131
- answers[q.name] = prefilled[q.name];
132
- index++;
159
+ const value = answers[question.name];
160
+ if (value === undefined) {
133
161
  continue;
134
162
  }
135
- if (!interactive) {
136
- return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MISSING_DIMENSION, `required dimension '${q.name}' was not provided (non-interactive)`));
163
+ if (typeof value !== "string") {
164
+ return (0, neverthrow_1.err)(new teamsfx_api_1.SystemError({
165
+ source: SOURCE,
166
+ name: "BuildTargetNonScalarAnswer",
167
+ message: `selector dimension '${question.name}' resolved to a non-scalar answer`,
168
+ }));
137
169
  }
138
- const outcome = await port.prompt(q, history.length + 1);
139
- if (outcome.kind === "back") {
140
- const restore = history.pop();
141
- if (restore === undefined) {
142
- return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_WALK_CANCELLED, "the create selector was cancelled"));
143
- }
144
- answers = restore.snapshot;
145
- index = restore.index;
146
- continue;
147
- }
148
- history.push({ index, snapshot: { ...answers } });
149
- answers[q.name] = outcome.value;
150
- index++;
170
+ normalized[question.name] = value;
171
+ }
172
+ return (0, neverthrow_1.ok)(normalized);
173
+ }
174
+ /** Walk Q1 through the shared collect-inputs engine with selector-specific prompt wiring. */
175
+ async function collectSelectorAnswers(selector, prefilled, interactive, port, resume) {
176
+ const collected = await (0, collectInputs_1.walkInputs)(selectorQuestions(selector), selectorOptionsSchema(selector), prefilled, buildCollectPort(interactive, port), { resume });
177
+ if (collected.isErr()) {
178
+ return (0, neverthrow_1.err)(collected.error);
151
179
  }
152
- return (0, neverthrow_1.ok)(answers);
180
+ const outcome = collected.value;
181
+ // `backable` is off for Q1, so a back past the first prompt errors in the prompt face (WCS-17)
182
+ // rather than returning a top-level back; the `done` branch is the live path.
183
+ return outcome.kind === "done"
184
+ ? scalarAnswers(selector, outcome.answers, port).map((answers) => ({
185
+ answers,
186
+ history: outcome.history,
187
+ promptCount: outcome.promptCount,
188
+ }))
189
+ : (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_WALK_CANCELLED, "the create selector was cancelled"));
153
190
  }
154
191
  /** Match the first route whose `when` predicate is true against the collected answers. */
155
192
  function matchRoute(selector, answers, port) {
@@ -166,22 +203,13 @@ function matchRoute(selector, answers, port) {
166
203
  return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_NO_MATCHING_ROUTE, "no selector route matched the resolved answers (no silent fallback)"));
167
204
  }
168
205
  /** Dispatch a matched route to its engine-specific id. */
169
- function dispatchRoute(r, port) {
206
+ function dispatchRoute(r) {
170
207
  switch (r.engine) {
171
208
  case "v4":
172
- case "v3":
173
209
  if (r.templateId === undefined) {
174
210
  return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `route '${r.when}': missing 'templateId'`));
175
211
  }
176
212
  return (0, neverthrow_1.ok)({ templateId: r.templateId, engine: r.engine });
177
- case "v3-core-method":
178
- if (r.coreMethod === undefined) {
179
- return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `route '${r.when}': missing 'coreMethod'`));
180
- }
181
- if (!port.v3CoreMethodRegistry(r.coreMethod)) {
182
- return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_UNKNOWN_TEMPLATE, `core method '${r.coreMethod}' is not in the v3 core-method allow-list`));
183
- }
184
- return (0, neverthrow_1.ok)({ templateId: r.coreMethod, engine: r.engine });
185
213
  case "surface-action":
186
214
  if (r.action === undefined) {
187
215
  return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `route '${r.when}': missing 'action'`));
@@ -190,26 +218,26 @@ function dispatchRoute(r, port) {
190
218
  }
191
219
  }
192
220
  /** Resolve a create/modify selector walk into a dispatched `BuildTarget`. */
193
- async function resolveBuildTarget(selector, prefilled, interactive, port) {
221
+ async function resolveBuildTarget(selector, prefilled, interactive, port, options = {}) {
194
222
  // Validate the whole routing table before any route match.
195
223
  const routesOk = validateRoutes(selector.routes, port);
196
224
  if (routesOk.isErr()) {
197
225
  return (0, neverthrow_1.err)(routesOk.error);
198
226
  }
199
227
  // One prefill-aware walk covers interactive and non-interactive resolution.
200
- const walked = await walkWithPrefill(selector, prefilled, interactive, port);
228
+ const walked = await collectSelectorAnswers(selector, prefilled, interactive, port, options.resume);
201
229
  if (walked.isErr()) {
202
230
  return (0, neverthrow_1.err)(walked.error);
203
231
  }
204
- const answers = walked.value;
232
+ const { answers, history, promptCount } = walked.value;
205
233
  const matched = matchRoute(selector, answers, port);
206
234
  if (matched.isErr()) {
207
235
  return (0, neverthrow_1.err)(matched.error);
208
236
  }
209
- const dispatched = dispatchRoute(matched.value, port);
237
+ const dispatched = dispatchRoute(matched.value);
210
238
  if (dispatched.isErr()) {
211
239
  return (0, neverthrow_1.err)(dispatched.error);
212
240
  }
213
- return (0, neverthrow_1.ok)({ ...dispatched.value, answers });
241
+ return (0, neverthrow_1.ok)({ ...dispatched.value, answers, history, promptCount });
214
242
  }
215
243
  //# sourceMappingURL=resolveBuildTarget.js.map