@aifabrix/builder 2.45.5 → 2.47.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/.cursor/rules/cli-layout.mdc +2 -0
- package/.cursor/rules/cli-product-neutral.mdc +43 -0
- package/.cursor/rules/project-rules.mdc +1 -0
- package/.npmrc.token +1 -0
- package/.temp/jest-protection-convert/run-IFN2nv/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-IvmKLO/.protection/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-convert/run-SdvblF/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-b51TsW/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-fiLmb1/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-qYGHMU/.protection/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-Mq5re8/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-f3u4YL/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-iQtd1O/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-mdmz5M/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-qbKYxQ/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-yzlJy6/hubspot-companies.yaml +17 -0
- package/.temp/validation/summary.txt +5 -0
- package/README.md +43 -17
- package/integration/hubspot-test/test-artifacts/wizard-hubspot-credential-real.yaml +1 -1
- package/integration/hubspot-test/test-artifacts/wizard-hubspot-env-vars.yaml +1 -1
- package/jest.config.default.js +2 -1
- package/jest.config.isolated.js +2 -1
- package/jest.global-live-fabrix-hooks.js +36 -0
- package/jest.isolated-projects.js +146 -0
- package/jest.projects.js +65 -136
- package/lib/api/api-response-errors.js +124 -0
- package/lib/api/dataplane-health.api.js +19 -7
- package/lib/api/governance-scenario-pack.api.js +159 -0
- package/lib/api/index.js +43 -3
- package/lib/api/lifecycle.api.js +98 -0
- package/lib/api/pipeline.api.js +3 -1
- package/lib/api/records-bulk.api.js +14 -1
- package/lib/api/resource-types.api.js +107 -0
- package/lib/api/runtime-configuration.api.js +72 -0
- package/lib/api/types/resource-types.types.js +45 -0
- package/lib/api/user-groups.api.js +9 -9
- package/lib/api/users.api.js +8 -8
- package/lib/api/validation-runner.js +3 -1
- package/lib/api/wizard.api.js +10 -2
- package/lib/app/deploy-config.js +4 -1
- package/lib/app/down.js +78 -27
- package/lib/app/index.js +2 -2
- package/lib/app/push.js +4 -5
- package/lib/app/register.js +7 -4
- package/lib/app/run-env-compose.js +84 -30
- package/lib/app/run-resolve-image.js +2 -1
- package/lib/app/run-stop-containers.js +113 -0
- package/lib/app/run.js +1 -31
- package/lib/app/show-display.js +35 -0
- package/lib/app/show.js +32 -1
- package/lib/build/index.js +22 -5
- package/lib/build/miso-controller-npm-sdk-guard.js +25 -0
- package/lib/certification/sync-system-certification.js +13 -6
- package/lib/channels/add-channel.js +348 -0
- package/lib/channels/channel-artifact-generator.js +141 -0
- package/lib/channels/channel-audit.js +101 -0
- package/lib/channels/channel-auth-context.js +37 -0
- package/lib/channels/channel-credential.js +200 -0
- package/lib/channels/channel-display-name.js +64 -0
- package/lib/channels/channel-external-system.js +106 -0
- package/lib/channels/channel-integration-generator.js +274 -0
- package/lib/channels/channel-probe.js +89 -0
- package/lib/channels/channel-runtime-resolver.js +152 -0
- package/lib/channels/channel-status-display.js +141 -0
- package/lib/channels/channel-targets.js +115 -0
- package/lib/cli/index.js +20 -4
- package/lib/cli/infra-guided-auth.js +109 -0
- package/lib/cli/infra-guided.js +84 -81
- package/lib/cli/setup-app.help.js +0 -31
- package/lib/cli/setup-app.js +82 -5
- package/lib/cli/setup-app.test-commands.js +5 -57
- package/lib/cli/setup-auth.js +25 -0
- package/lib/cli/setup-certification-commands.js +147 -0
- package/lib/cli/setup-certification.help.js +141 -0
- package/lib/cli/setup-environment.js +19 -2
- package/lib/cli/setup-external-system-help.js +62 -0
- package/lib/cli/setup-external-system.js +25 -3
- package/lib/cli/setup-infra-up-dataplane-action.js +2 -2
- package/lib/cli/setup-infra-up-platform-action.js +2 -1
- package/lib/cli/setup-infra.js +9 -1
- package/lib/cli/setup-platform.js +6 -1
- package/lib/cli/setup-secrets.js +33 -1
- package/lib/cli/setup-utility-help-after.js +25 -2
- package/lib/cli/setup-utility-repair.js +198 -0
- package/lib/cli/setup-utility-resolve.js +44 -5
- package/lib/cli/setup-utility-validate.js +197 -0
- package/lib/cli/setup-utility.js +4 -239
- package/lib/commands/app-logs.js +54 -26
- package/lib/commands/app.js +41 -0
- package/lib/commands/auth-status-client-tokens.js +214 -0
- package/lib/commands/auth-status-dataplane-version.js +142 -68
- package/lib/commands/auth-status.js +43 -54
- package/lib/commands/channel.js +58 -0
- package/lib/commands/datasource-test-trust-cli.js +27 -23
- package/lib/commands/datasource-unified-test-cli.js +6 -3
- package/lib/commands/datasource-unified-test-cli.options.js +5 -1
- package/lib/commands/datasource.js +8 -8
- package/lib/commands/dev-show-display.js +8 -1
- package/lib/commands/governance-cli-shared.js +94 -0
- package/lib/commands/governance-command-action.js +132 -0
- package/lib/commands/governance-download-external.js +34 -0
- package/lib/commands/governance-generate-external.js +71 -0
- package/lib/commands/governance-upload-external.js +36 -0
- package/lib/commands/governance-verify-external.js +64 -0
- package/lib/commands/governance.js +144 -0
- package/lib/commands/identity-apply-sync.js +49 -8
- package/lib/commands/identity-group-cli.js +66 -26
- package/lib/commands/identity-membership-role-cache.js +58 -37
- package/lib/commands/identity-shared.js +22 -1
- package/lib/commands/identity-user-cli.js +80 -34
- package/lib/commands/lifecycle-command-action.js +123 -0
- package/lib/commands/lifecycle-external.js +268 -0
- package/lib/commands/login.js +11 -2
- package/lib/commands/repair-auth-apply.js +153 -0
- package/lib/commands/repair-auth-config.js +8 -13
- package/lib/commands/repair-changed-files.js +41 -0
- package/lib/commands/repair-datasource-com-v2.js +15 -0
- package/lib/commands/repair-datasource-keys.js +4 -1
- package/lib/commands/repair-datasource-run.js +59 -0
- package/lib/commands/repair-datasource-service-contract.js +206 -0
- package/lib/commands/repair-datasource-test-payload.js +259 -0
- package/lib/commands/repair-datasource.js +49 -64
- package/lib/commands/repair-env-template.js +76 -25
- package/lib/commands/repair-external-run.js +216 -0
- package/lib/commands/repair-openapi-sync.js +49 -4
- package/lib/commands/repair-persist.js +4 -0
- package/lib/commands/repair-rbac.js +52 -1
- package/lib/commands/repair-steps.js +160 -0
- package/lib/commands/repair-system-alignment.js +7 -4
- package/lib/commands/repair.js +29 -296
- package/lib/commands/resource-type.js +371 -0
- package/lib/commands/secrets-get.js +184 -0
- package/lib/commands/secrets-remove-all.js +3 -1
- package/lib/commands/setup-image-refresh.js +146 -0
- package/lib/commands/setup-modes.js +158 -162
- package/lib/commands/setup-platform-auth.js +76 -0
- package/lib/commands/setup-prompts-admin.js +244 -0
- package/lib/commands/setup-prompts-platform-mode.js +70 -0
- package/lib/commands/setup-prompts-validators.js +36 -0
- package/lib/commands/setup-prompts.js +24 -76
- package/lib/commands/setup-run-context.js +45 -0
- package/lib/commands/setup-spinners.js +39 -0
- package/lib/commands/setup.js +27 -5
- package/lib/commands/teardown.js +39 -0
- package/lib/commands/test-e2e-external.js +24 -8
- package/lib/commands/test-governance-external.js +3 -24
- package/lib/commands/test-trust-external.js +48 -100
- package/lib/commands/up-common.js +57 -13
- package/lib/commands/up-dataplane.js +56 -15
- package/lib/commands/upload-publish-context.js +75 -0
- package/lib/commands/upload-sidecar-followups.js +89 -0
- package/lib/commands/upload.js +113 -110
- package/lib/commands/verify-governance-combined-external.js +61 -0
- package/lib/commands/verify-governance-command-action.js +64 -0
- package/lib/commands/verify-governance-db.js +102 -0
- package/lib/commands/verify-governance-external.js +77 -0
- package/lib/commands/verify-governance-result-builders.js +71 -0
- package/lib/commands/verify-operations-command-action.js +68 -0
- package/lib/commands/verify-operations-external.js +268 -0
- package/lib/commands/verify-operations-persist.js +75 -0
- package/lib/commands/verify-operations-step-plan.js +68 -0
- package/lib/commands/verify-operations-steps.js +111 -0
- package/lib/commands/verify-trust-command-action.js +73 -0
- package/lib/commands/verify-trust-external.js +59 -0
- package/lib/commands/wizard-config-normalizer.js +43 -23
- package/lib/commands/wizard-core.js +2 -0
- package/lib/core/admin-password-generator.js +38 -0
- package/lib/core/admin-secrets-bundle.js +111 -0
- package/lib/core/admin-secrets-env-overlay.js +62 -0
- package/lib/core/admin-secrets.js +32 -4
- package/lib/core/config-attach-extensions.js +3 -0
- package/lib/core/config-platform-controller.js +44 -0
- package/lib/core/config-setup-installation-profile.js +42 -0
- package/lib/core/config-setup-platform-mode.js +46 -0
- package/lib/core/config.js +46 -36
- package/lib/core/secrets-admin-env.js +6 -2
- package/lib/core/secrets-ensure.js +4 -0
- package/lib/core/secrets-env-content.js +54 -48
- package/lib/core/secrets-env-write.js +10 -1
- package/lib/core/secrets-infra-placeholder-sync.js +2 -0
- package/lib/core/setup-installation-profile.js +43 -0
- package/lib/core/setup-platform-mode.js +90 -0
- package/lib/datasource/agent-trust-debug-log.js +1 -1
- package/lib/datasource/agent-trust-run.js +5 -3
- package/lib/datasource/audit-evidence-extract-debug.js +30 -18
- package/lib/datasource/audit-evidence-extract.js +7 -4
- package/lib/datasource/audit-evidence-verify-matrix.js +54 -26
- package/lib/datasource/bulk-loader-run-batches.js +15 -3
- package/lib/datasource/capability/capability-diff-slice.js +2 -2
- package/lib/datasource/capability/capability-manifest.js +254 -0
- package/lib/datasource/capability/capability-resolve.js +3 -4
- package/lib/datasource/capability/copy-operations.js +5 -3
- package/lib/datasource/capability/remove-operations.js +2 -1
- package/lib/datasource/capability/run-capability-copy.js +32 -4
- package/lib/datasource/capability/run-capability-diff.js +3 -3
- package/lib/datasource/capability/run-capability-dimension.js +2 -4
- package/lib/datasource/capability/run-capability-edit.js +4 -7
- package/lib/datasource/capability/run-capability-relate.js +2 -4
- package/lib/datasource/capability/run-capability-remove.js +2 -4
- package/lib/datasource/capability/validate-capability-slice.js +2 -1
- package/lib/datasource/datasource-identifier.js +2 -1
- package/lib/datasource/datasource-load-export-context.js +3 -0
- package/lib/datasource/datasource-validate-display.js +1 -1
- package/lib/datasource/field-reference-validator.js +24 -3
- package/lib/datasource/log-cleaner.js +2 -2
- package/lib/datasource/log-viewer.js +8 -8
- package/lib/datasource/orphan-profiles-validator.js +98 -0
- package/lib/datasource/test-e2e.js +4 -1
- package/lib/datasource/unified-validation-run-body.js +3 -1
- package/lib/datasource/unified-validation-run.js +5 -2
- package/lib/datasource/validate.js +41 -23
- package/lib/deployment/environment-poll-status.js +138 -0
- package/lib/deployment/environment.js +42 -34
- package/lib/external-system/download-helpers.js +87 -0
- package/lib/external-system/download.js +78 -138
- package/lib/external-system/generator.js +1 -55
- package/lib/external-system/integration-auth-context.js +45 -0
- package/lib/external-system/test-auth.js +12 -5
- package/lib/external-system/test.js +16 -21
- package/lib/generator/builders.js +11 -1
- package/lib/generator/external-controller-manifest.js +18 -0
- package/lib/generator/split.js +3 -1
- package/lib/generator/wizard.js +1 -28
- package/lib/governance/governance-cli-errors.js +96 -0
- package/lib/governance/governance-download-display.js +38 -0
- package/lib/governance/governance-run-display.js +215 -25
- package/lib/identity/fk-reference.js +65 -0
- package/lib/identity/identity-apply-core.js +13 -58
- package/lib/identity/identity-apply-phases.js +5 -1
- package/lib/identity/identity-display.js +243 -0
- package/lib/identity/identity-response-helpers.js +52 -0
- package/lib/identity/identity-sync-errors.js +62 -0
- package/lib/identity/resolve-user-id.js +129 -0
- package/lib/identity/username-default.js +31 -0
- package/lib/infrastructure/admin-secrets-apply.js +84 -0
- package/lib/infrastructure/admin-secrets-ensure.js +130 -0
- package/lib/infrastructure/admin-secrets-resolve.js +95 -0
- package/lib/infrastructure/admin-secrets-sync.js +91 -0
- package/lib/infrastructure/helpers.js +23 -129
- package/lib/infrastructure/index.js +5 -6
- package/lib/infrastructure/orphan-infra-docker-teardown.js +11 -5
- package/lib/lifecycle/certification-progress.js +231 -0
- package/lib/lifecycle/dataplane-ui-url.js +145 -0
- package/lib/lifecycle/exit-codes.js +24 -0
- package/lib/lifecycle/json-envelope.js +25 -0
- package/lib/lifecycle/lifecycle-governance-options.js +51 -0
- package/lib/lifecycle/logger-quiet.js +29 -0
- package/lib/lifecycle/open-api-published.js +59 -0
- package/lib/lifecycle/operations-readiness-metrics.js +101 -0
- package/lib/lifecycle/product-model.js +196 -0
- package/lib/lifecycle/report-display-trust.js +70 -0
- package/lib/lifecycle/report-display.js +472 -0
- package/lib/lifecycle/scenario-upload.js +191 -0
- package/lib/lifecycle/verify-step-progress.js +87 -0
- package/lib/parameters/infra-kv-discovery.js +27 -2
- package/lib/protection/auth-context.js +10 -4
- package/lib/resolvers/datasource-resolver.js +2 -3
- package/lib/resolvers/resource-type-file.js +159 -0
- package/lib/schema/application-schema.json +17 -1
- package/lib/schema/datasource-test-run.schema.json +89 -6
- package/lib/schema/deployment-rules.yaml +2 -1
- package/lib/schema/external-datasource.schema.json +2947 -2619
- package/lib/schema/external-system.schema.json +1418 -761
- package/lib/schema/infra.parameter.yaml +45 -0
- package/lib/schema/type/credential-field-registry.json +103 -97
- package/lib/schema/type/document-storage.json +9 -5
- package/lib/utils/aifabrix-test-runtime-guard.js +125 -0
- package/lib/utils/api.js +55 -31
- package/lib/utils/app-relative-path-env.js +112 -0
- package/lib/utils/app-run-containers.js +25 -2
- package/lib/utils/authentication-shape.js +224 -0
- package/lib/utils/build-copy.js +36 -5
- package/lib/utils/build-resolve-image.js +66 -12
- package/lib/utils/celery-companion-apps.js +53 -0
- package/lib/utils/cli-secrets-error-format.js +83 -21
- package/lib/utils/cli-utils.js +20 -4
- package/lib/utils/compose-celery-worker.js +23 -0
- package/lib/utils/compose-generate-docker-compose.js +13 -1
- package/lib/utils/compose-traefik-ingress-base.js +16 -1
- package/lib/utils/config-secrets-path.js +46 -0
- package/lib/utils/configuration-env-resolver.js +36 -0
- package/lib/utils/controller-url.js +88 -1
- package/lib/utils/credential-secrets-env-kv.js +216 -0
- package/lib/utils/credential-secrets-env.js +175 -257
- package/lib/utils/dataplane-resolver.js +18 -2
- package/lib/utils/declarative-url-ports.js +27 -4
- package/lib/utils/deployment-auth-mode.js +41 -0
- package/lib/utils/developer-volume-id.js +33 -0
- package/lib/utils/docker-build.js +1 -4
- package/lib/utils/env-copy.js +14 -9
- package/lib/utils/env-kv-orphan-lines.js +43 -0
- package/lib/utils/error-formatters/network-errors.js +13 -4
- package/lib/utils/external-env-template.js +11 -3
- package/lib/utils/external-system-readiness-core.js +10 -0
- package/lib/utils/external-system-readiness-display.js +80 -23
- package/lib/utils/external-system-validators.js +8 -2
- package/lib/utils/health-check.js +4 -1
- package/lib/utils/help-builder.js +13 -8
- package/lib/utils/keycloak-realm-ready.js +101 -0
- package/lib/utils/load-cip-capacity-display-config.js +61 -15
- package/lib/utils/manifest-source-emit.js +2 -0
- package/lib/utils/paths.js +25 -0
- package/lib/utils/pipeline-upload-auth-retry.js +82 -0
- package/lib/utils/platform-controller-url.js +157 -0
- package/lib/utils/platform-kv-ref.js +57 -0
- package/lib/utils/postgres-platform-bootstrap.js +199 -0
- package/lib/utils/postgres-wipe.js +9 -2
- package/lib/utils/resolve-env-mode.js +47 -0
- package/lib/utils/runtime-configuration-download.js +189 -0
- package/lib/utils/runtime-configuration-values.js +119 -0
- package/lib/utils/schema-loader.js +19 -4
- package/lib/utils/secrets-generator.js +31 -25
- package/lib/utils/secrets-missing-error.js +164 -0
- package/lib/utils/service-url-label.js +81 -0
- package/lib/utils/setup-quiet-output.js +25 -0
- package/lib/utils/template-helpers.js +15 -0
- package/lib/utils/token-manager-client-credentials.js +201 -0
- package/lib/utils/token-manager-messages.js +8 -0
- package/lib/utils/token-manager-refresh.js +12 -2
- package/lib/utils/token-manager.js +86 -105
- package/lib/utils/upload-pipeline-ui.js +12 -5
- package/lib/utils/upload-sync-options.js +42 -0
- package/lib/utils/url-declarative-public-base.js +21 -3
- package/lib/utils/url-declarative-vdir-inactive-env.js +14 -4
- package/lib/utils/validation-poll-ui.js +8 -0
- package/lib/utils/validation-run-stage.js +45 -0
- package/lib/utils/worker-sidecars.js +142 -0
- package/lib/validation/external-manifest-validator.js +2 -0
- package/lib/validation/runtime-configuration-rules.js +98 -0
- package/lib/validation/validate-display-dimensions.js +154 -0
- package/lib/validation/validate-display-sections.js +276 -0
- package/lib/validation/validate-display-steps.js +67 -0
- package/lib/validation/validate-display.js +24 -402
- package/package.json +1 -1
- package/templates/applications/dataplane/application.yaml +7 -1
- package/templates/applications/dataplane/env.template +50 -14
- package/templates/applications/dataplane/rbac.yaml +108 -1
- package/templates/applications/miso-controller/application.yaml +2 -2
- package/templates/applications/miso-controller/env.template +53 -122
- package/templates/applications/miso-controller/rbac.yaml +28 -13
- package/templates/channels/chatgpt/install.template.md.hbs +49 -0
- package/templates/channels/chatgpt/manifest.template.json.hbs +9 -0
- package/templates/channels/microsoft-copilot/install.template.md.hbs +49 -0
- package/templates/channels/microsoft-copilot/manifest.template.json.hbs +8 -0
- package/templates/channels/slack/install.template.md.hbs +49 -0
- package/templates/channels/slack/manifest.template.json.hbs +66 -0
- package/templates/channels/teams-bot/install.template.md.hbs +49 -0
- package/templates/channels/teams-bot/manifest.template.json.hbs +13 -0
- package/templates/channels/web-embed/install.template.md.hbs +49 -0
- package/templates/channels/web-embed/manifest.template.json.hbs +8 -0
- package/templates/external-system/README.md.hbs +74 -17
- package/templates/python/docker-compose.hbs +75 -18
- package/templates/typescript/docker-compose.hbs +70 -17
- package/lib/commands/test-governance-command-action.js +0 -55
- package/lib/commands/test-trust-command-action.js +0 -118
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"display_information": {
|
|
3
|
+
"name": "{{appName}}",
|
|
4
|
+
"description": "{{appDescription}}",
|
|
5
|
+
"background_color": "#0F172A"
|
|
6
|
+
},
|
|
7
|
+
"features": {
|
|
8
|
+
"app_home": {
|
|
9
|
+
"home_tab_enabled": true,
|
|
10
|
+
"messages_tab_enabled": false,
|
|
11
|
+
"messages_tab_read_only_enabled": false
|
|
12
|
+
},
|
|
13
|
+
"bot_user": {
|
|
14
|
+
"display_name": "{{appName}}",
|
|
15
|
+
"always_online": true
|
|
16
|
+
},
|
|
17
|
+
"slash_commands": [
|
|
18
|
+
{
|
|
19
|
+
"command": "/aifabrix",
|
|
20
|
+
"url": "{{commandUrl}}",
|
|
21
|
+
"description": "Chat with your assistants",
|
|
22
|
+
"usage_hint": "[assistant or message]",
|
|
23
|
+
"should_escape": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"command": "/assistants",
|
|
27
|
+
"url": "{{commandUrl}}",
|
|
28
|
+
"description": "Show available assistants",
|
|
29
|
+
"should_escape": false
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"oauth_config": {
|
|
34
|
+
"redirect_urls": [
|
|
35
|
+
"{{oauthCallbackUrl}}"
|
|
36
|
+
],
|
|
37
|
+
"scopes": {
|
|
38
|
+
"bot": [
|
|
39
|
+
"app_mentions:read",
|
|
40
|
+
"chat:write",
|
|
41
|
+
"commands",
|
|
42
|
+
"im:history",
|
|
43
|
+
"im:read",
|
|
44
|
+
"im:write"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"pkce_enabled": false
|
|
48
|
+
},
|
|
49
|
+
"settings": {
|
|
50
|
+
"event_subscriptions": {
|
|
51
|
+
"request_url": "{{eventsUrl}}",
|
|
52
|
+
"bot_events": [
|
|
53
|
+
"app_mention",
|
|
54
|
+
"message.im"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"interactivity": {
|
|
58
|
+
"is_enabled": true,
|
|
59
|
+
"request_url": "{{interactionUrl}}"
|
|
60
|
+
},
|
|
61
|
+
"org_deploy_enabled": true,
|
|
62
|
+
"socket_mode_enabled": false,
|
|
63
|
+
"token_rotation_enabled": true,
|
|
64
|
+
"is_mcp_enabled": false
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# {{appName}} — assistant channel install
|
|
2
|
+
|
|
3
|
+
{{appDescription}}
|
|
4
|
+
|
|
5
|
+
Environment: **{{environment}}** · Credential key: `{{credentialKey}}`
|
|
6
|
+
|
|
7
|
+
## Platform callback URLs
|
|
8
|
+
|
|
9
|
+
Configure these in your Slack app, Teams bot registration, or platform admin console. Do not embed secrets in generated files — use AI Fabrix credential storage only.
|
|
10
|
+
|
|
11
|
+
{{#if eventsUrl}}
|
|
12
|
+
- **Events:** {{eventsUrl}}
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{#if interactionUrl}}
|
|
15
|
+
- **Interactivity:** {{interactionUrl}}
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#if commandUrl}}
|
|
18
|
+
- **Slash commands:** {{commandUrl}}
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if oauthCallbackUrl}}
|
|
21
|
+
- **OAuth redirect:** {{oauthCallbackUrl}}
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#if messagesUrl}}
|
|
24
|
+
- **Bot messages:** {{messagesUrl}}
|
|
25
|
+
{{/if}}
|
|
26
|
+
{{#if notificationsUrl}}
|
|
27
|
+
- **Notifications:** {{notificationsUrl}}
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{#if botConfigUrl}}
|
|
30
|
+
- **Bot config:** {{botConfigUrl}}
|
|
31
|
+
{{/if}}
|
|
32
|
+
|
|
33
|
+
## Assistant catalog
|
|
34
|
+
|
|
35
|
+
Runtime lists **assistants** available to each user from:
|
|
36
|
+
|
|
37
|
+
{{assistantCatalogUrl}}
|
|
38
|
+
|
|
39
|
+
## After admin approval
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
aifabrix app add-channel {{channelTarget}} --name "{{baseName}}"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Optional validation:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
aifabrix app add-channel {{channelTarget}} --name "{{baseName}}" --probe
|
|
49
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{appName}}",
|
|
3
|
+
"baseName": "{{baseName}}",
|
|
4
|
+
"description": "{{appDescription}}",
|
|
5
|
+
"credentialKey": "{{credentialKey}}",
|
|
6
|
+
"environment": "{{environment}}",
|
|
7
|
+
"endpoints": {
|
|
8
|
+
"messagesUrl": "{{messagesUrl}}",
|
|
9
|
+
"notificationsUrl": "{{notificationsUrl}}",
|
|
10
|
+
"botConfigUrl": "{{botConfigUrl}}",
|
|
11
|
+
"assistantCatalogUrl": "{{assistantCatalogUrl}}"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# {{appName}} — assistant channel install
|
|
2
|
+
|
|
3
|
+
{{appDescription}}
|
|
4
|
+
|
|
5
|
+
Environment: **{{environment}}** · Credential key: `{{credentialKey}}`
|
|
6
|
+
|
|
7
|
+
## Platform callback URLs
|
|
8
|
+
|
|
9
|
+
Configure these in your Slack app, Teams bot registration, or platform admin console. Do not embed secrets in generated files — use AI Fabrix credential storage only.
|
|
10
|
+
|
|
11
|
+
{{#if eventsUrl}}
|
|
12
|
+
- **Events:** {{eventsUrl}}
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{#if interactionUrl}}
|
|
15
|
+
- **Interactivity:** {{interactionUrl}}
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#if commandUrl}}
|
|
18
|
+
- **Slash commands:** {{commandUrl}}
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if oauthCallbackUrl}}
|
|
21
|
+
- **OAuth redirect:** {{oauthCallbackUrl}}
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#if messagesUrl}}
|
|
24
|
+
- **Bot messages:** {{messagesUrl}}
|
|
25
|
+
{{/if}}
|
|
26
|
+
{{#if notificationsUrl}}
|
|
27
|
+
- **Notifications:** {{notificationsUrl}}
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{#if botConfigUrl}}
|
|
30
|
+
- **Bot config:** {{botConfigUrl}}
|
|
31
|
+
{{/if}}
|
|
32
|
+
|
|
33
|
+
## Assistant catalog
|
|
34
|
+
|
|
35
|
+
Runtime lists **assistants** available to each user from:
|
|
36
|
+
|
|
37
|
+
{{assistantCatalogUrl}}
|
|
38
|
+
|
|
39
|
+
## After admin approval
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
aifabrix app add-channel {{channelTarget}} --name "{{baseName}}"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Optional validation:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
aifabrix app add-channel {{channelTarget}} --name "{{baseName}}" --probe
|
|
49
|
+
```
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
| `{{systemKey}}-deploy.json` | Deploy manifest (`aifabrix json {{appName}}`) |
|
|
24
24
|
| `deploy.js` | Deploy helper |
|
|
25
25
|
| `wizard.yaml` | Wizard input |
|
|
26
|
+
| `scenarios/*.yaml` | Governance scenario packs (optional; dataplane-first via `verify-governance` / `governance generate`; expert YAML via `governance download` / `upload`) |
|
|
26
27
|
| `{{rbacOptionalFile}}` | Roles and permissions |
|
|
27
28
|
|
|
28
29
|
## Typical workflow
|
|
@@ -33,7 +34,8 @@
|
|
|
33
34
|
4. **Check locally** — `aifabrix validate {{appName}}` and `aifabrix datasource validate` on files you touched.
|
|
34
35
|
5. **Align manifest** — `aifabrix repair {{appName}}` after bigger edits.
|
|
35
36
|
6. **Publish** — see [Publish and credentials](#publish-and-credentials) (`upload`, `deploy`, or `credential push`).
|
|
36
|
-
7. **
|
|
37
|
+
7. **Certify** — run [Enterprise AI Certification](#enterprise-ai-certification) (`verify-operations` → `verify-trust` → `verify-governance` → `lifecycle`).
|
|
38
|
+
8. **Protection** (optional) — dimension grants in `integration/.protection/` — see [Protection manifests](#protection-manifests).
|
|
37
39
|
|
|
38
40
|
Rollback an experiment: `datasource capability remove …` → validate → upload/deploy again.
|
|
39
41
|
|
|
@@ -41,7 +43,8 @@ Rollback an experiment: `datasource capability remove …` → validate → uplo
|
|
|
41
43
|
|
|
42
44
|
| Command | What it does |
|
|
43
45
|
| --- | --- |
|
|
44
|
-
| `aifabrix upload {{appName}}` | Publishes local integration files to the dataplane and pushes credential secrets from `integration/{{appName}}/.env` (when present). |
|
|
46
|
+
| `aifabrix upload {{appName}}` | Publishes local integration files to the dataplane (refreshes `{{systemKey}}-deploy.json` from sources) and pushes credential secrets from `integration/{{appName}}/.env` (when present). |
|
|
47
|
+
| `aifabrix upload {{appName}} --force` | Same publish path when the interface or datasource schema changed in ways **deploy cannot accept yet**; bypasses active-schema replacement guards. Read the CLI warning before use. |
|
|
45
48
|
| `aifabrix deploy {{appName}}` | Deploys via the controller pipeline. Does **not** replace a full upload for credential secrets — run `upload` or `credential push` when `.env` changed. |
|
|
46
49
|
| `aifabrix credential push {{appName}}` | Pushes `KV_*` values from `.env` only (no manifest publish). |
|
|
47
50
|
|
|
@@ -49,6 +52,10 @@ Rollback an experiment: `datasource capability remove …` → validate → uplo
|
|
|
49
52
|
aifabrix upload {{appName}}
|
|
50
53
|
# or secrets only:
|
|
51
54
|
aifabrix credential push {{appName}}
|
|
55
|
+
|
|
56
|
+
# Breaking schema / interface change — deploy blocked; publish for dev iteration
|
|
57
|
+
aifabrix validate {{appName}}
|
|
58
|
+
aifabrix upload {{appName}} --force
|
|
52
59
|
```
|
|
53
60
|
|
|
54
61
|
## Protection manifests
|
|
@@ -103,9 +110,9 @@ af ds cap remove {{#if hasDatasources}}{{datasources.[0].datasourceKey}}{{else}}
|
|
|
103
110
|
|
|
104
111
|
For flags, run `af ds cap <command> --help`.
|
|
105
112
|
|
|
106
|
-
##
|
|
113
|
+
## Per-datasource debug ladder
|
|
107
114
|
|
|
108
|
-
Start with one datasource and iterate until it’s stable.
|
|
115
|
+
Start with one datasource and iterate until it’s stable (architect / CI — use [Enterprise AI Certification](#enterprise-ai-certification) for the product path).
|
|
109
116
|
|
|
110
117
|
```bash
|
|
111
118
|
af ds validate {{#if hasDatasources}}{{datasources.[0].datasourceKey}}{{else}}<datasource-key>{{/if}}
|
|
@@ -137,7 +144,62 @@ aifabrix repair {{appName}}
|
|
|
137
144
|
|
|
138
145
|
Useful flags: `--dry-run`, `--auth <method>`, `--rbac`, `--expose`, `--sync`, `--test`.
|
|
139
146
|
|
|
140
|
-
##
|
|
147
|
+
## Enterprise AI Certification
|
|
148
|
+
|
|
149
|
+
Product-facing commands that prove operational readiness, AI trust, governance enforcement, and an **Enterprise AI Certification** report. Run after [publish](#publish-and-credentials).
|
|
150
|
+
|
|
151
|
+
| Command | What it proves |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| `aifabrix verify-operations {{appName}}` | Operational readiness — orchestrates validate, unit test, integration, and E2E for the whole system |
|
|
154
|
+
| `aifabrix verify-trust {{appName}}` | AI business context confidence (semantic agent metadata; not live vendor API calls) |
|
|
155
|
+
| `aifabrix verify-governance {{appName}}` | **Recommended** — publish (unless `--no-sync`), generate scenario packs on the dataplane, then verify ABAC visibility per subject |
|
|
156
|
+
| `aifabrix governance generate {{appName}}` | Granular: generate packs only (after protection + sync) |
|
|
157
|
+
| `aifabrix governance verify {{appName}}` | Granular: verify only (active packs on dataplane, or `--pack` for local YAML override) |
|
|
158
|
+
| `aifabrix lifecycle {{appName}}` | Certification report from persisted pillar results on the dataplane |
|
|
159
|
+
|
|
160
|
+
**Recommended order:** `upload` → `verify-operations` → `verify-trust` → `verify-governance` → `lifecycle`
|
|
161
|
+
|
|
162
|
+
Integration validation packs live under `integration/{{appName}}/scenarios/` (YAML per datasource). Prefer **`verify-governance`** (dataplane-first) after identity sync, protection upload, and `datasource load`. Granular: `governance generate` then `governance verify`. Expert YAML: `governance download` / `governance upload` (424.0 schema; pre-424 files fail with a hint to regenerate). **`governance download`** is read-only and does not publish this folder.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
aifabrix upload {{appName}}
|
|
166
|
+
|
|
167
|
+
aifabrix verify-operations {{appName}}
|
|
168
|
+
aifabrix verify-operations {{appName}} -v
|
|
169
|
+
|
|
170
|
+
aifabrix verify-trust {{appName}} -v
|
|
171
|
+
aifabrix verify-trust {{appName}} --no-sync --revalidate
|
|
172
|
+
|
|
173
|
+
# Governance pillar (replace <email> with a subject from your scenario pack)
|
|
174
|
+
aifabrix verify-governance {{appName}} --subject-email <email> -v
|
|
175
|
+
aifabrix verify-governance {{appName}} --subject-email <email> --no-sync
|
|
176
|
+
|
|
177
|
+
# Granular governance (debugging)
|
|
178
|
+
aifabrix governance generate {{appName}} --subject-email <email>
|
|
179
|
+
aifabrix governance verify {{appName}} -v
|
|
180
|
+
|
|
181
|
+
# Report only (GET persisted results)
|
|
182
|
+
aifabrix lifecycle {{appName}}
|
|
183
|
+
aifabrix lifecycle {{appName}} -v
|
|
184
|
+
|
|
185
|
+
# Run missing verify steps, publish local files, then print report
|
|
186
|
+
aifabrix lifecycle {{appName}} --run
|
|
187
|
+
aifabrix lifecycle {{appName}} --run --no-sync
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Prerequisites:** `aifabrix login`, dataplane reachable, config published (`upload`). Governance also needs identity sync, protection upload, `datasource load` for fixture records, at least one `--subject-email` or `--subject-user-id`, and `governance:evaluate` on your token. Run `aifabrix verify-governance --help` for flags.
|
|
191
|
+
|
|
192
|
+
**Single-datasource trust** (same semantic check as system `verify-trust`, one key):
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
aifabrix datasource verify-trust {{#if hasDatasources}}{{datasources.[0].datasourceKey}}{{else}}<datasource-key>{{/if}} --app {{appName}} -v
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Common flags: `-v` / `--verbose`, `-d` / `--debug` (trust), `--no-sync` (skip pre-run upload), `--json` (machine-readable envelope).
|
|
199
|
+
|
|
200
|
+
## Debug and low-level tests
|
|
201
|
+
|
|
202
|
+
Advanced commands for architects and CI. Prefer [Enterprise AI Certification](#enterprise-ai-certification) for integrator proof unless you need step-by-step debugging.
|
|
141
203
|
|
|
142
204
|
| Command | Network | Notes |
|
|
143
205
|
| --- | --- | --- |
|
|
@@ -145,14 +207,11 @@ Useful flags: `--dry-run`, `--auth <method>`, `--rbac`, `--expose`, `--sync`, `-
|
|
|
145
207
|
| `aifabrix test {{appName}}` | Off | Local checks |
|
|
146
208
|
| `aifabrix test-integration {{appName}}` | On | Needs login + dataplane |
|
|
147
209
|
| `aifabrix test-e2e {{appName}}` | On | E2E for every datasource; uploads local files first unless `--no-sync` |
|
|
148
|
-
| `aifabrix test-trust {{appName}}` | On | Semantic agent metadata trust (not live API E2E); uploads first unless `--no-sync` |
|
|
149
210
|
|
|
150
211
|
System-level tests publish local integration files before the run (same path as `upload`). Use **`--no-sync`** to validate against config already on the dataplane.
|
|
151
212
|
|
|
152
213
|
```bash
|
|
153
|
-
aifabrix test-
|
|
154
|
-
aifabrix test-trust {{appName}} --no-sync
|
|
155
|
-
aifabrix test-e2e {{appName}} --no-sync
|
|
214
|
+
aifabrix test-e2e {{appName}} --no-sync -d
|
|
156
215
|
```
|
|
157
216
|
|
|
158
217
|
Single datasource E2E:
|
|
@@ -171,14 +230,9 @@ aifabrix datasource test-e2e <datasource-key> --app {{appName}}
|
|
|
171
230
|
```
|
|
172
231
|
{{/if}}
|
|
173
232
|
|
|
174
|
-
Common flags: `-v` / `--verbose`, `-d` / `--debug`, `--no-async` (datasource E2E only), `--no-sync` (skip pre-run upload on system `test-e2e`
|
|
233
|
+
Common flags: `-v` / `--verbose`, `-d` / `--debug`, `--no-async` (datasource E2E only), `--no-sync` (skip pre-run upload on system `test-e2e`).
|
|
175
234
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
aifabrix datasource test-trust {{#if hasDatasources}}{{datasources.[0].datasourceKey}}{{else}}<datasource-key>{{/if}} --app {{appName}}
|
|
180
|
-
aifabrix datasource test-trust {{#if hasDatasources}}{{datasources.[0].datasourceKey}}{{else}}<datasource-key>{{/if}} --app {{appName}} --no-sync --revalidate
|
|
181
|
-
```
|
|
235
|
+
Debug logs (when using `--debug` on datasource commands) are written under `integration/{{appName}}/logs/` — use `aifabrix datasource log-test`, `log-integration`, `log-e2e`, or `log-trust` to inspect the latest file for each type.
|
|
182
236
|
|
|
183
237
|
## Deploy
|
|
184
238
|
|
|
@@ -195,5 +249,8 @@ aifabrix delete {{appName}}
|
|
|
195
249
|
## When something fails
|
|
196
250
|
|
|
197
251
|
- **Validation errors** — Fix JSON/schema issues; run `aifabrix validate {{appName}}` and `aifabrix datasource validate` on the file you changed.
|
|
198
|
-
- **
|
|
252
|
+
- **Deploy blocked by schema changes** — When the interface changed and deploy rejects the update, validate locally then `aifabrix upload {{appName}} --force` to publish for dev iteration (see [Publish and credentials](#publish-and-credentials)).
|
|
253
|
+
- **Auth** — `aifabrix auth config` + `aifabrix login` before upload, deploy, remote tests, or certification.
|
|
254
|
+
- **Certification gaps** — Run pillars in order (`verify-operations` → `verify-trust` → `verify-governance`), then `aifabrix lifecycle {{appName}} -v` for per-datasource breakdown; use `lifecycle --run` to execute missing steps and refresh the report.
|
|
255
|
+
- **Governance upload rejected** — Local `scenarios/*.yaml` must meet the 424.0 pack schema; use `verify-governance` or `governance generate` instead of hand-editing old YAML.
|
|
199
256
|
- **Wrong folder** — Run CLI from the project root (where `integration/{{appName}}/` lives).
|
|
@@ -51,7 +51,7 @@ services:
|
|
|
51
51
|
env_file:
|
|
52
52
|
- {{envFile}}
|
|
53
53
|
{{#if reloadStartCommand}}
|
|
54
|
-
command: ["sh", "-c", "cd /app && {{reloadStartCommand}}"]
|
|
54
|
+
command: ["sh", "-c", "cd /app && {{{reloadStartCommand}}}"]
|
|
55
55
|
{{/if}}
|
|
56
56
|
ports:
|
|
57
57
|
- "{{hostPort}}:{{containerPort}}"
|
|
@@ -87,6 +87,62 @@ services:
|
|
|
87
87
|
condition: service_completed_successfully
|
|
88
88
|
{{/if}}
|
|
89
89
|
|
|
90
|
+
{{#if workerSidecars.enabled}}
|
|
91
|
+
{{#if workerSidecars.worker}}
|
|
92
|
+
{{workerSidecars.worker.key}}:
|
|
93
|
+
image: {{image.name}}:{{image.tag}}
|
|
94
|
+
container_name: {{workerSidecars.worker.containerName}}
|
|
95
|
+
environment:
|
|
96
|
+
- MISO_ENVIRONMENT={{misoEnvironment}}
|
|
97
|
+
- LOCAL_MODE=false
|
|
98
|
+
env_file:
|
|
99
|
+
- {{envFile}}
|
|
100
|
+
command: ["sh", "-c", "cd /app && {{{workerSidecars.worker.command}}}"]
|
|
101
|
+
networks:
|
|
102
|
+
- {{networkName}}
|
|
103
|
+
{{#if devMountPath}}
|
|
104
|
+
volumes:
|
|
105
|
+
- {{devMountPath}}:/app
|
|
106
|
+
user: "${AIFABRIX_UID:-1000}:${AIFABRIX_GID:-1000}"
|
|
107
|
+
{{/if}}
|
|
108
|
+
depends_on:
|
|
109
|
+
{{app.key}}:
|
|
110
|
+
condition: service_started
|
|
111
|
+
healthcheck:
|
|
112
|
+
disable: true
|
|
113
|
+
restart: unless-stopped
|
|
114
|
+
{{/if}}
|
|
115
|
+
|
|
116
|
+
{{#if workerSidecars.beat}}
|
|
117
|
+
{{workerSidecars.beat.key}}:
|
|
118
|
+
image: {{image.name}}:{{image.tag}}
|
|
119
|
+
container_name: {{workerSidecars.beat.containerName}}
|
|
120
|
+
environment:
|
|
121
|
+
- MISO_ENVIRONMENT={{misoEnvironment}}
|
|
122
|
+
- LOCAL_MODE=false
|
|
123
|
+
env_file:
|
|
124
|
+
- {{envFile}}
|
|
125
|
+
command: ["sh", "-c", "cd /app && {{{workerSidecars.beat.command}}}"]
|
|
126
|
+
networks:
|
|
127
|
+
- {{networkName}}
|
|
128
|
+
{{#if devMountPath}}
|
|
129
|
+
volumes:
|
|
130
|
+
- {{devMountPath}}:/app
|
|
131
|
+
user: "${AIFABRIX_UID:-1000}:${AIFABRIX_GID:-1000}"
|
|
132
|
+
{{/if}}
|
|
133
|
+
depends_on:
|
|
134
|
+
{{#if workerSidecars.worker}}
|
|
135
|
+
{{workerSidecars.worker.key}}:
|
|
136
|
+
{{else}}
|
|
137
|
+
{{app.key}}:
|
|
138
|
+
{{/if}}
|
|
139
|
+
condition: service_started
|
|
140
|
+
healthcheck:
|
|
141
|
+
disable: true
|
|
142
|
+
restart: unless-stopped
|
|
143
|
+
{{/if}}
|
|
144
|
+
{{/if}}
|
|
145
|
+
|
|
90
146
|
{{#if requiresDatabase}}
|
|
91
147
|
# Database Initialization (uses infra pgpass when available: ~/.aifabrix/infra/pgpass)
|
|
92
148
|
# env_file: .env.run.admin only (POSTGRES_PASSWORD + DB_*); admin secrets never in app container
|
|
@@ -134,27 +190,28 @@ services:
|
|
|
134
190
|
done &&
|
|
135
191
|
{{#if databases}}
|
|
136
192
|
{{#each databases}}
|
|
137
|
-
echo
|
|
138
|
-
if psql -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname = '{{
|
|
139
|
-
echo
|
|
140
|
-
psql -d postgres -c "ALTER USER \"{{
|
|
141
|
-
echo
|
|
193
|
+
echo "Creating $${DB_{{@index}}_NAME} database and user..." &&
|
|
194
|
+
if psql -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname = '$${DB_{{@index}}_NAME}'" 2>/dev/null | grep -q '^1$$'; then
|
|
195
|
+
echo "Database \"$${DB_{{@index}}_NAME}\" already exists, syncing user password..." &&
|
|
196
|
+
psql -d postgres -c "ALTER USER \"$${DB_{{@index}}_USER}\" WITH PASSWORD '"$${DB_{{@index}}_PASSWORD}"';" &&
|
|
197
|
+
echo "Database \"$${DB_{{@index}}_NAME}\" ok."
|
|
142
198
|
else
|
|
143
|
-
echo
|
|
144
|
-
psql -d postgres -c "CREATE DATABASE \"{{
|
|
145
|
-
echo
|
|
199
|
+
echo "Creating database \"$${DB_{{@index}}_NAME}\"..." &&
|
|
200
|
+
psql -d postgres -c "CREATE DATABASE \"$${DB_{{@index}}_NAME}\";" &&
|
|
201
|
+
echo "Dropping old user if exists..." &&
|
|
146
202
|
psql -d postgres -c "DROP USER IF EXISTS \"{{pgUserOld name}}\";" || true &&
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
psql -d
|
|
152
|
-
psql -d {{
|
|
153
|
-
|
|
203
|
+
psql -d postgres -c "DROP USER IF EXISTS \"$${DB_{{@index}}_USER}\";" || true &&
|
|
204
|
+
echo "Creating user \"$${DB_{{@index}}_USER}\"..." &&
|
|
205
|
+
psql -d postgres -c "CREATE USER \"$${DB_{{@index}}_USER}\" WITH PASSWORD '"$${DB_{{@index}}_PASSWORD}"';" &&
|
|
206
|
+
echo "Granting privileges..." &&
|
|
207
|
+
psql -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE \"$${DB_{{@index}}_NAME}\" TO \"$${DB_{{@index}}_USER}\";" &&
|
|
208
|
+
psql -d "$${DB_{{@index}}_NAME}" -c "ALTER SCHEMA public OWNER TO \"$${DB_{{@index}}_USER}\";" &&
|
|
209
|
+
psql -d "$${DB_{{@index}}_NAME}" -c "GRANT ALL ON SCHEMA public TO \"$${DB_{{@index}}_USER}\";" &&
|
|
210
|
+
echo "Database \"$${DB_{{@index}}_NAME}\" created successfully!"
|
|
154
211
|
fi &&
|
|
155
212
|
{{#each (extensionsForDb this)}}
|
|
156
|
-
(psql -d {{
|
|
157
|
-
echo
|
|
213
|
+
(psql -d "$${DB_{{@../index}}_NAME}" -c 'CREATE EXTENSION IF NOT EXISTS {{pgQuote this}};' || echo "Warning: could not create extension {{this}}") &&
|
|
214
|
+
echo "Extension \"{{this}}\" enabled on \"$${DB_{{@../index}}_NAME}\"." &&
|
|
158
215
|
{{/each}}
|
|
159
216
|
{{/each}}
|
|
160
217
|
{{else}}
|
|
@@ -87,6 +87,58 @@ services:
|
|
|
87
87
|
condition: service_completed_successfully
|
|
88
88
|
{{/if}}
|
|
89
89
|
|
|
90
|
+
{{#if workerSidecars.enabled}}
|
|
91
|
+
{{#if workerSidecars.worker}}
|
|
92
|
+
{{workerSidecars.worker.key}}:
|
|
93
|
+
image: {{image.name}}:{{image.tag}}
|
|
94
|
+
container_name: {{workerSidecars.worker.containerName}}
|
|
95
|
+
environment:
|
|
96
|
+
- MISO_ENVIRONMENT={{misoEnvironment}}
|
|
97
|
+
- LOCAL_MODE=false
|
|
98
|
+
env_file:
|
|
99
|
+
- {{envFile}}
|
|
100
|
+
command: ["sh", "-c", "cd /app && {{{workerSidecars.worker.command}}}"]
|
|
101
|
+
networks:
|
|
102
|
+
- {{networkName}}
|
|
103
|
+
{{#if devMountPath}}
|
|
104
|
+
volumes:
|
|
105
|
+
- {{devMountPath}}:/app
|
|
106
|
+
user: "${AIFABRIX_UID:-1000}:${AIFABRIX_GID:-1000}"
|
|
107
|
+
{{/if}}
|
|
108
|
+
depends_on:
|
|
109
|
+
{{app.key}}:
|
|
110
|
+
condition: service_started
|
|
111
|
+
restart: unless-stopped
|
|
112
|
+
{{/if}}
|
|
113
|
+
|
|
114
|
+
{{#if workerSidecars.beat}}
|
|
115
|
+
{{workerSidecars.beat.key}}:
|
|
116
|
+
image: {{image.name}}:{{image.tag}}
|
|
117
|
+
container_name: {{workerSidecars.beat.containerName}}
|
|
118
|
+
environment:
|
|
119
|
+
- MISO_ENVIRONMENT={{misoEnvironment}}
|
|
120
|
+
- LOCAL_MODE=false
|
|
121
|
+
env_file:
|
|
122
|
+
- {{envFile}}
|
|
123
|
+
command: ["sh", "-c", "cd /app && {{{workerSidecars.beat.command}}}"]
|
|
124
|
+
networks:
|
|
125
|
+
- {{networkName}}
|
|
126
|
+
{{#if devMountPath}}
|
|
127
|
+
volumes:
|
|
128
|
+
- {{devMountPath}}:/app
|
|
129
|
+
user: "${AIFABRIX_UID:-1000}:${AIFABRIX_GID:-1000}"
|
|
130
|
+
{{/if}}
|
|
131
|
+
depends_on:
|
|
132
|
+
{{#if workerSidecars.worker}}
|
|
133
|
+
{{workerSidecars.worker.key}}:
|
|
134
|
+
{{else}}
|
|
135
|
+
{{app.key}}:
|
|
136
|
+
{{/if}}
|
|
137
|
+
condition: service_started
|
|
138
|
+
restart: unless-stopped
|
|
139
|
+
{{/if}}
|
|
140
|
+
{{/if}}
|
|
141
|
+
|
|
90
142
|
{{#if requiresDatabase}}
|
|
91
143
|
# Database Initialization (uses infra pgpass when available: ~/.aifabrix/infra/pgpass)
|
|
92
144
|
# env_file: .env.run.admin only (POSTGRES_PASSWORD + DB_*); admin secrets never in app container
|
|
@@ -134,27 +186,28 @@ services:
|
|
|
134
186
|
done &&
|
|
135
187
|
{{#if databases}}
|
|
136
188
|
{{#each databases}}
|
|
137
|
-
echo
|
|
138
|
-
if psql -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname = '{{
|
|
139
|
-
echo
|
|
140
|
-
psql -d postgres -c "ALTER USER \"{{
|
|
141
|
-
echo
|
|
189
|
+
echo "Creating $${DB_{{@index}}_NAME} database and user..." &&
|
|
190
|
+
if psql -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname = '$${DB_{{@index}}_NAME}'" 2>/dev/null | grep -q '^1$$'; then
|
|
191
|
+
echo "Database \"$${DB_{{@index}}_NAME}\" already exists, syncing user password..." &&
|
|
192
|
+
psql -d postgres -c "ALTER USER \"$${DB_{{@index}}_USER}\" WITH PASSWORD '"$${DB_{{@index}}_PASSWORD}"';" &&
|
|
193
|
+
echo "Database \"$${DB_{{@index}}_NAME}\" ok."
|
|
142
194
|
else
|
|
143
|
-
echo
|
|
144
|
-
psql -d postgres -c "CREATE DATABASE \"{{
|
|
145
|
-
echo
|
|
195
|
+
echo "Creating database \"$${DB_{{@index}}_NAME}\"..." &&
|
|
196
|
+
psql -d postgres -c "CREATE DATABASE \"$${DB_{{@index}}_NAME}\";" &&
|
|
197
|
+
echo "Dropping old user if exists..." &&
|
|
146
198
|
psql -d postgres -c "DROP USER IF EXISTS \"{{pgUserOld name}}\";" || true &&
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
psql -d
|
|
152
|
-
psql -d {{
|
|
153
|
-
|
|
199
|
+
psql -d postgres -c "DROP USER IF EXISTS \"$${DB_{{@index}}_USER}\";" || true &&
|
|
200
|
+
echo "Creating user \"$${DB_{{@index}}_USER}\"..." &&
|
|
201
|
+
psql -d postgres -c "CREATE USER \"$${DB_{{@index}}_USER}\" WITH PASSWORD '"$${DB_{{@index}}_PASSWORD}"';" &&
|
|
202
|
+
echo "Granting privileges..." &&
|
|
203
|
+
psql -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE \"$${DB_{{@index}}_NAME}\" TO \"$${DB_{{@index}}_USER}\";" &&
|
|
204
|
+
psql -d "$${DB_{{@index}}_NAME}" -c "ALTER SCHEMA public OWNER TO \"$${DB_{{@index}}_USER}\";" &&
|
|
205
|
+
psql -d "$${DB_{{@index}}_NAME}" -c "GRANT ALL ON SCHEMA public TO \"$${DB_{{@index}}_USER}\";" &&
|
|
206
|
+
echo "Database \"$${DB_{{@index}}_NAME}\" created successfully!"
|
|
154
207
|
fi &&
|
|
155
208
|
{{#each (extensionsForDb this)}}
|
|
156
|
-
(psql -d {{
|
|
157
|
-
echo
|
|
209
|
+
(psql -d "$${DB_{{@../index}}_NAME}" -c 'CREATE EXTENSION IF NOT EXISTS {{pgQuote this}};' || echo "Warning: could not create extension {{this}}") &&
|
|
210
|
+
echo "Extension \"{{this}}\" enabled on \"$${DB_{{@../index}}_NAME}\"." &&
|
|
158
211
|
{{/each}}
|
|
159
212
|
{{/each}}
|
|
160
213
|
{{else}}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview CLI action for `aifabrix test-governance` (plan 406)
|
|
3
|
-
* @author AI Fabrix Team
|
|
4
|
-
* @version 1.0.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
const { handleCommandError } = require('../utils/cli-utils');
|
|
10
|
-
const { runTestGovernanceForExternalSystem } = require('./test-governance-external');
|
|
11
|
-
const { normalizeTestGovernanceCliOptions } = require('./test-governance-cli-options');
|
|
12
|
-
const {
|
|
13
|
-
displayGovernanceRunTTY,
|
|
14
|
-
printGovernanceRunJson,
|
|
15
|
-
exitCodeFromGovernanceSummary
|
|
16
|
-
} = require('../governance/governance-run-display');
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @async
|
|
20
|
-
* @param {string} appName
|
|
21
|
-
* @param {Object} options
|
|
22
|
-
* @param {import('commander').Command} [cmd]
|
|
23
|
-
*/
|
|
24
|
-
async function runTestGovernanceCommandAction(appName, options, cmd) {
|
|
25
|
-
const opts = normalizeTestGovernanceCliOptions(options, cmd);
|
|
26
|
-
const { result, packPath, systemKey } = await runTestGovernanceForExternalSystem(appName, opts);
|
|
27
|
-
|
|
28
|
-
if (opts.json) {
|
|
29
|
-
printGovernanceRunJson(result);
|
|
30
|
-
} else {
|
|
31
|
-
displayGovernanceRunTTY(systemKey, result, {
|
|
32
|
-
verbose: opts.verbose,
|
|
33
|
-
packPath
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const exitCode = exitCodeFromGovernanceSummary(result.summary);
|
|
38
|
-
if (exitCode !== 0) {
|
|
39
|
-
process.exit(exitCode);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function testGovernanceCommandHandler(appName, options, cmd) {
|
|
44
|
-
try {
|
|
45
|
-
await runTestGovernanceCommandAction(appName, options, cmd);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
handleCommandError(error, 'test-governance');
|
|
48
|
-
process.exit(3);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
module.exports = {
|
|
53
|
-
runTestGovernanceCommandAction,
|
|
54
|
-
testGovernanceCommandHandler
|
|
55
|
-
};
|