@wildo-ai/dev-companion 1.1.13 → 1.1.15
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/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +89 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +114 -9
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts +46 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +39 -2
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js.map +1 -1
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts +6 -0
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.js.map +1 -1
- package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts +19 -5
- package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/verification-tool-availability.models.js +17 -5
- package/dist/esm/claude-cli/models/verification-tool-availability.models.js.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +16 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +53 -6
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +145 -6
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +474 -47
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +6 -2
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js +16 -39
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +14 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +35 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts +36 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts.map +1 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js +134 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js.map +1 -0
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js +31 -2
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.d.ts +2 -0
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +8 -0
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +7 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +26 -12
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts +17 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts.map +1 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.js +33 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.js.map +1 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts +9 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +12 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +7 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +8 -20
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +37 -142
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts +64 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.js +304 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.js.map +1 -0
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts +3 -2
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/translation-placement.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +24 -14
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/workspace-element-index.companion.d.ts +42 -0
- package/dist/esm/core/introspection/workspace-element-index.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/workspace-element-index.companion.js +42 -0
- package/dist/esm/core/introspection/workspace-element-index.companion.js.map +1 -1
- package/dist/esm/core/runtime/companion-language-model-route.d.ts +16 -1
- package/dist/esm/core/runtime/companion-language-model-route.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-language-model-route.js +23 -1
- package/dist/esm/core/runtime/companion-language-model-route.js.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +53 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js +119 -2
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +16 -3
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts +2 -2
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js +6 -6
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
- package/dist/esm/core/utils/git-read-broker.companion.d.ts +62 -0
- package/dist/esm/core/utils/git-read-broker.companion.d.ts.map +1 -0
- package/dist/esm/core/utils/git-read-broker.companion.js +282 -0
- package/dist/esm/core/utils/git-read-broker.companion.js.map +1 -0
- package/dist/esm/core/utils/local-write-recording.companion.d.ts +8 -1
- package/dist/esm/core/utils/local-write-recording.companion.d.ts.map +1 -1
- package/dist/esm/core/utils/local-write-recording.companion.js +7 -23
- package/dist/esm/core/utils/local-write-recording.companion.js.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts +5 -0
- package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.js +44 -11
- package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts +26 -2
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.js +41 -2
- package/dist/esm/email/utils/email-template-fs-discovery.utils.js.map +1 -1
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts +19 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts.map +1 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js +171 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js.map +1 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.d.ts +75 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.d.ts.map +1 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.js +162 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.js.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js +2 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js +2 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts +2 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js +3 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts +2 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js +3 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.d.ts +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts +2 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js +3 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts +3 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js +4 -2
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts +17 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js +18 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts +17 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js +18 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts +206 -195
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js +206 -195
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts +10 -0
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js +12 -2
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts +70 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js +70 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts +12 -2
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js +12 -2
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts +10 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js +10 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.js +4 -0
- package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts +25 -20
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js +25 -20
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.d.ts +32 -32
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js +32 -32
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.d.ts +65 -65
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js +65 -65
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts +20 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js +20 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts +12 -0
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js +13 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +35 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +12 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +536 -531
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +536 -531
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +170 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.js +170 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/flows-actors.fr.d.ts +22 -22
- package/dist/esm/i18n/system_enums/flows-actors.fr.js +22 -22
- package/dist/esm/i18n/system_enums/flows-actors.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/run-records.fr.d.ts +21 -21
- package/dist/esm/i18n/system_enums/run-records.fr.js +21 -21
- package/dist/esm/i18n/system_enums/run-records.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +3 -2
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js +3 -2
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts +37 -33
- package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.fr.js +37 -33
- package/dist/esm/i18n/system_enums/workbench-build.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts +1 -0
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.js +1 -0
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts +18 -17
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js +18 -17
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts +7 -5
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.js +8 -6
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.d.ts +12 -12
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.js +12 -12
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts +1 -0
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js +2 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js.map +1 -1
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js +7 -3
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js +3 -4
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts +11 -0
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js +21 -0
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts +9 -0
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js +18 -2
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +153 -22
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +970 -208
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +115 -13
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +295 -56
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.d.ts +3 -3
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js +3 -3
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts +9 -0
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js +19 -0
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +48 -26
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts +12 -0
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js +30 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +4 -5
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +12 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js +6 -3
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js +3 -5
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +8 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +119 -25
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts +55 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js +157 -10
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js.map +1 -1
- package/dist/esm/module-layout/module-layout-convention.companion.d.ts +158 -0
- package/dist/esm/module-layout/module-layout-convention.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-layout-convention.companion.js +272 -0
- package/dist/esm/module-layout/module-layout-convention.companion.js.map +1 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.d.ts +42 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.js +290 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.js.map +1 -0
- package/dist/esm/module-layout/module-source-files.companion.d.ts +3 -0
- package/dist/esm/module-layout/module-source-files.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-source-files.companion.js +45 -0
- package/dist/esm/module-layout/module-source-files.companion.js.map +1 -0
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-platform-config.companion.d.ts","sourceRoot":"","sources":["../../../../../src/core/runtime/utils/companion-platform-config.companion.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAStC,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EASL,KAAK,4BAA4B,EAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAqBjF,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"companion-platform-config.companion.d.ts","sourceRoot":"","sources":["../../../../../src/core/runtime/utils/companion-platform-config.companion.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAStC,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EASL,KAAK,4BAA4B,EAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAqBjF,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmH5B,CAAC;AAEL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAgK9E;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oCAAoC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,+EAA+E;IAC/E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;CACjD;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,GAAG,EAAE,oBAAoB,GACxB,oCAAoC,CAQtC;AAED,wBAAgB,yBAAyB,CACvC,MAAM,GAAE,MAAM,CAAC,UAAwB,GACtC,oBAAoB,CAEtB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,GAAE,MAAM,CAAC,UAAwB,GACtC,sBAAsB,CA6BxB;AAkFD;;;;;;;;;;;GAWG;AACH,wBAAsB,+BAA+B,CAAC,KAAK,EAAE;IAC3D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,GAAG,EAAE,oBAAoB,CAAC;IAC1B,aAAa,CAAC,EAAE,gCAAgC,CAAC;IACjD,eAAe,CAAC,EAAE,4BAA4B,CAAC;CAChD,GAAG,OAAO,CAAC;IACV,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,uBAAuB,CAAC;CAClC,CAAC,CAiXD"}
|
|
@@ -67,8 +67,10 @@ const CompanionPlatformEnvSchema = z.object({
|
|
|
67
67
|
REDIS_PORT: z.coerce.number().int().positive(),
|
|
68
68
|
REDIS_ADMIN_USER: z.string().min(1).optional(),
|
|
69
69
|
REDIS_ADMIN_PASSWORD: z.string().min(1).optional(),
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
// Optional (#2303 slice D): an environment whose service profile runs no broker emits no RabbitMQ keys, and the
|
|
71
|
+
// companion never connects to the broker either way (it runs no queue workers).
|
|
72
|
+
RABBITMQ_HOST: z.string().min(1).optional(),
|
|
73
|
+
RABBITMQ_PORT: z.coerce.number().int().positive().optional(),
|
|
72
74
|
RABBITMQ_ADMIN_USERNAME: z.string().min(1).optional(),
|
|
73
75
|
RABBITMQ_ADMIN_PASSWORD: z.string().min(1).optional(),
|
|
74
76
|
STORAGE_PROVIDER: z.string().min(1).optional(),
|
|
@@ -504,10 +506,8 @@ export async function buildCompanionResolvedAppConfig(input) {
|
|
|
504
506
|
port: env.REDIS_PORT,
|
|
505
507
|
db: 0,
|
|
506
508
|
},
|
|
507
|
-
rabbitmq
|
|
508
|
-
|
|
509
|
-
port: env.RABBITMQ_PORT,
|
|
510
|
-
},
|
|
509
|
+
// Only when the environment runs a broker (#2303 slice D); the `database.rabbitmq` config branch is optional.
|
|
510
|
+
...(env.RABBITMQ_HOST && env.RABBITMQ_PORT ? { rabbitmq: { host: env.RABBITMQ_HOST, port: env.RABBITMQ_PORT } } : {}),
|
|
511
511
|
},
|
|
512
512
|
});
|
|
513
513
|
// `frontendServices` inventory: prefer apps-manager (canonical, matches
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-platform-config.companion.js","sourceRoot":"","sources":["../../../../../src/core/runtime/utils/companion-platform-config.companion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAIL,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,+BAA+B,EAC/B,uCAAuC,EACvC,mCAAmC,EACnC,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAsB,eAAe,EAC3E,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wCAAwC,EACxC,+BAA+B,EAC/B,sCAAsC,EACtC,gCAAgC,EAEhC,kCAAkC,EAClC,6BAA6B,EAC7B,iCAAiC,GAElC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGx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,CAAC,gBAAgB;gBAC9B,QAAQ,EAAE,GAAG,CAAC,oBAAoB;aACnC;YACD,QAAQ,EAAE;gBACR,QAAQ,EAAE,GAAG,CAAC,uBAAuB;gBACrC,QAAQ,EAAE,GAAG,CAAC,uBAAuB;aACtC;SACF;QACD,QAAQ,EAAE;YACR,GAAG,EAAE;gBACH;;;;;;;;mBAQG;gBACH,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,EAAE,uBAAuB,CAAC,UAAU,EAAE;aAC/F;YACD,mHAAmH;YACnH,aAAa,EAAE,0BAA0B,CAAC,aAAa;YACvD,OAAO,EAAE;gBACP,MAAM,EAAE,0BAA0B,CAAC,aAAa;gBAChD,aAAa,EAAE,0BAA0B,CAAC,oBAAoB;aAC/D;SACF;QACD,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,GAAG;KACf,CAAC;IAEF,OAAO;QACL,kBAAkB,EAAE,YAAgC;QACpD,MAAM,EAAE,cAAc;QACtB,OAAO,EAAE,eAAe;KACzB,CAAC;AACJ,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport {\n type AppConfiguration,\n type AppConfigurationSecrets,\n type AppConfiguration_BackendAuthored,\n MongoDBProtocol,\n applyBackendAuthoredConfig,\n readMongoConnectionStringCredentials,\n readMongoConnectionStringOption,\n readMongoConnectionStringTarget,\n buildMinimalPreOverrideAppConfiguration,\n buildStorageTopologyFromEnvironment,\n fetchVerifiedAppsManagerJson,\n} from '@wildo-ai/saas-backend-lib';\nimport { parseDeclaredPersistenceAdapter, PersistenceAdapter, WildoHeaderKeys,\n BackendApiType,\n} from '@wildo-ai/saas-models';\nimport {\n buildPlatformRuntimeEndpoints,\n parseRuntimeEndpointsRecord,\n} from '@wildo-ai/platform-core-shared';\nimport {\n AppBootstrapConfigMetadataResponseSchema,\n DEVELOPMENT_COMPANION_PRINCIPAL,\n parseRuntimeResponseVerificationKeySet,\n RuntimeResponseVerificationError,\n type AppBootstrapConfigMetadataResponse,\n missingSelectedPlatformStoreUrlKey,\n PlatformInfrastructureEnvKeys,\n resolvePlatformMongoPreconnectUrl,\n type SaasRuntimeProvidersArtifact,\n} from '@wildo-ai/platform-config-lib';\nimport { z } from 'zod';\nimport type { CompanionContext } from '../../context/companion-context';\nimport type { CompanionRuntimeConfig } from '../models/companion-runtime.models';\nimport { CompanionTraceabilityLevel } from '../../traceability/companion-traceability.models';\nimport { WORKBENCH_FRONTEND_SERVICE_NAME } from '@wildo-ai/platform-core-shared';\nimport { WORKBENCH_PORT_OFFSET_FROM_COMPANION } from './companion-workbench-topology';\nimport { ensureCompanionLocalSigningKeyPair, ensureCompanionLocalSymmetricMaterial } from './companion-local-signing-key.companion';\nimport { CryptoKey_Purpose } from '@wildo-ai/saas-models';\n\n// semantic-literal-boundary: 'true'/'false' is the process-env string encoding of a boolean, translated to a real boolean right here at the env boundary — not a domain vocabulary.\nconst booleanStringSchema = z.enum(['true', 'false']).transform((value) => value === 'true');\nconst CompanionTraceabilityLevelSchema = z.enum(CompanionTraceabilityLevel);\n\n/**\n * An optional env value where the EMPTY STRING means absent. Docker Compose interpolates an\n * unset variable to `''` rather than omitting the key, so a plain `.optional()` would hand\n * `''` to `new URL()` and to the adapter parser.\n */\nconst OptionalPlatformStoreUrlSchema = z\n .string()\n .optional()\n .transform((value) => (value === undefined || value.trim() === '' ? undefined : value));\n\nconst CompanionPlatformEnvSchema = z.object({\n APPLICATION_ID: z.string().min(1),\n SERVICE_NAME: z.string().min(1),\n PLATFORM_ENVIRONMENT_ID: z.string().min(1),\n /**\n * The COMPANION's own bootstrap secret (#2941), not the application backend's. The variable keeps the name every\n * runtime reads (as a minion's and a worker's do); only the value differs. apps-manager mints it on a development\n * platform and resolves it to the `development_companion` principal, which it admits on `application-config` and the\n * storage session only, and which the signing and data-key proxies refuse.\n */\n PLATFORM_APPLICATION_PRIMARY_SECRET: z.string().min(1),\n PLATFORM_APPS_MANAGER_URL: z.url(),\n /** #2921 — the companion verifies apps-manager's answers like every other application runtime. */\n PLATFORM_APPS_MANAGER_RESPONSE_VERIFICATION_KEYS: z.string().min(1),\n PLATFORM_CRONTABS_BATCHES_MANAGER_URL: z.url(),\n PLATFORM_MODULE_REGISTRY_URL: z.url(),\n APPLICATION_ENV: z.string().min(1),\n /**\n * The platform's stores. BOTH are optional and AT LEAST ONE must be present — the\n * pair rules below are what enforce that, and they live on the schema rather than at\n * a call site so every consumer of `parseCompanionPlatformEnv` inherits them.\n *\n * `MONGO_CONNECT_URL` was REQUIRED until 2026-08-28, which is what made the companion\n * unable to run on a PostgreSQL-engined platform at all (issue #94): it connected Mongo\n * unconditionally, read platform rows from a database the platform had stopped using,\n * and reported every application as unregistered. Absence now means \"not MongoDB-engined\".\n *\n * Empty string counts as absent — the compose interpolation contract, the same reading\n * apps-manager and module-registry use for these two keys.\n */\n MONGO_CONNECT_URL: OptionalPlatformStoreUrlSchema,\n PG_CONNECT_URL: OptionalPlatformStoreUrlSchema,\n /**\n * Which store the platform's own data lives in. Parsed through the shared seam, so a\n * present-but-unknown declaration REFUSES rather than collapsing into the Mongo lane.\n *\n * semantic-literal-boundary: the canonical name is\n * `ApplicationBackendDataEnvKey.DATABASE_DEFAULT_ADAPTER` (platform-core-shared), which\n * this package does not depend on; the CLI emits the key from that enum.\n */\n DATABASE_DEFAULT_ADAPTER: OptionalPlatformStoreUrlSchema,\n REDIS_HOST: z.string().min(1),\n REDIS_PORT: z.coerce.number().int().positive(),\n REDIS_ADMIN_USER: z.string().min(1).optional(),\n REDIS_ADMIN_PASSWORD: z.string().min(1).optional(),\n RABBITMQ_HOST: z.string().min(1),\n RABBITMQ_PORT: z.coerce.number().int().positive(),\n RABBITMQ_ADMIN_USERNAME: z.string().min(1).optional(),\n RABBITMQ_ADMIN_PASSWORD: z.string().min(1).optional(),\n STORAGE_PROVIDER: z.string().min(1).optional(),\n STORAGE_ENDPOINT: z.string().min(1).optional(),\n STORAGE_PORT: z.coerce.number().int().positive().optional(),\n STORAGE_USE_SSL: z.union([z.boolean(), booleanStringSchema]).transform((value) => value === true).optional(),\n STORAGE_BUCKET: z.string().min(1).optional(),\n // ⚠️ NO `STORAGE_ACCESS_KEY` / `STORAGE_SECRET_KEY`. Those are the object store's\n // ROOT credential, and the companion never consumed them — it runs the same\n // app-tier storage provider as backend-api, which fetches short-lived,\n // prefix-confined STS sessions from apps-manager using the bootstrap contract\n // above. Declaring them here would let the CLI start emitting them again without\n // anything noticing, since an unused declaration reads exactly like a used one.\n HOST: z.string().min(1).default('0.0.0.0'),\n PORT: z.coerce.number().int().positive(),\n APPLICATION_RUNTIME_ENDPOINTS: z.string().optional(),\n})\n /**\n * The two store rules, on the SCHEMA so they cannot be bypassed by a consumer that parses\n * the env itself. Both are refusals at the door: the alternative is a companion that boots,\n * connects nothing usable, and then reports every platform row as missing for the rest of\n * the process lifetime — which is exactly how issue #94 presented, and why it was diagnosed\n * as an uninitialized platform rather than a wrong connection.\n */\n .superRefine((env, ctx) => {\n if (env.MONGO_CONNECT_URL === undefined && env.PG_CONNECT_URL === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['MONGO_CONNECT_URL'],\n message:\n 'The companion needs a platform store: set MONGO_CONNECT_URL or PG_CONNECT_URL. '\n + 'Re-run `wildo config sync` to regenerate the companion environment.',\n });\n }\n // The pair rule for BOTH stores, the one decision module-registry, apps-manager (both modes) and its env schema\n // make (`missingSelectedPlatformStoreUrlKey`). A declared PostgreSQL platform without its URL dies later inside a\n // repository read with an unsatisfiable message. A MongoDB platform (declaration absent or `mongodb`) without its\n // URL is worse (#1117): its Mongo block is written disabled at a `.invalid` host, readiness then owes no MongoDB\n // check, and the companion reports ready while every platform-row read fails on use, the #94 shape.\n const missingSelectedStoreUrl = missingSelectedPlatformStoreUrlKey({\n mongoConnectUrl: env.MONGO_CONNECT_URL,\n pgConnectUrl: env.PG_CONNECT_URL,\n declaredDefaultAdapter: env.DATABASE_DEFAULT_ADAPTER,\n });\n if (missingSelectedStoreUrl === PlatformInfrastructureEnvKeys.MONGO_CONNECT_URL\n && env.PG_CONNECT_URL !== undefined) {\n // With neither URL the rule above already names both; this one is for a PostgreSQL URL under a MongoDB selection.\n ctx.addIssue({\n code: 'custom',\n path: ['MONGO_CONNECT_URL'],\n message:\n 'A MongoDB platform (DATABASE_DEFAULT_ADAPTER absent or mongodb) requires MONGO_CONNECT_URL: the companion '\n + 'reads the platform rows through MongoDB. Re-run `wildo config sync`, or declare '\n + 'DATABASE_DEFAULT_ADAPTER=postgresql.',\n });\n }\n if (missingSelectedStoreUrl === PlatformInfrastructureEnvKeys.PG_CONNECT_URL) {\n ctx.addIssue({\n code: 'custom',\n path: ['PG_CONNECT_URL'],\n message:\n 'DATABASE_DEFAULT_ADAPTER=postgresql requires PG_CONNECT_URL: the companion pre-connects '\n + 'its own PostgreSQL from env before any repository is constructed. '\n + 'Re-run `wildo config sync`.',\n });\n }\n });\n\nexport type CompanionPlatformEnv = z.infer<typeof CompanionPlatformEnvSchema>;\n\n\n/**\n * The workbench's frontend-service entry.\n *\n * ## `usersManagement` is EMPTY on purpose, and the reason is not \"nothing to manage\"\n *\n * It reads as a placeholder and is a decision. `resolveUserTypeFromFrontendServiceName` derives the\n * session's `activeUserType` from this map, and the orchestrator then requires the authenticating\n * user's `userTypes[]` to contain it. Declaring the APPLICATION's user type here — which is what an\n * application frontend does, and what this entry briefly did — makes every workbench login fail with\n * `authentication_user_type_mismatch`.\n *\n * It fails because the companion authenticates against a DIFFERENT DATABASE than the application.\n * Measured on the dogfood stack, where one email exists twice:\n *\n * wildo_platform → userTypes: [] ← the identity the companion resolves\n * wonder-crm-db → userTypes: [\"member\"] ← the application's own user\n *\n * So the application's user-type vocabulary is not the companion's to assert. An empty map leaves\n * `activeUserType` unset, the type gate is skipped, and the operator is authenticated as the platform\n * identity they actually are.\n *\n * The entry must still EXIST — without the key, `ApplicationConfigController` refuses the bootstrap\n * with `app_configuration_unknown_frontend_service` and no provider mounts at all.\n *\n * If the companion ever authenticates application users, this becomes a real decision rather than an\n * omission: it would need the user types of whichever store it resolves identities from.\n */\nfunction buildWorkbenchFrontendServiceEntry(): AppConfiguration['frontendServices'][string] {\n return { usersManagement: {} };\n}\n\nfunction assertNoCompanionRuntimeManagedOverrides(\n backendConfig: AppConfiguration_BackendAuthored | undefined,\n): void {\n if (!backendConfig) {\n return;\n }\n\n const forbiddenKeys = ['providers', 'providerConfigurations'];\n const authoredForbiddenKeys = forbiddenKeys.filter((key) =>\n Object.prototype.hasOwnProperty.call(backendConfig, key),\n );\n if (authoredForbiddenKeys.length === 0) {\n return;\n }\n\n throw new Error(\n `Companion backendConfig attempted to override runtime-managed fields: ${authoredForbiddenKeys.join(', ')}`,\n );\n}\n\nfunction resolveCompanionVersion(companionContext: CompanionContext): string {\n const candidateServices = [\n ...Object.values(companionContext.backendServices),\n ...Object.values(companionContext.frontendServices),\n ];\n\n for (const service of candidateServices) {\n const packageJsonPath = resolve(companionContext.saasRoot, service.path, 'package.json');\n if (!existsSync(packageJsonPath)) {\n continue;\n }\n\n try {\n const parsed = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as { version?: unknown };\n if (typeof parsed.version === 'string' && parsed.version.trim()) {\n return parsed.version.trim();\n }\n } catch {\n // Fall through to the next candidate.\n }\n }\n\n return '1.0.0';\n}\n\n/**\n * On a platform with no MongoDB URL — a PostgreSQL-engined platform — this returns a\n * DISABLED block rather than a connected one.\n *\n * `enabled: false` is the contract's way of saying \"this store is not available here\":\n * `getDb()` refuses on it, so a Mongo-resolved repository fails with that answer instead\n * of binding to a connection this process never opened and failing at first use. The\n * configuration type requires the key, so omitting it is not available; declaring it\n * `enabled: true` unconditionally is the silent shape module-registry records paying for.\n */\nfunction resolveMongoRuntime(\n env: CompanionPlatformEnv,\n): {\n config: AppConfiguration['database']['mongodb'];\n secrets: AppConfigurationSecrets['database']['mongodb'];\n} {\n if (env.MONGO_CONNECT_URL === undefined) {\n return {\n config: {\n enabled: false,\n /*\n * The runtime schema requires a non-empty host and database name even on a disabled\n * block, so SOMETHING must go here — and the choice matters. A plausible default\n * (`localhost:27017`, `wildo_platform`) would mean that anything ignoring\n * `enabled: false` connects to whatever Mongo happens to be running on the machine and\n * silently reads an empty database, which is the exact failure this whole change exists\n * to remove. `.invalid` is reserved precisely so it can never resolve, so the same\n * mistake fails immediately and names its own cause.\n *\n * spec-cite: RFC 2606 §2 reserves the `.invalid` TLD for names that are \"clearly invalid\"\n * and guaranteed not to resolve in the global DNS.\n */\n host: 'mongodb-not-configured.invalid:27017',\n database: 'mongodb-not-configured',\n protocol: MongoDBProtocol.MONGODB,\n options: { retryWrites: false, w: 'majority', authSource: 'admin' },\n },\n secrets: {},\n };\n }\n /*\n * Read with the MongoDB connection-string grammar the CLI and apps-manager share (#2000 review), never\n * `new URL(...)`: on an Atlas platform this is the authored `externalEndpoints.mongodb.connectionUrl`, and for a\n * cluster with no SRV address that is a comma-separated seed list, which WHATWG URL parsing rejects\n * (`ERR_INVALID_URL`). The seed list's TLS and replica set are carried too, or the platform store is opened without\n * the TLS Atlas requires.\n */\n const connectUrl = env.MONGO_CONNECT_URL;\n const target = readMongoConnectionStringTarget(connectUrl);\n const credentials = readMongoConnectionStringCredentials(connectUrl);\n if (!target || !credentials) {\n throw new Error(\n 'MONGO_CONNECT_URL is not a MongoDB connection string with a host '\n + '(expected `mongodb://host[:port][,host[:port]…]/…` or `mongodb+srv://host/…`).',\n );\n }\n const directConnection = readMongoConnectionStringOption(connectUrl, 'directConnection');\n\n return {\n config: {\n enabled: true,\n host: target.hosts,\n database: target.database || 'wildo_platform',\n protocol: target.protocol,\n options: {\n retryWrites: readMongoConnectionStringOption(connectUrl, 'retryWrites') !== 'false',\n w: readMongoConnectionStringOption(connectUrl, 'w') ?? 'majority',\n authSource: readMongoConnectionStringOption(connectUrl, 'authSource') ?? 'admin',\n // Case-insensitive, as the grammar reads every connection-string boolean.\n ...(directConnection !== undefined ? { directConnection: directConnection.toLowerCase() === 'true' } : {}),\n ...(target.tls !== undefined ? { tls: target.tls } : {}),\n ...(target.replicaSet ? { replicaSet: target.replicaSet } : {}),\n },\n },\n secrets: {\n username: credentials.username,\n password: credentials.password,\n },\n };\n}\n\n/**\n * Which platform stores this environment says to connect, and with what.\n *\n * Extracted as a pure function because it is the decision issue #94 got wrong, and because\n * the startup service that executes it has ~15 injected dependencies and no unit test — so\n * left inline, the single most load-bearing branch of the fix was pinned by nothing. A\n * mutation that removed the PostgreSQL pre-connect entirely passed the whole suite.\n *\n * The startup service is now a trivial executor of this plan. Keep it that way: a branch\n * added there instead of here is a branch nothing can test.\n */\nexport interface CompanionPlatformStoreConnectionPlan {\n /**\n * Present only when MongoDB may be this platform's store: a URL is supplied AND the declared\n * adapter is not PostgreSQL (absent keeps the framework's Mongo default, so the dual-store\n * mid-flip state still opens both).\n */\n readonly mongoConnectUrl: string | undefined;\n /** Present only when this environment declares a PostgreSQL platform store. */\n readonly postgresConnectUrl: string | undefined;\n}\n\n/**\n * The Mongo half is the shared platform decision `resolvePlatformMongoPreconnectUrl`: gated on the\n * declared SELECTION, never on the address, so an application-side mongod outage cannot take the\n * companion down with it. The Mongo runtime block (`resolveMongoRuntime`) stays enabled when a URL\n * is present, so a resource that did resolve MongoDB would still connect on demand; none does today.\n */\nexport function planCompanionPlatformStoreConnections(\n env: CompanionPlatformEnv,\n): CompanionPlatformStoreConnectionPlan {\n return {\n mongoConnectUrl: resolvePlatformMongoPreconnectUrl({\n mongoConnectUrl: env.MONGO_CONNECT_URL,\n declaredDefaultAdapter: env.DATABASE_DEFAULT_ADAPTER,\n }),\n postgresConnectUrl: env.PG_CONNECT_URL,\n };\n}\n\nexport function parseCompanionPlatformEnv(\n source: NodeJS.ProcessEnv = process.env,\n): CompanionPlatformEnv {\n return CompanionPlatformEnvSchema.parse(source);\n}\n\nexport function resolveCompanionRuntimeConfig(\n source: NodeJS.ProcessEnv = process.env,\n): CompanionRuntimeConfig {\n const rawTraceabilityLevel = source.WILDO_DEV_COMPANION_TRACEABILITY_LEVEL;\n const normalizedTraceabilityLevel = rawTraceabilityLevel?.trim().toUpperCase();\n\n if (!normalizedTraceabilityLevel) {\n // ALWAYS-ON by default: the companion is a DEV-ONLY daemon whose whole\n // point is inspectable build-time work — a fresh checkout should leave\n // prompt/output artifacts for every agent call without anyone knowing a\n // magic env var. The old `NONE` default meant every derivation/deliberation\n // ran traceless unless the operator remembered to export the level (the\n // recurring \"why are there no trace rows?\" trap). The env var remains the\n // override for turning it DOWN (`NONE` / `DEBUG`) when disk noise matters.\n return {\n traceabilityLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n };\n }\n\n const parsedTraceabilityLevel = CompanionTraceabilityLevelSchema.safeParse(normalizedTraceabilityLevel);\n if (!parsedTraceabilityLevel.success) {\n const acceptedValues = Object.values(CompanionTraceabilityLevel).join(', ');\n throw new Error(\n `Invalid WILDO_DEV_COMPANION_TRACEABILITY_LEVEL \"${rawTraceabilityLevel}\". ` +\n `Accepted values: ${acceptedValues}.`,\n );\n }\n\n return {\n traceabilityLevel: parsedTraceabilityLevel.data,\n };\n}\n\n/**\n * Bootstrap material fetched from apps-manager — the authoritative source for\n * everything the operator authors in `wildo.infra.<env>.config.ts` and the\n * app declares in `wildo.saas.config.ts`. The companion fetches the SAME\n * payload that `AppConfigurationLoaderService.initialize()` fetches for\n * app backends (and the SAME `/apps-to-manager/application-config` route),\n * authenticated by the companion's OWN runtime-principal secret (#2941), which it carries in\n * its env. This is what aligns the companion with the canonical bootstrap:\n * the parallel-path single-source-of-truth was an artefact of an earlier\n * design; now the companion derives JWT TTLs, frontendServices inventory,\n * appIdentity, engineCapabilities, providers, and email-management flags\n * from apps-manager instead of synthesising them locally.\n *\n * Returns `null` if apps-manager is unreachable or returns an unrecognised\n * payload — callers fall back to the locally-derived seed in that case.\n */\ntype AppsManagerBootstrapMaterial = Omit<AppBootstrapConfigMetadataResponse, 'jwt'> & { readonly jwt: AppConfiguration['jwt'] };\n\nasync function fetchAppsManagerBootstrapMaterial(\n env: CompanionPlatformEnv,\n): Promise<AppsManagerBootstrapMaterial | null> {\n // Parsed OUTSIDE the fail-soft `try`: a malformed key set is a configuration error to refuse, never a reason to fall\n // back silently to the local seed (#2921).\n const verificationKeys = parseRuntimeResponseVerificationKeySet(env.PLATFORM_APPS_MANAGER_RESPONSE_VERIFICATION_KEYS);\n try {\n const url = `${env.PLATFORM_APPS_MANAGER_URL}/api/v1/apps-to-manager/application-config`;\n // #2921 — verified before anything reads it: signed by apps-manager, for this application and the companion's own\n // principal (#2941: it presents its own secret, never the backend's), echoing this request's nonce.\n const { response, body } = await fetchVerifiedAppsManagerJson(\n url,\n {\n method: 'GET',\n headers: {\n [WildoHeaderKeys.CONTENT_TYPE]: 'application/json',\n [WildoHeaderKeys.SERVICE_ID]: env.SERVICE_NAME,\n [WildoHeaderKeys.PLATFORM_SECRET]: env.PLATFORM_APPLICATION_PRIMARY_SECRET,\n [WildoHeaderKeys.APPLICATION_ID]: env.APPLICATION_ID,\n },\n signal: AbortSignal.timeout(10_000),\n },\n {\n keys: verificationKeys,\n applicationId: env.APPLICATION_ID,\n principal: DEVELOPMENT_COMPANION_PRINCIPAL,\n },\n );\n\n if (!response.ok) {\n return null;\n }\n\n const parsed = AppBootstrapConfigMetadataResponseSchema.safeParse(body);\n if (!parsed.success || !parsed.data.jwt) {\n return null;\n }\n // Parse the exact producer contract rather than maintaining a second shape. In particular,\n // verification keys and their rotation cutoffs live under `jwt`; reading obsolete top-level\n // properties silently empties the companion's fresh-publication authority.\n return {\n ...parsed.data,\n jwt: {\n ...parsed.data.jwt,\n rotatedPublicKeys: parsed.data.jwt.rotatedPublicKeys ?? {},\n // Staged next keys (#2895): absent until a rotation stages one, as the backend's loader reads it.\n nextPublicKeys: parsed.data.jwt.nextPublicKeys ?? {},\n },\n };\n } catch (error) {\n // An answer that FAILED VERIFICATION is not \"apps-manager unreachable\": falling back to the local seed would hide a\n // forged or mis-keyed answer behind a working companion. Refuse it loudly instead (#2921).\n // By name as well as by class: an injected snapshot split into two module instances would make `instanceof` false\n // and silently turn a refusal into a fallback.\n if (error instanceof RuntimeResponseVerificationError || (error instanceof Error && error.name === 'RuntimeResponseVerificationError')) {\n throw error;\n }\n // Fail-soft: apps-manager unreachable, downstream uses local seed.\n return null;\n }\n}\n\n/**\n * Build the fully resolved application config used by existing companion\n * services after the companion API lane switches to the platform-style env\n * contract. The env now owns runtime topology + infra identity, while the app\n * still authors backend semantics through `backendConfig`.\n *\n * Now async because the bootstrap material (JWT TTLs, frontendServices,\n * appIdentity, engineCapabilities, providers, email flags) is fetched from\n * apps-manager — the same single source of truth that backend-api uses via\n * `AppConfigurationLoaderService`. Locally-derived values (saas-config,\n * env) are kept as fallback when apps-manager is unreachable.\n */\nexport async function buildCompanionResolvedAppConfig(input: {\n companionContext: CompanionContext;\n env: CompanionPlatformEnv;\n backendConfig?: AppConfiguration_BackendAuthored;\n providerRuntime?: SaasRuntimeProvidersArtifact;\n}): Promise<{\n boundaryBaseConfig: AppConfiguration;\n config: AppConfiguration;\n secrets: AppConfigurationSecrets;\n}> {\n const { companionContext, env, backendConfig, providerRuntime } = input;\n assertNoCompanionRuntimeManagedOverrides(backendConfig);\n\n // Fetch the canonical bootstrap material from apps-manager BEFORE building\n // the seed. Apps-manager is the single source of truth for the\n // operator-authored JWT TTLs, the app-declared frontendServices inventory,\n // and other bootstrap-material the companion would otherwise have to\n // synthesise locally (and drift away from what backend-api / other\n // consumers see). When apps-manager is unreachable the result is `null`\n // and the seed below falls back to companionContext + canonical defaults.\n const appsManagerMaterial = await fetchAppsManagerBootstrapMaterial(env);\n\n const mongoRuntime = resolveMongoRuntime(env);\n const runtimeEndpointsFromEnv = env.APPLICATION_RUNTIME_ENDPOINTS\n ? parseRuntimeEndpointsRecord(env.APPLICATION_RUNTIME_ENDPOINTS)\n : {};\n const preservedCompanionEndpoint = runtimeEndpointsFromEnv[env.SERVICE_NAME];\n /* This process's own address, published twice below: under its service name and as the backend\n * the frontends it serves must call. Derived once so the two cannot disagree. */\n const companionOwnEndpoint = {\n publicUrl: preservedCompanionEndpoint?.publicUrl ?? `http://localhost:${env.PORT}`,\n internalUrl: preservedCompanionEndpoint?.internalUrl ?? `http://localhost:${env.PORT}`,\n };\n\n /*\n * The workbench's own endpoint, DERIVED from this companion's port rather than configured.\n *\n * The engine's config inspector refuses a `frontendServices` entry with no matching\n * `runtime.endPoints` entry — measured, as a startup crash loop:\n * `frontendServices.application-creation-workbench is declared but\n * runtime.endPoints.application-creation-workbench is missing a matching public URL`. Declaring the\n * service without its endpoint is not a half-configuration the engine tolerates, and it is right\n * not to: a frontend the backend cannot address is not a frontend it serves.\n *\n * Derived because the pair is allocated as a pair: the workbench sits at the companion's port plus\n * the declared offset (`wildo local dev` starts it there), so reading it from configuration would\n * add a second place for the same fact to be stated and to drift.\n */\n const workbenchEndpointUrl = `http://localhost:${env.PORT + WORKBENCH_PORT_OFFSET_FROM_COMPANION}`;\n\n const runtimeEndpoints = {\n ...runtimeEndpointsFromEnv,\n [WORKBENCH_FRONTEND_SERVICE_NAME]: {\n publicUrl: workbenchEndpointUrl,\n internalUrl: workbenchEndpointUrl,\n },\n ...buildPlatformRuntimeEndpoints({\n appsManager: {\n publicUrl: env.PLATFORM_APPS_MANAGER_URL,\n internalUrl: env.PLATFORM_APPS_MANAGER_URL,\n },\n crontabsBatchesManager: {\n publicUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n internalUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n },\n moduleRegistry: {\n publicUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n internalUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n },\n }),\n appsManager: {\n publicUrl: env.PLATFORM_APPS_MANAGER_URL,\n internalUrl: env.PLATFORM_APPS_MANAGER_URL,\n },\n crontabsBatchesManager: {\n publicUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n internalUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n },\n moduleRegistry: {\n publicUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n internalUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n },\n [env.SERVICE_NAME]: {\n publicUrl: companionOwnEndpoint.publicUrl,\n internalUrl: companionOwnEndpoint.internalUrl,\n },\n /*\n * `main_backend_api` is the COMPANION, overriding the observed application's.\n *\n * `runtimeEndpointsFromEnv` is the whole application topology, and it names wonder-crm's backend\n * (`:4251`) under this key. Spreading it unchanged tells every frontend this companion serves —\n * the workbench — that ANOTHER APPLICATION'S backend is its own, which is not a cosmetic\n * mislabel: `AuthSessionContext` derives the realtime URL from this key and `FlowsActorsContext`\n * calls it with the caller's bearer token. Measured in the browser: the workbench opened a\n * socket at `http://localhost:4251` and retried forever behind a CORS wall, and only that wall\n * stopped its token reaching a backend that is not its own.\n *\n * The workbench's backend is this process — it is what serves `/api/v1` to it — so the honest\n * value is the companion's own endpoint, and it is the same one `[env.SERVICE_NAME]` above\n * publishes. Overriding rather than deleting keeps both frontend readers working (a missing key\n * makes each warn and skip), and it is placed AFTER the spread on purpose: the inherited value\n * must lose.\n */\n [BackendApiType.MAIN_BACKEND_API]: {\n publicUrl: companionOwnEndpoint.publicUrl,\n internalUrl: companionOwnEndpoint.internalUrl,\n },\n };\n\n const baseConfig = buildMinimalPreOverrideAppConfiguration({\n runtimeEndpoints,\n // Object-storage TOPOLOGY, and it is load-bearing: the companion runs the\n // app-tier `WildoManagedStorageProvider`, which reads its endpoint / bucket /\n // prefix from resolved configuration. Omitting this block makes the provider\n // report itself UNCONFIGURED, so `initializePlatformRuntimeDependencies()`\n // skips storage init and every companion file operation fails later with no\n // configuration error anywhere — a silent disabling, not a crash.\n // The derivation is the one the application loader and the platform services\n // use; see `buildStorageTopologyFromEnvironment`.\n storage: buildStorageTopologyFromEnvironment(env),\n database: {\n /*\n * The platform's adapter, from env — NOT a literal. This was\n * `PersistenceAdapter.MONGODB` from 2026-02-05 (when Mongo was the only adapter)\n * until 2026-08-28, and the PostgreSQL migration never enumerated the companion,\n * so the literal outlived the world that made it true. See issue #94.\n */\n // The parser returns the WIDER `PersistenceAdapterType` union (it also admits `http-api`),\n // while this configuration field is typed as the `PersistenceAdapter` enum. The values are\n // identical strings; the cast is the narrow bridge between the two spellings, kept at the\n // single field rather than casting the whole configuration object.\n defaultAdapter: parseDeclaredPersistenceAdapter(env.DATABASE_DEFAULT_ADAPTER) as PersistenceAdapter,\n // Each store carries its own availability; see `resolveMongoRuntime` for why the Mongo\n // block is present-but-disabled rather than absent on a PostgreSQL platform.\n mongodb: mongoRuntime.config,\n ...(env.PG_CONNECT_URL ? { postgresql: { enabled: true } } : {}),\n redis: {\n host: env.REDIS_HOST,\n port: env.REDIS_PORT,\n db: 0,\n },\n rabbitmq: {\n host: env.RABBITMQ_HOST,\n port: env.RABBITMQ_PORT,\n },\n },\n });\n\n // `frontendServices` inventory: prefer apps-manager (canonical, matches\n // what backend-api gets). Fall back to companionContext's SaaS-declared\n // inventory when apps-manager is unreachable, with empty-policy entries\n // so the engine's boundary inspector recognises every key that\n // `backendConfig` may later attach policy to.\n const seededFrontendServices: AppConfiguration['frontendServices'] = {\n ...(appsManagerMaterial?.frontendServices\n ?? Object.fromEntries(\n Object.keys(companionContext.frontendServices).map((serviceName) => [\n serviceName,\n { usersManagement: {} },\n ]),\n )),\n /*\n * The workbench is a frontend this companion SERVES, and it is not one of the application's\n * declared services — so neither source above can produce it.\n *\n * Without this entry `ApplicationConfigController` refuses the workbench's bootstrap with\n * `app_configuration_unknown_frontend_service`, and `ApplicationMainProvider` cannot mount at\n * all: the config fetch is phase four of ten and every provider sits behind it.\n *\n * ## `usersManagement` is DERIVED from the application's own frontend, not invented\n *\n * It was `{}` first, and an empty map is not a neutral default — it declares a surface that\n * manages no users, so the frontend never establishes a session and the shell logs the operator\n * straight back out after a successful password authentication.\n *\n * The workbench authenticates the SAME users, from the SAME database, as the application it\n * observes, so it declares the same users-management capability rather than a hand-written one\n * that can disagree with it. Registration is forced OFF: an operator surface signs EXISTING\n * administrators in, and must never be a place an account is created.\n *\n * Seeded LAST so it can never shadow an application service of the same name.\n */\n [WORKBENCH_FRONTEND_SERVICE_NAME]: buildWorkbenchFrontendServiceEntry(),\n };\n\n // `jwt` block: canonical source is apps-manager (operator-authored TTLs\n // in `wildo.infra.<env>.config.ts` → app registration → apps-manager\n // seed → bootstrap response). Local fallback uses the framework's\n // canonical defaults (15 min / 30 days from `WildoAuthConfigSchema`,\n // empty public-key maps) when apps-manager is unreachable — a missing\n // JWT block would otherwise break Zod validation of the final resolved\n // config.\n /*\n * Minted (or read back) before the JWT block is seeded, because BOTH halves must name the same\n * pair: the private key signs in `secrets`, the public key verifies in `config`. Seeding one from\n * apps-manager and the other locally would produce a token this process cannot verify.\n */\n const companionSigningKeyPair = ensureCompanionLocalSigningKeyPair(companionContext.saasRoot);\n const companionSymmetricMaterial = ensureCompanionLocalSymmetricMaterial(companionContext.saasRoot);\n\n const seededJwtSource: AppConfiguration['jwt'] = appsManagerMaterial?.jwt ?? {\n publicKey: {},\n rotatedPublicKeys: {},\n nextPublicKeys: {},\n accessTokenExpirationMinutes: 15,\n refreshTokenExpirationDays: 30,\n };\n\n /*\n * The companion's own public key, merged over whichever source supplied the rest of the block.\n *\n * Apps-manager owns the operator-authored TTLs and any application keys, and it must keep owning\n * them — but it has no key for a token this process signs. Merging rather than replacing keeps the\n * TTLs canonical while making the locally-signed token verifiable here.\n */\n const seededJwt: AppConfiguration['jwt'] = {\n ...seededJwtSource,\n publicKey: {\n ...seededJwtSource.publicKey,\n [CryptoKey_Purpose.APPLICATION_AUTH_TOKEN]: companionSigningKeyPair.publicKey,\n },\n };\n\n const seededConfig = {\n ...baseConfig,\n // Override HTTP server timeouts so long-running LLM-bound endpoints\n // (`/api/companion/labelling/labellize`, `.../translate`, email +\n // market generation) aren't killed by Node's default 5-minute\n // `requestTimeout`. The companion's labelling pipeline routinely\n // runs > 10 minutes when materializing a large app's labels via\n // OpenAI. The default is the right setting for production app\n // traffic — only the dev companion needs the longer ceiling.\n runtime: {\n ...baseConfig.runtime,\n httpServerConfiguration: {\n requestTimeout: 30 * 60_000,\n headersTimeout: 30 * 60_000,\n keepAliveTimeout: 30 * 60_000,\n },\n },\n frontendServices: seededFrontendServices,\n jwt: seededJwt,\n appIdentity: appsManagerMaterial?.appIdentity ?? {\n appName: companionContext.saasConfig.name,\n displayName: companionContext.saasConfig.displayName,\n description: companionContext.saasConfig.description,\n version: resolveCompanionVersion(companionContext),\n },\n engineCapabilities:\n appsManagerMaterial?.engineCapabilities\n ?? companionContext.saasConfig.engineCapabilities\n ?? {},\n providers: providerRuntime?.scope\n ? {\n scopes: { companion: providerRuntime.scope },\n // A runtime-provided scope replaces only WHAT VENDORS DO here; what the application OFFERS\n // (`connections`) is an application-level declaration and is carried through unchanged.\n connections:\n appsManagerMaterial?.providers?.connections\n ?? companionContext.saasConfig.providers?.connections\n ?? {},\n // Same standing as `connections`: an application-level declaration a runtime scope knows\n // nothing about (#367).\n browserOperations:\n appsManagerMaterial?.providers?.browserOperations\n ?? companionContext.saasConfig.providers?.browserOperations\n ?? {},\n // Same standing again (#1725): which refs spend one grant is an application-level declaration.\n sharedConnections:\n appsManagerMaterial?.providers?.sharedConnections\n ?? companionContext.saasConfig.providers?.sharedConnections,\n }\n : appsManagerMaterial?.providers\n ?? companionContext.saasConfig.providers\n ?? { scopes: {}, connections: {}, browserOperations: {} },\n // The stored copy is the ENVIRONMENT's configuration: `wildo.saas.config.ts` with this environment's\n // `infrastructure/<env>/wildo.infra.<env>.config.ts > providerConfigurations` laid over it when the CLI registered the\n // application. The fallback is the application layer ALONE — it carries no per-deployment identifier (an OAuth client\n // ID, a frontend SDK DSN) — so a companion running without an apps-manager copy sees none of those values.\n providerConfigurations:\n appsManagerMaterial?.providerConfigurations\n ?? companionContext.saasConfig.providerConfigurations\n ?? {},\n // Declared in `wildo.saas.config.ts` and no longer backend-authored (#1032), so without this the companion's\n // configuration carries none and the startup validator refuses it. The stored copy wins, as for its siblings.\n organizationTypes:\n appsManagerMaterial?.organizationTypes\n ?? companionContext.saasConfig.organizationTypes,\n /*\n * #1055 — and this site was SKIPPED when the carrier hops were enumerated, on the wrong axis.\n *\n * The reasoning was \"the companion does not READ a system of record, so D2 says backend-only\".\n * True and irrelevant: the companion REGISTERS RESOURCES, so it runs the registration arm, which\n * refuses a binding naming an instance it cannot see. With this absent the companion died at boot\n * with `Declared: none` on an application whose declaration was perfectly correct.\n *\n * The axis that decides a carrier hop is not who reads the VALUE — it is who parses the\n * CONFIGURATION that has to contain it.\n */\n systemsOfRecord:\n appsManagerMaterial?.systemsOfRecord\n ?? companionContext.saasConfig.systemsOfRecord,\n // #2722 — on the same axis: the companion parses the configuration, and startup validates the relationship kinds in it.\n organizationRelationships:\n appsManagerMaterial?.organizationRelationships\n ?? companionContext.saasConfig.organizationRelationships,\n email: {\n ...baseConfig.email,\n isTransactionalWildoManaged:\n appsManagerMaterial?.email?.isTransactionalWildoManaged ?? true,\n isMarketingWildoManaged:\n appsManagerMaterial?.email?.isMarketingWildoManaged ?? true,\n },\n };\n\n const resolvedConfig = applyBackendAuthoredConfig(\n seededConfig,\n backendConfig ?? {},\n ) as AppConfiguration;\n\n const now = new Date();\n const resolvedSecrets: AppConfigurationSecrets = {\n database: {\n // REQUIRED by the secrets contract even on a PostgreSQL platform, so it is always present\n // and simply carries no credentials when no Mongo URL was declared. The CONFIG half above\n // is the one that must stay absent — that is what keeps repositories from binding to a\n // connection this process never opened.\n mongodb: mongoRuntime.secrets,\n // The engine PostgreSQL service reads `secrets.database.postgresql.connectUrl` first.\n // With the pre-connect door this is belt-and-braces, but a post-close reconnect must\n // find the same identity here rather than an unconfigurable blank.\n ...(env.PG_CONNECT_URL\n ? {\n postgresql: {\n connectUrl: env.PG_CONNECT_URL,\n // Required by the secrets contract. Read from the URL that is the actual\n // connection identity, so the two can never disagree; 5432 only when the URL\n // omits it, which is what the driver itself would assume.\n port: Number(new URL(env.PG_CONNECT_URL).port || '5432'),\n },\n }\n : {}),\n redis: {\n username: env.REDIS_ADMIN_USER,\n password: env.REDIS_ADMIN_PASSWORD,\n },\n rabbitmq: {\n username: env.RABBITMQ_ADMIN_USERNAME,\n password: env.RABBITMQ_ADMIN_PASSWORD,\n },\n },\n security: {\n jwt: {\n /*\n * The companion's OWN signing key, so the workbench operator can actually be issued a token.\n *\n * This was `{}` by construction, which made authentication run to completion and then fail\n * with `jwt_token_not_found`. The key is generated and persisted locally — see\n * `ensureCompanionLocalSigningKeyPair` for why it is deliberately NOT the application's:\n * a token signed here is one the application backend refuses, which is the correct boundary\n * between \"looking at a companion\" and \"acting on the application it observes\".\n */\n privateKey: { [CryptoKey_Purpose.APPLICATION_AUTH_TOKEN]: companionSigningKeyPair.privateKey },\n },\n // The companion's own symmetric keys and session secrets (#2893), never derived from the application's credential.\n symmetricKeys: companionSymmetricMaterial.symmetricKeys,\n session: {\n secret: companionSymmetricMaterial.sessionSecret,\n encryptionKey: companionSymmetricMaterial.sessionEncryptionKey,\n },\n },\n createdAt: now,\n updatedAt: now,\n };\n\n return {\n boundaryBaseConfig: seededConfig as AppConfiguration,\n config: resolvedConfig,\n secrets: resolvedSecrets,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"companion-platform-config.companion.js","sourceRoot":"","sources":["../../../../../src/core/runtime/utils/companion-platform-config.companion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAIL,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,+BAA+B,EAC/B,uCAAuC,EACvC,mCAAmC,EACnC,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAsB,eAAe,EAC3E,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC;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O;YAC7B,sFAAsF;YACtF,qFAAqF;YACrF,mEAAmE;YACnE,GAAG,CAAC,GAAG,CAAC,cAAc;gBACpB,CAAC,CAAC;oBACA,UAAU,EAAE;wBACV,UAAU,EAAE,GAAG,CAAC,cAAc;wBAC9B,yEAAyE;wBACzE,6EAA6E;wBAC7E,0DAA0D;wBAC1D,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC;qBACzD;iBACF;gBACD,CAAC,CAAC,EAAE,CAAC;YACP,KAAK,EAAE;gBACL,QAAQ,EAAE,GAAG,CAAC,gBAAgB;gBAC9B,QAAQ,EAAE,GAAG,CAAC,oBAAoB;aACnC;YACD,QAAQ,EAAE;gBACR,QAAQ,EAAE,GAAG,CAAC,uBAAuB;gBACrC,QAAQ,EAAE,GAAG,CAAC,uBAAuB;aACtC;SACF;QACD,QAAQ,EAAE;YACR,GAAG,EAAE;gBACH;;;;;;;;mBAQG;gBACH,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,EAAE,uBAAuB,CAAC,UAAU,EAAE;aAC/F;YACD,mHAAmH;YACnH,aAAa,EAAE,0BAA0B,CAAC,aAAa;YACvD,OAAO,EAAE;gBACP,MAAM,EAAE,0BAA0B,CAAC,aAAa;gBAChD,aAAa,EAAE,0BAA0B,CAAC,oBAAoB;aAC/D;SACF;QACD,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,GAAG;KACf,CAAC;IAEF,OAAO;QACL,kBAAkB,EAAE,YAAgC;QACpD,MAAM,EAAE,cAAc;QACtB,OAAO,EAAE,eAAe;KACzB,CAAC;AACJ,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport {\n type AppConfiguration,\n type AppConfigurationSecrets,\n type AppConfiguration_BackendAuthored,\n MongoDBProtocol,\n applyBackendAuthoredConfig,\n readMongoConnectionStringCredentials,\n readMongoConnectionStringOption,\n readMongoConnectionStringTarget,\n buildMinimalPreOverrideAppConfiguration,\n buildStorageTopologyFromEnvironment,\n fetchVerifiedAppsManagerJson,\n} from '@wildo-ai/saas-backend-lib';\nimport { parseDeclaredPersistenceAdapter, PersistenceAdapter, WildoHeaderKeys,\n BackendApiType,\n} from '@wildo-ai/saas-models';\nimport {\n buildPlatformRuntimeEndpoints,\n parseRuntimeEndpointsRecord,\n} from '@wildo-ai/platform-core-shared';\nimport {\n AppBootstrapConfigMetadataResponseSchema,\n DEVELOPMENT_COMPANION_PRINCIPAL,\n parseRuntimeResponseVerificationKeySet,\n RuntimeResponseVerificationError,\n type AppBootstrapConfigMetadataResponse,\n missingSelectedPlatformStoreUrlKey,\n PlatformInfrastructureEnvKeys,\n resolvePlatformMongoPreconnectUrl,\n type SaasRuntimeProvidersArtifact,\n} from '@wildo-ai/platform-config-lib';\nimport { z } from 'zod';\nimport type { CompanionContext } from '../../context/companion-context';\nimport type { CompanionRuntimeConfig } from '../models/companion-runtime.models';\nimport { CompanionTraceabilityLevel } from '../../traceability/companion-traceability.models';\nimport { WORKBENCH_FRONTEND_SERVICE_NAME } from '@wildo-ai/platform-core-shared';\nimport { WORKBENCH_PORT_OFFSET_FROM_COMPANION } from './companion-workbench-topology';\nimport { ensureCompanionLocalSigningKeyPair, ensureCompanionLocalSymmetricMaterial } from './companion-local-signing-key.companion';\nimport { CryptoKey_Purpose } from '@wildo-ai/saas-models';\n\n// semantic-literal-boundary: 'true'/'false' is the process-env string encoding of a boolean, translated to a real boolean right here at the env boundary — not a domain vocabulary.\nconst booleanStringSchema = z.enum(['true', 'false']).transform((value) => value === 'true');\nconst CompanionTraceabilityLevelSchema = z.enum(CompanionTraceabilityLevel);\n\n/**\n * An optional env value where the EMPTY STRING means absent. Docker Compose interpolates an\n * unset variable to `''` rather than omitting the key, so a plain `.optional()` would hand\n * `''` to `new URL()` and to the adapter parser.\n */\nconst OptionalPlatformStoreUrlSchema = z\n .string()\n .optional()\n .transform((value) => (value === undefined || value.trim() === '' ? undefined : value));\n\nconst CompanionPlatformEnvSchema = z.object({\n APPLICATION_ID: z.string().min(1),\n SERVICE_NAME: z.string().min(1),\n PLATFORM_ENVIRONMENT_ID: z.string().min(1),\n /**\n * The COMPANION's own bootstrap secret (#2941), not the application backend's. The variable keeps the name every\n * runtime reads (as a minion's and a worker's do); only the value differs. apps-manager mints it on a development\n * platform and resolves it to the `development_companion` principal, which it admits on `application-config` and the\n * storage session only, and which the signing and data-key proxies refuse.\n */\n PLATFORM_APPLICATION_PRIMARY_SECRET: z.string().min(1),\n PLATFORM_APPS_MANAGER_URL: z.url(),\n /** #2921 — the companion verifies apps-manager's answers like every other application runtime. */\n PLATFORM_APPS_MANAGER_RESPONSE_VERIFICATION_KEYS: z.string().min(1),\n PLATFORM_CRONTABS_BATCHES_MANAGER_URL: z.url(),\n PLATFORM_MODULE_REGISTRY_URL: z.url(),\n APPLICATION_ENV: z.string().min(1),\n /**\n * The platform's stores. BOTH are optional and AT LEAST ONE must be present — the\n * pair rules below are what enforce that, and they live on the schema rather than at\n * a call site so every consumer of `parseCompanionPlatformEnv` inherits them.\n *\n * `MONGO_CONNECT_URL` was REQUIRED until 2026-08-28, which is what made the companion\n * unable to run on a PostgreSQL-engined platform at all (issue #94): it connected Mongo\n * unconditionally, read platform rows from a database the platform had stopped using,\n * and reported every application as unregistered. Absence now means \"not MongoDB-engined\".\n *\n * Empty string counts as absent — the compose interpolation contract, the same reading\n * apps-manager and module-registry use for these two keys.\n */\n MONGO_CONNECT_URL: OptionalPlatformStoreUrlSchema,\n PG_CONNECT_URL: OptionalPlatformStoreUrlSchema,\n /**\n * Which store the platform's own data lives in. Parsed through the shared seam, so a\n * present-but-unknown declaration REFUSES rather than collapsing into the Mongo lane.\n *\n * semantic-literal-boundary: the canonical name is\n * `ApplicationBackendDataEnvKey.DATABASE_DEFAULT_ADAPTER` (platform-core-shared), which\n * this package does not depend on; the CLI emits the key from that enum.\n */\n DATABASE_DEFAULT_ADAPTER: OptionalPlatformStoreUrlSchema,\n REDIS_HOST: z.string().min(1),\n REDIS_PORT: z.coerce.number().int().positive(),\n REDIS_ADMIN_USER: z.string().min(1).optional(),\n REDIS_ADMIN_PASSWORD: z.string().min(1).optional(),\n // Optional (#2303 slice D): an environment whose service profile runs no broker emits no RabbitMQ keys, and the\n // companion never connects to the broker either way (it runs no queue workers).\n RABBITMQ_HOST: z.string().min(1).optional(),\n RABBITMQ_PORT: z.coerce.number().int().positive().optional(),\n RABBITMQ_ADMIN_USERNAME: z.string().min(1).optional(),\n RABBITMQ_ADMIN_PASSWORD: z.string().min(1).optional(),\n STORAGE_PROVIDER: z.string().min(1).optional(),\n STORAGE_ENDPOINT: z.string().min(1).optional(),\n STORAGE_PORT: z.coerce.number().int().positive().optional(),\n STORAGE_USE_SSL: z.union([z.boolean(), booleanStringSchema]).transform((value) => value === true).optional(),\n STORAGE_BUCKET: z.string().min(1).optional(),\n // ⚠️ NO `STORAGE_ACCESS_KEY` / `STORAGE_SECRET_KEY`. Those are the object store's\n // ROOT credential, and the companion never consumed them — it runs the same\n // app-tier storage provider as backend-api, which fetches short-lived,\n // prefix-confined STS sessions from apps-manager using the bootstrap contract\n // above. Declaring them here would let the CLI start emitting them again without\n // anything noticing, since an unused declaration reads exactly like a used one.\n HOST: z.string().min(1).default('0.0.0.0'),\n PORT: z.coerce.number().int().positive(),\n APPLICATION_RUNTIME_ENDPOINTS: z.string().optional(),\n})\n /**\n * The two store rules, on the SCHEMA so they cannot be bypassed by a consumer that parses\n * the env itself. Both are refusals at the door: the alternative is a companion that boots,\n * connects nothing usable, and then reports every platform row as missing for the rest of\n * the process lifetime — which is exactly how issue #94 presented, and why it was diagnosed\n * as an uninitialized platform rather than a wrong connection.\n */\n .superRefine((env, ctx) => {\n if (env.MONGO_CONNECT_URL === undefined && env.PG_CONNECT_URL === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['MONGO_CONNECT_URL'],\n message:\n 'The companion needs a platform store: set MONGO_CONNECT_URL or PG_CONNECT_URL. '\n + 'Re-run `wildo config sync` to regenerate the companion environment.',\n });\n }\n // The pair rule for BOTH stores, the one decision module-registry, apps-manager (both modes) and its env schema\n // make (`missingSelectedPlatformStoreUrlKey`). A declared PostgreSQL platform without its URL dies later inside a\n // repository read with an unsatisfiable message. A MongoDB platform (declaration absent or `mongodb`) without its\n // URL is worse (#1117): its Mongo block is written disabled at a `.invalid` host, readiness then owes no MongoDB\n // check, and the companion reports ready while every platform-row read fails on use, the #94 shape.\n const missingSelectedStoreUrl = missingSelectedPlatformStoreUrlKey({\n mongoConnectUrl: env.MONGO_CONNECT_URL,\n pgConnectUrl: env.PG_CONNECT_URL,\n declaredDefaultAdapter: env.DATABASE_DEFAULT_ADAPTER,\n });\n if (missingSelectedStoreUrl === PlatformInfrastructureEnvKeys.MONGO_CONNECT_URL\n && env.PG_CONNECT_URL !== undefined) {\n // With neither URL the rule above already names both; this one is for a PostgreSQL URL under a MongoDB selection.\n ctx.addIssue({\n code: 'custom',\n path: ['MONGO_CONNECT_URL'],\n message:\n 'A MongoDB platform (DATABASE_DEFAULT_ADAPTER absent or mongodb) requires MONGO_CONNECT_URL: the companion '\n + 'reads the platform rows through MongoDB. Re-run `wildo config sync`, or declare '\n + 'DATABASE_DEFAULT_ADAPTER=postgresql.',\n });\n }\n if (missingSelectedStoreUrl === PlatformInfrastructureEnvKeys.PG_CONNECT_URL) {\n ctx.addIssue({\n code: 'custom',\n path: ['PG_CONNECT_URL'],\n message:\n 'DATABASE_DEFAULT_ADAPTER=postgresql requires PG_CONNECT_URL: the companion pre-connects '\n + 'its own PostgreSQL from env before any repository is constructed. '\n + 'Re-run `wildo config sync`.',\n });\n }\n });\n\nexport type CompanionPlatformEnv = z.infer<typeof CompanionPlatformEnvSchema>;\n\n\n/**\n * The workbench's frontend-service entry.\n *\n * ## `usersManagement` is EMPTY on purpose, and the reason is not \"nothing to manage\"\n *\n * It reads as a placeholder and is a decision. `resolveUserTypeFromFrontendServiceName` derives the\n * session's `activeUserType` from this map, and the orchestrator then requires the authenticating\n * user's `userTypes[]` to contain it. Declaring the APPLICATION's user type here — which is what an\n * application frontend does, and what this entry briefly did — makes every workbench login fail with\n * `authentication_user_type_mismatch`.\n *\n * It fails because the companion authenticates against a DIFFERENT DATABASE than the application.\n * Measured on the dogfood stack, where one email exists twice:\n *\n * wildo_platform → userTypes: [] ← the identity the companion resolves\n * wonder-crm-db → userTypes: [\"member\"] ← the application's own user\n *\n * So the application's user-type vocabulary is not the companion's to assert. An empty map leaves\n * `activeUserType` unset, the type gate is skipped, and the operator is authenticated as the platform\n * identity they actually are.\n *\n * The entry must still EXIST — without the key, `ApplicationConfigController` refuses the bootstrap\n * with `app_configuration_unknown_frontend_service` and no provider mounts at all.\n *\n * If the companion ever authenticates application users, this becomes a real decision rather than an\n * omission: it would need the user types of whichever store it resolves identities from.\n */\nfunction buildWorkbenchFrontendServiceEntry(): AppConfiguration['frontendServices'][string] {\n return { usersManagement: {} };\n}\n\nfunction assertNoCompanionRuntimeManagedOverrides(\n backendConfig: AppConfiguration_BackendAuthored | undefined,\n): void {\n if (!backendConfig) {\n return;\n }\n\n const forbiddenKeys = ['providers', 'providerConfigurations'];\n const authoredForbiddenKeys = forbiddenKeys.filter((key) =>\n Object.prototype.hasOwnProperty.call(backendConfig, key),\n );\n if (authoredForbiddenKeys.length === 0) {\n return;\n }\n\n throw new Error(\n `Companion backendConfig attempted to override runtime-managed fields: ${authoredForbiddenKeys.join(', ')}`,\n );\n}\n\nfunction resolveCompanionVersion(companionContext: CompanionContext): string {\n const candidateServices = [\n ...Object.values(companionContext.backendServices),\n ...Object.values(companionContext.frontendServices),\n ];\n\n for (const service of candidateServices) {\n const packageJsonPath = resolve(companionContext.saasRoot, service.path, 'package.json');\n if (!existsSync(packageJsonPath)) {\n continue;\n }\n\n try {\n const parsed = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as { version?: unknown };\n if (typeof parsed.version === 'string' && parsed.version.trim()) {\n return parsed.version.trim();\n }\n } catch {\n // Fall through to the next candidate.\n }\n }\n\n return '1.0.0';\n}\n\n/**\n * On a platform with no MongoDB URL — a PostgreSQL-engined platform — this returns a\n * DISABLED block rather than a connected one.\n *\n * `enabled: false` is the contract's way of saying \"this store is not available here\":\n * `getDb()` refuses on it, so a Mongo-resolved repository fails with that answer instead\n * of binding to a connection this process never opened and failing at first use. The\n * configuration type requires the key, so omitting it is not available; declaring it\n * `enabled: true` unconditionally is the silent shape module-registry records paying for.\n */\nfunction resolveMongoRuntime(\n env: CompanionPlatformEnv,\n): {\n config: AppConfiguration['database']['mongodb'];\n secrets: AppConfigurationSecrets['database']['mongodb'];\n} {\n if (env.MONGO_CONNECT_URL === undefined) {\n return {\n config: {\n enabled: false,\n /*\n * The runtime schema requires a non-empty host and database name even on a disabled\n * block, so SOMETHING must go here — and the choice matters. A plausible default\n * (`localhost:27017`, `wildo_platform`) would mean that anything ignoring\n * `enabled: false` connects to whatever Mongo happens to be running on the machine and\n * silently reads an empty database, which is the exact failure this whole change exists\n * to remove. `.invalid` is reserved precisely so it can never resolve, so the same\n * mistake fails immediately and names its own cause.\n *\n * spec-cite: RFC 2606 §2 reserves the `.invalid` TLD for names that are \"clearly invalid\"\n * and guaranteed not to resolve in the global DNS.\n */\n host: 'mongodb-not-configured.invalid:27017',\n database: 'mongodb-not-configured',\n protocol: MongoDBProtocol.MONGODB,\n options: { retryWrites: false, w: 'majority', authSource: 'admin' },\n },\n secrets: {},\n };\n }\n /*\n * Read with the MongoDB connection-string grammar the CLI and apps-manager share (#2000 review), never\n * `new URL(...)`: on an Atlas platform this is the authored `externalEndpoints.mongodb.connectionUrl`, and for a\n * cluster with no SRV address that is a comma-separated seed list, which WHATWG URL parsing rejects\n * (`ERR_INVALID_URL`). The seed list's TLS and replica set are carried too, or the platform store is opened without\n * the TLS Atlas requires.\n */\n const connectUrl = env.MONGO_CONNECT_URL;\n const target = readMongoConnectionStringTarget(connectUrl);\n const credentials = readMongoConnectionStringCredentials(connectUrl);\n if (!target || !credentials) {\n throw new Error(\n 'MONGO_CONNECT_URL is not a MongoDB connection string with a host '\n + '(expected `mongodb://host[:port][,host[:port]…]/…` or `mongodb+srv://host/…`).',\n );\n }\n const directConnection = readMongoConnectionStringOption(connectUrl, 'directConnection');\n\n return {\n config: {\n enabled: true,\n host: target.hosts,\n database: target.database || 'wildo_platform',\n protocol: target.protocol,\n options: {\n retryWrites: readMongoConnectionStringOption(connectUrl, 'retryWrites') !== 'false',\n w: readMongoConnectionStringOption(connectUrl, 'w') ?? 'majority',\n authSource: readMongoConnectionStringOption(connectUrl, 'authSource') ?? 'admin',\n // Case-insensitive, as the grammar reads every connection-string boolean.\n ...(directConnection !== undefined ? { directConnection: directConnection.toLowerCase() === 'true' } : {}),\n ...(target.tls !== undefined ? { tls: target.tls } : {}),\n ...(target.replicaSet ? { replicaSet: target.replicaSet } : {}),\n },\n },\n secrets: {\n username: credentials.username,\n password: credentials.password,\n },\n };\n}\n\n/**\n * Which platform stores this environment says to connect, and with what.\n *\n * Extracted as a pure function because it is the decision issue #94 got wrong, and because\n * the startup service that executes it has ~15 injected dependencies and no unit test — so\n * left inline, the single most load-bearing branch of the fix was pinned by nothing. A\n * mutation that removed the PostgreSQL pre-connect entirely passed the whole suite.\n *\n * The startup service is now a trivial executor of this plan. Keep it that way: a branch\n * added there instead of here is a branch nothing can test.\n */\nexport interface CompanionPlatformStoreConnectionPlan {\n /**\n * Present only when MongoDB may be this platform's store: a URL is supplied AND the declared\n * adapter is not PostgreSQL (absent keeps the framework's Mongo default, so the dual-store\n * mid-flip state still opens both).\n */\n readonly mongoConnectUrl: string | undefined;\n /** Present only when this environment declares a PostgreSQL platform store. */\n readonly postgresConnectUrl: string | undefined;\n}\n\n/**\n * The Mongo half is the shared platform decision `resolvePlatformMongoPreconnectUrl`: gated on the\n * declared SELECTION, never on the address, so an application-side mongod outage cannot take the\n * companion down with it. The Mongo runtime block (`resolveMongoRuntime`) stays enabled when a URL\n * is present, so a resource that did resolve MongoDB would still connect on demand; none does today.\n */\nexport function planCompanionPlatformStoreConnections(\n env: CompanionPlatformEnv,\n): CompanionPlatformStoreConnectionPlan {\n return {\n mongoConnectUrl: resolvePlatformMongoPreconnectUrl({\n mongoConnectUrl: env.MONGO_CONNECT_URL,\n declaredDefaultAdapter: env.DATABASE_DEFAULT_ADAPTER,\n }),\n postgresConnectUrl: env.PG_CONNECT_URL,\n };\n}\n\nexport function parseCompanionPlatformEnv(\n source: NodeJS.ProcessEnv = process.env,\n): CompanionPlatformEnv {\n return CompanionPlatformEnvSchema.parse(source);\n}\n\nexport function resolveCompanionRuntimeConfig(\n source: NodeJS.ProcessEnv = process.env,\n): CompanionRuntimeConfig {\n const rawTraceabilityLevel = source.WILDO_DEV_COMPANION_TRACEABILITY_LEVEL;\n const normalizedTraceabilityLevel = rawTraceabilityLevel?.trim().toUpperCase();\n\n if (!normalizedTraceabilityLevel) {\n // ALWAYS-ON by default: the companion is a DEV-ONLY daemon whose whole\n // point is inspectable build-time work — a fresh checkout should leave\n // prompt/output artifacts for every agent call without anyone knowing a\n // magic env var. The old `NONE` default meant every derivation/deliberation\n // ran traceless unless the operator remembered to export the level (the\n // recurring \"why are there no trace rows?\" trap). The env var remains the\n // override for turning it DOWN (`NONE` / `DEBUG`) when disk noise matters.\n return {\n traceabilityLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n };\n }\n\n const parsedTraceabilityLevel = CompanionTraceabilityLevelSchema.safeParse(normalizedTraceabilityLevel);\n if (!parsedTraceabilityLevel.success) {\n const acceptedValues = Object.values(CompanionTraceabilityLevel).join(', ');\n throw new Error(\n `Invalid WILDO_DEV_COMPANION_TRACEABILITY_LEVEL \"${rawTraceabilityLevel}\". ` +\n `Accepted values: ${acceptedValues}.`,\n );\n }\n\n return {\n traceabilityLevel: parsedTraceabilityLevel.data,\n };\n}\n\n/**\n * Bootstrap material fetched from apps-manager — the authoritative source for\n * everything the operator authors in `wildo.infra.<env>.config.ts` and the\n * app declares in `wildo.saas.config.ts`. The companion fetches the SAME\n * payload that `AppConfigurationLoaderService.initialize()` fetches for\n * app backends (and the SAME `/apps-to-manager/application-config` route),\n * authenticated by the companion's OWN runtime-principal secret (#2941), which it carries in\n * its env. This is what aligns the companion with the canonical bootstrap:\n * the parallel-path single-source-of-truth was an artefact of an earlier\n * design; now the companion derives JWT TTLs, frontendServices inventory,\n * appIdentity, engineCapabilities, providers, and email-management flags\n * from apps-manager instead of synthesising them locally.\n *\n * Returns `null` if apps-manager is unreachable or returns an unrecognised\n * payload — callers fall back to the locally-derived seed in that case.\n */\ntype AppsManagerBootstrapMaterial = Omit<AppBootstrapConfigMetadataResponse, 'jwt'> & { readonly jwt: AppConfiguration['jwt'] };\n\nasync function fetchAppsManagerBootstrapMaterial(\n env: CompanionPlatformEnv,\n): Promise<AppsManagerBootstrapMaterial | null> {\n // Parsed OUTSIDE the fail-soft `try`: a malformed key set is a configuration error to refuse, never a reason to fall\n // back silently to the local seed (#2921).\n const verificationKeys = parseRuntimeResponseVerificationKeySet(env.PLATFORM_APPS_MANAGER_RESPONSE_VERIFICATION_KEYS);\n try {\n const url = `${env.PLATFORM_APPS_MANAGER_URL}/api/v1/apps-to-manager/application-config`;\n // #2921 — verified before anything reads it: signed by apps-manager, for this application and the companion's own\n // principal (#2941: it presents its own secret, never the backend's), echoing this request's nonce.\n const { response, body } = await fetchVerifiedAppsManagerJson(\n url,\n {\n method: 'GET',\n headers: {\n [WildoHeaderKeys.CONTENT_TYPE]: 'application/json',\n [WildoHeaderKeys.SERVICE_ID]: env.SERVICE_NAME,\n [WildoHeaderKeys.PLATFORM_SECRET]: env.PLATFORM_APPLICATION_PRIMARY_SECRET,\n [WildoHeaderKeys.APPLICATION_ID]: env.APPLICATION_ID,\n },\n signal: AbortSignal.timeout(10_000),\n },\n {\n keys: verificationKeys,\n applicationId: env.APPLICATION_ID,\n principal: DEVELOPMENT_COMPANION_PRINCIPAL,\n },\n );\n\n if (!response.ok) {\n return null;\n }\n\n const parsed = AppBootstrapConfigMetadataResponseSchema.safeParse(body);\n if (!parsed.success || !parsed.data.jwt) {\n return null;\n }\n // Parse the exact producer contract rather than maintaining a second shape. In particular,\n // verification keys and their rotation cutoffs live under `jwt`; reading obsolete top-level\n // properties silently empties the companion's fresh-publication authority.\n return {\n ...parsed.data,\n jwt: {\n ...parsed.data.jwt,\n rotatedPublicKeys: parsed.data.jwt.rotatedPublicKeys ?? {},\n // Staged next keys (#2895): absent until a rotation stages one, as the backend's loader reads it.\n nextPublicKeys: parsed.data.jwt.nextPublicKeys ?? {},\n },\n };\n } catch (error) {\n // An answer that FAILED VERIFICATION is not \"apps-manager unreachable\": falling back to the local seed would hide a\n // forged or mis-keyed answer behind a working companion. Refuse it loudly instead (#2921).\n // By name as well as by class: an injected snapshot split into two module instances would make `instanceof` false\n // and silently turn a refusal into a fallback.\n if (error instanceof RuntimeResponseVerificationError || (error instanceof Error && error.name === 'RuntimeResponseVerificationError')) {\n throw error;\n }\n // Fail-soft: apps-manager unreachable, downstream uses local seed.\n return null;\n }\n}\n\n/**\n * Build the fully resolved application config used by existing companion\n * services after the companion API lane switches to the platform-style env\n * contract. The env now owns runtime topology + infra identity, while the app\n * still authors backend semantics through `backendConfig`.\n *\n * Now async because the bootstrap material (JWT TTLs, frontendServices,\n * appIdentity, engineCapabilities, providers, email flags) is fetched from\n * apps-manager — the same single source of truth that backend-api uses via\n * `AppConfigurationLoaderService`. Locally-derived values (saas-config,\n * env) are kept as fallback when apps-manager is unreachable.\n */\nexport async function buildCompanionResolvedAppConfig(input: {\n companionContext: CompanionContext;\n env: CompanionPlatformEnv;\n backendConfig?: AppConfiguration_BackendAuthored;\n providerRuntime?: SaasRuntimeProvidersArtifact;\n}): Promise<{\n boundaryBaseConfig: AppConfiguration;\n config: AppConfiguration;\n secrets: AppConfigurationSecrets;\n}> {\n const { companionContext, env, backendConfig, providerRuntime } = input;\n assertNoCompanionRuntimeManagedOverrides(backendConfig);\n\n // Fetch the canonical bootstrap material from apps-manager BEFORE building\n // the seed. Apps-manager is the single source of truth for the\n // operator-authored JWT TTLs, the app-declared frontendServices inventory,\n // and other bootstrap-material the companion would otherwise have to\n // synthesise locally (and drift away from what backend-api / other\n // consumers see). When apps-manager is unreachable the result is `null`\n // and the seed below falls back to companionContext + canonical defaults.\n const appsManagerMaterial = await fetchAppsManagerBootstrapMaterial(env);\n\n const mongoRuntime = resolveMongoRuntime(env);\n const runtimeEndpointsFromEnv = env.APPLICATION_RUNTIME_ENDPOINTS\n ? parseRuntimeEndpointsRecord(env.APPLICATION_RUNTIME_ENDPOINTS)\n : {};\n const preservedCompanionEndpoint = runtimeEndpointsFromEnv[env.SERVICE_NAME];\n /* This process's own address, published twice below: under its service name and as the backend\n * the frontends it serves must call. Derived once so the two cannot disagree. */\n const companionOwnEndpoint = {\n publicUrl: preservedCompanionEndpoint?.publicUrl ?? `http://localhost:${env.PORT}`,\n internalUrl: preservedCompanionEndpoint?.internalUrl ?? `http://localhost:${env.PORT}`,\n };\n\n /*\n * The workbench's own endpoint, DERIVED from this companion's port rather than configured.\n *\n * The engine's config inspector refuses a `frontendServices` entry with no matching\n * `runtime.endPoints` entry — measured, as a startup crash loop:\n * `frontendServices.application-creation-workbench is declared but\n * runtime.endPoints.application-creation-workbench is missing a matching public URL`. Declaring the\n * service without its endpoint is not a half-configuration the engine tolerates, and it is right\n * not to: a frontend the backend cannot address is not a frontend it serves.\n *\n * Derived because the pair is allocated as a pair: the workbench sits at the companion's port plus\n * the declared offset (`wildo local dev` starts it there), so reading it from configuration would\n * add a second place for the same fact to be stated and to drift.\n */\n const workbenchEndpointUrl = `http://localhost:${env.PORT + WORKBENCH_PORT_OFFSET_FROM_COMPANION}`;\n\n const runtimeEndpoints = {\n ...runtimeEndpointsFromEnv,\n [WORKBENCH_FRONTEND_SERVICE_NAME]: {\n publicUrl: workbenchEndpointUrl,\n internalUrl: workbenchEndpointUrl,\n },\n ...buildPlatformRuntimeEndpoints({\n appsManager: {\n publicUrl: env.PLATFORM_APPS_MANAGER_URL,\n internalUrl: env.PLATFORM_APPS_MANAGER_URL,\n },\n crontabsBatchesManager: {\n publicUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n internalUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n },\n moduleRegistry: {\n publicUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n internalUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n },\n }),\n appsManager: {\n publicUrl: env.PLATFORM_APPS_MANAGER_URL,\n internalUrl: env.PLATFORM_APPS_MANAGER_URL,\n },\n crontabsBatchesManager: {\n publicUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n internalUrl: env.PLATFORM_CRONTABS_BATCHES_MANAGER_URL,\n },\n moduleRegistry: {\n publicUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n internalUrl: env.PLATFORM_MODULE_REGISTRY_URL,\n },\n [env.SERVICE_NAME]: {\n publicUrl: companionOwnEndpoint.publicUrl,\n internalUrl: companionOwnEndpoint.internalUrl,\n },\n /*\n * `main_backend_api` is the COMPANION, overriding the observed application's.\n *\n * `runtimeEndpointsFromEnv` is the whole application topology, and it names wonder-crm's backend\n * (`:4251`) under this key. Spreading it unchanged tells every frontend this companion serves —\n * the workbench — that ANOTHER APPLICATION'S backend is its own, which is not a cosmetic\n * mislabel: `AuthSessionContext` derives the realtime URL from this key and `FlowsActorsContext`\n * calls it with the caller's bearer token. Measured in the browser: the workbench opened a\n * socket at `http://localhost:4251` and retried forever behind a CORS wall, and only that wall\n * stopped its token reaching a backend that is not its own.\n *\n * The workbench's backend is this process — it is what serves `/api/v1` to it — so the honest\n * value is the companion's own endpoint, and it is the same one `[env.SERVICE_NAME]` above\n * publishes. Overriding rather than deleting keeps both frontend readers working (a missing key\n * makes each warn and skip), and it is placed AFTER the spread on purpose: the inherited value\n * must lose.\n */\n [BackendApiType.MAIN_BACKEND_API]: {\n publicUrl: companionOwnEndpoint.publicUrl,\n internalUrl: companionOwnEndpoint.internalUrl,\n },\n };\n\n const baseConfig = buildMinimalPreOverrideAppConfiguration({\n runtimeEndpoints,\n // Object-storage TOPOLOGY, and it is load-bearing: the companion runs the\n // app-tier `WildoManagedStorageProvider`, which reads its endpoint / bucket /\n // prefix from resolved configuration. Omitting this block makes the provider\n // report itself UNCONFIGURED, so `initializePlatformRuntimeDependencies()`\n // skips storage init and every companion file operation fails later with no\n // configuration error anywhere — a silent disabling, not a crash.\n // The derivation is the one the application loader and the platform services\n // use; see `buildStorageTopologyFromEnvironment`.\n storage: buildStorageTopologyFromEnvironment(env),\n database: {\n /*\n * The platform's adapter, from env — NOT a literal. This was\n * `PersistenceAdapter.MONGODB` from 2026-02-05 (when Mongo was the only adapter)\n * until 2026-08-28, and the PostgreSQL migration never enumerated the companion,\n * so the literal outlived the world that made it true. See issue #94.\n */\n // The parser returns the WIDER `PersistenceAdapterType` union (it also admits `http-api`),\n // while this configuration field is typed as the `PersistenceAdapter` enum. The values are\n // identical strings; the cast is the narrow bridge between the two spellings, kept at the\n // single field rather than casting the whole configuration object.\n defaultAdapter: parseDeclaredPersistenceAdapter(env.DATABASE_DEFAULT_ADAPTER) as PersistenceAdapter,\n // Each store carries its own availability; see `resolveMongoRuntime` for why the Mongo\n // block is present-but-disabled rather than absent on a PostgreSQL platform.\n mongodb: mongoRuntime.config,\n ...(env.PG_CONNECT_URL ? { postgresql: { enabled: true } } : {}),\n redis: {\n host: env.REDIS_HOST,\n port: env.REDIS_PORT,\n db: 0,\n },\n // Only when the environment runs a broker (#2303 slice D); the `database.rabbitmq` config branch is optional.\n ...(env.RABBITMQ_HOST && env.RABBITMQ_PORT ? { rabbitmq: { host: env.RABBITMQ_HOST, port: env.RABBITMQ_PORT } } : {}),\n },\n });\n\n // `frontendServices` inventory: prefer apps-manager (canonical, matches\n // what backend-api gets). Fall back to companionContext's SaaS-declared\n // inventory when apps-manager is unreachable, with empty-policy entries\n // so the engine's boundary inspector recognises every key that\n // `backendConfig` may later attach policy to.\n const seededFrontendServices: AppConfiguration['frontendServices'] = {\n ...(appsManagerMaterial?.frontendServices\n ?? Object.fromEntries(\n Object.keys(companionContext.frontendServices).map((serviceName) => [\n serviceName,\n { usersManagement: {} },\n ]),\n )),\n /*\n * The workbench is a frontend this companion SERVES, and it is not one of the application's\n * declared services — so neither source above can produce it.\n *\n * Without this entry `ApplicationConfigController` refuses the workbench's bootstrap with\n * `app_configuration_unknown_frontend_service`, and `ApplicationMainProvider` cannot mount at\n * all: the config fetch is phase four of ten and every provider sits behind it.\n *\n * ## `usersManagement` is DERIVED from the application's own frontend, not invented\n *\n * It was `{}` first, and an empty map is not a neutral default — it declares a surface that\n * manages no users, so the frontend never establishes a session and the shell logs the operator\n * straight back out after a successful password authentication.\n *\n * The workbench authenticates the SAME users, from the SAME database, as the application it\n * observes, so it declares the same users-management capability rather than a hand-written one\n * that can disagree with it. Registration is forced OFF: an operator surface signs EXISTING\n * administrators in, and must never be a place an account is created.\n *\n * Seeded LAST so it can never shadow an application service of the same name.\n */\n [WORKBENCH_FRONTEND_SERVICE_NAME]: buildWorkbenchFrontendServiceEntry(),\n };\n\n // `jwt` block: canonical source is apps-manager (operator-authored TTLs\n // in `wildo.infra.<env>.config.ts` → app registration → apps-manager\n // seed → bootstrap response). Local fallback uses the framework's\n // canonical defaults (15 min / 30 days from `WildoAuthConfigSchema`,\n // empty public-key maps) when apps-manager is unreachable — a missing\n // JWT block would otherwise break Zod validation of the final resolved\n // config.\n /*\n * Minted (or read back) before the JWT block is seeded, because BOTH halves must name the same\n * pair: the private key signs in `secrets`, the public key verifies in `config`. Seeding one from\n * apps-manager and the other locally would produce a token this process cannot verify.\n */\n const companionSigningKeyPair = ensureCompanionLocalSigningKeyPair(companionContext.saasRoot);\n const companionSymmetricMaterial = ensureCompanionLocalSymmetricMaterial(companionContext.saasRoot);\n\n const seededJwtSource: AppConfiguration['jwt'] = appsManagerMaterial?.jwt ?? {\n publicKey: {},\n rotatedPublicKeys: {},\n nextPublicKeys: {},\n accessTokenExpirationMinutes: 15,\n refreshTokenExpirationDays: 30,\n };\n\n /*\n * The companion's own public key, merged over whichever source supplied the rest of the block.\n *\n * Apps-manager owns the operator-authored TTLs and any application keys, and it must keep owning\n * them — but it has no key for a token this process signs. Merging rather than replacing keeps the\n * TTLs canonical while making the locally-signed token verifiable here.\n */\n const seededJwt: AppConfiguration['jwt'] = {\n ...seededJwtSource,\n publicKey: {\n ...seededJwtSource.publicKey,\n [CryptoKey_Purpose.APPLICATION_AUTH_TOKEN]: companionSigningKeyPair.publicKey,\n },\n };\n\n const seededConfig = {\n ...baseConfig,\n // Override HTTP server timeouts so long-running LLM-bound endpoints\n // (`/api/companion/labelling/labellize`, `.../translate`, email +\n // market generation) aren't killed by Node's default 5-minute\n // `requestTimeout`. The companion's labelling pipeline routinely\n // runs > 10 minutes when materializing a large app's labels via\n // OpenAI. The default is the right setting for production app\n // traffic — only the dev companion needs the longer ceiling.\n runtime: {\n ...baseConfig.runtime,\n httpServerConfiguration: {\n requestTimeout: 30 * 60_000,\n headersTimeout: 30 * 60_000,\n keepAliveTimeout: 30 * 60_000,\n },\n },\n frontendServices: seededFrontendServices,\n jwt: seededJwt,\n appIdentity: appsManagerMaterial?.appIdentity ?? {\n appName: companionContext.saasConfig.name,\n displayName: companionContext.saasConfig.displayName,\n description: companionContext.saasConfig.description,\n version: resolveCompanionVersion(companionContext),\n },\n engineCapabilities:\n appsManagerMaterial?.engineCapabilities\n ?? companionContext.saasConfig.engineCapabilities\n ?? {},\n providers: providerRuntime?.scope\n ? {\n scopes: { companion: providerRuntime.scope },\n // A runtime-provided scope replaces only WHAT VENDORS DO here; what the application OFFERS\n // (`connections`) is an application-level declaration and is carried through unchanged.\n connections:\n appsManagerMaterial?.providers?.connections\n ?? companionContext.saasConfig.providers?.connections\n ?? {},\n // Same standing as `connections`: an application-level declaration a runtime scope knows\n // nothing about (#367).\n browserOperations:\n appsManagerMaterial?.providers?.browserOperations\n ?? companionContext.saasConfig.providers?.browserOperations\n ?? {},\n // Same standing again (#1725): which refs spend one grant is an application-level declaration.\n sharedConnections:\n appsManagerMaterial?.providers?.sharedConnections\n ?? companionContext.saasConfig.providers?.sharedConnections,\n }\n : appsManagerMaterial?.providers\n ?? companionContext.saasConfig.providers\n ?? { scopes: {}, connections: {}, browserOperations: {} },\n // The stored copy is the ENVIRONMENT's configuration: `wildo.saas.config.ts` with this environment's\n // `infrastructure/<env>/wildo.infra.<env>.config.ts > providerConfigurations` laid over it when the CLI registered the\n // application. The fallback is the application layer ALONE — it carries no per-deployment identifier (an OAuth client\n // ID, a frontend SDK DSN) — so a companion running without an apps-manager copy sees none of those values.\n providerConfigurations:\n appsManagerMaterial?.providerConfigurations\n ?? companionContext.saasConfig.providerConfigurations\n ?? {},\n // Declared in `wildo.saas.config.ts` and no longer backend-authored (#1032), so without this the companion's\n // configuration carries none and the startup validator refuses it. The stored copy wins, as for its siblings.\n organizationTypes:\n appsManagerMaterial?.organizationTypes\n ?? companionContext.saasConfig.organizationTypes,\n /*\n * #1055 — and this site was SKIPPED when the carrier hops were enumerated, on the wrong axis.\n *\n * The reasoning was \"the companion does not READ a system of record, so D2 says backend-only\".\n * True and irrelevant: the companion REGISTERS RESOURCES, so it runs the registration arm, which\n * refuses a binding naming an instance it cannot see. With this absent the companion died at boot\n * with `Declared: none` on an application whose declaration was perfectly correct.\n *\n * The axis that decides a carrier hop is not who reads the VALUE — it is who parses the\n * CONFIGURATION that has to contain it.\n */\n systemsOfRecord:\n appsManagerMaterial?.systemsOfRecord\n ?? companionContext.saasConfig.systemsOfRecord,\n // #2722 — on the same axis: the companion parses the configuration, and startup validates the relationship kinds in it.\n organizationRelationships:\n appsManagerMaterial?.organizationRelationships\n ?? companionContext.saasConfig.organizationRelationships,\n email: {\n ...baseConfig.email,\n isTransactionalWildoManaged:\n appsManagerMaterial?.email?.isTransactionalWildoManaged ?? true,\n isMarketingWildoManaged:\n appsManagerMaterial?.email?.isMarketingWildoManaged ?? true,\n },\n };\n\n const resolvedConfig = applyBackendAuthoredConfig(\n seededConfig,\n backendConfig ?? {},\n ) as AppConfiguration;\n\n const now = new Date();\n const resolvedSecrets: AppConfigurationSecrets = {\n database: {\n // REQUIRED by the secrets contract even on a PostgreSQL platform, so it is always present\n // and simply carries no credentials when no Mongo URL was declared. The CONFIG half above\n // is the one that must stay absent — that is what keeps repositories from binding to a\n // connection this process never opened.\n mongodb: mongoRuntime.secrets,\n // The engine PostgreSQL service reads `secrets.database.postgresql.connectUrl` first.\n // With the pre-connect door this is belt-and-braces, but a post-close reconnect must\n // find the same identity here rather than an unconfigurable blank.\n ...(env.PG_CONNECT_URL\n ? {\n postgresql: {\n connectUrl: env.PG_CONNECT_URL,\n // Required by the secrets contract. Read from the URL that is the actual\n // connection identity, so the two can never disagree; 5432 only when the URL\n // omits it, which is what the driver itself would assume.\n port: Number(new URL(env.PG_CONNECT_URL).port || '5432'),\n },\n }\n : {}),\n redis: {\n username: env.REDIS_ADMIN_USER,\n password: env.REDIS_ADMIN_PASSWORD,\n },\n rabbitmq: {\n username: env.RABBITMQ_ADMIN_USERNAME,\n password: env.RABBITMQ_ADMIN_PASSWORD,\n },\n },\n security: {\n jwt: {\n /*\n * The companion's OWN signing key, so the workbench operator can actually be issued a token.\n *\n * This was `{}` by construction, which made authentication run to completion and then fail\n * with `jwt_token_not_found`. The key is generated and persisted locally — see\n * `ensureCompanionLocalSigningKeyPair` for why it is deliberately NOT the application's:\n * a token signed here is one the application backend refuses, which is the correct boundary\n * between \"looking at a companion\" and \"acting on the application it observes\".\n */\n privateKey: { [CryptoKey_Purpose.APPLICATION_AUTH_TOKEN]: companionSigningKeyPair.privateKey },\n },\n // The companion's own symmetric keys and session secrets (#2893), never derived from the application's credential.\n symmetricKeys: companionSymmetricMaterial.symmetricKeys,\n session: {\n secret: companionSymmetricMaterial.sessionSecret,\n encryptionKey: companionSymmetricMaterial.sessionEncryptionKey,\n },\n },\n createdAt: now,\n updatedAt: now,\n };\n\n return {\n boundaryBaseConfig: seededConfig as AppConfiguration,\n config: resolvedConfig,\n secrets: resolvedSecrets,\n };\n}\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Whether `git <args>` may run through the helper: its subcommand (after `-C`/`-c` and options) is read-only. */
|
|
2
|
+
export declare function isBrokerableGitInvocation(args: readonly string[]): boolean;
|
|
3
|
+
/** `execFile`'s options that a read-only git call uses, plus the stdin a `--batch` read is fed. */
|
|
4
|
+
export interface BrokeredGitOptions {
|
|
5
|
+
readonly maxBuffer?: number;
|
|
6
|
+
readonly timeout?: number;
|
|
7
|
+
/** The FULL environment, as `execFile` takes it; omitted, the helper's own (the companion's at the helper's start). */
|
|
8
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
9
|
+
/** Written to git's stdin, which is then closed (`cat-file --batch`). Omitted, stdin is left as `execFile` leaves it. */
|
|
10
|
+
readonly input?: string;
|
|
11
|
+
}
|
|
12
|
+
/** A read answered as text (`execFile`'s default `utf8`). */
|
|
13
|
+
export interface BrokeredGitTextResult {
|
|
14
|
+
readonly stdout: string;
|
|
15
|
+
readonly stderr: string;
|
|
16
|
+
}
|
|
17
|
+
/** A read answered as bytes (`encoding: 'buffer'`): a blob, or `cat-file --batch` output. */
|
|
18
|
+
export interface BrokeredGitBufferResult {
|
|
19
|
+
readonly stdout: Buffer;
|
|
20
|
+
readonly stderr: Buffer;
|
|
21
|
+
}
|
|
22
|
+
/** A call the helper could not serve; the caller spawns directly instead. */
|
|
23
|
+
export declare class GitReadBrokerUnavailableError extends Error {
|
|
24
|
+
readonly name = "GitReadBrokerUnavailableError";
|
|
25
|
+
}
|
|
26
|
+
/** Consecutive helper failures after which the companion spawns read-only git directly for the rest of its life. */
|
|
27
|
+
export declare const MAXIMUM_BROKER_FAILURES = 3;
|
|
28
|
+
/** The companion's side of the helper. One per process ({@link gitReadBroker}); constructed directly by tests. */
|
|
29
|
+
export declare class GitReadBroker {
|
|
30
|
+
private helper;
|
|
31
|
+
private nextId;
|
|
32
|
+
private consecutiveFailures;
|
|
33
|
+
private readonly pending;
|
|
34
|
+
private readonly options;
|
|
35
|
+
constructor(options?: {
|
|
36
|
+
readonly entryPath?: string;
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* `git <args>` as `execFile` would run it, through the helper when it is read-only and the helper is available, and
|
|
40
|
+
* directly otherwise. Resolves `{ stdout, stderr }` as text; rejects with `execFile`'s error shape.
|
|
41
|
+
*/
|
|
42
|
+
execGit(args: readonly string[], options?: BrokeredGitOptions): Promise<BrokeredGitTextResult>;
|
|
43
|
+
/** {@link execGit} answered as bytes (`execFile`'s `encoding: 'buffer'`): a blob, or a `--batch` read. */
|
|
44
|
+
execGitBuffer(args: readonly string[], options?: BrokeredGitOptions): Promise<BrokeredGitBufferResult>;
|
|
45
|
+
/** Whether the helper has been given up on for this process. For tests and logs. */
|
|
46
|
+
get disabled(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Stop the helper (tests). A call it was serving is answered by a direct spawn, as when the helper dies. The companion
|
|
49
|
+
* itself never calls this: the helper exits when the companion's IPC channel closes, which the companion's exit does.
|
|
50
|
+
*/
|
|
51
|
+
close(): void;
|
|
52
|
+
/** The helper's pid, or `undefined` when none runs. For tests. */
|
|
53
|
+
get helperPid(): number | undefined;
|
|
54
|
+
private run;
|
|
55
|
+
private viaHelper;
|
|
56
|
+
private ensureHelper;
|
|
57
|
+
/** Forget the helper and fail every call it was serving as unavailable, so each is answered by a direct spawn. */
|
|
58
|
+
private failPending;
|
|
59
|
+
}
|
|
60
|
+
/** The process's helper: one per companion. */
|
|
61
|
+
export declare const gitReadBroker: GitReadBroker;
|
|
62
|
+
//# sourceMappingURL=git-read-broker.companion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-read-broker.companion.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/git-read-broker.companion.ts"],"names":[],"mappings":"AAkDA,kHAAkH;AAClH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,SAAS,MA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