@aifabrix/builder 2.53.1 → 2.55.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/README.md +8 -0
- package/bin/aifabrix.js +2 -2
- package/lib/agent-kit/apply-ops.js +82 -0
- package/lib/agent-kit/checksums.js +28 -0
- package/lib/agent-kit/classify.js +113 -0
- package/lib/agent-kit/claude-shim.js +61 -0
- package/lib/agent-kit/constants.js +55 -0
- package/lib/agent-kit/file-list.js +103 -0
- package/lib/agent-kit/host-approve.js +130 -0
- package/lib/agent-kit/hosting/github.js +63 -0
- package/lib/agent-kit/hosts.js +71 -0
- package/lib/agent-kit/init.js +319 -0
- package/lib/agent-kit/kit-root.js +17 -0
- package/lib/agent-kit/managed-section.js +79 -0
- package/lib/agent-kit/package-load.js +45 -0
- package/lib/agent-kit/plan-ops.js +69 -0
- package/lib/agent-kit/remote-prompts.js +239 -0
- package/lib/agent-kit/render-host-markdown.js +40 -0
- package/lib/agent-kit/repo-guard.js +47 -0
- package/lib/agent-kit/report.js +107 -0
- package/lib/agent-kit/run.js +82 -0
- package/lib/agent-kit/scm/git.js +122 -0
- package/lib/agent-kit/state-file.js +83 -0
- package/lib/agent-kit/status.js +50 -0
- package/lib/agent-kit/v1-detect.js +81 -0
- package/lib/agent-kit/validate-kit.js +87 -0
- package/lib/agent-kit/workspace-name.js +40 -0
- package/lib/agent-kit/workspace-skeleton.js +103 -0
- 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/role-assistant-test-pack.api.js +86 -0
- package/lib/api/types/evidence.types.js +2 -0
- package/lib/api/work-search.api.js +163 -0
- package/lib/api/work.api.js +19 -12
- package/lib/app/list-external-systems.js +2 -1
- package/lib/app/show-display.js +33 -6
- package/lib/app/show.js +25 -2
- package/lib/channels/add-channel.js +164 -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 +61 -0
- package/lib/channels/channel-add-remaining.js +492 -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-definition-status.js +115 -0
- package/lib/channels/channel-description.js +60 -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 +358 -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 +18 -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 +194 -72
- package/lib/channels/channel-status-display.js +86 -16
- package/lib/channels/channel-targets.js +132 -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 +92 -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 +311 -0
- package/lib/channels/slack-mcp-callback.js +51 -0
- package/lib/channels/slack-mcp-runtime.js +156 -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 +335 -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 +53 -0
- package/lib/channels/teams-bot-channel-add.js +94 -0
- package/lib/channels/vendor-dataplane-url.js +249 -0
- package/lib/cli/index.js +4 -0
- package/lib/cli/setup-certification-commands.js +2 -2
- package/lib/cli/setup-certification.help.js +5 -1
- package/lib/cli/setup-external-system-help.js +2 -0
- package/lib/cli/setup-external-system.js +1 -1
- package/lib/commands/agent-kit-help.js +79 -0
- package/lib/commands/agent-kit.js +346 -0
- 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/datasource-capability-relate-cli.js +5 -4
- 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-auth-apply.js +1 -1
- package/lib/commands/repair-datasource-key-skip.js +39 -0
- package/lib/commands/repair-datasource-keys.js +24 -12
- 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 +26 -44
- package/lib/commands/repair-system-permissions.js +24 -22
- package/lib/commands/role-assistant-copy-output.js +61 -0
- package/lib/commands/role-assistant-copy.js +155 -0
- package/lib/commands/role-assistant-test-output.js +22 -9
- package/lib/commands/role-assistant-test-result-rows.js +42 -0
- package/lib/commands/role-assistant.js +150 -43
- package/lib/commands/search.js +143 -0
- package/lib/commands/test-e2e-external.js +148 -21
- package/lib/commands/test-trust-external.js +7 -5
- 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 +10 -4
- package/lib/commands/upload.js +18 -3
- package/lib/commands/verify-operations-skip-e2e.js +131 -0
- package/lib/commands/verify-operations-step-plan.js +6 -33
- package/lib/commands/verify-operations-steps.js +3 -1
- 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/datasource/capability/relate-operations.js +28 -10
- package/lib/datasource/capability/run-capability-relate.js +48 -25
- package/lib/datasource/datasource-identifier.js +13 -5
- package/lib/deployment/deployer-poll-run.js +117 -35
- package/lib/external-system/deploy-dataplane-published.js +70 -0
- package/lib/external-system/deploy-helpers.js +26 -1
- package/lib/external-system/deploy.js +22 -8
- package/lib/external-system/download-helpers.js +29 -2
- package/lib/external-system/download-role-assistant.js +109 -4
- package/lib/external-system/download.js +46 -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/generator/wizard-datasource-key.js +54 -0
- package/lib/generator/wizard.js +55 -54
- package/lib/integration-definition/apply-datasource-keys.js +75 -0
- package/lib/integration-definition/apply-relationships.js +195 -0
- package/lib/integration-definition/apply-static-enterprise.js +229 -0
- package/lib/integration-definition/apply-system-file.js +71 -0
- package/lib/integration-definition/apply-test-endpoint.js +89 -0
- package/lib/integration-definition/apply-viewpoint-defaults.js +157 -0
- package/lib/integration-definition/apply.js +78 -59
- package/lib/integration-definition/enrich-openapi-operations.js +36 -10
- package/lib/integration-definition/enrich-openapi-pick.js +87 -0
- package/lib/lifecycle/role-assistant-governance.js +181 -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 +55 -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/index.js +2 -0
- package/lib/programmatic/openapi-apply-result-schemas.js +8 -0
- package/lib/programmatic/openapi-channel-install-bindings.js +179 -0
- package/lib/programmatic/openapi-channel-install-schemas.js +289 -0
- package/lib/programmatic/openapi-component-schemas.js +19 -1
- package/lib/programmatic/openapi-description-enricher.js +3 -1
- package/lib/programmatic/openapi-descriptions.js +80 -3
- package/lib/programmatic/openapi-envelope-examples.js +124 -0
- package/lib/programmatic/openapi-operation-bindings.js +9 -1
- package/lib/programmatic/openapi-request-schemas.js +5 -0
- package/lib/programmatic/openapi-schema-descriptions-channel.js +319 -0
- package/lib/programmatic/openapi-schema-descriptions-operations.js +19 -0
- package/lib/programmatic/openapi-spec.js +13 -8
- package/lib/programmatic/platform-rbac-catalog.js +36 -18
- package/lib/programmatic/request-timeout.js +3 -0
- package/lib/programmatic/route-handler-map.js +58 -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 +238 -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 +236 -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/run-download.js +41 -0
- package/lib/programmatic/workspace-context.js +2 -0
- package/lib/protection/auth-context.js +3 -1
- package/lib/protection/protection-display.js +3 -2
- package/lib/protection/report-exit.js +50 -0
- package/lib/protection/run-commands.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/package-validate.js +175 -0
- package/lib/role-assistant/settings.js +49 -2
- package/lib/role-assistant/test-case-assertion-row.js +36 -0
- package/lib/role-assistant/test-case-copy-bind.js +77 -0
- package/lib/role-assistant/test-case-copy-expected.js +127 -0
- package/lib/role-assistant/test-case-copy-from-work.js +90 -0
- package/lib/role-assistant/test-case-copy-interactions.js +67 -0
- package/lib/role-assistant/test-case-copy.js +119 -0
- package/lib/role-assistant/test-case-expected-catalog.js +135 -0
- package/lib/role-assistant/test-case-validate.js +88 -0
- package/lib/role-assistant/test-cases-bid.js +117 -4
- package/lib/role-assistant/test-cases-evaluate.js +159 -24
- package/lib/role-assistant/test-cases-evidence.js +175 -0
- package/lib/role-assistant/test-cases-honesty.js +155 -6
- package/lib/role-assistant/test-cases-lifecycle.js +291 -0
- package/lib/role-assistant/test-cases-search-graph.js +122 -0
- package/lib/role-assistant/test-cases-search.js +247 -0
- package/lib/role-assistant/test-cases.js +71 -172
- package/lib/role-assistant/test-pack-map.js +180 -0
- package/lib/role-assistant/test-pack-sync.js +187 -0
- package/lib/role-assistant/test-runner-debug.js +54 -0
- package/lib/role-assistant/test-runner-respond-body.js +36 -0
- package/lib/role-assistant/test-runner-search.js +164 -0
- package/lib/role-assistant/test-runner-start-payload.js +63 -10
- package/lib/role-assistant/test-runner-workhub-answers.js +45 -16
- 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 +74 -32
- package/lib/role-assistant/test-runner.js +66 -11
- package/lib/schema/external-datasource.schema.json +146 -21
- package/lib/schema/external-system.schema.json +177 -2
- package/lib/schema/mcp-client-profile.schema.json +103 -0
- package/lib/schema/role-assistant-test-case.schema.json +408 -0
- package/lib/search/dataplane-context.js +23 -0
- package/lib/search/search-args.js +211 -0
- package/lib/search/search-display.js +238 -0
- package/lib/search/search-errors.js +50 -0
- package/lib/search/search-prompts.js +119 -0
- package/lib/search/search-roles.js +85 -0
- package/lib/search/search-run.js +241 -0
- package/lib/search/search-skills.js +198 -0
- package/lib/utils/app-path-resolve.js +4 -0
- package/lib/utils/authentication-env-template.js +44 -6
- package/lib/utils/authentication-slot-show.js +153 -0
- package/lib/utils/credential-display.js +43 -1
- 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/external-system-readiness-compact-blocks.js +5 -1
- package/lib/utils/external-system-readiness-compact-display.js +30 -1
- package/lib/utils/external-system-validators.js +2 -1
- package/lib/utils/help-builder.js +3 -1
- 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-loader.js +37 -0
- 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-external-file.js +5 -1
- package/lib/validation/validate.js +41 -0
- package/package.json +1 -1
- package/templates/README.md +1 -1
- package/templates/agent-kit/adapters/claude/nested.CLAUDE.md +1 -0
- package/templates/agent-kit/adapters/claude/root.CLAUDE.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-0-plan.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-1-validate.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-2-build.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-3-push.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-biz-1-validate.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-biz-2-build.md +5 -0
- package/templates/agent-kit/adapters/cursor/commands/cust-biz-3-prove.md +5 -0
- package/templates/agent-kit/agent-kit.yaml +45 -0
- package/templates/agent-kit/instructions/AGENTKIT.md +83 -0
- package/templates/agent-kit/instructions/integration.AGENTS.md +25 -0
- package/templates/agent-kit/instructions/role-assistant.AGENTS.md +22 -0
- package/templates/agent-kit/instructions/root.AGENTS.md +37 -0
- package/templates/agent-kit/parity-inventory.yaml +188 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/SKILL.md +58 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/references/contract-checklist.md +40 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/references/delivery-gates.md +54 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/references/production-safety.md +35 -0
- package/templates/agent-kit/skills/aifabrix-connected-system/scripts/reserved-system-key.js +19 -0
- package/templates/agent-kit/skills/aifabrix-plan/SKILL.md +51 -0
- package/templates/agent-kit/skills/aifabrix-plan/references/challenge-checklist.md +108 -0
- package/templates/agent-kit/skills/aifabrix-plan/references/interaction.md +34 -0
- package/templates/agent-kit/skills/aifabrix-plan/references/plan-template.md +182 -0
- package/templates/agent-kit/skills/aifabrix-prove/SKILL.md +50 -0
- package/templates/agent-kit/skills/aifabrix-prove/references/demo-template.md +65 -0
- package/templates/agent-kit/skills/aifabrix-prove/references/evidence-lifecycle.md +68 -0
- package/templates/agent-kit/skills/aifabrix-prove/references/learning-template.md +66 -0
- package/templates/agent-kit/skills/aifabrix-role-assistant/SKILL.md +42 -0
- package/templates/agent-kit/skills/aifabrix-role-assistant/references/package-boundary.md +21 -0
- package/templates/agent-kit/skills/shared/hosts.md +78 -0
- package/templates/agent-kit/workspace/.cursor/plans/README.md +22 -0
- package/templates/agent-kit/workspace/LICENSE.mit +21 -0
- package/templates/agent-kit/workspace/README.md +89 -0
- package/templates/applications/builder-api/Dockerfile +3 -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 +35 -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 +10 -9
- 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 +44 -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 +22 -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 +234 -0
- package/templates/channels/slack/icon.svg +1 -0
- package/templates/channels/slack/install.template.md.hbs +45 -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 +161 -72
- package/templates/channels/slack/manifest.template.json.hbs +10 -4
- package/templates/channels/teams-bot/channel.json +162 -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/templates/python/docker-compose.hbs +14 -0
- package/templates/typescript/docker-compose.hbs +14 -0
|
@@ -39,6 +39,99 @@ function deriveDatasourceKeyFromFileName(fileName, systemKey) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/* eslint-disable max-statements -- Key resolution from system or files */
|
|
42
|
+
function datasourceKeyFromParsedOrFile(parsed, fileName, systemKey) {
|
|
43
|
+
if (parsed && typeof parsed.key === 'string' && parsed.key.trim()) {
|
|
44
|
+
return parsed.key.trim();
|
|
45
|
+
}
|
|
46
|
+
return deriveDatasourceKeyFromFileName(fileName, systemKey);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function cipFetchSources(parsed) {
|
|
50
|
+
const ops = parsed && parsed.execution && parsed.execution.cip && parsed.execution.cip.operations;
|
|
51
|
+
if (!ops || typeof ops !== 'object') {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const sources = [];
|
|
55
|
+
for (const op of Object.values(ops)) {
|
|
56
|
+
if (!op || typeof op !== 'object') continue;
|
|
57
|
+
for (const step of op.steps || []) {
|
|
58
|
+
const src = step && step.fetch && step.fetch.source;
|
|
59
|
+
if (typeof src === 'string' && src.trim()) sources.push(src.trim());
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return sources;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isExclusiveRecordFetchSource(parsed) {
|
|
66
|
+
const sources = cipFetchSources(parsed);
|
|
67
|
+
return sources.length > 0 && sources.every((src) => src === 'record');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Maps datasource keys to E2E skip reasons (`view` / `record`) or storageType.
|
|
72
|
+
* @param {string} appPath
|
|
73
|
+
* @param {string[]} datasourceFiles
|
|
74
|
+
* @param {string} systemKey
|
|
75
|
+
* @returns {Object<string, string|undefined>}
|
|
76
|
+
*/
|
|
77
|
+
function loadDatasourceStorageByKey(appPath, datasourceFiles, systemKey) {
|
|
78
|
+
const byKey = {};
|
|
79
|
+
for (const fileName of datasourceFiles) {
|
|
80
|
+
const filePath = path.join(appPath, fileName);
|
|
81
|
+
if (!fs.existsSync(filePath)) continue;
|
|
82
|
+
try {
|
|
83
|
+
const parsed = loadConfigFile(filePath);
|
|
84
|
+
const key = datasourceKeyFromParsedOrFile(parsed, fileName, systemKey);
|
|
85
|
+
if (!key) continue;
|
|
86
|
+
if (parsed && parsed.storageType === 'view') byKey[key] = 'view';
|
|
87
|
+
else if (isExclusiveRecordFetchSource(parsed)) byKey[key] = 'record';
|
|
88
|
+
else byKey[key] = parsed && parsed.storageType;
|
|
89
|
+
} catch {
|
|
90
|
+
// Unreadable files stay unknown and remain eligible for E2E.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return byKey;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Table E2E (sync/CRUD) does not apply to viewpoint datasources.
|
|
98
|
+
* @param {string[]} keys
|
|
99
|
+
* @param {Object<string, string|undefined>} storageByKey
|
|
100
|
+
* @returns {{ runnable: string[], skipped: string[] }}
|
|
101
|
+
*/
|
|
102
|
+
function selectE2eRunnableKeys(keys, storageByKey) {
|
|
103
|
+
const runnable = [];
|
|
104
|
+
const skipped = [];
|
|
105
|
+
for (const key of keys) {
|
|
106
|
+
if (storageByKey[key] === 'view' || storageByKey[key] === 'record') skipped.push(key);
|
|
107
|
+
else runnable.push(key);
|
|
108
|
+
}
|
|
109
|
+
return { runnable, skipped };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Drops storageType view keys and logs skips. Empty runnable is success (nothing to run).
|
|
114
|
+
* @param {string} externalSystem
|
|
115
|
+
* @param {string} appPath
|
|
116
|
+
* @param {string[]} datasourceFiles
|
|
117
|
+
* @param {string} systemKey
|
|
118
|
+
* @param {string[]} keys
|
|
119
|
+
* @returns {string[]}
|
|
120
|
+
*/
|
|
121
|
+
function prepareE2eDatasourceKeys(externalSystem, appPath, datasourceFiles, systemKey, keys) {
|
|
122
|
+
const storageByKey = loadDatasourceStorageByKey(appPath, datasourceFiles, systemKey);
|
|
123
|
+
const { runnable, skipped } = selectE2eRunnableKeys(keys, storageByKey);
|
|
124
|
+
skipped.forEach((key) => {
|
|
125
|
+
const reason =
|
|
126
|
+
storageByKey[key] === 'record' ? 'fetch.source record' : 'storageType view';
|
|
127
|
+
logger.log(chalk.gray(`⏭ Skipping ${key} (${reason})`));
|
|
128
|
+
});
|
|
129
|
+
if (runnable.length === 0 && keys.length === 0) {
|
|
130
|
+
logger.log(chalk.yellow(`No datasources found for ${externalSystem}. Add datasource files and run aifabrix repair.`));
|
|
131
|
+
}
|
|
132
|
+
return runnable;
|
|
133
|
+
}
|
|
134
|
+
|
|
42
135
|
/**
|
|
43
136
|
* Resolves the list of datasource keys for an external system (from system file or discovered files).
|
|
44
137
|
* @param {string} appPath - Integration app path
|
|
@@ -117,22 +210,29 @@ async function syncLocalIfRequested(systemKey, options) {
|
|
|
117
210
|
return uploadCtx && uploadCtx.dataplaneUrl && uploadCtx.authConfig ? uploadCtx : null;
|
|
118
211
|
}
|
|
119
212
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
213
|
+
function isPlatformShellAppPath(appPath) {
|
|
214
|
+
const parent = path.basename(path.dirname(path.resolve(String(appPath || ''))));
|
|
215
|
+
return parent === 'role-assistant' || parent === 'enterprise-knowledge';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function platformShellIntegrationContext(systemKey, appPath) {
|
|
219
|
+
return { systemKey, keys: [], appPath, datasourceFiles: [] };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function tryApplicationConfigPath(appPath) {
|
|
223
|
+
try {
|
|
224
|
+
return resolveApplicationConfigPath(appPath);
|
|
225
|
+
} catch (error) {
|
|
226
|
+
if (isPlatformShellAppPath(appPath)) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
throw error;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
134
233
|
/**
|
|
135
234
|
* Resolve integration folder, system key, and datasource keys for system-level tests.
|
|
235
|
+
* Role Assistant / Enterprise Knowledge packages have no application.yaml.
|
|
136
236
|
* @param {string} externalSystem
|
|
137
237
|
* @returns {{ systemKey: string, keys: string[] }}
|
|
138
238
|
*/
|
|
@@ -144,13 +244,19 @@ function resolveExternalIntegrationContext(externalSystem, pathOptions = {}) {
|
|
|
144
244
|
if (!fs.existsSync(appPath)) {
|
|
145
245
|
throw new Error(`Integration path not found: ${appPath}`);
|
|
146
246
|
}
|
|
147
|
-
const configPath =
|
|
247
|
+
const configPath = tryApplicationConfigPath(appPath);
|
|
248
|
+
if (!configPath) {
|
|
249
|
+
return platformShellIntegrationContext(externalSystem, appPath);
|
|
250
|
+
}
|
|
148
251
|
let variables = {};
|
|
149
252
|
if (fs.existsSync(configPath)) {
|
|
150
253
|
variables = loadConfigFile(configPath);
|
|
151
254
|
}
|
|
152
255
|
const { systemFiles, datasourceFiles: discovered } = discoverIntegrationFiles(appPath);
|
|
153
256
|
if (systemFiles.length === 0) {
|
|
257
|
+
if (isPlatformShellAppPath(appPath)) {
|
|
258
|
+
return platformShellIntegrationContext(externalSystem, appPath);
|
|
259
|
+
}
|
|
154
260
|
throw new Error(`No system file found in ${appPath}. Expected *-system.yaml or *-system.json`);
|
|
155
261
|
}
|
|
156
262
|
const datasourceFiles = buildEffectiveDatasourceFiles(
|
|
@@ -171,13 +277,33 @@ function resolveExternalIntegrationContext(externalSystem, pathOptions = {}) {
|
|
|
171
277
|
systemParsed,
|
|
172
278
|
datasourceFiles
|
|
173
279
|
);
|
|
174
|
-
return { systemKey, keys };
|
|
280
|
+
return { systemKey, keys, appPath, datasourceFiles };
|
|
175
281
|
}
|
|
176
282
|
|
|
283
|
+
/* eslint-disable max-lines-per-function, max-statements -- Load context, then loop over keys */
|
|
284
|
+
/**
|
|
285
|
+
* Runs E2E for all datasources of an external system. Uses each datasource's payloadTemplate (no extra params required).
|
|
286
|
+
*
|
|
287
|
+
* @async
|
|
288
|
+
* @param {string} externalSystem - System key (e.g. hubspot-demo)
|
|
289
|
+
* @param {Object} options - Options passed to each runDatasourceTestE2E
|
|
290
|
+
* @param {string} [options.env] - Environment (dev, tst, pro)
|
|
291
|
+
* @param {boolean} [options.debug] - Include debug, write log
|
|
292
|
+
* @param {boolean} [options.verbose] - Verbose output
|
|
293
|
+
* @param {boolean} [options.async] - If false, sync mode (default true)
|
|
294
|
+
* @param {boolean} [options.noPublish] - When true, skip upload (E2E uses dataplane config already deployed)
|
|
295
|
+
* @returns {Promise<{ success: boolean, results: Array<{ key: string, success: boolean, error?: string }> }>}
|
|
296
|
+
*/
|
|
177
297
|
async function runTestE2EForExternalSystem(externalSystem, options = {}) {
|
|
178
|
-
const { systemKey, keys } = resolveExternalIntegrationContext(externalSystem);
|
|
179
|
-
|
|
180
|
-
|
|
298
|
+
const { systemKey, keys, appPath, datasourceFiles } = resolveExternalIntegrationContext(externalSystem);
|
|
299
|
+
const e2eKeys = prepareE2eDatasourceKeys(
|
|
300
|
+
externalSystem,
|
|
301
|
+
appPath,
|
|
302
|
+
datasourceFiles,
|
|
303
|
+
systemKey,
|
|
304
|
+
keys
|
|
305
|
+
);
|
|
306
|
+
if (e2eKeys.length === 0) {
|
|
181
307
|
return { success: true, results: [] };
|
|
182
308
|
}
|
|
183
309
|
|
|
@@ -217,12 +343,12 @@ async function runTestE2EForExternalSystem(externalSystem, options = {}) {
|
|
|
217
343
|
quietPollUi: options.quietPollUi === true,
|
|
218
344
|
onPollProgress: options.onPollProgress
|
|
219
345
|
};
|
|
220
|
-
for (const key of
|
|
346
|
+
for (const key of e2eKeys) {
|
|
221
347
|
if (typeof options.onDatasourceProgress === 'function') {
|
|
222
348
|
options.onDatasourceProgress({
|
|
223
349
|
key,
|
|
224
350
|
index: results.length,
|
|
225
|
-
total:
|
|
351
|
+
total: e2eKeys.length
|
|
226
352
|
});
|
|
227
353
|
}
|
|
228
354
|
try {
|
|
@@ -246,6 +372,7 @@ async function runTestE2EForExternalSystem(externalSystem, options = {}) {
|
|
|
246
372
|
module.exports = {
|
|
247
373
|
runTestE2EForExternalSystem,
|
|
248
374
|
getDatasourceKeys,
|
|
375
|
+
selectE2eRunnableKeys,
|
|
249
376
|
resolveExternalIntegrationContext,
|
|
250
377
|
syncLocalIfRequested
|
|
251
378
|
};
|
|
@@ -25,11 +25,13 @@ const {
|
|
|
25
25
|
async function runTestTrustForExternalSystem(externalSystem, options = {}) {
|
|
26
26
|
const { systemKey } = resolveExternalIntegrationContext(externalSystem);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
if (options.upload === true && options.noPublish !== true) {
|
|
29
|
+
const uploadCtx = await syncLocalIfRequested(systemKey, options);
|
|
30
|
+
if (uploadCtx?.authConfig && uploadCtx?.dataplaneUrl) {
|
|
31
|
+
options.authConfig = uploadCtx.authConfig;
|
|
32
|
+
options.dataplaneUrl = uploadCtx.dataplaneUrl;
|
|
33
|
+
options.silentResolve = true;
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
if (options.revalidate === true) {
|
|
35
37
|
logger.log(chalk.cyan('Forcing revalidation (cache bypass)…'));
|
|
@@ -91,7 +91,8 @@ async function pushAndLogCredentialSecrets(dataplaneUrl, authConfig, systemKey,
|
|
|
91
91
|
pushCredentialSecrets(dataplaneUrl, authConfig, {
|
|
92
92
|
envFilePath,
|
|
93
93
|
appName: systemKey,
|
|
94
|
-
payload
|
|
94
|
+
payload,
|
|
95
|
+
excludeKeys: uiOpts.excludeSecretKeys
|
|
95
96
|
}),
|
|
96
97
|
{ systemKey, json: uiOpts.json === true }
|
|
97
98
|
);
|
|
@@ -57,7 +57,7 @@ async function resolveUploadPublishContext(
|
|
|
57
57
|
environment: options.environment
|
|
58
58
|
});
|
|
59
59
|
requireBearerForDataplanePipeline(resolved.authConfig);
|
|
60
|
-
if (options.force === true) {
|
|
60
|
+
if (options.force === true && options.suppressSummary !== true) {
|
|
61
61
|
logForcePublishWarning();
|
|
62
62
|
}
|
|
63
63
|
const controllerUrl = await resolveControllerUrl();
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role Assistant upload without Connected System files.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Settings + Evidence path for role-assistant/ packages
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const chalk = require('chalk');
|
|
10
|
+
const logger = require('../utils/logger');
|
|
11
|
+
const { detectAppType } = require('../utils/paths');
|
|
12
|
+
const { isRoleAssistantWorkspace } = require('../utils/platform-shell-package');
|
|
13
|
+
const {
|
|
14
|
+
SYSTEM_KIND_DIGITAL_WORKER,
|
|
15
|
+
readRoleAssistantSettings,
|
|
16
|
+
resolveRoleAssistantSettingsVersion,
|
|
17
|
+
resolveRoleAssistantEnvironmentSettings
|
|
18
|
+
} = require('../role-assistant/settings');
|
|
19
|
+
const { validateExternalSystemComplete } = require('../validation/validate');
|
|
20
|
+
const { displayValidationResults } = require('../validation/validate-display');
|
|
21
|
+
const { formatSuccessLine } = require('../utils/cli-test-layout-chalk');
|
|
22
|
+
const { runUploadSidecarFollowups } = require('./upload-sidecar-followups');
|
|
23
|
+
const { finalizeUploadPublishResult } = require('./upload-data-sync-finalize');
|
|
24
|
+
|
|
25
|
+
async function isRoleAssistantShellPackage(systemKey, options = {}) {
|
|
26
|
+
const pathOptions = options.pathOptions || {};
|
|
27
|
+
const detected = await detectAppType(systemKey, pathOptions);
|
|
28
|
+
return isRoleAssistantWorkspace(detected.baseDir);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function buildRoleAssistantShellPayload(systemKey, options = {}) {
|
|
32
|
+
const pathOptions = options.pathOptions || {};
|
|
33
|
+
const settings = readRoleAssistantSettings(systemKey, { required: true, pathOptions });
|
|
34
|
+
resolveRoleAssistantEnvironmentSettings(settings, options.env || 'dev', { required: true });
|
|
35
|
+
const version = resolveRoleAssistantSettingsVersion(settings) || '1.0.0';
|
|
36
|
+
return {
|
|
37
|
+
version,
|
|
38
|
+
application: {
|
|
39
|
+
key: systemKey,
|
|
40
|
+
systemKind: SYSTEM_KIND_DIGITAL_WORKER
|
|
41
|
+
},
|
|
42
|
+
dataSources: [],
|
|
43
|
+
status: options.uploadStatus === 'published' ? 'published' : 'draft'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function assertRoleAssistantShellValid(validationResult) {
|
|
48
|
+
if (validationResult && validationResult.valid) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
displayValidationResults(validationResult);
|
|
52
|
+
const errors = (validationResult && validationResult.errors) || [];
|
|
53
|
+
const summary = errors.slice(0, 3).map((item) => (typeof item === 'string' ? item : String(item))).join('; ');
|
|
54
|
+
throw new Error(
|
|
55
|
+
summary
|
|
56
|
+
? `Validation failed: ${summary}. Fix errors above and run the command again.`
|
|
57
|
+
: 'Validation failed. Fix errors before uploading.'
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function validateRoleAssistantShellPackage(systemKey, options = {}) {
|
|
62
|
+
const pathOptions = options.pathOptions || {};
|
|
63
|
+
const validationResult = await validateExternalSystemComplete(systemKey, {
|
|
64
|
+
type: 'external',
|
|
65
|
+
...pathOptions
|
|
66
|
+
});
|
|
67
|
+
assertRoleAssistantShellValid(validationResult);
|
|
68
|
+
if (options.minimal !== true) {
|
|
69
|
+
logger.log(formatSuccessLine('Local validation passed'));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function logRoleAssistantShellDryRun(systemKey, payload) {
|
|
74
|
+
logger.log(
|
|
75
|
+
chalk.yellow(
|
|
76
|
+
'Dry run: would apply Role Assistant settings and Evidence (no Connected System publish).'
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
logger.log(chalk.gray(` System: ${systemKey}, version: ${payload.version}`));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function applyRoleAssistantShellSidecars(systemKey, options, payload, deps) {
|
|
83
|
+
const { dataplaneUrl, authConfig, environment } = await deps.resolveDataplaneAndAuth(
|
|
84
|
+
systemKey,
|
|
85
|
+
options
|
|
86
|
+
);
|
|
87
|
+
const sidecar = await runUploadSidecarFollowups({
|
|
88
|
+
systemKey,
|
|
89
|
+
options: { ...options, skipDataSync: true },
|
|
90
|
+
payload,
|
|
91
|
+
dataplaneUrl,
|
|
92
|
+
authConfig,
|
|
93
|
+
environment
|
|
94
|
+
});
|
|
95
|
+
if (options.suppressSummary !== true && options.minimal !== true) {
|
|
96
|
+
logger.log(
|
|
97
|
+
formatSuccessLine('Role Assistant settings and Evidence applied (no Connected System publish).')
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return finalizeUploadPublishResult(
|
|
101
|
+
{ dataplaneUrl, authConfig, environment, uploadSkipped: true, sidecar },
|
|
102
|
+
payload,
|
|
103
|
+
options
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async function uploadRoleAssistantShellPackage(systemKey, options = {}, deps = {}) {
|
|
108
|
+
if (!deps.resolveDataplaneAndAuth) {
|
|
109
|
+
throw new Error('Role Assistant upload requires dataplane auth resolution');
|
|
110
|
+
}
|
|
111
|
+
await validateRoleAssistantShellPackage(systemKey, options);
|
|
112
|
+
const payload = buildRoleAssistantShellPayload(systemKey, options);
|
|
113
|
+
if (options.dryRun === true) {
|
|
114
|
+
logRoleAssistantShellDryRun(systemKey, payload);
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
return applyRoleAssistantShellSidecars(systemKey, options, payload, deps);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
module.exports = {
|
|
121
|
+
isRoleAssistantShellPackage,
|
|
122
|
+
buildRoleAssistantShellPayload,
|
|
123
|
+
uploadRoleAssistantShellPackage
|
|
124
|
+
};
|
|
@@ -38,11 +38,14 @@ function buildRoleAssistantSyncContext(ctx, model) {
|
|
|
38
38
|
|
|
39
39
|
async function runGovernanceSidecar(ctx, sidecar, quietSidecar) {
|
|
40
40
|
try {
|
|
41
|
-
const {
|
|
42
|
-
|
|
41
|
+
const {
|
|
42
|
+
uploadGovernanceScenarioPacks,
|
|
43
|
+
normalizeGovernanceUploadResult
|
|
44
|
+
} = require('../lifecycle/scenario-upload');
|
|
45
|
+
const result = await uploadGovernanceScenarioPacks(ctx.systemKey, ctx.dataplaneUrl, ctx.authConfig, {
|
|
43
46
|
silent: quietSidecar
|
|
44
47
|
});
|
|
45
|
-
sidecar.governance =
|
|
48
|
+
sidecar.governance = normalizeGovernanceUploadResult(result);
|
|
46
49
|
} catch (err) {
|
|
47
50
|
sidecar.governance = { skipped: true, reason: err.message || String(err) };
|
|
48
51
|
if (!quietSidecar) {
|
|
@@ -114,7 +117,8 @@ async function runUploadSidecarFollowups(ctx) {
|
|
|
114
117
|
governance: null,
|
|
115
118
|
evidence: null,
|
|
116
119
|
knowledge: null,
|
|
117
|
-
documentStorageSettings: null
|
|
120
|
+
documentStorageSettings: null,
|
|
121
|
+
tests: null
|
|
118
122
|
};
|
|
119
123
|
const quietSidecar = isQuietMinimalSync(ctx.options);
|
|
120
124
|
const model = buildRoleAssistantModel(ctx.payload);
|
|
@@ -128,6 +132,8 @@ async function runUploadSidecarFollowups(ctx) {
|
|
|
128
132
|
throw err;
|
|
129
133
|
}
|
|
130
134
|
await runKnowledgeSidecar(ctx, model, sidecar, quietSidecar);
|
|
135
|
+
const { runTestsSidecar } = require('../role-assistant/test-pack-sync');
|
|
136
|
+
await runTestsSidecar(ctx, sidecar, quietSidecar);
|
|
131
137
|
return sidecar;
|
|
132
138
|
}
|
|
133
139
|
|
package/lib/commands/upload.js
CHANGED
|
@@ -44,6 +44,7 @@ const { maybeSyncOpenApiFilesForMcp } = require('./repair-openapi-sync');
|
|
|
44
44
|
const { exportProgrammaticOpenApiForRepair } = require('./repair-openapi-export');
|
|
45
45
|
const { resolveUploadPublishContext } = require('./upload-publish-context');
|
|
46
46
|
const { syncDeployJsonFromSources } = require('../external-system/sync-deploy-manifest');
|
|
47
|
+
const { assertUploadPackageIdentity } = require('../external-system/upload-identity');
|
|
47
48
|
const { handlePublicationAndFollowups } = require('./upload-sidecar-followups');
|
|
48
49
|
const { finalizeUploadPublishResult, finishUnchangedUploadPublication } = require('./upload-data-sync-finalize');
|
|
49
50
|
const { pushAndLogCredentialSecrets } = require('./upload-credential-push-log');
|
|
@@ -53,6 +54,10 @@ const {
|
|
|
53
54
|
resolveRoleAssistantSettingsVersion,
|
|
54
55
|
resolveRoleAssistantEnvironmentSettings
|
|
55
56
|
} = require('../role-assistant/settings');
|
|
57
|
+
const {
|
|
58
|
+
isRoleAssistantShellPackage,
|
|
59
|
+
uploadRoleAssistantShellPackage
|
|
60
|
+
} = require('./upload-role-assistant-shell');
|
|
56
61
|
|
|
57
62
|
/**
|
|
58
63
|
* Validates system-key format (same as download).
|
|
@@ -149,7 +154,10 @@ async function runUploadValidatePublish(
|
|
|
149
154
|
{ timeoutMs: options.timeoutMs }
|
|
150
155
|
);
|
|
151
156
|
if (res?.success === false) {
|
|
152
|
-
|
|
157
|
+
const err = new Error(formatApiError(res, dataplaneUrl));
|
|
158
|
+
const status = Number(res.status || res.statusCode);
|
|
159
|
+
err.statusCode = status >= 400 && status < 600 ? status : 400;
|
|
160
|
+
throw err;
|
|
153
161
|
}
|
|
154
162
|
return res;
|
|
155
163
|
}
|
|
@@ -256,6 +264,7 @@ async function buildValidatedUploadManifestPayload(systemKey, opts = {}) {
|
|
|
256
264
|
}
|
|
257
265
|
}
|
|
258
266
|
await resolvePayloadConfiguration(systemKey, payload, pathOptions);
|
|
267
|
+
assertUploadPackageIdentity(payload, systemKey);
|
|
259
268
|
return { manifest, payload };
|
|
260
269
|
}
|
|
261
270
|
|
|
@@ -312,7 +321,8 @@ async function completeUploadAfterPublish(systemKey, options, manifest, payload,
|
|
|
312
321
|
const pushMeta = await pushAndLogCredentialSecrets(ctx.dataplaneUrl, ctx.authConfig, systemKey, payload, {
|
|
313
322
|
json: options.json === true,
|
|
314
323
|
pathOptions: options.pathOptions,
|
|
315
|
-
suppressCredentialLog: quietCompact
|
|
324
|
+
suppressCredentialLog: quietCompact,
|
|
325
|
+
excludeSecretKeys: options.excludeSecretKeys
|
|
316
326
|
});
|
|
317
327
|
await logAndSyncLocalOpenApiForUpload(systemKey, manifest, {
|
|
318
328
|
dataplaneUrl: ctx.dataplaneUrl,
|
|
@@ -417,7 +427,12 @@ async function uploadExternalSystem(systemKey, options = {}) {
|
|
|
417
427
|
: options.minimal === false
|
|
418
428
|
? false
|
|
419
429
|
: options.verbose !== true;
|
|
420
|
-
const uploadOptions = { ...options, minimal };
|
|
430
|
+
const uploadOptions = { ...options, minimal, pathOptions };
|
|
431
|
+
if (await isRoleAssistantShellPackage(systemKey, uploadOptions)) {
|
|
432
|
+
return uploadRoleAssistantShellPackage(systemKey, uploadOptions, {
|
|
433
|
+
resolveDataplaneAndAuth
|
|
434
|
+
});
|
|
435
|
+
}
|
|
421
436
|
if (!minimal) {
|
|
422
437
|
logger.log('');
|
|
423
438
|
logger.log(sectionTitle('Upload external system'));
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When verify-operations should skip live E2E (Role Assistant or static custom).
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Skip E2E for packages that have no live vendor pull
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { loadConfigFile } = require('../utils/config-format');
|
|
11
|
+
const { discoverIntegrationFiles } = require('./repair-internal');
|
|
12
|
+
|
|
13
|
+
const STORAGE_ENTITY_TYPES = new Set(['recordStorage', 'documentStorage']);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Role Assistant packages use authType none + nested builder-api CIP.
|
|
17
|
+
* Live capacity E2E expects a system baseUrl credential and is not the RA certify path.
|
|
18
|
+
* @param {string} systemKey
|
|
19
|
+
* @param {Object} options
|
|
20
|
+
* @returns {boolean}
|
|
21
|
+
*/
|
|
22
|
+
function shouldSkipE2eForRoleAssistant(systemKey, options) {
|
|
23
|
+
if (options.forceE2e === true) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const { resolveAppWorkspace } = require('../utils/app-path-resolve');
|
|
28
|
+
const { baseDir } = resolveAppWorkspace(systemKey, {});
|
|
29
|
+
return baseDir === 'role-assistant';
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} filePath
|
|
37
|
+
* @returns {Object|null}
|
|
38
|
+
*/
|
|
39
|
+
function readManifestObject(filePath) {
|
|
40
|
+
try {
|
|
41
|
+
const parsed = loadConfigFile(filePath);
|
|
42
|
+
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} appPath
|
|
50
|
+
* @param {string} systemKey
|
|
51
|
+
* @returns {string|null}
|
|
52
|
+
*/
|
|
53
|
+
function readLocalSystemType(appPath, systemKey) {
|
|
54
|
+
const candidates = [
|
|
55
|
+
path.join(appPath, `${systemKey}-system.json`),
|
|
56
|
+
path.join(appPath, `${systemKey}-system.yaml`),
|
|
57
|
+
path.join(appPath, `${systemKey}-system.yml`)
|
|
58
|
+
];
|
|
59
|
+
for (const filePath of candidates) {
|
|
60
|
+
const doc = readManifestObject(filePath);
|
|
61
|
+
if (doc && typeof doc.type === 'string' && doc.type.trim()) {
|
|
62
|
+
return doc.type.trim().toLowerCase();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @param {string} appPath
|
|
70
|
+
* @returns {Object[]}
|
|
71
|
+
*/
|
|
72
|
+
function loadStorageDatasources(appPath) {
|
|
73
|
+
const { datasourceFiles } = discoverIntegrationFiles(appPath);
|
|
74
|
+
const storage = [];
|
|
75
|
+
for (const name of datasourceFiles) {
|
|
76
|
+
const doc = readManifestObject(path.join(appPath, name));
|
|
77
|
+
if (!doc || !STORAGE_ENTITY_TYPES.has(String(doc.entityType || ''))) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
storage.push(doc);
|
|
81
|
+
}
|
|
82
|
+
return storage;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Static custom packages (syncBridge disabled) have no live vendor pull.
|
|
87
|
+
* @param {string} systemKey
|
|
88
|
+
* @param {Object} options
|
|
89
|
+
* @returns {boolean}
|
|
90
|
+
*/
|
|
91
|
+
function shouldSkipE2eForStaticPackage(systemKey, options) {
|
|
92
|
+
if (options.forceE2e === true) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const { resolveAppWorkspace } = require('../utils/app-path-resolve');
|
|
97
|
+
const { baseDir, appPath } = resolveAppWorkspace(systemKey, options);
|
|
98
|
+
if (baseDir !== 'integration' || !appPath) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (readLocalSystemType(appPath, systemKey) !== 'custom') {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const storage = loadStorageDatasources(appPath);
|
|
105
|
+
if (storage.length === 0) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
return storage.every((ds) => String(ds.syncBridge || 'disabled').toLowerCase() === 'disabled');
|
|
109
|
+
} catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @param {string} systemKey
|
|
116
|
+
* @param {Object} options
|
|
117
|
+
* @returns {boolean}
|
|
118
|
+
*/
|
|
119
|
+
function shouldSkipOperationsE2e(systemKey, options) {
|
|
120
|
+
if (options.skipE2e === true || options.minimal === true) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
return shouldSkipE2eForRoleAssistant(systemKey, options)
|
|
124
|
+
|| shouldSkipE2eForStaticPackage(systemKey, options);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
module.exports = {
|
|
128
|
+
shouldSkipOperationsE2e,
|
|
129
|
+
shouldSkipE2eForRoleAssistant,
|
|
130
|
+
shouldSkipE2eForStaticPackage
|
|
131
|
+
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
const { validateExternalSystemComplete } = require('../validation/validate');
|
|
8
8
|
const { testExternalSystem, testExternalSystemIntegration } = require('../external-system/test');
|
|
9
9
|
const { runTestE2EForExternalSystem } = require('./test-e2e-external');
|
|
10
|
+
const { shouldSkipOperationsE2e } = require('./verify-operations-skip-e2e');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @param {string} systemKey
|
|
@@ -59,21 +60,13 @@ function buildAfterSyncSteps(systemKey, options) {
|
|
|
59
60
|
* @returns {Object}
|
|
60
61
|
*/
|
|
61
62
|
function buildE2eStep(systemKey, options) {
|
|
62
|
-
if (
|
|
63
|
+
if (shouldSkipOperationsE2e(systemKey, options)) {
|
|
64
|
+
const reason = options.skipE2e === true || options.minimal === true
|
|
65
|
+
? 'minimal'
|
|
66
|
+
: 'static-or-role-assistant';
|
|
63
67
|
return {
|
|
64
68
|
key: 'e2e',
|
|
65
|
-
run: async() => ({ success: true, skipped: true, reason
|
|
66
|
-
ok: () => true
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (shouldSkipE2eForRoleAssistant(systemKey, options)) {
|
|
70
|
-
return {
|
|
71
|
-
key: 'e2e',
|
|
72
|
-
run: async() => ({
|
|
73
|
-
success: true,
|
|
74
|
-
skipped: true,
|
|
75
|
-
reason: 'role-assistant-auth-none'
|
|
76
|
-
}),
|
|
69
|
+
run: async() => ({ success: true, skipped: true, reason }),
|
|
77
70
|
ok: () => true
|
|
78
71
|
};
|
|
79
72
|
}
|
|
@@ -99,26 +92,6 @@ function buildE2eStep(systemKey, options) {
|
|
|
99
92
|
};
|
|
100
93
|
}
|
|
101
94
|
|
|
102
|
-
/**
|
|
103
|
-
* Role Assistant packages use authType none + nested builder-api CIP.
|
|
104
|
-
* Live capacity E2E expects a system baseUrl credential and is not the RA certify path.
|
|
105
|
-
* @param {string} systemKey
|
|
106
|
-
* @param {Object} options
|
|
107
|
-
* @returns {boolean}
|
|
108
|
-
*/
|
|
109
|
-
function shouldSkipE2eForRoleAssistant(systemKey, options) {
|
|
110
|
-
if (options.forceE2e === true) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
const { resolveAppWorkspace } = require('../utils/app-path-resolve');
|
|
115
|
-
const { baseDir } = resolveAppWorkspace(systemKey, {});
|
|
116
|
-
return baseDir === 'role-assistant';
|
|
117
|
-
} catch {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
95
|
/**
|
|
123
96
|
* @param {string} systemKey
|
|
124
97
|
* @param {Object} options
|