@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Slack manifest description limits
|
|
2
|
+
* Slack manifest description limits.
|
|
3
3
|
*
|
|
4
|
-
* @fileoverview Enforce Slack display_information
|
|
4
|
+
* @fileoverview Enforce Slack display_information short and long description lengths
|
|
5
5
|
* @author AI Fabrix Team
|
|
6
6
|
* @version 1.0.0
|
|
7
7
|
*/
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
/** Slack manifest `display_information.description` max (api.slack.com/reference/manifests). */
|
|
12
12
|
const SLACK_APP_DESCRIPTION_MAX_LENGTH = 140;
|
|
13
13
|
|
|
14
|
+
/** Slack App Settings reject `long_description` shorter than this. */
|
|
15
|
+
const SLACK_APP_LONG_DESCRIPTION_MIN_LENGTH = 175;
|
|
16
|
+
|
|
17
|
+
/** Slack manifest `display_information.long_description` max. */
|
|
18
|
+
const SLACK_APP_LONG_DESCRIPTION_MAX_LENGTH = 4000;
|
|
19
|
+
|
|
20
|
+
const DEFAULT_SLACK_APP_LONG_DESCRIPTION =
|
|
21
|
+
'This Slack app connects employees to governed Role Assistants. Chat in DM, ' +
|
|
22
|
+
'follow work that needs you, and open documents waiting for review. Access is ' +
|
|
23
|
+
'limited by enterprise identity, and actions stay auditable. If a Slack ' +
|
|
24
|
+
'profile email does not match a platform user, they can still link their account.';
|
|
25
|
+
|
|
14
26
|
/**
|
|
15
27
|
* @param {string} description
|
|
16
28
|
* @returns {string}
|
|
@@ -51,9 +63,55 @@ function resolveAppDescription(channelTarget, description) {
|
|
|
51
63
|
return text;
|
|
52
64
|
}
|
|
53
65
|
|
|
66
|
+
/**
|
|
67
|
+
* @param {string} description
|
|
68
|
+
* @returns {string}
|
|
69
|
+
*/
|
|
70
|
+
function normalizeSlackAppLongDescription(description) {
|
|
71
|
+
const text = String(description ?? '').trim();
|
|
72
|
+
if (text.length >= SLACK_APP_LONG_DESCRIPTION_MIN_LENGTH) {
|
|
73
|
+
return text.length > SLACK_APP_LONG_DESCRIPTION_MAX_LENGTH
|
|
74
|
+
? text.slice(0, SLACK_APP_LONG_DESCRIPTION_MAX_LENGTH)
|
|
75
|
+
: text;
|
|
76
|
+
}
|
|
77
|
+
if (!text) {
|
|
78
|
+
return DEFAULT_SLACK_APP_LONG_DESCRIPTION;
|
|
79
|
+
}
|
|
80
|
+
const combined = `${text} ${DEFAULT_SLACK_APP_LONG_DESCRIPTION}`;
|
|
81
|
+
if (combined.length > SLACK_APP_LONG_DESCRIPTION_MAX_LENGTH) {
|
|
82
|
+
return combined.slice(0, SLACK_APP_LONG_DESCRIPTION_MAX_LENGTH);
|
|
83
|
+
}
|
|
84
|
+
return combined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @param {string} channelTarget
|
|
89
|
+
* @param {Object} runtimeValues
|
|
90
|
+
* @returns {Object}
|
|
91
|
+
*/
|
|
92
|
+
function fillSlackManifestDescriptions(channelTarget, runtimeValues) {
|
|
93
|
+
if (channelTarget !== 'slack' || !runtimeValues || typeof runtimeValues !== 'object') {
|
|
94
|
+
return runtimeValues;
|
|
95
|
+
}
|
|
96
|
+
const appLongDescription = normalizeSlackAppLongDescription(
|
|
97
|
+
runtimeValues.appLongDescription || runtimeValues.appDescription
|
|
98
|
+
);
|
|
99
|
+
return {
|
|
100
|
+
...runtimeValues,
|
|
101
|
+
appLongDescription,
|
|
102
|
+
appLongDescriptionJson: JSON.stringify(appLongDescription),
|
|
103
|
+
enableMcpServer: runtimeValues.enableMcpServer === true
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
54
107
|
module.exports = {
|
|
55
108
|
SLACK_APP_DESCRIPTION_MAX_LENGTH,
|
|
109
|
+
SLACK_APP_LONG_DESCRIPTION_MIN_LENGTH,
|
|
110
|
+
SLACK_APP_LONG_DESCRIPTION_MAX_LENGTH,
|
|
111
|
+
DEFAULT_SLACK_APP_LONG_DESCRIPTION,
|
|
56
112
|
normalizeSlackAppDescription,
|
|
113
|
+
normalizeSlackAppLongDescription,
|
|
114
|
+
fillSlackManifestDescriptions,
|
|
57
115
|
assertSlackAppDescription,
|
|
58
116
|
resolveAppDescription
|
|
59
117
|
};
|
|
@@ -75,6 +75,18 @@ function extractGovernedToolNames(discovery) {
|
|
|
75
75
|
return tools.map((tool) => (tool && tool.name ? String(tool.name) : '')).filter(Boolean);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Live discovery uses `publication.remoteMcpReady`. Older fixtures used `mcpReady`.
|
|
80
|
+
* @param {Object|null|undefined} publication
|
|
81
|
+
* @returns {boolean}
|
|
82
|
+
*/
|
|
83
|
+
function isPublicationRemoteMcpReady(publication) {
|
|
84
|
+
if (!publication || typeof publication !== 'object') {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return publication.remoteMcpReady === true || publication.mcpReady === true;
|
|
88
|
+
}
|
|
89
|
+
|
|
78
90
|
/**
|
|
79
91
|
* @param {Object} discovery
|
|
80
92
|
* @param {Object|null} adapter
|
|
@@ -93,7 +105,7 @@ function resolveMcpConnection(discovery, adapter, dataplaneBaseUrl) {
|
|
|
93
105
|
'Gateway tools catalog must not be used as MCP server URL for channel packages'
|
|
94
106
|
);
|
|
95
107
|
}
|
|
96
|
-
const mcpReady = discovery
|
|
108
|
+
const mcpReady = isPublicationRemoteMcpReady(discovery && discovery.publication);
|
|
97
109
|
const connectable = adapter ? adapter.connectable === true : mcpReady;
|
|
98
110
|
const remoteAvailable = discovery?.transport?.remoteMcp?.status === 'available';
|
|
99
111
|
const installReady = Boolean(mcpReady && connectable && remoteAvailable && mcpServerUrl);
|
|
@@ -213,7 +225,8 @@ function mapDiscoveryToPackageContext(params) {
|
|
|
213
225
|
authentication: mapAdapterAuthentication(adapter?.authentication || null),
|
|
214
226
|
authenticationCapabilities: authCaps,
|
|
215
227
|
publication: {
|
|
216
|
-
mcpReady: discovery.publication
|
|
228
|
+
mcpReady: isPublicationRemoteMcpReady(discovery.publication),
|
|
229
|
+
remoteMcpReady: isPublicationRemoteMcpReady(discovery.publication),
|
|
217
230
|
environment: discovery.publication?.environment || null
|
|
218
231
|
},
|
|
219
232
|
brandingApplied: isBrandingApplied(branding)
|
|
@@ -321,6 +334,7 @@ async function loadChannelPackageContext(params) {
|
|
|
321
334
|
module.exports = {
|
|
322
335
|
GATEWAY_TOOLS_CATALOG_MARKER,
|
|
323
336
|
isGatewayToolsCatalogUrl,
|
|
337
|
+
isPublicationRemoteMcpReady,
|
|
324
338
|
resolveDiscoveryUrl,
|
|
325
339
|
mapDiscoveryToPackageContext,
|
|
326
340
|
fetchExternalAiDiscovery,
|
|
@@ -8,13 +8,39 @@
|
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
getExternalSystem,
|
|
13
|
+
getExternalSystemConfig,
|
|
14
|
+
updateExternalSystem
|
|
15
|
+
} = require('../api/external-systems.api');
|
|
12
16
|
const { unwrapApiData } = require('../utils/external-system-readiness-core');
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* @param {Object|null} system
|
|
16
20
|
* @returns {Object|null}
|
|
17
21
|
*/
|
|
22
|
+
/**
|
|
23
|
+
* Connected System key for fetch/patch (instance, not definition).
|
|
24
|
+
* @param {Object} ctx
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
function communicationSystemKey(ctx) {
|
|
28
|
+
const instanceKey = ctx && typeof ctx.instanceSystemKey === 'string'
|
|
29
|
+
? ctx.instanceSystemKey.trim()
|
|
30
|
+
: '';
|
|
31
|
+
if (!instanceKey) {
|
|
32
|
+
throw new Error(
|
|
33
|
+
'Connected System instance key is required. Derive it from the display name; it cannot equal the catalog key.'
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
if (ctx.channelTarget && instanceKey === ctx.channelTarget) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`Connected System key cannot equal the catalog key. Use ${ctx.channelTarget}-<name-slug>.`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return instanceKey;
|
|
42
|
+
}
|
|
43
|
+
|
|
18
44
|
function getExistingChannelExtension(system) {
|
|
19
45
|
if (!system || typeof system !== 'object') return null;
|
|
20
46
|
const channel = system.config?.extensions?.channel;
|
|
@@ -32,7 +58,7 @@ function getExistingChannelExtension(system) {
|
|
|
32
58
|
* @returns {Object}
|
|
33
59
|
*/
|
|
34
60
|
function buildChannelExtensionBlock(params, target) {
|
|
35
|
-
|
|
61
|
+
const block = {
|
|
36
62
|
type: target.channelType,
|
|
37
63
|
name: params.name,
|
|
38
64
|
baseName: params.baseName,
|
|
@@ -40,8 +66,20 @@ function buildChannelExtensionBlock(params, target) {
|
|
|
40
66
|
capabilities: [...target.capabilities],
|
|
41
67
|
status: params.status,
|
|
42
68
|
artifactHash: params.artifactHash,
|
|
43
|
-
credentialKey: target.credentialKey
|
|
69
|
+
credentialKey: target.credentialKey,
|
|
70
|
+
definitionKey: target.definitionKey || target.key
|
|
44
71
|
};
|
|
72
|
+
const prefix =
|
|
73
|
+
typeof params.commandPrefix === 'string' ? params.commandPrefix.trim().toLowerCase() : '';
|
|
74
|
+
if (prefix) {
|
|
75
|
+
block.commandPrefix = prefix;
|
|
76
|
+
}
|
|
77
|
+
const packageVersion =
|
|
78
|
+
typeof params.packageVersion === 'string' ? params.packageVersion.trim() : '';
|
|
79
|
+
if (packageVersion) {
|
|
80
|
+
block.packageVersion = packageVersion;
|
|
81
|
+
}
|
|
82
|
+
return block;
|
|
45
83
|
}
|
|
46
84
|
|
|
47
85
|
/**
|
|
@@ -55,7 +93,13 @@ function mergeChannelIntoSystem(system, channelBlock) {
|
|
|
55
93
|
config.extensions && typeof config.extensions === 'object' ? { ...config.extensions } : {};
|
|
56
94
|
extensions.channel = channelBlock;
|
|
57
95
|
config.extensions = extensions;
|
|
58
|
-
|
|
96
|
+
const definitionKey =
|
|
97
|
+
channelBlock.definitionKey || (system.channel && system.channel.definitionKey);
|
|
98
|
+
const channel = {
|
|
99
|
+
...(system.channel && typeof system.channel === 'object' ? system.channel : {}),
|
|
100
|
+
definitionKey
|
|
101
|
+
};
|
|
102
|
+
return { ...system, config, displayName: channelBlock.name, channel };
|
|
59
103
|
}
|
|
60
104
|
|
|
61
105
|
/**
|
|
@@ -67,11 +111,14 @@ function mergeChannelIntoSystem(system, channelBlock) {
|
|
|
67
111
|
* @returns {Promise<Object>}
|
|
68
112
|
*/
|
|
69
113
|
async function fetchCommunicationSystem(ctx) {
|
|
70
|
-
const res = await getExternalSystem(ctx.dataplaneUrl, ctx
|
|
114
|
+
const res = await getExternalSystem(ctx.dataplaneUrl, communicationSystemKey(ctx), ctx.authConfig);
|
|
71
115
|
const system = unwrapApiData(res);
|
|
72
116
|
if (!system || typeof system !== 'object') {
|
|
117
|
+
if (ctx.allowMissing === true) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
73
120
|
throw new Error(
|
|
74
|
-
`Communication external system "${ctx
|
|
121
|
+
`Communication external system "${communicationSystemKey(ctx)}" was not found. ` +
|
|
75
122
|
`Run: aifabrix channel add ${ctx.channelTarget} --name "…" --force`
|
|
76
123
|
);
|
|
77
124
|
}
|
|
@@ -84,6 +131,29 @@ async function fetchCommunicationSystem(ctx) {
|
|
|
84
131
|
return system;
|
|
85
132
|
}
|
|
86
133
|
|
|
134
|
+
/**
|
|
135
|
+
* GET /systems/{key} serializes a slim ExternalSystemConfig and drops
|
|
136
|
+
* authentications[]. Use the running manifest so inbound HMAC survives PUT.
|
|
137
|
+
*
|
|
138
|
+
* @param {Object} ctx
|
|
139
|
+
* @param {Object} system
|
|
140
|
+
* @returns {Promise<Object>}
|
|
141
|
+
*/
|
|
142
|
+
async function loadSystemConfigForChannelPatch(ctx, system) {
|
|
143
|
+
const getConfig = ctx.getExternalSystemConfig || getExternalSystemConfig;
|
|
144
|
+
try {
|
|
145
|
+
const res = await getConfig(ctx.dataplaneUrl, communicationSystemKey(ctx), ctx.authConfig);
|
|
146
|
+
const body = unwrapApiData(res) || res;
|
|
147
|
+
const application = body && body.application;
|
|
148
|
+
if (application && typeof application === 'object') {
|
|
149
|
+
return application;
|
|
150
|
+
}
|
|
151
|
+
} catch {
|
|
152
|
+
/* keep GET-by-id config */
|
|
153
|
+
}
|
|
154
|
+
return system.config && typeof system.config === 'object' ? system.config : {};
|
|
155
|
+
}
|
|
156
|
+
|
|
87
157
|
/**
|
|
88
158
|
* @async
|
|
89
159
|
* @param {Object} ctx
|
|
@@ -92,8 +162,14 @@ async function fetchCommunicationSystem(ctx) {
|
|
|
92
162
|
*/
|
|
93
163
|
async function patchChannelExtension(ctx, channelBlock) {
|
|
94
164
|
const system = await fetchCommunicationSystem(ctx);
|
|
95
|
-
const
|
|
96
|
-
const
|
|
165
|
+
const config = await loadSystemConfigForChannelPatch(ctx, system);
|
|
166
|
+
const merged = mergeChannelIntoSystem({ ...system, config }, channelBlock);
|
|
167
|
+
const res = await updateExternalSystem(
|
|
168
|
+
ctx.dataplaneUrl,
|
|
169
|
+
communicationSystemKey(ctx),
|
|
170
|
+
ctx.authConfig,
|
|
171
|
+
{ displayName: merged.displayName, config: merged.config, channel: merged.channel }
|
|
172
|
+
);
|
|
97
173
|
return unwrapApiData(res) || merged;
|
|
98
174
|
}
|
|
99
175
|
|
|
@@ -102,5 +178,6 @@ module.exports = {
|
|
|
102
178
|
buildChannelExtensionBlock,
|
|
103
179
|
mergeChannelIntoSystem,
|
|
104
180
|
fetchCommunicationSystem,
|
|
105
|
-
patchChannelExtension
|
|
181
|
+
patchChannelExtension,
|
|
182
|
+
communicationSystemKey
|
|
106
183
|
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared ChannelInstallEnvelope user-action builders.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Keep envelope.js under the file-size limit
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {Object} params
|
|
11
|
+
* @param {string} params.id
|
|
12
|
+
* @param {string} params.kind
|
|
13
|
+
* @param {string} params.label
|
|
14
|
+
* @param {boolean} [params.required]
|
|
15
|
+
* @param {string} [params.resume]
|
|
16
|
+
* @param {Object} [params.extra]
|
|
17
|
+
* @returns {Object}
|
|
18
|
+
*/
|
|
19
|
+
function userAction(params) {
|
|
20
|
+
return {
|
|
21
|
+
id: params.id,
|
|
22
|
+
kind: params.kind,
|
|
23
|
+
label: params.label,
|
|
24
|
+
required: params.required !== false,
|
|
25
|
+
resume: params.resume || 'poll',
|
|
26
|
+
...(params.extra || {})
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {string} href
|
|
32
|
+
* @param {string} label
|
|
33
|
+
* @param {string} id
|
|
34
|
+
* @param {boolean} [required]
|
|
35
|
+
* @returns {Object|null}
|
|
36
|
+
*/
|
|
37
|
+
function openUrlAction(href, label, id, required) {
|
|
38
|
+
if (typeof href !== 'string' || !href.trim()) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return userAction({
|
|
42
|
+
id,
|
|
43
|
+
kind: 'openUrl',
|
|
44
|
+
label,
|
|
45
|
+
required,
|
|
46
|
+
extra: { href: href.trim() }
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} label
|
|
52
|
+
* @param {string} value
|
|
53
|
+
* @param {string} id
|
|
54
|
+
* @returns {Object|null}
|
|
55
|
+
*/
|
|
56
|
+
function copyValueAction(label, value, id) {
|
|
57
|
+
if (typeof value !== 'string' || !value.trim()) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return userAction({
|
|
61
|
+
id,
|
|
62
|
+
kind: 'copyValue',
|
|
63
|
+
label,
|
|
64
|
+
extra: { value: value.trim() }
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @param {string} text
|
|
70
|
+
* @param {string} id
|
|
71
|
+
* @returns {Object}
|
|
72
|
+
*/
|
|
73
|
+
function remainingStepAction(text, id) {
|
|
74
|
+
return userAction({
|
|
75
|
+
id,
|
|
76
|
+
kind: 'remainingVendorStep',
|
|
77
|
+
label: text,
|
|
78
|
+
required: false,
|
|
79
|
+
extra: { text }
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
module.exports = {
|
|
84
|
+
userAction,
|
|
85
|
+
openUrlAction,
|
|
86
|
+
copyValueAction,
|
|
87
|
+
remainingStepAction
|
|
88
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Microsoft Copilot and Teams Bot envelope actions.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Sign-in / continue handoff for portal install
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const { userAction, copyValueAction } = require('./channel-install-envelope-actions');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {Object|null} runtimeValues
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
function copilotVaultMissing(runtimeValues) {
|
|
16
|
+
return !(
|
|
17
|
+
runtimeValues &&
|
|
18
|
+
typeof runtimeValues.oauthPluginVaultReferenceId === 'string' &&
|
|
19
|
+
runtimeValues.oauthPluginVaultReferenceId.trim()
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {Object} params
|
|
25
|
+
* @returns {boolean}
|
|
26
|
+
*/
|
|
27
|
+
function copilotWaitingNoLoginUrl(params) {
|
|
28
|
+
const values = params.runtimeValues || {};
|
|
29
|
+
return (
|
|
30
|
+
params.channelTarget === 'microsoft-copilot' &&
|
|
31
|
+
copilotVaultMissing(values) &&
|
|
32
|
+
values.microsoftAuthConfigFallback !== true &&
|
|
33
|
+
!(typeof values.microsoftLoginUrl === 'string' && values.microsoftLoginUrl.trim())
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {Object} params
|
|
39
|
+
* @returns {boolean}
|
|
40
|
+
*/
|
|
41
|
+
function teamsBotWaiting(params) {
|
|
42
|
+
return params.channelTarget === 'teams-bot' && Boolean(params.ctx && params.ctx.teamsBotSkipped);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {Object} params
|
|
47
|
+
* @returns {boolean}
|
|
48
|
+
*/
|
|
49
|
+
function microsoftLoginWaiting(params) {
|
|
50
|
+
if (teamsBotWaiting(params)) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
const waitingNoUrl = copilotWaitingNoLoginUrl(params);
|
|
54
|
+
return (
|
|
55
|
+
params.channelTarget === 'microsoft-copilot' &&
|
|
56
|
+
copilotVaultMissing(params.runtimeValues) &&
|
|
57
|
+
(params.runtimeValues || {}).microsoftAuthConfigFallback !== true &&
|
|
58
|
+
waitingNoUrl !== true
|
|
59
|
+
) || waitingNoUrl;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param {Object} params
|
|
64
|
+
* @returns {Object|null}
|
|
65
|
+
*/
|
|
66
|
+
function continueAfterMicrosoftLoginAction(params) {
|
|
67
|
+
const values = params.runtimeValues || {};
|
|
68
|
+
const teams = teamsBotWaiting(params);
|
|
69
|
+
if (params.channelTarget === 'microsoft-copilot') {
|
|
70
|
+
if (!copilotVaultMissing(values) || values.microsoftAuthConfigFallback === true) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
} else if (!teams) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const loginUrl =
|
|
77
|
+
typeof values.microsoftLoginUrl === 'string' ? values.microsoftLoginUrl.trim() : '';
|
|
78
|
+
return userAction({
|
|
79
|
+
id: 'continue-after-microsoft-login',
|
|
80
|
+
kind: 'submitInput',
|
|
81
|
+
label: loginUrl ? 'Continue after sign-in' : 'Continue'
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @param {Object} params
|
|
87
|
+
* @returns {Object[]}
|
|
88
|
+
*/
|
|
89
|
+
function microsoftLoginCodeActions(params) {
|
|
90
|
+
const actions = [];
|
|
91
|
+
const code =
|
|
92
|
+
params.runtimeValues && typeof params.runtimeValues.microsoftLoginUserCode === 'string'
|
|
93
|
+
? params.runtimeValues.microsoftLoginUserCode.trim()
|
|
94
|
+
: '';
|
|
95
|
+
const copy = copyValueAction('Enter this code', code, 'copy-microsoft-login-code');
|
|
96
|
+
if (copy) {
|
|
97
|
+
actions.push(copy);
|
|
98
|
+
}
|
|
99
|
+
const resume = continueAfterMicrosoftLoginAction(params);
|
|
100
|
+
if (resume) {
|
|
101
|
+
actions.push(resume);
|
|
102
|
+
}
|
|
103
|
+
return actions;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @param {Object} params
|
|
108
|
+
* @returns {Object[]}
|
|
109
|
+
*/
|
|
110
|
+
function copilotExtraActions(params) {
|
|
111
|
+
if (params.channelTarget !== 'microsoft-copilot') {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
if (!copilotVaultMissing(params.runtimeValues)) {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
if (params.runtimeValues && params.runtimeValues.microsoftAuthConfigFallback === true) {
|
|
118
|
+
return [
|
|
119
|
+
userAction({
|
|
120
|
+
id: 'submit-entra-sso-registration',
|
|
121
|
+
kind: 'submitInput',
|
|
122
|
+
label: 'Paste the Microsoft auth-config ID (fallback)',
|
|
123
|
+
extra: { field: 'oauthPluginVaultReferenceId' }
|
|
124
|
+
})
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
return microsoftLoginCodeActions(params);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @param {Object} params
|
|
132
|
+
* @returns {Object[]}
|
|
133
|
+
*/
|
|
134
|
+
function teamsBotExtraActions(params) {
|
|
135
|
+
if (!teamsBotWaiting(params)) {
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
return microsoftLoginCodeActions(params);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @param {Object} params
|
|
143
|
+
* @returns {Object[]}
|
|
144
|
+
*/
|
|
145
|
+
function microsoftExtraActions(params) {
|
|
146
|
+
return [...copilotExtraActions(params), ...teamsBotExtraActions(params)];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
module.exports = {
|
|
150
|
+
copilotVaultMissing,
|
|
151
|
+
copilotWaitingNoLoginUrl,
|
|
152
|
+
teamsBotWaiting,
|
|
153
|
+
microsoftLoginWaiting,
|
|
154
|
+
microsoftExtraActions
|
|
155
|
+
};
|