@wildo-ai/dev-companion 1.1.12 → 1.1.14
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 +21 -0
- 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 +37 -4
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -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 +9 -2
- 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 +66 -0
- 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 +191 -13
- 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/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 +13 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +39 -13
- 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 +19 -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/resources/launch-blockers.companion.d.ts +5 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js +37 -4
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +14 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +48 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts +128 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js +180 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js.map +1 -0
- 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/introspection-worker-pool.companion.d.ts +9 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js +25 -3
- package/dist/esm/core/introspection/services/introspection-worker-pool.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/restart-drain.companion.d.ts +107 -0
- package/dist/esm/core/runtime/restart-drain.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/restart-drain.companion.js +237 -0
- package/dist/esm/core/runtime/restart-drain.companion.js.map +1 -0
- 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 +3 -2
- package/dist/esm/core/runtime/services/start-companion-application.service.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/executions/services/companion-executions.companion.service.d.ts +18 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +34 -8
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- 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_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/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 +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +13 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts +5 -0
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.js +6 -0
- package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +175 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.js +175 -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 -0
- 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 -0
- 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/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/application-coding-agent.actors-system.definitions.d.ts +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +12 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js +9 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +200 -20
- 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 +1107 -230
- 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 +158 -16
- 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 +381 -46
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +58 -0
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +116 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.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 +12 -0
- 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 +31 -7
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.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 +2 -2
- 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 +10 -8
- 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 +68 -3
- 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 +281 -69
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/package.json +18 -18
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Drain before a held restart (#3204; #265's first candidate shape, never built until now).
|
|
5
|
+
*
|
|
6
|
+
* `wildo local dev` runs the companion under `runtime-supervisor.mjs`, which HOLDS a restart (a dependency install, an
|
|
7
|
+
* engine rebuild) while work is in flight, because the restart kills the companion's process tree. During an unattended
|
|
8
|
+
* build a playbook run is always in flight, so the hold only ever ended at its ceiling (`HOLD_EXCEEDED`, 65 min), which
|
|
9
|
+
* then killed the wave's live coding runs: reference run 43237839187 lost nine at 15:43. Nothing told the companion a
|
|
10
|
+
* restart was waiting, so it kept starting work.
|
|
11
|
+
*
|
|
12
|
+
* Now the supervisor publishes the held restart in its observation, and this module answers three things for the rest of
|
|
13
|
+
* the companion:
|
|
14
|
+
* - {@link CompanionRestartDrain.isRestartHeld}: the build wave stops filling (`ApplicationBuildWaveStop.RESTART_PENDING`);
|
|
15
|
+
* - {@link CompanionRestartDrain.awaitRestartWindow}: the creation loop and every choreography wait at the TOP of each
|
|
16
|
+
* round, before reading the tree or asking a model, until the restart comes (the process ends) or the hold is withdrawn;
|
|
17
|
+
* - when nothing is BUSY, the companion writes its drained marker, `{ pid, at }`, every few seconds. The supervisor's
|
|
18
|
+
* `decideRestartHold` reads it as `DRAINED` and restarts at once.
|
|
19
|
+
*
|
|
20
|
+
* ## What counts as busy (review F1 of the first draft, which counted leaves only)
|
|
21
|
+
*
|
|
22
|
+
* EVERY run is counted for its whole life ({@link CompanionRestartDrain.whileWorking}, at the same entry points that beat
|
|
23
|
+
* the playbook-run heartbeat, settle included): a composite does work of its own between children (merging, a checkpoint,
|
|
24
|
+
* a tree read, the selector's model call), and a run's record is written after its work returns. A run stops being busy
|
|
25
|
+
* only while it is PAUSED: parked at the restart window, or waiting on the children its round dispatched
|
|
26
|
+
* ({@link CompanionRestartDrain.whilePaused}), each of which is counted itself. Busy is runs minus pauses; drained is none
|
|
27
|
+
* busy. A nested lane, which runs inside its parent's round rather than as a run of its own, is counted by the runtime
|
|
28
|
+
* through the same port. Agents (coding, research) keep their own heartbeats, which the supervisor checks first.
|
|
29
|
+
*
|
|
30
|
+
* The marker is deleted the moment anything becomes busy again, so a stale "drained" can never cover work that started
|
|
31
|
+
* after it (review F4).
|
|
32
|
+
*/
|
|
33
|
+
/** A COPY of `COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH` in `scripts/dev-orchestrator/runtime-supervisor-lifecycle.mjs`. */
|
|
34
|
+
export const COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH = '.wildo-saas/runtime-signals/wildo-dev-companion.drained-for-restart.json';
|
|
35
|
+
/** The supervisor's observation of this companion (`runtime-supervisor.mjs` `publishSupervisorState`). */
|
|
36
|
+
const SUPERVISOR_OBSERVATION_RELATIVE_PATH = '.wildo-saas/runtime-signals/supervisors/wildo-dev-companion.json';
|
|
37
|
+
/** How often a parked loop re-reads the hold and the companion rewrites its drained marker. Under the supervisor's 30 s freshness. */
|
|
38
|
+
export const RESTART_DRAIN_POLL_MS = 5_000;
|
|
39
|
+
/** How long one observation read is reused: every slot of a wave and every round asks, and the file changes rarely. */
|
|
40
|
+
const OBSERVATION_CACHE_MS = 2_000;
|
|
41
|
+
/**
|
|
42
|
+
* The longest a round waits at the restart window (review F3): the supervisor's own ceiling (`CODING_RUN_HARD_MAX_MS`
|
|
43
|
+
* 60 min + 5 min margin), past which it restarts anyway. A hold still published after it is a supervisor fault, and the
|
|
44
|
+
* round goes on rather than parking the creation for ever.
|
|
45
|
+
*/
|
|
46
|
+
export const RESTART_WINDOW_CEILING_MS = 65 * 60_000;
|
|
47
|
+
function defaultIsProcessAlive(pid) {
|
|
48
|
+
try {
|
|
49
|
+
process.kill(pid, 0);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return error.code === 'EPERM';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The restart the supervisor running THIS process holds, or `undefined`. Counted only when the observation names this
|
|
58
|
+
* process as its child and its producer is alive, as `requestCompanionRestart` reads the same file: a record left by a
|
|
59
|
+
* supervisor that has exited, or describing another companion, must never park this one.
|
|
60
|
+
*/
|
|
61
|
+
export function readHeldCompanionRestart(saasRoot, options = {}) {
|
|
62
|
+
let observation;
|
|
63
|
+
try {
|
|
64
|
+
observation = JSON.parse(readFileSync(join(saasRoot, SUPERVISOR_OBSERVATION_RELATIVE_PATH), 'utf8'));
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
if (observation.childPid !== (options.processId ?? process.pid))
|
|
70
|
+
return undefined;
|
|
71
|
+
if (typeof observation.producerPid !== 'number' || !(options.isProcessAlive ?? defaultIsProcessAlive)(observation.producerPid))
|
|
72
|
+
return undefined;
|
|
73
|
+
const held = observation.restartHeld;
|
|
74
|
+
if (held === null || typeof held !== 'object' || typeof held.since !== 'string')
|
|
75
|
+
return undefined;
|
|
76
|
+
// A hold taken for another child (one this process replaced) is not this process's (review F2).
|
|
77
|
+
if (typeof held.forChildPid === 'number' && held.forChildPid !== (options.processId ?? process.pid))
|
|
78
|
+
return undefined;
|
|
79
|
+
return { since: held.since, reason: typeof held.reason === 'string' ? held.reason : null };
|
|
80
|
+
}
|
|
81
|
+
/** See the module comment. One per process ({@link companionRestartDrain}); constructed directly by tests. */
|
|
82
|
+
export class CompanionRestartDrain {
|
|
83
|
+
options;
|
|
84
|
+
workInFlight = 0;
|
|
85
|
+
paused = 0;
|
|
86
|
+
saasRoot;
|
|
87
|
+
ticker;
|
|
88
|
+
cached;
|
|
89
|
+
constructor(options = {}) {
|
|
90
|
+
this.options = options;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The restart held for this process right now, or `undefined`; read at most every {@link OBSERVATION_CACHE_MS}. A hold
|
|
94
|
+
* published for longer than {@link RESTART_WINDOW_CEILING_MS} is a supervisor fault and is NOT held here (second review
|
|
95
|
+
* H2): one predicate for every reader, so a wave does not stop filling for ever after the window let its loop go on.
|
|
96
|
+
*/
|
|
97
|
+
heldRestart(saasRoot) {
|
|
98
|
+
const held = this.publishedRestart(saasRoot);
|
|
99
|
+
return held === undefined || this.pastCeiling(held) ? undefined : held;
|
|
100
|
+
}
|
|
101
|
+
/** What the supervisor publishes, ceiling not applied. */
|
|
102
|
+
publishedRestart(saasRoot) {
|
|
103
|
+
this.attach(saasRoot);
|
|
104
|
+
const nowMs = this.now();
|
|
105
|
+
if (this.cached === undefined || nowMs - this.cached.readAtMs >= OBSERVATION_CACHE_MS) {
|
|
106
|
+
this.cached = {
|
|
107
|
+
readAtMs: nowMs,
|
|
108
|
+
held: readHeldCompanionRestart(saasRoot, {
|
|
109
|
+
...(this.options.processId !== undefined ? { processId: this.options.processId } : {}),
|
|
110
|
+
...(this.options.isProcessAlive ? { isProcessAlive: this.options.isProcessAlive } : {}),
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return this.cached.held;
|
|
115
|
+
}
|
|
116
|
+
isRestartHeld(saasRoot) {
|
|
117
|
+
return this.heldRestart(saasRoot) !== undefined;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Count work as in flight from NOW until the returned release is called (idempotent): for a run whose life spans a
|
|
121
|
+
* detached chain, counted before its first await so no marker is written between its start and its count (review L1).
|
|
122
|
+
*/
|
|
123
|
+
begin(saasRoot) {
|
|
124
|
+
this.attach(saasRoot);
|
|
125
|
+
this.changeCounts(1, 0);
|
|
126
|
+
let released = false;
|
|
127
|
+
return () => {
|
|
128
|
+
if (released)
|
|
129
|
+
return;
|
|
130
|
+
released = true;
|
|
131
|
+
this.changeCounts(-1, 0);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** Run work counted as in flight for its whole life: busy, unless it is paused. */
|
|
135
|
+
async whileWorking(saasRoot, work) {
|
|
136
|
+
this.attach(saasRoot);
|
|
137
|
+
this.changeCounts(1, 0);
|
|
138
|
+
try {
|
|
139
|
+
return await work();
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
this.changeCounts(-1, 0);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/** Run `work` while the counted run calling it is PAUSED: it waits on children that are counted themselves. */
|
|
146
|
+
async whilePaused(work) {
|
|
147
|
+
this.changeCounts(0, 1);
|
|
148
|
+
try {
|
|
149
|
+
return await work();
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
this.changeCounts(0, -1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Wait at a round boundary while a restart is held: return at once when none is, and otherwise only once the hold is
|
|
157
|
+
* withdrawn. Normally it never returns: the supervisor reads the drained marker and restarts the process.
|
|
158
|
+
*/
|
|
159
|
+
async awaitRestartWindow(saasRoot, onParked, onCeiling) {
|
|
160
|
+
let held = this.publishedRestart(saasRoot);
|
|
161
|
+
if (held === undefined)
|
|
162
|
+
return;
|
|
163
|
+
if (this.pastCeiling(held)) {
|
|
164
|
+
onCeiling?.(held);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
onParked?.(held);
|
|
168
|
+
await this.whilePaused(async () => {
|
|
169
|
+
while (held !== undefined) {
|
|
170
|
+
if (this.pastCeiling(held)) {
|
|
171
|
+
onCeiling?.(held);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
this.tick();
|
|
175
|
+
await this.sleep(RESTART_DRAIN_POLL_MS);
|
|
176
|
+
this.cached = undefined;
|
|
177
|
+
held = this.publishedRestart(saasRoot);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/** Write the drained marker when a restart is held and nothing is busy. Called by the ticker and when a round parks. */
|
|
182
|
+
tick() {
|
|
183
|
+
const saasRoot = this.saasRoot;
|
|
184
|
+
if (saasRoot === undefined || this.busy() > 0 || !this.isRestartHeld(saasRoot))
|
|
185
|
+
return;
|
|
186
|
+
const markerPath = join(saasRoot, COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH);
|
|
187
|
+
try {
|
|
188
|
+
mkdirSync(dirname(markerPath), { recursive: true });
|
|
189
|
+
const temporary = `${markerPath}.tmp-${process.pid}`;
|
|
190
|
+
writeFileSync(temporary, `${JSON.stringify({ pid: this.options.processId ?? process.pid, at: new Date(this.now()).toISOString() })}\n`, 'utf8');
|
|
191
|
+
renameSync(temporary, markerPath);
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
// Best-effort: without the marker the supervisor holds to its ceiling, exactly as before.
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/** How many counted runs are busy (in flight and not paused). For tests and logs. */
|
|
198
|
+
busy() {
|
|
199
|
+
return Math.max(0, this.workInFlight - this.paused);
|
|
200
|
+
}
|
|
201
|
+
/** Apply a change to the counts, deleting the drained marker the moment something becomes busy (review F4). */
|
|
202
|
+
changeCounts(work, paused) {
|
|
203
|
+
const wasBusy = this.busy() > 0;
|
|
204
|
+
this.workInFlight = Math.max(0, this.workInFlight + work);
|
|
205
|
+
this.paused = Math.max(0, this.paused + paused);
|
|
206
|
+
if (!wasBusy && this.busy() > 0 && this.saasRoot !== undefined) {
|
|
207
|
+
try {
|
|
208
|
+
rmSync(join(this.saasRoot, COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH), { force: true });
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// Best-effort: the supervisor's freshness bound still retires it.
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
pastCeiling(held) {
|
|
216
|
+
const sinceMs = Date.parse(held.since);
|
|
217
|
+
return Number.isFinite(sinceMs) && this.now() - sinceMs > RESTART_WINDOW_CEILING_MS;
|
|
218
|
+
}
|
|
219
|
+
attach(saasRoot) {
|
|
220
|
+
if (this.saasRoot === saasRoot)
|
|
221
|
+
return;
|
|
222
|
+
this.saasRoot = saasRoot;
|
|
223
|
+
if (this.options.withoutTicker || this.ticker !== undefined)
|
|
224
|
+
return;
|
|
225
|
+
this.ticker = setInterval(() => this.tick(), RESTART_DRAIN_POLL_MS);
|
|
226
|
+
this.ticker.unref?.();
|
|
227
|
+
}
|
|
228
|
+
now() {
|
|
229
|
+
return (this.options.now ?? Date.now)();
|
|
230
|
+
}
|
|
231
|
+
sleep(ms) {
|
|
232
|
+
return this.options.sleep ? this.options.sleep(ms) : new Promise((resolveSleep) => setTimeout(resolveSleep, ms));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/** The process's drain: one supervisor watches one companion process. */
|
|
236
|
+
export const companionRestartDrain = new CompanionRestartDrain();
|
|
237
|
+
//# sourceMappingURL=restart-drain.companion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restart-drain.companion.js","sourceRoot":"","sources":["../../../../src/core/runtime/restart-drain.companion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,8HAA8H;AAC9H,MAAM,CAAC,MAAM,2CAA2C,GAAG,0EAA0E,CAAC;AAEtI,0GAA0G;AAC1G,MAAM,oCAAoC,GAAG,kEAAkE,CAAC;AAEhH,sIAAsI;AACtI,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C,uHAAuH;AACvH,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAy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name, join } from 'node:path';\n\n/**\n * Drain before a held restart (#3204; #265's first candidate shape, never built until now).\n *\n * `wildo local dev` runs the companion under `runtime-supervisor.mjs`, which HOLDS a restart (a dependency install, an\n * engine rebuild) while work is in flight, because the restart kills the companion's process tree. During an unattended\n * build a playbook run is always in flight, so the hold only ever ended at its ceiling (`HOLD_EXCEEDED`, 65 min), which\n * then killed the wave's live coding runs: reference run 43237839187 lost nine at 15:43. Nothing told the companion a\n * restart was waiting, so it kept starting work.\n *\n * Now the supervisor publishes the held restart in its observation, and this module answers three things for the rest of\n * the companion:\n * - {@link CompanionRestartDrain.isRestartHeld}: the build wave stops filling (`ApplicationBuildWaveStop.RESTART_PENDING`);\n * - {@link CompanionRestartDrain.awaitRestartWindow}: the creation loop and every choreography wait at the TOP of each\n * round, before reading the tree or asking a model, until the restart comes (the process ends) or the hold is withdrawn;\n * - when nothing is BUSY, the companion writes its drained marker, `{ pid, at }`, every few seconds. The supervisor's\n * `decideRestartHold` reads it as `DRAINED` and restarts at once.\n *\n * ## What counts as busy (review F1 of the first draft, which counted leaves only)\n *\n * EVERY run is counted for its whole life ({@link CompanionRestartDrain.whileWorking}, at the same entry points that beat\n * the playbook-run heartbeat, settle included): a composite does work of its own between children (merging, a checkpoint,\n * a tree read, the selector's model call), and a run's record is written after its work returns. A run stops being busy\n * only while it is PAUSED: parked at the restart window, or waiting on the children its round dispatched\n * ({@link CompanionRestartDrain.whilePaused}), each of which is counted itself. Busy is runs minus pauses; drained is none\n * busy. A nested lane, which runs inside its parent's round rather than as a run of its own, is counted by the runtime\n * through the same port. Agents (coding, research) keep their own heartbeats, which the supervisor checks first.\n *\n * The marker is deleted the moment anything becomes busy again, so a stale \"drained\" can never cover work that started\n * after it (review F4).\n */\n\n/** A COPY of `COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH` in `scripts/dev-orchestrator/runtime-supervisor-lifecycle.mjs`. */\nexport const COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH = '.wildo-saas/runtime-signals/wildo-dev-companion.drained-for-restart.json';\n\n/** The supervisor's observation of this companion (`runtime-supervisor.mjs` `publishSupervisorState`). */\nconst SUPERVISOR_OBSERVATION_RELATIVE_PATH = '.wildo-saas/runtime-signals/supervisors/wildo-dev-companion.json';\n\n/** How often a parked loop re-reads the hold and the companion rewrites its drained marker. Under the supervisor's 30 s freshness. */\nexport const RESTART_DRAIN_POLL_MS = 5_000;\n\n/** How long one observation read is reused: every slot of a wave and every round asks, and the file changes rarely. */\nconst OBSERVATION_CACHE_MS = 2_000;\n\n/**\n * The longest a round waits at the restart window (review F3): the supervisor's own ceiling (`CODING_RUN_HARD_MAX_MS`\n * 60 min + 5 min margin), past which it restarts anyway. A hold still published after it is a supervisor fault, and the\n * round goes on rather than parking the creation for ever.\n */\nexport const RESTART_WINDOW_CEILING_MS = 65 * 60_000;\n\n/** A restart the running supervisor holds for this process. */\nexport interface HeldCompanionRestart {\n readonly since: string;\n readonly reason: string | null;\n}\n\nfunction defaultIsProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The restart the supervisor running THIS process holds, or `undefined`. Counted only when the observation names this\n * process as its child and its producer is alive, as `requestCompanionRestart` reads the same file: a record left by a\n * supervisor that has exited, or describing another companion, must never park this one.\n */\nexport function readHeldCompanionRestart(\n saasRoot: string,\n options: { readonly processId?: number; readonly isProcessAlive?: (pid: number) => boolean } = {},\n): HeldCompanionRestart | undefined {\n let observation: { readonly producerPid?: unknown; readonly childPid?: unknown; readonly restartHeld?: unknown };\n try {\n observation = JSON.parse(readFileSync(join(saasRoot, SUPERVISOR_OBSERVATION_RELATIVE_PATH), 'utf8')) as typeof observation;\n } catch {\n return undefined;\n }\n if (observation.childPid !== (options.processId ?? process.pid)) return undefined;\n if (typeof observation.producerPid !== 'number' || !(options.isProcessAlive ?? defaultIsProcessAlive)(observation.producerPid)) return undefined;\n const held = observation.restartHeld as { readonly since?: unknown; readonly reason?: unknown; readonly forChildPid?: unknown } | null | undefined;\n if (held === null || typeof held !== 'object' || typeof held.since !== 'string') return undefined;\n // A hold taken for another child (one this process replaced) is not this process's (review F2).\n if (typeof held.forChildPid === 'number' && held.forChildPid !== (options.processId ?? process.pid)) return undefined;\n return { since: held.since, reason: typeof held.reason === 'string' ? held.reason : null };\n}\n\n/** See the module comment. One per process ({@link companionRestartDrain}); constructed directly by tests. */\nexport class CompanionRestartDrain {\n private workInFlight = 0;\n private paused = 0;\n private saasRoot: string | undefined;\n private ticker: ReturnType<typeof setInterval> | undefined;\n private cached: { readonly readAtMs: number; readonly held: HeldCompanionRestart | undefined } | undefined;\n\n public constructor(private readonly options: {\n readonly now?: () => number;\n readonly sleep?: (ms: number) => Promise<void>;\n readonly processId?: number;\n readonly isProcessAlive?: (pid: number) => boolean;\n /** Tests drive {@link tick} themselves. */\n readonly withoutTicker?: boolean;\n } = {}) {}\n\n /**\n * The restart held for this process right now, or `undefined`; read at most every {@link OBSERVATION_CACHE_MS}. A hold\n * published for longer than {@link RESTART_WINDOW_CEILING_MS} is a supervisor fault and is NOT held here (second review\n * H2): one predicate for every reader, so a wave does not stop filling for ever after the window let its loop go on.\n */\n public heldRestart(saasRoot: string): HeldCompanionRestart | undefined {\n const held = this.publishedRestart(saasRoot);\n return held === undefined || this.pastCeiling(held) ? undefined : held;\n }\n\n /** What the supervisor publishes, ceiling not applied. */\n private publishedRestart(saasRoot: string): HeldCompanionRestart | undefined {\n this.attach(saasRoot);\n const nowMs = this.now();\n if (this.cached === undefined || nowMs - this.cached.readAtMs >= OBSERVATION_CACHE_MS) {\n this.cached = {\n readAtMs: nowMs,\n held: readHeldCompanionRestart(saasRoot, {\n ...(this.options.processId !== undefined ? { processId: this.options.processId } : {}),\n ...(this.options.isProcessAlive ? { isProcessAlive: this.options.isProcessAlive } : {}),\n }),\n };\n }\n return this.cached.held;\n }\n\n public isRestartHeld(saasRoot: string): boolean {\n return this.heldRestart(saasRoot) !== undefined;\n }\n\n /**\n * Count work as in flight from NOW until the returned release is called (idempotent): for a run whose life spans a\n * detached chain, counted before its first await so no marker is written between its start and its count (review L1).\n */\n public begin(saasRoot: string): () => void {\n this.attach(saasRoot);\n this.changeCounts(1, 0);\n let released = false;\n return () => {\n if (released) return;\n released = true;\n this.changeCounts(-1, 0);\n };\n }\n\n /** Run work counted as in flight for its whole life: busy, unless it is paused. */\n public async whileWorking<T>(saasRoot: string, work: () => Promise<T>): Promise<T> {\n this.attach(saasRoot);\n this.changeCounts(1, 0);\n try {\n return await work();\n } finally {\n this.changeCounts(-1, 0);\n }\n }\n\n /** Run `work` while the counted run calling it is PAUSED: it waits on children that are counted themselves. */\n public async whilePaused<T>(work: () => Promise<T>): Promise<T> {\n this.changeCounts(0, 1);\n try {\n return await work();\n } finally {\n this.changeCounts(0, -1);\n }\n }\n\n /**\n * Wait at a round boundary while a restart is held: return at once when none is, and otherwise only once the hold is\n * withdrawn. Normally it never returns: the supervisor reads the drained marker and restarts the process.\n */\n public async awaitRestartWindow(\n saasRoot: string,\n onParked?: (held: HeldCompanionRestart) => void,\n onCeiling?: (held: HeldCompanionRestart) => void,\n ): Promise<void> {\n let held = this.publishedRestart(saasRoot);\n if (held === undefined) return;\n if (this.pastCeiling(held)) {\n onCeiling?.(held);\n return;\n }\n onParked?.(held);\n await this.whilePaused(async () => {\n while (held !== undefined) {\n if (this.pastCeiling(held)) {\n onCeiling?.(held);\n return;\n }\n this.tick();\n await this.sleep(RESTART_DRAIN_POLL_MS);\n this.cached = undefined;\n held = this.publishedRestart(saasRoot);\n }\n });\n }\n\n /** Write the drained marker when a restart is held and nothing is busy. Called by the ticker and when a round parks. */\n public tick(): void {\n const saasRoot = this.saasRoot;\n if (saasRoot === undefined || this.busy() > 0 || !this.isRestartHeld(saasRoot)) return;\n const markerPath = join(saasRoot, COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH);\n try {\n mkdirSync(dirname(markerPath), { recursive: true });\n const temporary = `${markerPath}.tmp-${process.pid}`;\n writeFileSync(temporary, `${JSON.stringify({ pid: this.options.processId ?? process.pid, at: new Date(this.now()).toISOString() })}\\n`, 'utf8');\n renameSync(temporary, markerPath);\n } catch {\n // Best-effort: without the marker the supervisor holds to its ceiling, exactly as before.\n }\n }\n\n /** How many counted runs are busy (in flight and not paused). For tests and logs. */\n public busy(): number {\n return Math.max(0, this.workInFlight - this.paused);\n }\n\n /** Apply a change to the counts, deleting the drained marker the moment something becomes busy (review F4). */\n private changeCounts(work: number, paused: number): void {\n const wasBusy = this.busy() > 0;\n this.workInFlight = Math.max(0, this.workInFlight + work);\n this.paused = Math.max(0, this.paused + paused);\n if (!wasBusy && this.busy() > 0 && this.saasRoot !== undefined) {\n try {\n rmSync(join(this.saasRoot, COMPANION_DRAINED_FOR_RESTART_RELATIVE_PATH), { force: true });\n } catch {\n // Best-effort: the supervisor's freshness bound still retires it.\n }\n }\n }\n\n private pastCeiling(held: HeldCompanionRestart): boolean {\n const sinceMs = Date.parse(held.since);\n return Number.isFinite(sinceMs) && this.now() - sinceMs > RESTART_WINDOW_CEILING_MS;\n }\n\n private attach(saasRoot: string): void {\n if (this.saasRoot === saasRoot) return;\n this.saasRoot = saasRoot;\n if (this.options.withoutTicker || this.ticker !== undefined) return;\n this.ticker = setInterval(() => this.tick(), RESTART_DRAIN_POLL_MS);\n this.ticker.unref?.();\n }\n\n private now(): number {\n return (this.options.now ?? Date.now)();\n }\n\n private sleep(ms: number): Promise<void> {\n return this.options.sleep ? this.options.sleep(ms) : new Promise((resolveSleep) => setTimeout(resolveSleep, ms));\n }\n}\n\n/** The process's drain: one supervisor watches one companion process. */\nexport const companionRestartDrain = new CompanionRestartDrain();\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-companion-application.service.d.ts","sourceRoot":"","sources":["../../../../../src/core/runtime/services/start-companion-application.service.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,K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AE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;YAqPxD,sCAAsC;IAgDpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;YACW,2CAA2C;IA0BzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;YACW,iCAAiC;IAyH/C;;;;;;;;;;;;;OAaG;YACW,uCAAuC;YAuBvC,8BAA8B;IAgB5C;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;
|
|
1
|
+
{"version":3,"file":"start-companion-application.service.d.ts","sourceRoot":"","sources":["../../../../../src/core/runtime/services/start-companion-application.service.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,qCAAqC,EAE1C,wBAAwB,EACxB,cAAc,EACd,gCAAgC,EAChC,YAAY,EACZ,+BAA+B,EAC/B,uCAAuC,EACvC,2BAA2B,EAC3B,mCAAmC,EACnC,0BAA0B,EAC1B,wCAAwC,EACxC,+BAA+B,EAC/B,qCAAqC,EACrC,yCAAyC,EACzC,2DAA2D,EAK3D,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,aAAa,EAClB,KAAK,yCAAyC,EAE/C,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,EAEL,KAAK,mCAAmC,EACzC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAIlF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AAGtG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAE1G,OAAO,EAAE,0CAA0C,EAAE,MAAM,6EAA6E,CAAC;AAIzI,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,4FAA4F,CAAC;AAE7J,OAAO,EAAE,6CAA6C,EA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uC,CAc7D;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,iCAAiC;IA8CzC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qCAAqC,CAmB3D;YAEY,sCAAsC;YA8FtC,yBAAyB;IAMvC,+EAA+E;IACxE,mBAAmB,IAAI,OAAO;IAIrC;;;;OAIG;IACI,4BAA4B,IAAI,OAAO;IAIvC,aAAa,IAAI,MAAM,GAAG,IAAI;IAIrC;;;;;;;;;OASG;IACH,OAAO,CAAC,gCAAgC;IAkDxC,OAAO,CAAC,8BAA8B;IAWtC;;;;;;OAMG;IACH,OAAO,CAAC,kCAAkC;IAoC1C,4FAA4F;YAC9E,sBAAsB;CAiBrC"}
|
|
@@ -14,7 +14,7 @@ var StartCompanionApplicationService_1;
|
|
|
14
14
|
import { chmodSync, mkdirSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
15
15
|
import { dirname, join } from 'node:path';
|
|
16
16
|
import { COMPANION_MODEL_APPLICABILITY_PREFERENCE } from '../companion-model-preference.js';
|
|
17
|
-
import { resolveCompanionLanguageModelRoute } from '../companion-language-model-route.js';
|
|
17
|
+
import { createLanguageModelRunHeartbeatReporter, resolveCompanionLanguageModelRoute } from '../companion-language-model-route.js';
|
|
18
18
|
import { injectable, inject, optional } from 'inversify';
|
|
19
19
|
import { I18nBackendService, SAAS_SERVICE_TYPES, HttpServerBackendService, MongoDBService, PostgreSQLDatabaseBackendService, RedisService, FileStorageRouterBackendService, ExternalProvidersRegistryBackendService, ObservabilityBackendService, WorkerShutdownManagerBackendService, FlowsActorsRegistryService, ControllersRegistryHandlerBackendService, ResourcesRegistryBackendService, ServicesRegistryHandlerBackendService, RepositoriesRegistryHandlerBackendService, ResourceOperationCustomImplementationRegistryBackendService, mergeBackendDomainModules, projectCaughtErrorLogFields, projectRetriedAttemptErrorLogFields, resolveBackendProviderRegistry, describeCaughtError, } from '@wildo-ai/saas-backend-lib';
|
|
20
20
|
import { CoreResourceType, buildSharedSaaSModulesRegistry, ENGINE_RUNTIME_REQUIRED_RESOURCE_TYPES, } from '@wildo-ai/saas-models';
|
|
@@ -697,7 +697,8 @@ let StartCompanionApplicationService = class StartCompanionApplicationService {
|
|
|
697
697
|
* every surface of the companion for a cost concern, and the error is what makes the cost visible.
|
|
698
698
|
*/
|
|
699
699
|
installLanguageModelRoute() {
|
|
700
|
-
|
|
700
|
+
// The heartbeat that holds a supervisor restart while a routed call's agent is running (#3472, 2026-11-15).
|
|
701
|
+
const route = resolveCompanionLanguageModelRoute(process.env, createLanguageModelRunHeartbeatReporter(this.companionContext.saasRoot, (message, error) => this.logger.warn(message, { reason: describeCaughtError(error) })));
|
|
701
702
|
if (route === undefined) {
|
|
702
703
|
this.logger.info('Language-model calls stay on the API keys (WILDO_LANGUAGE_MODEL_TRANSPORT=api)');
|
|
703
704
|
return;
|