@wildo-ai/dev-companion 1.1.3 → 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 +192 -13
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +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 +16 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +17 -0
- 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 +33 -5
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +150 -40
- 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 +8 -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 +4 -9
- 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 +0 -21
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +39 -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 +41 -2
- 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 +178 -41
- 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 +5 -0
- 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 +82 -3
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +128 -6
- 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 +82 -3
- 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 +210 -54
- 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 +27 -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 +38 -5
- 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 +49 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +95 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -0
- 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 +25 -6
- 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 +82 -25
- 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 +44 -3
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +346 -42
- 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 +260 -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 +7 -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 +179 -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
|
@@ -23,6 +23,7 @@ import { getCompanionConfiguredPrimaryLanguage } from '../../core/config/primary
|
|
|
23
23
|
import { WildoSaasLockCompanionService } from '../../core/lock/wildo-saas-lock.companion.service.js';
|
|
24
24
|
import { resolvePerUnitFilePath, readPerUnitLabels, writePerUnitLabels, } from '../utils/per-unit-file.utils.js';
|
|
25
25
|
import { rejectPrimaryLocaleTarget } from '../utils/translate-locale-contract.utils.js';
|
|
26
|
+
import { assembleTranslatedChunkResult, extractLabelPlaceholderTokens, } from '../utils/label-placeholder-drift.utils.js';
|
|
26
27
|
import { I18nUnitRunStatus } from '../models/labelling-unit.models.js';
|
|
27
28
|
import { completeStructuredChunkKeys } from '../utils/structured-chunk-completion.utils.js';
|
|
28
29
|
import { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service.js';
|
|
@@ -352,7 +353,7 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
352
353
|
* re-send eighty-seven strings it is not being asked to translate.
|
|
353
354
|
*/
|
|
354
355
|
buildTranslatePrompt(args) {
|
|
355
|
-
const { unit, chunk, sourceLocale, targetLocale, specContext, requestedKeys, omittedKeys } = args;
|
|
356
|
+
const { unit, chunk, sourceLocale, targetLocale, specContext, requestedKeys, omittedKeys, priorDrift } = args;
|
|
356
357
|
const sourceEntries = Object.fromEntries(requestedKeys.filter((key) => args.sourceEntries[key] !== undefined).map((key) => [key, args.sourceEntries[key]]));
|
|
357
358
|
const sourceLanguage = LANGUAGE_INFO_MAP[sourceLocale]?.name ?? sourceLocale;
|
|
358
359
|
const targetLanguage = LANGUAGE_INFO_MAP[targetLocale]?.name ?? targetLocale;
|
|
@@ -361,10 +362,14 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
361
362
|
// translated and works for EVERY bucket, not just keyParam-threaded
|
|
362
363
|
// components. Listing them explicitly + "these are variables, not words" is
|
|
363
364
|
// the strongest guard against the model translating `{limit}` → `{limite}`.
|
|
364
|
-
|
|
365
|
+
//
|
|
366
|
+
// The scan goes through the shared extractor so the set stated in the prompt
|
|
367
|
+
// and the set the answer is VALIDATED against are produced by one grammar —
|
|
368
|
+
// a prompt that promised different tokens from the ones the check enforces
|
|
369
|
+
// would fail every repair pass for a reason nobody could read.
|
|
365
370
|
const varsByKey = [];
|
|
366
371
|
for (const [key, value] of Object.entries(sourceEntries)) {
|
|
367
|
-
const tokens =
|
|
372
|
+
const tokens = extractLabelPlaceholderTokens(value);
|
|
368
373
|
if (tokens.length > 0)
|
|
369
374
|
varsByKey.push({ key, tokens });
|
|
370
375
|
}
|
|
@@ -396,6 +401,24 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
396
401
|
if (omittedKeys.length > 0) {
|
|
397
402
|
lines.push('', `# Correction — your previous response left out ${omittedKeys.length} key(s). They are the ONLY keys above. Return every one of them.`);
|
|
398
403
|
}
|
|
404
|
+
// Placeholder-drift correction — the model DID answer these keys and got the
|
|
405
|
+
// variable keys wrong. Distinct from the omission block above on purpose: a
|
|
406
|
+
// "you left this out" instruction against a key that was answered reads as
|
|
407
|
+
// contradicting the model's own transcript and is the weakest possible
|
|
408
|
+
// correction. Name the exact tokens instead.
|
|
409
|
+
const relevantDrift = (priorDrift ?? []).filter((drift) => requestedKeys.includes(drift.key));
|
|
410
|
+
if (relevantDrift.length > 0) {
|
|
411
|
+
lines.push('', '# Correction — your previous translation used the wrong variable keys. Fix EXACTLY these keys:');
|
|
412
|
+
for (const drift of relevantDrift) {
|
|
413
|
+
const expected = drift.expected.length ? drift.expected.map((token) => `{${token}}`).join(' ') : 'no variable keys at all';
|
|
414
|
+
const fixes = [`use ${expected}`];
|
|
415
|
+
if (drift.unexpected.length > 0)
|
|
416
|
+
fixes.push(`remove ${drift.unexpected.map((token) => `{${token}}`).join(' ')}`);
|
|
417
|
+
if (drift.missing.length > 0)
|
|
418
|
+
fixes.push(`add ${drift.missing.map((token) => `{${token}}`).join(' ')}`);
|
|
419
|
+
lines.push(` ${drift.key}: ${fixes.join('; ')}`);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
399
422
|
return lines.join('\n');
|
|
400
423
|
}
|
|
401
424
|
/**
|
|
@@ -444,27 +467,48 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
444
467
|
*/
|
|
445
468
|
async translateChunkKeys(args) {
|
|
446
469
|
const { unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step } = args;
|
|
470
|
+
/**
|
|
471
|
+
* One physical translate call. Factored out because it is now driven from
|
|
472
|
+
* TWO loops — the omission-repair loop and the placeholder-repair round —
|
|
473
|
+
* and a second hand-written copy of the prompt/trace wiring is exactly how
|
|
474
|
+
* the two would come to send different prompts for the same contract.
|
|
475
|
+
*/
|
|
476
|
+
const invokeTranslatePass = async (pass) => {
|
|
477
|
+
const prompt = this.buildTranslatePrompt({
|
|
478
|
+
unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries,
|
|
479
|
+
requestedKeys: pass.requestedKeys,
|
|
480
|
+
omittedKeys: pass.omittedByPreviousPass,
|
|
481
|
+
priorDrift: pass.priorDrift,
|
|
482
|
+
});
|
|
483
|
+
// Correlate this chunk×locale×pass so the engine AgentCallTraceSink writes
|
|
484
|
+
// the prompt + output (+usage/latency) into THIS unit's step. The caller
|
|
485
|
+
// keeps only its DOMAIN artifact — the translated labels + source strings.
|
|
486
|
+
const traceContext = traceSession && step
|
|
487
|
+
? {
|
|
488
|
+
sessionRef: traceSession.sessionId,
|
|
489
|
+
stepRef: step.stepId,
|
|
490
|
+
label: `translate.chunk-${chunk.chunkId}.${targetLocale}${pass.labelSuffix}`,
|
|
491
|
+
attributes: {
|
|
492
|
+
unitId: unit.id,
|
|
493
|
+
chunkId: chunk.chunkId,
|
|
494
|
+
targetLocale,
|
|
495
|
+
keyCount: pass.requestedKeys.length,
|
|
496
|
+
pass: pass.passIndex,
|
|
497
|
+
},
|
|
498
|
+
}
|
|
499
|
+
: undefined;
|
|
500
|
+
return await this.invokeTranslateChunkAgent({
|
|
501
|
+
unit, chunk, targetLocale, requestedKeys: pass.requestedKeys, prompt, traceContext,
|
|
502
|
+
});
|
|
503
|
+
};
|
|
447
504
|
const completion = await completeStructuredChunkKeys({
|
|
448
505
|
keys: chunk.keys,
|
|
449
|
-
invoke: async ({ requestedKeys, omittedByPreviousPass, pass }) => {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
// Correlate this chunk×locale×pass so the engine AgentCallTraceSink writes
|
|
456
|
-
// the prompt + output (+usage/latency) into THIS unit's step. The caller
|
|
457
|
-
// keeps only its DOMAIN artifact — the translated labels + source strings.
|
|
458
|
-
const traceContext = traceSession && step
|
|
459
|
-
? {
|
|
460
|
-
sessionRef: traceSession.sessionId,
|
|
461
|
-
stepRef: step.stepId,
|
|
462
|
-
label: `translate.chunk-${chunk.chunkId}.${targetLocale}${pass === 1 ? '' : `.repair-${pass - 1}`}`,
|
|
463
|
-
attributes: { unitId: unit.id, chunkId: chunk.chunkId, targetLocale, keyCount: requestedKeys.length, pass },
|
|
464
|
-
}
|
|
465
|
-
: undefined;
|
|
466
|
-
return await this.invokeTranslateChunkAgent({ unit, chunk, targetLocale, requestedKeys, prompt, traceContext });
|
|
467
|
-
},
|
|
506
|
+
invoke: async ({ requestedKeys, omittedByPreviousPass, pass }) => await invokeTranslatePass({
|
|
507
|
+
requestedKeys,
|
|
508
|
+
omittedByPreviousPass,
|
|
509
|
+
labelSuffix: pass === 1 ? '' : `.repair-${pass - 1}`,
|
|
510
|
+
passIndex: pass,
|
|
511
|
+
}),
|
|
468
512
|
});
|
|
469
513
|
if (completion.missingKeys.length > 0) {
|
|
470
514
|
// Repair budget spent. These keys fall back to the SOURCE-locale string, so
|
|
@@ -487,19 +531,61 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
487
531
|
keyCount: chunk.keys.length,
|
|
488
532
|
});
|
|
489
533
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
534
|
+
// Assemble, enforcing the placeholder contract the prompt states. Until this
|
|
535
|
+
// check existed, a key the model DID return with a mangled variable key —
|
|
536
|
+
// `{limite}` for `{limit}`, or the token dropped entirely — was written
|
|
537
|
+
// straight to the locale file with no signal of any kind. (The OMISSION case
|
|
538
|
+
// was already reported at error level below; drift on a returned key was the
|
|
539
|
+
// genuinely silent one.)
|
|
540
|
+
let assembly = assembleTranslatedChunkResult({ keys: chunk.keys, sourceEntries, translatedValues: completion.values });
|
|
541
|
+
// One bounded repair round over just the drifted keys, mirroring the
|
|
542
|
+
// labellize orchestrator's drift retry. Scoped to the offenders rather than
|
|
543
|
+
// re-translating the whole chunk: a three-key request naming the exact
|
|
544
|
+
// tokens to fix is both cheaper and more reliable than re-rolling ninety
|
|
545
|
+
// strings, and every clean translation in this chunk is already good.
|
|
546
|
+
if (assembly.rejectedDrifts.length > 0) {
|
|
547
|
+
const priorDrift = assembly.rejectedDrifts;
|
|
548
|
+
this.logDebug('Translation placeholder drift detected — re-requesting the offending keys', {
|
|
549
|
+
unitId: unit.id,
|
|
550
|
+
chunkId: chunk.chunkId,
|
|
551
|
+
targetLocale,
|
|
552
|
+
offenders: priorDrift.map((drift) => drift.key),
|
|
553
|
+
});
|
|
554
|
+
const repair = await completeStructuredChunkKeys({
|
|
555
|
+
keys: priorDrift.map((drift) => drift.key),
|
|
556
|
+
invoke: async ({ requestedKeys, omittedByPreviousPass, pass }) => await invokeTranslatePass({
|
|
557
|
+
requestedKeys,
|
|
558
|
+
omittedByPreviousPass,
|
|
559
|
+
priorDrift,
|
|
560
|
+
labelSuffix: `.placeholder-repair${pass === 1 ? '' : `.repair-${pass - 1}`}`,
|
|
561
|
+
passIndex: completion.passes + pass,
|
|
562
|
+
}),
|
|
563
|
+
});
|
|
564
|
+
// Re-assemble from the MERGED values: a key the repair round answered
|
|
565
|
+
// cleanly is adopted, a key it answered badly is rejected again, and a key
|
|
566
|
+
// it omitted keeps its original (still-drifted, still-rejected) value. All
|
|
567
|
+
// three land correctly because the assembler re-checks everything.
|
|
568
|
+
assembly = assembleTranslatedChunkResult({
|
|
569
|
+
keys: chunk.keys,
|
|
570
|
+
sourceEntries,
|
|
571
|
+
translatedValues: { ...completion.values, ...repair.values },
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
if (assembly.rejectedDrifts.length > 0) {
|
|
575
|
+
// Repair spent and the variable keys still do not match the source. These
|
|
576
|
+
// keys fall back to the SOURCE-locale string — untranslated, but with
|
|
577
|
+
// working placeholders — rather than shipping text that renders `{limite}`
|
|
578
|
+
// literally to a user and drops the value it was meant to carry. Name
|
|
579
|
+
// them, exactly as the missing-key path does: otherwise the only evidence
|
|
580
|
+
// is a reader noticing English in a French UI.
|
|
581
|
+
this.logger.error('Translated placeholders still drifted after the repair round — falling back to source text', {
|
|
582
|
+
unitId: unit.id,
|
|
583
|
+
chunkId: chunk.chunkId,
|
|
584
|
+
targetLocale,
|
|
585
|
+
drift: assembly.rejectedDrifts,
|
|
586
|
+
});
|
|
502
587
|
}
|
|
588
|
+
const result = assembly.values;
|
|
503
589
|
// Caller-owned domain artifact: the translated labels + the source strings
|
|
504
590
|
// for this chunk×locale (the engine sink owns the raw prompt/output/usage
|
|
505
591
|
// record). `translate-chunk` stays a domain event; usage now lives only in
|
|
@@ -512,6 +598,10 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
512
598
|
content: {
|
|
513
599
|
object: result,
|
|
514
600
|
sourceStrings: sourceEntries,
|
|
601
|
+
// The drift that SURVIVED the repair round, so a reviewer reading the
|
|
602
|
+
// artifact can tell a source-string fallback caused by a mangled
|
|
603
|
+
// placeholder from one caused by a key the model never returned.
|
|
604
|
+
drift: assembly.rejectedDrifts,
|
|
515
605
|
},
|
|
516
606
|
});
|
|
517
607
|
await this.traceability.traceEvent({
|
|
@@ -519,11 +609,12 @@ let TranslateOrchestratorCompanionService = class TranslateOrchestratorCompanion
|
|
|
519
609
|
step,
|
|
520
610
|
minimumLevel: CompanionTraceabilityLevel.DEBUG,
|
|
521
611
|
type: 'translate-chunk',
|
|
522
|
-
summary: `Chunk ${chunk.chunkId} → ${targetLocale}: ${chunk.keys.length} key(s)`,
|
|
612
|
+
summary: `Chunk ${chunk.chunkId} → ${targetLocale}: ${chunk.keys.length} key(s), ${assembly.rejectedDrifts.length} placeholder drift`,
|
|
523
613
|
payload: {
|
|
524
614
|
chunkId: chunk.chunkId,
|
|
525
615
|
targetLocale,
|
|
526
616
|
keyCount: chunk.keys.length,
|
|
617
|
+
driftKeys: assembly.rejectedDrifts.map((drift) => drift.key),
|
|
527
618
|
},
|
|
528
619
|
});
|
|
529
620
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate-orchestrator.companion.service.js","sourceRoot":"","sources":["../../../../../src/i18n-labelling/services/translate-orchestrator.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,kBAAkB,EAKlB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,2BAA2B,EAC3B,SAAS,GAGV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAqB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,qCAAqC,EAAE,MAAM,oDAAoD,CAAC;AAC3G,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAElG,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EA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A5mBY,qCAAqC;IADjD,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;IAC/C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAE3C,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,CAAA;IACvD,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;IACpD,WAAA,MAAM,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAA;qFAF+B,gCAAgC;QAC/B,6BAA6B;QAC7B,4BAA4B;GAZvG,qCAAqC,CA4mBjD","sourcesContent":["import * as fs from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { inject, injectable } from 'inversify';\nimport { z } from 'zod';\nimport {\n SAAS_SERVICE_TYPES,\n type AgentsBackendService,\n type AppConfigurationService,\n type LoggerService,\n type ErrorBuilderBackendService,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n LLMProvider_GenerateStructuredInputSchema,\n LLMProvider_GenerateStructuredOutputSchema,\n describeStructuredGenerationFailure,\n readStructuredGenerationFailure,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n type AgentTraceContext,\n type FlowsActors_Agent_Invocation,\n} from '@wildo-ai/saas-models';\nimport { AvailableLanguage, LANGUAGE_INFO_MAP } from '@wildo-ai/presets-components-models';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { LabellingPlannerCompanionService } from './labelling-planner.companion.service';\nimport { getCompanionConfiguredPrimaryLanguage } from '../../core/config/primary-language.companion.utils';\nimport { WildoSaasLockCompanionService } from '../../core/lock/wildo-saas-lock.companion.service';\nimport type { I18nLockUnitEntry } from '../../core/lock/wildo-saas-lock.models';\nimport {\n resolvePerUnitFilePath,\n readPerUnitLabels,\n writePerUnitLabels,\n} from '../utils/per-unit-file.utils';\nimport { rejectPrimaryLocaleTarget } from '../utils/translate-locale-contract.utils';\nimport { I18nUnitRunStatus, type LabellingUnit, type LabellingUnitChunk, type LabellingUnitSpecContext } from '../models/labelling-unit.models';\nimport { completeStructuredChunkKeys } from '../utils/structured-chunk-completion.utils';\nimport { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service';\nimport {\n CompanionTraceabilityLevel,\n type CompanionExecutionSessionContext,\n type CompanionTraceStepContext,\n} from '../../core/traceability/companion-traceability.models';\n\nexport interface TranslateOptions {\n targetLocales: AvailableLanguage[];\n forceRetranslate?: boolean;\n unitIdFilter?: string[];\n}\n\nexport interface TranslateUnitResult {\n unitId: string;\n targetLocale: AvailableLanguage;\n filePath: string;\n status: I18nUnitRunStatus;\n error?: string;\n}\n\nexport interface TranslateRunResult {\n primaryLocale: AvailableLanguage;\n totalRoundtrips: number;\n updated: number;\n fresh: number;\n failed: number;\n skipped: number;\n details: TranslateUnitResult[];\n}\n\n/**\n * Per-unit, per-locale translator.\n *\n * For each unit × target locale:\n * - Read primary file content and compute its SHA.\n * - If lock entry says (inputSha, primarySha) match the locale's\n * last successful state and the locale output file SHA still\n * matches => fresh, skip.\n * - Else: rebuild the same chunk schemas, ship the source labels +\n * the SAME spec context the labellize step used + the primary\n * values to the agent, write the per-unit translated file, and\n * update the lock with the new locale entry.\n *\n * \"Same context + primary value\" is the user-mandated invariant: the\n * translator must not see less context than the labellizer.\n */\n@injectable()\nexport class TranslateOrchestratorCompanionService {\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) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService) private readonly agentsService: AgentsBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService)\n private readonly appConfigService: AppConfigurationService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.LabellingPlannerService) private readonly planner: LabellingPlannerCompanionService,\n @inject(COMPANION_SERVICE_TYPES.WildoSaasLockService) private readonly lockService: WildoSaasLockCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService) private readonly traceability: CompanionTraceabilityService,\n ) {\n this.logDebug = this.logger.debugByType('TranslateOrchestrator');\n }\n\n public async translate(\n options: TranslateOptions,\n providedSession?: CompanionExecutionSessionContext,\n ): Promise<TranslateRunResult> {\n const primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n const targetLocales = [...new Set(options.targetLocales ?? [])];\n if (targetLocales.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'targetLocales is required and must be a non-empty array' },\n });\n }\n rejectPrimaryLocaleTarget(targetLocales, primaryLocale, this.errorBuilder);\n\n const i18nRoot = this.resolveI18nRoot();\n const allUnits = await this.planner.planAllUnits();\n const filter = options.unitIdFilter ? new Set(options.unitIdFilter) : null;\n const units = filter ? allUnits.filter((u) => filter.has(u.id)) : allUnits;\n\n // Trace under the CALLER's session when provided (controller's per-request\n // `POST /labelling/translate` session) so artifacts land in the session the\n // user inspects; fall back to a self-owned `internal` session for\n // direct/CLI/test callers. Gated no-op at the default NONE level (translated\n // output byte-identical). At DEBUG_VERBOSE it captures, per unit×locale, the\n // source strings + replayed spec context + the exact prompt + the LLM\n // response + token usage.\n const traceSession = providedSession ?? this.traceability.createInternalSession({\n label: 'translate-run',\n metadata: {\n run: 'translate',\n primaryLocale,\n targetLocales,\n forceRetranslate: options.forceRetranslate === true,\n unitIdFilter: options.unitIdFilter ?? null,\n totalUnits: units.length,\n },\n });\n\n const details: TranslateUnitResult[] = [];\n let updated = 0;\n let fresh = 0;\n let failed = 0;\n let skipped = 0;\n\n for (const unit of units) {\n const sourceFilePath = resolvePerUnitFilePath({ i18nRoot, unit, localeCode: primaryLocale });\n let sourceFlat: Record<string, string>;\n try {\n sourceFlat = await readPerUnitLabels(sourceFilePath);\n } catch (err: unknown) {\n const message = describeCaughtError(err);\n for (const targetLocale of targetLocales) {\n failed++;\n details.push({\n unitId: unit.id,\n targetLocale,\n filePath: '',\n status: I18nUnitRunStatus.FAILED,\n error: `Failed to read source: ${message}`,\n });\n }\n continue;\n }\n\n if (Object.keys(sourceFlat).length === 0) {\n for (const targetLocale of targetLocales) {\n skipped++;\n details.push({\n unitId: unit.id,\n targetLocale,\n filePath: resolvePerUnitFilePath({ i18nRoot, unit, localeCode: targetLocale }),\n status: I18nUnitRunStatus.SKIPPED,\n });\n }\n continue;\n }\n\n // Spec context is loaded ONCE per unit and reused across locales.\n const specContext = await unit.loadSpecContext();\n\n for (const targetLocale of targetLocales) {\n try {\n const result = await this.translateUnitForLocale({\n unit,\n sourceLocale: primaryLocale,\n targetLocale,\n sourceFlat,\n specContext,\n i18nRoot,\n forceRetranslate: options.forceRetranslate === true,\n traceSession,\n });\n details.push(result);\n if (result.status === I18nUnitRunStatus.FRESH) fresh++;\n else if (result.status === I18nUnitRunStatus.UPDATED) updated++;\n else if (result.status === I18nUnitRunStatus.SKIPPED) skipped++;\n else failed++;\n } catch (err: unknown) {\n failed++;\n const message = describeCaughtError(err);\n details.push({\n unitId: unit.id,\n targetLocale,\n filePath: '',\n status: I18nUnitRunStatus.FAILED,\n error: message,\n });\n }\n }\n }\n\n await this.traceability.traceEvent({\n session: traceSession,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-run-complete',\n summary: `Translated ${units.length} unit(s) → [${targetLocales.join(', ')}]: ${updated} updated, ${fresh} fresh, ${skipped} skipped, ${failed} failed`,\n payload: { primaryLocale, targetLocales, totalRoundtrips: details.length, updated, fresh, skipped, failed },\n });\n if (traceSession.traceabilityLevel !== CompanionTraceabilityLevel.NONE) {\n this.logger.info('Translate trace session written', {\n sessionId: traceSession.sessionId,\n sessionDir: traceSession.sessionDirPath,\n });\n }\n\n return {\n primaryLocale,\n totalRoundtrips: details.length,\n updated,\n fresh,\n failed,\n skipped,\n details,\n };\n }\n\n private async translateUnitForLocale(args: {\n unit: LabellingUnit;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n sourceFlat: Record<string, string>;\n specContext: LabellingUnitSpecContext | undefined;\n i18nRoot: string;\n forceRetranslate: boolean;\n traceSession: CompanionExecutionSessionContext;\n }): Promise<TranslateUnitResult> {\n const { unit, sourceLocale, targetLocale, sourceFlat, specContext, i18nRoot, forceRetranslate, traceSession } = args;\n\n const targetPath = resolvePerUnitFilePath({ i18nRoot, unit, localeCode: targetLocale });\n const sourcePath = resolvePerUnitFilePath({ i18nRoot, unit, localeCode: sourceLocale });\n\n // One trace step per unit×locale; the source strings + prompt + response\n // land under it (materialized only when a gated write actually fires).\n const step = this.traceability.createStep(traceSession, {\n kind: 'translate-unit',\n label: `${unit.id}->${targetLocale}`,\n });\n\n const section = await this.lockService.readI18nSection();\n const existing = section?.units[unit.id];\n const localeEntry = existing?.locales[targetLocale];\n\n if (\n !forceRetranslate\n && existing?.primarySha\n && localeEntry?.status === 'fresh'\n && localeEntry.outputSha\n ) {\n // Verify both the on-disk source AND target file hashes still\n // match what's recorded. A hand-edit / branch switch / `git\n // checkout` of either file out-of-band must NOT be silently\n // honored as \"fresh\".\n const onDiskSourceSha = await this.computeFileShaIfExists(sourcePath);\n const onDiskTargetSha = await this.computeFileShaIfExists(targetPath);\n const sourceMatches = onDiskSourceSha === existing.primarySha;\n const targetMatches = onDiskTargetSha === localeEntry.outputSha;\n if (sourceMatches && targetMatches) {\n this.logDebug('Locale fresh — skipping agent call', {\n unitId: unit.id,\n targetLocale,\n });\n await this.traceability.traceEvent({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-unit-fresh',\n summary: `Unit ${unit.id} → ${targetLocale} fresh — no LLM call`,\n payload: { unitId: unit.id, targetLocale },\n });\n return { unitId: unit.id, targetLocale, filePath: targetPath, status: I18nUnitRunStatus.FRESH };\n }\n this.logDebug('Locale lock says fresh but on-disk content drifted — re-translating', {\n unitId: unit.id,\n targetLocale,\n sourceMatches,\n targetMatches,\n });\n }\n\n // We refuse to translate a unit that was never labellized. The\n // primary file's hash space (formatted TS file content, set by\n // labellize) is NOT interchangeable with the source-flat JSON hash\n // we'd otherwise have to fabricate here, and lying about it\n // permanently invalidates the labellize cache for this unit.\n if (!existing?.inputSha || !existing?.primarySha) {\n await this.traceability.traceEvent({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-unit-skipped',\n summary: `Unit ${unit.id} → ${targetLocale} skipped — no labellize state`,\n payload: { unitId: unit.id, targetLocale },\n });\n return {\n unitId: unit.id,\n targetLocale,\n filePath: targetPath,\n status: I18nUnitRunStatus.SKIPPED,\n error: 'Unit has no recorded labellize state; run labellize first',\n };\n }\n\n const existingTargetFlat = await readPerUnitLabels(targetPath);\n const targetFlat: Record<string, string> = { ...existingTargetFlat };\n\n // The spec context replayed into the translation prompt (the same one the\n // labellize step used) — recorded so a reviewer can confirm the translator\n // saw no less context than the labellizer (the user-mandated invariant).\n await this.traceability.writeArtifact({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: 'spec-context.json',\n content: {\n unitId: unit.id,\n category: unit.category,\n targetLocale,\n hasSpecContext: specContext !== undefined,\n description: specContext?.description ?? null,\n hints: specContext?.hints ?? null,\n origin: specContext?.origin ?? null,\n },\n });\n\n for (const chunk of unit.chunks) {\n const chunkSourceEntries: Record<string, string> = {};\n for (const key of chunk.keys) {\n const v = sourceFlat[key];\n if (typeof v === 'string') chunkSourceEntries[key] = v;\n }\n if (Object.keys(chunkSourceEntries).length === 0) continue;\n\n const chunkResult = await this.translateChunk({\n unit,\n chunk,\n sourceLocale,\n targetLocale,\n specContext,\n sourceEntries: chunkSourceEntries,\n traceSession,\n step,\n });\n Object.assign(targetFlat, chunkResult);\n }\n\n const plannedSet = new Set(unit.chunks.flatMap((chunk) => chunk.keys));\n for (const key of Object.keys(targetFlat)) {\n if (!plannedSet.has(key)) delete targetFlat[key];\n }\n\n const localeDisplayName = LANGUAGE_INFO_MAP[targetLocale]?.name ?? targetLocale;\n const writtenContent = await writePerUnitLabels({\n filePath: targetPath,\n localeCode: targetLocale,\n localeDisplayName,\n isPrimaryLocale: false,\n flatEntries: targetFlat,\n });\n\n const outputSha = this.lockService.hashString(writtenContent);\n const updatedLocales = { ...(existing?.locales ?? {}) };\n updatedLocales[targetLocale] = {\n status: 'fresh',\n outputSha,\n lastTranslatedAt: new Date().toISOString(),\n };\n\n // `existing` is guaranteed non-null by the early-return guard above;\n // we never fabricate `inputSha` / `primarySha` here because they\n // belong to the labellize hash space, not translate's.\n const updatedEntry: I18nLockUnitEntry = {\n category: existing.category,\n displayLabel: existing.displayLabel,\n inputSha: existing.inputSha,\n primarySha: existing.primarySha,\n lastLabellizedAt: existing.lastLabellizedAt,\n locales: updatedLocales,\n };\n\n await this.lockService.upsertI18nUnit(\n unit.id,\n updatedEntry,\n undefined,\n Array.from(new Set([...(section?.trackedLocales ?? []), targetLocale])),\n );\n\n return { unitId: unit.id, targetLocale, filePath: targetPath, status: I18nUnitRunStatus.UPDATED };\n }\n\n private async translateChunk(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n specContext: LabellingUnitSpecContext | undefined;\n sourceEntries: Record<string, string>;\n traceSession: CompanionExecutionSessionContext;\n step: CompanionTraceStepContext;\n }): Promise<Record<string, string>> {\n const { unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step } = args;\n return await this.translateChunkKeys({\n unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step,\n });\n }\n\n /**\n * Build the translation prompt for `requestedKeys`.\n *\n * `requestedKeys` is the whole chunk on the first pass and only the outstanding\n * keys on a repair pass, so the source block, the variable-key contract and the\n * omission correction all narrow together — a three-key repair request must not\n * re-send eighty-seven strings it is not being asked to translate.\n */\n private buildTranslatePrompt(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n specContext: LabellingUnitSpecContext | undefined;\n sourceEntries: Record<string, string>;\n requestedKeys: readonly string[];\n omittedKeys: readonly string[];\n }): string {\n const { unit, chunk, sourceLocale, targetLocale, specContext, requestedKeys, omittedKeys } = args;\n const sourceEntries = Object.fromEntries(\n requestedKeys.filter((key) => args.sourceEntries[key] !== undefined).map((key) => [key, args.sourceEntries[key]!]),\n );\n\n const sourceLanguage = LANGUAGE_INFO_MAP[sourceLocale]?.name ?? sourceLocale;\n const targetLanguage = LANGUAGE_INFO_MAP[targetLocale]?.name ?? targetLocale;\n\n // Scan the SOURCE values for runtime variable keys (the `{token}`s). Done by\n // scanning — not chunk.keyParams — so it's accurate to exactly what is being\n // translated and works for EVERY bucket, not just keyParam-threaded\n // components. Listing them explicitly + \"these are variables, not words\" is\n // the strongest guard against the model translating `{limit}` → `{limite}`.\n const placeholderRegex = /\\{(\\w+)\\}/g;\n const varsByKey: Array<{ key: string; tokens: string[] }> = [];\n for (const [key, value] of Object.entries(sourceEntries)) {\n const tokens = [...new Set([...value.matchAll(placeholderRegex)].map((m) => m[1]!))];\n if (tokens.length > 0) varsByKey.push({ key, tokens });\n }\n\n const lines: string[] = [\n `Translate these UI labels from ${sourceLanguage} to ${targetLanguage} for a professional SaaS web app (${unit.category} \"${unit.displayLabel}\").`,\n ];\n\n // Same context the labellizer saw (terminology + tone), replayed for\n // consistency. No structured-hints dump — the description carries it.\n if (specContext?.description) {\n lines.push('', '# Context (for terminology & tone)', specContext.description.trim());\n }\n\n // Variable-key contract — the placeholders are NOT words to translate.\n if (varsByKey.length > 0) {\n lines.push(\n '',\n '# Variable keys — DO NOT translate',\n 'The single-brace tokens below are runtime VARIABLE KEYS: the app substitutes live values for them at render time. They are NOT words. Copy each one into your translation EXACTLY as written (identical spelling, identical { } braces) — never translate, localize, rename, reorder away, add, or drop one. Each translated value MUST contain exactly the same variable keys as its source — no more, no fewer.',\n 'Variable keys by source string:',\n );\n const keyMeta = chunk.keyMeta ?? {};\n for (const { key, tokens } of varsByKey) {\n const meanings = keyMeta[key]?.paramMeanings;\n const rendered = tokens.map((t) => {\n const m = meanings?.[t];\n return m ? `{${t}} (${m})` : `{${t}}`;\n }).join(' ');\n lines.push(` ${key} → ${rendered}`);\n }\n }\n\n lines.push(\n '',\n '# Rules',\n `- Use natural ${targetLanguage} UI conventions: do NOT copy English Title Case — apply the casing ${targetLanguage} uses for interface text (most languages, including French, use sentence case: capitalize only the first word and proper nouns).`,\n `- Apply ${targetLanguage} typography (e.g. French uses a narrow no-break space before : ; ! ? and « guillemets » for quotes).`,\n \"- Match the source's brevity: translate as the SHORTEST natural UI copy — never lengthen, never add words the source omits, never re-introduce filler. A 2-word source label becomes a 2-word target label, not a sentence.\",\n '- Never introduce internal/framework jargon the source avoids (e.g. resource/ressource, entity/entité, record/enregistrement): mirror the register + wording the source uses.',\n `- Preserve the SOURCE's register: if the source reads as operator/admin-console or developer/technical copy (not casual consumer wording), keep that same register in ${targetLanguage} — don't casualize it, and don't make end-user copy more technical.`,\n `- A label that names a relationship to another thing stays a relationship NAME in ${targetLanguage} (e.g. \"Assignee\" → \"Responsable\" / \"Assigné\", \"Owner\" → \"Propriétaire\") — never an identifier, never reintroduce \"ID\" / \"Id\" or a technical reference term.`,\n '- Keep terminology consistent across every key; aria phrases stay self-contained and natural to read aloud.',\n );\n\n lines.push(\n '',\n '# Source (translate the values)',\n JSON.stringify(sourceEntries, null, 2),\n '',\n 'Return a translated value for every key. Do not omit any field.',\n );\n\n // Omission correction — the model silently dropped these keys from its\n // previous response. They are the only keys in the source block above.\n if (omittedKeys.length > 0) {\n lines.push(\n '',\n `# Correction — your previous response left out ${omittedKeys.length} key(s). They are the ONLY keys above. Return every one of them.`,\n );\n }\n\n return lines.join('\\n');\n }\n\n /**\n * Run one physical translation call for `requestedKeys` and return the raw\n * parsed object. Filtering and fallback belong to the caller.\n */\n private async invokeTranslateChunkAgent(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n targetLocale: AvailableLanguage;\n requestedKeys: readonly string[];\n prompt: string;\n traceContext: AgentTraceContext | undefined;\n }): Promise<Record<string, unknown>> {\n const { unit, chunk, targetLocale, requestedKeys, prompt, traceContext } = args;\n const schema = chunk.buildOutputSchema(requestedKeys);\n const invocation: FlowsActors_Agent_Invocation<\n typeof LLMProvider_GenerateStructuredInputSchema,\n typeof LLMProvider_GenerateStructuredOutputSchema,\n z.ZodSchema<Record<string, string | undefined>>\n > = {\n agentRef: 'labelling.translation.agent',\n initiator: {},\n invocationContext: [],\n input: { prompt, schema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n\n const response = await this.agentsService.invokeAgent(invocation, traceContext);\n const parsed = (response.output as { object?: Record<string, unknown> })?.object;\n if (!parsed || typeof parsed !== 'object') {\n // The engine now says WHY there is no object; carry it into the message an operator\n // actually sees. Without this the reason existed only in the companion's own log\n // (the preceding `GENERATE_STRUCTURED` line), so the CLI summary — the surface a\n // human reads — reported a bare \"invalid output\" for a truncated completion, a\n // refusal, and a schema the model half-filled, alike. `validationIssues` names the\n // exact paths that failed and is the single most useful half.\n const failure = readStructuredGenerationFailure(response.executionContext);\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n message: `Invalid translation output for unit ${unit.id} chunk ${chunk.chunkId} -> ${targetLocale}`\n + (failure ? ` — ${describeStructuredGenerationFailure(failure)}` : ''),\n ...(failure ? { structuredGenerationFailure: failure } : {}),\n },\n });\n }\n return parsed;\n }\n\n /**\n * Translate one chunk into `targetLocale`, re-requesting any key the model\n * omits. A non-strict provider can silently drop leaves from a large flat\n * object, and the response schema now tolerates that (see\n * `LabellingUnitChunk.buildOutputSchema`) — so the gap is repaired here\n * instead of failing the whole unit.\n */\n private async translateChunkKeys(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n specContext: LabellingUnitSpecContext | undefined;\n sourceEntries: Record<string, string>;\n traceSession: CompanionExecutionSessionContext;\n step: CompanionTraceStepContext;\n }): Promise<Record<string, string>> {\n const { unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step } = args;\n\n const completion = await completeStructuredChunkKeys({\n keys: chunk.keys,\n invoke: async ({ requestedKeys, omittedByPreviousPass, pass }) => {\n const prompt = this.buildTranslatePrompt({\n unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries,\n requestedKeys,\n omittedKeys: omittedByPreviousPass,\n });\n // Correlate this chunk×locale×pass so the engine AgentCallTraceSink writes\n // the prompt + output (+usage/latency) into THIS unit's step. The caller\n // keeps only its DOMAIN artifact — the translated labels + source strings.\n const traceContext: AgentTraceContext | undefined = traceSession && step\n ? {\n sessionRef: traceSession.sessionId,\n stepRef: step.stepId,\n label: `translate.chunk-${chunk.chunkId}.${targetLocale}${pass === 1 ? '' : `.repair-${pass - 1}`}`,\n attributes: { unitId: unit.id, chunkId: chunk.chunkId, targetLocale, keyCount: requestedKeys.length, pass },\n }\n : undefined;\n return await this.invokeTranslateChunkAgent({ unit, chunk, targetLocale, requestedKeys, prompt, traceContext });\n },\n });\n\n if (completion.missingKeys.length > 0) {\n // Repair budget spent. These keys fall back to the SOURCE-locale string, so\n // the file stays complete but shows untranslated text — name them, or the\n // only evidence is a reader noticing English in a French UI.\n this.logger.error('Translation keys still missing after repair passes — falling back to source text', {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n passes: completion.passes,\n missingKeys: completion.missingKeys,\n });\n } else if (completion.passes > 1) {\n this.logger.warn('Structured translation response omitted keys — recovered by follow-up call(s)', {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n passes: completion.passes,\n keyCount: chunk.keys.length,\n });\n }\n\n const result: Record<string, string> = {};\n for (const key of chunk.keys) {\n const value = completion.values[key];\n if (typeof value === 'string' && value.length > 0) {\n result[key] = value;\n } else {\n // Fall back to source value (better than dropping the key).\n const fallback = sourceEntries[key];\n if (typeof fallback === 'string') result[key] = fallback;\n }\n }\n\n // Caller-owned domain artifact: the translated labels + the source strings\n // for this chunk×locale (the engine sink owns the raw prompt/output/usage\n // record). `translate-chunk` stays a domain event; usage now lives only in\n // the engine sink's agent-call-success event for this step.\n await this.traceability.writeArtifact({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: `chunk-${chunk.chunkId}.${targetLocale}.labels.json`,\n content: {\n object: result,\n sourceStrings: sourceEntries,\n },\n });\n await this.traceability.traceEvent({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-chunk',\n summary: `Chunk ${chunk.chunkId} → ${targetLocale}: ${chunk.keys.length} key(s)`,\n payload: {\n chunkId: chunk.chunkId,\n targetLocale,\n keyCount: chunk.keys.length,\n },\n });\n\n return result;\n }\n\n private async computeFileShaIfExists(filePath: string): Promise<string | undefined> {\n try {\n const content = await fs.readFile(filePath, 'utf-8');\n return this.lockService.hashString(content);\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException)?.code === 'ENOENT') return undefined;\n throw err;\n }\n }\n\n private resolveI18nRoot(): string {\n const backendService = Object.values(this.companionContext.backendServices)[0];\n if (!backendService) {\n throw this.errorBuilder.buildFromStandardError(\n new Error('No backend service configured for per-unit i18n output'),\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { operation: 'TranslateOrchestrator.resolveI18nRoot' },\n },\n );\n }\n return path.resolve(this.companionContext.saasRoot, backendService.path, 'src/engine/i18n');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"translate-orchestrator.companion.service.js","sourceRoot":"","sources":["../../../../src/i18n-labelling/services/translate-orchestrator.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,kBAAkB,EAKlB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,2BAA2B,EAC3B,SAAS,GAGV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAqB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,qCAAqC,EAAE,MAAM,oDAAoD,CAAC;AAC3G,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAElG,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAE9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAA8E,MAAM,iCAAiC,CAAC;AAChJ,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AAC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EO,eAAe;QACrB,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAC5C,IAAI,KAAK,CAAC,wDAAwD,CAAC,EACnE,SAAS,EACT;gBACE,sBAAsB,EAAE,2BAA2B,CAAC,QAAQ;gBAC5D,OAAO,EAAE,EAAE,SAAS,EAAE,uCAAuC,EAAE;aAChE,CACF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAC9F,CAAC;CACF,CAAA;AA1tBY,qCAAqC;IADjD,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;IAC/C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAE3C,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,CAAA;IACvD,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;IACpD,WAAA,MAAM,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAA;qFAF+B,gCAAgC;QAC/B,6BAA6B;QAC7B,4BAA4B;GAZvG,qCAAqC,CA0tBjD","sourcesContent":["import * as fs from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { inject, injectable } from 'inversify';\nimport { z } from 'zod';\nimport {\n SAAS_SERVICE_TYPES,\n type AgentsBackendService,\n type AppConfigurationService,\n type LoggerService,\n type ErrorBuilderBackendService,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n LLMProvider_GenerateStructuredInputSchema,\n LLMProvider_GenerateStructuredOutputSchema,\n describeStructuredGenerationFailure,\n readStructuredGenerationFailure,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n type AgentTraceContext,\n type FlowsActors_Agent_Invocation,\n} from '@wildo-ai/saas-models';\nimport { AvailableLanguage, LANGUAGE_INFO_MAP } from '@wildo-ai/presets-components-models';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { LabellingPlannerCompanionService } from './labelling-planner.companion.service';\nimport { getCompanionConfiguredPrimaryLanguage } from '../../core/config/primary-language.companion.utils';\nimport { WildoSaasLockCompanionService } from '../../core/lock/wildo-saas-lock.companion.service';\nimport type { I18nLockUnitEntry } from '../../core/lock/wildo-saas-lock.models';\nimport {\n resolvePerUnitFilePath,\n readPerUnitLabels,\n writePerUnitLabels,\n} from '../utils/per-unit-file.utils';\nimport { rejectPrimaryLocaleTarget } from '../utils/translate-locale-contract.utils';\nimport {\n assembleTranslatedChunkResult,\n extractLabelPlaceholderTokens,\n type PlaceholderDrift,\n} from '../utils/label-placeholder-drift.utils';\nimport { I18nUnitRunStatus, type LabellingUnit, type LabellingUnitChunk, type LabellingUnitSpecContext } from '../models/labelling-unit.models';\nimport { completeStructuredChunkKeys } from '../utils/structured-chunk-completion.utils';\nimport { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service';\nimport {\n CompanionTraceabilityLevel,\n type CompanionExecutionSessionContext,\n type CompanionTraceStepContext,\n} from '../../core/traceability/companion-traceability.models';\n\nexport interface TranslateOptions {\n targetLocales: AvailableLanguage[];\n forceRetranslate?: boolean;\n unitIdFilter?: string[];\n}\n\nexport interface TranslateUnitResult {\n unitId: string;\n targetLocale: AvailableLanguage;\n filePath: string;\n status: I18nUnitRunStatus;\n error?: string;\n}\n\nexport interface TranslateRunResult {\n primaryLocale: AvailableLanguage;\n totalRoundtrips: number;\n updated: number;\n fresh: number;\n failed: number;\n skipped: number;\n details: TranslateUnitResult[];\n}\n\n/**\n * Per-unit, per-locale translator.\n *\n * For each unit × target locale:\n * - Read primary file content and compute its SHA.\n * - If lock entry says (inputSha, primarySha) match the locale's\n * last successful state and the locale output file SHA still\n * matches => fresh, skip.\n * - Else: rebuild the same chunk schemas, ship the source labels +\n * the SAME spec context the labellize step used + the primary\n * values to the agent, write the per-unit translated file, and\n * update the lock with the new locale entry.\n *\n * \"Same context + primary value\" is the user-mandated invariant: the\n * translator must not see less context than the labellizer.\n */\n@injectable()\nexport class TranslateOrchestratorCompanionService {\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) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService) private readonly agentsService: AgentsBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService)\n private readonly appConfigService: AppConfigurationService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.LabellingPlannerService) private readonly planner: LabellingPlannerCompanionService,\n @inject(COMPANION_SERVICE_TYPES.WildoSaasLockService) private readonly lockService: WildoSaasLockCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService) private readonly traceability: CompanionTraceabilityService,\n ) {\n this.logDebug = this.logger.debugByType('TranslateOrchestrator');\n }\n\n public async translate(\n options: TranslateOptions,\n providedSession?: CompanionExecutionSessionContext,\n ): Promise<TranslateRunResult> {\n const primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n const targetLocales = [...new Set(options.targetLocales ?? [])];\n if (targetLocales.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'targetLocales is required and must be a non-empty array' },\n });\n }\n rejectPrimaryLocaleTarget(targetLocales, primaryLocale, this.errorBuilder);\n\n const i18nRoot = this.resolveI18nRoot();\n const allUnits = await this.planner.planAllUnits();\n const filter = options.unitIdFilter ? new Set(options.unitIdFilter) : null;\n const units = filter ? allUnits.filter((u) => filter.has(u.id)) : allUnits;\n\n // Trace under the CALLER's session when provided (controller's per-request\n // `POST /labelling/translate` session) so artifacts land in the session the\n // user inspects; fall back to a self-owned `internal` session for\n // direct/CLI/test callers. Gated no-op at the default NONE level (translated\n // output byte-identical). At DEBUG_VERBOSE it captures, per unit×locale, the\n // source strings + replayed spec context + the exact prompt + the LLM\n // response + token usage.\n const traceSession = providedSession ?? this.traceability.createInternalSession({\n label: 'translate-run',\n metadata: {\n run: 'translate',\n primaryLocale,\n targetLocales,\n forceRetranslate: options.forceRetranslate === true,\n unitIdFilter: options.unitIdFilter ?? null,\n totalUnits: units.length,\n },\n });\n\n const details: TranslateUnitResult[] = [];\n let updated = 0;\n let fresh = 0;\n let failed = 0;\n let skipped = 0;\n\n for (const unit of units) {\n const sourceFilePath = resolvePerUnitFilePath({ i18nRoot, unit, localeCode: primaryLocale });\n let sourceFlat: Record<string, string>;\n try {\n sourceFlat = await readPerUnitLabels(sourceFilePath);\n } catch (err: unknown) {\n const message = describeCaughtError(err);\n for (const targetLocale of targetLocales) {\n failed++;\n details.push({\n unitId: unit.id,\n targetLocale,\n filePath: '',\n status: I18nUnitRunStatus.FAILED,\n error: `Failed to read source: ${message}`,\n });\n }\n continue;\n }\n\n if (Object.keys(sourceFlat).length === 0) {\n for (const targetLocale of targetLocales) {\n skipped++;\n details.push({\n unitId: unit.id,\n targetLocale,\n filePath: resolvePerUnitFilePath({ i18nRoot, unit, localeCode: targetLocale }),\n status: I18nUnitRunStatus.SKIPPED,\n });\n }\n continue;\n }\n\n // Spec context is loaded ONCE per unit and reused across locales.\n const specContext = await unit.loadSpecContext();\n\n for (const targetLocale of targetLocales) {\n try {\n const result = await this.translateUnitForLocale({\n unit,\n sourceLocale: primaryLocale,\n targetLocale,\n sourceFlat,\n specContext,\n i18nRoot,\n forceRetranslate: options.forceRetranslate === true,\n traceSession,\n });\n details.push(result);\n if (result.status === I18nUnitRunStatus.FRESH) fresh++;\n else if (result.status === I18nUnitRunStatus.UPDATED) updated++;\n else if (result.status === I18nUnitRunStatus.SKIPPED) skipped++;\n else failed++;\n } catch (err: unknown) {\n failed++;\n const message = describeCaughtError(err);\n details.push({\n unitId: unit.id,\n targetLocale,\n filePath: '',\n status: I18nUnitRunStatus.FAILED,\n error: message,\n });\n }\n }\n }\n\n await this.traceability.traceEvent({\n session: traceSession,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-run-complete',\n summary: `Translated ${units.length} unit(s) → [${targetLocales.join(', ')}]: ${updated} updated, ${fresh} fresh, ${skipped} skipped, ${failed} failed`,\n payload: { primaryLocale, targetLocales, totalRoundtrips: details.length, updated, fresh, skipped, failed },\n });\n if (traceSession.traceabilityLevel !== CompanionTraceabilityLevel.NONE) {\n this.logger.info('Translate trace session written', {\n sessionId: traceSession.sessionId,\n sessionDir: traceSession.sessionDirPath,\n });\n }\n\n return {\n primaryLocale,\n totalRoundtrips: details.length,\n updated,\n fresh,\n failed,\n skipped,\n details,\n };\n }\n\n private async translateUnitForLocale(args: {\n unit: LabellingUnit;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n sourceFlat: Record<string, string>;\n specContext: LabellingUnitSpecContext | undefined;\n i18nRoot: string;\n forceRetranslate: boolean;\n traceSession: CompanionExecutionSessionContext;\n }): Promise<TranslateUnitResult> {\n const { unit, sourceLocale, targetLocale, sourceFlat, specContext, i18nRoot, forceRetranslate, traceSession } = args;\n\n const targetPath = resolvePerUnitFilePath({ i18nRoot, unit, localeCode: targetLocale });\n const sourcePath = resolvePerUnitFilePath({ i18nRoot, unit, localeCode: sourceLocale });\n\n // One trace step per unit×locale; the source strings + prompt + response\n // land under it (materialized only when a gated write actually fires).\n const step = this.traceability.createStep(traceSession, {\n kind: 'translate-unit',\n label: `${unit.id}->${targetLocale}`,\n });\n\n const section = await this.lockService.readI18nSection();\n const existing = section?.units[unit.id];\n const localeEntry = existing?.locales[targetLocale];\n\n if (\n !forceRetranslate\n && existing?.primarySha\n && localeEntry?.status === 'fresh'\n && localeEntry.outputSha\n ) {\n // Verify both the on-disk source AND target file hashes still\n // match what's recorded. A hand-edit / branch switch / `git\n // checkout` of either file out-of-band must NOT be silently\n // honored as \"fresh\".\n const onDiskSourceSha = await this.computeFileShaIfExists(sourcePath);\n const onDiskTargetSha = await this.computeFileShaIfExists(targetPath);\n const sourceMatches = onDiskSourceSha === existing.primarySha;\n const targetMatches = onDiskTargetSha === localeEntry.outputSha;\n if (sourceMatches && targetMatches) {\n this.logDebug('Locale fresh — skipping agent call', {\n unitId: unit.id,\n targetLocale,\n });\n await this.traceability.traceEvent({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-unit-fresh',\n summary: `Unit ${unit.id} → ${targetLocale} fresh — no LLM call`,\n payload: { unitId: unit.id, targetLocale },\n });\n return { unitId: unit.id, targetLocale, filePath: targetPath, status: I18nUnitRunStatus.FRESH };\n }\n this.logDebug('Locale lock says fresh but on-disk content drifted — re-translating', {\n unitId: unit.id,\n targetLocale,\n sourceMatches,\n targetMatches,\n });\n }\n\n // We refuse to translate a unit that was never labellized. The\n // primary file's hash space (formatted TS file content, set by\n // labellize) is NOT interchangeable with the source-flat JSON hash\n // we'd otherwise have to fabricate here, and lying about it\n // permanently invalidates the labellize cache for this unit.\n if (!existing?.inputSha || !existing?.primarySha) {\n await this.traceability.traceEvent({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-unit-skipped',\n summary: `Unit ${unit.id} → ${targetLocale} skipped — no labellize state`,\n payload: { unitId: unit.id, targetLocale },\n });\n return {\n unitId: unit.id,\n targetLocale,\n filePath: targetPath,\n status: I18nUnitRunStatus.SKIPPED,\n error: 'Unit has no recorded labellize state; run labellize first',\n };\n }\n\n const existingTargetFlat = await readPerUnitLabels(targetPath);\n const targetFlat: Record<string, string> = { ...existingTargetFlat };\n\n // The spec context replayed into the translation prompt (the same one the\n // labellize step used) — recorded so a reviewer can confirm the translator\n // saw no less context than the labellizer (the user-mandated invariant).\n await this.traceability.writeArtifact({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: 'spec-context.json',\n content: {\n unitId: unit.id,\n category: unit.category,\n targetLocale,\n hasSpecContext: specContext !== undefined,\n description: specContext?.description ?? null,\n hints: specContext?.hints ?? null,\n origin: specContext?.origin ?? null,\n },\n });\n\n for (const chunk of unit.chunks) {\n const chunkSourceEntries: Record<string, string> = {};\n for (const key of chunk.keys) {\n const v = sourceFlat[key];\n if (typeof v === 'string') chunkSourceEntries[key] = v;\n }\n if (Object.keys(chunkSourceEntries).length === 0) continue;\n\n const chunkResult = await this.translateChunk({\n unit,\n chunk,\n sourceLocale,\n targetLocale,\n specContext,\n sourceEntries: chunkSourceEntries,\n traceSession,\n step,\n });\n Object.assign(targetFlat, chunkResult);\n }\n\n const plannedSet = new Set(unit.chunks.flatMap((chunk) => chunk.keys));\n for (const key of Object.keys(targetFlat)) {\n if (!plannedSet.has(key)) delete targetFlat[key];\n }\n\n const localeDisplayName = LANGUAGE_INFO_MAP[targetLocale]?.name ?? targetLocale;\n const writtenContent = await writePerUnitLabels({\n filePath: targetPath,\n localeCode: targetLocale,\n localeDisplayName,\n isPrimaryLocale: false,\n flatEntries: targetFlat,\n });\n\n const outputSha = this.lockService.hashString(writtenContent);\n const updatedLocales = { ...(existing?.locales ?? {}) };\n updatedLocales[targetLocale] = {\n status: 'fresh',\n outputSha,\n lastTranslatedAt: new Date().toISOString(),\n };\n\n // `existing` is guaranteed non-null by the early-return guard above;\n // we never fabricate `inputSha` / `primarySha` here because they\n // belong to the labellize hash space, not translate's.\n const updatedEntry: I18nLockUnitEntry = {\n category: existing.category,\n displayLabel: existing.displayLabel,\n inputSha: existing.inputSha,\n primarySha: existing.primarySha,\n lastLabellizedAt: existing.lastLabellizedAt,\n locales: updatedLocales,\n };\n\n await this.lockService.upsertI18nUnit(\n unit.id,\n updatedEntry,\n undefined,\n Array.from(new Set([...(section?.trackedLocales ?? []), targetLocale])),\n );\n\n return { unitId: unit.id, targetLocale, filePath: targetPath, status: I18nUnitRunStatus.UPDATED };\n }\n\n private async translateChunk(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n specContext: LabellingUnitSpecContext | undefined;\n sourceEntries: Record<string, string>;\n traceSession: CompanionExecutionSessionContext;\n step: CompanionTraceStepContext;\n }): Promise<Record<string, string>> {\n const { unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step } = args;\n return await this.translateChunkKeys({\n unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step,\n });\n }\n\n /**\n * Build the translation prompt for `requestedKeys`.\n *\n * `requestedKeys` is the whole chunk on the first pass and only the outstanding\n * keys on a repair pass, so the source block, the variable-key contract and the\n * omission correction all narrow together — a three-key repair request must not\n * re-send eighty-seven strings it is not being asked to translate.\n */\n private buildTranslatePrompt(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n specContext: LabellingUnitSpecContext | undefined;\n sourceEntries: Record<string, string>;\n requestedKeys: readonly string[];\n omittedKeys: readonly string[];\n /**\n * Placeholder drift measured on the previous response, rendered as an\n * explicit per-key correction. Mirrors the labellize prompt's retry block:\n * naming the exact tokens to add/remove is what makes the repair pass\n * reliable, rather than restating the general contract and hoping.\n */\n priorDrift?: readonly PlaceholderDrift[];\n }): string {\n const { unit, chunk, sourceLocale, targetLocale, specContext, requestedKeys, omittedKeys, priorDrift } = args;\n const sourceEntries = Object.fromEntries(\n requestedKeys.filter((key) => args.sourceEntries[key] !== undefined).map((key) => [key, args.sourceEntries[key]!]),\n );\n\n const sourceLanguage = LANGUAGE_INFO_MAP[sourceLocale]?.name ?? sourceLocale;\n const targetLanguage = LANGUAGE_INFO_MAP[targetLocale]?.name ?? targetLocale;\n\n // Scan the SOURCE values for runtime variable keys (the `{token}`s). Done by\n // scanning — not chunk.keyParams — so it's accurate to exactly what is being\n // translated and works for EVERY bucket, not just keyParam-threaded\n // components. Listing them explicitly + \"these are variables, not words\" is\n // the strongest guard against the model translating `{limit}` → `{limite}`.\n //\n // The scan goes through the shared extractor so the set stated in the prompt\n // and the set the answer is VALIDATED against are produced by one grammar —\n // a prompt that promised different tokens from the ones the check enforces\n // would fail every repair pass for a reason nobody could read.\n const varsByKey: Array<{ key: string; tokens: string[] }> = [];\n for (const [key, value] of Object.entries(sourceEntries)) {\n const tokens = extractLabelPlaceholderTokens(value);\n if (tokens.length > 0) varsByKey.push({ key, tokens });\n }\n\n const lines: string[] = [\n `Translate these UI labels from ${sourceLanguage} to ${targetLanguage} for a professional SaaS web app (${unit.category} \"${unit.displayLabel}\").`,\n ];\n\n // Same context the labellizer saw (terminology + tone), replayed for\n // consistency. No structured-hints dump — the description carries it.\n if (specContext?.description) {\n lines.push('', '# Context (for terminology & tone)', specContext.description.trim());\n }\n\n // Variable-key contract — the placeholders are NOT words to translate.\n if (varsByKey.length > 0) {\n lines.push(\n '',\n '# Variable keys — DO NOT translate',\n 'The single-brace tokens below are runtime VARIABLE KEYS: the app substitutes live values for them at render time. They are NOT words. Copy each one into your translation EXACTLY as written (identical spelling, identical { } braces) — never translate, localize, rename, reorder away, add, or drop one. Each translated value MUST contain exactly the same variable keys as its source — no more, no fewer.',\n 'Variable keys by source string:',\n );\n const keyMeta = chunk.keyMeta ?? {};\n for (const { key, tokens } of varsByKey) {\n const meanings = keyMeta[key]?.paramMeanings;\n const rendered = tokens.map((t) => {\n const m = meanings?.[t];\n return m ? `{${t}} (${m})` : `{${t}}`;\n }).join(' ');\n lines.push(` ${key} → ${rendered}`);\n }\n }\n\n lines.push(\n '',\n '# Rules',\n `- Use natural ${targetLanguage} UI conventions: do NOT copy English Title Case — apply the casing ${targetLanguage} uses for interface text (most languages, including French, use sentence case: capitalize only the first word and proper nouns).`,\n `- Apply ${targetLanguage} typography (e.g. French uses a narrow no-break space before : ; ! ? and « guillemets » for quotes).`,\n \"- Match the source's brevity: translate as the SHORTEST natural UI copy — never lengthen, never add words the source omits, never re-introduce filler. A 2-word source label becomes a 2-word target label, not a sentence.\",\n '- Never introduce internal/framework jargon the source avoids (e.g. resource/ressource, entity/entité, record/enregistrement): mirror the register + wording the source uses.',\n `- Preserve the SOURCE's register: if the source reads as operator/admin-console or developer/technical copy (not casual consumer wording), keep that same register in ${targetLanguage} — don't casualize it, and don't make end-user copy more technical.`,\n `- A label that names a relationship to another thing stays a relationship NAME in ${targetLanguage} (e.g. \"Assignee\" → \"Responsable\" / \"Assigné\", \"Owner\" → \"Propriétaire\") — never an identifier, never reintroduce \"ID\" / \"Id\" or a technical reference term.`,\n '- Keep terminology consistent across every key; aria phrases stay self-contained and natural to read aloud.',\n );\n\n lines.push(\n '',\n '# Source (translate the values)',\n JSON.stringify(sourceEntries, null, 2),\n '',\n 'Return a translated value for every key. Do not omit any field.',\n );\n\n // Omission correction — the model silently dropped these keys from its\n // previous response. They are the only keys in the source block above.\n if (omittedKeys.length > 0) {\n lines.push(\n '',\n `# Correction — your previous response left out ${omittedKeys.length} key(s). They are the ONLY keys above. Return every one of them.`,\n );\n }\n\n // Placeholder-drift correction — the model DID answer these keys and got the\n // variable keys wrong. Distinct from the omission block above on purpose: a\n // \"you left this out\" instruction against a key that was answered reads as\n // contradicting the model's own transcript and is the weakest possible\n // correction. Name the exact tokens instead.\n const relevantDrift = (priorDrift ?? []).filter((drift) => requestedKeys.includes(drift.key));\n if (relevantDrift.length > 0) {\n lines.push('', '# Correction — your previous translation used the wrong variable keys. Fix EXACTLY these keys:');\n for (const drift of relevantDrift) {\n const expected = drift.expected.length ? drift.expected.map((token) => `{${token}}`).join(' ') : 'no variable keys at all';\n const fixes = [`use ${expected}`];\n if (drift.unexpected.length > 0) fixes.push(`remove ${drift.unexpected.map((token) => `{${token}}`).join(' ')}`);\n if (drift.missing.length > 0) fixes.push(`add ${drift.missing.map((token) => `{${token}}`).join(' ')}`);\n lines.push(` ${drift.key}: ${fixes.join('; ')}`);\n }\n }\n\n return lines.join('\\n');\n }\n\n /**\n * Run one physical translation call for `requestedKeys` and return the raw\n * parsed object. Filtering and fallback belong to the caller.\n */\n private async invokeTranslateChunkAgent(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n targetLocale: AvailableLanguage;\n requestedKeys: readonly string[];\n prompt: string;\n traceContext: AgentTraceContext | undefined;\n }): Promise<Record<string, unknown>> {\n const { unit, chunk, targetLocale, requestedKeys, prompt, traceContext } = args;\n const schema = chunk.buildOutputSchema(requestedKeys);\n const invocation: FlowsActors_Agent_Invocation<\n typeof LLMProvider_GenerateStructuredInputSchema,\n typeof LLMProvider_GenerateStructuredOutputSchema,\n z.ZodSchema<Record<string, string | undefined>>\n > = {\n agentRef: 'labelling.translation.agent',\n initiator: {},\n invocationContext: [],\n input: { prompt, schema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n\n const response = await this.agentsService.invokeAgent(invocation, traceContext);\n const parsed = (response.output as { object?: Record<string, unknown> })?.object;\n if (!parsed || typeof parsed !== 'object') {\n // The engine now says WHY there is no object; carry it into the message an operator\n // actually sees. Without this the reason existed only in the companion's own log\n // (the preceding `GENERATE_STRUCTURED` line), so the CLI summary — the surface a\n // human reads — reported a bare \"invalid output\" for a truncated completion, a\n // refusal, and a schema the model half-filled, alike. `validationIssues` names the\n // exact paths that failed and is the single most useful half.\n const failure = readStructuredGenerationFailure(response.executionContext);\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n message: `Invalid translation output for unit ${unit.id} chunk ${chunk.chunkId} -> ${targetLocale}`\n + (failure ? ` — ${describeStructuredGenerationFailure(failure)}` : ''),\n ...(failure ? { structuredGenerationFailure: failure } : {}),\n },\n });\n }\n return parsed;\n }\n\n /**\n * Translate one chunk into `targetLocale`, re-requesting any key the model\n * omits. A non-strict provider can silently drop leaves from a large flat\n * object, and the response schema now tolerates that (see\n * `LabellingUnitChunk.buildOutputSchema`) — so the gap is repaired here\n * instead of failing the whole unit.\n */\n private async translateChunkKeys(args: {\n unit: LabellingUnit;\n chunk: LabellingUnitChunk;\n sourceLocale: AvailableLanguage;\n targetLocale: AvailableLanguage;\n specContext: LabellingUnitSpecContext | undefined;\n sourceEntries: Record<string, string>;\n traceSession: CompanionExecutionSessionContext;\n step: CompanionTraceStepContext;\n }): Promise<Record<string, string>> {\n const { unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries, traceSession, step } = args;\n\n /**\n * One physical translate call. Factored out because it is now driven from\n * TWO loops — the omission-repair loop and the placeholder-repair round —\n * and a second hand-written copy of the prompt/trace wiring is exactly how\n * the two would come to send different prompts for the same contract.\n */\n const invokeTranslatePass = async (pass: {\n requestedKeys: readonly string[];\n omittedByPreviousPass: readonly string[];\n priorDrift?: readonly PlaceholderDrift[];\n /** Trace label suffix identifying which loop and which pass this call is. */\n labelSuffix: string;\n /** Flat pass counter carried into the trace attributes. */\n passIndex: number;\n }): Promise<Record<string, unknown>> => {\n const prompt = this.buildTranslatePrompt({\n unit, chunk, sourceLocale, targetLocale, specContext, sourceEntries,\n requestedKeys: pass.requestedKeys,\n omittedKeys: pass.omittedByPreviousPass,\n priorDrift: pass.priorDrift,\n });\n // Correlate this chunk×locale×pass so the engine AgentCallTraceSink writes\n // the prompt + output (+usage/latency) into THIS unit's step. The caller\n // keeps only its DOMAIN artifact — the translated labels + source strings.\n const traceContext: AgentTraceContext | undefined = traceSession && step\n ? {\n sessionRef: traceSession.sessionId,\n stepRef: step.stepId,\n label: `translate.chunk-${chunk.chunkId}.${targetLocale}${pass.labelSuffix}`,\n attributes: {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n keyCount: pass.requestedKeys.length,\n pass: pass.passIndex,\n },\n }\n : undefined;\n return await this.invokeTranslateChunkAgent({\n unit, chunk, targetLocale, requestedKeys: pass.requestedKeys, prompt, traceContext,\n });\n };\n\n const completion = await completeStructuredChunkKeys({\n keys: chunk.keys,\n invoke: async ({ requestedKeys, omittedByPreviousPass, pass }) => await invokeTranslatePass({\n requestedKeys,\n omittedByPreviousPass,\n labelSuffix: pass === 1 ? '' : `.repair-${pass - 1}`,\n passIndex: pass,\n }),\n });\n\n if (completion.missingKeys.length > 0) {\n // Repair budget spent. These keys fall back to the SOURCE-locale string, so\n // the file stays complete but shows untranslated text — name them, or the\n // only evidence is a reader noticing English in a French UI.\n this.logger.error('Translation keys still missing after repair passes — falling back to source text', {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n passes: completion.passes,\n missingKeys: completion.missingKeys,\n });\n } else if (completion.passes > 1) {\n this.logger.warn('Structured translation response omitted keys — recovered by follow-up call(s)', {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n passes: completion.passes,\n keyCount: chunk.keys.length,\n });\n }\n\n // Assemble, enforcing the placeholder contract the prompt states. Until this\n // check existed, a key the model DID return with a mangled variable key —\n // `{limite}` for `{limit}`, or the token dropped entirely — was written\n // straight to the locale file with no signal of any kind. (The OMISSION case\n // was already reported at error level below; drift on a returned key was the\n // genuinely silent one.)\n let assembly = assembleTranslatedChunkResult({ keys: chunk.keys, sourceEntries, translatedValues: completion.values });\n\n // One bounded repair round over just the drifted keys, mirroring the\n // labellize orchestrator's drift retry. Scoped to the offenders rather than\n // re-translating the whole chunk: a three-key request naming the exact\n // tokens to fix is both cheaper and more reliable than re-rolling ninety\n // strings, and every clean translation in this chunk is already good.\n if (assembly.rejectedDrifts.length > 0) {\n const priorDrift = assembly.rejectedDrifts;\n this.logDebug('Translation placeholder drift detected — re-requesting the offending keys', {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n offenders: priorDrift.map((drift) => drift.key),\n });\n const repair = await completeStructuredChunkKeys({\n keys: priorDrift.map((drift) => drift.key),\n invoke: async ({ requestedKeys, omittedByPreviousPass, pass }) => await invokeTranslatePass({\n requestedKeys,\n omittedByPreviousPass,\n priorDrift,\n labelSuffix: `.placeholder-repair${pass === 1 ? '' : `.repair-${pass - 1}`}`,\n passIndex: completion.passes + pass,\n }),\n });\n // Re-assemble from the MERGED values: a key the repair round answered\n // cleanly is adopted, a key it answered badly is rejected again, and a key\n // it omitted keeps its original (still-drifted, still-rejected) value. All\n // three land correctly because the assembler re-checks everything.\n assembly = assembleTranslatedChunkResult({\n keys: chunk.keys,\n sourceEntries,\n translatedValues: { ...completion.values, ...repair.values },\n });\n }\n\n if (assembly.rejectedDrifts.length > 0) {\n // Repair spent and the variable keys still do not match the source. These\n // keys fall back to the SOURCE-locale string — untranslated, but with\n // working placeholders — rather than shipping text that renders `{limite}`\n // literally to a user and drops the value it was meant to carry. Name\n // them, exactly as the missing-key path does: otherwise the only evidence\n // is a reader noticing English in a French UI.\n this.logger.error('Translated placeholders still drifted after the repair round — falling back to source text', {\n unitId: unit.id,\n chunkId: chunk.chunkId,\n targetLocale,\n drift: assembly.rejectedDrifts,\n });\n }\n\n const result = assembly.values;\n\n // Caller-owned domain artifact: the translated labels + the source strings\n // for this chunk×locale (the engine sink owns the raw prompt/output/usage\n // record). `translate-chunk` stays a domain event; usage now lives only in\n // the engine sink's agent-call-success event for this step.\n await this.traceability.writeArtifact({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: `chunk-${chunk.chunkId}.${targetLocale}.labels.json`,\n content: {\n object: result,\n sourceStrings: sourceEntries,\n // The drift that SURVIVED the repair round, so a reviewer reading the\n // artifact can tell a source-string fallback caused by a mangled\n // placeholder from one caused by a key the model never returned.\n drift: assembly.rejectedDrifts,\n },\n });\n await this.traceability.traceEvent({\n session: traceSession,\n step,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'translate-chunk',\n summary: `Chunk ${chunk.chunkId} → ${targetLocale}: ${chunk.keys.length} key(s), ${assembly.rejectedDrifts.length} placeholder drift`,\n payload: {\n chunkId: chunk.chunkId,\n targetLocale,\n keyCount: chunk.keys.length,\n driftKeys: assembly.rejectedDrifts.map((drift) => drift.key),\n },\n });\n\n return result;\n }\n\n private async computeFileShaIfExists(filePath: string): Promise<string | undefined> {\n try {\n const content = await fs.readFile(filePath, 'utf-8');\n return this.lockService.hashString(content);\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException)?.code === 'ENOENT') return undefined;\n throw err;\n }\n }\n\n private resolveI18nRoot(): string {\n const backendService = Object.values(this.companionContext.backendServices)[0];\n if (!backendService) {\n throw this.errorBuilder.buildFromStandardError(\n new Error('No backend service configured for per-unit i18n output'),\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { operation: 'TranslateOrchestrator.resolveI18nRoot' },\n },\n );\n }\n return path.resolve(this.companionContext.saasRoot, backendService.path, 'src/engine/i18n');\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-derived-label-keys.utils.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-derived-label-keys.utils.d.ts","sourceRoot":"","sources":["../../../../src/i18n-labelling/utils/frontend-derived-label-keys.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,wBAAwB;IACvC,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,6BAA6B,EAAE,MAAM,EAAE,CAAC;IACxC,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C;;;;;;;;;;;;OAYG;IACH,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C;;;;;;;;;;;;;;;;;OAiBG;IACH,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrD;;;;;;;;;;;;OAYG;IACH,6BAA6B,EAAE,MAAM,EAAE,CAAC;CACzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,EAAE,wBAQ/C,CAAC;AAgCF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,OAAO,GAAG,wBAAwB,GAAG,IAAI,CA0BhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance-keys.utils.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"guidance-keys.utils.d.ts","sourceRoot":"","sources":["../../../../src/i18n-labelling/utils/guidance-keys.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,MAAM,EAAE,CAmDX;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,MAAM,EAAE,CAU7F;AAED,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,wBAAwB,GACvC,MAAM,EAAE,CAiBV;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,8EAA8E;IAC9E,8BAA8B,EAAE,OAAO,CAAC;IACxC,gFAAgF;IAChF,wBAAwB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,0EAA0E;IAC1E,0BAA0B,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAClD,4EAA4E;IAC5E,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC3C,GAAG,MAAM,EAAE,CAKX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-file-source.utils.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"label-file-source.utils.d.ts","sourceRoot":"","sources":["../../../../src/i18n-labelling/utils/label-file-source.utils.ts"],"names":[],"mappings":"AAEA,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC;AAE5F,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAClC;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CAahF;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC/B,IAAI,GAAE,MAAM,EAAO,EACnB,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcxB;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAmB1B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAClC,GAAG,MAAM,CAWT"}
|