@aifabrix/builder 2.53.0 → 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 +119 -16
- 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
package/lib/utils/env-copy.js
CHANGED
|
@@ -20,7 +20,7 @@ const devConfig = require('../utils/dev-config');
|
|
|
20
20
|
const { rewriteInfraEndpoints } = require('./env-endpoints');
|
|
21
21
|
const { buildEnvVarMap } = require('./env-map');
|
|
22
22
|
const { interpolateEnvVars } = require('./secrets-helpers');
|
|
23
|
-
const { getLocalPort } = require('./port-resolver');
|
|
23
|
+
const { getLocalPort, isExternalAppDoc } = require('./port-resolver');
|
|
24
24
|
const { applyHostLocalKeycloakInternalUrl } = require('./env-copy-keycloak');
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -263,6 +263,21 @@ function extractEnvVarsFromContent(envContent, envVars) {
|
|
|
263
263
|
return envVars;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Patch Connected System env for local resolve (infra hosts only; no listen PORT).
|
|
268
|
+
* @async
|
|
269
|
+
* @param {string} envContent - Original env content
|
|
270
|
+
* @returns {Promise<string>} Patched env content
|
|
271
|
+
*/
|
|
272
|
+
async function patchExternalEnvContentForLocal(envContent) {
|
|
273
|
+
const devIdNum = readDeveloperIdFromConfig(config) || 0;
|
|
274
|
+
const infraPorts = devConfig.getDevPorts(devIdNum);
|
|
275
|
+
const updated = await rewriteInfraEndpoints(envContent, 'local', infraPorts);
|
|
276
|
+
const envVars = await buildEnvVarMap('local', null, devIdNum);
|
|
277
|
+
const updatedEnvVars = extractEnvVarsFromContent(updated, envVars);
|
|
278
|
+
return interpolateEnvVars(updated, updatedEnvVars);
|
|
279
|
+
}
|
|
280
|
+
|
|
266
281
|
/**
|
|
267
282
|
* Patch env content for local development
|
|
268
283
|
* @async
|
|
@@ -271,21 +286,18 @@ function extractEnvVarsFromContent(envContent, envVars) {
|
|
|
271
286
|
* @returns {Promise<string>} Patched env content
|
|
272
287
|
*/
|
|
273
288
|
async function patchEnvContentForLocal(envContent, variables) {
|
|
289
|
+
if (isExternalAppDoc(variables)) {
|
|
290
|
+
return patchExternalEnvContentForLocal(envContent);
|
|
291
|
+
}
|
|
274
292
|
const baseAppPort = getLocalPort(variables, 3000);
|
|
275
293
|
const appPort = calculateDevAppPort(baseAppPort);
|
|
276
294
|
const devIdNum = readDeveloperIdFromConfig(config) || 0;
|
|
277
295
|
const infraPorts = devConfig.getDevPorts(devIdNum);
|
|
278
296
|
|
|
279
|
-
// Update PORT
|
|
280
297
|
envContent = updatePortInEnv(envContent, appPort);
|
|
281
|
-
|
|
282
|
-
// Update localhost URLs
|
|
283
298
|
envContent = updateLocalhostUrls(envContent, baseAppPort, appPort);
|
|
284
|
-
|
|
285
|
-
// Rewrite infra endpoints
|
|
286
299
|
envContent = await rewriteInfraEndpoints(envContent, 'local', infraPorts);
|
|
287
300
|
|
|
288
|
-
// Interpolate ${VAR} references
|
|
289
301
|
const envVars = await buildEnvVarMap('local', null, devIdNum);
|
|
290
302
|
const updatedEnvVars = extractEnvVarsFromContent(envContent, envVars);
|
|
291
303
|
envContent = interpolateEnvVars(envContent, updatedEnvVars);
|
|
@@ -52,9 +52,17 @@ const FALLBACK_SECURITY_BY_AUTH = {
|
|
|
52
52
|
hmac: ['signingSecret'],
|
|
53
53
|
bearer: ['bearerToken'],
|
|
54
54
|
token: ['bearerToken'],
|
|
55
|
-
none: []
|
|
55
|
+
none: [],
|
|
56
|
+
system: []
|
|
56
57
|
};
|
|
57
58
|
|
|
59
|
+
const NO_SECRET_AUTH_TYPES = new Set(['none', 'apiProvider', 'system']);
|
|
60
|
+
|
|
61
|
+
function isNoSecretAuthType(authBlock) {
|
|
62
|
+
const authType = authBlock && typeof authBlock.authType === 'string' ? authBlock.authType.trim() : '';
|
|
63
|
+
return NO_SECRET_AUTH_TYPES.has(authType);
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
/**
|
|
59
67
|
* @param {Array<{name: string, value: string}>} authSecureVars
|
|
60
68
|
* @param {Record<string, unknown>} security
|
|
@@ -96,7 +104,7 @@ function buildAuthSecureVarsFromSystem(system) {
|
|
|
96
104
|
const prefix = systemKeyToKvPrefix(systemKey);
|
|
97
105
|
if (!prefix) return authSecureVars;
|
|
98
106
|
const authBlock = system?.authentication || system?.auth;
|
|
99
|
-
if (authBlock
|
|
107
|
+
if (isNoSecretAuthType(authBlock)) {
|
|
100
108
|
return authSecureVars;
|
|
101
109
|
}
|
|
102
110
|
const credential = getAuthCredentialTemplate(authBlock);
|
|
@@ -147,6 +155,8 @@ function buildExternalEnvTemplateContext(system) {
|
|
|
147
155
|
authMethod = 'apiprovider';
|
|
148
156
|
} else if (authBlock?.authType === 'none') {
|
|
149
157
|
authMethod = 'none';
|
|
158
|
+
} else if (authBlock?.authType === 'system') {
|
|
159
|
+
authMethod = 'system';
|
|
150
160
|
} else {
|
|
151
161
|
authMethod = (
|
|
152
162
|
credential?.method ||
|
|
@@ -155,6 +165,14 @@ function buildExternalEnvTemplateContext(system) {
|
|
|
155
165
|
'apikey'
|
|
156
166
|
).toLowerCase();
|
|
157
167
|
}
|
|
168
|
+
if (isNoSecretAuthType(authBlock)) {
|
|
169
|
+
return {
|
|
170
|
+
authMethod,
|
|
171
|
+
authSecureVars: [],
|
|
172
|
+
authNonSecureVarNames: [],
|
|
173
|
+
configuration: buildConfigurationEntries(system)
|
|
174
|
+
};
|
|
175
|
+
}
|
|
158
176
|
const slotSecureVars = buildAuthSecureVarsFromAllSlots(system);
|
|
159
177
|
const authSecureVars =
|
|
160
178
|
slotSecureVars.length > 0 ? slotSecureVars : buildAuthSecureVarsFromSystem(system);
|
package/lib/utils/paths.js
CHANGED
|
@@ -842,12 +842,25 @@ function resolveExistingWorkspacePath(appName, options) {
|
|
|
842
842
|
return null;
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
+
function platformShellWorkspaceWithoutConfig(appPath, baseDir) {
|
|
846
|
+
if (!isExistingAppDirectory(appPath)) {
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
if (baseDir === 'role-assistant' || baseDir === 'enterprise-knowledge') {
|
|
850
|
+
return externalIntegrationFolderResult(appPath, baseDir);
|
|
851
|
+
}
|
|
852
|
+
return null;
|
|
853
|
+
}
|
|
854
|
+
|
|
845
855
|
function externalWorkspaceFolderFromConfig(appPath, baseDir, scopedWorkspace) {
|
|
846
856
|
try {
|
|
847
857
|
const configPath = resolveApplicationConfigPath(appPath);
|
|
848
858
|
const variables = loadConfigFile(configPath);
|
|
849
859
|
if (!variables) {
|
|
850
|
-
return
|
|
860
|
+
return platformShellWorkspaceWithoutConfig(appPath, baseDir);
|
|
861
|
+
}
|
|
862
|
+
if (baseDir === 'role-assistant' || baseDir === 'enterprise-knowledge') {
|
|
863
|
+
return externalIntegrationFolderResult(appPath, baseDir);
|
|
851
864
|
}
|
|
852
865
|
const isExternal = isExternalAppType(variables);
|
|
853
866
|
return {
|
|
@@ -857,6 +870,10 @@ function externalWorkspaceFolderFromConfig(appPath, baseDir, scopedWorkspace) {
|
|
|
857
870
|
baseDir
|
|
858
871
|
};
|
|
859
872
|
} catch {
|
|
873
|
+
const platformShell = platformShellWorkspaceWithoutConfig(appPath, baseDir);
|
|
874
|
+
if (platformShell) {
|
|
875
|
+
return platformShell;
|
|
876
|
+
}
|
|
860
877
|
if (scopedWorkspace && isExistingAppDirectory(appPath)) {
|
|
861
878
|
return externalIntegrationFolderResult(appPath, baseDir);
|
|
862
879
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* digitalWorker / enterpriseKnowledge packages are platform shells, not Connected Systems.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Kind and workspace helpers for Role Assistant and Enterprise Knowledge
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { SYSTEM_KIND_DIGITAL_WORKER, WORKSPACE_ROLE_ASSISTANT } = require('./role-assistant-paths');
|
|
12
|
+
const {
|
|
13
|
+
SYSTEM_KIND_ENTERPRISE_KNOWLEDGE,
|
|
14
|
+
WORKSPACE_ENTERPRISE_KNOWLEDGE
|
|
15
|
+
} = require('./enterprise-knowledge-paths');
|
|
16
|
+
|
|
17
|
+
function readSystemKind(application) {
|
|
18
|
+
if (!application || typeof application !== 'object') {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
const kind = application.systemKind || application.systemKindKey;
|
|
22
|
+
return typeof kind === 'string' ? kind.trim() : '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isDigitalWorkerKind(application) {
|
|
26
|
+
return readSystemKind(application) === SYSTEM_KIND_DIGITAL_WORKER;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isEnterpriseKnowledgeKind(application) {
|
|
30
|
+
return readSystemKind(application) === SYSTEM_KIND_ENTERPRISE_KNOWLEDGE;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isPlatformShellKind(application) {
|
|
34
|
+
return isDigitalWorkerKind(application) || isEnterpriseKnowledgeKind(application);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isRoleAssistantWorkspace(baseDir) {
|
|
38
|
+
return String(baseDir || '').trim() === WORKSPACE_ROLE_ASSISTANT;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isEnterpriseKnowledgeWorkspace(baseDir) {
|
|
42
|
+
return String(baseDir || '').trim() === WORKSPACE_ENTERPRISE_KNOWLEDGE;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isPlatformShellWorkspace(baseDir) {
|
|
46
|
+
return isRoleAssistantWorkspace(baseDir) || isEnterpriseKnowledgeWorkspace(baseDir);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function throwIfPlatformShellHasNoDeployJson(appName, baseDir) {
|
|
50
|
+
if (!isPlatformShellWorkspace(baseDir)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(
|
|
54
|
+
`'${appName}' is a Role Assistant or Enterprise Knowledge package and does not use ` +
|
|
55
|
+
'application.yaml or deployment JSON. Publish settings and Evidence with: ' +
|
|
56
|
+
`aifabrix upload ${appName} --env <dev|tst|pro>`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = {
|
|
61
|
+
readSystemKind,
|
|
62
|
+
isDigitalWorkerKind,
|
|
63
|
+
isEnterpriseKnowledgeKind,
|
|
64
|
+
isPlatformShellKind,
|
|
65
|
+
isRoleAssistantWorkspace,
|
|
66
|
+
isEnterpriseKnowledgeWorkspace,
|
|
67
|
+
isPlatformShellWorkspace,
|
|
68
|
+
throwIfPlatformShellHasNoDeployJson
|
|
69
|
+
};
|
|
@@ -101,10 +101,59 @@ function getLocalPortFromPath(variablesPath) {
|
|
|
101
101
|
return (p !== undefined && p !== null) ? p : null;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Connected Systems (`app.type: external`) have no HTTP listen port.
|
|
106
|
+
* @param {Object|null|undefined} variables - Parsed application config
|
|
107
|
+
* @returns {boolean}
|
|
108
|
+
*/
|
|
109
|
+
function isExternalAppDoc(variables) {
|
|
110
|
+
return Boolean(variables && variables.app && variables.app.type === 'external');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @param {string|null|undefined} variablesPath - Path to application config
|
|
115
|
+
* @returns {boolean}
|
|
116
|
+
*/
|
|
117
|
+
function isExternalAppPath(variablesPath) {
|
|
118
|
+
return isExternalAppDoc(loadVariablesFromPath(variablesPath));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Drop PORT assignments from resolved .env content (Connected Systems).
|
|
123
|
+
* @param {string} envContent
|
|
124
|
+
* @returns {string}
|
|
125
|
+
*/
|
|
126
|
+
function stripListenPortEnvLines(envContent) {
|
|
127
|
+
if (!envContent || typeof envContent !== 'string') {
|
|
128
|
+
return envContent;
|
|
129
|
+
}
|
|
130
|
+
return envContent
|
|
131
|
+
.split(/\r?\n/)
|
|
132
|
+
.filter((line) => !/^\s*PORT\s*=/.test(line))
|
|
133
|
+
.join('\n');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Set or append PORT for builder apps that listen on HTTP.
|
|
138
|
+
* @param {string} envContent
|
|
139
|
+
* @param {number} appPort
|
|
140
|
+
* @returns {string}
|
|
141
|
+
*/
|
|
142
|
+
function assignListenPortEnvLine(envContent, appPort) {
|
|
143
|
+
if (/^PORT\s*=.*$/m.test(envContent)) {
|
|
144
|
+
return envContent.replace(/^PORT\s*=\s*.*$/m, `PORT=${appPort}`);
|
|
145
|
+
}
|
|
146
|
+
return `${envContent}\nPORT=${appPort}\n`;
|
|
147
|
+
}
|
|
148
|
+
|
|
104
149
|
module.exports = {
|
|
105
150
|
getContainerPort,
|
|
106
151
|
getLocalPort,
|
|
107
152
|
getContainerPortFromPath,
|
|
108
153
|
getLocalPortFromPath,
|
|
109
|
-
loadVariablesFromPath
|
|
154
|
+
loadVariablesFromPath,
|
|
155
|
+
isExternalAppDoc,
|
|
156
|
+
isExternalAppPath,
|
|
157
|
+
stripListenPortEnvLines,
|
|
158
|
+
assignListenPortEnvLine
|
|
110
159
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Treat clustered -name as the long --name option so quoted names with spaces work.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Commander parses -name as -n plus leftover letters
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {string[]} argv
|
|
13
|
+
* @returns {string[]}
|
|
14
|
+
*/
|
|
15
|
+
function rewriteClusteredNameFlag(argv) {
|
|
16
|
+
const args = Array.isArray(argv) ? argv : [];
|
|
17
|
+
return args.map((arg) => (arg === '-name' ? '--name' : arg));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = { rewriteClusteredNameFlag };
|
|
@@ -121,30 +121,33 @@ function firstExistingUnderRoot(disk, root, folderNames) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Resolves role-assistant
|
|
125
|
-
*
|
|
124
|
+
* Resolves role-assistant/<systemKey> by exact folder name.
|
|
125
|
+
* Does not map a connected-system key onto an ra- package.
|
|
126
|
+
* @param {string} systemKey
|
|
126
127
|
* @returns {string}
|
|
127
128
|
*/
|
|
128
|
-
function getRoleAssistantPath(
|
|
129
|
-
if (!
|
|
129
|
+
function getRoleAssistantPath(systemKey) {
|
|
130
|
+
if (!systemKey || typeof systemKey !== 'string') {
|
|
131
|
+
throw new Error('Role key is required and must be a string');
|
|
132
|
+
}
|
|
133
|
+
const folderName = systemKey.trim();
|
|
134
|
+
if (!folderName) {
|
|
130
135
|
throw new Error('Role key is required and must be a string');
|
|
131
136
|
}
|
|
132
137
|
const disk = nodeFs();
|
|
133
|
-
const folders = roleAssistantFolderCandidates(roleKey);
|
|
134
|
-
const preferred = roleAssistantSystemKey(roleKey);
|
|
135
138
|
const cwdRoot = getCwdRoleAssistantRoot();
|
|
136
139
|
const matRoot = path.join(getMaterializationParent(), WORKSPACE_ROLE_ASSISTANT);
|
|
137
140
|
|
|
138
141
|
const existing =
|
|
139
|
-
firstExistingUnderRoot(disk, cwdRoot,
|
|
140
|
-
firstExistingUnderRoot(disk, matRoot,
|
|
142
|
+
firstExistingUnderRoot(disk, cwdRoot, [folderName]) ||
|
|
143
|
+
firstExistingUnderRoot(disk, matRoot, [folderName]);
|
|
141
144
|
if (existing) {
|
|
142
145
|
return existing;
|
|
143
146
|
}
|
|
144
147
|
if (cwdRoot) {
|
|
145
|
-
return path.join(cwdRoot,
|
|
148
|
+
return path.join(cwdRoot, folderName);
|
|
146
149
|
}
|
|
147
|
-
return path.join(matRoot,
|
|
150
|
+
return path.join(matRoot, folderName);
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
module.exports = {
|
|
@@ -14,6 +14,10 @@ const path = require('path');
|
|
|
14
14
|
const { detectAppType } = require('./paths');
|
|
15
15
|
const { resolveApplicationConfigPath } = require('./app-config-resolver');
|
|
16
16
|
const { loadConfigFile } = require('./config-format');
|
|
17
|
+
const {
|
|
18
|
+
isRoleAssistantWorkspace,
|
|
19
|
+
isEnterpriseKnowledgeWorkspace
|
|
20
|
+
} = require('./platform-shell-package');
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* Resolves schemaBasePath from application config
|
|
@@ -314,7 +318,13 @@ async function resolveExternalFiles(appName, options = {}) {
|
|
|
314
318
|
throw new Error('App name is required and must be a string');
|
|
315
319
|
}
|
|
316
320
|
|
|
317
|
-
const { appPath } = await detectAppType(appName, options);
|
|
321
|
+
const { appPath, baseDir } = await detectAppType(appName, options);
|
|
322
|
+
if (isEnterpriseKnowledgeWorkspace(baseDir)) {
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
325
|
+
if (isRoleAssistantWorkspace(baseDir)) {
|
|
326
|
+
return [resolveRoleAssistantSettingsFile(appPath)];
|
|
327
|
+
}
|
|
318
328
|
const variables = await loadAndValidateVariables(appPath);
|
|
319
329
|
|
|
320
330
|
if (!variables.externalIntegration) {
|
|
@@ -17,7 +17,7 @@ const { rewriteInfraEndpoints, getEnvHosts, getServicePort, getServiceHost, getL
|
|
|
17
17
|
const { loadEnvConfig } = require('./env-config-loader');
|
|
18
18
|
const { updateContainerPortInEnvFile } = require('./env-ports');
|
|
19
19
|
const { buildEnvVarMap } = require('./env-map');
|
|
20
|
-
const { getLocalPortFromPath } = require('./port-resolver');
|
|
20
|
+
const { getLocalPortFromPath, isExternalAppPath, assignListenPortEnvLine } = require('./port-resolver');
|
|
21
21
|
const { readYamlAtPath, applyCanonicalSecretsOverride } = require('./secrets-canonical');
|
|
22
22
|
const { collectUniqueKvPathStrings, isCommentOrEmptyLine, activeEnvLineForKvScan, envLineWithoutInlineComment } = require('./secrets-kv-refs');
|
|
23
23
|
|
|
@@ -407,20 +407,6 @@ async function getLocalEnvWithOverrides() {
|
|
|
407
407
|
return localEnv;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
/**
|
|
411
|
-
* Updates PORT variable in content
|
|
412
|
-
* @function updatePortVariable
|
|
413
|
-
* @param {string} envContent - Environment content
|
|
414
|
-
* @param {number} appPort - Application port
|
|
415
|
-
* @returns {string} Updated content
|
|
416
|
-
*/
|
|
417
|
-
function updatePortVariable(envContent, appPort) {
|
|
418
|
-
if (/^PORT\s*=.*$/m.test(envContent)) {
|
|
419
|
-
return envContent.replace(/^PORT\s*=\s*.*$/m, `PORT=${appPort}`);
|
|
420
|
-
}
|
|
421
|
-
return `${envContent}\nPORT=${appPort}\n`;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
410
|
/**
|
|
425
411
|
* Builds environment variables for interpolation
|
|
426
412
|
* @async
|
|
@@ -446,6 +432,7 @@ async function buildEnvVarsForInterpolation(devIdNum) {
|
|
|
446
432
|
}
|
|
447
433
|
|
|
448
434
|
async function adjustLocalEnvPortsInContent(envContent, variablesPath) {
|
|
435
|
+
const skipListenPort = isExternalAppPath(variablesPath);
|
|
449
436
|
const devIdNum = await getDeveloperIdNumber();
|
|
450
437
|
const localEnv = await getLocalEnvWithOverrides();
|
|
451
438
|
const { localHostPort } = require('./declarative-url-ports');
|
|
@@ -453,15 +440,19 @@ async function adjustLocalEnvPortsInContent(envContent, variablesPath) {
|
|
|
453
440
|
const baseListen = await resolveManifestListenPort(variablesPath, localEnv, envContent);
|
|
454
441
|
const appPort = localHostPort(baseListen, devIdNum);
|
|
455
442
|
|
|
456
|
-
let updated =
|
|
457
|
-
|
|
443
|
+
let updated = skipListenPort ? envContent : assignListenPortEnvLine(envContent, appPort);
|
|
444
|
+
if (!skipListenPort) {
|
|
445
|
+
updated = updateLocalhostUrls(updated, baseListen, appPort);
|
|
446
|
+
}
|
|
458
447
|
updated = await rewriteInfraEndpoints(updated, 'local');
|
|
459
448
|
|
|
460
449
|
const envVars = await buildEnvVarsForInterpolation(devIdNum);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
450
|
+
if (!skipListenPort) {
|
|
451
|
+
envVars.PORT = String(appPort);
|
|
452
|
+
const portVar = getPortVarFromEnvTemplatePath(variablesPath);
|
|
453
|
+
if (portVar) {
|
|
454
|
+
envVars[portVar] = String(appPort);
|
|
455
|
+
}
|
|
465
456
|
}
|
|
466
457
|
updated = interpolateEnvVars(updated, envVars);
|
|
467
458
|
|
|
@@ -212,6 +212,15 @@ async function tryClientTokenAuth(environment, appName, controllerUrl) {
|
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
function throwNoDeploymentAuth(credentialApp) {
|
|
216
|
+
const err = new Error(
|
|
217
|
+
`No authentication method available. For CI: set AIFABRIX_DEPLOYMENT_AUTH=client-credentials and MISO_CLIENTID/MISO_CLIENTSECRET in .env or '${credentialApp}-client-idKeyVault' in secrets.local.yaml. For interactive use: aifabrix login`
|
|
218
|
+
);
|
|
219
|
+
err.statusCode = 401;
|
|
220
|
+
err.authFailure = true;
|
|
221
|
+
throw err;
|
|
222
|
+
}
|
|
223
|
+
|
|
215
224
|
/**
|
|
216
225
|
* Get deployment authentication configuration with priority:
|
|
217
226
|
* 1. Device token → type 'bearer' (user token) → send as Authorization: Bearer
|
|
@@ -265,11 +274,7 @@ async function getDeploymentAuth(controllerUrl, environment, appName, options =
|
|
|
265
274
|
}
|
|
266
275
|
}
|
|
267
276
|
|
|
268
|
-
|
|
269
|
-
'No authentication method available. For CI: set AIFABRIX_DEPLOYMENT_AUTH=client-credentials and ' +
|
|
270
|
-
`MISO_CLIENTID/MISO_CLIENTSECRET in .env or '${credentialApp}-client-idKeyVault' in secrets.local.yaml. ` +
|
|
271
|
-
'For interactive use: aifabrix login'
|
|
272
|
-
);
|
|
277
|
+
throwNoDeploymentAuth(credentialApp);
|
|
273
278
|
}
|
|
274
279
|
|
|
275
280
|
/**
|
|
@@ -23,6 +23,10 @@ const { validateControllerManifest } = require('./external-manifest-validator');
|
|
|
23
23
|
const { runExternalValidateWithOptionalCertSync } = require('./validate-external-cert-sync');
|
|
24
24
|
const { validateExternalFile } = require('./validate-external-file');
|
|
25
25
|
const { reservedSystemKeyError } = require('./reserved-system-key-prefixes');
|
|
26
|
+
const {
|
|
27
|
+
isRoleAssistantWorkspace,
|
|
28
|
+
isEnterpriseKnowledgeWorkspace
|
|
29
|
+
} = require('../utils/platform-shell-package');
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
32
|
* Validates a file path (detects type and validates)
|
|
@@ -323,6 +327,32 @@ function aggregateExternalValidationSteps(steps, appPath) {
|
|
|
323
327
|
};
|
|
324
328
|
}
|
|
325
329
|
|
|
330
|
+
function skippedValidationStep() {
|
|
331
|
+
return { valid: true, errors: [], warnings: [], skipped: true };
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function skippedComponentsStep() {
|
|
335
|
+
return { valid: true, errors: [], warnings: [], files: [], skipped: true };
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
async function validatePlatformShellPackage(appName, baseDir, appPath, options) {
|
|
339
|
+
if (isEnterpriseKnowledgeWorkspace(baseDir)) {
|
|
340
|
+
return aggregateExternalValidationSteps({
|
|
341
|
+
application: skippedValidationStep(),
|
|
342
|
+
components: skippedComponentsStep(),
|
|
343
|
+
manifest: skippedValidationStep()
|
|
344
|
+
}, appPath);
|
|
345
|
+
}
|
|
346
|
+
if (!isRoleAssistantWorkspace(baseDir)) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
return aggregateExternalValidationSteps({
|
|
350
|
+
application: skippedValidationStep(),
|
|
351
|
+
components: await validateComponentsStep(appName, options),
|
|
352
|
+
manifest: skippedValidationStep()
|
|
353
|
+
}, appPath);
|
|
354
|
+
}
|
|
355
|
+
|
|
326
356
|
/**
|
|
327
357
|
* Validates external system completely (components + full manifest)
|
|
328
358
|
* Performs step-by-step validation: application config → components → full manifest
|
|
@@ -355,6 +385,16 @@ async function validateExternalSystemComplete(appName, options = {}) {
|
|
|
355
385
|
};
|
|
356
386
|
|
|
357
387
|
const externalOptions = { ...options };
|
|
388
|
+
const platformResult = await validatePlatformShellPackage(
|
|
389
|
+
appName,
|
|
390
|
+
baseDir,
|
|
391
|
+
appPath,
|
|
392
|
+
externalOptions
|
|
393
|
+
);
|
|
394
|
+
if (platformResult) {
|
|
395
|
+
return platformResult;
|
|
396
|
+
}
|
|
397
|
+
|
|
358
398
|
steps.application = await validateApplicationStep(appName, externalOptions);
|
|
359
399
|
steps.components = await validateComponentsStep(appName, externalOptions);
|
|
360
400
|
|
package/package.json
CHANGED
package/templates/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Application templates are folder-based and located under `templates/applications
|
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| `aifabrix-builder/builder/builder-api/` | `templates/applications/builder-api/` |
|
|
23
23
|
| `aifabrix-miso/builder/miso-controller/` (`env.template`, `rbac.yaml`, `application.yaml`) | `templates/applications/miso-controller/` |
|
|
24
|
-
| `aifabrix-miso/builder/keycloak/` (`env.template`, `application.yaml`) | `templates/applications/keycloak/` |
|
|
24
|
+
| `aifabrix-miso/builder/keycloak/` (`env.template`, `application.yaml`, `Dockerfile`, `cimd-lenient-parse/`) | `templates/applications/keycloak/` |
|
|
25
25
|
| `aifabrix-dataplane/builder/dataplane/` (`env.template`, `rbac.yaml`, `application.yaml`) | `templates/applications/dataplane/` |
|
|
26
26
|
|
|
27
27
|
**Schema master (dataplane):** Also copies dataplane `app/schemas/json/` core integration schemas + `type/*` and `configs/deployment-rules.yaml` into `lib/schema/` (same contract as dataplane `make sync-json`). Do not hand-edit those mirrors — edit dataplane SSOT, then sync. Builder-owned schemas in `lib/schema/` (wizard, infra, etc.) are left alone.
|
|
@@ -13,7 +13,7 @@ ENV NODE_ENV=production \
|
|
|
13
13
|
WORKDIR /app
|
|
14
14
|
|
|
15
15
|
RUN apt-get update \
|
|
16
|
-
&& apt-get install -y --no-install-recommends dumb-init \
|
|
16
|
+
&& apt-get install -y --no-install-recommends dumb-init ca-certificates \
|
|
17
17
|
&& rm -rf /var/lib/apt/lists/*
|
|
18
18
|
|
|
19
19
|
COPY package.json package-lock.json ./
|
|
@@ -29,12 +29,19 @@ MISO_CLIENTSECRET=kv://builder-api-client-secretKeyVault
|
|
|
29
29
|
|
|
30
30
|
# Internal: controller API for token validation (supports all miso-controller auth modes)
|
|
31
31
|
MISO_CONTROLLER_URL=url://miso-controller-internal
|
|
32
|
+
# Public: OAuth profile and remaining-step links shown to vendors (not Docker DNS)
|
|
33
|
+
MISO_CONTROLLER_PUBLIC_URL=url://miso-controller-public
|
|
32
34
|
|
|
33
35
|
# Internal: server-to-dataplane API (MCP execute, upload, governance)
|
|
34
36
|
DATAPLANE_URL=url://dataplane-internal
|
|
37
|
+
# Public: Slack/Teams/ChatGPT callbacks, packages, and portal remaining-step URLs
|
|
38
|
+
DATAPLANE_PUBLIC_URL=url://dataplane-public
|
|
35
39
|
|
|
36
40
|
DEFAULT_ENVIRONMENT=dev
|
|
37
41
|
|
|
42
|
+
# Browser Origin allowlist for portal calls (CORS). url:// expands at resolve.
|
|
43
|
+
ALLOWED_ORIGINS=http://localhost:*,url://host-public,url://host-private,url://dataplane-host-public,url://dataplane-host-private
|
|
44
|
+
|
|
38
45
|
# COM-generated Enterprise MCP owner system (normal MCP execute — no dataplane adapter)
|
|
39
46
|
ENTERPRISE_MCP_SYSTEM_KEY=enterprise-integration-lifecycle
|
|
40
47
|
|
|
@@ -5,7 +5,7 @@ app:
|
|
|
5
5
|
description: "AI Fabrix Dataplane is a secure, in-tenant integration and automation layer that supplies governed, normalized, and explainable enterprise data to AI agents. Using CIP as a declarative standard, it enforces RBAC and ABAC, executes integrations, and exposes trusted data via MCP and OpenAPI."
|
|
6
6
|
type: webapp
|
|
7
7
|
language: python # Explicitly specify Python language
|
|
8
|
-
version: 2.0.
|
|
8
|
+
version: 2.0.47
|
|
9
9
|
# Image Configuration
|
|
10
10
|
# Set tag to match your build (example: aifabrix build dataplane -t 1.0.0).
|
|
11
11
|
# Registry is required so the controller can pull the image (avoids docker-not-found on the controller host).
|
|
@@ -71,14 +71,15 @@ build:
|
|
|
71
71
|
envOutputPath: ../../.env # Copy to repo root for local dev
|
|
72
72
|
language: python # Runtime language for template selection (typescript or python)
|
|
73
73
|
# Dev reload: polling + watch /app/app only (avoids EMFILE on full repo bind-mount). See run_local.py, make af-reload.
|
|
74
|
-
reloadStart: WATCHFILES_FORCE_POLLING=1 uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-3001} --reload --reload-dir /app/app
|
|
74
|
+
reloadStart: WATCHFILES_FORCE_POLLING=1 uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-3001} --reload --reload-dir /app/app --timeout-graceful-shutdown 15
|
|
75
75
|
# Pulled-image local compose (no bind-mount): drives `command` in generated docker-compose. Override for non-standard images (e.g. stub ACR tags).
|
|
76
|
-
|
|
76
|
+
# Early ASGI (boot.api) binds PORT before heavy app.main import — Azure App Service warmup.
|
|
77
|
+
imageRun: exec python -m uvicorn boot.api:app --host 0.0.0.0 --port ${PORT:-3001}
|
|
77
78
|
# Image policy (442.0): explicit Dockerfile COPY; worker/beat via python -m app.core.*
|
|
78
79
|
# integration/ in image: only onboarding-catalog.json keys (+ deploy/application per key).
|
|
79
80
|
worker: true
|
|
80
|
-
imageRunWorker: exec python -m
|
|
81
|
-
imageRunBeat: exec python -m
|
|
81
|
+
imageRunWorker: exec python -m boot.celery_worker
|
|
82
|
+
imageRunBeat: exec python -m boot.celery_beat
|
|
82
83
|
# Optional one-shot before ANY long-running role (api/worker/beat). Run exactly once per
|
|
83
84
|
# aifabrix run / Deployment — never once-per-container. Schema: application-schema build.deployJob.
|
|
84
85
|
# Local: aifabrix run; remote: miso Deployment via miso-azure (not Docker on controller).
|
|
@@ -21,7 +21,7 @@ AIFABRIX_PLATFORM_LANGUAGE=en
|
|
|
21
21
|
# Docker default (no volume): use LOG_FILE_PATH=/app/logs/app.log (directory created in image).
|
|
22
22
|
# Production with persistent logs: use /mnt/data/logs/app.log and mount a volume at /mnt/data.
|
|
23
23
|
LOG_FILE_PATH=/mnt/data/logs/app.log
|
|
24
|
-
# If true, run without
|
|
24
|
+
# If true, run without Celery (single process). Pair with build.worker: false so worker/beat are not started.
|
|
25
25
|
LOCAL_MODE=false
|
|
26
26
|
|
|
27
27
|
# Celery worker process tuning (dataplane-worker container; optional overrides)
|
|
@@ -44,7 +44,7 @@ API_KEY_BYPASS_ROLES=full-access
|
|
|
44
44
|
|
|
45
45
|
# API Configuration
|
|
46
46
|
API_V1_STR=/api/v1
|
|
47
|
-
VERSION=2.0.
|
|
47
|
+
VERSION=2.0.47
|
|
48
48
|
# Minimum supported aifabrix-builder CLI semver (advertised on /health and /api/v1/health; empty = no gate)
|
|
49
49
|
# MIN_BUILDER_CLI_VERSION=2.45.0
|
|
50
50
|
MIN_BUILDER_CLI_VERSION=2.45.5
|
|
@@ -50,6 +50,11 @@ roles:
|
|
|
50
50
|
description: "Discover business context for external systems via REST and MCP"
|
|
51
51
|
groups: ["AI-Fabrix-External-System-Discoverers"]
|
|
52
52
|
|
|
53
|
+
- name: "Everyone"
|
|
54
|
+
value: "aifabrix-everyone"
|
|
55
|
+
description: "Authenticated-user consume access for Enterprise LLM and platform search (not a Role Assistant)"
|
|
56
|
+
groups: ["AI-Fabrix-Everyone"]
|
|
57
|
+
|
|
53
58
|
permissions:
|
|
54
59
|
# Credential management
|
|
55
60
|
- name: "credential:create"
|
|
@@ -314,11 +319,11 @@ permissions:
|
|
|
314
319
|
|
|
315
320
|
# Search operations
|
|
316
321
|
- name: "document:search"
|
|
317
|
-
roles: ["aifabrix-
|
|
322
|
+
roles: ["aifabrix-everyone"]
|
|
318
323
|
description: "Search documents"
|
|
319
324
|
|
|
320
325
|
- name: "record:search"
|
|
321
|
-
roles: ["aifabrix-
|
|
326
|
+
roles: ["aifabrix-everyone"]
|
|
322
327
|
description: "Search records"
|
|
323
328
|
|
|
324
329
|
- name: "external-system:discover"
|