@microsoft/teamsfx-core 3.0.14 → 3.0.15-alpha.2c8841ec2d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/aadAppClient.d.ts.map +1 -1
- package/build/client/aadAppClient.js +6 -6
- package/build/client/aadAppClient.js.map +1 -1
- package/build/common/mcpToolFetcher.d.ts +31 -0
- package/build/common/mcpToolFetcher.d.ts.map +1 -0
- package/build/common/mcpToolFetcher.js +182 -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/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/templates-config.json +4 -4
- package/build/common/wrappedAxiosClient.d.ts +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deps-checker/internal/dotnetChecker.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/script/scriptDriver.js +1 -1
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/create.d.ts.map +1 -1
- package/build/component/driver/teamsApp/create.js +3 -3
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
- package/build/component/generator/declarativeAgent/helper.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +1 -0
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +81 -2
- package/build/component/generator/officeAddin/generator.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 +6 -56
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/templateHelper.d.ts +10 -2
- package/build/component/generator/templateHelper.d.ts.map +1 -1
- package/build/component/generator/templateHelper.js +16 -3
- package/build/component/generator/templateHelper.js.map +1 -1
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +6 -0
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/generator/v4TemplateBridge.d.ts +4 -1
- package/build/component/generator/v4TemplateBridge.d.ts.map +1 -1
- package/build/component/generator/v4TemplateBridge.js +11 -3
- package/build/component/generator/v4TemplateBridge.js.map +1 -1
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.js.map +1 -1
- package/build/component/utils/mcpToolFetcher.d.ts +1 -72
- package/build/component/utils/mcpToolFetcher.d.ts.map +1 -1
- package/build/component/utils/mcpToolFetcher.js +1 -227
- package/build/component/utils/mcpToolFetcher.js.map +1 -1
- package/build/component/utils/odrProvider.d.ts +1 -55
- package/build/component/utils/odrProvider.d.ts.map +1 -1
- package/build/component/utils/odrProvider.js +1 -101
- package/build/component/utils/odrProvider.js.map +1 -1
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +3 -5
- package/build/core/FxCore.js.map +1 -1
- package/build/core/createFrontDoorAdapters.d.ts +1 -25
- package/build/core/createFrontDoorAdapters.d.ts.map +1 -1
- package/build/core/createFrontDoorAdapters.js +4 -155
- package/build/core/createFrontDoorAdapters.js.map +1 -1
- package/build/core/createProjectFrontDoor.d.ts +10 -12
- package/build/core/createProjectFrontDoor.d.ts.map +1 -1
- package/build/core/createProjectFrontDoor.js +141 -106
- package/build/core/createProjectFrontDoor.js.map +1 -1
- package/build/core/modifyProjectFrontDoor.d.ts +0 -1
- package/build/core/modifyProjectFrontDoor.d.ts.map +1 -1
- package/build/core/modifyProjectFrontDoor.js +0 -2
- package/build/core/modifyProjectFrontDoor.js.map +1 -1
- package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +2 -0
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +7 -0
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +1 -0
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +1 -0
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/constructNode.d.ts +2 -1
- package/build/question/scaffold/constructNode.d.ts.map +1 -1
- package/build/question/scaffold/constructNode.js +28 -0
- package/build/question/scaffold/constructNode.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +0 -7
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/v4/buildTarget/parseSelector.d.ts +5 -2
- package/build/v4/buildTarget/parseSelector.d.ts.map +1 -1
- package/build/v4/buildTarget/parseSelector.js +16 -20
- package/build/v4/buildTarget/parseSelector.js.map +1 -1
- package/build/v4/buildTarget/resolveBuildTarget.d.ts +19 -7
- package/build/v4/buildTarget/resolveBuildTarget.d.ts.map +1 -1
- package/build/v4/buildTarget/resolveBuildTarget.js +86 -49
- package/build/v4/buildTarget/resolveBuildTarget.js.map +1 -1
- package/build/v4/collectInputs/collectInputs.d.ts +50 -9
- package/build/v4/collectInputs/collectInputs.d.ts.map +1 -1
- package/build/v4/collectInputs/collectInputs.js +274 -91
- package/build/v4/collectInputs/collectInputs.js.map +1 -1
- package/build/v4/distribution/createQuestions.d.ts.map +1 -1
- package/build/v4/distribution/createQuestions.js +2 -29
- package/build/v4/distribution/createQuestions.js.map +1 -1
- package/build/v4/distribution/declarativePackage.d.ts.map +1 -1
- package/build/v4/distribution/declarativePackage.js +2 -30
- package/build/v4/distribution/declarativePackage.js.map +1 -1
- 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/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 +11 -0
- package/build/v4/expression/evaluateExpression.d.ts.map +1 -1
- package/build/v4/expression/evaluateExpression.js +22 -0
- package/build/v4/expression/evaluateExpression.js.map +1 -1
- package/build/v4/index.d.ts +5 -0
- package/build/v4/index.d.ts.map +1 -1
- package/build/v4/index.js +5 -0
- package/build/v4/index.js.map +1 -1
- package/build/v4/mcp/mcpAuthAction.d.ts +23 -0
- package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -0
- package/build/v4/mcp/mcpAuthAction.js +151 -0
- package/build/v4/mcp/mcpAuthAction.js.map +1 -0
- package/build/v4/mcp/mcpAuthScaffold.d.ts +28 -0
- package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -0
- package/build/v4/mcp/mcpAuthScaffold.js +124 -0
- package/build/v4/mcp/mcpAuthScaffold.js.map +1 -0
- package/build/v4/model/dataModel.d.ts +1 -1
- package/build/v4/model/dataModel.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.d.ts +17 -4
- package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.js +60 -9
- package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -1
- 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.map +1 -1
- package/build/v4/renderContext/buildRenderContext.js +1 -2
- package/build/v4/renderContext/buildRenderContext.js.map +1 -1
- 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 +2 -1
- package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -1
- package/build/v4/runtime/inMemoryRuntime.js +2 -2
- package/build/v4/runtime/inMemoryRuntime.js.map +1 -1
- package/build/v4/runtime/packageParse.d.ts.map +1 -1
- package/build/v4/runtime/packageParse.js +64 -8
- package/build/v4/runtime/packageParse.js.map +1 -1
- package/build/v4/runtime/realRuntime.d.ts +2 -1
- package/build/v4/runtime/realRuntime.d.ts.map +1 -1
- package/build/v4/runtime/realRuntime.js +2 -2
- package/build/v4/runtime/realRuntime.js.map +1 -1
- package/build/v4/runtime/renderMustache.d.ts.map +1 -1
- package/build/v4/runtime/renderMustache.js +13 -4
- package/build/v4/runtime/renderMustache.js.map +1 -1
- package/build/v4/runtime/runtimeRegistry.d.ts +8 -3
- package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -1
- package/build/v4/runtime/runtimeRegistry.js +122 -17
- package/build/v4/runtime/runtimeRegistry.js.map +1 -1
- package/build/v4/runtime/scaffold.d.ts +1 -0
- package/build/v4/runtime/scaffold.d.ts.map +1 -1
- package/build/v4/runtime/scaffold.js +1 -20
- package/build/v4/runtime/scaffold.js.map +1 -1
- package/build/v4/runtime/steps/daAction.d.ts.map +1 -1
- package/build/v4/runtime/steps/daAction.js +3 -111
- package/build/v4/runtime/steps/daAction.js.map +1 -1
- 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 +5 -2
- package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.js +13 -63
- package/build/v4/runtime/steps/mcpAuth.js.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.d.ts +0 -4
- package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.js +11 -31
- package/build/v4/runtime/steps/mcpLocal.js.map +1 -1
- package/build/v4/runtime/steps/mcpStatic.d.ts +1 -1
- package/build/v4/runtime/steps/mcpStatic.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpStatic.js +14 -32
- package/build/v4/runtime/steps/mcpStatic.js.map +1 -1
- package/build/v4/runtime/steps/metaOs.d.ts.map +1 -1
- package/build/v4/runtime/steps/metaOs.js +39 -51
- package/build/v4/runtime/steps/metaOs.js.map +1 -1
- package/build/v4/runtime/steps/officeAddin.d.ts.map +1 -1
- package/build/v4/runtime/steps/officeAddin.js +7 -12
- package/build/v4/runtime/steps/officeAddin.js.map +1 -1
- package/build/v4/runtime/steps/openApi.d.ts.map +1 -1
- package/build/v4/runtime/steps/openApi.js +47 -555
- package/build/v4/runtime/steps/openApi.js.map +1 -1
- 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/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 +25 -3
- package/build/v4/surface/createInputs.d.ts.map +1 -1
- package/build/v4/surface/createInputs.js +54 -431
- package/build/v4/surface/createInputs.js.map +1 -1
- package/build/v4/surface/createSelectorWalk.d.ts +8 -3
- package/build/v4/surface/createSelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/createSelectorWalk.js +21 -11
- package/build/v4/surface/createSelectorWalk.js.map +1 -1
- 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.map +1 -1
- package/build/v4/surface/modifySelectorWalk.js +0 -3
- package/build/v4/surface/modifySelectorWalk.js.map +1 -1
- package/build/v4/surface/uiPromptUI.d.ts.map +1 -1
- package/build/v4/surface/uiPromptUI.js +36 -41
- package/build/v4/surface/uiPromptUI.js.map +1 -1
- 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 +58 -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 +21 -2
- package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -1
- package/build/v4/validation/validateTemplatePackage.js +155 -31
- package/build/v4/validation/validateTemplatePackage.js.map +1 -1
- 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 +71 -0
- package/build/v4/validators/createInputValidators.js.map +1 -0
- package/package.json +13 -14
- package/resource/package.nls.json +1 -0
- package/resource/templates/package.nls.cs.json +8 -2
- package/resource/templates/package.nls.de.json +8 -2
- package/resource/templates/package.nls.es.json +8 -2
- package/resource/templates/package.nls.fr.json +8 -2
- package/resource/templates/package.nls.it.json +8 -2
- package/resource/templates/package.nls.ja.json +8 -2
- package/resource/templates/package.nls.json +8 -1
- package/resource/templates/package.nls.ko.json +8 -2
- package/resource/templates/package.nls.pl.json +8 -2
- package/resource/templates/package.nls.pt-BR.json +8 -2
- package/resource/templates/package.nls.ru.json +8 -2
- package/resource/templates/package.nls.tr.json +8 -2
- package/resource/templates/package.nls.zh-Hans.json +8 -2
- package/resource/templates/package.nls.zh-Hant.json +8 -2
- package/resource/templates/package.nls.zh-cn.json +7 -1
- package/resource/templates/package.nls.zh-tw.json +7 -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.zip +0 -0
- package/templates/ui/wizardNode.json +6 -0
- package/templates/v4/create-selector.json +10 -3
- package/templates/v4/floor.json +1 -1
- package/templates/v4/modify-selector.json +1 -6
- package/templates/v4/templates-metadata.zip +0 -0
- package/templates/v4/templates.zip +0 -0
- package/templates/configs/local/typescript/.gitignore +0 -1
- package/templates/configs/playground/typescript/.gitignore +0 -4
|
@@ -16,12 +16,20 @@ const DELIMITERS = ["{{", "}}"];
|
|
|
16
16
|
// Private-use sentinels keep producer-less tokens inert through Mustache.
|
|
17
17
|
const SENTINEL_OPEN = "\uE000";
|
|
18
18
|
const SENTINEL_CLOSE = "\uE001";
|
|
19
|
+
const VALUE_SENTINEL_OPEN = "\uE002";
|
|
20
|
+
const VALUE_SENTINEL_CLOSE = "\uE003";
|
|
19
21
|
// Bare value tokens only; section/comment/partial tags carry a rejected sigil.
|
|
20
|
-
const VALUE_TOKEN = /\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;
|
|
22
|
+
const VALUE_TOKEN = /\{\{\s*([A-Za-z_][A-Za-z0-9_.]*(?::[A-Za-z_][A-Za-z0-9_.]*)?)\s*\}\}/g;
|
|
21
23
|
const SENTINEL_TOKEN = /\uE000([^\uE001]+)\uE001/g;
|
|
24
|
+
const VALUE_SENTINEL_TOKEN = /\uE002([^\uE003]+)\uE003/g;
|
|
22
25
|
function renderMustache(template, renderVars) {
|
|
23
|
-
// Protect producer-less
|
|
24
|
-
const guarded = template.replace(VALUE_TOKEN, (match, name) =>
|
|
26
|
+
// Protect producer-less tokens and exact flat dotted keys from Mustache's nested lookup.
|
|
27
|
+
const guarded = template.replace(VALUE_TOKEN, (match, name) => {
|
|
28
|
+
if (!(name in renderVars)) {
|
|
29
|
+
return `${SENTINEL_OPEN}${name}${SENTINEL_CLOSE}`;
|
|
30
|
+
}
|
|
31
|
+
return name.includes(".") ? `${VALUE_SENTINEL_OPEN}${name}${VALUE_SENTINEL_CLOSE}` : match;
|
|
32
|
+
});
|
|
25
33
|
const previousEscape = mustache_1.default.escape;
|
|
26
34
|
mustache_1.default.escape = (value) => value; // no HTML escaping — URLs and ${{…}} refs pass through
|
|
27
35
|
let rendered;
|
|
@@ -39,7 +47,8 @@ function renderMustache(template, renderVars) {
|
|
|
39
47
|
mustache_1.default.escape = previousEscape;
|
|
40
48
|
}
|
|
41
49
|
// Restore protected producer-less tokens verbatim.
|
|
42
|
-
const
|
|
50
|
+
const restoredMissing = rendered.replace(SENTINEL_TOKEN, (_match, name) => `{{${name}}}`);
|
|
51
|
+
const result = restoredMissing.replace(VALUE_SENTINEL_TOKEN, (_match, name) => String(renderVars[name]));
|
|
43
52
|
return (0, neverthrow_1.ok)(result);
|
|
44
53
|
}
|
|
45
54
|
//# sourceMappingURL=renderMustache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderMustache.js","sourceRoot":"","sources":["../../../src/v4/runtime/renderMustache.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"renderMustache.js","sourceRoot":"","sources":["../../../src/v4/runtime/renderMustache.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2BlC,wCAqCC;;AA9DD,wDAA8D;AAC9D,gEAAgC;AAChC,2CAA6C;AAG7C,8EAA8E;AAE9E,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,sFAAsF;AACzE,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,MAAM,UAAU,GAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAElD,0EAA0E;AAC1E,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AACrC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAEtC,+EAA+E;AAC/E,MAAM,WAAW,GAAG,uEAAuE,CAAC;AAC5F,MAAM,cAAc,GAAG,2BAA2B,CAAC;AACnD,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEzD,SAAgB,cAAc,CAAC,QAAgB,EAAE,UAAsB;IACrE,yFAAyF;IACzF,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;QAC5E,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,C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E,EAAC,MAAM,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ExpressionRuntimePort } from "../expression/evaluateExpression";
|
|
2
2
|
import { ManifestWrapper, PipelineRuntimePort, RegisteredStep } from "../pipeline/runScaffoldPipeline";
|
|
3
|
+
import { GeneralSensitivityLabelService } from "./steps/daSensitivity";
|
|
3
4
|
/** Shared v4 pipeline registry and port factory. See ADR-0017 for whitelist rules. */
|
|
4
5
|
/** The orchestration names the engine knows (ADR-0017 closed whitelist). */
|
|
5
6
|
export declare const KNOWN_PIPELINES: Set<string>;
|
|
6
|
-
/**
|
|
7
|
-
export
|
|
7
|
+
/** Generic named-step lookup assembled at a runtime composition boundary. */
|
|
8
|
+
export type StepRegistry = ReadonlyMap<string, RegisteredStep>;
|
|
9
|
+
/** Bind runtime-owned business adapters into the closed post-render step whitelist. */
|
|
10
|
+
export declare function createStepRegistry(generalSensitivityLabel?: GeneralSensitivityLabelService): StepRegistry;
|
|
11
|
+
/** Default post-render step whitelist for offline runtimes and compatibility tests. */
|
|
12
|
+
export declare const STEP_REGISTRY: StepRegistry;
|
|
8
13
|
/** No-op wrapper for create flows that do not mutate a manifest. */
|
|
9
14
|
export declare const NOOP_MANIFEST_WRAPPER: ManifestWrapper;
|
|
10
15
|
/** Runtime-specific file sink injected behind the shared pipeline port. */
|
|
@@ -15,5 +20,5 @@ export interface FileSink {
|
|
|
15
20
|
read(path: string): Buffer | undefined;
|
|
16
21
|
}
|
|
17
22
|
/** Build the shared pipeline port over an injected file sink. */
|
|
18
|
-
export declare function buildPipelinePort(exprPort: ExpressionRuntimePort, sink: FileSink): PipelineRuntimePort;
|
|
23
|
+
export declare function buildPipelinePort(exprPort: ExpressionRuntimePort, sink: FileSink, stepRegistry?: StepRegistry, warningSink?: (message: string) => void): PipelineRuntimePort;
|
|
19
24
|
//# sourceMappingURL=runtimeRegistry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRegistry.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/runtimeRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtimeRegistry.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/runtimeRegistry.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,qBAAqB,EAA6B,MAAM,kCAAkC,CAAC;AACpG,OAAO,EACL,eAAe,EAEf,mBAAmB,EACnB,cAAc,EACf,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,8BAA8B,EAI/B,MAAM,uBAAuB,CAAC;AAyB/B,sFAAsF;AAEtF,4EAA4E;AAC5E,eAAO,MAAM,eAAe,aAAqE,CAAC;AAElG,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE/D,uFAAuF;AACvF,wBAAgB,kBAAkB,CAChC,uBAAuB,GAAE,8BAAuE,GAC/F,YAAY,CAcd;AAED,uFAAuF;AACvF,eAAO,MAAM,aAAa,cAAuB,CAAC;AAElD,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,EAAE,eAQnC,CAAC;AA8JF,2EAA2E;AAC3E,MAAM,WAAW,QAAQ;IACvB,wEAAwE;IACxE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,8EAA8E;IAC9E,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACxC;AAcD,iEAAiE;AACjE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,EAAE,QAAQ,EACd,YAAY,GAAE,YAA4B,EAC1C,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACtC,mBAAmB,CAgBrB"}
|
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.NOOP_MANIFEST_WRAPPER = exports.STEP_REGISTRY = exports.KNOWN_PIPELINES = void 0;
|
|
6
|
+
exports.createStepRegistry = createStepRegistry;
|
|
6
7
|
exports.buildPipelinePort = buildPipelinePort;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
10
|
+
const neverthrow_1 = require("neverthrow");
|
|
11
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
12
|
const evaluateExpression_1 = require("../expression/evaluateExpression");
|
|
8
13
|
const renderMustache_1 = require("./renderMustache");
|
|
9
14
|
const daAction_1 = require("./steps/daAction");
|
|
15
|
+
const daSensitivity_1 = require("./steps/daSensitivity");
|
|
10
16
|
const mcpAuth_1 = require("./steps/mcpAuth");
|
|
11
17
|
const mcpLocal_1 = require("./steps/mcpLocal");
|
|
12
18
|
const mcpStatic_1 = require("./steps/mcpStatic");
|
|
@@ -16,23 +22,121 @@ const metaOs_1 = require("./steps/metaOs");
|
|
|
16
22
|
/** Shared v4 pipeline registry and port factory. See ADR-0017 for whitelist rules. */
|
|
17
23
|
/** The orchestration names the engine knows (ADR-0017 closed whitelist). */
|
|
18
24
|
exports.KNOWN_PIPELINES = new Set(["default", "openapi", "typespec", "officeAddin", "spfx"]);
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
[
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
25
|
+
/** Bind runtime-owned business adapters into the closed post-render step whitelist. */
|
|
26
|
+
function createStepRegistry(generalSensitivityLabel = daSensitivity_1.NOOP_GENERAL_SENSITIVITY_LABEL_SERVICE) {
|
|
27
|
+
return new Map([
|
|
28
|
+
[daAction_1.STEP_REGISTER_PLUGIN_MANIFEST, daAction_1.daActionRegisterPluginManifest],
|
|
29
|
+
[daSensitivity_1.STEP_SET_SENSITIVITY_LABEL, (0, daSensitivity_1.createDaSetSensitivityLabelStep)(generalSensitivityLabel)],
|
|
30
|
+
[mcpAuth_1.STEP_INJECT_YML_ACTION, mcpAuth_1.mcpAuthInjectYmlAction],
|
|
31
|
+
[mcpAuth_1.STEP_PERSIST_CREDENTIAL_ENV, mcpAuth_1.mcpAuthPersistCredentialEnv],
|
|
32
|
+
[mcpLocal_1.STEP_MATERIALIZE_LOCAL_SERVERS, mcpLocal_1.mcpLocalMaterializeServers],
|
|
33
|
+
[mcpStatic_1.STEP_MATERIALIZE_STATIC_MCP_TOOLS, mcpStatic_1.mcpStaticMaterializeTools],
|
|
34
|
+
[openApi_1.STEP_GENERATE_OPENAPI_PLUGIN_FILES, openApi_1.openApiGeneratePluginFiles],
|
|
35
|
+
[openApi_1.STEP_GENERATE_TEAMS_AI_CUSTOM_API_FILES, openApi_1.openApiGenerateTeamsAiCustomApiFiles],
|
|
36
|
+
[officeAddin_1.STEP_IMPORT_EXISTING_OFFICE_ADDIN_PROJECT, officeAddin_1.officeAddinImportExistingProject],
|
|
37
|
+
[metaOs_1.STEP_UNIFY_PROJECT_ID, metaOs_1.metaOsUnifyProjectId],
|
|
38
|
+
[metaOs_1.STEP_UPGRADE_EXISTING_PROJECT, metaOs_1.metaOsUpgradeExistingProject],
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
/** Default post-render step whitelist for offline runtimes and compatibility tests. */
|
|
42
|
+
exports.STEP_REGISTRY = createStepRegistry();
|
|
32
43
|
/** No-op wrapper for create flows that do not mutate a manifest. */
|
|
33
44
|
exports.NOOP_MANIFEST_WRAPPER = {
|
|
34
|
-
|
|
45
|
+
registerDeclarativeAgentAction: () => (0, neverthrow_1.err)(manifestError("ManifestMutationUnavailable", "the current runtime does not provide manifest mutation")),
|
|
35
46
|
};
|
|
47
|
+
function manifestError(name, message, cause) {
|
|
48
|
+
return cause instanceof Error
|
|
49
|
+
? new teamsfx_api_1.SystemError({ source: "Scaffold", name, message, error: cause })
|
|
50
|
+
: new teamsfx_api_1.SystemError({ source: "Scaffold", name, message });
|
|
51
|
+
}
|
|
52
|
+
function normalizeTargetPath(entryPath) {
|
|
53
|
+
return entryPath.replace(/\\/g, "/");
|
|
54
|
+
}
|
|
55
|
+
function resolveSiblingPath(baseFile, relativeFile) {
|
|
56
|
+
return normalizeTargetPath(path_1.default.posix.normalize(path_1.default.posix.join(path_1.default.posix.dirname(baseFile), relativeFile)));
|
|
57
|
+
}
|
|
58
|
+
function pluginFileRelativeToAgent(agentManifestPath, pluginManifestPath) {
|
|
59
|
+
return normalizeTargetPath(path_1.default.posix.relative(path_1.default.posix.dirname(agentManifestPath), pluginManifestPath));
|
|
60
|
+
}
|
|
61
|
+
function actionId(pluginManifestPath) {
|
|
62
|
+
const basename = path_1.default.posix.basename(pluginManifestPath, path_1.default.posix.extname(pluginManifestPath));
|
|
63
|
+
return basename.startsWith("ai-plugin-") ? basename.substring("ai-plugin-".length) : basename;
|
|
64
|
+
}
|
|
65
|
+
function readManifest(sink, filePath, missingErrorName, readErrorName) {
|
|
66
|
+
try {
|
|
67
|
+
const contents = sink.read(filePath);
|
|
68
|
+
return contents === undefined
|
|
69
|
+
? (0, neverthrow_1.err)(manifestError(missingErrorName, `Cannot read '${filePath}'.`))
|
|
70
|
+
: (0, neverthrow_1.ok)(contents);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return (0, neverthrow_1.err)(manifestError(readErrorName, `Cannot read '${filePath}'.`, error));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function registerDeclarativeAgentAction(sink, teamsManifestPath, pluginManifestPath) {
|
|
77
|
+
const teamsManifestContents = readManifest(sink, teamsManifestPath, "DaActionTeamsManifestMissing", "DaActionTeamsManifestReadFailed");
|
|
78
|
+
if (teamsManifestContents.isErr()) {
|
|
79
|
+
return (0, neverthrow_1.err)(teamsManifestContents.error);
|
|
80
|
+
}
|
|
81
|
+
let teamsManifest;
|
|
82
|
+
try {
|
|
83
|
+
teamsManifest = teamsfx_api_1.TeamsManifestWrapper.fromJSON(teamsManifestContents.value.toString("utf8"));
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return (0, neverthrow_1.err)(manifestError("DaActionTeamsManifestInvalid", `'${teamsManifestPath}' is not valid JSON.`));
|
|
87
|
+
}
|
|
88
|
+
const agentFile = teamsManifest.getDeclarativeAgentPaths()[0];
|
|
89
|
+
if (agentFile === undefined) {
|
|
90
|
+
return (0, neverthrow_1.err)(manifestError("DaActionManifestFileMissing", `The Teams manifest '${teamsManifestPath}' does not reference a declarative agent manifest.`));
|
|
91
|
+
}
|
|
92
|
+
const agentManifestPath = resolveSiblingPath(teamsManifestPath, agentFile);
|
|
93
|
+
const agentManifestContents = readManifest(sink, agentManifestPath, "DaActionManifestMissing", "DaActionManifestReadFailed");
|
|
94
|
+
if (agentManifestContents.isErr()) {
|
|
95
|
+
return (0, neverthrow_1.err)(agentManifestContents.error);
|
|
96
|
+
}
|
|
97
|
+
let agentManifest;
|
|
98
|
+
try {
|
|
99
|
+
agentManifest = teamsfx_api_1.DeclarativeAgentManifestWrapper.fromJSON(agentManifestContents.value.toString("utf8"));
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return (0, neverthrow_1.err)(manifestError("DaActionManifestInvalid", `'${agentManifestPath}' is not valid JSON.`));
|
|
103
|
+
}
|
|
104
|
+
agentManifest.upsertAction(actionId(pluginManifestPath), pluginFileRelativeToAgent(agentManifestPath, pluginManifestPath));
|
|
105
|
+
try {
|
|
106
|
+
sink.write(agentManifestPath, Buffer.from(agentManifest.toJSON(), "utf8"));
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return (0, neverthrow_1.err)(manifestError("DaActionManifestWriteFailed", `Cannot write '${agentManifestPath}'.`, error));
|
|
110
|
+
}
|
|
111
|
+
return (0, neverthrow_1.ok)(undefined);
|
|
112
|
+
}
|
|
113
|
+
function buildManifestWrapper(sink) {
|
|
114
|
+
return {
|
|
115
|
+
registerDeclarativeAgentAction: (teamsManifestPath, pluginManifestPath) => registerDeclarativeAgentAction(sink, teamsManifestPath, pluginManifestPath),
|
|
116
|
+
setSensitivityLabel: (manifestPath, id) => {
|
|
117
|
+
const contents = readManifest(sink, manifestPath, "DaSensitivityLabelManifestMissing", "DaSensitivityLabelManifestReadFailed");
|
|
118
|
+
if (contents.isErr()) {
|
|
119
|
+
return (0, neverthrow_1.err)(contents.error);
|
|
120
|
+
}
|
|
121
|
+
let serialized;
|
|
122
|
+
try {
|
|
123
|
+
const wrapper = teamsfx_api_1.DeclarativeAgentManifestWrapper.fromJSON(contents.value.toString("utf8"));
|
|
124
|
+
wrapper.setSensitivityLabel(id);
|
|
125
|
+
serialized = Buffer.from(wrapper.toJSON(), "utf8");
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return (0, neverthrow_1.err)(manifestError("DaSensitivityLabelManifestInvalid", "the Declarative Agent manifest to label is invalid", error));
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
sink.write(manifestPath, serialized);
|
|
132
|
+
return (0, neverthrow_1.ok)(undefined);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
return (0, neverthrow_1.err)(manifestError("DaSensitivityLabelManifestWriteFailed", `Cannot write '${manifestPath}'.`, error));
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
36
140
|
/** Drop list-valued render vars before calling the scalar expression evaluator. */
|
|
37
141
|
function scalarScope(renderVars) {
|
|
38
142
|
const scope = {};
|
|
@@ -45,13 +149,14 @@ function scalarScope(renderVars) {
|
|
|
45
149
|
return scope;
|
|
46
150
|
}
|
|
47
151
|
/** Build the shared pipeline port over an injected file sink. */
|
|
48
|
-
function buildPipelinePort(exprPort, sink) {
|
|
152
|
+
function buildPipelinePort(exprPort, sink, stepRegistry = exports.STEP_REGISTRY, warningSink) {
|
|
49
153
|
return {
|
|
50
154
|
pipelineRegistry: (name) => exports.KNOWN_PIPELINES.has(name) ? { name } : undefined,
|
|
51
|
-
stepRegistry: (name) =>
|
|
155
|
+
stepRegistry: (name) => stepRegistry.get(name),
|
|
52
156
|
evalWhen: (expr, renderVars) => (0, evaluateExpression_1.evaluateExpression)({ expr }, scalarScope(renderVars), exprPort).map((value) => value === true),
|
|
53
157
|
render: (mustache, renderVars) => (0, renderMustache_1.renderMustache)(mustache, renderVars),
|
|
54
|
-
manifestWrapper: () =>
|
|
158
|
+
manifestWrapper: () => buildManifestWrapper(sink),
|
|
159
|
+
warn: warningSink,
|
|
55
160
|
write: (path, data) => sink.write(path, data),
|
|
56
161
|
read: (path) => sink.read(path),
|
|
57
162
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRegistry.js","sourceRoot":"","sources":["../../../src/v4/runtime/runtimeRegistry.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"runtimeRegistry.js","sourceRoot":"","sources":["../../../src/v4/runtime/runtimeRegistry.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2DlC,gDAgBC;AAiMD,8CAqBC;;AA/RD,wDAKgC;AAChC,2CAA6C;AAC7C,wDAAwB;AAExB,yEAAoG;AAOpG,qDAAkD;AAClD,+CAAiG;AACjG,yDAK+B;AAC/B,6CAKyB;AACzB,+CAA8F;AAC9F,iDAAiG;AACjG,qDAG6B;AAC7B,6CAKyB;AACzB,2CAKwB;AACxB,sFAAsF;AAEtF,4EAA4E;AAC/D,QAAA,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;AAKlG,uFAAuF;AACvF,SAAgB,kBAAkB,CAChC,0BAA0D,sDAAsC;IAEhG,OAAO,IAAI,GAAG,CAAyB;QACrC,CAAC,wCAA6B,E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Y,EAAE,CAAC,IAAY,EAA8B,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;QAClF,QAAQ,EAAE,CAAC,IAAY,EAAE,UAAsB,EAA4B,EAAE,CAC3E,IAAA,uCAAkB,EAAC,EAAE,IAAI,EAAE,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CACjE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAC1B;QACH,MAAM,EAAE,CAAC,QAAgB,EAAE,UAAsB,EAA2B,EAAE,CAC5E,IAAA,+BAAc,EAAC,QAAQ,EAAE,UAAU,CAAC;QACtC,eAAe,EAAE,GAAoB,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;QAClE,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,CAAC,IAAY,EAAE,IAAY,EAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;QACnE,IAAI,EAAE,CAAC,IAAY,EAAsB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { Result } from "neverthrow";
|
|
|
3
3
|
import { Answers, CallerFloor, TemplateFileEntry } from "../model/dataModel";
|
|
4
4
|
import { ExpressionRuntimePort } from "../expression/evaluateExpression";
|
|
5
5
|
import { PipelineRuntimePort, ScaffoldOutcome, TargetDir } from "../pipeline/runScaffoldPipeline";
|
|
6
|
+
/** v4 scaffold composition over an injected runtime. See create-mcp-server spec. */
|
|
6
7
|
/** The two ports `scaffold` composes. */
|
|
7
8
|
export interface ScaffoldRuntime {
|
|
8
9
|
/** The pure expression port (whitelist + flags) for `{expr}` render-var derivation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,O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xB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CA8B3C"}
|
|
@@ -8,24 +8,6 @@ const buildRenderContext_1 = require("../renderContext/buildRenderContext");
|
|
|
8
8
|
const runScaffoldPipeline_1 = require("../pipeline/runScaffoldPipeline");
|
|
9
9
|
const packageParse_1 = require("./packageParse");
|
|
10
10
|
const selectLanguageContent_1 = require("./selectLanguageContent");
|
|
11
|
-
/** v4 scaffold composition over an injected runtime. See create-mcp-server spec. */
|
|
12
|
-
const SANDBOXED_TEAM_FLAG = "TEAMSFX_SANDBOXED_TEAM";
|
|
13
|
-
const sandboxFileNames = new Set([
|
|
14
|
-
"teamsapp.sandbox.yml.tpl",
|
|
15
|
-
"m365agents.sandbox.yml.tpl",
|
|
16
|
-
".env.sandbox",
|
|
17
|
-
".env.sandbox.user.tpl",
|
|
18
|
-
]);
|
|
19
|
-
function filterSandboxContent(content, runtime) {
|
|
20
|
-
if (runtime.exprPort.flags(SANDBOXED_TEAM_FLAG)) {
|
|
21
|
-
return content;
|
|
22
|
-
}
|
|
23
|
-
return content.filter((entry) => {
|
|
24
|
-
const normalizedPath = entry.path.replace(/\\/g, "/");
|
|
25
|
-
const fileName = normalizedPath.slice(normalizedPath.lastIndexOf("/") + 1);
|
|
26
|
-
return !sandboxFileNames.has(fileName);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
11
|
/** Scaffold one template package against an injected runtime. */
|
|
30
12
|
async function scaffold(request, runtime) {
|
|
31
13
|
const replaceMap = (0, packageParse_1.parseReplaceMap)(request.descriptor);
|
|
@@ -46,8 +28,7 @@ async function scaffold(request, runtime) {
|
|
|
46
28
|
const renderVars = { ...baseVars.value, ...request.callerFloor };
|
|
47
29
|
// Select the active language subtree before render.
|
|
48
30
|
const language = request.callerFloor.language || selectLanguageContent_1.COMMON_LANGUAGE;
|
|
49
|
-
const
|
|
50
|
-
const content = filterSandboxContent(selectedContent, runtime);
|
|
31
|
+
const content = (0, selectLanguageContent_1.selectLanguageContent)(request.descriptor, request.content, language);
|
|
51
32
|
return (0, runScaffoldPipeline_1.runScaffoldPipeline)(pipeline.value, content, renderVars, request.targetDir, runtime.port);
|
|
52
33
|
}
|
|
53
34
|
//# sourceMappingURL=scaffold.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2ClC,4BAiCC;AAzED,2CAAyC;AAGzC,4EAAyE;AACzE,yEAKyC;AACzC,iDAAmF;AACnF,mEAAiF;AA4BjF,iEAAiE;AAC1D,KAAK,UAAU,QAAQ,CAC5B,OAAwB,EACxB,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,8BAAe,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvD,IAAI,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;QACvB,OAAO,IAAA,gBAAG,EAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,QAAQ,GAAG,IAAA,4BAAa,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,IAAA,gBAAG,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,iFAAiF;IACjF,MAAM,YAAY,GAAG,IAAA,gCAAiB,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,IAAA,uCAAkB,EACjC,UAAU,CAAC,KAAK,EAChB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,QAAQ,EAChB,YAAY,CACb,CAAC;IACF,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,IAAA,gBAAG,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,sFAAsF;IACtF,MAAM,UAAU,GAAG,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEjE,oDAAoD;IACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,IAAI,uCAAe,CAAC;IACjE,MAAM,OAAO,GAAG,IAAA,6CAAqB,EAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAErF,OAAO,IAAA,yCAAmB,EAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daAction.d.ts","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/daAction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daAction.d.ts","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/daAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAA2B,MAAM,oCAAoC,CAAC;AAM7F,6DAA6D;AAC7D,eAAO,MAAM,6BAA6B,uCAAuC,CAAC;AAWlF,gFAAgF;AAChF,eAAO,MAAM,8BAA8B,EAAE,cAqB5C,CAAC"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.daActionRegisterPluginManifest = exports.STEP_REGISTER_PLUGIN_MANIFEST = void 0;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
7
|
const neverthrow_1 = require("neverthrow");
|
|
10
8
|
/** Declarative Agent manifest mutation steps for modify flows. */
|
|
11
9
|
const SOURCE = "Scaffold";
|
|
@@ -18,88 +16,6 @@ function stringParam(params, key) {
|
|
|
18
16
|
const value = params[key];
|
|
19
17
|
return typeof value === "string" ? value : undefined;
|
|
20
18
|
}
|
|
21
|
-
function isRecord(value) {
|
|
22
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23
|
-
}
|
|
24
|
-
function isAction(value) {
|
|
25
|
-
return (isRecord(value) &&
|
|
26
|
-
typeof value.id === "string" &&
|
|
27
|
-
typeof value.file === "string" &&
|
|
28
|
-
Object.values(value).every((item) => typeof item === "string"));
|
|
29
|
-
}
|
|
30
|
-
function parseJsonObject(json, errorName, filePath) {
|
|
31
|
-
let parsed;
|
|
32
|
-
try {
|
|
33
|
-
parsed = JSON.parse(json.toString("utf8"));
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return (0, neverthrow_1.err)(systemError(errorName, `'${filePath}' is not valid JSON.`));
|
|
37
|
-
}
|
|
38
|
-
if (!isRecord(parsed)) {
|
|
39
|
-
return (0, neverthrow_1.err)(systemError(errorName, `'${filePath}' must be a JSON object.`));
|
|
40
|
-
}
|
|
41
|
-
return (0, neverthrow_1.ok)(parsed);
|
|
42
|
-
}
|
|
43
|
-
function firstFileFromArray(value) {
|
|
44
|
-
if (!Array.isArray(value)) {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
const first = value[0];
|
|
48
|
-
return isRecord(first) && typeof first.file === "string" ? first.file : undefined;
|
|
49
|
-
}
|
|
50
|
-
function nestedRecord(value, key) {
|
|
51
|
-
if (!isRecord(value)) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
const nested = value[key];
|
|
55
|
-
return isRecord(nested) ? nested : undefined;
|
|
56
|
-
}
|
|
57
|
-
function declarativeAgentFile(teamsManifest) {
|
|
58
|
-
const copilotExtensions = nestedRecord(teamsManifest, "copilotExtensions");
|
|
59
|
-
const legacy = firstFileFromArray(copilotExtensions?.declarativeCopilots);
|
|
60
|
-
if (legacy !== undefined) {
|
|
61
|
-
return legacy;
|
|
62
|
-
}
|
|
63
|
-
const copilotAgents = nestedRecord(teamsManifest, "copilotAgents");
|
|
64
|
-
const current = firstFileFromArray(copilotAgents?.declarativeAgents);
|
|
65
|
-
if (current !== undefined) {
|
|
66
|
-
return current;
|
|
67
|
-
}
|
|
68
|
-
return firstFileFromArray(teamsManifest.declarativeAgents);
|
|
69
|
-
}
|
|
70
|
-
function normalizeTargetPath(entryPath) {
|
|
71
|
-
return entryPath.replace(/\\/g, "/");
|
|
72
|
-
}
|
|
73
|
-
function resolveSiblingPath(baseFile, relativeFile) {
|
|
74
|
-
return normalizeTargetPath(path_1.default.posix.normalize(path_1.default.posix.join(path_1.default.posix.dirname(baseFile), relativeFile)));
|
|
75
|
-
}
|
|
76
|
-
function pluginFileRelativeToAgent(agentManifestPath, pluginManifestPath) {
|
|
77
|
-
return normalizeTargetPath(path_1.default.posix.relative(path_1.default.posix.dirname(agentManifestPath), pluginManifestPath));
|
|
78
|
-
}
|
|
79
|
-
function actionId(pluginManifestPath) {
|
|
80
|
-
const basename = path_1.default.posix.basename(pluginManifestPath, path_1.default.posix.extname(pluginManifestPath));
|
|
81
|
-
return basename.startsWith("ai-plugin-") ? basename.substring("ai-plugin-".length) : basename;
|
|
82
|
-
}
|
|
83
|
-
function upsertAction(manifest, action) {
|
|
84
|
-
const existing = manifest.actions;
|
|
85
|
-
const actions = Array.isArray(existing) ? existing.filter(isAction) : [];
|
|
86
|
-
const index = actions.findIndex((item) => item.file === action.file);
|
|
87
|
-
if (index === -1) {
|
|
88
|
-
actions.push(action);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
actions[index] = action;
|
|
92
|
-
}
|
|
93
|
-
manifest.actions = actions;
|
|
94
|
-
return actions;
|
|
95
|
-
}
|
|
96
|
-
function readRequired(ctx, filePath, errorName) {
|
|
97
|
-
const current = ctx.read(filePath);
|
|
98
|
-
if (current === undefined) {
|
|
99
|
-
return (0, neverthrow_1.err)(systemError(errorName, `Cannot read '${filePath}'.`));
|
|
100
|
-
}
|
|
101
|
-
return (0, neverthrow_1.ok)(current);
|
|
102
|
-
}
|
|
103
19
|
/** Registered step for adding a rendered API plugin manifest as a DA action. */
|
|
104
20
|
exports.daActionRegisterPluginManifest = {
|
|
105
21
|
validateParams(resolved) {
|
|
@@ -117,33 +33,9 @@ exports.daActionRegisterPluginManifest = {
|
|
|
117
33
|
if (teamsManifestPath === undefined || pluginManifestPath === undefined) {
|
|
118
34
|
return (0, neverthrow_1.err)(systemError("DaActionRegisterParams", "resolved parameters are not all strings"));
|
|
119
35
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
const teamsManifest = parseJsonObject(teamsManifestRaw.value, "DaActionTeamsManifestInvalid", teamsManifestPath);
|
|
125
|
-
if (teamsManifest.isErr()) {
|
|
126
|
-
return (0, neverthrow_1.err)(teamsManifest.error);
|
|
127
|
-
}
|
|
128
|
-
const agentFile = declarativeAgentFile(teamsManifest.value);
|
|
129
|
-
if (agentFile === undefined) {
|
|
130
|
-
return (0, neverthrow_1.err)(systemError("DaActionManifestFileMissing", `The Teams manifest '${teamsManifestPath}' does not reference a declarative agent manifest.`));
|
|
131
|
-
}
|
|
132
|
-
const agentManifestPath = resolveSiblingPath(teamsManifestPath, agentFile);
|
|
133
|
-
const agentManifestRaw = readRequired(ctx, agentManifestPath, "DaActionManifestMissing");
|
|
134
|
-
if (agentManifestRaw.isErr()) {
|
|
135
|
-
return (0, neverthrow_1.err)(agentManifestRaw.error);
|
|
136
|
-
}
|
|
137
|
-
const agentManifest = parseJsonObject(agentManifestRaw.value, "DaActionManifestInvalid", agentManifestPath);
|
|
138
|
-
if (agentManifest.isErr()) {
|
|
139
|
-
return (0, neverthrow_1.err)(agentManifest.error);
|
|
140
|
-
}
|
|
141
|
-
upsertAction(agentManifest.value, {
|
|
142
|
-
id: actionId(pluginManifestPath),
|
|
143
|
-
file: pluginFileRelativeToAgent(agentManifestPath, pluginManifestPath),
|
|
144
|
-
});
|
|
145
|
-
ctx.write(agentManifestPath, Buffer.from(JSON.stringify(agentManifest.value, null, 2) + "\n", "utf8"));
|
|
146
|
-
return (0, neverthrow_1.ok)(undefined);
|
|
36
|
+
return ctx
|
|
37
|
+
.manifestWrapper("declarativeAgent")
|
|
38
|
+
.registerDeclarativeAgentAction(teamsManifestPath, pluginManifestPath);
|
|
147
39
|
},
|
|
148
40
|
};
|
|
149
41
|
//# sourceMappingURL=daAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daAction.js","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/daAction.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC
|
|
1
|
+
{"version":3,"file":"daAction.js","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/daAction.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAA8D;AAC9D,2CAAyC;AAGzC,kEAAkE;AAElE,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,6DAA6D;AAChD,QAAA,6BAA6B,GAAG,oCAAoC,CAAC;AAElF,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,OAAO,IAAI,yBAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,WAAW,CAAC,MAAkB,EAAE,GAAW;IAClD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,gFAAgF;AACnE,QAAA,8BAA8B,GAAmB;IAC5D,cAAc,CAAC,QAAoB;QACjC,IAAI,WAAW,CAAC,QAAQ,EAAE,mBAAmB,CAAC,KAAK,SAAS,EAAE,CAAC;YAC7D,OAAO,8CAA8C,CAAC;QACxD,CAAC;QACD,IAAI,WAAW,CAAC,QAAQ,EAAE,oBAAoB,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9D,OAAO,+CAA+C,CAAC;QACzD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,KAAK,CAAC,QAAoB,EAAE,GAAgB;QAC1C,MAAM,iBAAiB,GAAG,WAAW,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;QACrE,MAAM,kBAAkB,GAAG,WAAW,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QACvE,IAAI,iBAAiB,KAAK,SAAS,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACxE,OAAO,IAAA,gBAAG,EAAC,WAAW,CAAC,wBAAwB,EAAE,yCAAyC,CAAC,CAAC,CAAC;QAC/F,CAAC;QAED,OAAO,GAAG;aACP,eAAe,CAAC,kBAAkB,CAAC;aACnC,8BAA8B,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IAC3E,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RegisteredStep } from "../../pipeline/runScaffoldPipeline";
|
|
2
|
+
/** Engine step name `da/set-sensitivity-label`. */
|
|
3
|
+
export declare const STEP_SET_SENSITIVITY_LABEL = "da/set-sensitivity-label";
|
|
4
|
+
/** Best-effort service used by the sensitivity-label step. */
|
|
5
|
+
export interface GeneralSensitivityLabelService {
|
|
6
|
+
resolveId(): Promise<string | undefined>;
|
|
7
|
+
}
|
|
8
|
+
/** Offline/default service used when no authenticated M365 adapter is registered. */
|
|
9
|
+
export declare const NOOP_GENERAL_SENSITIVITY_LABEL_SERVICE: GeneralSensitivityLabelService;
|
|
10
|
+
/** Bind the General-label lookup dependency into its registered step. */
|
|
11
|
+
export declare function createDaSetSensitivityLabelStep(generalSensitivityLabel: GeneralSensitivityLabelService): RegisteredStep;
|
|
12
|
+
/** Default step binding for offline runtimes and compatibility consumers. */
|
|
13
|
+
export declare const daSetSensitivityLabel: RegisteredStep;
|
|
14
|
+
//# sourceMappingURL=daSensitivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daSensitivity.d.ts","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/daSensitivity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAA2B,MAAM,oCAAoC,CAAC;AAI7F,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AAWrE,8DAA8D;AAC9D,MAAM,WAAW,8BAA8B;IAC7C,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAED,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,8BAEpD,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,+BAA+B,CAC7C,uBAAuB,EAAE,8BAA8B,GACtD,cAAc,CAgChB;AAED,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,gBAEjC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.daSetSensitivityLabel = exports.NOOP_GENERAL_SENSITIVITY_LABEL_SERVICE = exports.STEP_SET_SENSITIVITY_LABEL = void 0;
|
|
6
|
+
exports.createDaSetSensitivityLabelStep = createDaSetSensitivityLabelStep;
|
|
7
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
|
+
const neverthrow_1 = require("neverthrow");
|
|
9
|
+
const SOURCE = "Scaffold";
|
|
10
|
+
/** Engine step name `da/set-sensitivity-label`. */
|
|
11
|
+
exports.STEP_SET_SENSITIVITY_LABEL = "da/set-sensitivity-label";
|
|
12
|
+
function systemError(name, message) {
|
|
13
|
+
return new teamsfx_api_1.SystemError({ source: SOURCE, name, message });
|
|
14
|
+
}
|
|
15
|
+
function manifestPath(params) {
|
|
16
|
+
const value = params.manifestPath;
|
|
17
|
+
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Offline/default service used when no authenticated M365 adapter is registered. */
|
|
20
|
+
exports.NOOP_GENERAL_SENSITIVITY_LABEL_SERVICE = {
|
|
21
|
+
resolveId: () => Promise.resolve(undefined),
|
|
22
|
+
};
|
|
23
|
+
/** Bind the General-label lookup dependency into its registered step. */
|
|
24
|
+
function createDaSetSensitivityLabelStep(generalSensitivityLabel) {
|
|
25
|
+
return {
|
|
26
|
+
validateParams(resolved) {
|
|
27
|
+
return manifestPath(resolved) === undefined
|
|
28
|
+
? "missing non-empty string parameter 'manifestPath'"
|
|
29
|
+
: undefined;
|
|
30
|
+
},
|
|
31
|
+
async apply(resolved, ctx) {
|
|
32
|
+
const path = manifestPath(resolved);
|
|
33
|
+
if (path === undefined) {
|
|
34
|
+
return (0, neverthrow_1.err)(systemError("DaSensitivityLabelParams", "resolved manifestPath is not a non-empty string"));
|
|
35
|
+
}
|
|
36
|
+
const id = await generalSensitivityLabel.resolveId();
|
|
37
|
+
if (id === undefined) {
|
|
38
|
+
return (0, neverthrow_1.ok)(undefined);
|
|
39
|
+
}
|
|
40
|
+
const wrapper = ctx.manifestWrapper("declarativeAgent");
|
|
41
|
+
if (wrapper.setSensitivityLabel === undefined) {
|
|
42
|
+
return (0, neverthrow_1.err)(systemError("DaSensitivityLabelWrapperMissing", "the Declarative Agent manifest wrapper cannot set a sensitivity label"));
|
|
43
|
+
}
|
|
44
|
+
return wrapper.setSensitivityLabel(path, id);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Default step binding for offline runtimes and compatibility consumers. */
|
|
49
|
+
exports.daSetSensitivityLabel = createDaSetSensitivityLabelStep(exports.NOOP_GENERAL_SENSITIVITY_LABEL_SERVICE);
|
|
50
|
+
//# sourceMappingURL=daSensitivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daSensitivity.js","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/daSensitivity.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA+BlC,0EAkCC;AA/DD,wDAA8D;AAC9D,2CAA6C;AAG7C,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,mDAAmD;AACtC,QAAA,0BAA0B,GAAG,0BAA0B,CAAC;AAErE,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,OAAO,IAAI,yBAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,YAAY,CAAC,MAAkB;IACtC,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC;AAOD,qFAAqF;AACxE,QAAA,sCAAsC,GAAmC;IACpF,SAAS,EAAE,GAAuB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;CAChE,CAAC;AAEF,yEAAyE;AACzE,SAAgB,+BAA+B,CAC7C,uBAAuD;IAEvD,OAAO;QACL,cAAc,CAAC,QAAoB;YACjC,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,SAAS;gBACzC,CAAC,CAAC,mDAAmD;gBACrD,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,QAAoB,EAAE,GAAgB;YAChD,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,IAAA,gBAAG,EACR,WAAW,CAAC,0BAA0B,EAAE,iDAAiD,CAAC,CAC3F,CAAC;YACJ,CAAC;YAED,MAAM,EAAE,GAAG,MAAM,uBAAuB,CAAC,SAAS,EAAE,CAAC;YACrD,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;gBACrB,OAAO,IAAA,eAAE,EAAC,SAAS,CAAC,CAAC;YACvB,CAAC;YAED,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YACxD,IAAI,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;gBAC9C,OAAO,IAAA,gBAAG,EACR,WAAW,CACT,kCAAkC,EAClC,uEAAuE,CACxE,CACF,CAAC;YACJ,CAAC;YACD,OAAO,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC;AAED,6EAA6E;AAChE,QAAA,qBAAqB,GAAG,+BAA+B,CAClE,8CAAsC,CACvC,CAAC"}
|
|
@@ -3,8 +3,11 @@ import { RegisteredStep } from "../../pipeline/runScaffoldPipeline";
|
|
|
3
3
|
export declare const STEP_INJECT_YML_ACTION = "mcp-auth/inject-yml-action";
|
|
4
4
|
/** Engine step name `mcp-auth/persist-credential-env`. */
|
|
5
5
|
export declare const STEP_PERSIST_CREDENTIAL_ENV = "mcp-auth/persist-credential-env";
|
|
6
|
-
/** Registered step for injecting the auth
|
|
6
|
+
/** Registered step for injecting the shared v4 MCP auth action into `m365agents.yml`. */
|
|
7
7
|
export declare const mcpAuthInjectYmlAction: RegisteredStep;
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Registered step for writing the deterministic `MCP_DA_AUTH_ID_<NS>` registration placeholder into
|
|
10
|
+
* `env/.env.dev`.
|
|
11
|
+
*/
|
|
9
12
|
export declare const mcpAuthPersistCredentialEnv: RegisteredStep;
|
|
10
13
|
//# sourceMappingURL=mcpAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpAuth.d.ts","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/mcpAuth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAA2B,MAAM,oCAAoC,CAAC;AAO7F,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcpAuth.d.ts","sourceRoot":"","sources":["../../../../src/v4/runtime/steps/mcpAuth.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAA2B,MAAM,oCAAoC,CAAC;AAO7F,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,oCAAoC,CAAC;AAY7E,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,EAAE,cAwBpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,cAiBzC,CAAC"}
|