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