@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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register `channel configure` (callback URL on the existing Integration Client).
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Thin wrapper over Integration Client redirect URI update
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const logger = require('../utils/logger');
|
|
10
|
+
const {
|
|
11
|
+
formatWarningLine,
|
|
12
|
+
formatBlockingError
|
|
13
|
+
} = require('../utils/cli-layout-chalk');
|
|
14
|
+
const { printCallbackRegistered } = require('../channels/channel-add-tty');
|
|
15
|
+
const { isChannelTargetKey, formatUnknownChannelTargetError } = require('../channels/channel-targets');
|
|
16
|
+
const { resolveChannelAuthContext } = require('../channels/channel-auth-context');
|
|
17
|
+
const { registerChatGptCallbackUrl } = require('../channels/chatgpt-callback');
|
|
18
|
+
const { runChatGptConfigureValidate } = require('../channels/chatgpt-channel-add');
|
|
19
|
+
const { registerClaudeCallbackUrl } = require('../channels/claude-callback');
|
|
20
|
+
const { runClaudeConfigureValidate } = require('../channels/claude-channel-add');
|
|
21
|
+
|
|
22
|
+
const CONFIGURE_TARGETS = new Set(['chatgpt', 'claude']);
|
|
23
|
+
|
|
24
|
+
const CHANNEL_CONFIGURE_HELP_AFTER = `
|
|
25
|
+
Examples:
|
|
26
|
+
$ aifabrix channel configure chatgpt --callback-url "https://chatgpt.com/connector/oauth/callback"
|
|
27
|
+
$ aifabrix channel configure claude --callback-url "https://claude.ai/api/mcp/auth_callback"
|
|
28
|
+
|
|
29
|
+
Registers an HTTPS OAuth callback on the existing ChatGPT or Claude Integration Client.
|
|
30
|
+
Does not rotate the client secret. Extra redirect URIs are preserved.
|
|
31
|
+
|
|
32
|
+
Requires: aifabrix login and integration-client:read plus integration-client:update
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} channelTarget
|
|
37
|
+
* @param {Object} ctx
|
|
38
|
+
* @param {string} callbackUrl
|
|
39
|
+
* @returns {Promise<Object>}
|
|
40
|
+
*/
|
|
41
|
+
async function registerConfigureCallback(channelTarget, ctx, callbackUrl) {
|
|
42
|
+
if (channelTarget === 'claude') {
|
|
43
|
+
return registerClaudeCallbackUrl({ ctx, callbackUrl });
|
|
44
|
+
}
|
|
45
|
+
return registerChatGptCallbackUrl({ ctx, callbackUrl });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} channelTarget
|
|
50
|
+
* @param {Object} ctx
|
|
51
|
+
* @returns {Promise<void>}
|
|
52
|
+
*/
|
|
53
|
+
async function validateAfterConfigure(channelTarget, ctx) {
|
|
54
|
+
if (channelTarget === 'claude') {
|
|
55
|
+
await runClaudeConfigureValidate(ctx);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await runChatGptConfigureValidate(ctx);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {string} channelTarget
|
|
63
|
+
* @param {Object} options
|
|
64
|
+
* @returns {Promise<void>}
|
|
65
|
+
*/
|
|
66
|
+
async function runChannelConfigure(channelTarget, options = {}) {
|
|
67
|
+
if (!isChannelTargetKey(channelTarget)) {
|
|
68
|
+
throw new Error(formatUnknownChannelTargetError(channelTarget));
|
|
69
|
+
}
|
|
70
|
+
if (!CONFIGURE_TARGETS.has(channelTarget)) {
|
|
71
|
+
throw new Error(
|
|
72
|
+
`channel configure currently supports chatgpt and claude. Received "${channelTarget}".`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
const callbackUrl =
|
|
76
|
+
typeof options.callbackUrl === 'string' ? options.callbackUrl.trim() : '';
|
|
77
|
+
if (!callbackUrl) {
|
|
78
|
+
throw new Error(`--callback-url is required for channel configure ${channelTarget}.`);
|
|
79
|
+
}
|
|
80
|
+
const ctx = await resolveChannelAuthContext(channelTarget, { silent: true });
|
|
81
|
+
const result = await registerConfigureCallback(channelTarget, ctx, callbackUrl);
|
|
82
|
+
if (result.fallback) {
|
|
83
|
+
logger.log(
|
|
84
|
+
formatWarningLine(
|
|
85
|
+
`Missing integration-client:update. Add the callback on the ${channelTarget} profile: ${result.profileUrl}`
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
printCallbackRegistered();
|
|
91
|
+
await validateAfterConfigure(channelTarget, ctx);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @param {import('commander').Command} parent
|
|
96
|
+
* @returns {import('commander').Command}
|
|
97
|
+
*/
|
|
98
|
+
function registerChannelConfigureCommand(parent) {
|
|
99
|
+
return parent
|
|
100
|
+
.command('configure <channelTarget>')
|
|
101
|
+
.description('Register a ChatGPT or Claude callback URL on the existing OAuth2 profile')
|
|
102
|
+
.option('--callback-url <url>', 'HTTPS redirect URI from ChatGPT or Claude OAuth')
|
|
103
|
+
.addHelpText('after', CHANNEL_CONFIGURE_HELP_AFTER)
|
|
104
|
+
.action(async(channelTarget, options) => {
|
|
105
|
+
try {
|
|
106
|
+
await runChannelConfigure(channelTarget, options);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
logger.error(formatBlockingError(error.message || String(error)));
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
module.exports = {
|
|
115
|
+
CHANNEL_CONFIGURE_HELP_AFTER,
|
|
116
|
+
registerChannelConfigureCommand,
|
|
117
|
+
runChannelConfigure
|
|
118
|
+
};
|
package/lib/commands/channel.js
CHANGED
|
@@ -22,15 +22,23 @@ const {
|
|
|
22
22
|
} = require('../channels/channel-targets');
|
|
23
23
|
const { scaffoldChannelIntegration } = require('../channels/channel-integration-generator');
|
|
24
24
|
const { registerChannelAddCommand } = require('./channel-add-setup');
|
|
25
|
+
const { registerChannelConfigureCommand } = require('./channel-configure');
|
|
25
26
|
|
|
26
27
|
const CHANNEL_HELP_AFTER = `
|
|
27
28
|
Subcommands:
|
|
28
|
-
add
|
|
29
|
+
add [target] One command: scaffold (if needed) → upload (if needed/--force) → install
|
|
30
|
+
configure chatgpt Register the ChatGPT callback URL on the existing OAuth2 profile
|
|
29
31
|
scaffold <target> Optional: create integration/<target>/ files only (local)
|
|
30
32
|
|
|
31
33
|
${formatSupportedChannelTargetsHelp()}
|
|
32
34
|
|
|
35
|
+
Examples:
|
|
36
|
+
$ aifabrix channel add
|
|
37
|
+
$ aifabrix channel add slack --name "Elsa" --probe
|
|
38
|
+
$ aifabrix channel configure chatgpt --callback-url "https://chatgpt.com/connector/oauth/callback"
|
|
39
|
+
|
|
33
40
|
Typical flow:
|
|
41
|
+
aifabrix channel add
|
|
34
42
|
aifabrix channel add slack --name "Elsa" --probe
|
|
35
43
|
|
|
36
44
|
# Force re-upload of the communication system, then reinstall channel
|
|
@@ -102,6 +110,7 @@ function setupChannelCommands(program) {
|
|
|
102
110
|
});
|
|
103
111
|
|
|
104
112
|
registerChannelAddCommand(channel);
|
|
113
|
+
registerChannelConfigureCommand(channel);
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
module.exports = { setupChannelCommands };
|
|
@@ -18,9 +18,10 @@ const { runCapabilityRelate } = require('../datasource/capability/run-capability
|
|
|
18
18
|
const { printCapabilitySuccessFooter } = require('./datasource-capability-output');
|
|
19
19
|
|
|
20
20
|
const CAP_RELATE_HELP = `
|
|
21
|
-
Adds or replaces one **foreignKeys[]** row (metadata-only; no pipeline). Optional **metadataSchema.properties** stub unless **--skip-metadata-property**.
|
|
21
|
+
Adds or replaces one **foreignKeys[]** row (metadata-only; no pipeline). Optional **metadataSchema.properties** stub unless **--skip-metadata-property**. **--relation-name** defaults to the carrier **--field**.
|
|
22
22
|
|
|
23
|
-
$ aifabrix datasource capability relate
|
|
23
|
+
$ aifabrix datasource capability relate pkg-a-facts --to pkg-b-persons --field personId
|
|
24
|
+
$ aifabrix datasource capability relate pkg-a-facts --relation-name personId --to pkg-b-persons --field personId --target-field externalId
|
|
24
25
|
`;
|
|
25
26
|
|
|
26
27
|
function parseTargetFields(raw) {
|
|
@@ -103,8 +104,8 @@ function setupCapabilityRelateCommand(cap) {
|
|
|
103
104
|
.description(
|
|
104
105
|
'Add or replace foreignKeys[] metadata (+ optional metadataSchema property for relation name)'
|
|
105
106
|
)
|
|
106
|
-
.
|
|
107
|
-
.requiredOption('--to <targetDatasource>', 'Target datasource key (
|
|
107
|
+
.option('--relation-name <name>', 'FK name (camelCase; defaults to --field)')
|
|
108
|
+
.requiredOption('--to <targetDatasource>', 'Target datasource key (sibling packages resolve by key)')
|
|
108
109
|
.requiredOption('--field <name>', 'Local normalized attribute (foreignKeys.fields[])')
|
|
109
110
|
.option('--description <text>', 'FK description (defaults to a generated description)')
|
|
110
111
|
.option('--required', 'Mark FK required (foreignKeys[].required=true)')
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
uploadGovernanceScenarioPacks,
|
|
9
|
+
normalizeGovernanceUploadResult
|
|
10
|
+
} = require('../lifecycle/scenario-upload');
|
|
8
11
|
const { resolveGovernanceIntegrationContext } = require('./governance-cli-shared');
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -18,7 +21,7 @@ async function runGovernanceUploadForExternalSystem(systemKey, options = {}) {
|
|
|
18
21
|
systemKey,
|
|
19
22
|
options
|
|
20
23
|
);
|
|
21
|
-
const
|
|
24
|
+
const result = await uploadGovernanceScenarioPacks(
|
|
22
25
|
resolvedKey,
|
|
23
26
|
dataplaneUrl,
|
|
24
27
|
authConfig,
|
|
@@ -27,7 +30,7 @@ async function runGovernanceUploadForExternalSystem(systemKey, options = {}) {
|
|
|
27
30
|
return {
|
|
28
31
|
systemKey: resolvedKey,
|
|
29
32
|
command: 'governance upload',
|
|
30
|
-
|
|
33
|
+
...normalizeGovernanceUploadResult(result)
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -14,6 +14,7 @@ const { displayLifecycleReportTTY } = require('../lifecycle/report-display');
|
|
|
14
14
|
const { VERDICT } = require('../lifecycle/product-model');
|
|
15
15
|
const { exitCodeFromVerdict } = require('../lifecycle/exit-codes');
|
|
16
16
|
const { lifecycleHasGovernanceSubjects } = require('../lifecycle/lifecycle-governance-options');
|
|
17
|
+
const { lifecyclePillarSatisfied } = require('../lifecycle/role-assistant-governance');
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* @param {Object} options
|
|
@@ -48,11 +49,7 @@ function lifecycleVerdictFromReport(report) {
|
|
|
48
49
|
if (ops === VERDICT.FAILED || trust === VERDICT.FAILED || gov === VERDICT.FAILED) {
|
|
49
50
|
return VERDICT.FAILED;
|
|
50
51
|
}
|
|
51
|
-
if (
|
|
52
|
-
ops === VERDICT.VERIFIED &&
|
|
53
|
-
trust === VERDICT.VERIFIED &&
|
|
54
|
-
gov === VERDICT.VERIFIED
|
|
55
|
-
) {
|
|
52
|
+
if (lifecyclePillarSatisfied(ops) && lifecyclePillarSatisfied(trust) && lifecyclePillarSatisfied(gov)) {
|
|
56
53
|
return VERDICT.VERIFIED;
|
|
57
54
|
}
|
|
58
55
|
return VERDICT.NOT_VERIFIED;
|
|
@@ -24,6 +24,8 @@ const {
|
|
|
24
24
|
lifecycleGovernanceNeedsWork,
|
|
25
25
|
buildGovernanceOptsFromLifecycle
|
|
26
26
|
} = require('../lifecycle/lifecycle-governance-options');
|
|
27
|
+
const { remapRoleAssistantGovernanceReport } = require('../lifecycle/role-assistant-governance');
|
|
28
|
+
const { isRoleAssistantWorkspace } = require('../utils/platform-shell-package');
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* @async
|
|
@@ -76,6 +78,9 @@ async function runLifecycleGovernanceCombinedIfNeeded(
|
|
|
76
78
|
dataplaneUrl,
|
|
77
79
|
options
|
|
78
80
|
) {
|
|
81
|
+
if (options.skipConnectedSystemGovernance === true) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
79
84
|
if (!lifecycleHasGovernanceSubjects(options)) {
|
|
80
85
|
return;
|
|
81
86
|
}
|
|
@@ -100,16 +105,21 @@ async function runMissingVerifyStepsLocally(systemKey, report, options) {
|
|
|
100
105
|
const runOpts = { ...options, noPublish: true };
|
|
101
106
|
const pathsUtil = require('../utils/paths');
|
|
102
107
|
const appType = await pathsUtil.detectAppType(systemKey).catch(() => null);
|
|
103
|
-
const isRoleAssistantPackage =
|
|
104
|
-
|
|
108
|
+
const isRoleAssistantPackage =
|
|
109
|
+
options.skipConnectedSystemGovernance === true || isRoleAssistantWorkspace(appType && appType.baseDir);
|
|
110
|
+
// verify-operations / CS governance packs are integration/-only.
|
|
111
|
+
// Role Assistant isolation is Work Hub cases + role-assistant.yaml.
|
|
105
112
|
if (report.operations?.verdict !== VERDICT.VERIFIED && !isRoleAssistantPackage) {
|
|
106
113
|
await runVerifyOperationsForExternalSystem(systemKey, runOpts);
|
|
107
114
|
}
|
|
108
|
-
if (report.trust?.verdict !== VERDICT.VERIFIED) {
|
|
115
|
+
if (report.trust?.verdict !== VERDICT.VERIFIED && !isRoleAssistantPackage) {
|
|
109
116
|
await runVerifyTrustForExternalSystem(systemKey, runOpts);
|
|
110
117
|
}
|
|
111
|
-
if (
|
|
112
|
-
&&
|
|
118
|
+
if (
|
|
119
|
+
!isRoleAssistantPackage &&
|
|
120
|
+
report.governance?.verdict !== VERDICT.VERIFIED &&
|
|
121
|
+
report.governance?.verdict !== VERDICT.NOT_APPLICABLE
|
|
122
|
+
) {
|
|
113
123
|
if (lifecycleHasGovernanceSubjects(options)) {
|
|
114
124
|
const { runVerifyGovernanceCombined } = require('./verify-governance-combined-external');
|
|
115
125
|
await runVerifyGovernanceCombined(
|
|
@@ -143,15 +153,17 @@ async function buildLifecycleResult(
|
|
|
143
153
|
authConfig,
|
|
144
154
|
extra = {}
|
|
145
155
|
) {
|
|
156
|
+
const mappedReport =
|
|
157
|
+
extra.roleAssistant === true ? remapRoleAssistantGovernanceReport(report) : report;
|
|
146
158
|
const openApiPublished = await resolveOpenApiPublished(dataplaneUrl, authConfig, systemKey);
|
|
147
159
|
return {
|
|
148
160
|
systemKey,
|
|
149
161
|
command: 'lifecycle',
|
|
150
|
-
report,
|
|
162
|
+
report: mappedReport,
|
|
151
163
|
dataplaneUrl,
|
|
152
164
|
dataplaneUiBaseUrl,
|
|
153
165
|
openApiPublished,
|
|
154
|
-
certificationProgress: buildCertificationProgress(
|
|
166
|
+
certificationProgress: buildCertificationProgress(mappedReport, { openApiPublished }),
|
|
155
167
|
...extra
|
|
156
168
|
};
|
|
157
169
|
}
|
|
@@ -191,7 +203,58 @@ async function runLifecycleViaDataplaneApi(
|
|
|
191
203
|
dataplaneUrl,
|
|
192
204
|
dataplaneUiBaseUrl,
|
|
193
205
|
authConfig,
|
|
194
|
-
{
|
|
206
|
+
{
|
|
207
|
+
stepsRun: runRes.stepsRun || [],
|
|
208
|
+
source: 'api',
|
|
209
|
+
roleAssistant: options.roleAssistant === true
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function emptyRoleAssistantLifecycleReport(systemKey) {
|
|
215
|
+
return {
|
|
216
|
+
systemKey,
|
|
217
|
+
operations: { verdict: VERDICT.NOT_APPLICABLE },
|
|
218
|
+
trust: { verdict: VERDICT.NOT_APPLICABLE },
|
|
219
|
+
governance: { verdict: VERDICT.NOT_APPLICABLE },
|
|
220
|
+
recommendations: [],
|
|
221
|
+
warnings: [
|
|
222
|
+
{
|
|
223
|
+
code: 'ROLE_ASSISTANT_LIFECYCLE_REPORT_UNAVAILABLE',
|
|
224
|
+
message:
|
|
225
|
+
'Lifecycle report unavailable. Role Assistant cases still run against the published worker.'
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Role Assistant prove uses the published dataplane worker.
|
|
233
|
+
* Do not POST CS lifecycle/run or fall back to verify-trust (those paths need application.yaml).
|
|
234
|
+
* @async
|
|
235
|
+
*/
|
|
236
|
+
async function fetchRoleAssistantLifecycleResult(
|
|
237
|
+
systemKey,
|
|
238
|
+
authConfig,
|
|
239
|
+
dataplaneUrl,
|
|
240
|
+
dataplaneUiBaseUrl,
|
|
241
|
+
options
|
|
242
|
+
) {
|
|
243
|
+
let report;
|
|
244
|
+
try {
|
|
245
|
+
report = await getSystemLifecycleReport(dataplaneUrl, authConfig, systemKey, {
|
|
246
|
+
details: options.verbose === true
|
|
247
|
+
});
|
|
248
|
+
} catch {
|
|
249
|
+
report = emptyRoleAssistantLifecycleReport(systemKey);
|
|
250
|
+
}
|
|
251
|
+
return buildLifecycleResult(
|
|
252
|
+
systemKey,
|
|
253
|
+
report,
|
|
254
|
+
dataplaneUrl,
|
|
255
|
+
dataplaneUiBaseUrl,
|
|
256
|
+
authConfig,
|
|
257
|
+
{ source: 'api', roleAssistant: true }
|
|
195
258
|
);
|
|
196
259
|
}
|
|
197
260
|
|
|
@@ -205,6 +268,16 @@ async function executeLifecycleWork(systemKey, options = {}) {
|
|
|
205
268
|
const { authConfig, dataplaneUrl } = await resolveLifecycleAuth(systemKey, options);
|
|
206
269
|
const dataplaneUiBaseUrl = await resolveLifecycleDataplaneUiBaseUrl(dataplaneUrl);
|
|
207
270
|
|
|
271
|
+
if (options.roleAssistant === true) {
|
|
272
|
+
return fetchRoleAssistantLifecycleResult(
|
|
273
|
+
systemKey,
|
|
274
|
+
authConfig,
|
|
275
|
+
dataplaneUrl,
|
|
276
|
+
dataplaneUiBaseUrl,
|
|
277
|
+
options
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
208
281
|
if (options.run === true) {
|
|
209
282
|
try {
|
|
210
283
|
return await runLifecycleViaDataplaneApi(
|
|
@@ -235,7 +308,10 @@ async function executeLifecycleWork(systemKey, options = {}) {
|
|
|
235
308
|
dataplaneUrl,
|
|
236
309
|
dataplaneUiBaseUrl,
|
|
237
310
|
authConfig,
|
|
238
|
-
{
|
|
311
|
+
{
|
|
312
|
+
source: options.run ? 'local-fallback' : 'api',
|
|
313
|
+
roleAssistant: options.roleAssistant === true
|
|
314
|
+
}
|
|
239
315
|
);
|
|
240
316
|
}
|
|
241
317
|
|
|
@@ -251,26 +327,22 @@ async function runLifecycleForExternalSystem(systemKey, options = {}) {
|
|
|
251
327
|
const appType = await pathsUtil.detectAppType(systemKey).catch(() => null);
|
|
252
328
|
assertCertifyExternalWorkspace(appType && appType.baseDir, 'lifecycle');
|
|
253
329
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
} catch {
|
|
261
|
-
resolvedKey = roleAssistantSystemKey(systemKey);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
330
|
+
const roleAssistant = isRoleAssistantWorkspace(appType && appType.baseDir);
|
|
331
|
+
const workOpts = {
|
|
332
|
+
...options,
|
|
333
|
+
roleAssistant,
|
|
334
|
+
skipConnectedSystemGovernance: roleAssistant
|
|
335
|
+
};
|
|
264
336
|
|
|
265
337
|
if (options.run === true) {
|
|
266
338
|
return runWithVerifyStepProgress(
|
|
267
339
|
'Processing',
|
|
268
|
-
async(progress) => executeLifecycleWork(
|
|
340
|
+
async(progress) => executeLifecycleWork(systemKey, { ...workOpts, lifecycleProgress: progress }),
|
|
269
341
|
{ json: options.json === true }
|
|
270
342
|
);
|
|
271
343
|
}
|
|
272
344
|
|
|
273
|
-
return executeLifecycleWork(
|
|
345
|
+
return executeLifecycleWork(systemKey, workOpts);
|
|
274
346
|
}
|
|
275
347
|
|
|
276
348
|
module.exports = {
|
|
@@ -117,7 +117,7 @@ function repairAuthChangeLabel(authOption) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
const MISSING_TEST_ENDPOINT_WARNING =
|
|
120
|
-
'authentication.variables.testEndpoint is missing for apikey/bearerToken auth — add a GET URL for credential/E2E tests (
|
|
120
|
+
'authentication.variables.testEndpoint is missing for apikey/bearerToken auth — add a GET URL for credential/E2E tests (use the OpenAPI minimum for required page-size query params, or a path resolved against baseUrl).';
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
123
|
* Warn when apikey auth (including bearerToken preset) has no testEndpoint.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skip repair key prefix when a datasource key is already unique scoped kebab-case.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Unique kebab datasource keys stay as-is during repair
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const SCOPED_KEBAB = /^[a-z0-9]+(-[a-z0-9]+)+$/;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} key
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
function isScopedKebabKey(key) {
|
|
16
|
+
return SCOPED_KEBAB.test(String(key || '').trim());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* True when key already contains a hyphen and appears once in the package.
|
|
21
|
+
* Single-token keys (persons) must still be prefixed with the system key.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} key
|
|
24
|
+
* @param {string[]} allKeys
|
|
25
|
+
* @returns {boolean}
|
|
26
|
+
*/
|
|
27
|
+
function shouldSkipSystemKeyPrefix(key, allKeys) {
|
|
28
|
+
const trimmed = String(key || '').trim();
|
|
29
|
+
if (!isScopedKebabKey(trimmed) || trimmed.endsWith('-datasource')) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const hits = (allKeys || []).filter((item) => String(item || '').trim() === trimmed);
|
|
33
|
+
return hits.length === 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = {
|
|
37
|
+
isScopedKebabKey,
|
|
38
|
+
shouldSkipSystemKeyPrefix
|
|
39
|
+
};
|
|
@@ -17,6 +17,7 @@ const fs = require('fs');
|
|
|
17
17
|
const { loadConfigFile, writeConfigFile } = require('../utils/config-format');
|
|
18
18
|
const { backupIntegrationFile } = require('../utils/integration-file-backup');
|
|
19
19
|
const { trackRepairWrite } = require('./repair-changed-files');
|
|
20
|
+
const { shouldSkipSystemKeyPrefix } = require('./repair-datasource-key-skip');
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Returns suffix from a canonical-format filename: <systemKey>-datasource-<suffix>.<ext>.
|
|
@@ -53,6 +54,9 @@ function isKeyAlreadyCanonical(key, systemKey, fileName) {
|
|
|
53
54
|
return true;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
57
|
+
if (shouldSkipSystemKeyPrefix(key, [key])) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
56
60
|
if (!key.startsWith(systemKey + '-')) return false;
|
|
57
61
|
const suffix = key.slice(systemKey.length + 1);
|
|
58
62
|
if (!suffix) return false;
|
|
@@ -126,6 +130,7 @@ function normalizeDatasourceKeysAndFilenames(appPath, datasourceFiles, systemKey
|
|
|
126
130
|
|
|
127
131
|
const slugCounts = new Map();
|
|
128
132
|
const fileInfos = [];
|
|
133
|
+
const packageKeys = [];
|
|
129
134
|
|
|
130
135
|
for (const fileName of datasourceFiles) {
|
|
131
136
|
const filePath = path.join(appPath, fileName);
|
|
@@ -138,23 +143,30 @@ function normalizeDatasourceKeysAndFilenames(appPath, datasourceFiles, systemKey
|
|
|
138
143
|
continue;
|
|
139
144
|
}
|
|
140
145
|
const key = (parsed && typeof parsed.key === 'string' && parsed.key.trim()) ? parsed.key.trim() : null;
|
|
141
|
-
if (
|
|
142
|
-
|
|
146
|
+
if (key) packageKeys.push(key);
|
|
147
|
+
fileInfos.push({ fileName, parsed, key, skip: false, slug: null, canonicalKey: null });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
for (const info of fileInfos) {
|
|
151
|
+
if (info.skip) continue;
|
|
152
|
+
const filenameCanonical = isFilenameAlreadyCanonical(info.fileName, systemKey);
|
|
153
|
+
const keyCanonical = isKeyAlreadyCanonical(info.key, systemKey, info.fileName);
|
|
154
|
+
const skipPrefix =
|
|
155
|
+
shouldSkipSystemKeyPrefix(info.key, packageKeys) &&
|
|
156
|
+
!String(info.key || '').endsWith('-datasource');
|
|
157
|
+
if ((keyCanonical || skipPrefix) && filenameCanonical) {
|
|
158
|
+
info.skip = true;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (skipPrefix) {
|
|
162
|
+
info.canonicalKey = info.key;
|
|
143
163
|
continue;
|
|
144
164
|
}
|
|
145
|
-
|
|
146
|
-
fileInfos.push({
|
|
147
|
-
fileName,
|
|
148
|
-
parsed,
|
|
149
|
-
key,
|
|
150
|
-
slug,
|
|
151
|
-
canonicalKey: null,
|
|
152
|
-
skip: false
|
|
153
|
-
});
|
|
165
|
+
info.slug = slugFromKey(info.key || info.fileName, systemKey);
|
|
154
166
|
}
|
|
155
167
|
|
|
156
168
|
for (const info of fileInfos) {
|
|
157
|
-
if (info.skip) continue;
|
|
169
|
+
if (info.skip || info.canonicalKey) continue;
|
|
158
170
|
const slug = info.slug;
|
|
159
171
|
const n = (slugCounts.get(slug) || 0) + 1;
|
|
160
172
|
slugCounts.set(slug, n);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Schema-aware testPayload repair (payloadTemplate / expectedResult).
|
|
2
|
+
* Schema-aware testPayload repair (payloadTemplate / expectedResult only).
|
|
3
3
|
*
|
|
4
|
-
* @fileoverview
|
|
4
|
+
* @fileoverview Mapping-shape testPayload generation; does not write scenario gold
|
|
5
5
|
* @author AI Fabrix Team
|
|
6
6
|
* @version 2.0.0
|
|
7
7
|
*/
|
|
@@ -288,6 +288,8 @@ function buildTemplatesFromPathEntries(parsed, pathEntries) {
|
|
|
288
288
|
|
|
289
289
|
/**
|
|
290
290
|
* Builds minimal payloadTemplate and expectedResult from attributes + metadataSchema.
|
|
291
|
+
* Does not generate or rewrite testPayload.scenarios (including nested expectedRows).
|
|
292
|
+
* Placeholder zeros on expectedResult are mapping-shape only — not capacity row gold.
|
|
291
293
|
*
|
|
292
294
|
* @param {Object} parsed - Parsed datasource (mutated)
|
|
293
295
|
* @param {string[]} changes - Change log
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
+
const { listCapabilityKeys } = require('../datasource/capability/capability-manifest');
|
|
10
|
+
|
|
9
11
|
const AUTH_USAGE_WEBHOOK_INBOUND = 'webhookInbound';
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -23,6 +25,23 @@ function systemHasWebhookInboundAuth(systemParsed) {
|
|
|
23
25
|
return false;
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
/**
|
|
29
|
+
* True when every webhook.events[] entry is a capability key (CIP invoke, not change-signal get).
|
|
30
|
+
* @param {object} parsed
|
|
31
|
+
* @returns {boolean}
|
|
32
|
+
*/
|
|
33
|
+
function webhookEventsAreCapabilityKeys(parsed) {
|
|
34
|
+
const events = parsed?.webhook?.events;
|
|
35
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const keys = new Set(listCapabilityKeys(parsed.capabilities));
|
|
39
|
+
if (keys.size === 0) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return events.every((event) => keys.has(String(event || '').trim()));
|
|
43
|
+
}
|
|
44
|
+
|
|
26
45
|
/**
|
|
27
46
|
* @param {object} parsed
|
|
28
47
|
* @param {string[]} changes
|
|
@@ -37,7 +56,8 @@ function repairWebhookSection(parsed, changes, warnings) {
|
|
|
37
56
|
let updated = false;
|
|
38
57
|
|
|
39
58
|
if (webhook.enabled === true) {
|
|
40
|
-
|
|
59
|
+
const needsIdPath = !webhookEventsAreCapabilityKeys(parsed);
|
|
60
|
+
if (needsIdPath && (!webhook.idPath || !String(webhook.idPath).trim())) {
|
|
41
61
|
warnings.push(
|
|
42
62
|
'webhook.enabled is true but idPath is missing — set idPath (for example $.objectId) before upload.'
|
|
43
63
|
);
|
|
@@ -168,5 +188,6 @@ module.exports = {
|
|
|
168
188
|
repairSyncBridgeSection,
|
|
169
189
|
defaultSyncBridgeForSyncRepair,
|
|
170
190
|
collectWebhookSyncBridgeSystemWarnings,
|
|
171
|
-
systemHasWebhookInboundAuth
|
|
191
|
+
systemHasWebhookInboundAuth,
|
|
192
|
+
webhookEventsAreCapabilityKeys
|
|
172
193
|
};
|
|
@@ -365,6 +365,9 @@ function repairSyncSection(parsed, changes) {
|
|
|
365
365
|
|
|
366
366
|
/**
|
|
367
367
|
* Removes unknown top-level keys from testPayload (v2.4.1 closed root).
|
|
368
|
+
* Nested keys under scenarios (including author-owned row gold) are not stripped.
|
|
369
|
+
* Do not add a nested scenario allowlist unless it is derived from the published
|
|
370
|
+
* external-datasource.schema.json testPayload.scenarios.items.properties.
|
|
368
371
|
* @param {Object} parsed - Parsed datasource (mutated)
|
|
369
372
|
* @param {string[]} changes - Change log
|
|
370
373
|
* @returns {boolean}
|