@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
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import childProcess from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describeCaughtError } from '@wildo-ai/saas-models/public-runtime';
|
|
5
|
+
/**
|
|
6
|
+
* Read-only `git` invocations, spawned by a small long-lived helper process instead of by the companion (#3204).
|
|
7
|
+
*
|
|
8
|
+
* ## Why
|
|
9
|
+
*
|
|
10
|
+
* Starting a process forks its parent, and on Linux the fork copies the parent's page tables while the calling thread
|
|
11
|
+
* waits. The companion runs with a 1.5–2 GB heap during a build, and measured on the reference VM one `git rev-parse`
|
|
12
|
+
* blocked a 2 GB process's main thread for 8.5 ms against 1.1 ms from a 50 MB one. The build's landing derivation and
|
|
13
|
+
* change-set reads run `git` about a dozen times a second, so a 90 s CPU profile of the reference run's companion
|
|
14
|
+
* (2026-11-14) spent 10 s of the main thread inside `spawn` for read-only git alone, while every workbench request waited.
|
|
15
|
+
* From a helper the companion pays one IPC message each way; the fork happens in a process with a few tens of MB.
|
|
16
|
+
*
|
|
17
|
+
* ## What it never does
|
|
18
|
+
*
|
|
19
|
+
* Only READ-ONLY git goes through it ({@link isBrokerableGitInvocation}): a subcommand the companion's write recording
|
|
20
|
+
* (`local-write-recording.companion.ts`) treats as unable to write anything a fingerprint reads. A write must stay a
|
|
21
|
+
* direct spawn, because that recording sees a subprocess only when the companion starts it, and a write it did not see
|
|
22
|
+
* would leave a derived input's fingerprint stale.
|
|
23
|
+
*
|
|
24
|
+
* ## Failing toward the direct spawn
|
|
25
|
+
*
|
|
26
|
+
* Every answer is the one `execFile` would give: the same stdout and stderr strings, and on failure an `Error` carrying
|
|
27
|
+
* `code`, `signal`, `killed`, `stdout` and `stderr`, with `execFile`'s own message. When the helper cannot start, exits or
|
|
28
|
+
* loses its channel, the call it was serving is retried as a direct spawn (a read-only command is safe to run twice), and
|
|
29
|
+
* the next call starts a fresh helper. After {@link MAXIMUM_BROKER_FAILURES} consecutive failures the companion spawns
|
|
30
|
+
* directly for the rest of its life.
|
|
31
|
+
*
|
|
32
|
+
* This module imports nothing but Node built-ins, so the helper can run from this `.ts` file under Node's type stripping
|
|
33
|
+
* (the companion under test, or run from source) as well as from the compiled `.js`.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Git subcommands that write nothing a fingerprint reads. THE one list: the write recording
|
|
37
|
+
* (`local-write-recording.companion.ts`) reads it through {@link isBrokerableGitInvocation} to decide which subprocesses
|
|
38
|
+
* cannot have written, and the helper may run only these.
|
|
39
|
+
*
|
|
40
|
+
* `status` may refresh `.git/index`, which no fingerprint reads (the creation plane signs `HEAD` and `logs/HEAD`). Kept
|
|
41
|
+
* narrow on purpose: a subcommand missing here costs one walk per fingerprint (and a direct spawn), a subcommand wrongly
|
|
42
|
+
* here costs a stale fingerprint.
|
|
43
|
+
*/
|
|
44
|
+
const READ_ONLY_GIT_SUBCOMMANDS = new Set([
|
|
45
|
+
'status', 'ls-files', 'rev-parse', 'log', 'show', 'diff', 'cat-file', 'ls-tree', 'for-each-ref', 'merge-base',
|
|
46
|
+
'rev-list', 'describe', 'blame', 'grep', 'check-ignore', 'diff-tree', 'diff-index', 'name-rev',
|
|
47
|
+
]);
|
|
48
|
+
/** Whether `git <args>` may run through the helper: its subcommand (after `-C`/`-c` and options) is read-only. */
|
|
49
|
+
export function isBrokerableGitInvocation(args) {
|
|
50
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
51
|
+
const argument = args[index];
|
|
52
|
+
if (argument === '-C' || argument === '-c' || argument === '--git-dir' || argument === '--work-tree') {
|
|
53
|
+
index += 1;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (argument.startsWith('-'))
|
|
57
|
+
continue;
|
|
58
|
+
return READ_ONLY_GIT_SUBCOMMANDS.has(argument);
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* `execFile` with this module's options, as every path here runs it (the helper, and the direct fallback): the text or
|
|
64
|
+
* the bytes, and the stdin a batch read is fed. The callback receives `execFile`'s own error, stdout and stderr.
|
|
65
|
+
*/
|
|
66
|
+
function runExecFile(args, options, binary, callback) {
|
|
67
|
+
const child = childProcess.execFile('git', [...args], {
|
|
68
|
+
...(binary ? { encoding: 'buffer' } : {}),
|
|
69
|
+
...(options.maxBuffer !== undefined ? { maxBuffer: options.maxBuffer } : {}),
|
|
70
|
+
...(options.timeout !== undefined ? { timeout: options.timeout } : {}),
|
|
71
|
+
...(options.env !== undefined ? { env: options.env } : {}),
|
|
72
|
+
}, (error, stdout, stderr) => callback(error, stdout, stderr));
|
|
73
|
+
if (options.input !== undefined) {
|
|
74
|
+
// A child that died before the write finished settles through `execFile`'s own callback.
|
|
75
|
+
child.stdin?.on('error', () => undefined);
|
|
76
|
+
child.stdin?.end(options.input);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function asBuffer(output) {
|
|
80
|
+
if (output === undefined)
|
|
81
|
+
return Buffer.alloc(0);
|
|
82
|
+
return typeof output === 'string' ? Buffer.from(output) : Buffer.from(output.buffer, output.byteOffset, output.byteLength);
|
|
83
|
+
}
|
|
84
|
+
function asText(output) {
|
|
85
|
+
if (output === undefined)
|
|
86
|
+
return '';
|
|
87
|
+
return typeof output === 'string' ? output : asBuffer(output).toString('utf8');
|
|
88
|
+
}
|
|
89
|
+
/** Marks a process started by {@link GitReadBroker}, so importing this module elsewhere starts nothing. */
|
|
90
|
+
const GIT_READ_BROKER_ARGUMENT = '--wildo-git-read-broker';
|
|
91
|
+
// The helper's side: run each request with `execFile`, answer on the channel, and exit with the companion.
|
|
92
|
+
if (process.argv.includes(GIT_READ_BROKER_ARGUMENT) && typeof process.send === 'function') {
|
|
93
|
+
const send = process.send.bind(process);
|
|
94
|
+
process.on('disconnect', () => process.exit(0));
|
|
95
|
+
process.on('message', (request) => {
|
|
96
|
+
if (!isBrokerableGitInvocation(request.args)) {
|
|
97
|
+
send({ id: request.id, failure: { message: `git ${request.args.join(' ')} is not a read-only invocation; the helper refuses it` } });
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
runExecFile(request.args, request.options, request.binary, (error, stdout, stderr) => {
|
|
101
|
+
if (error === null) {
|
|
102
|
+
send({ id: request.id, stdout, stderr });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const failed = error;
|
|
106
|
+
send({
|
|
107
|
+
id: request.id,
|
|
108
|
+
failure: { message: failed.message, code: failed.code ?? null, signal: failed.signal ?? null, killed: failed.killed ?? false, stdout, stderr },
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/** A call the helper could not serve; the caller spawns directly instead. */
|
|
114
|
+
export class GitReadBrokerUnavailableError extends Error {
|
|
115
|
+
name = 'GitReadBrokerUnavailableError';
|
|
116
|
+
}
|
|
117
|
+
/** Consecutive helper failures after which the companion spawns read-only git directly for the rest of its life. */
|
|
118
|
+
export const MAXIMUM_BROKER_FAILURES = 3;
|
|
119
|
+
/** The companion's side of the helper. One per process ({@link gitReadBroker}); constructed directly by tests. */
|
|
120
|
+
export class GitReadBroker {
|
|
121
|
+
helper;
|
|
122
|
+
nextId = 1;
|
|
123
|
+
consecutiveFailures = 0;
|
|
124
|
+
pending = new Map();
|
|
125
|
+
// A plain field, not a parameter property: this file runs under type stripping, which refuses non-erasable syntax.
|
|
126
|
+
options;
|
|
127
|
+
constructor(options = {}) {
|
|
128
|
+
this.options = options;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* `git <args>` as `execFile` would run it, through the helper when it is read-only and the helper is available, and
|
|
132
|
+
* directly otherwise. Resolves `{ stdout, stderr }` as text; rejects with `execFile`'s error shape.
|
|
133
|
+
*/
|
|
134
|
+
async execGit(args, options = {}) {
|
|
135
|
+
const { stdout, stderr } = await this.run(args, options, false);
|
|
136
|
+
return { stdout: asText(stdout), stderr: asText(stderr) };
|
|
137
|
+
}
|
|
138
|
+
/** {@link execGit} answered as bytes (`execFile`'s `encoding: 'buffer'`): a blob, or a `--batch` read. */
|
|
139
|
+
async execGitBuffer(args, options = {}) {
|
|
140
|
+
const { stdout, stderr } = await this.run(args, options, true);
|
|
141
|
+
return { stdout: asBuffer(stdout), stderr: asBuffer(stderr) };
|
|
142
|
+
}
|
|
143
|
+
/** Whether the helper has been given up on for this process. For tests and logs. */
|
|
144
|
+
get disabled() {
|
|
145
|
+
return this.consecutiveFailures >= MAXIMUM_BROKER_FAILURES;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Stop the helper (tests). A call it was serving is answered by a direct spawn, as when the helper dies. The companion
|
|
149
|
+
* itself never calls this: the helper exits when the companion's IPC channel closes, which the companion's exit does.
|
|
150
|
+
*/
|
|
151
|
+
close() {
|
|
152
|
+
const helper = this.helper;
|
|
153
|
+
if (helper === undefined)
|
|
154
|
+
return;
|
|
155
|
+
this.failPending(helper, 'the git read helper was closed');
|
|
156
|
+
helper.disconnect?.();
|
|
157
|
+
}
|
|
158
|
+
/** The helper's pid, or `undefined` when none runs. For tests. */
|
|
159
|
+
get helperPid() {
|
|
160
|
+
return this.helper?.pid;
|
|
161
|
+
}
|
|
162
|
+
async run(args, options, binary) {
|
|
163
|
+
if (isBrokerableGitInvocation(args)) {
|
|
164
|
+
try {
|
|
165
|
+
return await this.viaHelper(args, options, binary);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
if (!(error instanceof GitReadBrokerUnavailableError))
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return directExecGit(args, options, binary);
|
|
173
|
+
}
|
|
174
|
+
viaHelper(args, options, binary) {
|
|
175
|
+
const helper = this.ensureHelper();
|
|
176
|
+
if (helper === undefined)
|
|
177
|
+
return Promise.reject(new GitReadBrokerUnavailableError('no git read helper is available'));
|
|
178
|
+
const id = this.nextId;
|
|
179
|
+
this.nextId += 1;
|
|
180
|
+
return new Promise((resolve, reject) => {
|
|
181
|
+
this.pending.set(id, { resolve, reject });
|
|
182
|
+
// Referenced only while a call is pending: an idle helper never keeps the companion alive.
|
|
183
|
+
if (this.pending.size === 1)
|
|
184
|
+
helper.channel?.ref?.();
|
|
185
|
+
try {
|
|
186
|
+
helper.send({ id, args, options, binary });
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
this.pending.delete(id);
|
|
190
|
+
reject(new GitReadBrokerUnavailableError(`the git read helper could not be sent the call: ${describeCaughtError(error)}`));
|
|
191
|
+
}
|
|
192
|
+
}).then((response) => {
|
|
193
|
+
if (response.failure === undefined)
|
|
194
|
+
return { stdout: response.stdout ?? '', stderr: response.stderr ?? '' };
|
|
195
|
+
// `execFile`'s own error, rebuilt: its message, exit code, signal, and the output it had, in the caller's encoding.
|
|
196
|
+
throw Object.assign(new Error(response.failure.message), {
|
|
197
|
+
code: response.failure.code,
|
|
198
|
+
signal: response.failure.signal,
|
|
199
|
+
killed: response.failure.killed,
|
|
200
|
+
stdout: binary ? asBuffer(response.failure.stdout) : asText(response.failure.stdout),
|
|
201
|
+
stderr: binary ? asBuffer(response.failure.stderr) : asText(response.failure.stderr),
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
ensureHelper() {
|
|
206
|
+
if (this.helper !== undefined)
|
|
207
|
+
return this.helper;
|
|
208
|
+
if (this.disabled)
|
|
209
|
+
return undefined;
|
|
210
|
+
let helper;
|
|
211
|
+
try {
|
|
212
|
+
const entryPath = this.options.entryPath ?? resolveGitReadBrokerEntry();
|
|
213
|
+
/*
|
|
214
|
+
* `execArgv: []`: the companion's own flags (its heap size, its loaders) are not the helper's, and a large heap
|
|
215
|
+
* limit is exactly what the helper exists to avoid. Its environment is the companion's, so git sees the same one.
|
|
216
|
+
* `serialization: 'advanced'` carries a blob's bytes as bytes rather than as text that would have to be re-encoded.
|
|
217
|
+
*/
|
|
218
|
+
helper = childProcess.fork(entryPath, [GIT_READ_BROKER_ARGUMENT], { execArgv: [], serialization: 'advanced', stdio: ['ignore', 'ignore', 'inherit', 'ipc'] });
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
this.consecutiveFailures += 1;
|
|
222
|
+
return undefined;
|
|
223
|
+
}
|
|
224
|
+
helper.unref();
|
|
225
|
+
helper.channel?.unref?.();
|
|
226
|
+
helper.on('message', (response) => {
|
|
227
|
+
const waiter = this.pending.get(response.id);
|
|
228
|
+
if (waiter === undefined)
|
|
229
|
+
return;
|
|
230
|
+
this.pending.delete(response.id);
|
|
231
|
+
if (this.pending.size === 0)
|
|
232
|
+
helper.channel?.unref?.();
|
|
233
|
+
this.consecutiveFailures = 0;
|
|
234
|
+
waiter.resolve(response);
|
|
235
|
+
});
|
|
236
|
+
const fail = (reason) => {
|
|
237
|
+
if (this.helper !== helper)
|
|
238
|
+
return;
|
|
239
|
+
this.consecutiveFailures += 1;
|
|
240
|
+
this.failPending(helper, reason);
|
|
241
|
+
// A failure that is not an exit (an error, a lost channel) can leave the process running: stop the one it forgot.
|
|
242
|
+
if (helper.exitCode === null && helper.signalCode === null)
|
|
243
|
+
helper.kill();
|
|
244
|
+
};
|
|
245
|
+
helper.on('error', (error) => fail(`the git read helper failed: ${error.message}`));
|
|
246
|
+
helper.on('exit', (code, signal) => fail(`the git read helper exited (code ${String(code)}, signal ${String(signal)})`));
|
|
247
|
+
helper.on('disconnect', () => fail('the git read helper lost its channel'));
|
|
248
|
+
this.helper = helper;
|
|
249
|
+
return helper;
|
|
250
|
+
}
|
|
251
|
+
/** Forget the helper and fail every call it was serving as unavailable, so each is answered by a direct spawn. */
|
|
252
|
+
failPending(helper, reason) {
|
|
253
|
+
if (this.helper !== helper)
|
|
254
|
+
return;
|
|
255
|
+
this.helper = undefined;
|
|
256
|
+
const waiters = [...this.pending.values()];
|
|
257
|
+
this.pending.clear();
|
|
258
|
+
for (const waiter of waiters)
|
|
259
|
+
waiter.reject(new GitReadBrokerUnavailableError(reason));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/** The direct spawn: what every call did before the helper, and the fallback when it cannot serve. */
|
|
263
|
+
function directExecGit(args, options, binary) {
|
|
264
|
+
return new Promise((resolve, reject) => {
|
|
265
|
+
runExecFile(args, options, binary, (error, stdout, stderr) => {
|
|
266
|
+
if (error === null)
|
|
267
|
+
resolve({ stdout, stderr });
|
|
268
|
+
else
|
|
269
|
+
reject(Object.assign(error, { stdout, stderr }));
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
/** This module's own file: the compiled `.js` in a build, the `.ts` when the companion runs from source. */
|
|
274
|
+
function resolveGitReadBrokerEntry() {
|
|
275
|
+
const own = fileURLToPath(import.meta.url);
|
|
276
|
+
if (existsSync(own))
|
|
277
|
+
return own;
|
|
278
|
+
throw new GitReadBrokerUnavailableError(`the git read helper entry ${own} does not exist`);
|
|
279
|
+
}
|
|
280
|
+
/** The process's helper: one per companion. */
|
|
281
|
+
export const gitReadBroker = new GitReadBroker();
|
|
282
|
+
//# sourceMappingURL=git-read-broker.companion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-read-broker.companion.js","sourceRoot":"","sources":["../../../../src/core/utils/git-read-broker.companion.ts"],"names":[],"mappings":"AAAA,OAAO,YAAmC,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;GAQG;AACH,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC;IAC7D,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAA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B,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,MAAM,CAAC,MAAM,CAAC,IAAI,6BAA6B,CAAC,MAAM,CAAC,CAAC,CAAC;IACzF,CAAC;CACF;AAED,sGAAsG;AACtG,SAAS,aAAa,CAAC,IAAuB,EAAE,OAA2B,EAAE,MAAe;IAC1F,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YAC3D,IAAI,KAAK,KAAK,IAAI;gBAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;;gBAC3C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,4GAA4G;AAC5G,SAAS,yBAAyB;IAChC,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAChC,MAAM,IAAI,6BAA6B,CAAC,6BAA6B,GAAG,iBAAiB,CAAC,CAAC;AAC7F,CAAC;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC","sourcesContent":["import childProcess, { type ChildProcess } from 'node:child_process';\nimport { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { describeCaughtError } from '@wildo-ai/saas-models/public-runtime';\n\n/**\n * Read-only `git` invocations, spawned by a small long-lived helper process instead of by the companion (#3204).\n *\n * ## Why\n *\n * Starting a process forks its parent, and on Linux the fork copies the parent's page tables while the calling thread\n * waits. The companion runs with a 1.5–2 GB heap during a build, and measured on the reference VM one `git rev-parse`\n * blocked a 2 GB process's main thread for 8.5 ms against 1.1 ms from a 50 MB one. The build's landing derivation and\n * change-set reads run `git` about a dozen times a second, so a 90 s CPU profile of the reference run's companion\n * (2026-11-14) spent 10 s of the main thread inside `spawn` for read-only git alone, while every workbench request waited.\n * From a helper the companion pays one IPC message each way; the fork happens in a process with a few tens of MB.\n *\n * ## What it never does\n *\n * Only READ-ONLY git goes through it ({@link isBrokerableGitInvocation}): a subcommand the companion's write recording\n * (`local-write-recording.companion.ts`) treats as unable to write anything a fingerprint reads. A write must stay a\n * direct spawn, because that recording sees a subprocess only when the companion starts it, and a write it did not see\n * would leave a derived input's fingerprint stale.\n *\n * ## Failing toward the direct spawn\n *\n * Every answer is the one `execFile` would give: the same stdout and stderr strings, and on failure an `Error` carrying\n * `code`, `signal`, `killed`, `stdout` and `stderr`, with `execFile`'s own message. When the helper cannot start, exits or\n * loses its channel, the call it was serving is retried as a direct spawn (a read-only command is safe to run twice), and\n * the next call starts a fresh helper. After {@link MAXIMUM_BROKER_FAILURES} consecutive failures the companion spawns\n * directly for the rest of its life.\n *\n * This module imports nothing but Node built-ins, so the helper can run from this `.ts` file under Node's type stripping\n * (the companion under test, or run from source) as well as from the compiled `.js`.\n */\n\n/**\n * Git subcommands that write nothing a fingerprint reads. THE one list: the write recording\n * (`local-write-recording.companion.ts`) reads it through {@link isBrokerableGitInvocation} to decide which subprocesses\n * cannot have written, and the helper may run only these.\n *\n * `status` may refresh `.git/index`, which no fingerprint reads (the creation plane signs `HEAD` and `logs/HEAD`). Kept\n * narrow on purpose: a subcommand missing here costs one walk per fingerprint (and a direct spawn), a subcommand wrongly\n * here costs a stale fingerprint.\n */\nconst READ_ONLY_GIT_SUBCOMMANDS: ReadonlySet<string> = new Set([\n 'status', 'ls-files', 'rev-parse', 'log', 'show', 'diff', 'cat-file', 'ls-tree', 'for-each-ref', 'merge-base',\n 'rev-list', 'describe', 'blame', 'grep', 'check-ignore', 'diff-tree', 'diff-index', 'name-rev',\n]);\n\n/** Whether `git <args>` may run through the helper: its subcommand (after `-C`/`-c` and options) is read-only. */\nexport function isBrokerableGitInvocation(args: readonly string[]): boolean {\n for (let index = 0; index < args.length; index += 1) {\n const argument = args[index]!;\n if (argument === '-C' || argument === '-c' || argument === '--git-dir' || argument === '--work-tree') {\n index += 1;\n continue;\n }\n if (argument.startsWith('-')) continue;\n return READ_ONLY_GIT_SUBCOMMANDS.has(argument);\n }\n return false;\n}\n\n/** `execFile`'s options that a read-only git call uses, plus the stdin a `--batch` read is fed. */\nexport interface BrokeredGitOptions {\n readonly maxBuffer?: number;\n readonly timeout?: number;\n /** The FULL environment, as `execFile` takes it; omitted, the helper's own (the companion's at the helper's start). */\n readonly env?: Readonly<Record<string, string | undefined>>;\n /** Written to git's stdin, which is then closed (`cat-file --batch`). Omitted, stdin is left as `execFile` leaves it. */\n readonly input?: string;\n}\n\n/** A read answered as text (`execFile`'s default `utf8`). */\nexport interface BrokeredGitTextResult {\n readonly stdout: string;\n readonly stderr: string;\n}\n\n/** A read answered as bytes (`encoding: 'buffer'`): a blob, or `cat-file --batch` output. */\nexport interface BrokeredGitBufferResult {\n readonly stdout: Buffer;\n readonly stderr: Buffer;\n}\n\n/** What crosses the channel: `serialization: 'advanced'` carries a `Buffer` as a `Uint8Array`, a string as itself. */\ntype Output = string | Uint8Array;\n\ninterface BrokerRequest {\n readonly id: number;\n readonly args: readonly string[];\n readonly options: BrokeredGitOptions;\n readonly binary: boolean;\n}\n\ninterface BrokerFailure {\n readonly message: string;\n readonly code?: number | string | null;\n readonly signal?: string | null;\n readonly killed?: boolean;\n readonly stdout?: Output;\n readonly stderr?: Output;\n}\n\ninterface BrokerResponse {\n readonly id: number;\n readonly stdout?: Output;\n readonly stderr?: Output;\n readonly failure?: BrokerFailure;\n}\n\n/**\n * `execFile` with this module's options, as every path here runs it (the helper, and the direct fallback): the text or\n * the bytes, and the stdin a batch read is fed. The callback receives `execFile`'s own error, stdout and stderr.\n */\nfunction runExecFile(\n args: readonly string[],\n options: BrokeredGitOptions,\n binary: boolean,\n callback: (error: Error | null, stdout: Output, stderr: Output) => void,\n): void {\n const child = childProcess.execFile('git', [...args], {\n ...(binary ? { encoding: 'buffer' as const } : {}),\n ...(options.maxBuffer !== undefined ? { maxBuffer: options.maxBuffer } : {}),\n ...(options.timeout !== undefined ? { timeout: options.timeout } : {}),\n ...(options.env !== undefined ? { env: options.env as NodeJS.ProcessEnv } : {}),\n }, (error, stdout, stderr) => callback(error, stdout as Output, stderr as Output));\n if (options.input !== undefined) {\n // A child that died before the write finished settles through `execFile`'s own callback.\n child.stdin?.on('error', () => undefined);\n child.stdin?.end(options.input);\n }\n}\n\nfunction asBuffer(output: Output | undefined): Buffer {\n if (output === undefined) return Buffer.alloc(0);\n return typeof output === 'string' ? Buffer.from(output) : Buffer.from(output.buffer, output.byteOffset, output.byteLength);\n}\n\nfunction asText(output: Output | undefined): string {\n if (output === undefined) return '';\n return typeof output === 'string' ? output : asBuffer(output).toString('utf8');\n}\n\n/** Marks a process started by {@link GitReadBroker}, so importing this module elsewhere starts nothing. */\nconst GIT_READ_BROKER_ARGUMENT = '--wildo-git-read-broker';\n\n// The helper's side: run each request with `execFile`, answer on the channel, and exit with the companion.\nif (process.argv.includes(GIT_READ_BROKER_ARGUMENT) && typeof process.send === 'function') {\n const send = process.send.bind(process);\n process.on('disconnect', () => process.exit(0));\n process.on('message', (request: BrokerRequest) => {\n if (!isBrokerableGitInvocation(request.args)) {\n send({ id: request.id, failure: { message: `git ${request.args.join(' ')} is not a read-only invocation; the helper refuses it` } } satisfies BrokerResponse);\n return;\n }\n runExecFile(request.args, request.options, request.binary, (error, stdout, stderr) => {\n if (error === null) {\n send({ id: request.id, stdout, stderr } satisfies BrokerResponse);\n return;\n }\n const failed = error as Error & { code?: number | string | null; signal?: string | null; killed?: boolean };\n send({\n id: request.id,\n failure: { message: failed.message, code: failed.code ?? null, signal: failed.signal ?? null, killed: failed.killed ?? false, stdout, stderr },\n } satisfies BrokerResponse);\n });\n });\n}\n\n/** A call the helper could not serve; the caller spawns directly instead. */\nexport class GitReadBrokerUnavailableError extends Error {\n public override readonly name = 'GitReadBrokerUnavailableError';\n}\n\n/** Consecutive helper failures after which the companion spawns read-only git directly for the rest of its life. */\nexport const MAXIMUM_BROKER_FAILURES = 3;\n\n/** The companion's side of the helper. One per process ({@link gitReadBroker}); constructed directly by tests. */\nexport class GitReadBroker {\n private helper: ChildProcess | undefined;\n private nextId = 1;\n private consecutiveFailures = 0;\n private readonly pending = new Map<number, { resolve: (response: BrokerResponse) => void; reject: (error: Error) => void }>();\n // A plain field, not a parameter property: this file runs under type stripping, which refuses non-erasable syntax.\n private readonly options: { readonly entryPath?: string };\n\n public constructor(options: { readonly entryPath?: string } = {}) {\n this.options = options;\n }\n\n /**\n * `git <args>` as `execFile` would run it, through the helper when it is read-only and the helper is available, and\n * directly otherwise. Resolves `{ stdout, stderr }` as text; rejects with `execFile`'s error shape.\n */\n public async execGit(args: readonly string[], options: BrokeredGitOptions = {}): Promise<BrokeredGitTextResult> {\n const { stdout, stderr } = await this.run(args, options, false);\n return { stdout: asText(stdout), stderr: asText(stderr) };\n }\n\n /** {@link execGit} answered as bytes (`execFile`'s `encoding: 'buffer'`): a blob, or a `--batch` read. */\n public async execGitBuffer(args: readonly string[], options: BrokeredGitOptions = {}): Promise<BrokeredGitBufferResult> {\n const { stdout, stderr } = await this.run(args, options, true);\n return { stdout: asBuffer(stdout), stderr: asBuffer(stderr) };\n }\n\n /** Whether the helper has been given up on for this process. For tests and logs. */\n public get disabled(): boolean {\n return this.consecutiveFailures >= MAXIMUM_BROKER_FAILURES;\n }\n\n /**\n * Stop the helper (tests). A call it was serving is answered by a direct spawn, as when the helper dies. The companion\n * itself never calls this: the helper exits when the companion's IPC channel closes, which the companion's exit does.\n */\n public close(): void {\n const helper = this.helper;\n if (helper === undefined) return;\n this.failPending(helper, 'the git read helper was closed');\n helper.disconnect?.();\n }\n\n /** The helper's pid, or `undefined` when none runs. For tests. */\n public get helperPid(): number | undefined {\n return this.helper?.pid;\n }\n\n private async run(args: readonly string[], options: BrokeredGitOptions, binary: boolean): Promise<{ stdout: Output; stderr: Output }> {\n if (isBrokerableGitInvocation(args)) {\n try {\n return await this.viaHelper(args, options, binary);\n } catch (error) {\n if (!(error instanceof GitReadBrokerUnavailableError)) throw error;\n }\n }\n return directExecGit(args, options, binary);\n }\n\n private viaHelper(args: readonly string[], options: BrokeredGitOptions, binary: boolean): Promise<{ stdout: Output; stderr: Output }> {\n const helper = this.ensureHelper();\n if (helper === undefined) return Promise.reject(new GitReadBrokerUnavailableError('no git read helper is available'));\n const id = this.nextId;\n this.nextId += 1;\n return new Promise<BrokerResponse>((resolve, reject) => {\n this.pending.set(id, { resolve, reject });\n // Referenced only while a call is pending: an idle helper never keeps the companion alive.\n if (this.pending.size === 1) helper.channel?.ref?.();\n try {\n helper.send({ id, args, options, binary } satisfies BrokerRequest);\n } catch (error) {\n this.pending.delete(id);\n reject(new GitReadBrokerUnavailableError(`the git read helper could not be sent the call: ${describeCaughtError(error)}`));\n }\n }).then((response) => {\n if (response.failure === undefined) return { stdout: response.stdout ?? '', stderr: response.stderr ?? '' };\n // `execFile`'s own error, rebuilt: its message, exit code, signal, and the output it had, in the caller's encoding.\n throw Object.assign(new Error(response.failure.message), {\n code: response.failure.code,\n signal: response.failure.signal,\n killed: response.failure.killed,\n stdout: binary ? asBuffer(response.failure.stdout) : asText(response.failure.stdout),\n stderr: binary ? asBuffer(response.failure.stderr) : asText(response.failure.stderr),\n });\n });\n }\n\n private ensureHelper(): ChildProcess | undefined {\n if (this.helper !== undefined) return this.helper;\n if (this.disabled) return undefined;\n let helper: ChildProcess;\n try {\n const entryPath = this.options.entryPath ?? resolveGitReadBrokerEntry();\n /*\n * `execArgv: []`: the companion's own flags (its heap size, its loaders) are not the helper's, and a large heap\n * limit is exactly what the helper exists to avoid. Its environment is the companion's, so git sees the same one.\n * `serialization: 'advanced'` carries a blob's bytes as bytes rather than as text that would have to be re-encoded.\n */\n helper = childProcess.fork(entryPath, [GIT_READ_BROKER_ARGUMENT], { execArgv: [], serialization: 'advanced', stdio: ['ignore', 'ignore', 'inherit', 'ipc'] });\n } catch {\n this.consecutiveFailures += 1;\n return undefined;\n }\n helper.unref();\n helper.channel?.unref?.();\n helper.on('message', (response: BrokerResponse) => {\n const waiter = this.pending.get(response.id);\n if (waiter === undefined) return;\n this.pending.delete(response.id);\n if (this.pending.size === 0) helper.channel?.unref?.();\n this.consecutiveFailures = 0;\n waiter.resolve(response);\n });\n const fail = (reason: string): void => {\n if (this.helper !== helper) return;\n this.consecutiveFailures += 1;\n this.failPending(helper, reason);\n // A failure that is not an exit (an error, a lost channel) can leave the process running: stop the one it forgot.\n if (helper.exitCode === null && helper.signalCode === null) helper.kill();\n };\n helper.on('error', (error: Error) => fail(`the git read helper failed: ${error.message}`));\n helper.on('exit', (code, signal) => fail(`the git read helper exited (code ${String(code)}, signal ${String(signal)})`));\n helper.on('disconnect', () => fail('the git read helper lost its channel'));\n this.helper = helper;\n return helper;\n }\n\n /** Forget the helper and fail every call it was serving as unavailable, so each is answered by a direct spawn. */\n private failPending(helper: ChildProcess, reason: string): void {\n if (this.helper !== helper) return;\n this.helper = undefined;\n const waiters = [...this.pending.values()];\n this.pending.clear();\n for (const waiter of waiters) waiter.reject(new GitReadBrokerUnavailableError(reason));\n }\n}\n\n/** The direct spawn: what every call did before the helper, and the fallback when it cannot serve. */\nfunction directExecGit(args: readonly string[], options: BrokeredGitOptions, binary: boolean): Promise<{ stdout: Output; stderr: Output }> {\n return new Promise((resolve, reject) => {\n runExecFile(args, options, binary, (error, stdout, stderr) => {\n if (error === null) resolve({ stdout, stderr });\n else reject(Object.assign(error, { stdout, stderr }));\n });\n });\n}\n\n/** This module's own file: the compiled `.js` in a build, the `.ts` when the companion runs from source. */\nfunction resolveGitReadBrokerEntry(): string {\n const own = fileURLToPath(import.meta.url);\n if (existsSync(own)) return own;\n throw new GitReadBrokerUnavailableError(`the git read helper entry ${own} does not exist`);\n}\n\n/** The process's helper: one per companion. */\nexport const gitReadBroker = new GitReadBroker();\n"]}
|
|
@@ -9,7 +9,14 @@ export interface LocalWriteSink {
|
|
|
9
9
|
}
|
|
10
10
|
/** Route recorded writes to `next` (the watcher's generations), or nowhere. */
|
|
11
11
|
export declare function setLocalWriteSink(next: LocalWriteSink | undefined): void;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Whether a subprocess cannot have written anything a fingerprint reads: a `git` whose subcommand is in the read-only set.
|
|
14
|
+
* Every other subprocess (another git subcommand, the CLI, a generator, a coding agent, a package manager) is taken to
|
|
15
|
+
* have possibly written.
|
|
16
|
+
*
|
|
17
|
+
* The set lives with the git read helper (`git-read-broker.companion.ts`, #3204), which may spawn only what this says is
|
|
18
|
+
* read-only: one list, so the helper can never run a git invocation this recording would have had to see.
|
|
19
|
+
*/
|
|
13
20
|
export declare function subprocessIsReadOnly(command: string, args: readonly string[]): boolean;
|
|
14
21
|
/**
|
|
15
22
|
* Record every file this process writes, the moment the write completes, and every subprocess that may have written
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-write-recording.companion.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/local-write-recording.companion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-write-recording.companion.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/local-write-recording.companion.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+FAA+F;IAC/F,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qDAAqD;IACrD,mBAAmB,IAAI,IAAI,CAAC;CAC7B;AAKD,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEtF;AAyBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAgGjD"}
|
|
@@ -7,6 +7,7 @@ import { basename } from 'node:path';
|
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import { promisify } from 'node:util';
|
|
9
9
|
import { realPathOrProjection } from './derived-input-change-feed.companion.utils.js';
|
|
10
|
+
import { isBrokerableGitInvocation } from './git-read-broker.companion.js';
|
|
10
11
|
let sink;
|
|
11
12
|
let installed = false;
|
|
12
13
|
/** Route recorded writes to `next` (the watcher's generations), or nowhere. */
|
|
@@ -14,32 +15,15 @@ export function setLocalWriteSink(next) {
|
|
|
14
15
|
sink = next;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
* generator, a coding agent, a package manager) is taken to
|
|
18
|
+
* Whether a subprocess cannot have written anything a fingerprint reads: a `git` whose subcommand is in the read-only set.
|
|
19
|
+
* Every other subprocess (another git subcommand, the CLI, a generator, a coding agent, a package manager) is taken to
|
|
20
|
+
* have possibly written.
|
|
19
21
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* stale fingerprint.
|
|
22
|
+
* The set lives with the git read helper (`git-read-broker.companion.ts`, #3204), which may spawn only what this says is
|
|
23
|
+
* read-only: one list, so the helper can never run a git invocation this recording would have had to see.
|
|
23
24
|
*/
|
|
24
|
-
const READ_ONLY_GIT_SUBCOMMANDS = new Set([
|
|
25
|
-
'status', 'ls-files', 'rev-parse', 'log', 'show', 'diff', 'cat-file', 'ls-tree', 'for-each-ref', 'merge-base',
|
|
26
|
-
'rev-list', 'describe', 'blame', 'grep', 'check-ignore', 'diff-tree', 'diff-index', 'name-rev',
|
|
27
|
-
]);
|
|
28
|
-
/** Whether a subprocess cannot have written anything a fingerprint reads. */
|
|
29
25
|
export function subprocessIsReadOnly(command, args) {
|
|
30
|
-
|
|
31
|
-
return false;
|
|
32
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
33
|
-
const argument = args[index];
|
|
34
|
-
if (argument === '-C' || argument === '-c' || argument === '--git-dir' || argument === '--work-tree') {
|
|
35
|
-
index += 1;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (argument.startsWith('-'))
|
|
39
|
-
continue;
|
|
40
|
-
return READ_ONLY_GIT_SUBCOMMANDS.has(argument);
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
26
|
+
return basename(command) === 'git' && isBrokerableGitInvocation(args);
|
|
43
27
|
}
|
|
44
28
|
function pathOf(value) {
|
|
45
29
|
if (typeof value === 'string')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-write-recording.companion.js","sourceRoot":"","sources":["../../../../src/core/utils/local-write-recording.companion.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,qHAAqH;AACrH,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAYnF,IAAI,IAAgC,CAAC;AACrC,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB,CAAC,IAAgC;IAChE,IAAI,GAAG,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC;IAC7D,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY;IAC7G,UAAU,E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,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE;gBAChD,KAAK,EAAE,SAAS,0BAA0B,CAAgB,GAAG,IAAe;oBAC1E,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAsE,CAAC;oBAChH,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;oBACrD,OAAO,OAAO,CAAC;gBACjB,CAAC;aACF,CAAC,CAAC;QACL,CAAC;QACD,aAAa,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;IACjC,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAE,CAAC;QACtC,aAAa,CAAC,IAAI,CAAC,GAAG,SAAS,sBAAsB,CAAgB,GAAG,IAAe;YACrF,IAAI,CAAC;gBACH,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC;oBAAS,CAAC;gBACT,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IACD,qBAAqB,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["// The DEFAULT imports on purpose: they are the mutable CommonJS module objects every caller reaches, and the place the\n// patches below must go. `import * as` would be an ES module namespace, which is frozen, and assigning to it throws.\nimport childProcess from 'node:child_process';\nimport fs from 'node:fs';\nimport { syncBuiltinESMExports } from 'node:module';\nimport { basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport { realPathOrProjection } from './derived-input-change-feed.companion.utils';\n\n/**\n * Where the companion's own writes are recorded: the change feed's generations, once the source watcher runs.\n */\nexport interface LocalWriteSink {\n /** A path this process just finished writing, renaming, creating or removing (a real path). */\n noteLocalWrite(path: string): void;\n /** A subprocess that may have written just ended. */\n noteSubprocessEnded(): void;\n}\n\nlet sink: LocalWriteSink | undefined;\nlet installed = false;\n\n/** Route recorded writes to `next` (the watcher's generations), or nowhere. */\nexport function setLocalWriteSink(next: LocalWriteSink | undefined): void {\n sink = next;\n}\n\n/**\n * Git subcommands that write nothing a fingerprint reads. Every other subprocess (another git subcommand, the CLI, a\n * generator, a coding agent, a package manager) is taken to have possibly written.\n *\n * `status` may refresh `.git/index`, which no fingerprint reads (the creation plane signs `HEAD` and `logs/HEAD`). Kept\n * narrow on purpose: a subcommand missing here costs one walk per fingerprint, a subcommand wrongly here costs a\n * stale fingerprint.\n */\nconst READ_ONLY_GIT_SUBCOMMANDS: ReadonlySet<string> = new Set([\n 'status', 'ls-files', 'rev-parse', 'log', 'show', 'diff', 'cat-file', 'ls-tree', 'for-each-ref', 'merge-base',\n 'rev-list', 'describe', 'blame', 'grep', 'check-ignore', 'diff-tree', 'diff-index', 'name-rev',\n]);\n\n/** Whether a subprocess cannot have written anything a fingerprint reads. */\nexport function subprocessIsReadOnly(command: string, args: readonly string[]): boolean {\n if (basename(command) !== 'git') return false;\n for (let index = 0; index < args.length; index += 1) {\n const argument = args[index]!;\n if (argument === '-C' || argument === '-c' || argument === '--git-dir' || argument === '--work-tree') {\n index += 1;\n continue;\n }\n if (argument.startsWith('-')) continue;\n return READ_ONLY_GIT_SUBCOMMANDS.has(argument);\n }\n return false;\n}\n\nfunction pathOf(value: unknown): string | undefined {\n if (typeof value === 'string') return value;\n if (value instanceof URL) return value.protocol === 'file:' ? fileURLToPath(value) : undefined;\n if (Buffer.isBuffer(value)) return value.toString();\n return undefined;\n}\n\nfunction record(values: readonly unknown[]): void {\n if (sink === undefined) return;\n for (const value of values) {\n const path = pathOf(value);\n if (path !== undefined) sink.noteLocalWrite(realPathOrProjection(path));\n }\n}\n\n/** The arguments of each write operation that name a path it changes, by index. */\nconst WRITE_OPERATIONS: Readonly<Record<string, readonly number[]>> = {\n writeFile: [0], appendFile: [0], rename: [0, 1], unlink: [0], rm: [0], rmdir: [0], mkdir: [0], copyFile: [1],\n cp: [1], symlink: [1], link: [1], truncate: [0], utimes: [0], lutimes: [0], mkdtemp: [],\n};\n\ntype AnyFunction = (...args: unknown[]) => unknown;\n\n/**\n * Record every file this process writes, the moment the write completes, and every subprocess that may have written\n * (#3452 second review M2).\n *\n * ## Why at the `fs` boundary\n *\n * The change feed learns of a write from the watcher, 6-15 ms after it happens. The companion itself writes inputs it\n * reads back at once: a specification file it lands, label files, the brand module, and the outputs of the generators it\n * awaits (`wildo db generate`, `design-tokens generate`). Without this, a fingerprint read right after such a write is\n * the one taken before it. The writers are spread over 32 files; recording them one by one is a list that drifts the\n * first time someone adds a writer (`.claude/rules/invariant-call-site-enumeration.md`), so the record is taken where\n * every write passes: the `fs` functions and their promise forms, and the `child_process` functions.\n *\n * Installed by the entry's second import (`install-local-write-recording.companion.ts`), before any other module\n * captures an `fs` function, and synced into ES-module named imports with `syncBuiltinESMExports`. Never on import of this\n * module, so a test that imports the watcher does not patch its own process. A write made through a file DESCRIPTOR (`fs.write` on an fd) names no path\n * and is not recorded; its file is reached by a recorded `rename` when it is atomic, and otherwise by the watcher's event.\n *\n * The record only ever makes a fingerprint walk sooner. It decides nothing about the write and cannot fail it: the\n * original function runs exactly as before, and the record happens after it.\n */\nexport function installLocalWriteRecording(): void {\n if (installed) return;\n installed = true;\n const fsModule = fs as unknown as Record<string, AnyFunction>;\n const promises = fs.promises as unknown as Record<string, AnyFunction>;\n for (const [name, pathIndexes] of Object.entries(WRITE_OPERATIONS)) {\n const paths = (args: readonly unknown[]): unknown[] => pathIndexes.map((index) => args[index]);\n const callbackForm = fsModule[name];\n if (typeof callbackForm === 'function') {\n fsModule[name] = function recordedCallbackForm(this: unknown, ...args: unknown[]) {\n const last = args.length - 1;\n if (last >= 0 && typeof args[last] === 'function') {\n const callback = args[last] as AnyFunction;\n const targets = paths(args);\n args[last] = (...results: unknown[]) => {\n if (results[0] === null || results[0] === undefined) record(targets);\n return callback(...results);\n };\n }\n return callbackForm.apply(this, args);\n };\n }\n const syncForm = fsModule[`${name}Sync`];\n if (typeof syncForm === 'function') {\n fsModule[`${name}Sync`] = function recordedSyncForm(this: unknown, ...args: unknown[]) {\n const result = syncForm.apply(this, args);\n record(paths(args));\n return result;\n };\n }\n const promiseForm = promises[name];\n if (typeof promiseForm === 'function') {\n promises[name] = function recordedPromiseForm(this: unknown, ...args: unknown[]) {\n return (promiseForm.apply(this, args) as Promise<unknown>).then((result) => {\n record(paths(args));\n return result;\n });\n };\n }\n }\n const createWriteStream = fsModule.createWriteStream!;\n fsModule.createWriteStream = function recordedCreateWriteStream(this: unknown, ...args: unknown[]) {\n const stream = createWriteStream.apply(this, args) as fs.WriteStream;\n stream.once('close', () => record([args[0]]));\n return stream;\n };\n\n const processModule = childProcess as unknown as Record<string, AnyFunction>;\n const commandOf = (name: string, args: readonly unknown[]): { command: string; argv: string[] } => {\n if (name === 'exec' || name === 'execSync') {\n const words = String(args[0] ?? '').trim().split(/\\s+/u);\n return { command: words[0] ?? '', argv: words.slice(1) };\n }\n if (name === 'fork') return { command: 'node', argv: [] };\n return { command: String(args[0] ?? ''), argv: Array.isArray(args[1]) ? args[1].map(String) : [] };\n };\n const ended = (name: string, args: readonly unknown[]): void => {\n const { command, argv } = commandOf(name, args);\n if (!subprocessIsReadOnly(command, argv)) sink?.noteSubprocessEnded();\n };\n for (const name of ['spawn', 'execFile', 'exec', 'fork']) {\n const original = processModule[name]!;\n const recorded = function recordedSubprocess(this: unknown, ...args: unknown[]) {\n const child = original.apply(this, args) as childProcess.ChildProcess;\n child.once('exit', () => ended(name, args));\n return child;\n };\n /*\n * `execFile` and `exec` carry Node's own promise form (`util.promisify.custom`), resolving to `{ stdout, stderr }`.\n * A wrapper without it makes every `promisify(execFile)` evaluated after this install resolve to the bare stdout, so\n * `const { stdout } = await …` reads `undefined` (#3204, reference run 42486534966: every git read of the playbook\n * write register threw, and no playbook result was ever accepted). So the wrapper keeps that form, recording the end.\n */\n const promised = (original as unknown as Record<symbol, AnyFunction | undefined>)[promisify.custom];\n if (promised !== undefined) {\n Object.defineProperty(recorded, promisify.custom, {\n value: function recordedPromisedSubprocess(this: unknown, ...args: unknown[]) {\n const promise = promised.apply(this, args) as Promise<unknown> & { readonly child?: childProcess.ChildProcess };\n promise.child?.once('exit', () => ended(name, args));\n return promise;\n },\n });\n }\n processModule[name] = recorded;\n }\n for (const name of ['spawnSync', 'execFileSync', 'execSync']) {\n const original = processModule[name]!;\n processModule[name] = function recordedSyncSubprocess(this: unknown, ...args: unknown[]) {\n try {\n return original.apply(this, args);\n } finally {\n ended(name, args);\n }\n };\n }\n syncBuiltinESMExports();\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"local-write-recording.companion.js","sourceRoot":"","sources":["../../../../src/core/utils/local-write-recording.companion.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,qHAAqH;AACrH,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAYxE,IAAI,IAAgC,CAAC;AACrC,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB,CAAC,IAAgC;IAChE,IAAI,GAAG,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,I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AAgB,GAAG,IAAe;YACrF,IAAI,CAAC;gBACH,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC;oBAAS,CAAC;gBACT,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IACD,qBAAqB,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["// The DEFAULT imports on purpose: they are the mutable CommonJS module objects every caller reaches, and the place the\n// patches below must go. `import * as` would be an ES module namespace, which is frozen, and assigning to it throws.\nimport childProcess from 'node:child_process';\nimport fs from 'node:fs';\nimport { syncBuiltinESMExports } from 'node:module';\nimport { basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport { realPathOrProjection } from './derived-input-change-feed.companion.utils';\nimport { isBrokerableGitInvocation } from './git-read-broker.companion';\n\n/**\n * Where the companion's own writes are recorded: the change feed's generations, once the source watcher runs.\n */\nexport interface LocalWriteSink {\n /** A path this process just finished writing, renaming, creating or removing (a real path). */\n noteLocalWrite(path: string): void;\n /** A subprocess that may have written just ended. */\n noteSubprocessEnded(): void;\n}\n\nlet sink: LocalWriteSink | undefined;\nlet installed = false;\n\n/** Route recorded writes to `next` (the watcher's generations), or nowhere. */\nexport function setLocalWriteSink(next: LocalWriteSink | undefined): void {\n sink = next;\n}\n\n/**\n * Whether a subprocess cannot have written anything a fingerprint reads: a `git` whose subcommand is in the read-only set.\n * Every other subprocess (another git subcommand, the CLI, a generator, a coding agent, a package manager) is taken to\n * have possibly written.\n *\n * The set lives with the git read helper (`git-read-broker.companion.ts`, #3204), which may spawn only what this says is\n * read-only: one list, so the helper can never run a git invocation this recording would have had to see.\n */\nexport function subprocessIsReadOnly(command: string, args: readonly string[]): boolean {\n return basename(command) === 'git' && isBrokerableGitInvocation(args);\n}\n\nfunction pathOf(value: unknown): string | undefined {\n if (typeof value === 'string') return value;\n if (value instanceof URL) return value.protocol === 'file:' ? fileURLToPath(value) : undefined;\n if (Buffer.isBuffer(value)) return value.toString();\n return undefined;\n}\n\nfunction record(values: readonly unknown[]): void {\n if (sink === undefined) return;\n for (const value of values) {\n const path = pathOf(value);\n if (path !== undefined) sink.noteLocalWrite(realPathOrProjection(path));\n }\n}\n\n/** The arguments of each write operation that name a path it changes, by index. */\nconst WRITE_OPERATIONS: Readonly<Record<string, readonly number[]>> = {\n writeFile: [0], appendFile: [0], rename: [0, 1], unlink: [0], rm: [0], rmdir: [0], mkdir: [0], copyFile: [1],\n cp: [1], symlink: [1], link: [1], truncate: [0], utimes: [0], lutimes: [0], mkdtemp: [],\n};\n\ntype AnyFunction = (...args: unknown[]) => unknown;\n\n/**\n * Record every file this process writes, the moment the write completes, and every subprocess that may have written\n * (#3452 second review M2).\n *\n * ## Why at the `fs` boundary\n *\n * The change feed learns of a write from the watcher, 6-15 ms after it happens. The companion itself writes inputs it\n * reads back at once: a specification file it lands, label files, the brand module, and the outputs of the generators it\n * awaits (`wildo db generate`, `design-tokens generate`). Without this, a fingerprint read right after such a write is\n * the one taken before it. The writers are spread over 32 files; recording them one by one is a list that drifts the\n * first time someone adds a writer (`.claude/rules/invariant-call-site-enumeration.md`), so the record is taken where\n * every write passes: the `fs` functions and their promise forms, and the `child_process` functions.\n *\n * Installed by the entry's second import (`install-local-write-recording.companion.ts`), before any other module\n * captures an `fs` function, and synced into ES-module named imports with `syncBuiltinESMExports`. Never on import of this\n * module, so a test that imports the watcher does not patch its own process. A write made through a file DESCRIPTOR (`fs.write` on an fd) names no path\n * and is not recorded; its file is reached by a recorded `rename` when it is atomic, and otherwise by the watcher's event.\n *\n * The record only ever makes a fingerprint walk sooner. It decides nothing about the write and cannot fail it: the\n * original function runs exactly as before, and the record happens after it.\n */\nexport function installLocalWriteRecording(): void {\n if (installed) return;\n installed = true;\n const fsModule = fs as unknown as Record<string, AnyFunction>;\n const promises = fs.promises as unknown as Record<string, AnyFunction>;\n for (const [name, pathIndexes] of Object.entries(WRITE_OPERATIONS)) {\n const paths = (args: readonly unknown[]): unknown[] => pathIndexes.map((index) => args[index]);\n const callbackForm = fsModule[name];\n if (typeof callbackForm === 'function') {\n fsModule[name] = function recordedCallbackForm(this: unknown, ...args: unknown[]) {\n const last = args.length - 1;\n if (last >= 0 && typeof args[last] === 'function') {\n const callback = args[last] as AnyFunction;\n const targets = paths(args);\n args[last] = (...results: unknown[]) => {\n if (results[0] === null || results[0] === undefined) record(targets);\n return callback(...results);\n };\n }\n return callbackForm.apply(this, args);\n };\n }\n const syncForm = fsModule[`${name}Sync`];\n if (typeof syncForm === 'function') {\n fsModule[`${name}Sync`] = function recordedSyncForm(this: unknown, ...args: unknown[]) {\n const result = syncForm.apply(this, args);\n record(paths(args));\n return result;\n };\n }\n const promiseForm = promises[name];\n if (typeof promiseForm === 'function') {\n promises[name] = function recordedPromiseForm(this: unknown, ...args: unknown[]) {\n return (promiseForm.apply(this, args) as Promise<unknown>).then((result) => {\n record(paths(args));\n return result;\n });\n };\n }\n }\n const createWriteStream = fsModule.createWriteStream!;\n fsModule.createWriteStream = function recordedCreateWriteStream(this: unknown, ...args: unknown[]) {\n const stream = createWriteStream.apply(this, args) as fs.WriteStream;\n stream.once('close', () => record([args[0]]));\n return stream;\n };\n\n const processModule = childProcess as unknown as Record<string, AnyFunction>;\n const commandOf = (name: string, args: readonly unknown[]): { command: string; argv: string[] } => {\n if (name === 'exec' || name === 'execSync') {\n const words = String(args[0] ?? '').trim().split(/\\s+/u);\n return { command: words[0] ?? '', argv: words.slice(1) };\n }\n if (name === 'fork') return { command: 'node', argv: [] };\n return { command: String(args[0] ?? ''), argv: Array.isArray(args[1]) ? args[1].map(String) : [] };\n };\n const ended = (name: string, args: readonly unknown[]): void => {\n const { command, argv } = commandOf(name, args);\n if (!subprocessIsReadOnly(command, argv)) sink?.noteSubprocessEnded();\n };\n for (const name of ['spawn', 'execFile', 'exec', 'fork']) {\n const original = processModule[name]!;\n const recorded = function recordedSubprocess(this: unknown, ...args: unknown[]) {\n const child = original.apply(this, args) as childProcess.ChildProcess;\n child.once('exit', () => ended(name, args));\n return child;\n };\n /*\n * `execFile` and `exec` carry Node's own promise form (`util.promisify.custom`), resolving to `{ stdout, stderr }`.\n * A wrapper without it makes every `promisify(execFile)` evaluated after this install resolve to the bare stdout, so\n * `const { stdout } = await …` reads `undefined` (#3204, reference run 42486534966: every git read of the playbook\n * write register threw, and no playbook result was ever accepted). So the wrapper keeps that form, recording the end.\n */\n const promised = (original as unknown as Record<symbol, AnyFunction | undefined>)[promisify.custom];\n if (promised !== undefined) {\n Object.defineProperty(recorded, promisify.custom, {\n value: function recordedPromisedSubprocess(this: unknown, ...args: unknown[]) {\n const promise = promised.apply(this, args) as Promise<unknown> & { readonly child?: childProcess.ChildProcess };\n promise.child?.once('exit', () => ended(name, args));\n return promise;\n },\n });\n }\n processModule[name] = recorded;\n }\n for (const name of ['spawnSync', 'execFileSync', 'execSync']) {\n const original = processModule[name]!;\n processModule[name] = function recordedSyncSubprocess(this: unknown, ...args: unknown[]) {\n try {\n return original.apply(this, args);\n } finally {\n ended(name, args);\n }\n };\n }\n syncBuiltinESMExports();\n}\n\n"]}
|
|
@@ -109,6 +109,11 @@ export interface EmailTemplateStatusResult {
|
|
|
109
109
|
exists: boolean;
|
|
110
110
|
updatedAt: string;
|
|
111
111
|
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Why the template has no place (#3904 review F2): its owner registers templates from no folder the companion can read,
|
|
114
|
+
* so generation writes nothing for it. `templatePath` is then empty and `templateExists` false.
|
|
115
|
+
*/
|
|
116
|
+
notPlacedBecause?: string;
|
|
112
117
|
}
|
|
113
118
|
/**
|
|
114
119
|
* Translate filesystem `labels.{primaryLocale}.ts` → `labels.{targetLocale}.ts` for each template directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/email/services/email-template.companion.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"email-template.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/email/services/email-template.companion.service.ts"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,mCAAmC,EACxC,aAAa,EACb,0BAA0B,EAE1B,KAAK,oBAAoB,EAE1B,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,sBAAsB,EAEvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAqB,MAAM,qCAAqC,CAAC;AAsB3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAM7E,OAAO,EAAE,oCAAoC,EAAE,MAAM,2EAA2E,CAAC;AACjI,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,sCAAsC,EAAE,MAAM,+CAA+C,CAAC;AACvG,OAAO,EAAE,2CAA2C,EAAE,MAAM,oDAAoD,CAAC;AACjH,OAAO,EAAE,2CAA2C,EAAE,MAAM,gFAAgF,CAAC;AAC7I,OAAO,EAAE,qCAAqC,EAAE,MAAM,wEAAwE,CAAC;AAE/H,OAAO,EAGL,KAAK,gCAAgC,EACtC,MAAM,uDAAuD,CAAC;AAG/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAQvG,+FAA+F;AAC/F,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,qBAAqB,CAAC,GAAG;IACjG,mBAAmB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,6BAA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