@aifabrix/builder 2.53.1 → 2.54.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/bin/aifabrix.js +2 -2
- package/lib/api/assistants.api.js +8 -5
- package/lib/api/channel-identity.api.js +41 -0
- package/lib/api/evidence-authoring.api.js +5 -1
- package/lib/api/evidence.api.js +2 -0
- package/lib/api/types/evidence.types.js +2 -0
- package/lib/api/work-search.api.js +136 -0
- package/lib/channels/add-channel.js +163 -126
- package/lib/channels/approval-guides/chatgpt.js +14 -18
- package/lib/channels/approval-guides/claude.js +29 -0
- package/lib/channels/approval-guides/index.js +88 -22
- package/lib/channels/approval-guides/mcp-client.js +27 -0
- package/lib/channels/approval-guides/microsoft-copilot.js +52 -3
- package/lib/channels/approval-guides/slack.js +10 -10
- package/lib/channels/approval-guides/teams-bot.js +8 -12
- package/lib/channels/channel-add-continuations.js +91 -0
- package/lib/channels/channel-add-ensure.js +124 -27
- package/lib/channels/channel-add-existing.js +160 -28
- package/lib/channels/channel-add-failure.js +60 -0
- package/lib/channels/channel-add-remaining.js +486 -0
- package/lib/channels/channel-add-tty.js +190 -0
- package/lib/channels/channel-add-wizard-config.js +138 -0
- package/lib/channels/channel-add-wizard.js +250 -0
- package/lib/channels/channel-artifact-generator.js +27 -13
- package/lib/channels/channel-cardinality.js +83 -0
- package/lib/channels/channel-catalog-icon.js +45 -0
- package/lib/channels/channel-cli-instructions.js +75 -0
- package/lib/channels/channel-configuration-map.js +213 -0
- package/lib/channels/channel-credential.js +11 -14
- package/lib/channels/channel-definition-project.js +101 -0
- package/lib/channels/channel-definition-registry.js +154 -0
- package/lib/channels/channel-description.js +59 -2
- package/lib/channels/channel-discovery.js +16 -2
- package/lib/channels/channel-external-system.js +86 -9
- package/lib/channels/channel-install-envelope-actions.js +88 -0
- package/lib/channels/channel-install-envelope-microsoft.js +155 -0
- package/lib/channels/channel-install-envelope.js +356 -0
- package/lib/channels/channel-install-help-md.js +172 -0
- package/lib/channels/channel-install-http-payload.js +62 -0
- package/lib/channels/channel-install-inventory.js +115 -0
- package/lib/channels/channel-install-profiles.js +90 -0
- package/lib/channels/channel-instance-collision.js +118 -0
- package/lib/channels/channel-instance-key.js +100 -0
- package/lib/channels/channel-instance-materialize.js +240 -0
- package/lib/channels/channel-integration-generator.js +16 -9
- package/lib/channels/channel-integration-template.js +101 -22
- package/lib/channels/channel-inventory-fetch.js +79 -0
- package/lib/channels/channel-oauth-preflight.js +104 -0
- package/lib/channels/channel-package-version.js +76 -0
- package/lib/channels/channel-predefined-client.js +154 -0
- package/lib/channels/channel-probe.js +7 -2
- package/lib/channels/channel-runtime-resolver.js +180 -72
- package/lib/channels/channel-status-display.js +86 -16
- package/lib/channels/channel-targets.js +106 -92
- package/lib/channels/chatgpt-callback.js +318 -0
- package/lib/channels/chatgpt-channel-add.js +229 -0
- package/lib/channels/chatgpt-preflight.js +396 -0
- package/lib/channels/chatgpt-runtime-contract.js +17 -0
- package/lib/channels/chatgpt-setup-values.js +124 -0
- package/lib/channels/claude-callback.js +67 -0
- package/lib/channels/claude-channel-add.js +254 -0
- package/lib/channels/claude-runtime-contract.js +40 -0
- package/lib/channels/claude-runtime.js +58 -0
- package/lib/channels/claude-setup-values.js +89 -0
- package/lib/channels/mcp-client/config-merge.js +148 -0
- package/lib/channels/mcp-client/ensure-client.js +231 -0
- package/lib/channels/mcp-client/paths.js +53 -0
- package/lib/channels/mcp-client/profiles.js +122 -0
- package/lib/channels/mcp-client/redirect-uris.js +99 -0
- package/lib/channels/mcp-client/runtime.js +59 -0
- package/lib/channels/mcp-client-channel-add.js +186 -0
- package/lib/channels/microsoft-copilot-channel-add.js +117 -7
- package/lib/channels/microsoft-copilot-entra-identifier-uris.js +187 -0
- package/lib/channels/microsoft-copilot-entra-sso-form.js +106 -18
- package/lib/channels/microsoft-copilot-entra-sso.js +31 -2
- package/lib/channels/microsoft-copilot-package-prior.js +107 -0
- package/lib/channels/microsoft-copilot-package.js +29 -28
- package/lib/channels/microsoft-provisioning/a365.js +80 -0
- package/lib/channels/microsoft-provisioning/auth-config.js +240 -0
- package/lib/channels/microsoft-provisioning/auth.js +179 -0
- package/lib/channels/microsoft-provisioning/cli.js +71 -0
- package/lib/channels/microsoft-provisioning/constants.js +75 -0
- package/lib/channels/microsoft-provisioning/errors.js +117 -0
- package/lib/channels/microsoft-provisioning/index.js +55 -0
- package/lib/channels/microsoft-provisioning/install-atk.js +158 -0
- package/lib/channels/microsoft-provisioning/install-teams.js +115 -0
- package/lib/channels/microsoft-provisioning/login-portal-device.js +236 -0
- package/lib/channels/microsoft-provisioning/login-portal-parse.js +71 -0
- package/lib/channels/microsoft-provisioning/login-portal-teams.js +193 -0
- package/lib/channels/microsoft-provisioning/login-portal.js +230 -0
- package/lib/channels/microsoft-provisioning/persist.js +110 -0
- package/lib/channels/microsoft-provisioning/teams-bot-args.js +119 -0
- package/lib/channels/microsoft-provisioning/teams-bot-controller.js +123 -0
- package/lib/channels/microsoft-provisioning/teams-bot-parse.js +134 -0
- package/lib/channels/microsoft-provisioning/teams-bot-persist.js +113 -0
- package/lib/channels/microsoft-provisioning/teams-bot-provision.js +234 -0
- package/lib/channels/microsoft-provisioning/teams-bot-secrets.js +45 -0
- package/lib/channels/microsoft-provisioning/teams-cli.js +82 -0
- package/lib/channels/runtime-tool-catalog.js +5 -2
- package/lib/channels/slack-channel-add-portal.js +130 -0
- package/lib/channels/slack-channel-add-tty-auth.js +95 -0
- package/lib/channels/slack-channel-add.js +258 -0
- package/lib/channels/slack-provisioning/apps.js +181 -0
- package/lib/channels/slack-provisioning/auth-store.js +110 -0
- package/lib/channels/slack-provisioning/auth-ticket.js +185 -0
- package/lib/channels/slack-provisioning/auth.js +115 -0
- package/lib/channels/slack-provisioning/callbacks.js +41 -0
- package/lib/channels/slack-provisioning/cli.js +226 -0
- package/lib/channels/slack-provisioning/constants.js +37 -0
- package/lib/channels/slack-provisioning/credentials.js +169 -0
- package/lib/channels/slack-provisioning/curl-shim.js +132 -0
- package/lib/channels/slack-provisioning/developer-install.js +118 -0
- package/lib/channels/slack-provisioning/env-file.js +120 -0
- package/lib/channels/slack-provisioning/errors.js +47 -0
- package/lib/channels/slack-provisioning/go-ca-bundle.js +137 -0
- package/lib/channels/slack-provisioning/index.js +250 -0
- package/lib/channels/slack-provisioning/install-cli.js +323 -0
- package/lib/channels/slack-provisioning/manifest.js +89 -0
- package/lib/channels/slack-provisioning/oauth-lock.js +33 -0
- package/lib/channels/slack-provisioning/offer-cli.js +113 -0
- package/lib/channels/slack-provisioning/onboard-members.js +122 -0
- package/lib/channels/slack-provisioning/onboard.js +89 -0
- package/lib/channels/slack-provisioning/persist.js +95 -0
- package/lib/channels/slack-provisioning/remaining-urls.js +158 -0
- package/lib/channels/slack-provisioning/with-curl-on-path.js +48 -0
- package/lib/channels/teams-bot-channel-add.js +94 -0
- package/lib/channels/vendor-dataplane-url.js +249 -0
- package/lib/cli/setup-certification.help.js +2 -0
- package/lib/cli/setup-external-system-help.js +2 -0
- package/lib/cli/setup-external-system.js +1 -1
- package/lib/commands/channel-add-help.js +366 -0
- package/lib/commands/channel-add-setup.js +162 -80
- package/lib/commands/channel-configure.js +118 -0
- package/lib/commands/channel.js +10 -1
- package/lib/commands/governance-upload-external.js +6 -3
- package/lib/commands/lifecycle-command-action.js +2 -5
- package/lib/commands/lifecycle-external.js +93 -21
- package/lib/commands/repair-datasource-test-payload.js +4 -2
- package/lib/commands/repair-datasource-webhooks-sync-bridge.js +23 -2
- package/lib/commands/repair-datasource.js +3 -0
- package/lib/commands/repair-external-run.js +59 -25
- package/lib/commands/repair-openapi-rest-runtime.js +127 -0
- package/lib/commands/repair-orchestration-tag-merge.js +339 -0
- package/lib/commands/repair-rbac-catalog-defaults.js +96 -0
- package/lib/commands/repair-rbac-platform-preset.js +26 -15
- package/lib/commands/repair-rbac-reader-roles.js +8 -21
- package/lib/commands/repair-rbac.js +10 -34
- package/lib/commands/repair-system-permissions.js +24 -22
- package/lib/commands/role-assistant-test-output.js +14 -0
- package/lib/commands/role-assistant.js +59 -21
- package/lib/commands/test-e2e-external.js +148 -21
- package/lib/commands/upload-credential-push-log.js +2 -1
- package/lib/commands/upload-publish-context.js +1 -1
- package/lib/commands/upload-role-assistant-shell.js +124 -0
- package/lib/commands/upload-sidecar-followups.js +6 -3
- package/lib/commands/upload.js +18 -3
- package/lib/core/secrets-docker-env.js +4 -1
- package/lib/core/secrets-env-content.js +17 -3
- package/lib/datasource/capability/capability-manifest.js +0 -3
- package/lib/datasource/capability/copy-test-payload.js +3 -0
- package/lib/external-system/deploy-helpers.js +26 -1
- package/lib/external-system/deploy.js +10 -6
- package/lib/external-system/download-helpers.js +29 -2
- package/lib/external-system/download-role-assistant.js +83 -4
- package/lib/external-system/download.js +40 -30
- package/lib/external-system/sync-deploy-manifest.js +3 -2
- package/lib/external-system/upload-identity.js +42 -0
- package/lib/generator/index.js +19 -15
- package/lib/generator/split.js +13 -2
- package/lib/lifecycle/role-assistant-governance.js +146 -0
- package/lib/lifecycle/scenario-upload.js +181 -30
- package/lib/programmatic/builder-api-cors.js +143 -0
- package/lib/programmatic/builder-api-request.js +6 -0
- package/lib/programmatic/builder-api-route-dispatch.js +56 -42
- package/lib/programmatic/builder-api-server.js +8 -1
- package/lib/programmatic/capability-registry.js +54 -0
- package/lib/programmatic/channel-install-help-resolve.js +359 -0
- package/lib/programmatic/channel-install-session.js +218 -0
- package/lib/programmatic/help-content/channel-onboarding.md +2 -0
- package/lib/programmatic/help-content/cip-overview.md +3 -1
- package/lib/programmatic/http-raw-response.js +62 -0
- package/lib/programmatic/openapi-channel-install-bindings.js +179 -0
- package/lib/programmatic/openapi-channel-install-schemas.js +286 -0
- package/lib/programmatic/openapi-component-schemas.js +18 -1
- package/lib/programmatic/openapi-description-enricher.js +3 -1
- package/lib/programmatic/openapi-descriptions.js +74 -3
- package/lib/programmatic/openapi-envelope-examples.js +117 -0
- package/lib/programmatic/openapi-operation-bindings.js +4 -1
- package/lib/programmatic/openapi-schema-descriptions-channel.js +316 -0
- package/lib/programmatic/openapi-spec.js +12 -8
- package/lib/programmatic/platform-rbac-catalog.js +36 -18
- package/lib/programmatic/route-handler-map.js +51 -1
- package/lib/programmatic/route-handlers-context.js +2 -1
- package/lib/programmatic/run-auth-permissions.js +54 -0
- package/lib/programmatic/run-channel-catalog.js +196 -0
- package/lib/programmatic/run-channel-install-artifacts.js +137 -0
- package/lib/programmatic/run-channel-install-copilot.js +353 -0
- package/lib/programmatic/run-channel-install-options.js +232 -0
- package/lib/programmatic/run-channel-install-teams-bot.js +204 -0
- package/lib/programmatic/run-channel-install.js +346 -0
- package/lib/programmatic/run-channel-package.js +87 -7
- package/lib/programmatic/workspace-context.js +2 -0
- package/lib/role-assistant/evidence-sync.js +4 -2
- package/lib/role-assistant/evidence-validation-issues.js +51 -0
- package/lib/role-assistant/knowledge-sync.js +10 -4
- package/lib/role-assistant/settings.js +49 -2
- package/lib/role-assistant/test-cases-evaluate.js +30 -2
- package/lib/role-assistant/test-cases-evidence.js +175 -0
- package/lib/role-assistant/test-cases-search.js +229 -0
- package/lib/role-assistant/test-cases.js +37 -4
- package/lib/role-assistant/test-runner-search.js +149 -0
- package/lib/role-assistant/test-runner-workhub-helpers.js +40 -2
- package/lib/role-assistant/test-runner-workhub-soft.js +9 -3
- package/lib/role-assistant/test-runner-workhub.js +29 -11
- package/lib/role-assistant/test-runner.js +16 -1
- package/lib/schema/external-datasource.schema.json +112 -18
- package/lib/schema/external-system.schema.json +159 -2
- package/lib/schema/mcp-client-profile.schema.json +103 -0
- package/lib/utils/app-path-resolve.js +4 -0
- package/lib/utils/authentication-env-template.js +44 -6
- package/lib/utils/credential-secrets-env.js +6 -1
- package/lib/utils/env-copy.js +19 -7
- package/lib/utils/external-env-template.js +20 -2
- package/lib/utils/paths.js +18 -1
- package/lib/utils/platform-shell-package.js +69 -0
- package/lib/utils/port-resolver.js +50 -1
- package/lib/utils/rewrite-name-flag.js +20 -0
- package/lib/utils/role-assistant-paths.js +13 -10
- package/lib/utils/schema-resolver.js +11 -1
- package/lib/utils/secrets-helpers.js +12 -21
- package/lib/utils/token-manager.js +10 -5
- package/lib/validation/validate.js +40 -0
- package/package.json +1 -1
- package/templates/README.md +1 -1
- package/templates/applications/builder-api/Dockerfile +1 -1
- package/templates/applications/builder-api/env.template +7 -0
- package/templates/applications/dataplane/application.yaml +6 -5
- package/templates/applications/dataplane/env.template +2 -2
- package/templates/applications/dataplane/rbac.yaml +7 -2
- package/templates/applications/keycloak/Dockerfile +30 -4
- package/templates/applications/keycloak/application.yaml +2 -2
- package/templates/applications/keycloak/cimd-lenient-parse/AbstractClientIdMetadataDocumentExecutor.java +896 -0
- package/templates/applications/keycloak/cimd-lenient-parse/SOURCE.md +19 -0
- package/templates/applications/keycloak/env.template +3 -0
- package/templates/applications/miso-controller/application.yaml +1 -2
- package/templates/applications/miso-controller/env.template +2 -0
- package/templates/channels/README.md +5 -5
- package/templates/channels/chatgpt/TROUBLESHOOTING.md +51 -0
- package/templates/channels/chatgpt/channel.json +59 -0
- package/templates/channels/chatgpt/icon.svg +1 -0
- package/templates/channels/chatgpt/install.template.md.hbs +20 -95
- package/templates/channels/chatgpt/integration/README.md +1 -1
- package/templates/channels/chatgpt/integration/application.json +2 -2
- package/templates/channels/chatgpt/integration/chatgpt-system.json +49 -4
- package/templates/channels/chatgpt/integration/env.template +2 -4
- package/templates/channels/chatgpt/integration/rbac.json +13 -0
- package/templates/channels/claude/TROUBLESHOOTING.md +41 -0
- package/templates/channels/claude/channel.json +59 -0
- package/templates/channels/claude/icon.svg +1 -0
- package/templates/channels/claude/install.template.md.hbs +21 -0
- package/templates/channels/claude/integration/README.md +14 -0
- package/templates/channels/claude/integration/application.json +15 -0
- package/templates/channels/claude/integration/claude-system.json +59 -0
- package/templates/channels/claude/integration/env.template +2 -0
- package/templates/channels/claude/integration/rbac.json +13 -0
- package/templates/channels/claude/manifest.template.json.hbs +40 -0
- package/templates/channels/mcp-client/channel.json +72 -0
- package/templates/channels/mcp-client/icon.svg +1 -0
- package/templates/channels/mcp-client/install.template.md.hbs +24 -0
- package/templates/channels/mcp-client/integration/README.md +13 -0
- package/templates/channels/mcp-client/integration/application.json +15 -0
- package/templates/channels/mcp-client/integration/env.template +2 -0
- package/templates/channels/mcp-client/integration/mcp-client-system.json +72 -0
- package/templates/channels/mcp-client/integration/rbac.json +13 -0
- package/templates/channels/mcp-client/manifest.template.json.hbs +41 -0
- package/templates/channels/mcp-client/profiles/cursor.json +26 -0
- package/templates/channels/mcp-client/profiles/github-copilot.json +29 -0
- package/templates/channels/mcp-client/profiles/vscode.json +29 -0
- package/templates/channels/microsoft-copilot/channel.json +73 -0
- package/templates/channels/microsoft-copilot/declarative-agent.template.json.hbs +8 -4
- package/templates/channels/microsoft-copilot/entra-sso-registration.template.md.hbs +65 -5
- package/templates/channels/microsoft-copilot/icon.svg +1 -0
- package/templates/channels/microsoft-copilot/install.template.md.hbs +9 -9
- package/templates/channels/microsoft-copilot/integration/README.md +1 -1
- package/templates/channels/microsoft-copilot/integration/application.json +2 -2
- package/templates/channels/microsoft-copilot/integration/env.template +3 -6
- package/templates/channels/microsoft-copilot/integration/microsoft-copilot-system.json +63 -4
- package/templates/channels/microsoft-copilot/integration/rbac.json +13 -0
- package/templates/channels/microsoft-copilot/oauth-plugin-vault-required.template.md.hbs +5 -5
- package/templates/channels/slack/channel.json +223 -0
- package/templates/channels/slack/icon.svg +1 -0
- package/templates/channels/slack/install.template.md.hbs +36 -28
- package/templates/channels/slack/integration/README.md +245 -22
- package/templates/channels/slack/integration/application.json +44 -7
- package/templates/channels/slack/integration/env.template +15 -6
- package/templates/channels/slack/integration/openapi/openapi.json +126 -0
- package/templates/channels/slack/integration/rbac.json +84 -0
- package/templates/channels/slack/integration/slack-datasource-commands.json +154 -0
- package/templates/channels/slack/integration/slack-datasource-conversations.json +28 -3
- package/templates/channels/slack/integration/slack-datasource-events.json +154 -0
- package/templates/channels/slack/integration/slack-datasource-interactive.json +154 -0
- package/templates/channels/slack/integration/slack-datasource-messages.json +40 -2
- package/templates/channels/slack/integration/slack-system.json +155 -77
- package/templates/channels/slack/manifest.template.json.hbs +5 -2
- package/templates/channels/teams-bot/channel.json +161 -0
- package/templates/channels/teams-bot/icon.svg +1 -0
- package/templates/channels/teams-bot/install.template.md.hbs +12 -13
- package/templates/channels/teams-bot/integration/README.md +5 -4
- package/templates/channels/teams-bot/integration/application.json +6 -4
- package/templates/channels/teams-bot/integration/env.template +5 -4
- package/templates/channels/teams-bot/integration/openapi/openapi.json +68 -0
- package/templates/channels/teams-bot/integration/rbac.json +21 -0
- package/templates/channels/teams-bot/integration/teams-bot-datasource-activities.json +154 -0
- package/templates/channels/teams-bot/integration/teams-bot-system.json +128 -23
- package/templates/channels/web-embed/channel.json +60 -0
- package/templates/channels/web-embed/install.template.md.hbs +1 -1
- package/templates/channels/web-embed/integration/README.md +2 -2
- package/templates/channels/web-embed/integration/application.json +2 -2
- package/templates/channels/web-embed/integration/env.template +1 -1
- package/templates/channels/web-embed/integration/rbac.json +13 -0
- package/templates/channels/web-embed/integration/web-embed-system.json +50 -4
|
@@ -24,6 +24,8 @@ const {
|
|
|
24
24
|
lifecycleGovernanceNeedsWork,
|
|
25
25
|
buildGovernanceOptsFromLifecycle
|
|
26
26
|
} = require('../lifecycle/lifecycle-governance-options');
|
|
27
|
+
const { remapRoleAssistantGovernanceReport } = require('../lifecycle/role-assistant-governance');
|
|
28
|
+
const { isRoleAssistantWorkspace } = require('../utils/platform-shell-package');
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* @async
|
|
@@ -76,6 +78,9 @@ async function runLifecycleGovernanceCombinedIfNeeded(
|
|
|
76
78
|
dataplaneUrl,
|
|
77
79
|
options
|
|
78
80
|
) {
|
|
81
|
+
if (options.skipConnectedSystemGovernance === true) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
79
84
|
if (!lifecycleHasGovernanceSubjects(options)) {
|
|
80
85
|
return;
|
|
81
86
|
}
|
|
@@ -100,16 +105,21 @@ async function runMissingVerifyStepsLocally(systemKey, report, options) {
|
|
|
100
105
|
const runOpts = { ...options, noPublish: true };
|
|
101
106
|
const pathsUtil = require('../utils/paths');
|
|
102
107
|
const appType = await pathsUtil.detectAppType(systemKey).catch(() => null);
|
|
103
|
-
const isRoleAssistantPackage =
|
|
104
|
-
|
|
108
|
+
const isRoleAssistantPackage =
|
|
109
|
+
options.skipConnectedSystemGovernance === true || isRoleAssistantWorkspace(appType && appType.baseDir);
|
|
110
|
+
// verify-operations / CS governance packs are integration/-only.
|
|
111
|
+
// Role Assistant isolation is Work Hub cases + role-assistant.yaml.
|
|
105
112
|
if (report.operations?.verdict !== VERDICT.VERIFIED && !isRoleAssistantPackage) {
|
|
106
113
|
await runVerifyOperationsForExternalSystem(systemKey, runOpts);
|
|
107
114
|
}
|
|
108
|
-
if (report.trust?.verdict !== VERDICT.VERIFIED) {
|
|
115
|
+
if (report.trust?.verdict !== VERDICT.VERIFIED && !isRoleAssistantPackage) {
|
|
109
116
|
await runVerifyTrustForExternalSystem(systemKey, runOpts);
|
|
110
117
|
}
|
|
111
|
-
if (
|
|
112
|
-
&&
|
|
118
|
+
if (
|
|
119
|
+
!isRoleAssistantPackage &&
|
|
120
|
+
report.governance?.verdict !== VERDICT.VERIFIED &&
|
|
121
|
+
report.governance?.verdict !== VERDICT.NOT_APPLICABLE
|
|
122
|
+
) {
|
|
113
123
|
if (lifecycleHasGovernanceSubjects(options)) {
|
|
114
124
|
const { runVerifyGovernanceCombined } = require('./verify-governance-combined-external');
|
|
115
125
|
await runVerifyGovernanceCombined(
|
|
@@ -143,15 +153,17 @@ async function buildLifecycleResult(
|
|
|
143
153
|
authConfig,
|
|
144
154
|
extra = {}
|
|
145
155
|
) {
|
|
156
|
+
const mappedReport =
|
|
157
|
+
extra.roleAssistant === true ? remapRoleAssistantGovernanceReport(report) : report;
|
|
146
158
|
const openApiPublished = await resolveOpenApiPublished(dataplaneUrl, authConfig, systemKey);
|
|
147
159
|
return {
|
|
148
160
|
systemKey,
|
|
149
161
|
command: 'lifecycle',
|
|
150
|
-
report,
|
|
162
|
+
report: mappedReport,
|
|
151
163
|
dataplaneUrl,
|
|
152
164
|
dataplaneUiBaseUrl,
|
|
153
165
|
openApiPublished,
|
|
154
|
-
certificationProgress: buildCertificationProgress(
|
|
166
|
+
certificationProgress: buildCertificationProgress(mappedReport, { openApiPublished }),
|
|
155
167
|
...extra
|
|
156
168
|
};
|
|
157
169
|
}
|
|
@@ -191,7 +203,58 @@ async function runLifecycleViaDataplaneApi(
|
|
|
191
203
|
dataplaneUrl,
|
|
192
204
|
dataplaneUiBaseUrl,
|
|
193
205
|
authConfig,
|
|
194
|
-
{
|
|
206
|
+
{
|
|
207
|
+
stepsRun: runRes.stepsRun || [],
|
|
208
|
+
source: 'api',
|
|
209
|
+
roleAssistant: options.roleAssistant === true
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function emptyRoleAssistantLifecycleReport(systemKey) {
|
|
215
|
+
return {
|
|
216
|
+
systemKey,
|
|
217
|
+
operations: { verdict: VERDICT.NOT_APPLICABLE },
|
|
218
|
+
trust: { verdict: VERDICT.NOT_APPLICABLE },
|
|
219
|
+
governance: { verdict: VERDICT.NOT_APPLICABLE },
|
|
220
|
+
recommendations: [],
|
|
221
|
+
warnings: [
|
|
222
|
+
{
|
|
223
|
+
code: 'ROLE_ASSISTANT_LIFECYCLE_REPORT_UNAVAILABLE',
|
|
224
|
+
message:
|
|
225
|
+
'Lifecycle report unavailable. Role Assistant cases still run against the published worker.'
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Role Assistant prove uses the published dataplane worker.
|
|
233
|
+
* Do not POST CS lifecycle/run or fall back to verify-trust (those paths need application.yaml).
|
|
234
|
+
* @async
|
|
235
|
+
*/
|
|
236
|
+
async function fetchRoleAssistantLifecycleResult(
|
|
237
|
+
systemKey,
|
|
238
|
+
authConfig,
|
|
239
|
+
dataplaneUrl,
|
|
240
|
+
dataplaneUiBaseUrl,
|
|
241
|
+
options
|
|
242
|
+
) {
|
|
243
|
+
let report;
|
|
244
|
+
try {
|
|
245
|
+
report = await getSystemLifecycleReport(dataplaneUrl, authConfig, systemKey, {
|
|
246
|
+
details: options.verbose === true
|
|
247
|
+
});
|
|
248
|
+
} catch {
|
|
249
|
+
report = emptyRoleAssistantLifecycleReport(systemKey);
|
|
250
|
+
}
|
|
251
|
+
return buildLifecycleResult(
|
|
252
|
+
systemKey,
|
|
253
|
+
report,
|
|
254
|
+
dataplaneUrl,
|
|
255
|
+
dataplaneUiBaseUrl,
|
|
256
|
+
authConfig,
|
|
257
|
+
{ source: 'api', roleAssistant: true }
|
|
195
258
|
);
|
|
196
259
|
}
|
|
197
260
|
|
|
@@ -205,6 +268,16 @@ async function executeLifecycleWork(systemKey, options = {}) {
|
|
|
205
268
|
const { authConfig, dataplaneUrl } = await resolveLifecycleAuth(systemKey, options);
|
|
206
269
|
const dataplaneUiBaseUrl = await resolveLifecycleDataplaneUiBaseUrl(dataplaneUrl);
|
|
207
270
|
|
|
271
|
+
if (options.roleAssistant === true) {
|
|
272
|
+
return fetchRoleAssistantLifecycleResult(
|
|
273
|
+
systemKey,
|
|
274
|
+
authConfig,
|
|
275
|
+
dataplaneUrl,
|
|
276
|
+
dataplaneUiBaseUrl,
|
|
277
|
+
options
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
208
281
|
if (options.run === true) {
|
|
209
282
|
try {
|
|
210
283
|
return await runLifecycleViaDataplaneApi(
|
|
@@ -235,7 +308,10 @@ async function executeLifecycleWork(systemKey, options = {}) {
|
|
|
235
308
|
dataplaneUrl,
|
|
236
309
|
dataplaneUiBaseUrl,
|
|
237
310
|
authConfig,
|
|
238
|
-
{
|
|
311
|
+
{
|
|
312
|
+
source: options.run ? 'local-fallback' : 'api',
|
|
313
|
+
roleAssistant: options.roleAssistant === true
|
|
314
|
+
}
|
|
239
315
|
);
|
|
240
316
|
}
|
|
241
317
|
|
|
@@ -251,26 +327,22 @@ async function runLifecycleForExternalSystem(systemKey, options = {}) {
|
|
|
251
327
|
const appType = await pathsUtil.detectAppType(systemKey).catch(() => null);
|
|
252
328
|
assertCertifyExternalWorkspace(appType && appType.baseDir, 'lifecycle');
|
|
253
329
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
} catch {
|
|
261
|
-
resolvedKey = roleAssistantSystemKey(systemKey);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
330
|
+
const roleAssistant = isRoleAssistantWorkspace(appType && appType.baseDir);
|
|
331
|
+
const workOpts = {
|
|
332
|
+
...options,
|
|
333
|
+
roleAssistant,
|
|
334
|
+
skipConnectedSystemGovernance: roleAssistant
|
|
335
|
+
};
|
|
264
336
|
|
|
265
337
|
if (options.run === true) {
|
|
266
338
|
return runWithVerifyStepProgress(
|
|
267
339
|
'Processing',
|
|
268
|
-
async(progress) => executeLifecycleWork(
|
|
340
|
+
async(progress) => executeLifecycleWork(systemKey, { ...workOpts, lifecycleProgress: progress }),
|
|
269
341
|
{ json: options.json === true }
|
|
270
342
|
);
|
|
271
343
|
}
|
|
272
344
|
|
|
273
|
-
return executeLifecycleWork(
|
|
345
|
+
return executeLifecycleWork(systemKey, workOpts);
|
|
274
346
|
}
|
|
275
347
|
|
|
276
348
|
module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Schema-aware testPayload repair (payloadTemplate / expectedResult).
|
|
2
|
+
* Schema-aware testPayload repair (payloadTemplate / expectedResult only).
|
|
3
3
|
*
|
|
4
|
-
* @fileoverview
|
|
4
|
+
* @fileoverview Mapping-shape testPayload generation; does not write scenario gold
|
|
5
5
|
* @author AI Fabrix Team
|
|
6
6
|
* @version 2.0.0
|
|
7
7
|
*/
|
|
@@ -288,6 +288,8 @@ function buildTemplatesFromPathEntries(parsed, pathEntries) {
|
|
|
288
288
|
|
|
289
289
|
/**
|
|
290
290
|
* Builds minimal payloadTemplate and expectedResult from attributes + metadataSchema.
|
|
291
|
+
* Does not generate or rewrite testPayload.scenarios (including nested expectedRows).
|
|
292
|
+
* Placeholder zeros on expectedResult are mapping-shape only — not capacity row gold.
|
|
291
293
|
*
|
|
292
294
|
* @param {Object} parsed - Parsed datasource (mutated)
|
|
293
295
|
* @param {string[]} changes - Change log
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
+
const { listCapabilityKeys } = require('../datasource/capability/capability-manifest');
|
|
10
|
+
|
|
9
11
|
const AUTH_USAGE_WEBHOOK_INBOUND = 'webhookInbound';
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -23,6 +25,23 @@ function systemHasWebhookInboundAuth(systemParsed) {
|
|
|
23
25
|
return false;
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
/**
|
|
29
|
+
* True when every webhook.events[] entry is a capability key (CIP invoke, not change-signal get).
|
|
30
|
+
* @param {object} parsed
|
|
31
|
+
* @returns {boolean}
|
|
32
|
+
*/
|
|
33
|
+
function webhookEventsAreCapabilityKeys(parsed) {
|
|
34
|
+
const events = parsed?.webhook?.events;
|
|
35
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const keys = new Set(listCapabilityKeys(parsed.capabilities));
|
|
39
|
+
if (keys.size === 0) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return events.every((event) => keys.has(String(event || '').trim()));
|
|
43
|
+
}
|
|
44
|
+
|
|
26
45
|
/**
|
|
27
46
|
* @param {object} parsed
|
|
28
47
|
* @param {string[]} changes
|
|
@@ -37,7 +56,8 @@ function repairWebhookSection(parsed, changes, warnings) {
|
|
|
37
56
|
let updated = false;
|
|
38
57
|
|
|
39
58
|
if (webhook.enabled === true) {
|
|
40
|
-
|
|
59
|
+
const needsIdPath = !webhookEventsAreCapabilityKeys(parsed);
|
|
60
|
+
if (needsIdPath && (!webhook.idPath || !String(webhook.idPath).trim())) {
|
|
41
61
|
warnings.push(
|
|
42
62
|
'webhook.enabled is true but idPath is missing — set idPath (for example $.objectId) before upload.'
|
|
43
63
|
);
|
|
@@ -168,5 +188,6 @@ module.exports = {
|
|
|
168
188
|
repairSyncBridgeSection,
|
|
169
189
|
defaultSyncBridgeForSyncRepair,
|
|
170
190
|
collectWebhookSyncBridgeSystemWarnings,
|
|
171
|
-
systemHasWebhookInboundAuth
|
|
191
|
+
systemHasWebhookInboundAuth,
|
|
192
|
+
webhookEventsAreCapabilityKeys
|
|
172
193
|
};
|
|
@@ -365,6 +365,9 @@ function repairSyncSection(parsed, changes) {
|
|
|
365
365
|
|
|
366
366
|
/**
|
|
367
367
|
* Removes unknown top-level keys from testPayload (v2.4.1 closed root).
|
|
368
|
+
* Nested keys under scenarios (including author-owned row gold) are not stripped.
|
|
369
|
+
* Do not add a nested scenario allowlist unless it is derived from the published
|
|
370
|
+
* external-datasource.schema.json testPayload.scenarios.items.properties.
|
|
368
371
|
* @param {Object} parsed - Parsed datasource (mutated)
|
|
369
372
|
* @param {string[]} changes - Change log
|
|
370
373
|
* @returns {boolean}
|
|
@@ -18,6 +18,7 @@ const { persistChangesAndRegenerate, regenerateReadmeIfRequested, regenerateDepl
|
|
|
18
18
|
const { runRepairSteps } = require('./repair-steps');
|
|
19
19
|
const { runDatasourceRepairs } = require('./repair-datasource-run');
|
|
20
20
|
const { repairSplitOrchestrationDatasources } = require('./repair-orchestration-datasource-split');
|
|
21
|
+
const { mergeOrchestrationTagOperations } = require('./repair-orchestration-tag-merge');
|
|
21
22
|
const { maybeRepairRbac } = require('./repair-rbac');
|
|
22
23
|
const { collectCapabilityOpenApiDriftWarnings } = require('./repair-capability-openapi-warnings');
|
|
23
24
|
const { maybeRunOpenApiSyncForMcp } = require('./repair-openapi-sync');
|
|
@@ -169,7 +170,62 @@ async function runDatasourceOpenApiRepairs(ws) {
|
|
|
169
170
|
changes: ws.changes,
|
|
170
171
|
backupCtx: ws.backupCtx
|
|
171
172
|
});
|
|
172
|
-
|
|
173
|
+
const tagMerge = mergeOrchestrationTagOperations({
|
|
174
|
+
appPath: ws.appPath,
|
|
175
|
+
systemKey: ws.systemKey,
|
|
176
|
+
dryRun: ws.dryRun,
|
|
177
|
+
changes: ws.changes,
|
|
178
|
+
backupCtx: ws.backupCtx,
|
|
179
|
+
options: ws.options
|
|
180
|
+
});
|
|
181
|
+
return {
|
|
182
|
+
datasourceRepairUpdated: datasourceRepairUpdated || splitResult.updated || tagMerge.length > 0,
|
|
183
|
+
openapiActionsPerformed
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @param {Object} ws
|
|
189
|
+
* @returns {Promise<Object>}
|
|
190
|
+
*/
|
|
191
|
+
/**
|
|
192
|
+
* @param {Object} ws
|
|
193
|
+
* @returns {Object}
|
|
194
|
+
*/
|
|
195
|
+
function runRepairRbacStep(ws) {
|
|
196
|
+
return maybeRepairRbac(
|
|
197
|
+
ws.appPath,
|
|
198
|
+
ws.systemFilePath,
|
|
199
|
+
ws.systemParsed,
|
|
200
|
+
ws.datasourceFiles,
|
|
201
|
+
{
|
|
202
|
+
rbac: Boolean(ws.options.rbac),
|
|
203
|
+
rbacFmt: ws.rbacFmt,
|
|
204
|
+
rbacPreset: ws.options.rbacPreset,
|
|
205
|
+
dryRun: ws.dryRun,
|
|
206
|
+
changes: ws.changes,
|
|
207
|
+
backupCtx: ws.backupCtx
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @param {Object} ws
|
|
214
|
+
* @param {Object} steps
|
|
215
|
+
* @param {boolean} datasourceRepairUpdated
|
|
216
|
+
* @param {Object} rbac
|
|
217
|
+
* @returns {boolean}
|
|
218
|
+
*/
|
|
219
|
+
function anyRepairLocalUpdated(ws, steps, datasourceRepairUpdated, rbac) {
|
|
220
|
+
return Boolean(
|
|
221
|
+
ws.keysNormalized ||
|
|
222
|
+
steps.updated ||
|
|
223
|
+
datasourceRepairUpdated ||
|
|
224
|
+
rbac.rbacMigratedFromSystem ||
|
|
225
|
+
rbac.rbacMergeUpdated ||
|
|
226
|
+
rbac.rbacSyncedIntoSystem ||
|
|
227
|
+
rbac.rbacSecurityBound
|
|
228
|
+
);
|
|
173
229
|
}
|
|
174
230
|
|
|
175
231
|
/**
|
|
@@ -198,32 +254,10 @@ async function runRepairIntegrationFileSteps(ws) {
|
|
|
198
254
|
collectCapabilityOpenApiDriftWarnings(ws.appPath, ws.datasourceFiles, ws.warnings);
|
|
199
255
|
}
|
|
200
256
|
const { datasourceRepairUpdated, openapiActionsPerformed } = await runDatasourceOpenApiRepairs(ws);
|
|
201
|
-
const
|
|
202
|
-
maybeRepairRbac(
|
|
203
|
-
ws.appPath,
|
|
204
|
-
ws.systemFilePath,
|
|
205
|
-
ws.systemParsed,
|
|
206
|
-
ws.datasourceFiles,
|
|
207
|
-
{
|
|
208
|
-
rbac: Boolean(ws.options.rbac),
|
|
209
|
-
rbacFmt: ws.rbacFmt,
|
|
210
|
-
rbacPreset: ws.options.rbacPreset,
|
|
211
|
-
dryRun: ws.dryRun,
|
|
212
|
-
changes: ws.changes,
|
|
213
|
-
backupCtx: ws.backupCtx
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
const anyLocalUpdated =
|
|
217
|
-
ws.keysNormalized ||
|
|
218
|
-
steps.updated ||
|
|
219
|
-
datasourceRepairUpdated ||
|
|
220
|
-
rbacMigratedFromSystem ||
|
|
221
|
-
rbacMergeUpdated ||
|
|
222
|
-
rbacSyncedIntoSystem ||
|
|
223
|
-
rbacSecurityBound;
|
|
257
|
+
const rbac = runRepairRbacStep(ws);
|
|
224
258
|
return {
|
|
225
259
|
steps,
|
|
226
|
-
anyLocalUpdated,
|
|
260
|
+
anyLocalUpdated: anyRepairLocalUpdated(ws, steps, datasourceRepairUpdated, rbac),
|
|
227
261
|
changes: ws.changes,
|
|
228
262
|
warnings: ws.warnings,
|
|
229
263
|
openapiActionsPerformed,
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infer published REST restRuntime from a Builder OpenAPI path.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview CIP item routes bind one `{systemKey}` path param as recordIdentifier
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const APP_PACKAGE_ARTIFACT_ID = 'appPackage';
|
|
12
|
+
const BUILDER_API_PREFIX = /^\/api\/v1\/builder/;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Published REST cannot carry extra `{param}` segments except as restRuntime
|
|
16
|
+
* templates bound from the catch-all item subpath (only recordIdentifier is
|
|
17
|
+
* canonical). Channel ZIP downloads use the envelope artifact id `appPackage`.
|
|
18
|
+
* @param {string} segment
|
|
19
|
+
* @returns {string}
|
|
20
|
+
*/
|
|
21
|
+
function normalizeRestRuntimeSegment(segment) {
|
|
22
|
+
if (segment === '{artifactId}') {
|
|
23
|
+
return APP_PACKAGE_ARTIFACT_ID;
|
|
24
|
+
}
|
|
25
|
+
if (segment === '{systemKey}') {
|
|
26
|
+
return '{installationKey}';
|
|
27
|
+
}
|
|
28
|
+
return segment;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} tail
|
|
33
|
+
* @returns {string[]}
|
|
34
|
+
*/
|
|
35
|
+
function splitNormalizedSegments(tail) {
|
|
36
|
+
return tail.split('/').filter(Boolean).map(normalizeRestRuntimeSegment);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param {string} stripped
|
|
41
|
+
* @returns {{ pathKind: string, subpathSegments: string[] }|undefined}
|
|
42
|
+
*/
|
|
43
|
+
function restRuntimeFromSystemsPath(stripped) {
|
|
44
|
+
const match = stripped.match(/^\/systems\/\{[^}]+\}\/(.+)$/);
|
|
45
|
+
if (!match) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const segs = splitNormalizedSegments(match[1]);
|
|
49
|
+
if (segs.length === 0) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
return { pathKind: 'itemSubresource', subpathSegments: segs };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param {string} stripped
|
|
57
|
+
* @returns {{ pathKind: string, subpathSegments?: string[] }|undefined}
|
|
58
|
+
*/
|
|
59
|
+
function restRuntimeFromChannelsPath(stripped) {
|
|
60
|
+
if (/^\/channels\/\{[^}]+\}$/.test(stripped)) {
|
|
61
|
+
return { pathKind: 'item' };
|
|
62
|
+
}
|
|
63
|
+
const match = stripped.match(/^\/channels\/\{[^}]+\}\/(.+)$/);
|
|
64
|
+
if (!match) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const segs = splitNormalizedSegments(match[1]);
|
|
68
|
+
if (segs.length === 0) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return { pathKind: 'itemSubresource', subpathSegments: segs };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @param {string} stripped
|
|
76
|
+
* @returns {{ pathKind: string, subpathSegments: string[] }|undefined}
|
|
77
|
+
*/
|
|
78
|
+
function restRuntimeFromCollectionPath(stripped) {
|
|
79
|
+
if (stripped.includes('{')) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const match = stripped.match(/^\/[^/]+\/(.+)$/);
|
|
83
|
+
if (!match) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const segs = match[1].split('/').filter(Boolean);
|
|
87
|
+
if (segs.length === 0) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
return { pathKind: 'collectionSubresource', subpathSegments: segs };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @param {string} vendorPath
|
|
95
|
+
* @returns {{ pathKind: string, subpathSegments?: string[] }|undefined}
|
|
96
|
+
*/
|
|
97
|
+
function restRuntimeFromVendorPath(vendorPath) {
|
|
98
|
+
if (typeof vendorPath !== 'string' || !vendorPath.trim()) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
const stripped = vendorPath.replace(BUILDER_API_PREFIX, '');
|
|
102
|
+
return (
|
|
103
|
+
restRuntimeFromSystemsPath(stripped) ||
|
|
104
|
+
restRuntimeFromChannelsPath(stripped) ||
|
|
105
|
+
restRuntimeFromCollectionPath(stripped)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {Object} openapiOp
|
|
111
|
+
* @returns {Object}
|
|
112
|
+
*/
|
|
113
|
+
function withInferredRestRuntime(openapiOp) {
|
|
114
|
+
if (!openapiOp || typeof openapiOp !== 'object' || openapiOp.restRuntime) {
|
|
115
|
+
return openapiOp;
|
|
116
|
+
}
|
|
117
|
+
const restRuntime = restRuntimeFromVendorPath(openapiOp.path);
|
|
118
|
+
if (!restRuntime) {
|
|
119
|
+
return openapiOp;
|
|
120
|
+
}
|
|
121
|
+
return { ...openapiOp, restRuntime };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
module.exports = {
|
|
125
|
+
restRuntimeFromVendorPath,
|
|
126
|
+
withInferredRestRuntime
|
|
127
|
+
};
|