@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
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
const chalk = require('chalk');
|
|
11
|
+
const { formatCredentialShowLine } = require('./authentication-slot-show');
|
|
11
12
|
|
|
12
13
|
/** @type {{ verified: string, pending: string, failed: string, expired: string }} */
|
|
13
14
|
const STATUS_ICONS = {
|
|
@@ -74,10 +75,51 @@ function formatCredentialWithStatus(credential) {
|
|
|
74
75
|
return { key, name, statusFormatted, statusLabel };
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* @param {unknown[]} values
|
|
80
|
+
* @returns {string|null}
|
|
81
|
+
*/
|
|
82
|
+
function firstNonEmptyScalar(values) {
|
|
83
|
+
for (const value of values) {
|
|
84
|
+
if (typeof value === 'number') return String(value);
|
|
85
|
+
if (typeof value === 'string' && value.trim()) return value.trim();
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Identity from a dataplane credential id or ForeignKeyReference. Never `[object Object]`.
|
|
92
|
+
* @param {unknown} value
|
|
93
|
+
* @returns {string|null}
|
|
94
|
+
*/
|
|
95
|
+
function formatCredentialIdentity(value) {
|
|
96
|
+
if (value === null || value === undefined || value === '') return null;
|
|
97
|
+
if (typeof value !== 'object') return String(value);
|
|
98
|
+
return firstNonEmptyScalar([
|
|
99
|
+
value.name,
|
|
100
|
+
value.displayName,
|
|
101
|
+
value.key,
|
|
102
|
+
value.id,
|
|
103
|
+
value.credentialKey,
|
|
104
|
+
value.credentialId
|
|
105
|
+
]);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Scalar credential id/key for show output. Objects must not print as [object Object].
|
|
110
|
+
* @param {unknown} value
|
|
111
|
+
* @returns {string}
|
|
112
|
+
*/
|
|
113
|
+
function formatCredentialIdValue(value) {
|
|
114
|
+
return formatCredentialIdentity(value) || '—';
|
|
115
|
+
}
|
|
116
|
+
|
|
77
117
|
module.exports = {
|
|
78
118
|
STATUS_ICONS,
|
|
79
119
|
STATUS_LABELS,
|
|
80
120
|
STATUS_CHALK,
|
|
81
121
|
formatCredentialStatus,
|
|
82
|
-
formatCredentialWithStatus
|
|
122
|
+
formatCredentialWithStatus,
|
|
123
|
+
formatCredentialIdValue,
|
|
124
|
+
formatCredentialShowLine
|
|
83
125
|
};
|
|
@@ -262,8 +262,13 @@ async function pushCredentialSecrets(dataplaneUrl, authConfig, options = {}) {
|
|
|
262
262
|
buildItemsFromPayload(payload, secrets, itemsByKey);
|
|
263
263
|
reconcileBearerTokenSecretPaths(itemsByKey, appName, authConfig);
|
|
264
264
|
|
|
265
|
+
const excluded = new Set(
|
|
266
|
+
Array.isArray(options.excludeKeys)
|
|
267
|
+
? options.excludeKeys.map((key) => String(key).trim()).filter(Boolean)
|
|
268
|
+
: []
|
|
269
|
+
);
|
|
265
270
|
const items = Array.from(itemsByKey.entries())
|
|
266
|
-
.filter(([k]) => isValidKvPath(k))
|
|
271
|
+
.filter(([k]) => isValidKvPath(k) && !excluded.has(k))
|
|
267
272
|
.map(([key, value]) => ({ key, value }));
|
|
268
273
|
|
|
269
274
|
if (items.length === 0) return { pushed: 0, skipped: true };
|
package/lib/utils/env-copy.js
CHANGED
|
@@ -20,7 +20,7 @@ const devConfig = require('../utils/dev-config');
|
|
|
20
20
|
const { rewriteInfraEndpoints } = require('./env-endpoints');
|
|
21
21
|
const { buildEnvVarMap } = require('./env-map');
|
|
22
22
|
const { interpolateEnvVars } = require('./secrets-helpers');
|
|
23
|
-
const { getLocalPort } = require('./port-resolver');
|
|
23
|
+
const { getLocalPort, isExternalAppDoc } = require('./port-resolver');
|
|
24
24
|
const { applyHostLocalKeycloakInternalUrl } = require('./env-copy-keycloak');
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -263,6 +263,21 @@ function extractEnvVarsFromContent(envContent, envVars) {
|
|
|
263
263
|
return envVars;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Patch Connected System env for local resolve (infra hosts only; no listen PORT).
|
|
268
|
+
* @async
|
|
269
|
+
* @param {string} envContent - Original env content
|
|
270
|
+
* @returns {Promise<string>} Patched env content
|
|
271
|
+
*/
|
|
272
|
+
async function patchExternalEnvContentForLocal(envContent) {
|
|
273
|
+
const devIdNum = readDeveloperIdFromConfig(config) || 0;
|
|
274
|
+
const infraPorts = devConfig.getDevPorts(devIdNum);
|
|
275
|
+
const updated = await rewriteInfraEndpoints(envContent, 'local', infraPorts);
|
|
276
|
+
const envVars = await buildEnvVarMap('local', null, devIdNum);
|
|
277
|
+
const updatedEnvVars = extractEnvVarsFromContent(updated, envVars);
|
|
278
|
+
return interpolateEnvVars(updated, updatedEnvVars);
|
|
279
|
+
}
|
|
280
|
+
|
|
266
281
|
/**
|
|
267
282
|
* Patch env content for local development
|
|
268
283
|
* @async
|
|
@@ -271,21 +286,18 @@ function extractEnvVarsFromContent(envContent, envVars) {
|
|
|
271
286
|
* @returns {Promise<string>} Patched env content
|
|
272
287
|
*/
|
|
273
288
|
async function patchEnvContentForLocal(envContent, variables) {
|
|
289
|
+
if (isExternalAppDoc(variables)) {
|
|
290
|
+
return patchExternalEnvContentForLocal(envContent);
|
|
291
|
+
}
|
|
274
292
|
const baseAppPort = getLocalPort(variables, 3000);
|
|
275
293
|
const appPort = calculateDevAppPort(baseAppPort);
|
|
276
294
|
const devIdNum = readDeveloperIdFromConfig(config) || 0;
|
|
277
295
|
const infraPorts = devConfig.getDevPorts(devIdNum);
|
|
278
296
|
|
|
279
|
-
// Update PORT
|
|
280
297
|
envContent = updatePortInEnv(envContent, appPort);
|
|
281
|
-
|
|
282
|
-
// Update localhost URLs
|
|
283
298
|
envContent = updateLocalhostUrls(envContent, baseAppPort, appPort);
|
|
284
|
-
|
|
285
|
-
// Rewrite infra endpoints
|
|
286
299
|
envContent = await rewriteInfraEndpoints(envContent, 'local', infraPorts);
|
|
287
300
|
|
|
288
|
-
// Interpolate ${VAR} references
|
|
289
301
|
const envVars = await buildEnvVarMap('local', null, devIdNum);
|
|
290
302
|
const updatedEnvVars = extractEnvVarsFromContent(envContent, envVars);
|
|
291
303
|
envContent = interpolateEnvVars(envContent, updatedEnvVars);
|
|
@@ -52,9 +52,17 @@ const FALLBACK_SECURITY_BY_AUTH = {
|
|
|
52
52
|
hmac: ['signingSecret'],
|
|
53
53
|
bearer: ['bearerToken'],
|
|
54
54
|
token: ['bearerToken'],
|
|
55
|
-
none: []
|
|
55
|
+
none: [],
|
|
56
|
+
system: []
|
|
56
57
|
};
|
|
57
58
|
|
|
59
|
+
const NO_SECRET_AUTH_TYPES = new Set(['none', 'apiProvider', 'system']);
|
|
60
|
+
|
|
61
|
+
function isNoSecretAuthType(authBlock) {
|
|
62
|
+
const authType = authBlock && typeof authBlock.authType === 'string' ? authBlock.authType.trim() : '';
|
|
63
|
+
return NO_SECRET_AUTH_TYPES.has(authType);
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
/**
|
|
59
67
|
* @param {Array<{name: string, value: string}>} authSecureVars
|
|
60
68
|
* @param {Record<string, unknown>} security
|
|
@@ -96,7 +104,7 @@ function buildAuthSecureVarsFromSystem(system) {
|
|
|
96
104
|
const prefix = systemKeyToKvPrefix(systemKey);
|
|
97
105
|
if (!prefix) return authSecureVars;
|
|
98
106
|
const authBlock = system?.authentication || system?.auth;
|
|
99
|
-
if (authBlock
|
|
107
|
+
if (isNoSecretAuthType(authBlock)) {
|
|
100
108
|
return authSecureVars;
|
|
101
109
|
}
|
|
102
110
|
const credential = getAuthCredentialTemplate(authBlock);
|
|
@@ -147,6 +155,8 @@ function buildExternalEnvTemplateContext(system) {
|
|
|
147
155
|
authMethod = 'apiprovider';
|
|
148
156
|
} else if (authBlock?.authType === 'none') {
|
|
149
157
|
authMethod = 'none';
|
|
158
|
+
} else if (authBlock?.authType === 'system') {
|
|
159
|
+
authMethod = 'system';
|
|
150
160
|
} else {
|
|
151
161
|
authMethod = (
|
|
152
162
|
credential?.method ||
|
|
@@ -155,6 +165,14 @@ function buildExternalEnvTemplateContext(system) {
|
|
|
155
165
|
'apikey'
|
|
156
166
|
).toLowerCase();
|
|
157
167
|
}
|
|
168
|
+
if (isNoSecretAuthType(authBlock)) {
|
|
169
|
+
return {
|
|
170
|
+
authMethod,
|
|
171
|
+
authSecureVars: [],
|
|
172
|
+
authNonSecureVarNames: [],
|
|
173
|
+
configuration: buildConfigurationEntries(system)
|
|
174
|
+
};
|
|
175
|
+
}
|
|
158
176
|
const slotSecureVars = buildAuthSecureVarsFromAllSlots(system);
|
|
159
177
|
const authSecureVars =
|
|
160
178
|
slotSecureVars.length > 0 ? slotSecureVars : buildAuthSecureVarsFromSystem(system);
|
|
@@ -75,7 +75,11 @@ function logUploadReadinessSummaryCompact(ctx) {
|
|
|
75
75
|
const genMcp = publication?.generateMcpContract !== false;
|
|
76
76
|
const tierA = summarizeDatasourceTiersA(publication?.datasources || [], genMcp);
|
|
77
77
|
const systemCfg = manifest?.system || {};
|
|
78
|
-
const statusLabel = resolveConnectedSystemStatus({
|
|
78
|
+
const statusLabel = resolveConnectedSystemStatus({
|
|
79
|
+
command: 'upload',
|
|
80
|
+
publication,
|
|
81
|
+
systemFromDataplane: ctx.systemFromDataplane
|
|
82
|
+
});
|
|
79
83
|
|
|
80
84
|
logCompactHeader({ command: 'upload', systemKey, environment, dataplaneUrl });
|
|
81
85
|
if (forcePublish) {
|
|
@@ -29,12 +29,33 @@ const PILLAR_LABELS = Object.freeze({
|
|
|
29
29
|
governance: 'Governance'
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
/** Connected System lifecycle labels — same Draft / Published / Archived as the web. */
|
|
33
|
+
const CONNECTED_SYSTEM_LIFECYCLE_LABELS = Object.freeze({
|
|
34
|
+
draft: 'Draft',
|
|
35
|
+
published: 'Published',
|
|
36
|
+
archived: 'Archived',
|
|
37
|
+
deployed: 'Published'
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Product lifecycle label, or null when the value is not Draft/Published/Archived
|
|
42
|
+
* (controller `active` is not Published).
|
|
43
|
+
* @param {string|null|undefined} status
|
|
44
|
+
* @returns {string|null}
|
|
45
|
+
*/
|
|
46
|
+
function formatConnectedSystemLifecycleLabel(status) {
|
|
47
|
+
const raw = String(status || '').trim().toLowerCase();
|
|
48
|
+
return CONNECTED_SYSTEM_LIFECYCLE_LABELS[raw] || null;
|
|
49
|
+
}
|
|
50
|
+
|
|
32
51
|
/**
|
|
33
52
|
* @param {string|null|undefined} status
|
|
34
53
|
* @returns {string}
|
|
35
54
|
*/
|
|
36
55
|
function formatLifecycleLabel(status) {
|
|
37
56
|
const raw = String(status || 'unknown').trim().toLowerCase();
|
|
57
|
+
const lifecycle = formatConnectedSystemLifecycleLabel(raw);
|
|
58
|
+
if (lifecycle) return lifecycle;
|
|
38
59
|
if (!raw || raw === 'unknown') return 'Unknown';
|
|
39
60
|
return raw.charAt(0).toUpperCase() + raw.slice(1);
|
|
40
61
|
}
|
|
@@ -159,8 +180,14 @@ function resolveManifestAuthMethod(systemCfg) {
|
|
|
159
180
|
* @returns {string}
|
|
160
181
|
*/
|
|
161
182
|
function resolveConnectedSystemStatus(opts = {}) {
|
|
162
|
-
const fromPub = opts.publication?.system?.status;
|
|
163
183
|
const fromGet = opts.systemFromDataplane?.status;
|
|
184
|
+
if (fromGet) {
|
|
185
|
+
return formatLifecycleLabel(fromGet);
|
|
186
|
+
}
|
|
187
|
+
if (opts.command === 'upload') {
|
|
188
|
+
return formatLifecycleLabel('draft');
|
|
189
|
+
}
|
|
190
|
+
const fromPub = opts.publication?.system?.status;
|
|
164
191
|
return formatLifecycleLabel(fromGet || fromPub || opts.status);
|
|
165
192
|
}
|
|
166
193
|
|
|
@@ -307,6 +334,8 @@ function logCompactTip(opts) {
|
|
|
307
334
|
|
|
308
335
|
module.exports = {
|
|
309
336
|
PILLAR_LABELS,
|
|
337
|
+
CONNECTED_SYSTEM_LIFECYCLE_LABELS,
|
|
338
|
+
formatConnectedSystemLifecycleLabel,
|
|
310
339
|
formatLifecycleLabel,
|
|
311
340
|
truncateKeyList,
|
|
312
341
|
formatCredentialPushLine,
|
|
@@ -80,6 +80,7 @@ const CATEGORIES = [
|
|
|
80
80
|
{ name: 'resource-type' },
|
|
81
81
|
{ name: 'role' },
|
|
82
82
|
{ name: 'role-assistant' },
|
|
83
|
+
{ name: 'search' },
|
|
83
84
|
{ name: 'evidence-kind' },
|
|
84
85
|
{ name: 'enterprise-knowledge' },
|
|
85
86
|
{ name: 'identity' },
|
|
@@ -133,7 +134,8 @@ const CATEGORIES = [
|
|
|
133
134
|
{ name: 'dev' },
|
|
134
135
|
{ name: 'secret' },
|
|
135
136
|
{ name: 'npm', term: 'npm config' },
|
|
136
|
-
{ name: 'secure' }
|
|
137
|
+
{ name: 'secure' },
|
|
138
|
+
{ name: 'agent-kit' }
|
|
137
139
|
]
|
|
138
140
|
}
|
|
139
141
|
];
|
package/lib/utils/paths.js
CHANGED
|
@@ -842,12 +842,25 @@ function resolveExistingWorkspacePath(appName, options) {
|
|
|
842
842
|
return null;
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
+
function platformShellWorkspaceWithoutConfig(appPath, baseDir) {
|
|
846
|
+
if (!isExistingAppDirectory(appPath)) {
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
if (baseDir === 'role-assistant' || baseDir === 'enterprise-knowledge') {
|
|
850
|
+
return externalIntegrationFolderResult(appPath, baseDir);
|
|
851
|
+
}
|
|
852
|
+
return null;
|
|
853
|
+
}
|
|
854
|
+
|
|
845
855
|
function externalWorkspaceFolderFromConfig(appPath, baseDir, scopedWorkspace) {
|
|
846
856
|
try {
|
|
847
857
|
const configPath = resolveApplicationConfigPath(appPath);
|
|
848
858
|
const variables = loadConfigFile(configPath);
|
|
849
859
|
if (!variables) {
|
|
850
|
-
return
|
|
860
|
+
return platformShellWorkspaceWithoutConfig(appPath, baseDir);
|
|
861
|
+
}
|
|
862
|
+
if (baseDir === 'role-assistant' || baseDir === 'enterprise-knowledge') {
|
|
863
|
+
return externalIntegrationFolderResult(appPath, baseDir);
|
|
851
864
|
}
|
|
852
865
|
const isExternal = isExternalAppType(variables);
|
|
853
866
|
return {
|
|
@@ -857,6 +870,10 @@ function externalWorkspaceFolderFromConfig(appPath, baseDir, scopedWorkspace) {
|
|
|
857
870
|
baseDir
|
|
858
871
|
};
|
|
859
872
|
} catch {
|
|
873
|
+
const platformShell = platformShellWorkspaceWithoutConfig(appPath, baseDir);
|
|
874
|
+
if (platformShell) {
|
|
875
|
+
return platformShell;
|
|
876
|
+
}
|
|
860
877
|
if (scopedWorkspace && isExistingAppDirectory(appPath)) {
|
|
861
878
|
return externalIntegrationFolderResult(appPath, baseDir);
|
|
862
879
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* digitalWorker / enterpriseKnowledge packages are platform shells, not Connected Systems.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Kind and workspace helpers for Role Assistant and Enterprise Knowledge
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { SYSTEM_KIND_DIGITAL_WORKER, WORKSPACE_ROLE_ASSISTANT } = require('./role-assistant-paths');
|
|
12
|
+
const {
|
|
13
|
+
SYSTEM_KIND_ENTERPRISE_KNOWLEDGE,
|
|
14
|
+
WORKSPACE_ENTERPRISE_KNOWLEDGE
|
|
15
|
+
} = require('./enterprise-knowledge-paths');
|
|
16
|
+
|
|
17
|
+
function readSystemKind(application) {
|
|
18
|
+
if (!application || typeof application !== 'object') {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
const kind = application.systemKind || application.systemKindKey;
|
|
22
|
+
return typeof kind === 'string' ? kind.trim() : '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isDigitalWorkerKind(application) {
|
|
26
|
+
return readSystemKind(application) === SYSTEM_KIND_DIGITAL_WORKER;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isEnterpriseKnowledgeKind(application) {
|
|
30
|
+
return readSystemKind(application) === SYSTEM_KIND_ENTERPRISE_KNOWLEDGE;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isPlatformShellKind(application) {
|
|
34
|
+
return isDigitalWorkerKind(application) || isEnterpriseKnowledgeKind(application);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isRoleAssistantWorkspace(baseDir) {
|
|
38
|
+
return String(baseDir || '').trim() === WORKSPACE_ROLE_ASSISTANT;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isEnterpriseKnowledgeWorkspace(baseDir) {
|
|
42
|
+
return String(baseDir || '').trim() === WORKSPACE_ENTERPRISE_KNOWLEDGE;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isPlatformShellWorkspace(baseDir) {
|
|
46
|
+
return isRoleAssistantWorkspace(baseDir) || isEnterpriseKnowledgeWorkspace(baseDir);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function throwIfPlatformShellHasNoDeployJson(appName, baseDir) {
|
|
50
|
+
if (!isPlatformShellWorkspace(baseDir)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(
|
|
54
|
+
`'${appName}' is a Role Assistant or Enterprise Knowledge package and does not use ` +
|
|
55
|
+
'application.yaml or deployment JSON. Publish settings and Evidence with: ' +
|
|
56
|
+
`aifabrix upload ${appName} --env <dev|tst|pro>`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = {
|
|
61
|
+
readSystemKind,
|
|
62
|
+
isDigitalWorkerKind,
|
|
63
|
+
isEnterpriseKnowledgeKind,
|
|
64
|
+
isPlatformShellKind,
|
|
65
|
+
isRoleAssistantWorkspace,
|
|
66
|
+
isEnterpriseKnowledgeWorkspace,
|
|
67
|
+
isPlatformShellWorkspace,
|
|
68
|
+
throwIfPlatformShellHasNoDeployJson
|
|
69
|
+
};
|
|
@@ -101,10 +101,59 @@ function getLocalPortFromPath(variablesPath) {
|
|
|
101
101
|
return (p !== undefined && p !== null) ? p : null;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Connected Systems (`app.type: external`) have no HTTP listen port.
|
|
106
|
+
* @param {Object|null|undefined} variables - Parsed application config
|
|
107
|
+
* @returns {boolean}
|
|
108
|
+
*/
|
|
109
|
+
function isExternalAppDoc(variables) {
|
|
110
|
+
return Boolean(variables && variables.app && variables.app.type === 'external');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @param {string|null|undefined} variablesPath - Path to application config
|
|
115
|
+
* @returns {boolean}
|
|
116
|
+
*/
|
|
117
|
+
function isExternalAppPath(variablesPath) {
|
|
118
|
+
return isExternalAppDoc(loadVariablesFromPath(variablesPath));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Drop PORT assignments from resolved .env content (Connected Systems).
|
|
123
|
+
* @param {string} envContent
|
|
124
|
+
* @returns {string}
|
|
125
|
+
*/
|
|
126
|
+
function stripListenPortEnvLines(envContent) {
|
|
127
|
+
if (!envContent || typeof envContent !== 'string') {
|
|
128
|
+
return envContent;
|
|
129
|
+
}
|
|
130
|
+
return envContent
|
|
131
|
+
.split(/\r?\n/)
|
|
132
|
+
.filter((line) => !/^\s*PORT\s*=/.test(line))
|
|
133
|
+
.join('\n');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Set or append PORT for builder apps that listen on HTTP.
|
|
138
|
+
* @param {string} envContent
|
|
139
|
+
* @param {number} appPort
|
|
140
|
+
* @returns {string}
|
|
141
|
+
*/
|
|
142
|
+
function assignListenPortEnvLine(envContent, appPort) {
|
|
143
|
+
if (/^PORT\s*=.*$/m.test(envContent)) {
|
|
144
|
+
return envContent.replace(/^PORT\s*=\s*.*$/m, `PORT=${appPort}`);
|
|
145
|
+
}
|
|
146
|
+
return `${envContent}\nPORT=${appPort}\n`;
|
|
147
|
+
}
|
|
148
|
+
|
|
104
149
|
module.exports = {
|
|
105
150
|
getContainerPort,
|
|
106
151
|
getLocalPort,
|
|
107
152
|
getContainerPortFromPath,
|
|
108
153
|
getLocalPortFromPath,
|
|
109
|
-
loadVariablesFromPath
|
|
154
|
+
loadVariablesFromPath,
|
|
155
|
+
isExternalAppDoc,
|
|
156
|
+
isExternalAppPath,
|
|
157
|
+
stripListenPortEnvLines,
|
|
158
|
+
assignListenPortEnvLine
|
|
110
159
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Treat clustered -name as the long --name option so quoted names with spaces work.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Commander parses -name as -n plus leftover letters
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {string[]} argv
|
|
13
|
+
* @returns {string[]}
|
|
14
|
+
*/
|
|
15
|
+
function rewriteClusteredNameFlag(argv) {
|
|
16
|
+
const args = Array.isArray(argv) ? argv : [];
|
|
17
|
+
return args.map((arg) => (arg === '-name' ? '--name' : arg));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = { rewriteClusteredNameFlag };
|
|
@@ -121,30 +121,33 @@ function firstExistingUnderRoot(disk, root, folderNames) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Resolves role-assistant
|
|
125
|
-
*
|
|
124
|
+
* Resolves role-assistant/<systemKey> by exact folder name.
|
|
125
|
+
* Does not map a connected-system key onto an ra- package.
|
|
126
|
+
* @param {string} systemKey
|
|
126
127
|
* @returns {string}
|
|
127
128
|
*/
|
|
128
|
-
function getRoleAssistantPath(
|
|
129
|
-
if (!
|
|
129
|
+
function getRoleAssistantPath(systemKey) {
|
|
130
|
+
if (!systemKey || typeof systemKey !== 'string') {
|
|
131
|
+
throw new Error('Role key is required and must be a string');
|
|
132
|
+
}
|
|
133
|
+
const folderName = systemKey.trim();
|
|
134
|
+
if (!folderName) {
|
|
130
135
|
throw new Error('Role key is required and must be a string');
|
|
131
136
|
}
|
|
132
137
|
const disk = nodeFs();
|
|
133
|
-
const folders = roleAssistantFolderCandidates(roleKey);
|
|
134
|
-
const preferred = roleAssistantSystemKey(roleKey);
|
|
135
138
|
const cwdRoot = getCwdRoleAssistantRoot();
|
|
136
139
|
const matRoot = path.join(getMaterializationParent(), WORKSPACE_ROLE_ASSISTANT);
|
|
137
140
|
|
|
138
141
|
const existing =
|
|
139
|
-
firstExistingUnderRoot(disk, cwdRoot,
|
|
140
|
-
firstExistingUnderRoot(disk, matRoot,
|
|
142
|
+
firstExistingUnderRoot(disk, cwdRoot, [folderName]) ||
|
|
143
|
+
firstExistingUnderRoot(disk, matRoot, [folderName]);
|
|
141
144
|
if (existing) {
|
|
142
145
|
return existing;
|
|
143
146
|
}
|
|
144
147
|
if (cwdRoot) {
|
|
145
|
-
return path.join(cwdRoot,
|
|
148
|
+
return path.join(cwdRoot, folderName);
|
|
146
149
|
}
|
|
147
|
-
return path.join(matRoot,
|
|
150
|
+
return path.join(matRoot, folderName);
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
module.exports = {
|
|
@@ -19,6 +19,7 @@ const addFormats = require('ajv-formats');
|
|
|
19
19
|
let externalSystemValidator = null;
|
|
20
20
|
let externalDataSourceValidator = null;
|
|
21
21
|
let roleAssistantSettingsValidator = null;
|
|
22
|
+
let roleAssistantTestCaseValidator = null;
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Reset validators cache (for testing)
|
|
@@ -28,6 +29,7 @@ function resetValidators() {
|
|
|
28
29
|
externalSystemValidator = null;
|
|
29
30
|
externalDataSourceValidator = null;
|
|
30
31
|
roleAssistantSettingsValidator = null;
|
|
32
|
+
roleAssistantTestCaseValidator = null;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
/**
|
|
@@ -172,6 +174,37 @@ function loadRoleAssistantSettingsSchema() {
|
|
|
172
174
|
return roleAssistantSettingsValidator;
|
|
173
175
|
}
|
|
174
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Loads and compiles role-assistant test-case schema.
|
|
179
|
+
* @function loadRoleAssistantTestCaseSchema
|
|
180
|
+
* @returns {Function}
|
|
181
|
+
*/
|
|
182
|
+
function loadRoleAssistantTestCaseSchema() {
|
|
183
|
+
if (roleAssistantTestCaseValidator) {
|
|
184
|
+
return roleAssistantTestCaseValidator;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const schemaPath = path.join(__dirname, '..', 'schema', 'role-assistant-test-case.schema.json');
|
|
188
|
+
let schema;
|
|
189
|
+
try {
|
|
190
|
+
schema = JSON.parse(fsRealSync.readFileSync(schemaPath, 'utf8'));
|
|
191
|
+
} catch (error) {
|
|
192
|
+
try {
|
|
193
|
+
schema = require('../schema/role-assistant-test-case.schema.json');
|
|
194
|
+
} catch {
|
|
195
|
+
if (error && error.code === 'ENOENT') {
|
|
196
|
+
throw new Error(`Role assistant test-case schema not found: ${schemaPath}`);
|
|
197
|
+
}
|
|
198
|
+
throw new Error(`Invalid JSON in role-assistant-test-case.schema.json: ${error.message}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const ajv = new Ajv({ allErrors: true, verbose: true, strict: false, strictSchema: false });
|
|
203
|
+
addFormats(ajv);
|
|
204
|
+
roleAssistantTestCaseValidator = ajv.compile(schema);
|
|
205
|
+
return roleAssistantTestCaseValidator;
|
|
206
|
+
}
|
|
207
|
+
|
|
175
208
|
/**
|
|
176
209
|
* Detect schema type from $id field
|
|
177
210
|
* @param {Object} parsed - Parsed JSON object
|
|
@@ -194,6 +227,9 @@ function detectFromId(parsed) {
|
|
|
194
227
|
if (parsed.$id.includes('role-assistant-settings')) {
|
|
195
228
|
return 'role-assistant-settings';
|
|
196
229
|
}
|
|
230
|
+
if (parsed.$id.includes('role-assistant-test-case')) {
|
|
231
|
+
return 'role-assistant-test-case';
|
|
232
|
+
}
|
|
197
233
|
|
|
198
234
|
return null;
|
|
199
235
|
}
|
|
@@ -388,6 +424,7 @@ module.exports = {
|
|
|
388
424
|
loadExternalSystemSchema,
|
|
389
425
|
loadExternalDataSourceSchema,
|
|
390
426
|
loadRoleAssistantSettingsSchema,
|
|
427
|
+
loadRoleAssistantTestCaseSchema,
|
|
391
428
|
registerExternalDatasourceAjvDependencies,
|
|
392
429
|
detectSchemaType,
|
|
393
430
|
detectSchemaTypeFromParsed,
|
|
@@ -14,6 +14,10 @@ const path = require('path');
|
|
|
14
14
|
const { detectAppType } = require('./paths');
|
|
15
15
|
const { resolveApplicationConfigPath } = require('./app-config-resolver');
|
|
16
16
|
const { loadConfigFile } = require('./config-format');
|
|
17
|
+
const {
|
|
18
|
+
isRoleAssistantWorkspace,
|
|
19
|
+
isEnterpriseKnowledgeWorkspace
|
|
20
|
+
} = require('./platform-shell-package');
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* Resolves schemaBasePath from application config
|
|
@@ -314,7 +318,13 @@ async function resolveExternalFiles(appName, options = {}) {
|
|
|
314
318
|
throw new Error('App name is required and must be a string');
|
|
315
319
|
}
|
|
316
320
|
|
|
317
|
-
const { appPath } = await detectAppType(appName, options);
|
|
321
|
+
const { appPath, baseDir } = await detectAppType(appName, options);
|
|
322
|
+
if (isEnterpriseKnowledgeWorkspace(baseDir)) {
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
325
|
+
if (isRoleAssistantWorkspace(baseDir)) {
|
|
326
|
+
return [resolveRoleAssistantSettingsFile(appPath)];
|
|
327
|
+
}
|
|
318
328
|
const variables = await loadAndValidateVariables(appPath);
|
|
319
329
|
|
|
320
330
|
if (!variables.externalIntegration) {
|
|
@@ -17,7 +17,7 @@ const { rewriteInfraEndpoints, getEnvHosts, getServicePort, getServiceHost, getL
|
|
|
17
17
|
const { loadEnvConfig } = require('./env-config-loader');
|
|
18
18
|
const { updateContainerPortInEnvFile } = require('./env-ports');
|
|
19
19
|
const { buildEnvVarMap } = require('./env-map');
|
|
20
|
-
const { getLocalPortFromPath } = require('./port-resolver');
|
|
20
|
+
const { getLocalPortFromPath, isExternalAppPath, assignListenPortEnvLine } = require('./port-resolver');
|
|
21
21
|
const { readYamlAtPath, applyCanonicalSecretsOverride } = require('./secrets-canonical');
|
|
22
22
|
const { collectUniqueKvPathStrings, isCommentOrEmptyLine, activeEnvLineForKvScan, envLineWithoutInlineComment } = require('./secrets-kv-refs');
|
|
23
23
|
|
|
@@ -407,20 +407,6 @@ async function getLocalEnvWithOverrides() {
|
|
|
407
407
|
return localEnv;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
/**
|
|
411
|
-
* Updates PORT variable in content
|
|
412
|
-
* @function updatePortVariable
|
|
413
|
-
* @param {string} envContent - Environment content
|
|
414
|
-
* @param {number} appPort - Application port
|
|
415
|
-
* @returns {string} Updated content
|
|
416
|
-
*/
|
|
417
|
-
function updatePortVariable(envContent, appPort) {
|
|
418
|
-
if (/^PORT\s*=.*$/m.test(envContent)) {
|
|
419
|
-
return envContent.replace(/^PORT\s*=\s*.*$/m, `PORT=${appPort}`);
|
|
420
|
-
}
|
|
421
|
-
return `${envContent}\nPORT=${appPort}\n`;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
410
|
/**
|
|
425
411
|
* Builds environment variables for interpolation
|
|
426
412
|
* @async
|
|
@@ -446,6 +432,7 @@ async function buildEnvVarsForInterpolation(devIdNum) {
|
|
|
446
432
|
}
|
|
447
433
|
|
|
448
434
|
async function adjustLocalEnvPortsInContent(envContent, variablesPath) {
|
|
435
|
+
const skipListenPort = isExternalAppPath(variablesPath);
|
|
449
436
|
const devIdNum = await getDeveloperIdNumber();
|
|
450
437
|
const localEnv = await getLocalEnvWithOverrides();
|
|
451
438
|
const { localHostPort } = require('./declarative-url-ports');
|
|
@@ -453,15 +440,19 @@ async function adjustLocalEnvPortsInContent(envContent, variablesPath) {
|
|
|
453
440
|
const baseListen = await resolveManifestListenPort(variablesPath, localEnv, envContent);
|
|
454
441
|
const appPort = localHostPort(baseListen, devIdNum);
|
|
455
442
|
|
|
456
|
-
let updated =
|
|
457
|
-
|
|
443
|
+
let updated = skipListenPort ? envContent : assignListenPortEnvLine(envContent, appPort);
|
|
444
|
+
if (!skipListenPort) {
|
|
445
|
+
updated = updateLocalhostUrls(updated, baseListen, appPort);
|
|
446
|
+
}
|
|
458
447
|
updated = await rewriteInfraEndpoints(updated, 'local');
|
|
459
448
|
|
|
460
449
|
const envVars = await buildEnvVarsForInterpolation(devIdNum);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
450
|
+
if (!skipListenPort) {
|
|
451
|
+
envVars.PORT = String(appPort);
|
|
452
|
+
const portVar = getPortVarFromEnvTemplatePath(variablesPath);
|
|
453
|
+
if (portVar) {
|
|
454
|
+
envVars[portVar] = String(appPort);
|
|
455
|
+
}
|
|
465
456
|
}
|
|
466
457
|
updated = interpolateEnvVars(updated, envVars);
|
|
467
458
|
|