@wildo-ai/dev-companion 1.1.2 → 1.1.4
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/__tests__/asset-noop.d.ts.map +1 -1
- package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts.map +1 -1
- package/dist/esm/__tests__/internal-test-view.d.ts.map +1 -1
- package/dist/esm/brand/models/logo-creative-brief.schemas.d.ts.map +1 -1
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.d.ts.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 +9 -3
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.js.map +1 -1
- package/dist/esm/brand/models/logo-judge.schemas.d.ts.map +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.d.ts +3 -24
- package/dist/esm/brand/services/brand-accept.companion.service.d.ts.map +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.js +10 -48
- package/dist/esm/brand/services/brand-accept.companion.service.js.map +1 -1
- package/dist/esm/brand/services/logo-deliberation.companion.service.d.ts.map +1 -1
- package/dist/esm/brand/services/logo-deliberation.companion.service.js +2 -8
- package/dist/esm/brand/services/logo-deliberation.companion.service.js.map +1 -1
- package/dist/esm/brand/services/logo-generation.companion.service.d.ts +6 -3
- package/dist/esm/brand/services/logo-generation.companion.service.d.ts.map +1 -1
- package/dist/esm/brand/services/logo-generation.companion.service.js +11 -12
- package/dist/esm/brand/services/logo-generation.companion.service.js.map +1 -1
- package/dist/esm/brand/utils/derived-brand-assets.d.ts +0 -1
- package/dist/esm/brand/utils/derived-brand-assets.d.ts.map +1 -1
- package/dist/esm/brand/utils/derived-brand-assets.js +1 -2
- package/dist/esm/brand/utils/derived-brand-assets.js.map +1 -1
- package/dist/esm/brand/utils/stage-brand-candidate.d.ts +7 -9
- package/dist/esm/brand/utils/stage-brand-candidate.d.ts.map +1 -1
- package/dist/esm/brand/utils/stage-brand-candidate.js +8 -11
- package/dist/esm/brand/utils/stage-brand-candidate.js.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +52 -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 +45 -0
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +45 -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 +180 -9
- 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 +12 -22
- 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 +151 -82
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +30 -4
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js +30 -4
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +1 -1
- 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 +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
- package/dist/esm/code-compliance-check/check-label-placeholder-contract.companion.d.ts.map +1 -1
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.d.ts +57 -57
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion-i18n-api-contract.utils.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion-token-floor.policy.d.ts +90 -0
- package/dist/esm/companion-api/controllers/companion-token-floor.policy.d.ts.map +1 -0
- package/dist/esm/companion-api/controllers/companion-token-floor.policy.js +98 -0
- package/dist/esm/companion-api/controllers/companion-token-floor.policy.js.map +1 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +32 -5
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +126 -41
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/auth/companion-auth-floor.companion.service.d.ts +8 -1
- package/dist/esm/core/auth/companion-auth-floor.companion.service.d.ts.map +1 -1
- package/dist/esm/core/auth/companion-auth-floor.companion.service.js +8 -1
- package/dist/esm/core/auth/companion-auth-floor.companion.service.js.map +1 -1
- package/dist/esm/core/catalogs/catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/catalog-context.factory.models.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/aggregate-offer-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/aggregate-rating-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/article-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/blog-posting-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/breadcrumb-list-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/faq-page-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/offer-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/organization-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/product-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/review-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.d.ts +34 -0
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.d.ts.map +1 -0
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.js +65 -0
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-boundary.shared.js.map +1 -0
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-context.shared.d.ts +11 -1
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-context.shared.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/schema-org-catalog-context.shared.js.map +1 -1
- package/dist/esm/core/catalogs/schema-org/software-application-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/schema-org/website-catalog-context.factory.d.ts.map +1 -1
- package/dist/esm/core/catalogs/structured-data-catalog-audit.service.d.ts.map +1 -1
- package/dist/esm/core/catalogs/structured-data-catalog-audit.service.js +10 -2
- package/dist/esm/core/catalogs/structured-data-catalog-audit.service.js.map +1 -1
- package/dist/esm/core/config/primary-language.companion.utils.d.ts.map +1 -1
- package/dist/esm/core/context/companion-context.d.ts.map +1 -1
- package/dist/esm/core/context/companion-package-loaders.companion.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.js +0 -7
- package/dist/esm/core/inject/models/container.js.map +1 -1
- package/dist/esm/core/inject/models/service-types.d.ts +0 -1
- package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/core/inject/models/service-types.js +0 -1
- package/dist/esm/core/inject/models/service-types.js.map +1 -1
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.d.ts.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
- 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 +8 -4
- 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.map +1 -1
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection-behavior-registry.companion.service.d.ts.map +1 -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 +42 -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.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/assertions.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/asset-noop-hooks.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/asset-noop-register.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/brand-prompt-renderer.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/chart-registration-refs.behavior.d.ts.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 +3 -2
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-child.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-module-exports.utils.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.d.ts +14 -5
- package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.js +14 -5
- package/dist/esm/core/introspection/subprocess/compliance-primary-facts.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/definition-specifications.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/frontend-labels-needed-info.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/market-context-block.builder.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/market-prompt-renderer.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +38 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +143 -19
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -1
- package/dist/esm/core/lock/wildo-saas-lock.companion.service.d.ts +23 -0
- package/dist/esm/core/lock/wildo-saas-lock.companion.service.d.ts.map +1 -1
- package/dist/esm/core/lock/wildo-saas-lock.companion.service.js +23 -0
- package/dist/esm/core/lock/wildo-saas-lock.companion.service.js.map +1 -1
- package/dist/esm/core/lock/wildo-saas-lock.models.d.ts.map +1 -1
- package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts +4 -4
- package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-startup-assembly.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-startup-assembly.js.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/models/companion-runtime.models.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +16 -13
- 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 +70 -45
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/runtime/utils/companion-local-signing-key.companion.d.ts.map +1 -1
- 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 +9 -2
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
- package/dist/esm/core/runtime/utils/companion-workbench-topology.d.ts.map +1 -1
- package/dist/esm/core/runtime/utils/platform-core-domain-modules.companion.d.ts.map +1 -1
- package/dist/esm/core/specifications/chart-view-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/composite-view-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/cross-registry-rendering.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/execution-view-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/feature-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/flows-actors-view-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/frontend-component-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/full-custom-view-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/guidance-flow-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/milestone-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/onboarding-element-rendering.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/onboarding-view-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/product-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/resource-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/role-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.models.d.ts.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/system-email-template-specification-context.factory.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/composite-view/composite-view-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/composite-view/composite-view-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/composite-view/composite-view-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/composite-view/composite-view-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/feature/feature-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/feature/feature-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/feature/feature-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/feature/feature-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/frontend-component/frontend-component-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/frontend-component/frontend-component-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/frontend-component/frontend-component-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/frontend-component/frontend-component-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/guidance-flow-specification/guidance-flow-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/milestone/milestone-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/milestone/milestone-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/milestone/milestone-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/milestone/milestone-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/non-composite-view/non-composite-view-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/onboarding-view-specification/onboarding-view-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/product/product-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/product/product-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/product/product-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/product/product-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/resource/resource-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/resource/resource-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/resource/resource-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/resource/resource-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/role/role-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/role/role-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/role/role-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/role/role-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/system-email-template/system-email-template-all-information.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/system-email-template/system-email-template-custom-implementation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/system-email-template/system-email-template-development-usage-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/templates/system-email-template/system-email-template-translation-context.template.d.ts.map +1 -1
- package/dist/esm/core/specifications/validate-resource-field-completeness.d.ts.map +1 -1
- package/dist/esm/core/traceability/companion-agent-call-trace-sink.companion.service.d.ts.map +1 -1
- package/dist/esm/core/traceability/companion-agent-call-trace-sink.companion.service.js +4 -4
- package/dist/esm/core/traceability/companion-agent-call-trace-sink.companion.service.js.map +1 -1
- package/dist/esm/core/traceability/companion-traceability.models.d.ts.map +1 -1
- package/dist/esm/core/traceability/companion-traceability.service.d.ts.map +1 -1
- package/dist/esm/core/utils/atomic-write.utils.d.ts.map +1 -1
- 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 +13 -3
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js.map +1 -1
- package/dist/esm/deliberations/services/deliberation.companion.service.d.ts.map +1 -1
- package/dist/esm/deliberations/services/deliberation.companion.service.js +0 -5
- package/dist/esm/deliberations/services/deliberation.companion.service.js.map +1 -1
- package/dist/esm/deliberations/services/structured-deliberation.companion.service.d.ts.map +1 -1
- package/dist/esm/deliberations/services/structured-deliberation.companion.service.js +0 -2
- package/dist/esm/deliberations/services/structured-deliberation.companion.service.js.map +1 -1
- package/dist/esm/deliberations/utils/load-committed-expert-agents.d.ts.map +1 -1
- package/dist/esm/email/models/email-template.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/email/models/email-template.actors-system.definitions.js +4 -2
- package/dist/esm/email/models/email-template.actors-system.definitions.js.map +1 -1
- package/dist/esm/email/services/email-spec-context-loader.companion.service.d.ts +1 -1
- package/dist/esm/email/services/email-spec-context-loader.companion.service.d.ts.map +1 -1
- package/dist/esm/email/services/email-spec-context-loader.companion.service.js +1 -1
- package/dist/esm/email/services/email-spec-context-loader.companion.service.js.map +1 -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 +23 -1
- package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
- package/dist/esm/email/utils/email-labels-file-source.utils.d.ts.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +15 -2
- package/dist/esm/executions/services/companion-executions.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 +7 -3
- 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 +11 -5
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-derivation.schemas.d.ts.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts +9 -24
- 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 +11 -60
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_ACTIVITY_BAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_COMMAND_MENU.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_CONTROL_PANEL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_MENUBAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_NAVIGATION_BACK.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_NOTIFICATION_CENTER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_QUICK_ACTION_BUTTON.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_QUICK_SWITCHER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_SIDEBAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_STATUS_BAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_TOOLBAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_USER_DROPDOWN.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APPLICATION_LEVEL_UTILITY_PANEL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_APPEARANCE_SETTINGS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_BILLING_SETTINGS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_ERROR_BOUNDARY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_HOME.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_INVITATIONS_SETTINGS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_ROUTER_ERROR_BOUNDARY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_SECURITY_SETTINGS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_SETTINGS_HUB.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_WIDGET.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_EXECUTION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_FLOWS_ACTORS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_NOT_FOUND.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_ACTION_BAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_ACTOR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_ARTIFACT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_ARTIFACT_BROWSER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CHAIN_OF_THOUGHT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CODE_BLOCK.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONFIRMATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONTEXT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_DECISION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_EXECUTION_PLAN.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_EXECUTION_STREAM.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_FLOW_EXECUTION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_FLOW_NODE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_INLINE_CITATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_MESSAGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_MODEL_SELECTOR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_OPEN_IN_CHAT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_PLAN.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_PROMPT_INPUT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_SYSTEM_CATALOG.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_TASK_DETAIL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_TASK_MEMORY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_WEB_PREVIEW.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_INVOICE_HISTORY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PORTAL_LINK.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PRICING_TABLE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_SUBSCRIPTION_STATUS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_USAGE_DASHBOARD.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BREADCRUMB.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BUTTON.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CAROUSEL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CELEBRATION_OVERLAY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_COLOR_INPUT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_COMMAND.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DIALOG.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_BIGDECIMAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_BOOLEAN.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_CODE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_DURATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_AUDIO.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_DOCUMENT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_GALLERY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_IMAGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_FILE_VIDEO.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_MONEY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_PHONE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_RANGE_BIGDECIMAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_RANGE_MONEY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DISPLAY_FIELD_RANGE_NUMBER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_DRAWER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_ERROR_DISPLAY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FEATURE_LOCK_BADGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FEATURE_UNAVAILABLE_PROMPT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FILE_UPLOAD.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_BOOLEAN.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_CODE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_FILE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_PHONE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_MESSAGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_IMAGE_CROP.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_LOADING_OVERLAY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_LOADING_SPINNER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_OPERATIONS_CONFIRM_CRITICAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_OVERLAY_CONTAINER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_PAGINATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_SELECT_MULTIPLE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_SHEET.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_SIDEBAR.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_AUTH_CALLBACK.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_ENROLLMENT_REQUIRED.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.d.ts +39 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.js +39 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_FILE_UPLOAD_GRANT.en.js.map +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MAGIC_LINK_VERIFY.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_OAUTH_CONSENT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_OAUTH_LOGGED_OUT.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_OAUTH_LOGOUT_CONFIRM.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_ONE_OFF_SESSION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_CONFIRM_EMAIL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_INVITATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_PASSWORD_LOST.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_REGISTER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_FIELDS_RESOURCE_REFERENCE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_ACTION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_CONTAINER_NESTED.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_CREATE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_DANGER_ZONE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_HEADER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_OPERATIONS_BULK.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_OPERATIONS_ITEMS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_PAGINATION.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_READ.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_SEARCH.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_UPDATE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_announcement.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_banner.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_card.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_checklist.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_checklist_item.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_modal.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_onboarding_view.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_survey.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_tooltip.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/guidance_tour.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/progression_achievement_badge.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/progression_milestone_tracker.en.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -1
- package/dist/esm/i18n/index.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/models/labelling-unit.models.d.ts +58 -0
- package/dist/esm/i18n-labelling/models/labelling-unit.models.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/models/labelling-unit.models.js +35 -0
- package/dist/esm/i18n-labelling/models/labelling-unit.models.js.map +1 -1
- package/dist/esm/i18n-labelling/models/labelling.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/models/labelling.actors-system.definitions.js +8 -3
- package/dist/esm/i18n-labelling/models/labelling.actors-system.definitions.js.map +1 -1
- package/dist/esm/i18n-labelling/services/component-labels-bootstrap.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts +55 -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 +178 -73
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.d.ts +3 -3
- package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.js +16 -5
- package/dist/esm/i18n-labelling/services/labelling-spec-context-loader.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts +35 -2
- 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 +68 -29
- 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.map +1 -1
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js +126 -35
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/frontend-derived-label-keys.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/guidance-keys.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/label-file-source.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.d.ts +143 -0
- package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.js +179 -0
- package/dist/esm/i18n-labelling/utils/label-placeholder-drift.utils.js.map +1 -0
- package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.d.ts +154 -0
- package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.js +174 -0
- package/dist/esm/i18n-labelling/utils/orphan-label-artifacts.utils.js.map +1 -0
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/role-lifecycle-keys.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.d.ts +104 -0
- package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.js +163 -18
- package/dist/esm/i18n-labelling/utils/schema-fields-extractor.utils.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/structured-chunk-completion.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/translate-locale-contract.utils.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/market/services/market-generation.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +72 -0
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts +17 -4
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +25 -5
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/meta-workflows.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/meta-workflows.actors-system.definitions.js +9 -4
- package/dist/esm/meta-workflows/models/meta-workflows.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +3 -9
- 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 +48 -28
- 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 +83 -2
- 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 +197 -4
- 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.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-choreography-checkpoint.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-execution-trace.companion.service.d.ts.map +1 -1
- 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.companion.service.d.ts +37 -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 +227 -15
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +117 -2
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.js +258 -69
- package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +5 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +142 -10
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-environment-identity.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot-assets.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts +2 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js +10 -2
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js.map +1 -1
- package/package.json +17 -17
- package/dist/esm/core/runtime/companion-startup-composition-fence.d.ts +0 -44
- package/dist/esm/core/runtime/companion-startup-composition-fence.d.ts.map +0 -1
- package/dist/esm/core/runtime/companion-startup-composition-fence.js +0 -85
- package/dist/esm/core/runtime/companion-startup-composition-fence.js.map +0 -1
- package/dist/esm/expert-personas/utils/canonical-json.d.ts +0 -25
- package/dist/esm/expert-personas/utils/canonical-json.d.ts.map +0 -1
- package/dist/esm/expert-personas/utils/canonical-json.js +0 -45
- package/dist/esm/expert-personas/utils/canonical-json.js.map +0 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.d.ts +0 -19
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.d.ts.map +0 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.js +0 -19
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PLAN_CHANGE_PREVIEW.en.js.map +0 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.d.ts +0 -17
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.d.ts.map +0 -1
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.js +0 -17
- package/dist/esm/i18n/components/LOW_LEVEL_BILLING_PROMOTION_CODE_INPUT.en.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliberation.companion.service.js","sourceRoot":"","sources":["../../../../../src/deliberations/services/deliberation.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B,SAAS,EAET,uBAAuB,GAQxB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAA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AC,MAA2C,EAAE,MAAM,CAAC;QAC1E,MAAM,MAAM,GAAG,0CAA0C,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE;gBAChE,sBAAsB,EAAE,2BAA2B,CAAC,QAAQ;gBAC5D,OAAO,EAAE;oBACP,OAAO,EAAE,iFAAiF;iBAC3F;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;IACjC,CAAC;CACF,CAAA;AA/SY,4BAA4B;IADxC,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;IAErD,WAAA,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;IAE/C,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;qCATO,aAAa;QAE1C,0BAA0B;QAEnB,0BAA0B,oBAMhB,6BAA6B;GAdpE,4BAA4B,CA+SxC","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport {\n ActorsSystemBackendService,\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n type AgentsBackendService,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n ExpertWorkDomain,\n FlowsActors_IO_PartKind,\n type AgentTraceContext,\n type DeliberationCandidateInput,\n type DeliberationExpertBinding,\n type DeliberationPlan,\n type DeliberationRecord,\n type FlowsActors_Agent_Invocation,\n type RuntimeExpertProfile,\n} from '@wildo-ai/saas-models';\nimport {\n LLMProvider_GenerateStructuredInputSchema,\n LLMProvider_GenerateStructuredOutputSchema,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ExpertPersonaCharterSchema,\n getExpertRoleTemplate,\n type ExpertPersonaCharter,\n} from '@wildo-ai/saas-specifications';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport {\n DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n DeliberationTextRevisionOutputSchema,\n DeliberationTextRevisionOutputStrictSchema,\n expertAgentRefForRole,\n} from '../models/deliberation-agents.actors-system.definitions';\n\n/** A TEXT-subject deliberation request (the v1 route; IMAGE arrives with the brand refit). */\nexport interface DeliberationRunOptions {\n workDomain: ExpertWorkDomain;\n /** The assembled work-product brief every pass is grounded on. */\n briefContext: string;\n /** The initial candidate set (inline text; the service persists the bytes). */\n candidates: Array<{ ref: string; text: string }>;\n /** Panel roles — each must have a committed charter AND cover the work domain. */\n reviewerRoleRefs: string[];\n /** Coordinator role — the manager hat; NOT domain-gated (documented in the plan). */\n coordinatorRoleRef: string;\n /** Rubric-deriving role (default: the first reviewer — the domain owner). */\n rubricDeriverRoleRef?: string;\n roundBudget?: number;\n shortlistSize?: number;\n}\n\nexport interface DeliberationRunResult {\n record: DeliberationRecord;\n /** saasRoot-relative path of the persisted record. */\n recordPath: string;\n}\n\nconst DELIBERATIONS_DIR_SEGMENTS = ['.wildo-saas', 'generated', 'deliberations'] as const;\n\n/**\n * Deliberation COMPOSER (agentic deliberation system, Step 3) — the\n * companion half of the split: it owns charters, agents, candidate BYTES\n * and record persistence; the ENGINE (`ActorsSystemBackendService.\n * executeDeliberation`) owns the orchestration semantics.\n *\n * Composition steps: read the committed charters (introspection read-back,\n * Zod-validated) → enforce NARROWNESS fail-closed (every reviewer's role\n * must declare the deliberation's work domain; the coordinator is the\n * manager hat and is not domain-gated) → map charters to runtime profiles\n * (workDomains come from the TEMPLATE — the charter carries substance, the\n * framework carries routing) → persist the initial candidate bytes under\n * `.wildo-saas/generated/deliberations/<ref>/candidates/` → hand the engine\n * a plan whose PRODUCER callback revises TEXT candidates through the\n * `deliberation.text-producer.agent` and persists each revision → persist\n * the returned `DeliberationRecord` (RF-2).\n *\n * Fail-closed posture (RF-6): a reviewer/coordinator role without a\n * committed charter aborts with \"derive + accept the charter first\"; a\n * charter accepted after startup has no registered agent until the\n * companion restarts — the error says exactly that.\n */\n@injectable()\nexport class DeliberationCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ActorsSystemBackendService)\n private readonly actorsSystemService: ActorsSystemBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly companionIntrospectionService: CompanionIntrospectionService,\n ) {\n this.logDebug = this.logger.debugByType('DeliberationCompanionService');\n this.logger.setDebugTypeLogging('DeliberationCompanionService', true);\n }\n\n public async run(\n options: DeliberationRunOptions,\n traceContext?: AgentTraceContext,\n ): Promise<DeliberationRunResult> {\n this.validateOptions(options);\n const deliberationRef = `delib-${options.workDomain.toLowerCase()}-${randomUUID().slice(0, 8)}`;\n const deliberationDirAbs = resolve(\n this.companionContext.saasRoot, ...DELIBERATIONS_DIR_SEGMENTS, deliberationRef,\n );\n const candidatesDirAbs = resolve(deliberationDirAbs, 'candidates');\n await mkdir(candidatesDirAbs, { recursive: true });\n\n // ── Experts: committed charters → narrowness-gated bindings ──\n const charters = await this.readCommittedCharters();\n const charterByRole = new Map(charters.map((charter) => [charter.roleRef, charter]));\n const reviewers = options.reviewerRoleRefs.map((roleRef) =>\n this.bindExpert(roleRef, charterByRole, { reviewDomain: options.workDomain }));\n const coordinator = this.bindExpert(options.coordinatorRoleRef, charterByRole, {});\n const rubricDeriverRole = options.rubricDeriverRoleRef ?? options.reviewerRoleRefs[0];\n const rubricDeriver = this.bindExpert(rubricDeriverRole, charterByRole, {\n ownDomain: options.workDomain,\n });\n\n // ── Initial candidates: persist bytes, hand locators+payload to the engine ──\n const relDir = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/candidates`;\n const initialCandidates: DeliberationCandidateInput[] = [];\n for (const candidate of options.candidates) {\n const fileName = `${candidate.ref}.txt`;\n await writeFile(resolve(candidatesDirAbs, fileName), candidate.text, 'utf8');\n initialCandidates.push({\n ref: candidate.ref,\n storageRef: `${relDir}/${fileName}`,\n content: { kind: FlowsActors_IO_PartKind.TEXT, text: candidate.text },\n });\n }\n\n // ── Producer: TEXT revision via the producer agent + byte persistence ──\n let revisionSequence = 0;\n const producer = {\n produceRevision: async (\n parent: DeliberationCandidateInput,\n revisionPrompt: string,\n ): Promise<DeliberationCandidateInput> => {\n if (parent.content.kind !== FlowsActors_IO_PartKind.TEXT) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'The TEXT deliberation route cannot revise non-text candidates.' },\n });\n }\n const revised = await this.reviseText(parent.content.text, revisionPrompt, options.briefContext, traceContext);\n revisionSequence += 1;\n const ref = `${parent.ref}-rev${revisionSequence}`;\n const fileName = `${ref}.txt`;\n await writeFile(resolve(candidatesDirAbs, fileName), revised, 'utf8');\n return {\n ref,\n storageRef: `${relDir}/${fileName}`,\n content: { kind: FlowsActors_IO_PartKind.TEXT, text: revised },\n };\n },\n };\n\n const plan: DeliberationPlan = {\n deliberationRef,\n workDomain: options.workDomain,\n subjectKind: FlowsActors_IO_PartKind.TEXT,\n briefContext: options.briefContext,\n reviewers,\n coordinator,\n rubricDeriver,\n producerAgentRef: DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n producer,\n initialCandidates,\n roundBudget: options.roundBudget ?? 2,\n shortlistSize: options.shortlistSize ?? 2,\n charterInputsDigests: Object.fromEntries(\n [...new Set([...reviewers, coordinator, rubricDeriver].map((binding) => binding.profile.charterRef))]\n .map((charterRef) => {\n const charter = charters.find((entry) => entry.charterRef === charterRef);\n return [charterRef, charter?.inputsDigest ?? 'unknown'];\n }),\n ),\n };\n\n this.logDebug('deliberation composed', {\n deliberationRef,\n reviewers: reviewers.map((binding) => binding.profile.roleRef),\n coordinator: coordinator.profile.roleRef,\n candidates: initialCandidates.length,\n });\n\n // ── Engine orchestration → persist the record (RF-2) ────────\n const record = await this.actorsSystemService.executeDeliberation(plan, traceContext);\n const recordPath = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/record.json`;\n await writeFile(\n resolve(deliberationDirAbs, 'record.json'),\n `${JSON.stringify(record, null, 2)}\\n`,\n 'utf8',\n );\n this.logDebug('deliberation record persisted', {\n deliberationRef,\n status: record.status,\n rounds: record.rounds.length,\n winnerRef: record.synthesis?.winnerRef,\n recordPath,\n });\n return { record, recordPath };\n }\n\n private validateOptions(options: DeliberationRunOptions): void {\n /*\n * The SAME floor the engine enforces (`validateDeliberationPlan`), raised here too\n * so the composer refuses before spending a charter read — and, more importantly,\n * so the two sites do not disagree about what a panel IS. Two floors for one\n * invariant is how a rule ends up half-applied\n * (`invariant-call-site-enumeration.md`); if this bound moves, move both.\n */\n if (options.candidates.length === 0 || options.reviewerRoleRefs.length < 2) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: 'A deliberation needs ≥1 candidate and ≥2 reviewer roles — a panel of one is a judge, '\n + 'not a deliberation, and its record would carry an always-empty dissent.',\n },\n });\n }\n const refs = new Set(options.candidates.map((candidate) => candidate.ref));\n if (refs.size !== options.candidates.length) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'Candidate refs must be unique.' },\n });\n }\n }\n\n /**\n * Resolve one expert seat: committed charter (fail-closed, RF-6) +\n * NARROWNESS enforcement on the right axis — `ownDomain` gates OWNERSHIP\n * (rubric derivation / brief authoring: `template.workDomains`),\n * `reviewDomain` gates PANEL PARTICIPATION (`template.reviewScopes` —\n * a guardian/strategist reviews a mark through its own lens without\n * owning marks) — + charter→runtime-profile mapping (domains from the\n * framework TEMPLATE; substance from the derived charter).\n */\n public bindExpert(\n roleRef: string,\n charterByRole: Map<string, ExpertPersonaCharter>,\n gate: { ownDomain?: ExpertWorkDomain; reviewDomain?: ExpertWorkDomain },\n ): DeliberationExpertBinding {\n const template = getExpertRoleTemplate(roleRef);\n if (!template) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: `Unknown expert role '${roleRef}' — no such template in EXPERT_ROLE_TEMPLATES.` },\n });\n }\n if (gate.ownDomain !== undefined && !template.workDomains.includes(gate.ownDomain)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `NARROWNESS (ownership): role '${roleRef}' does not OWN work domain '${gate.ownDomain}' `\n + `(owns [${template.workDomains.join(', ')}]) — only the domain owner authors briefs and `\n + `derives rubrics. Use the owning role instead.`,\n },\n });\n }\n if (gate.reviewDomain !== undefined && !template.reviewScopes.includes(gate.reviewDomain)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `NARROWNESS (lens): role '${roleRef}' does not review work domain '${gate.reviewDomain}' `\n + `(review scopes: [${template.reviewScopes.join(', ')}]) — an expert never sits on a panel `\n + `outside its lens reach. Convene a role whose review scope covers the domain.`,\n },\n });\n }\n const charter = charterByRole.get(roleRef);\n if (!charter) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Role '${roleRef}' has no COMMITTED charter — derive + accept it first `\n + `(POST /expert-personas/derive then /accept), then RESTART the companion so its agent `\n + `registers (agents are indexed at startup).`,\n },\n });\n }\n const profile: RuntimeExpertProfile = {\n charterRef: charter.charterRef,\n roleRef: charter.roleRef,\n workDomains: template.workDomains,\n personaProse: charter.personaProse,\n priorities: charter.priorities,\n taboos: charter.taboos,\n ...(charter.qualityBar !== undefined ? { qualityBar: charter.qualityBar } : {}),\n ...(charter.reviewProtocol !== undefined ? { reviewProtocol: charter.reviewProtocol } : {}),\n };\n return { profile, agentRef: expertAgentRefForRole(roleRef) };\n }\n\n /**\n * Committed charters via the read-back behavior, Zod-validated at the\n * seam. PUBLIC on purpose: this + `bindExpert` are the shared composer\n * seams other deliberation adopters (e.g. the brand/logo IMAGE flow)\n * reuse instead of duplicating charter/narrowness logic.\n */\n public async readCommittedCharters(): Promise<ExpertPersonaCharter[]> {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { message: 'No backend service available to resolve the expert-persona-charters behavior.' },\n });\n }\n const introspection = await this.companionIntrospectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'expert-persona-charters',\n input: {},\n });\n if (introspection.success === false) {\n const failure = introspection;\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { message: failure.error.message, behavior: failure.behavior },\n });\n }\n const raw = (introspection.data as { charters?: unknown[] }).charters ?? [];\n return raw.map((candidate, index) => {\n const parsed = ExpertPersonaCharterSchema.safeParse(candidate);\n if (!parsed.success) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Committed charter at index ${index} is structurally invalid: `\n + parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; '),\n },\n });\n }\n return parsed.data;\n });\n }\n\n /** One TEXT revision through the producer agent (strict-validated). */\n private async reviseText(\n currentText: string,\n revisionPrompt: string,\n briefContext: string,\n traceContext?: AgentTraceContext,\n ): Promise<string> {\n const prompt = [\n briefContext,\n '',\n '# Current candidate text',\n currentText,\n '',\n revisionPrompt,\n ].join('\\n');\n const invocation: FlowsActors_Agent_Invocation<\n typeof LLMProvider_GenerateStructuredInputSchema,\n typeof LLMProvider_GenerateStructuredOutputSchema\n > = {\n agentRef: DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt, schema: DeliberationTextRevisionOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation, traceContext);\n const raw = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = DeliberationTextRevisionOutputStrictSchema.safeParse(raw);\n if (!parsed.success || parsed.data.revisedText.trim().length === 0) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message: 'The text producer returned an invalid/empty revision — re-run the deliberation.',\n },\n });\n }\n return parsed.data.revisedText;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deliberation.companion.service.js","sourceRoot":"","sources":["../../../../src/deliberations/services/deliberation.companion.service.ts"],"names":[],"mappings":";;;;;;;;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U,EAAE,YAAY,CAAC,CAAC;QAChF,MAAM,GAAG,GAAI,QAAQ,CAAC,MAA2C,EAAE,MAAM,CAAC;QAC1E,MAAM,MAAM,GAAG,0CAA0C,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE;gBAChE,sBAAsB,EAAE,2BAA2B,CAAC,QAAQ;gBAC5D,OAAO,EAAE;oBACP,OAAO,EAAE,iFAAiF;iBAC3F;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;IACjC,CAAC;CACF,CAAA;AAxSY,4BAA4B;IADxC,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;IAErD,WAAA,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;IAE/C,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;qCATO,aAAa;QAE1C,0BAA0B;QAEnB,0BAA0B,oBAMhB,6BAA6B;GAdpE,4BAA4B,CAwSxC","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport {\n ActorsSystemBackendService,\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n type AgentsBackendService,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n ExpertWorkDomain,\n FlowsActors_IO_PartKind,\n type AgentTraceContext,\n type DeliberationCandidateInput,\n type DeliberationExpertBinding,\n type DeliberationPlan,\n type DeliberationRecord,\n type FlowsActors_Agent_Invocation,\n type RuntimeExpertProfile,\n} from '@wildo-ai/saas-models';\nimport {\n LLMProvider_GenerateStructuredInputSchema,\n LLMProvider_GenerateStructuredOutputSchema,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ExpertPersonaCharterSchema,\n getExpertRoleTemplate,\n type ExpertPersonaCharter,\n} from '@wildo-ai/saas-specifications';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport {\n DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n DeliberationTextRevisionOutputSchema,\n DeliberationTextRevisionOutputStrictSchema,\n expertAgentRefForRole,\n} from '../models/deliberation-agents.actors-system.definitions';\n\n/** A TEXT-subject deliberation request (the v1 route; IMAGE arrives with the brand refit). */\nexport interface DeliberationRunOptions {\n workDomain: ExpertWorkDomain;\n /** The assembled work-product brief every pass is grounded on. */\n briefContext: string;\n /** The initial candidate set (inline text; the service persists the bytes). */\n candidates: Array<{ ref: string; text: string }>;\n /** Panel roles — each must have a committed charter AND cover the work domain. */\n reviewerRoleRefs: string[];\n /** Coordinator role — the manager hat; NOT domain-gated (documented in the plan). */\n coordinatorRoleRef: string;\n /** Rubric-deriving role (default: the first reviewer — the domain owner). */\n rubricDeriverRoleRef?: string;\n roundBudget?: number;\n shortlistSize?: number;\n}\n\nexport interface DeliberationRunResult {\n record: DeliberationRecord;\n /** saasRoot-relative path of the persisted record. */\n recordPath: string;\n}\n\nconst DELIBERATIONS_DIR_SEGMENTS = ['.wildo-saas', 'generated', 'deliberations'] as const;\n\n/**\n * Deliberation COMPOSER (agentic deliberation system, Step 3) — the\n * companion half of the split: it owns charters, agents, candidate BYTES\n * and record persistence; the ENGINE (`ActorsSystemBackendService.\n * executeDeliberation`) owns the orchestration semantics.\n *\n * Composition steps: read the committed charters (introspection read-back,\n * Zod-validated) → enforce NARROWNESS fail-closed (every reviewer's role\n * must declare the deliberation's work domain; the coordinator is the\n * manager hat and is not domain-gated) → map charters to runtime profiles\n * (workDomains come from the TEMPLATE — the charter carries substance, the\n * framework carries routing) → persist the initial candidate bytes under\n * `.wildo-saas/generated/deliberations/<ref>/candidates/` → hand the engine\n * a plan whose PRODUCER callback revises TEXT candidates through the\n * `deliberation.text-producer.agent` and persists each revision → persist\n * the returned `DeliberationRecord` (RF-2).\n *\n * Fail-closed posture (RF-6): a reviewer/coordinator role without a\n * committed charter aborts with \"derive + accept the charter first\"; a\n * charter accepted after startup has no registered agent until the\n * companion restarts — the error says exactly that.\n */\n@injectable()\nexport class DeliberationCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ActorsSystemBackendService)\n private readonly actorsSystemService: ActorsSystemBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly companionIntrospectionService: CompanionIntrospectionService,\n ) {\n this.logDebug = this.logger.debugByType('DeliberationCompanionService');\n this.logger.setDebugTypeLogging('DeliberationCompanionService', true);\n }\n\n public async run(\n options: DeliberationRunOptions,\n traceContext?: AgentTraceContext,\n ): Promise<DeliberationRunResult> {\n this.validateOptions(options);\n const deliberationRef = `delib-${options.workDomain.toLowerCase()}-${randomUUID().slice(0, 8)}`;\n const deliberationDirAbs = resolve(\n this.companionContext.saasRoot, ...DELIBERATIONS_DIR_SEGMENTS, deliberationRef,\n );\n const candidatesDirAbs = resolve(deliberationDirAbs, 'candidates');\n await mkdir(candidatesDirAbs, { recursive: true });\n\n // ── Experts: committed charters → narrowness-gated bindings ──\n const charters = await this.readCommittedCharters();\n const charterByRole = new Map(charters.map((charter) => [charter.roleRef, charter]));\n const reviewers = options.reviewerRoleRefs.map((roleRef) =>\n this.bindExpert(roleRef, charterByRole, { reviewDomain: options.workDomain }));\n const coordinator = this.bindExpert(options.coordinatorRoleRef, charterByRole, {});\n const rubricDeriverRole = options.rubricDeriverRoleRef ?? options.reviewerRoleRefs[0];\n const rubricDeriver = this.bindExpert(rubricDeriverRole, charterByRole, {\n ownDomain: options.workDomain,\n });\n\n // ── Initial candidates: persist bytes, hand locators+payload to the engine ──\n const relDir = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/candidates`;\n const initialCandidates: DeliberationCandidateInput[] = [];\n for (const candidate of options.candidates) {\n const fileName = `${candidate.ref}.txt`;\n await writeFile(resolve(candidatesDirAbs, fileName), candidate.text, 'utf8');\n initialCandidates.push({\n ref: candidate.ref,\n storageRef: `${relDir}/${fileName}`,\n content: { kind: FlowsActors_IO_PartKind.TEXT, text: candidate.text },\n });\n }\n\n // ── Producer: TEXT revision via the producer agent + byte persistence ──\n let revisionSequence = 0;\n const producer = {\n produceRevision: async (\n parent: DeliberationCandidateInput,\n revisionPrompt: string,\n ): Promise<DeliberationCandidateInput> => {\n if (parent.content.kind !== FlowsActors_IO_PartKind.TEXT) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'The TEXT deliberation route cannot revise non-text candidates.' },\n });\n }\n const revised = await this.reviseText(parent.content.text, revisionPrompt, options.briefContext, traceContext);\n revisionSequence += 1;\n const ref = `${parent.ref}-rev${revisionSequence}`;\n const fileName = `${ref}.txt`;\n await writeFile(resolve(candidatesDirAbs, fileName), revised, 'utf8');\n return {\n ref,\n storageRef: `${relDir}/${fileName}`,\n content: { kind: FlowsActors_IO_PartKind.TEXT, text: revised },\n };\n },\n };\n\n const plan: DeliberationPlan = {\n deliberationRef,\n workDomain: options.workDomain,\n subjectKind: FlowsActors_IO_PartKind.TEXT,\n briefContext: options.briefContext,\n reviewers,\n coordinator,\n rubricDeriver,\n producerAgentRef: DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n producer,\n initialCandidates,\n roundBudget: options.roundBudget ?? 2,\n shortlistSize: options.shortlistSize ?? 2,\n };\n\n this.logDebug('deliberation composed', {\n deliberationRef,\n reviewers: reviewers.map((binding) => binding.profile.roleRef),\n coordinator: coordinator.profile.roleRef,\n candidates: initialCandidates.length,\n });\n\n // ── Engine orchestration → persist the record (RF-2) ────────\n const record = await this.actorsSystemService.executeDeliberation(plan, traceContext);\n const recordPath = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/record.json`;\n await writeFile(\n resolve(deliberationDirAbs, 'record.json'),\n `${JSON.stringify(record, null, 2)}\\n`,\n 'utf8',\n );\n this.logDebug('deliberation record persisted', {\n deliberationRef,\n status: record.status,\n rounds: record.rounds.length,\n winnerRef: record.synthesis?.winnerRef,\n recordPath,\n });\n return { record, recordPath };\n }\n\n private validateOptions(options: DeliberationRunOptions): void {\n /*\n * The SAME floor the engine enforces (`validateDeliberationPlan`), raised here too\n * so the composer refuses before spending a charter read — and, more importantly,\n * so the two sites do not disagree about what a panel IS. Two floors for one\n * invariant is how a rule ends up half-applied\n * (`invariant-call-site-enumeration.md`); if this bound moves, move both.\n */\n if (options.candidates.length === 0 || options.reviewerRoleRefs.length < 2) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: 'A deliberation needs ≥1 candidate and ≥2 reviewer roles — a panel of one is a judge, '\n + 'not a deliberation, and its record would carry an always-empty dissent.',\n },\n });\n }\n const refs = new Set(options.candidates.map((candidate) => candidate.ref));\n if (refs.size !== options.candidates.length) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'Candidate refs must be unique.' },\n });\n }\n }\n\n /**\n * Resolve one expert seat: committed charter (fail-closed, RF-6) +\n * NARROWNESS enforcement on the right axis — `ownDomain` gates OWNERSHIP\n * (rubric derivation / brief authoring: `template.workDomains`),\n * `reviewDomain` gates PANEL PARTICIPATION (`template.reviewScopes` —\n * a guardian/strategist reviews a mark through its own lens without\n * owning marks) — + charter→runtime-profile mapping (domains from the\n * framework TEMPLATE; substance from the derived charter).\n */\n public bindExpert(\n roleRef: string,\n charterByRole: Map<string, ExpertPersonaCharter>,\n gate: { ownDomain?: ExpertWorkDomain; reviewDomain?: ExpertWorkDomain },\n ): DeliberationExpertBinding {\n const template = getExpertRoleTemplate(roleRef);\n if (!template) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: `Unknown expert role '${roleRef}' — no such template in EXPERT_ROLE_TEMPLATES.` },\n });\n }\n if (gate.ownDomain !== undefined && !template.workDomains.includes(gate.ownDomain)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `NARROWNESS (ownership): role '${roleRef}' does not OWN work domain '${gate.ownDomain}' `\n + `(owns [${template.workDomains.join(', ')}]) — only the domain owner authors briefs and `\n + `derives rubrics. Use the owning role instead.`,\n },\n });\n }\n if (gate.reviewDomain !== undefined && !template.reviewScopes.includes(gate.reviewDomain)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `NARROWNESS (lens): role '${roleRef}' does not review work domain '${gate.reviewDomain}' `\n + `(review scopes: [${template.reviewScopes.join(', ')}]) — an expert never sits on a panel `\n + `outside its lens reach. Convene a role whose review scope covers the domain.`,\n },\n });\n }\n const charter = charterByRole.get(roleRef);\n if (!charter) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Role '${roleRef}' has no COMMITTED charter — derive + accept it first `\n + `(POST /expert-personas/derive then /accept), then RESTART the companion so its agent `\n + `registers (agents are indexed at startup).`,\n },\n });\n }\n const profile: RuntimeExpertProfile = {\n charterRef: charter.charterRef,\n roleRef: charter.roleRef,\n workDomains: template.workDomains,\n personaProse: charter.personaProse,\n priorities: charter.priorities,\n taboos: charter.taboos,\n ...(charter.qualityBar !== undefined ? { qualityBar: charter.qualityBar } : {}),\n ...(charter.reviewProtocol !== undefined ? { reviewProtocol: charter.reviewProtocol } : {}),\n };\n return { profile, agentRef: expertAgentRefForRole(roleRef) };\n }\n\n /**\n * Committed charters via the read-back behavior, Zod-validated at the\n * seam. PUBLIC on purpose: this + `bindExpert` are the shared composer\n * seams other deliberation adopters (e.g. the brand/logo IMAGE flow)\n * reuse instead of duplicating charter/narrowness logic.\n */\n public async readCommittedCharters(): Promise<ExpertPersonaCharter[]> {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { message: 'No backend service available to resolve the expert-persona-charters behavior.' },\n });\n }\n const introspection = await this.companionIntrospectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'expert-persona-charters',\n input: {},\n });\n if (introspection.success === false) {\n const failure = introspection;\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { message: failure.error.message, behavior: failure.behavior },\n });\n }\n const raw = (introspection.data as { charters?: unknown[] }).charters ?? [];\n return raw.map((candidate, index) => {\n const parsed = ExpertPersonaCharterSchema.safeParse(candidate);\n if (!parsed.success) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Committed charter at index ${index} is structurally invalid: `\n + parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; '),\n },\n });\n }\n return parsed.data;\n });\n }\n\n /** One TEXT revision through the producer agent (strict-validated). */\n private async reviseText(\n currentText: string,\n revisionPrompt: string,\n briefContext: string,\n traceContext?: AgentTraceContext,\n ): Promise<string> {\n const prompt = [\n briefContext,\n '',\n '# Current candidate text',\n currentText,\n '',\n revisionPrompt,\n ].join('\\n');\n const invocation: FlowsActors_Agent_Invocation<\n typeof LLMProvider_GenerateStructuredInputSchema,\n typeof LLMProvider_GenerateStructuredOutputSchema\n > = {\n agentRef: DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt, schema: DeliberationTextRevisionOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation, traceContext);\n const raw = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = DeliberationTextRevisionOutputStrictSchema.safeParse(raw);\n if (!parsed.success || parsed.data.revisedText.trim().length === 0) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message: 'The text producer returned an invalid/empty revision — re-run the deliberation.',\n },\n });\n }\n return parsed.data.revisedText;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-deliberation.companion.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"structured-deliberation.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/deliberations/services/structured-deliberation.companion.service.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,0BAA0B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AE,0BAA0B,EAE/C,gBAAgB,EAAE,gBAAgB,EAElC,oBAAoB,EAAE,4BAA4B;IAMxD,GAAG,CAAC,KAAK,EAAE;QACtB,8CAA8C;QAC9C,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC;QAClD,wFAAwF;QACxF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,8EAA8E;QAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;QAC/C,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;KAC3C,GAAG,OAAO,CAAC,4BAA4B,CAAC;CAuI1C"}
|
|
@@ -132,8 +132,6 @@ let StructuredDeliberationCompanionService = class StructuredDeliberationCompani
|
|
|
132
132
|
initialCandidates,
|
|
133
133
|
roundBudget: panel.roundBudget ?? 2,
|
|
134
134
|
shortlistSize: panel.shortlistSize ?? 2,
|
|
135
|
-
charterInputsDigests: Object.fromEntries([...new Set([...reviewers, coordinator, rubricDeriver].map((binding) => binding.profile.charterRef))]
|
|
136
|
-
.map((charterRef) => [charterRef, charters.find((entry) => entry.charterRef === charterRef)?.inputsDigest ?? 'unknown'])),
|
|
137
135
|
};
|
|
138
136
|
const record = await this.actorsSystemService.executeDeliberation(plan, input.traceContext);
|
|
139
137
|
const recordPath = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/record.json`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-deliberation.companion.service.js","sourceRoot":"","sources":["../../../../../src/deliberations/services/structured-deliberation.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,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import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport {\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n ActorsSystemBackendService,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n FlowsActors_IO_PartKind,\n type AgentTraceContext,\n type DeliberationCandidateInput,\n type DeliberationPlan,\n DeliberationStatus,\n type DeliberationRecord,\n} from '@wildo-ai/saas-models';\nimport type { MetaWorkflow_PlaybookDeliberation } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { DELIBERATION_TEXT_PRODUCER_AGENT_REF } from '../models/deliberation-agents.actors-system.definitions';\nimport { DeliberationCompanionService } from './deliberation.companion.service';\n\nconst DELIBERATIONS_DIR_SEGMENTS = ['.wildo-saas', 'generated', 'deliberations'] as const;\n\n/** How one structured candidate is produced or revised — supplied by the caller, which owns the schema. */\nexport interface StructuredCandidateProducer {\n /**\n * Produce candidate `index` of `total`. The caller varies its own prompt so the\n * candidates genuinely differ; this service never composes prompts, because the\n * brief belongs to whatever family is being deliberated.\n */\n produceInitial(index: number, total: number): Promise<unknown>;\n /** Revise `parent` against the coordinator's deterministic revision prompt. */\n produceRevision(parent: unknown, revisionPrompt: string): Promise<unknown>;\n /**\n * OPTIONAL human-readable framing rendered ABOVE the candidate's JSON — never\n * instead of it. See `DeliberationCandidateContent`: the engine always renders the\n * value, so a projection that drifts cannot cause the panel to score prose while\n * the winner is data.\n */\n project?(value: unknown): string | undefined;\n}\n\nexport interface StructuredDeliberationResult {\n /** The winning candidate's value — what the caller lands. */\n readonly winner: unknown;\n readonly record: DeliberationRecord;\n /** saasRoot-relative path of the persisted record. */\n readonly recordPath: string;\n}\n\n/**\n * Runs an expert panel over STRUCTURED candidates.\n *\n * The sibling of `LogoDeliberationCompanionService` for the third subject kind, and\n * built the same way: charter reading and narrowness gating are delegated to the\n * shared `DeliberationCompanionService` seams (`readCommittedCharters`, `bindExpert`),\n * so the working TEXT route is untouched and there is one implementation of \"who may\n * sit on this panel\".\n *\n * Deliberately GENERIC over the family. It knows nothing about placement, or any\n * other artifact: the caller owns the schema, the brief and the prompts, and hands in\n * a producer. That keeps this service from accumulating a per-family branch every\n * time another artifact becomes worth arguing over.\n */\n@injectable()\nexport class StructuredDeliberationCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ActorsSystemBackendService)\n private readonly actorsSystemService: ActorsSystemBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.DeliberationService)\n private readonly deliberationComposer: DeliberationCompanionService,\n ) {\n this.logDebug = this.logger.debugByType('StructuredDeliberationCompanionService');\n this.logger.setDebugTypeLogging('StructuredDeliberationCompanionService', true);\n }\n\n public async run(input: {\n /** The panel, as the playbook declared it. */\n readonly panel: MetaWorkflow_PlaybookDeliberation;\n /** The assembled brief every pass is grounded on — the caller's, not this service's. */\n readonly briefContext: string;\n /** Correlation label, e.g. `placement-plan`. Used in the deliberation ref. */\n readonly label: string;\n readonly producer: StructuredCandidateProducer;\n readonly traceContext?: AgentTraceContext;\n }): Promise<StructuredDeliberationResult> {\n const { panel, producer } = input;\n const deliberationRef = `delib-${input.label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}-${randomUUID().slice(0, 8)}`;\n const deliberationDirAbs = resolve(this.companionContext.saasRoot, ...DELIBERATIONS_DIR_SEGMENTS, deliberationRef);\n const candidatesDirAbs = resolve(deliberationDirAbs, 'candidates');\n await mkdir(candidatesDirAbs, { recursive: true });\n const relDir = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/candidates`;\n\n // ── Panel: committed charters → narrowness-gated bindings (shared seams) ──\n const charters = await this.deliberationComposer.readCommittedCharters();\n const charterByRole = new Map(charters.map((charter) => [charter.roleRef, charter]));\n const reviewers = panel.reviewerRoleRefs.map((roleRef) =>\n this.deliberationComposer.bindExpert(roleRef, charterByRole, { reviewDomain: panel.workDomain }));\n const coordinator = this.deliberationComposer.bindExpert(panel.coordinatorRoleRef, charterByRole, {});\n const rubricDeriverRole = panel.rubricDeriverRoleRef ?? panel.reviewerRoleRefs[0]!;\n const rubricDeriver = this.deliberationComposer.bindExpert(rubricDeriverRole, charterByRole, {\n ownDomain: panel.workDomain,\n });\n\n // ── Initial candidates: persist bytes, hand locators + payload to the engine ──\n /*\n * Every candidate VALUE this run produced, keyed by ref — initial and revised alike.\n *\n * Necessary because the persisted `DeliberationRecord` carries only refs and\n * storage locators, never payloads (the engine never holds candidate bytes, RF-2).\n * A first cut resolved the winner from `record.rounds[].candidateSet` and would\n * have resolved any REVISED winner to `undefined` — which is most of them, since\n * revision is the point of a multi-round panel.\n */\n const valueByRef = new Map<string, unknown>();\n\n const persist = async (ref: string, value: unknown): Promise<DeliberationCandidateInput> => {\n const fileName = `${ref}.json`;\n await writeFile(resolve(candidatesDirAbs, fileName), `${JSON.stringify(value, null, 2)}\\n`, 'utf8');\n valueByRef.set(ref, value);\n const projection = producer.project?.(value);\n return {\n ref,\n storageRef: `${relDir}/${fileName}`,\n content: {\n kind: FlowsActors_IO_PartKind.STRUCTURED,\n value,\n ...(projection === undefined ? {} : { projection }),\n },\n };\n };\n\n const initialCandidates: DeliberationCandidateInput[] = [];\n for (let index = 0; index < panel.candidateCount; index += 1) {\n const value = await producer.produceInitial(index, panel.candidateCount);\n initialCandidates.push(await persist(`c${index + 1}`, value));\n }\n if (initialCandidates.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'A structured deliberation produced no candidates — there is nothing to deliberate over.' },\n });\n }\n\n let revisionSequence = 0;\n const plan: DeliberationPlan = {\n deliberationRef,\n workDomain: panel.workDomain,\n subjectKind: FlowsActors_IO_PartKind.STRUCTURED,\n briefContext: input.briefContext,\n reviewers,\n coordinator,\n rubricDeriver,\n // The revision producer is the CALLER's structured generator, not the text\n // producer agent; this ref is the audit stamp for who produced revisions, and\n // naming the text agent would be a lie about what ran.\n producerAgentRef: DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n producer: {\n produceRevision: async (parent, revisionPrompt) => {\n if (parent.content.kind !== FlowsActors_IO_PartKind.STRUCTURED) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'The STRUCTURED deliberation route cannot revise a non-structured candidate.' },\n });\n }\n const revised = await producer.produceRevision(parent.content.value, revisionPrompt);\n revisionSequence += 1;\n return persist(`${parent.ref}-rev${revisionSequence}`, revised);\n },\n },\n initialCandidates,\n roundBudget: panel.roundBudget ?? 2,\n shortlistSize: panel.shortlistSize ?? 2,\n charterInputsDigests: Object.fromEntries(\n [...new Set([...reviewers, coordinator, rubricDeriver].map((binding) => binding.profile.charterRef))]\n .map((charterRef) => [charterRef, charters.find((entry) => entry.charterRef === charterRef)?.inputsDigest ?? 'unknown']),\n ),\n };\n\n const record = await this.actorsSystemService.executeDeliberation(plan, input.traceContext);\n const recordPath = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/record.json`;\n await writeFile(resolve(deliberationDirAbs, 'record.json'), `${JSON.stringify(record, null, 2)}\\n`, 'utf8');\n\n /*\n * Resolve the winner from the values THIS RUN produced, and fail loudly when the\n * ref does not resolve: a coordinator naming a candidate that does not exist must\n * never land an `undefined` artifact.\n */\n /*\n * A REJECTED panel is a RESULT, and it must not surface as \"something went wrong\".\n * The engine completed, every lens was heard, and the answer is \"none of these\" —\n * so the message says that, names the rejected count, and points at the record\n * where the critiques are. Reporting it as a missing winner would send the reader\n * looking for a defect in the machinery instead of at the candidates.\n */\n if (record.status === DeliberationStatus.REJECTED) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `The panel REJECTED every one of the ${initialCandidates.length} candidate(s) for `\n + `'${input.label}' — this is a verdict, not a failure. Nothing is landed. The reviewers' `\n + `critiques are in ${recordPath}; widen the brief or the candidate set and re-run.`,\n },\n });\n }\n\n const winnerRef = record.synthesis?.winnerRef;\n const winner = winnerRef === undefined ? undefined : valueByRef.get(winnerRef);\n if (winnerRef === undefined || winner === undefined) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `The deliberation produced no resolvable winner (synthesis ref ${winnerRef ?? 'absent'}); `\n + `record at ${recordPath}. A run that cannot name its winner has decided nothing, and landing `\n + 'anything here would attribute an unargued artifact to a panel.',\n },\n });\n }\n\n this.logDebug('structured deliberation complete', {\n deliberationRef, status: record.status, rounds: record.rounds.length, winnerRef, recordPath,\n });\n return { winner, record, recordPath };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"structured-deliberation.companion.service.js","sourceRoot":"","sources":["../../../../src/deliberations/services/structured-deliberation.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B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AAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU;SAC5F,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IACxC,CAAC;CACF,CAAA;AAlKY,sCAAsC;IADlD,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;IAErD,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAA;qCAPQ,aAAa;QAE1C,0BAA0B;QAEnB,0BAA0B,UAIzB,4BAA4B;GAZ1D,sCAAsC,CAkKlD","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport {\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n ActorsSystemBackendService,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n FlowsActors_IO_PartKind,\n type AgentTraceContext,\n type DeliberationCandidateInput,\n type DeliberationPlan,\n DeliberationStatus,\n type DeliberationRecord,\n} from '@wildo-ai/saas-models';\nimport type { MetaWorkflow_PlaybookDeliberation } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { DELIBERATION_TEXT_PRODUCER_AGENT_REF } from '../models/deliberation-agents.actors-system.definitions';\nimport { DeliberationCompanionService } from './deliberation.companion.service';\n\nconst DELIBERATIONS_DIR_SEGMENTS = ['.wildo-saas', 'generated', 'deliberations'] as const;\n\n/** How one structured candidate is produced or revised — supplied by the caller, which owns the schema. */\nexport interface StructuredCandidateProducer {\n /**\n * Produce candidate `index` of `total`. The caller varies its own prompt so the\n * candidates genuinely differ; this service never composes prompts, because the\n * brief belongs to whatever family is being deliberated.\n */\n produceInitial(index: number, total: number): Promise<unknown>;\n /** Revise `parent` against the coordinator's deterministic revision prompt. */\n produceRevision(parent: unknown, revisionPrompt: string): Promise<unknown>;\n /**\n * OPTIONAL human-readable framing rendered ABOVE the candidate's JSON — never\n * instead of it. See `DeliberationCandidateContent`: the engine always renders the\n * value, so a projection that drifts cannot cause the panel to score prose while\n * the winner is data.\n */\n project?(value: unknown): string | undefined;\n}\n\nexport interface StructuredDeliberationResult {\n /** The winning candidate's value — what the caller lands. */\n readonly winner: unknown;\n readonly record: DeliberationRecord;\n /** saasRoot-relative path of the persisted record. */\n readonly recordPath: string;\n}\n\n/**\n * Runs an expert panel over STRUCTURED candidates.\n *\n * The sibling of `LogoDeliberationCompanionService` for the third subject kind, and\n * built the same way: charter reading and narrowness gating are delegated to the\n * shared `DeliberationCompanionService` seams (`readCommittedCharters`, `bindExpert`),\n * so the working TEXT route is untouched and there is one implementation of \"who may\n * sit on this panel\".\n *\n * Deliberately GENERIC over the family. It knows nothing about placement, or any\n * other artifact: the caller owns the schema, the brief and the prompts, and hands in\n * a producer. That keeps this service from accumulating a per-family branch every\n * time another artifact becomes worth arguing over.\n */\n@injectable()\nexport class StructuredDeliberationCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ActorsSystemBackendService)\n private readonly actorsSystemService: ActorsSystemBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.DeliberationService)\n private readonly deliberationComposer: DeliberationCompanionService,\n ) {\n this.logDebug = this.logger.debugByType('StructuredDeliberationCompanionService');\n this.logger.setDebugTypeLogging('StructuredDeliberationCompanionService', true);\n }\n\n public async run(input: {\n /** The panel, as the playbook declared it. */\n readonly panel: MetaWorkflow_PlaybookDeliberation;\n /** The assembled brief every pass is grounded on — the caller's, not this service's. */\n readonly briefContext: string;\n /** Correlation label, e.g. `placement-plan`. Used in the deliberation ref. */\n readonly label: string;\n readonly producer: StructuredCandidateProducer;\n readonly traceContext?: AgentTraceContext;\n }): Promise<StructuredDeliberationResult> {\n const { panel, producer } = input;\n const deliberationRef = `delib-${input.label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}-${randomUUID().slice(0, 8)}`;\n const deliberationDirAbs = resolve(this.companionContext.saasRoot, ...DELIBERATIONS_DIR_SEGMENTS, deliberationRef);\n const candidatesDirAbs = resolve(deliberationDirAbs, 'candidates');\n await mkdir(candidatesDirAbs, { recursive: true });\n const relDir = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/candidates`;\n\n // ── Panel: committed charters → narrowness-gated bindings (shared seams) ──\n const charters = await this.deliberationComposer.readCommittedCharters();\n const charterByRole = new Map(charters.map((charter) => [charter.roleRef, charter]));\n const reviewers = panel.reviewerRoleRefs.map((roleRef) =>\n this.deliberationComposer.bindExpert(roleRef, charterByRole, { reviewDomain: panel.workDomain }));\n const coordinator = this.deliberationComposer.bindExpert(panel.coordinatorRoleRef, charterByRole, {});\n const rubricDeriverRole = panel.rubricDeriverRoleRef ?? panel.reviewerRoleRefs[0]!;\n const rubricDeriver = this.deliberationComposer.bindExpert(rubricDeriverRole, charterByRole, {\n ownDomain: panel.workDomain,\n });\n\n // ── Initial candidates: persist bytes, hand locators + payload to the engine ──\n /*\n * Every candidate VALUE this run produced, keyed by ref — initial and revised alike.\n *\n * Necessary because the persisted `DeliberationRecord` carries only refs and\n * storage locators, never payloads (the engine never holds candidate bytes, RF-2).\n * A first cut resolved the winner from `record.rounds[].candidateSet` and would\n * have resolved any REVISED winner to `undefined` — which is most of them, since\n * revision is the point of a multi-round panel.\n */\n const valueByRef = new Map<string, unknown>();\n\n const persist = async (ref: string, value: unknown): Promise<DeliberationCandidateInput> => {\n const fileName = `${ref}.json`;\n await writeFile(resolve(candidatesDirAbs, fileName), `${JSON.stringify(value, null, 2)}\\n`, 'utf8');\n valueByRef.set(ref, value);\n const projection = producer.project?.(value);\n return {\n ref,\n storageRef: `${relDir}/${fileName}`,\n content: {\n kind: FlowsActors_IO_PartKind.STRUCTURED,\n value,\n ...(projection === undefined ? {} : { projection }),\n },\n };\n };\n\n const initialCandidates: DeliberationCandidateInput[] = [];\n for (let index = 0; index < panel.candidateCount; index += 1) {\n const value = await producer.produceInitial(index, panel.candidateCount);\n initialCandidates.push(await persist(`c${index + 1}`, value));\n }\n if (initialCandidates.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'A structured deliberation produced no candidates — there is nothing to deliberate over.' },\n });\n }\n\n let revisionSequence = 0;\n const plan: DeliberationPlan = {\n deliberationRef,\n workDomain: panel.workDomain,\n subjectKind: FlowsActors_IO_PartKind.STRUCTURED,\n briefContext: input.briefContext,\n reviewers,\n coordinator,\n rubricDeriver,\n // The revision producer is the CALLER's structured generator, not the text\n // producer agent; this ref is the audit stamp for who produced revisions, and\n // naming the text agent would be a lie about what ran.\n producerAgentRef: DELIBERATION_TEXT_PRODUCER_AGENT_REF,\n producer: {\n produceRevision: async (parent, revisionPrompt) => {\n if (parent.content.kind !== FlowsActors_IO_PartKind.STRUCTURED) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'The STRUCTURED deliberation route cannot revise a non-structured candidate.' },\n });\n }\n const revised = await producer.produceRevision(parent.content.value, revisionPrompt);\n revisionSequence += 1;\n return persist(`${parent.ref}-rev${revisionSequence}`, revised);\n },\n },\n initialCandidates,\n roundBudget: panel.roundBudget ?? 2,\n shortlistSize: panel.shortlistSize ?? 2,\n };\n\n const record = await this.actorsSystemService.executeDeliberation(plan, input.traceContext);\n const recordPath = `${DELIBERATIONS_DIR_SEGMENTS.join('/')}/${deliberationRef}/record.json`;\n await writeFile(resolve(deliberationDirAbs, 'record.json'), `${JSON.stringify(record, null, 2)}\\n`, 'utf8');\n\n /*\n * Resolve the winner from the values THIS RUN produced, and fail loudly when the\n * ref does not resolve: a coordinator naming a candidate that does not exist must\n * never land an `undefined` artifact.\n */\n /*\n * A REJECTED panel is a RESULT, and it must not surface as \"something went wrong\".\n * The engine completed, every lens was heard, and the answer is \"none of these\" —\n * so the message says that, names the rejected count, and points at the record\n * where the critiques are. Reporting it as a missing winner would send the reader\n * looking for a defect in the machinery instead of at the candidates.\n */\n if (record.status === DeliberationStatus.REJECTED) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `The panel REJECTED every one of the ${initialCandidates.length} candidate(s) for `\n + `'${input.label}' — this is a verdict, not a failure. Nothing is landed. The reviewers' `\n + `critiques are in ${recordPath}; widen the brief or the candidate set and re-run.`,\n },\n });\n }\n\n const winnerRef = record.synthesis?.winnerRef;\n const winner = winnerRef === undefined ? undefined : valueByRef.get(winnerRef);\n if (winnerRef === undefined || winner === undefined) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `The deliberation produced no resolvable winner (synthesis ref ${winnerRef ?? 'absent'}); `\n + `record at ${recordPath}. A run that cannot name its winner has decided nothing, and landing `\n + 'anything here would attribute an unargued artifact to a panel.',\n },\n });\n }\n\n this.logDebug('structured deliberation complete', {\n deliberationRef, status: record.status, rounds: record.rounds.length, winnerRef, recordPath,\n });\n return { winner, record, recordPath };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-committed-expert-agents.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"load-committed-expert-agents.d.ts","sourceRoot":"","sources":["../../../../src/deliberations/utils/load-committed-expert-agents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AASrF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAAC,QAAQ,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAAC,CA4C5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template.actors-system.definitions.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"email-template.actors-system.definitions.d.ts","sourceRoot":"","sources":["../../../../src/email/models/email-template.actors-system.definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,iBAAiB,EAA0D,MAAM,uBAAuB,CAAC;AAOlH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,EAAE,iBAoC1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,EAE1C,CAAC"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* runtime service.)
|
|
26
26
|
*/
|
|
27
27
|
import { FlowsActors_Agent_Status, FlowsActors_Agent_Skill_Type } from '@wildo-ai/saas-models';
|
|
28
|
-
import {
|
|
28
|
+
import { LLMProvider_GenerateTextInputSchema, LLMProvider_GenerateTextOutputSchema, LLMProvider_OperationContext_BaseSchema, LLMProvider_OperationKey, LLM_Model_Applicability } from '@wildo-ai/external-connectors-models';
|
|
29
29
|
import { ResourceOperationRiskLevel, ResourcePrimaryScope, } from '@wildo-ai/saas-models';
|
|
30
30
|
/**
|
|
31
31
|
* Agent for scaffolding **file-based** email-template artifacts
|
|
@@ -44,7 +44,9 @@ export const emailTemplateGenerationAgent = {
|
|
|
44
44
|
status: FlowsActors_Agent_Status.ACTIVE,
|
|
45
45
|
config: {
|
|
46
46
|
providerRef: 'openai',
|
|
47
|
-
|
|
47
|
+
// STRUCTURED_AUTHORING: copy generated against a template (#439). Resolves to `gpt-5.6-terra`
|
|
48
|
+
// on `openai` today — the model this pinned.
|
|
49
|
+
modelApplicability: LLM_Model_Applicability.STRUCTURED_AUTHORING,
|
|
48
50
|
operationKey: LLMProvider_OperationKey.GENERATE_TEXT,
|
|
49
51
|
temperature: 0.4, // Slightly higher for creative template generation
|
|
50
52
|
accessControl: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template.actors-system.definitions.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"email-template.actors-system.definitions.js","sourceRoot":"","sources":["../../../../src/email/models/email-template.actors-system.definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAqB,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAClH,OAAO,EAAE,mCAAmC,EAAE,oCAAoC,EAAE,uCAAuC,EAAuC,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAClQ,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,GAAG,EAAE,iCAAiC;IACtC,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAE,wBAAwB,CAAC,MAAM;IACvC,MAAM,EAAE;QACN,WAAW,EAAE,QAAQ;QACrB,8FAA8F;QAC9F,6CAA6C;QAC7C,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB;QAChE,YAAY,EAAE,wBAAwB,CAAC,aAAa;QACpD,WAAW,EAAE,GAAG,EAAE,mDAAmD;QACrE,aAAa,EAAE,CAAC;gBACd,YAAY,EAAE,oBAAoB,CAAC,WAAW;gBAC9C,gBAAgB,EAAE,KAAK;aACxB,CAAC;QACF,SAAS,EAAE,0BAA0B,CAAC,GAAG;KAC1C;IACD,mBAAmB,EAAE;QACnB,YAAY,EAAE,wBAAwB,CAAC,aAAa;QACpD,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,mCAAmC;QAChD,YAAY,EAAE,oCAAoC;QAClD,sBAAsB,EAAE,uCAAuC;KAClB;IAC/C,UAAU,EAAE;QACV,IAAI,EAAE;;kGAEwF;QAC9F,OAAO,EAAE;;;qFAGwE;QACjF,SAAS,EAAE,4BAA4B,CAAC,UAAU;QAClD,YAAY,EAAE,EAAE;KACjB;IACD,SAAS,EAAE,0BAA0B;CACtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAwB;IAC9C,4BAA4B;CAC7B,CAAC","sourcesContent":["/**\n * Email Template Generation Agent Definition — COMPANION-OWNED.\n *\n * Defines the LLM agent the dev companion invokes to scaffold the\n * **file-based** email-template authoring artifacts:\n * - `template.tsx` — a typed `EmailTemplateDefinition<L>` exporting\n * `subject` + `body` functions consuming `EmailTemplateProps<L>`.\n * - `labels.<locale>.ts` — co-located per-locale label maps.\n *\n * This is a build-time generation agent with the SAME ownership tier as the\n * labelling / logo agents: defined and registered by the companion, NOT\n * shipped as an engine default. Its only live consumer is the companion's\n * `email-template.companion.service.ts` (`generateTemplateArtifactsWithAgent`),\n * which invokes it by `agentRef: 'email-template.generation.agent'` and writes\n * the returned `templateSource` + `labels` to disk before calling\n * `refreshEmailTemplateRegistry()`.\n *\n * The engine owns only the generic execution MACHINERY (AgentsBackendService,\n * the LLM transport) + the runtime `EmailTemplateRegistryBackendService` that\n * reads the scaffolded files from the filesystem. The build-time agent that\n * writes them lives here, where it is consumed.\n *\n * (Relocated from `@wildo-ai/saas-backend-lib` — an engine runtime library —\n * because it is companion-only build-time tooling, never used by an engine\n * runtime service.)\n */\n\nimport { FlowsActors_Agent, FlowsActors_Agent_Status, FlowsActors_Agent_Skill_Type } from '@wildo-ai/saas-models';\nimport { LLMProvider_GenerateTextInputSchema, LLMProvider_GenerateTextOutputSchema, LLMProvider_OperationContext_BaseSchema, LLMProvider_OperationDefinitionBase, LLMProvider_OperationKey, LLM_Model_Applicability } from '@wildo-ai/external-connectors-models';\nimport {\n ResourceOperationRiskLevel,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\n\n/**\n * Agent for scaffolding **file-based** email-template artifacts\n * (`template.tsx` + `labels.<locale>.ts`) via an LLM call.\n *\n * Uses `GENERATE_TEXT` because the output is raw code (TSX source + a JSON\n * labels map embedded in the response) rather than a structured object. The\n * companion service prompts the agent to return\n * `{ templateSource: string, labels: Record<string, string> }`, then parses,\n * validates, and writes those artifacts to disk before refreshing\n * `EmailTemplateRegistryBackendService`.\n */\nexport const emailTemplateGenerationAgent: FlowsActors_Agent = {\n ref: 'email-template.generation.agent',\n displayName: 'Email Template Generation Agent',\n status: FlowsActors_Agent_Status.ACTIVE,\n config: {\n providerRef: 'openai',\n // STRUCTURED_AUTHORING: copy generated against a template (#439). Resolves to `gpt-5.6-terra`\n // on `openai` today — the model this pinned.\n modelApplicability: LLM_Model_Applicability.STRUCTURED_AUTHORING,\n operationKey: LLMProvider_OperationKey.GENERATE_TEXT,\n temperature: 0.4, // Slightly higher for creative template generation\n accessControl: [{\n primaryScope: ResourcePrimaryScope.APPLICATION,\n requiresApproval: false,\n }],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n operationDefinition: {\n operationKey: LLMProvider_OperationKey.GENERATE_TEXT,\n providerRef: 'openai',\n inputSchema: LLMProvider_GenerateTextInputSchema,\n outputSchema: LLMProvider_GenerateTextOutputSchema,\n operationContextSchema: LLMProvider_OperationContext_BaseSchema,\n } satisfies LLMProvider_OperationDefinitionBase,\n promptSpec: {\n role: `You are an expert email template developer specializing in React Email components.\nYour task is to generate professional, accessible, and visually appealing email templates using TSX syntax.\nYou create templates that work across all major email clients (Gmail, Outlook, Apple Mail, etc.).`,\n persona: `You write clean, maintainable TSX code with proper TypeScript types.\nYou follow email best practices: inline styles, table-based layouts for compatibility, mobile-responsive design.\nYou use the provided predefined components and design tokens consistently.\nYou never use external APIs, fetch calls, or any code that could be a security risk.`,\n skillType: FlowsActors_Agent_Skill_Type.GENERATION,\n instructions: [],\n },\n createdAt: '2024-01-01T00:00:00.000Z',\n};\n\n/**\n * Aggregate list of companion email agents, spread into the companion\n * bootstrap's `flowsActorsRegistry.agents` in `src/index.ts`. Currently a\n * singleton; new email-related build-time agents belong here.\n */\nexport const emailAgents: FlowsActors_Agent[] = [\n emailTemplateGenerationAgent,\n];\n"]}
|
|
@@ -19,7 +19,7 @@ export interface EmailSpecContext {
|
|
|
19
19
|
*
|
|
20
20
|
* This is the email analogue of `LabellingSpecContextLoaderCompanionService`:
|
|
21
21
|
* it resolves the SAME `systemEmailTemplateSpecifications` companion-export the
|
|
22
|
-
* `wildo context
|
|
22
|
+
* `wildo context info` introspection lane resolves (keyed by `templateRef`), and reuses the
|
|
23
23
|
* SAME renderer the spec-context dispatcher uses
|
|
24
24
|
* (`renderSystemEmailTemplateSpecificationContextPart`). DD1 picks the
|
|
25
25
|
* `CUSTOM_IMPLEMENTATION_CONTEXT` concern — it bundles purpose + tone +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-spec-context-loader.companion.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"email-spec-context-loader.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/email/services/email-spec-context-loader.companion.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAIhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAK7E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,sCAAsC;IAMZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IACR,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IANrF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+D;IACxF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA8C;IAC3E,OAAO,CAAC,gBAAgB,CAAiD;gBAGnB,MAAM,EAAE,aAAa,EACN,gBAAgB,EAAE,gBAAgB;IAKvG;;;;OAIG;IACH;;;;OAIG;IACU,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAO9F;;;;;OAKG;IACU,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAO/F;;;;;;OAMG;YACW,YAAY;IAwC1B;;;;;OAKG;YACW,oBAAoB;CAmBnC"}
|
|
@@ -23,7 +23,7 @@ import { SpecificationContextTemplateId } from '../../core/specifications/specif
|
|
|
23
23
|
*
|
|
24
24
|
* This is the email analogue of `LabellingSpecContextLoaderCompanionService`:
|
|
25
25
|
* it resolves the SAME `systemEmailTemplateSpecifications` companion-export the
|
|
26
|
-
* `wildo context
|
|
26
|
+
* `wildo context info` introspection lane resolves (keyed by `templateRef`), and reuses the
|
|
27
27
|
* SAME renderer the spec-context dispatcher uses
|
|
28
28
|
* (`renderSystemEmailTemplateSpecificationContextPart`). DD1 picks the
|
|
29
29
|
* `CUSTOM_IMPLEMENTATION_CONTEXT` concern — it bundles purpose + tone +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-spec-context-loader.companion.service.js","sourceRoot":"","sources":["../../../../../src/email/services/email-spec-context-loader.companion.service.ts"],"names":[],"mappings":";;;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AM,kCAAkC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAChF,IAAI,CAAC,gBAAgB;gBAClB,OAAoF;qBAClF,iCAAiC,IAAI,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,6CAA6C,EAAE;gBAC3D,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM;aACjD,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,iGAAiG,EACjG,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CACpC,CAAC;YACF,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;CACF,CAAA;AAlHY,sCAAsC;IADlD,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;;GAPxC,sCAAsC,CAkHlD","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES , describeCaughtError} from '@wildo-ai/saas-backend-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport type { SystemEmailTemplateSpecification } from '@wildo-ai/saas-specifications';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { loadSpecificationsCompanionExports } from '../../core/context/companion-package-loaders.companion';\nimport { renderSystemEmailTemplateSpecificationContextPart } from '../../core/specifications/system-email-template-specification-context.factory';\nimport { SpecificationContextTemplateId } from '../../core/specifications/specification-context-factory.models';\n\n/**\n * Resolved authored-spec context for one email template, ready to inject into\n * the generation prompt.\n */\nexport interface EmailSpecContext {\n /**\n * Rendered `SystemEmailTemplateSpecification` markdown (purpose, tone,\n * per-slot text-slot meaning, event-data meaning, business constraints) —\n * the body of the prompt's `# Email purpose & contract` block.\n */\n description: string;\n}\n\n/**\n * Loads the authored `SystemEmailTemplateSpecification` for a system-email\n * `templateRef` and renders it into LLM-ready markdown for the email\n * generation prompt.\n *\n * This is the email analogue of `LabellingSpecContextLoaderCompanionService`:\n * it resolves the SAME `systemEmailTemplateSpecifications` companion-export the\n * `wildo context spec` lane resolves (keyed by `templateRef`), and reuses the\n * SAME renderer the spec-context dispatcher uses\n * (`renderSystemEmailTemplateSpecificationContextPart`). DD1 picks the\n * `CUSTOM_IMPLEMENTATION_CONTEXT` concern — it bundles purpose + tone +\n * text-slot meaning + event-data + business constraints, the shape needed to\n * author the TSX + labels (translation context is a separate concern used by\n * the translate path).\n *\n * Companion rule: ALWAYS warn when context cannot be located, NEVER throw —\n * generation degrades to the ref + app name + current source only. Results are\n * cached per `templateRef`; the exports map is loaded once.\n */\n@injectable()\nexport class EmailSpecContextLoaderCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n private readonly contextCache = new Map<string, EmailSpecContext | null>();\n private systemEmailSpecs: SystemEmailTemplateSpecification | null = null;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n ) {\n this.logDebug = this.logger.debugByType('EmailSpecContextLoader');\n }\n\n /**\n * Resolve + render the authored spec context for a system-email\n * `templateRef`. Returns `undefined` (after a soft warning) when no authored\n * spec exists for the ref or rendering fails — never throws.\n */\n /**\n * Generation context (DD1: the `CUSTOM_IMPLEMENTATION_CONTEXT` concern) —\n * purpose, tone, text-slot meaning, event-data, business constraints + impl\n * references. For the `generate` prompt that authors the TSX + labels.\n */\n public async loadGenerationContext(templateRef: string): Promise<EmailSpecContext | undefined> {\n return this.loadRendered(\n templateRef,\n SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_CUSTOM_IMPLEMENTATION_CONTEXT,\n );\n }\n\n /**\n * Translation context (the `TRANSLATION_CONTEXT` concern) — purpose, tone,\n * and per-slot meaning framed for terminology/tone fidelity. For the\n * `translate` prompt. Mirrors how the labelling translate path feeds the\n * translation context (vs the richer custom-impl context generation uses).\n */\n public async loadTranslationContext(templateRef: string): Promise<EmailSpecContext | undefined> {\n return this.loadRendered(\n templateRef,\n SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_TRANSLATION_CONTEXT,\n );\n }\n\n /**\n * Resolve + render the authored spec context for a system-email\n * `templateRef` under the requested concern. Returns `undefined` (after a\n * soft warning) when no authored spec exists for the ref or rendering fails —\n * never throws. Cached per `(templateRef, templateId)` since the two concerns\n * render different markdown.\n */\n private async loadRendered(\n templateRef: string,\n templateId:\n | SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_CUSTOM_IMPLEMENTATION_CONTEXT\n | SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_TRANSLATION_CONTEXT,\n ): Promise<EmailSpecContext | undefined> {\n const cacheKey = `${templateRef}::${templateId}`;\n if (this.contextCache.has(cacheKey)) {\n return this.contextCache.get(cacheKey) ?? undefined;\n }\n\n const specs = await this.loadSystemEmailSpecs();\n const specification = specs[templateRef];\n\n if (!specification) {\n this.logger.warn(\n `No system-email-template specification found for \"${templateRef}\". `\n + 'The email will be generated/translated without authored spec context '\n + '(purpose / tone / text-slot meaning / event-data / business constraints).',\n { templateRef },\n );\n this.contextCache.set(cacheKey, null);\n return undefined;\n }\n\n try {\n const part = renderSystemEmailTemplateSpecificationContextPart(templateRef, specification, templateId);\n const ctx: EmailSpecContext = { description: part.markdown };\n this.contextCache.set(cacheKey, ctx);\n return ctx;\n } catch (err: unknown) {\n this.logger.warn(\n `Failed to render system-email-template specification context for \"${templateRef}\"; proceeding without it.`,\n { templateRef, error: describeCaughtError(err) },\n );\n this.contextCache.set(cacheKey, null);\n return undefined;\n }\n }\n\n /**\n * Lazily load the merged `systemEmailTemplateSpecifications` map from the\n * specifications companion exports (engine overlays + any app overlays).\n * Loaded once and cached. Best-effort: a load failure degrades email\n * generation to generic context rather than breaking the run.\n */\n private async loadSystemEmailSpecs(): Promise<SystemEmailTemplateSpecification> {\n if (this.systemEmailSpecs) return this.systemEmailSpecs;\n try {\n const exports = await loadSpecificationsCompanionExports(this.companionContext);\n this.systemEmailSpecs =\n (exports as { systemEmailTemplateSpecifications?: SystemEmailTemplateSpecification })\n .systemEmailTemplateSpecifications ?? {};\n this.logDebug('Loaded system-email-template specifications', {\n count: Object.keys(this.systemEmailSpecs).length,\n });\n } catch (err: unknown) {\n this.logger.warn(\n 'Failed to load system-email-template specifications; email generation will use generic context.',\n { error: describeCaughtError(err) },\n );\n this.systemEmailSpecs = {};\n }\n return this.systemEmailSpecs;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"email-spec-context-loader.companion.service.js","sourceRoot":"","sources":["../../../../src/email/services/email-spec-context-loader.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAG,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AAIrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,iDAAiD,EAAE,MAAM,+EAA+E,CAAC;AAClJ,OAAO,EAAE,8BAA8B,EAAE,MAAM,gEAAgE,CAAC;AAehH;;;;;;;;;;;;;;;;;;GAkBG;AAEI,IAAM,sCAAsC,GAA5C,MAAM,sCAAsC;IAMK;IACe;IANpD,QAAQ,CAA+D;IACvE,YAAY,GAAG,IAAI,GAAG,EAAmC,CAAC;IACnE,gBAAgB,GAA4C,IAAI,CAAC;IAEzE,YACsD,MAAqB,EACN,gBAAkC;QADjD,WAAM,GAAN,MAAM,CAAe;QACN,qBA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kB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;;GAPxC,sCAAsC,CAkHlD","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES , describeCaughtError} from '@wildo-ai/saas-backend-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport type { SystemEmailTemplateSpecification } from '@wildo-ai/saas-specifications';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { loadSpecificationsCompanionExports } from '../../core/context/companion-package-loaders.companion';\nimport { renderSystemEmailTemplateSpecificationContextPart } from '../../core/specifications/system-email-template-specification-context.factory';\nimport { SpecificationContextTemplateId } from '../../core/specifications/specification-context-factory.models';\n\n/**\n * Resolved authored-spec context for one email template, ready to inject into\n * the generation prompt.\n */\nexport interface EmailSpecContext {\n /**\n * Rendered `SystemEmailTemplateSpecification` markdown (purpose, tone,\n * per-slot text-slot meaning, event-data meaning, business constraints) —\n * the body of the prompt's `# Email purpose & contract` block.\n */\n description: string;\n}\n\n/**\n * Loads the authored `SystemEmailTemplateSpecification` for a system-email\n * `templateRef` and renders it into LLM-ready markdown for the email\n * generation prompt.\n *\n * This is the email analogue of `LabellingSpecContextLoaderCompanionService`:\n * it resolves the SAME `systemEmailTemplateSpecifications` companion-export the\n * `wildo context info` introspection lane resolves (keyed by `templateRef`), and reuses the\n * SAME renderer the spec-context dispatcher uses\n * (`renderSystemEmailTemplateSpecificationContextPart`). DD1 picks the\n * `CUSTOM_IMPLEMENTATION_CONTEXT` concern — it bundles purpose + tone +\n * text-slot meaning + event-data + business constraints, the shape needed to\n * author the TSX + labels (translation context is a separate concern used by\n * the translate path).\n *\n * Companion rule: ALWAYS warn when context cannot be located, NEVER throw —\n * generation degrades to the ref + app name + current source only. Results are\n * cached per `templateRef`; the exports map is loaded once.\n */\n@injectable()\nexport class EmailSpecContextLoaderCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n private readonly contextCache = new Map<string, EmailSpecContext | null>();\n private systemEmailSpecs: SystemEmailTemplateSpecification | null = null;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n ) {\n this.logDebug = this.logger.debugByType('EmailSpecContextLoader');\n }\n\n /**\n * Resolve + render the authored spec context for a system-email\n * `templateRef`. Returns `undefined` (after a soft warning) when no authored\n * spec exists for the ref or rendering fails — never throws.\n */\n /**\n * Generation context (DD1: the `CUSTOM_IMPLEMENTATION_CONTEXT` concern) —\n * purpose, tone, text-slot meaning, event-data, business constraints + impl\n * references. For the `generate` prompt that authors the TSX + labels.\n */\n public async loadGenerationContext(templateRef: string): Promise<EmailSpecContext | undefined> {\n return this.loadRendered(\n templateRef,\n SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_CUSTOM_IMPLEMENTATION_CONTEXT,\n );\n }\n\n /**\n * Translation context (the `TRANSLATION_CONTEXT` concern) — purpose, tone,\n * and per-slot meaning framed for terminology/tone fidelity. For the\n * `translate` prompt. Mirrors how the labelling translate path feeds the\n * translation context (vs the richer custom-impl context generation uses).\n */\n public async loadTranslationContext(templateRef: string): Promise<EmailSpecContext | undefined> {\n return this.loadRendered(\n templateRef,\n SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_TRANSLATION_CONTEXT,\n );\n }\n\n /**\n * Resolve + render the authored spec context for a system-email\n * `templateRef` under the requested concern. Returns `undefined` (after a\n * soft warning) when no authored spec exists for the ref or rendering fails —\n * never throws. Cached per `(templateRef, templateId)` since the two concerns\n * render different markdown.\n */\n private async loadRendered(\n templateRef: string,\n templateId:\n | SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_CUSTOM_IMPLEMENTATION_CONTEXT\n | SpecificationContextTemplateId.SYSTEM_EMAIL_TEMPLATE_TRANSLATION_CONTEXT,\n ): Promise<EmailSpecContext | undefined> {\n const cacheKey = `${templateRef}::${templateId}`;\n if (this.contextCache.has(cacheKey)) {\n return this.contextCache.get(cacheKey) ?? undefined;\n }\n\n const specs = await this.loadSystemEmailSpecs();\n const specification = specs[templateRef];\n\n if (!specification) {\n this.logger.warn(\n `No system-email-template specification found for \"${templateRef}\". `\n + 'The email will be generated/translated without authored spec context '\n + '(purpose / tone / text-slot meaning / event-data / business constraints).',\n { templateRef },\n );\n this.contextCache.set(cacheKey, null);\n return undefined;\n }\n\n try {\n const part = renderSystemEmailTemplateSpecificationContextPart(templateRef, specification, templateId);\n const ctx: EmailSpecContext = { description: part.markdown };\n this.contextCache.set(cacheKey, ctx);\n return ctx;\n } catch (err: unknown) {\n this.logger.warn(\n `Failed to render system-email-template specification context for \"${templateRef}\"; proceeding without it.`,\n { templateRef, error: describeCaughtError(err) },\n );\n this.contextCache.set(cacheKey, null);\n return undefined;\n }\n }\n\n /**\n * Lazily load the merged `systemEmailTemplateSpecifications` map from the\n * specifications companion exports (engine overlays + any app overlays).\n * Loaded once and cached. Best-effort: a load failure degrades email\n * generation to generic context rather than breaking the run.\n */\n private async loadSystemEmailSpecs(): Promise<SystemEmailTemplateSpecification> {\n if (this.systemEmailSpecs) return this.systemEmailSpecs;\n try {\n const exports = await loadSpecificationsCompanionExports(this.companionContext);\n this.systemEmailSpecs =\n (exports as { systemEmailTemplateSpecifications?: SystemEmailTemplateSpecification })\n .systemEmailTemplateSpecifications ?? {};\n this.logDebug('Loaded system-email-template specifications', {\n count: Object.keys(this.systemEmailSpecs).length,\n });\n } catch (err: unknown) {\n this.logger.warn(\n 'Failed to load system-email-template specifications; email generation will use generic context.',\n { error: describeCaughtError(err) },\n );\n this.systemEmailSpecs = {};\n }\n return this.systemEmailSpecs;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template.companion.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"email-template.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/email/services/email-template.companion.service.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,mCAAmC,EACxC,aAAa,EACb,0BAA0B,EAE1B,KAAK,oBAAoB,EAE1B,MAAM,4BAA4B,CAAC;AAqBpC,OAAO,EAAE,iBAAiB,EAAqB,MAAM,qCAAqC,CAAC;AAa3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAK7E,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,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;AAEvF;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oCAAoC;IACpC,WAAW,CAAC,EAAE;QACZ,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACxC,WAAW,CAAC,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,SAAS,CAAC,EAA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from 'inversify';
|
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { buildEmailBrandTokensFromConfig, LoggerService, ErrorBuilderBackendService, SAAS_SERVICE_TYPES, describeCaughtError, } from '@wildo-ai/saas-backend-lib';
|
|
20
20
|
import { getCompanionConfiguredFallbackLanguage, getCompanionConfiguredPrimaryLanguage, } from '../../core/config/primary-language.companion.utils.js';
|
|
21
|
-
import { ErrorType, ErrorCustomMessageReference, EmailTemplateType, isWildoBackendError, } from '@wildo-ai/saas-models';
|
|
21
|
+
import { BrandAssetComposition, BrandAssetPurpose, ErrorType, ErrorCustomMessageReference, EmailTemplateType, isWildoBackendError, } from '@wildo-ai/saas-models';
|
|
22
22
|
import { AvailableLanguage, LANGUAGE_INFO_MAP } from '@wildo-ai/presets-components-models';
|
|
23
23
|
import { resolveEmailTemplateArtifactTargets, labelsFilePath, readUtf8File, writeUtf8File, fileExists, } from '../utils/email-template-fs-discovery.utils.js';
|
|
24
24
|
import { parseEmailLabelsTsSource, formatLabelsTsFile, } from '../utils/email-labels-file-source.utils.js';
|
|
@@ -237,6 +237,28 @@ let EmailTemplateCompanionService = class EmailTemplateCompanionService {
|
|
|
237
237
|
appName: 'Preview App',
|
|
238
238
|
applicationId: 'preview-app-id',
|
|
239
239
|
organizationName: 'Preview Organization',
|
|
240
|
+
/*
|
|
241
|
+
* THE LOGO IS SCOPE-RESOLVED, and this context omitted it — so no preview could ever
|
|
242
|
+
* show one (#567).
|
|
243
|
+
*
|
|
244
|
+
* `EmailBrandTokens` deliberately carries no logo field (see the note in
|
|
245
|
+
* `color-conversion.utils.ts`); every real sender resolves it here instead, through
|
|
246
|
+
* `resolveBrandLogoAbsoluteUrl` with the LOCKUP/EMAIL pair — the verification initiator,
|
|
247
|
+
* the password reset, the authentication controller and the notifications dispatcher all
|
|
248
|
+
* do exactly this. The preview was the fifth site of that resolution and was the one
|
|
249
|
+
* that did not perform it, so a template rendering `<img src={logoUrl}>` produced
|
|
250
|
+
* nothing HERE while producing a logo in every real send.
|
|
251
|
+
*
|
|
252
|
+
* That is why the SAME resolver is called rather than a preview-specific placeholder: a
|
|
253
|
+
* preview whose logo comes from somewhere else answers a question nobody asked. An
|
|
254
|
+
* application that configures no email lockup still resolves to `undefined`, and the
|
|
255
|
+
* template then renders whatever it renders without one — which is the truthful answer,
|
|
256
|
+
* and now a visible one.
|
|
257
|
+
*/
|
|
258
|
+
logoUrl: this.appConfigService.resolveBrandLogoAbsoluteUrl({
|
|
259
|
+
composition: BrandAssetComposition.LOCKUP,
|
|
260
|
+
purpose: BrandAssetPurpose.EMAIL,
|
|
261
|
+
}) ?? undefined,
|
|
240
262
|
},
|
|
241
263
|
},
|
|
242
264
|
userContext: request.mockContext?.userContext
|