@wildo-ai/dev-companion 1.1.8 → 1.1.9
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/bin/companion-supervisor.d.mts +33 -0
- package/bin/companion-supervisor.mjs +174 -0
- package/bin/wildo-dev-companion-supervised.mjs +16 -0
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.js +8 -2
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.js.map +1 -1
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.js +8 -2
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.js.map +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.d.ts +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.d.ts.map +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.js +9 -11
- package/dist/esm/brand/services/brand-accept.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.d.ts +21 -0
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.js +33 -1
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.js.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +41 -2
- 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 +43 -1
- 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 +57 -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 +75 -1
- 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 +90 -5
- 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 +242 -22
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.d.ts +23 -2
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +13 -2
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -7
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +315 -39
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/config/primary-language.companion.utils.d.ts +5 -4
- package/dist/esm/core/config/primary-language.companion.utils.d.ts.map +1 -1
- package/dist/esm/core/config/primary-language.companion.utils.js +5 -4
- package/dist/esm/core/config/primary-language.companion.utils.js.map +1 -1
- package/dist/esm/core/context/application-module-generations.companion.d.ts +103 -0
- package/dist/esm/core/context/application-module-generations.companion.d.ts.map +1 -0
- package/dist/esm/core/context/application-module-generations.companion.js +313 -0
- package/dist/esm/core/context/application-module-generations.companion.js.map +1 -0
- package/dist/esm/core/context/companion-package-loaders.companion.d.ts +19 -19
- package/dist/esm/core/context/companion-package-loaders.companion.d.ts.map +1 -1
- package/dist/esm/core/context/companion-package-loaders.companion.js +52 -40
- package/dist/esm/core/context/companion-package-loaders.companion.js.map +1 -1
- package/dist/esm/core/inject/models/container.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.js +4 -0
- package/dist/esm/core/inject/models/container.js.map +1 -1
- package/dist/esm/core/inject/models/service-types.d.ts +4 -0
- package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/core/inject/models/service-types.js +4 -0
- package/dist/esm/core/inject/models/service-types.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.d.ts +15 -1
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.js +38 -3
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.d.ts +21 -0
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.js +64 -25
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.js.map +1 -1
- 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 +2 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +0 -28
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +192 -19
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.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 +27 -5
- 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 +47 -0
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js +98 -0
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +6 -1
- 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 +20 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +34 -8
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +61 -12
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.d.ts +44 -0
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.js +104 -0
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +41 -22
- 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 +64 -47
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts +7 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.js +13 -4
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +7 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -1
- package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts +4 -4
- package/dist/esm/core/runtime/companion-env-file.d.ts +39 -9
- package/dist/esm/core/runtime/companion-env-file.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-env-file.js +75 -16
- package/dist/esm/core/runtime/companion-env-file.js.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +7 -3
- 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 +29 -11
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/utils/bounded-concurrency.utils.d.ts +17 -0
- package/dist/esm/core/utils/bounded-concurrency.utils.d.ts.map +1 -0
- package/dist/esm/core/utils/bounded-concurrency.utils.js +37 -0
- package/dist/esm/core/utils/bounded-concurrency.utils.js.map +1 -0
- package/dist/esm/core/utils/derived-input-signature.companion.utils.d.ts +10 -1
- package/dist/esm/core/utils/derived-input-signature.companion.utils.d.ts.map +1 -1
- package/dist/esm/core/utils/derived-input-signature.companion.utils.js +9 -2
- package/dist/esm/core/utils/derived-input-signature.companion.utils.js.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.js +2 -0
- package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.js.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.function-tools.d.ts.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.function-tools.js +66 -6
- package/dist/esm/creation-conversation/creation-conversation.function-tools.js.map +1 -1
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts +0 -17
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js +10 -4
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts +6 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.js +4 -1
- package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js +8 -2
- package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js +8 -2
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js +7 -7
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.en.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.en.js +41 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.js +7 -0
- package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.d.ts +5 -0
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.js +5 -0
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +2 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.d.ts +46 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.js +12 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +266 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +91 -5
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts +41 -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 +45 -1
- package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/localization.en.d.ts +82 -0
- package/dist/esm/i18n/system_enums/localization.en.d.ts.map +1 -0
- package/dist/esm/i18n/system_enums/localization.en.js +82 -0
- package/dist/esm/i18n/system_enums/localization.en.js.map +1 -0
- package/dist/esm/i18n/system_enums/risk-register.en.d.ts +1 -0
- package/dist/esm/i18n/system_enums/risk-register.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/risk-register.en.js +1 -0
- package/dist/esm/i18n/system_enums/risk-register.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.en.d.ts +10 -0
- package/dist/esm/i18n/system_enums/workbench-dossier.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.en.js +13 -0
- package/dist/esm/i18n/system_enums/workbench-dossier.en.js.map +1 -1
- package/dist/esm/i18n-labelling/models/labelling-progress.models.d.ts +43 -0
- package/dist/esm/i18n-labelling/models/labelling-progress.models.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/models/labelling-progress.models.js +34 -0
- package/dist/esm/i18n-labelling/models/labelling-progress.models.js.map +1 -0
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts +8 -0
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js +97 -56
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts +18 -0
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js +269 -153
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.d.ts +41 -0
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.js +47 -0
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.js.map +1 -0
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts +12 -0
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.js +10 -2
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.d.ts +89 -0
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.js +229 -0
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.js.map +1 -0
- package/dist/esm/meta-workflows/models/build-task-rearm.models.d.ts +67 -1
- package/dist/esm/meta-workflows/models/build-task-rearm.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/build-task-rearm.models.js +64 -0
- package/dist/esm/meta-workflows/models/build-task-rearm.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/creation-intervention.models.d.ts +308 -0
- package/dist/esm/meta-workflows/models/creation-intervention.models.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/creation-intervention.models.js +365 -0
- package/dist/esm/meta-workflows/models/creation-intervention.models.js.map +1 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.d.ts +61 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.js +58 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.js.map +1 -0
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts +10 -6
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.js +11 -6
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.d.ts +3 -0
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.js +8 -1
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +26 -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 +66 -10
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts +13 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js +33 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.d.ts +145 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.js +179 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +376 -17
- 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 +805 -39
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +93 -7
- 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 +142 -25
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +120 -3
- 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 +325 -16
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js +15 -6
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.js +10 -11
- package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.js +10 -11
- package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts +82 -0
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +291 -0
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.d.ts +60 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.js +66 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.js.map +1 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts +53 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +164 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.d.ts +37 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.js +52 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.js.map +1 -0
- package/dist/esm/meta-workflows/services/dossier.companion.service.d.ts +74 -14
- package/dist/esm/meta-workflows/services/dossier.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/dossier.companion.service.js +180 -28
- package/dist/esm/meta-workflows/services/dossier.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts +2 -3
- 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 +2 -8
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.d.ts +67 -0
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.js +64 -0
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.js.map +1 -0
- package/dist/esm/meta-workflows/services/playbook-instance.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-instance.companion.service.js +11 -3
- package/dist/esm/meta-workflows/services/playbook-instance.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +92 -4
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +328 -7
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +105 -6
- 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 +309 -39
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.d.ts +62 -1
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.js +152 -2
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.js.map +1 -1
- package/package.json +22 -18
- package/dist/esm/.tsbuildinfo +0 -1
- package/dist/esm/__tests__/asset-noop.d.ts +0 -3
- package/dist/esm/__tests__/asset-noop.d.ts.map +0 -1
- package/dist/esm/__tests__/asset-noop.js +0 -2
- package/dist/esm/__tests__/asset-noop.js.map +0 -1
- package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts +0 -2
- package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts.map +0 -1
- package/dist/esm/__tests__/chdir-dogfood-app.setup.js +0 -44
- package/dist/esm/__tests__/chdir-dogfood-app.setup.js.map +0 -1
- package/dist/esm/__tests__/internal-test-view.d.ts +0 -39
- package/dist/esm/__tests__/internal-test-view.d.ts.map +0 -1
- package/dist/esm/__tests__/internal-test-view.js +0 -2
- package/dist/esm/__tests__/internal-test-view.js.map +0 -1
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.d.ts +0 -50
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.d.ts.map +0 -1
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.js +0 -157
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.js.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts +0 -8
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.js +0 -43
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.js.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.d.ts +0 -79
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.d.ts.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.js +0 -193
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.js.map +0 -1
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The REAL engine execution driver over an in-memory actor plane — for tests of the lane's suspend,
|
|
3
|
-
* resume, cancel and list behaviour (#1360).
|
|
4
|
-
*
|
|
5
|
-
* The lane no longer owns that lifecycle: `ActorsSystemBackendService` opens, suspends, resumes and
|
|
6
|
-
* settles, and the lane supplies the executor and reads the rows back. Mocking the driver would pin
|
|
7
|
-
* what the lane TELLS it and nothing about what then happens to the run, which is the half these
|
|
8
|
-
* tests exist for. So the driver here is the production class; only the rows are in memory, behind
|
|
9
|
-
* the same `ActorExecutionPersistencePort` the platform adapter implements, and the registry carries
|
|
10
|
-
* the production `meta-workflows.system` definition so the roster check is the real one.
|
|
11
|
-
*/
|
|
12
|
-
import { ActorsSystemBackendService, } from '@wildo-ai/saas-backend-lib';
|
|
13
|
-
import { FlowsActors_Status, HumanDecision_RequesterKind, HumanDecision_RouteKind } from '@wildo-ai/saas-models';
|
|
14
|
-
import { vi } from 'vitest';
|
|
15
|
-
import { META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF, META_WORKFLOWS_SYSTEM_REF } from '../../../models/meta-workflows-lane.models.js';
|
|
16
|
-
import { buildMetaWorkflowsActorSystemDefinitions } from '../../../models/meta-workflows.actors-system.definitions.js';
|
|
17
|
-
import { projectPlaybookClarificationAsDecision } from '../../../models/playbook-run-checkpoint.models.js';
|
|
18
|
-
import { createPlaybookRunOptions } from '../../playbook-run.companion.service.js';
|
|
19
|
-
import { PlaybookSpendMeterCompanionService } from '../../playbook-spend-meter.companion.service.js';
|
|
20
|
-
export function createInMemoryActorPlane() {
|
|
21
|
-
const executions = new Map();
|
|
22
|
-
const tasks = new Map();
|
|
23
|
-
let sequence = 0;
|
|
24
|
-
const nextId = (prefix) => `${prefix}${String(++sequence).padStart(6, '0')}`;
|
|
25
|
-
const toRow = (execution) => ({
|
|
26
|
-
_id: execution._id,
|
|
27
|
-
systemRef: execution.systemRef,
|
|
28
|
-
status: execution.status,
|
|
29
|
-
tasks: [...tasks.values()].filter((task) => task.executionId === execution._id).map((task) => ({ _id: task._id, actorRef: task.actorRef })),
|
|
30
|
-
...(execution.suspension !== undefined ? { suspension: execution.suspension } : {}),
|
|
31
|
-
...(execution.checkpoint !== undefined ? { checkpoint: execution.checkpoint } : {}),
|
|
32
|
-
...(execution.exclusiveSubject !== undefined ? { exclusiveSubject: execution.exclusiveSubject } : {}),
|
|
33
|
-
createdAt: execution.createdAt,
|
|
34
|
-
});
|
|
35
|
-
const port = {
|
|
36
|
-
createExecution: async (input) => {
|
|
37
|
-
const _id = nextId('exec');
|
|
38
|
-
executions.set(_id, { _id, systemRef: input.systemRef, status: input.status, ...(input.exclusiveSubject !== undefined ? { exclusiveSubject: input.exclusiveSubject } : {}), createdAt: new Date().toISOString() });
|
|
39
|
-
return { _id };
|
|
40
|
-
},
|
|
41
|
-
createTask: async (input) => {
|
|
42
|
-
const _id = nextId('task');
|
|
43
|
-
tasks.set(_id, { _id, executionId: input.executionId, actorRef: input.actorRef, status: input.status, context: input.context, input: input.input });
|
|
44
|
-
return { _id };
|
|
45
|
-
},
|
|
46
|
-
updateTask: async (taskId, patch) => {
|
|
47
|
-
const task = tasks.get(taskId);
|
|
48
|
-
if (!task)
|
|
49
|
-
throw new Error(`no task ${taskId}`);
|
|
50
|
-
task.status = patch.status;
|
|
51
|
-
if (patch.output !== undefined)
|
|
52
|
-
task.output = patch.output;
|
|
53
|
-
},
|
|
54
|
-
updateExecution: async (executionId, patch) => {
|
|
55
|
-
const execution = executions.get(executionId);
|
|
56
|
-
if (!execution)
|
|
57
|
-
throw new Error(`no execution ${executionId}`);
|
|
58
|
-
if (patch.status !== undefined)
|
|
59
|
-
execution.status = patch.status;
|
|
60
|
-
if (patch.finishedAt !== undefined)
|
|
61
|
-
execution.finishedAt = patch.finishedAt ?? undefined;
|
|
62
|
-
// `null` clears, absent leaves alone — the contract the platform adapter honours too.
|
|
63
|
-
if (patch.suspension !== undefined)
|
|
64
|
-
execution.suspension = patch.suspension;
|
|
65
|
-
if (patch.checkpoint !== undefined)
|
|
66
|
-
execution.checkpoint = patch.checkpoint;
|
|
67
|
-
},
|
|
68
|
-
/*
|
|
69
|
-
* The compare-and-swap, as the platform adapter's one guarded statement (#1586): the check and the
|
|
70
|
-
* write happen with no `await` between them, so no other port call can interleave.
|
|
71
|
-
*/
|
|
72
|
-
updateSuspendedExecution: async (executionId, expected, patch) => {
|
|
73
|
-
const execution = executions.get(executionId);
|
|
74
|
-
if (!execution || execution.status !== FlowsActors_Status.AWAITING_APPROVAL || !execution.suspension)
|
|
75
|
-
return false;
|
|
76
|
-
const matches = (expected.suspensionId !== undefined
|
|
77
|
-
? execution.suspension.suspensionId === expected.suspensionId
|
|
78
|
-
: execution.suspension.suspendedAt === expected.suspendedAt)
|
|
79
|
-
// The route version, as the platform adapter's filter checks it (#1594 I5).
|
|
80
|
-
&& (expected.routeVersion === undefined || execution.suspension.routeVersion === expected.routeVersion);
|
|
81
|
-
if (!matches)
|
|
82
|
-
return false;
|
|
83
|
-
// How the wait ended, recorded with the move that ended it (#1594 I4).
|
|
84
|
-
if (patch.resolution !== undefined)
|
|
85
|
-
(execution.resolutions ??= []).push(patch.resolution);
|
|
86
|
-
if (patch.status !== undefined)
|
|
87
|
-
execution.status = patch.status;
|
|
88
|
-
if (patch.finishedAt !== undefined)
|
|
89
|
-
execution.finishedAt = patch.finishedAt ?? undefined;
|
|
90
|
-
if (patch.suspension !== undefined)
|
|
91
|
-
execution.suspension = patch.suspension;
|
|
92
|
-
if (patch.checkpoint !== undefined)
|
|
93
|
-
execution.checkpoint = patch.checkpoint;
|
|
94
|
-
return true;
|
|
95
|
-
},
|
|
96
|
-
readExecution: async (executionId) => {
|
|
97
|
-
const execution = executions.get(executionId);
|
|
98
|
-
return execution ? toRow(execution) : null;
|
|
99
|
-
},
|
|
100
|
-
listExecutions: async (query) => [...executions.values()]
|
|
101
|
-
.filter((execution) => execution.systemRef === query.systemRef && query.statuses.includes(execution.status))
|
|
102
|
-
.map(toRow),
|
|
103
|
-
};
|
|
104
|
-
const system = buildMetaWorkflowsActorSystemDefinitions().factoryMap[META_WORKFLOWS_SYSTEM_REF]();
|
|
105
|
-
const audit = {
|
|
106
|
-
logHumanDecisionRequested: vi.fn(async (..._args) => undefined),
|
|
107
|
-
logHumanDecisionResolved: vi.fn(async (..._args) => undefined),
|
|
108
|
-
logHumanDecisionAnswerRefused: vi.fn(async (..._args) => undefined),
|
|
109
|
-
};
|
|
110
|
-
const actorsSystem = new ActorsSystemBackendService({ debugByType: () => () => undefined, setDebugTypeLogging: () => undefined, error: () => undefined, warn: () => undefined }, {
|
|
111
|
-
buildError: (type, _cause, detail) => Object.assign(new Error(`${type}:${detail.customMessageReference}`), { customMessageReference: detail.customMessageReference }),
|
|
112
|
-
}, { getSystemOrThrow: () => system, getSystem: () => system, getActors: () => [system] }, {}, port, audit);
|
|
113
|
-
const wholeRow = (execution) => ({
|
|
114
|
-
...execution,
|
|
115
|
-
standaloneTasks: [...tasks.values()].filter((task) => task.executionId === execution._id),
|
|
116
|
-
});
|
|
117
|
-
const executionsService = {
|
|
118
|
-
listActorExecutions: async (query) => [...executions.values()]
|
|
119
|
-
.filter((execution) => query.systemRef === undefined || execution.systemRef === query.systemRef)
|
|
120
|
-
.reverse()
|
|
121
|
-
.slice(0, query.limit ?? 50)
|
|
122
|
-
.map(wholeRow),
|
|
123
|
-
// One whole row — what the lane reads to NAME the run holding a single-flight subject (#1361).
|
|
124
|
-
getActorExecution: async (executionId) => {
|
|
125
|
-
const execution = executions.get(executionId);
|
|
126
|
-
if (!execution)
|
|
127
|
-
throw new Error(`no execution ${executionId}`);
|
|
128
|
-
return wholeRow(execution);
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
return {
|
|
132
|
-
actorsSystem,
|
|
133
|
-
audit,
|
|
134
|
-
executions,
|
|
135
|
-
tasks,
|
|
136
|
-
executionsService,
|
|
137
|
-
seedSuspendedPlaybookRun: (checkpoint, options) => {
|
|
138
|
-
const suspendedAt = options?.suspendedAt ?? new Date().toISOString();
|
|
139
|
-
const _id = nextId('exec');
|
|
140
|
-
executions.set(_id, {
|
|
141
|
-
_id,
|
|
142
|
-
systemRef: META_WORKFLOWS_SYSTEM_REF,
|
|
143
|
-
status: FlowsActors_Status.AWAITING_APPROVAL,
|
|
144
|
-
suspension: {
|
|
145
|
-
decision: projectPlaybookClarificationAsDecision({ runId: _id, requestedAt: suspendedAt, checkpoint }),
|
|
146
|
-
suspendedAt,
|
|
147
|
-
...(options?.routedToUserId
|
|
148
|
-
? { route: { kind: HumanDecision_RouteKind.OWNER }, requester: { kind: HumanDecision_RequesterKind.USER, ref: options.routedToUserId }, routeVersion: 0 }
|
|
149
|
-
: {}),
|
|
150
|
-
},
|
|
151
|
-
checkpoint: { context: checkpoint, checkpointedAt: suspendedAt },
|
|
152
|
-
createdAt: suspendedAt,
|
|
153
|
-
});
|
|
154
|
-
const taskId = nextId('task');
|
|
155
|
-
tasks.set(taskId, { _id: taskId, executionId: _id, actorRef: META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF, status: FlowsActors_Status.AWAITING_APPROVAL });
|
|
156
|
-
return _id;
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Give a run service built with `Object.create(prototype)` what its constructor and field
|
|
162
|
-
* initializers would have: the engine driver, and the two members the suspension path reads.
|
|
163
|
-
*
|
|
164
|
-
* Every suite that calls `runPlaybook` on a bare service needs this since #1358. Before it, the
|
|
165
|
-
* service opened the actor plane itself and SWALLOWED a missing dependency, so a bare service ran
|
|
166
|
-
* happily with no plane at all — which is exactly the best-effort posture that was removed.
|
|
167
|
-
*/
|
|
168
|
-
export function wireInMemoryActorPlane(service, plane = createInMemoryActorPlane()) {
|
|
169
|
-
const suspensionRequests = new WeakMap();
|
|
170
|
-
const runMeasurements = new WeakMap();
|
|
171
|
-
// What each root run overlapped (#1610), read into its row summary beside its measurement.
|
|
172
|
-
const runOverlaps = new WeakMap();
|
|
173
|
-
Object.assign(service, {
|
|
174
|
-
actorsSystem: plane.actorsSystem,
|
|
175
|
-
// The runs read is a projection of the rows (#1362), so a bare service needs the row reader too.
|
|
176
|
-
executions: plane.executionsService,
|
|
177
|
-
suspensionRequests,
|
|
178
|
-
// What every run cost (#1507): the production meter, UNWIRED — no recorder decorator is installed
|
|
179
|
-
// here, so every run records its duration and a spend of NOT OBSERVED, which is the honest reading
|
|
180
|
-
// of a service no model call can reach. A suite that wants observed spend sets its own meter.
|
|
181
|
-
spendMeter: new PlaybookSpendMeterCompanionService(),
|
|
182
|
-
runMeasurements,
|
|
183
|
-
failedRunMeasurements: new Map(),
|
|
184
|
-
adoptedCheckpointIterations: new Map(),
|
|
185
|
-
inheritedRoundsByFailure: new WeakMap(),
|
|
186
|
-
runOverlaps,
|
|
187
|
-
failedRunOverlaps: new Map(),
|
|
188
|
-
// The PRODUCTION reading of a run's result, not a copy of it.
|
|
189
|
-
playbookRunOptions: createPlaybookRunOptions(suspensionRequests, runMeasurements, runOverlaps),
|
|
190
|
-
});
|
|
191
|
-
return plane;
|
|
192
|
-
}
|
|
193
|
-
//# sourceMappingURL=in-memory-actor-plane.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-actor-plane.js","sourceRoot":"","sources":["../../../../../../../src/meta-workflows/services/__tests__/support/in-memory-actor-plane.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,0BAA0B,GAI3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,uBAAuB,EAAmH,MAAM,uBAAuB,CAAC;AAClO,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,qCAAqC,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAC9H,OAAO,EAAE,wCAAwC,EAAE,MAAM,0DAA0D,CAAC;AACpH,OAAO,EAAE,sCAAsC,EAAwC,MAAM,gDAAgD,CAAC;AAC9I,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AA8ClG,MAAM,UAAU,wBAAwB;IACtC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;IACtD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC5C,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,MAAM,MAAM,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAE7F,MAAM,KAAK,GAAG,CAAC,SAA0B,EAA0C,EAAE,CAAC,CAAC;QACrF,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,MA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E,SAAS,EAAE,WAAW;aACvB,CAAC,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC9B,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,qCAAqC,EAAE,MAAM,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACpJ,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe,EAAE,QAA4B,wBAAwB,EAAE;IAC5G,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAA2C,CAAC;IAClF,MAAM,eAAe,GAAG,IAAI,OAAO,EAAkC,CAAC;IACtE,2FAA2F;IAC3F,MAAM,WAAW,GAAG,IAAI,OAAO,EAAyC,CAAC;IACzE,MAAM,CAAC,MAAM,CAAC,OAAkC,EAAE;QAChD,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,iGAAiG;QACjG,UAAU,EAAE,KAAK,CAAC,iBAAiB;QACnC,kBAAkB;QAClB,kGAAkG;QAClG,mGAAmG;QACnG,8FAA8F;QAC9F,UAAU,EAAE,IAAI,kCAAkC,EAAE;QACpD,eAAe;QACf,qBAAqB,EAAE,IAAI,GAAG,EAAE;QAChC,2BAA2B,EAAE,IAAI,GAAG,EAAE;QACtC,wBAAwB,EAAE,IAAI,OAAO,EAAE;QACvC,WAAW;QACX,iBAAiB,EAAE,IAAI,GAAG,EAAE;QAC5B,8DAA8D;QAC9D,kBAAkB,EAAE,wBAAwB,CAAC,kBAAkB,EAAE,eAAe,EAAE,WAAW,CAAC;KAC/F,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * The REAL engine execution driver over an in-memory actor plane — for tests of the lane's suspend,\n * resume, cancel and list behaviour (#1360).\n *\n * The lane no longer owns that lifecycle: `ActorsSystemBackendService` opens, suspends, resumes and\n * settles, and the lane supplies the executor and reads the rows back. Mocking the driver would pin\n * what the lane TELLS it and nothing about what then happens to the run, which is the half these\n * tests exist for. So the driver here is the production class; only the rows are in memory, behind\n * the same `ActorExecutionPersistencePort` the platform adapter implements, and the registry carries\n * the production `meta-workflows.system` definition so the roster check is the real one.\n */\nimport {\n ActorsSystemBackendService,\n type ActorExecutionSuspensionRequest,\n type ActorExecutionPersistencePort,\n type ActorExecutionPersistence_ExecutionRow,\n} from '@wildo-ai/saas-backend-lib';\nimport { FlowsActors_Status, HumanDecision_RequesterKind, HumanDecision_RouteKind, type ActorExecution_Checkpoint, type ActorExecution_Suspension, type ActorSystem, type HumanDecision_Resolution } from '@wildo-ai/saas-models';\nimport { vi } from 'vitest';\n\nimport { META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF, META_WORKFLOWS_SYSTEM_REF } from '../../../models/meta-workflows-lane.models';\nimport { buildMetaWorkflowsActorSystemDefinitions } from '../../../models/meta-workflows.actors-system.definitions';\nimport { projectPlaybookClarificationAsDecision, type PlaybookRunSuspensionCheckpoint } from '../../../models/playbook-run-checkpoint.models';\nimport { createPlaybookRunOptions } from '../../playbook-run.companion.service';\nimport { PlaybookSpendMeterCompanionService } from '../../playbook-spend-meter.companion.service';\nimport type { PlaybookRunMeasurement, PlaybookRunOverlap } from '../../../models/playbook-run-record.models';\n\ninterface StoredExecution {\n _id: string;\n systemRef: string;\n status: FlowsActors_Status;\n suspension?: ActorExecution_Suspension | null;\n checkpoint?: ActorExecution_Checkpoint | null;\n exclusiveSubject?: string;\n createdAt: string;\n finishedAt?: string;\n /** Every decision this run's waits ended with, oldest first — what the platform keeps on its status changes. */\n resolutions?: HumanDecision_Resolution[];\n}\ninterface StoredTask { _id: string; executionId: string; actorRef: string; status: FlowsActors_Status; output?: unknown; context?: unknown; input?: unknown }\n\nexport interface InMemoryActorPlane {\n readonly actorsSystem: ActorsSystemBackendService;\n readonly executions: Map<string, StoredExecution>;\n readonly tasks: Map<string, StoredTask>;\n /**\n * The executions-service read the runs projection uses (#1362): whole execution rows, newest\n * first, each carrying its task snapshot with the correlation and the output the driver wrote.\n */\n readonly executionsService: {\n listActorExecutions(query: { systemRef?: string; limit?: number }): Promise<readonly Record<string, unknown>[]>;\n getActorExecution(executionId: string): Promise<Record<string, unknown>>;\n };\n /** Put a run in the WAITING state a real suspension leaves, and answer its id. */\n seedSuspendedPlaybookRun(checkpoint: PlaybookRunSuspensionCheckpoint, options?: {\n readonly suspendedAt?: string;\n /** Route its question to this signed-in person, as a run they started is (#1751). */\n readonly routedToUserId?: string;\n }): string;\n /**\n * The engine's audit sink, as spies (#1751 review L1): a refused settle, a raise and a resolution each\n * write a row, and without the sink no companion test could see whether a refusal was recorded.\n */\n readonly audit: {\n readonly logHumanDecisionRequested: ReturnType<typeof vi.fn>;\n readonly logHumanDecisionResolved: ReturnType<typeof vi.fn>;\n readonly logHumanDecisionAnswerRefused: ReturnType<typeof vi.fn>;\n };\n}\n\nexport function createInMemoryActorPlane(): InMemoryActorPlane {\n const executions = new Map<string, StoredExecution>();\n const tasks = new Map<string, StoredTask>();\n let sequence = 0;\n const nextId = (prefix: string): string => `${prefix}${String(++sequence).padStart(6, '0')}`;\n\n const toRow = (execution: StoredExecution): ActorExecutionPersistence_ExecutionRow => ({\n _id: execution._id,\n systemRef: execution.systemRef,\n status: execution.status,\n tasks: [...tasks.values()].filter((task) => task.executionId === execution._id).map((task) => ({ _id: task._id, actorRef: task.actorRef })),\n ...(execution.suspension !== undefined ? { suspension: execution.suspension } : {}),\n ...(execution.checkpoint !== undefined ? { checkpoint: execution.checkpoint } : {}),\n ...(execution.exclusiveSubject !== undefined ? { exclusiveSubject: execution.exclusiveSubject } : {}),\n createdAt: execution.createdAt,\n });\n\n const port: ActorExecutionPersistencePort = {\n createExecution: async (input) => {\n const _id = nextId('exec');\n executions.set(_id, { _id, systemRef: input.systemRef, status: input.status, ...(input.exclusiveSubject !== undefined ? { exclusiveSubject: input.exclusiveSubject } : {}), createdAt: new Date().toISOString() });\n return { _id };\n },\n createTask: async (input) => {\n const _id = nextId('task');\n tasks.set(_id, { _id, executionId: input.executionId, actorRef: input.actorRef, status: input.status, context: input.context, input: input.input });\n return { _id };\n },\n updateTask: async (taskId, patch) => {\n const task = tasks.get(taskId);\n if (!task) throw new Error(`no task ${taskId}`);\n task.status = patch.status;\n if (patch.output !== undefined) task.output = patch.output;\n },\n updateExecution: async (executionId, patch) => {\n const execution = executions.get(executionId);\n if (!execution) throw new Error(`no execution ${executionId}`);\n if (patch.status !== undefined) execution.status = patch.status;\n if (patch.finishedAt !== undefined) execution.finishedAt = patch.finishedAt ?? undefined;\n // `null` clears, absent leaves alone — the contract the platform adapter honours too.\n if (patch.suspension !== undefined) execution.suspension = patch.suspension;\n if (patch.checkpoint !== undefined) execution.checkpoint = patch.checkpoint;\n },\n /*\n * The compare-and-swap, as the platform adapter's one guarded statement (#1586): the check and the\n * write happen with no `await` between them, so no other port call can interleave.\n */\n updateSuspendedExecution: async (executionId, expected, patch) => {\n const execution = executions.get(executionId);\n if (!execution || execution.status !== FlowsActors_Status.AWAITING_APPROVAL || !execution.suspension) return false;\n const matches = (expected.suspensionId !== undefined\n ? execution.suspension.suspensionId === expected.suspensionId\n : execution.suspension.suspendedAt === expected.suspendedAt)\n // The route version, as the platform adapter's filter checks it (#1594 I5).\n && (expected.routeVersion === undefined || execution.suspension.routeVersion === expected.routeVersion);\n if (!matches) return false;\n // How the wait ended, recorded with the move that ended it (#1594 I4).\n if (patch.resolution !== undefined) (execution.resolutions ??= []).push(patch.resolution);\n if (patch.status !== undefined) execution.status = patch.status;\n if (patch.finishedAt !== undefined) execution.finishedAt = patch.finishedAt ?? undefined;\n if (patch.suspension !== undefined) execution.suspension = patch.suspension;\n if (patch.checkpoint !== undefined) execution.checkpoint = patch.checkpoint;\n return true;\n },\n readExecution: async (executionId) => {\n const execution = executions.get(executionId);\n return execution ? toRow(execution) : null;\n },\n listExecutions: async (query) => [...executions.values()]\n .filter((execution) => execution.systemRef === query.systemRef && query.statuses.includes(execution.status))\n .map(toRow),\n };\n\n const system = buildMetaWorkflowsActorSystemDefinitions().factoryMap[META_WORKFLOWS_SYSTEM_REF]!() as ActorSystem;\n const audit = {\n logHumanDecisionRequested: vi.fn(async (..._args: unknown[]) => undefined),\n logHumanDecisionResolved: vi.fn(async (..._args: unknown[]) => undefined),\n logHumanDecisionAnswerRefused: vi.fn(async (..._args: unknown[]) => undefined),\n };\n const actorsSystem = new ActorsSystemBackendService(\n { debugByType: () => () => undefined, setDebugTypeLogging: () => undefined, error: () => undefined, warn: () => undefined } as never,\n {\n buildError: (type: string, _cause: unknown, detail: { customMessageReference: string }) =>\n Object.assign(new Error(`${type}:${detail.customMessageReference}`), { customMessageReference: detail.customMessageReference }),\n } as never,\n { getSystemOrThrow: () => system, getSystem: () => system, getActors: () => [system] } as never,\n {} as never,\n port,\n audit as never,\n );\n\n const wholeRow = (execution: StoredExecution) => ({\n ...execution,\n standaloneTasks: [...tasks.values()].filter((task) => task.executionId === execution._id),\n });\n const executionsService = {\n listActorExecutions: async (query: { systemRef?: string; limit?: number }) => [...executions.values()]\n .filter((execution) => query.systemRef === undefined || execution.systemRef === query.systemRef)\n .reverse()\n .slice(0, query.limit ?? 50)\n .map(wholeRow),\n // One whole row — what the lane reads to NAME the run holding a single-flight subject (#1361).\n getActorExecution: async (executionId: string) => {\n const execution = executions.get(executionId);\n if (!execution) throw new Error(`no execution ${executionId}`);\n return wholeRow(execution);\n },\n };\n\n return {\n actorsSystem,\n audit,\n executions,\n tasks,\n executionsService,\n seedSuspendedPlaybookRun: (checkpoint, options) => {\n const suspendedAt = options?.suspendedAt ?? new Date().toISOString();\n const _id = nextId('exec');\n executions.set(_id, {\n _id,\n systemRef: META_WORKFLOWS_SYSTEM_REF,\n status: FlowsActors_Status.AWAITING_APPROVAL,\n suspension: {\n decision: projectPlaybookClarificationAsDecision({ runId: _id, requestedAt: suspendedAt, checkpoint }),\n suspendedAt,\n ...(options?.routedToUserId\n ? { route: { kind: HumanDecision_RouteKind.OWNER }, requester: { kind: HumanDecision_RequesterKind.USER, ref: options.routedToUserId }, routeVersion: 0 }\n : {}),\n },\n checkpoint: { context: checkpoint, checkpointedAt: suspendedAt },\n createdAt: suspendedAt,\n });\n const taskId = nextId('task');\n tasks.set(taskId, { _id: taskId, executionId: _id, actorRef: META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF, status: FlowsActors_Status.AWAITING_APPROVAL });\n return _id;\n },\n };\n}\n\n/**\n * Give a run service built with `Object.create(prototype)` what its constructor and field\n * initializers would have: the engine driver, and the two members the suspension path reads.\n *\n * Every suite that calls `runPlaybook` on a bare service needs this since #1358. Before it, the\n * service opened the actor plane itself and SWALLOWED a missing dependency, so a bare service ran\n * happily with no plane at all — which is exactly the best-effort posture that was removed.\n */\nexport function wireInMemoryActorPlane(service: object, plane: InMemoryActorPlane = createInMemoryActorPlane()): InMemoryActorPlane {\n const suspensionRequests = new WeakMap<object, ActorExecutionSuspensionRequest>();\n const runMeasurements = new WeakMap<object, PlaybookRunMeasurement>();\n // What each root run overlapped (#1610), read into its row summary beside its measurement.\n const runOverlaps = new WeakMap<object, readonly PlaybookRunOverlap[]>();\n Object.assign(service as Record<string, unknown>, {\n actorsSystem: plane.actorsSystem,\n // The runs read is a projection of the rows (#1362), so a bare service needs the row reader too.\n executions: plane.executionsService,\n suspensionRequests,\n // What every run cost (#1507): the production meter, UNWIRED — no recorder decorator is installed\n // here, so every run records its duration and a spend of NOT OBSERVED, which is the honest reading\n // of a service no model call can reach. A suite that wants observed spend sets its own meter.\n spendMeter: new PlaybookSpendMeterCompanionService(),\n runMeasurements,\n failedRunMeasurements: new Map(),\n adoptedCheckpointIterations: new Map(),\n inheritedRoundsByFailure: new WeakMap(),\n runOverlaps,\n failedRunOverlaps: new Map(),\n // The PRODUCTION reading of a run's result, not a copy of it.\n playbookRunOptions: createPlaybookRunOptions(suspensionRequests, runMeasurements, runOverlaps),\n });\n return plane;\n}\n\n"]}
|