@wildo-ai/dev-companion 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +12 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +11 -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 +153 -1
- 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 +419 -41
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +25 -10
- 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 +65 -24
- 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 +86 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +127 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -0
- package/dist/esm/companion-api/companion-api.schemas.d.ts +59 -2
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +60 -0
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +322 -21
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/inject/models/container.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.js +11 -0
- package/dist/esm/core/inject/models/container.js.map +1 -1
- package/dist/esm/core/inject/models/service-types.d.ts +5 -0
- package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/core/inject/models/service-types.js +5 -0
- 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/behaviors/companion-introspection-behavior-definitions.js +81 -0
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts +11 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.js +39 -0
- package/dist/esm/core/introspection/models/companion-introspection.models.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +8 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +317 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts +45 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +250 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts +123 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js +298 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts +78 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js +155 -6
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +131 -2
- 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 +259 -9
- 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 +243 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +417 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +186 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +368 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts +101 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js +278 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts +365 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js +167 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -0
- 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 +332 -3
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts +19 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +164 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +3 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +36 -23
- 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 +51 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +391 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -0
- 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 +103 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js +124 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -0
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +39 -2
- 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 +122 -11
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts +6 -0
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.js.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts +23 -0
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.js +26 -4
- package/dist/esm/core/specifications/specification-context-factory.shared.js.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 +126 -12
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts +12 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js +12 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts +13 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.js +91 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.js.map +1 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts +38 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.js +41 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.js.map +1 -0
- package/dist/esm/i18n/index.d.ts +3 -3
- package/dist/esm/i18n/index.js +3 -3
- package/dist/esm/i18n/index.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts +24 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js +20 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts +31 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js +27 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts +24 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js +20 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +28 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +24 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts +138 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.js +100 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts +29 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.js +25 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts +27 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js +23 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +806 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +326 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts +26 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.js +22 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.js.map +1 -0
- package/dist/esm/i18n/system_enums/market.en.d.ts +202 -0
- package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -0
- package/dist/esm/i18n/system_enums/market.en.js +209 -0
- package/dist/esm/i18n/system_enums/market.en.js.map +1 -0
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +112 -2
- 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 +201 -34
- 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 +31 -3
- 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 +48 -12
- 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 +36 -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 +75 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +105 -7
- 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 +298 -24
- 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 +46 -3
- 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 +95 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts +9 -0
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js +13 -0
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +12 -0
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +23 -0
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +120 -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 +636 -81
- 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 +40 -0
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js +63 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +21 -0
- 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 +86 -2
- 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 +12 -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 +47 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
- package/package.json +17 -17
- package/dist/esm/.builder.pid +0 -9
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts +0 -36
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts.map +0 -1
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.js +0 -32
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.js.map +0 -1
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts +0 -29
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts.map +0 -1
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js +0 -25
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js.map +0 -1
package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-introspection-behavior-handlers.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/companion-introspection-behavior-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,uCAAuC,EAAE,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EACL,wCAAwC,EACxC,6BAA6B,EAC7B,8BAA8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,EACrG,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,iGAAiG,CAAC,CAAC;QACrH,CAAC;QACD,MAAM,CAAC,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,qBAA2C,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACtG,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { pathToFileURL } from 'node:url';\nimport type { z } from 'zod';\nimport { generateDesignTokensCssFromSourceConfig } from '@wildo-ai/presets-components-models';\nimport {\n backendResourcesConfigurationsFactoryMap,\n backendResourcesRelationships,\n BackendResourceFieldIdentifier,\n} from '@wildo-ai/saas-backend-lib/backend-resource-registry';\nimport {\n buildSharedSaaSModulesRegistry,\n coreResourceShared_FieldIdentifier,\n coreResourceShared_FieldIdentifierPriority,\n coreShared_ResourcesConfigurations_FactoryMap,\n coreSharedResourceRelationship,\n CoreResourceType,\n Resources_SharedUtils,\n type ResourceConfiguration,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { CompanionArtifactClass } from '@wildo-ai/saas-models/companion';\nimport { getZodObjectShape } from '@wildo-ai/zod-decorators';\nimport {\n assertResourceSpecificationsAlignWithRegistry,\n ExpertShapingInputKind,\n extractFieldSpecsFromFieldMap,\n extractResourceFieldSpecs,\n validateBrandSnapshot,\n validateMarketSnapshot,\n type AnyResourceSpecificationConfig,\n type BrandSnapshot,\n type ExpertPersonaCharter,\n type MarketSnapshot,\n type ToneOfVoiceConfig,\n} from '@wildo-ai/saas-specifications';\nimport {\n parseSpecificationContextFactoryRequest,\n renderSpecificationContextPart,\n} from '../../specifications/specification-context-factory';\nimport { renderCatalogEntryContextPart } from '../../catalogs/catalog-context.factory';\nimport { CatalogContextVocabulary } from '../../catalogs/catalog-context.factory.models';\nimport {\n resolveBackendCompanionExports,\n resolveDesignSystemSourceConfig,\n resolveFrontendCompanionExports,\n resolveSharedLibraryCompanionExports,\n resolveSpecificationsCompanionExports,\n} from './companion-introspection-module-exports.utils';\nimport { runFrontendLabelsNeededInfo } from './frontend-labels-needed-info.behavior';\nimport {\n findUnknownDestinationRefs,\n resolveSettingsHubConfig,\n verifySettingsHubContent,\n} from '@wildo-ai/saas-frontend-lib';\nimport { runChartRegistrationRefs } from './chart-registration-refs.behavior';\nimport { buildMarketContextBlock } from './market-context-block.builder';\nimport { runOpenApiGenerationInputBehavior } from './openapi-generation-input.behavior';\nimport { renderMarketPrompt, type MarketPromptRequest } from './market-prompt-renderer';\nimport { renderBrandPrompt } from './brand-prompt-renderer';\nimport { renderShapingInputBriefs, type ExpertPersonaBriefSources } from './expert-persona-brief.renderer';\nimport {\n runAssertionsList,\n runAssertionsReconcile,\n runAssertionsResolve,\n} from './assertions.behavior';\nimport { runDefinitionSpecifications } from './definition-specifications.behavior';\nimport {\n asComplianceRelevantConfiguration,\n CompliancePrimaryFactOrigin,\n projectCompliancePrimaryFacts,\n} from './compliance-primary-facts.behavior';\nimport type {\n CompanionIntrospectionBehaviorId,\n CompanionIntrospectionChildRequest,\n CompanionIntrospectionResolvedBehaviorDefinition,\n} from '../models/companion-introspection.models';\n\n\n/**\n * Every engine-owned resource-configuration factory THE BACKEND RUNTIME ACTUALLY MERGES.\n *\n * `resources-registry.backend.service.ts` merges TWO maps at init: the core shared map from\n * `@wildo-ai/saas-models` and the backend map from `@wildo-ai/saas-backend-lib`. Completing the registry\n * side of a pairing with only the first observes half the population, and the half it misses is invisible\n * rather than noisy: on 2026-08-22 that made every `BackendResourceType` carrying an authored\n * specification a spec-orphan by construction, and the whole `resource-specifications` introspection failed\n * on `dataSeedRuns` — the first backend resource to be given a spec.\n *\n * This exists as ONE function because the completion happens at two call sites in this file, and the\n * previous defect was precisely that a population was enumerated correctly at neither. A third map added\n * to the runtime merge must be added here once, not twice.\n */\nfunction engineResourceConfigurationFactoryEntries(): ReadonlyArray<readonly [string, unknown]> {\n return [\n ...Object.entries(coreShared_ResourcesConfigurations_FactoryMap),\n ...Object.entries(backendResourcesConfigurationsFactoryMap),\n ];\n}\n\n/**\n * The relationship set an ENGINE resource-configuration factory must be materialized against.\n *\n * An engine factory buckets its own parent/child edges out of whatever array it is handed, so calling\n * one with the APPLICATION's relationship slice alone produces a configuration whose engine edges have\n * silently vanished — a materialization that succeeds and is wrong. The backend runtime never does\n * that: `resources-registry.backend.service.ts` compiles app + core-shared + core-backend edges\n * together, against the merged field identifiers, before it calls any factory.\n *\n * This exists as ONE function for the same reason {@link engineResourceConfigurationFactoryEntries}\n * does: three call sites in this file now complete the app registry with the engine population, and\n * three hand-written copies of a merge convention are three things that can disagree — invisibly,\n * because each site's own pins would still pass. A fourth relationship source added to the runtime\n * merge is added here once.\n */\nfunction engineMergedCompiledResourceRelationships(\n applicationResourceRelationships: readonly unknown[] | undefined,\n applicationResourceFieldIdentifiers: Record<string, string> | undefined,\n): ReturnType<typeof Resources_SharedUtils.ensureCompiledRelationships> {\n return Resources_SharedUtils.ensureCompiledRelationships(\n [\n ...(applicationResourceRelationships ?? []),\n ...coreSharedResourceRelationship,\n ...backendResourcesRelationships,\n ] as Parameters<typeof Resources_SharedUtils.ensureCompiledRelationships>[0],\n {\n ...(applicationResourceFieldIdentifiers ?? {}),\n ...coreResourceShared_FieldIdentifier,\n ...BackendResourceFieldIdentifier,\n },\n );\n}\n\nexport interface CompanionIntrospectionBehaviorRuntimeContext {\n request: CompanionIntrospectionChildRequest;\n behavior: CompanionIntrospectionResolvedBehaviorDefinition;\n moduleExports: Record<string, unknown>;\n}\n\nexport type CompanionIntrospectionBehaviorHandler = (\n input: unknown,\n context: CompanionIntrospectionBehaviorRuntimeContext,\n) => unknown | Promise<unknown>;\n\nfunction materializeResourceSpecificationOverlay(\n resourceSpecOverlay: AnyResourceSpecificationConfig | undefined,\n): Record<string, unknown> | null {\n if (!resourceSpecOverlay) {\n return null;\n }\n\n return {\n purpose: resourceSpecOverlay.purpose,\n businessRole: resourceSpecOverlay.businessRole,\n lifecycleRole: resourceSpecOverlay.lifecycleRole,\n codeHandling: resourceSpecOverlay.codeHandling,\n businessConstraints: resourceSpecOverlay.businessConstraints,\n operations: resourceSpecOverlay.operations,\n frontend: resourceSpecOverlay.frontend,\n };\n}\n\n/**\n * Module keys that IDENTIFY a module rather than describe what it contributes.\n *\n * Named rather than inlined so the contribution derivation below stays a RULE: a new identity field\n * is added here once, and a new CONTRIBUTION field needs no change at all — which is the whole point\n * of deriving contributions from the module's own keys.\n */\nconst MODULE_IDENTITY_KEYS: ReadonlySet<string> = new Set(['moduleId', 'kind']);\n\nexport const COMPANION_INTROSPECTION_BUILTIN_BEHAVIOR_HANDLERS: Partial<\n Record<CompanionIntrospectionBehaviorId, CompanionIntrospectionBehaviorHandler>\n> = {\n /*\n * Compliance facts, derived rather than elicited.\n *\n * Materializes exactly as `resources-registry` does — `factory(allRelationships)`, the way both\n * runtime registries do — and classifies each resource by ORIGIN using the same engine factory\n * population that helper owns. Reusing `engineResourceConfigurationFactoryEntries()` is not tidiness:\n * that function exists because the runtime merges TWO engine maps and a caller enumerating one of\n * them observes half the population invisibly. Here the consequence would be a privacy notice\n * crediting the application with declarations the ENGINE made, or the reverse.\n */\n 'compliance-primary-facts': async (_input, context) => {\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n const engineResourceTypes = new Set(engineResourceConfigurationFactoryEntries().map(([resourceType]) => resourceType));\n\n const entries: {\n resourceType: string;\n origin: CompliancePrimaryFactOrigin;\n configuration: ReturnType<typeof asComplianceRelevantConfiguration>;\n }[] = [];\n const unmaterializableResourceTypes: string[] = [];\n\n /*\n * Materialize one factory into the projection's narrow slice, naming it rather than dropping it\n * when it throws.\n *\n * A factory that cannot materialize is its own (loud) defect elsewhere — the same policy\n * `resources-registry` takes. It is NAMED rather than skipped: a resource silently missing from\n * this projection would make a document under-report what the application holds, which is the one\n * direction a compliance statement must never fail in. Note the two sibling handlers below\n * deliberately let an engine factory throw escape; this one cannot, because a single broken engine\n * factory would then take the whole compliance projection with it — and reporting nothing is worse\n * here than reporting a named hole.\n */\n const collect = (resourceType: string, factory: unknown, relationships: unknown): void => {\n if (typeof factory !== 'function') {\n return;\n }\n // Typed at the narrow compliance slice rather than at `ResourceConfiguration`, which is generic\n // in three parameters this projection has no opinion about. The slice's own field types come\n // from `saas-models`, so a rename there still breaks the build.\n let configuration: Parameters<typeof asComplianceRelevantConfiguration>[0];\n try {\n configuration = (factory as (rels: unknown) => Parameters<typeof asComplianceRelevantConfiguration>[0])(\n relationships,\n );\n } catch {\n unmaterializableResourceTypes.push(resourceType);\n return;\n }\n entries.push({\n resourceType,\n origin: engineResourceTypes.has(resourceType)\n ? CompliancePrimaryFactOrigin.ENGINE\n : CompliancePrimaryFactOrigin.APPLICATION,\n configuration: asComplianceRelevantConfiguration(configuration),\n });\n };\n\n for (const [resourceType, factory] of Object.entries(sharedRegistry.resourceConfigurations)) {\n collect(resourceType, factory, sharedRegistry.resourceRelationships);\n }\n\n /*\n * COMPLETE THE POPULATION WITH THE ENGINE'S OWN RESOURCES — without this the origin split is inert.\n *\n * `loadSharedModules()` returns the APPLICATION's modules, so `sharedRegistry.resourceConfigurations`\n * carries the app's resources and nothing else. Classifying that slice by engine-key membership can\n * therefore only ever answer APPLICATION: measured live against wonder-crm on 2026-08-29, the ENGINE\n * column read `resources 0` on an application that inherits ~80 engine resources. The branch read as\n * capability and could not execute — and the unit tests could not see it, because they hand the\n * projection both origins directly.\n *\n * That silence is the expensive direction. The whole point of the split is that a produced privacy\n * notice can say \"this much came free, this much is yours to declare\"; an ENGINE column of zero says\n * the framework answers nothing, which is false and unfalsifiable from the document.\n *\n * Symmetric with the `resource-specifications` and `resource-render-inputs` handlers below: the\n * engine factories are materialized against the CORE-MERGED compiled relationships (an engine factory\n * handed the app-only slice loses its own edges), and an app registration always wins over a\n * same-keyed core entry — so this loop adds engine resources the app did not re-register, and never\n * overwrites what the app declared.\n */\n const coreCompiledRelationships = engineMergedCompiledResourceRelationships(\n sharedRegistry.resourceRelationships,\n sharedRegistry.resourceFieldIdentifiers,\n );\n for (const [resourceType, factory] of engineResourceConfigurationFactoryEntries()) {\n if (Object.prototype.hasOwnProperty.call(sharedRegistry.resourceConfigurations, resourceType)) {\n continue;\n }\n collect(resourceType, factory, coreCompiledRelationships);\n }\n\n return { ...projectCompliancePrimaryFacts(entries), unmaterializableResourceTypes };\n },\n\n 'resources-registry': async (_input, context) => {\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n\n /*\n * The FK-resolution SWEEP, run against the CURRENT working tree (this subprocess re-imports\n * the app's shared-lib fresh per request — never the companion's boot-time cache). Same\n * shared implementation the frontend registry refuses on at init\n * (`frontend_fk_resolution_failed`), surfaced here so the app-creation verification lane can\n * refuse a compose/coding mutation that landed a decorated FK with no relationship edge —\n * the wonder-crm 2026-08-27 defect, which typecheck and the backend boot both missed.\n * Factories are materialized exactly as both runtime registries do: `factory(allRelationships)`.\n */\n const mainSchemasByResourceType: Record<string, z.ZodTypeAny | undefined> = {};\n for (const [resourceType, factory] of Object.entries(sharedRegistry.resourceConfigurations)) {\n try {\n mainSchemasByResourceType[resourceType] = (factory as (relationships: unknown) => { mainSchema?: z.ZodTypeAny })(\n sharedRegistry.resourceRelationships,\n )?.mainSchema;\n } catch {\n // A factory that cannot materialize is its own (loud) defect elsewhere; the sweep only\n // judges the schemas it can see.\n mainSchemasByResourceType[resourceType] = undefined;\n }\n }\n const fieldIdentifierToResourceType = Resources_SharedUtils.buildFieldIdentifierToResourceTypeMap({\n allResourceFieldIdentifiers: sharedRegistry.resourceFieldIdentifiers,\n allResourceRelationships: sharedRegistry.resourceRelationships,\n getMainSchema: (resourceType) => mainSchemasByResourceType[resourceType],\n fieldIdentifierPriority: coreResourceShared_FieldIdentifierPriority,\n });\n const unresolvableForeignKeyFields = Resources_SharedUtils.collectUnresolvableForeignKeyFields({\n mainSchemasByResourceType,\n fieldIdentifierToResourceType,\n });\n\n return {\n resourceTypes: Object.keys(sharedRegistry.resourceConfigurations),\n resourceFieldIdentifiers: sharedRegistry.resourceFieldIdentifiers,\n resourceRelationships: sharedRegistry.resourceRelationships,\n customFeatureDefinitionCount: sharedRegistry.customFeatureDefinitions.length,\n customMilestoneDefinitionCount: sharedRegistry.customMilestoneDefinitions.length,\n productDefinitionCount: sharedRegistry.productDefinitions.length,\n unresolvableForeignKeyFields,\n /*\n * WORKSPACE GROUND TRUTH for build planning (J-1 stalls G+H): the REAL module ids and each\n * resource's CURRENT schema fields, so a decompose brief can state them instead of the model\n * inventing a moduleRef (`module-crm`) or emitting \"create the skeleton\" objectives for\n * resources compose already scaffolded. `modules` covers app-authored domain modules only —\n * engine modules are framework-owned and not build-plan targets.\n */\n modules: sharedModules\n .filter((sharedModule) => sharedModule.kind !== 'engine')\n .map((sharedModule) => ({\n moduleId: sharedModule.moduleId,\n resourceTypes: Object.keys(sharedModule.resourceConfigurations ?? {}),\n })),\n resourceSchemaFields: Object.fromEntries(\n Object.entries(mainSchemasByResourceType).map(([resourceType, schema]) => [\n resourceType,\n schema ? Object.keys(getZodObjectShape(schema) ?? {}) : [],\n ]),\n ),\n };\n },\n 'email-template-placement-info': async (_input, context) => {\n const { loadBackendModules } = resolveBackendCompanionExports(context.moduleExports);\n const backendModules = await loadBackendModules();\n\n return {\n emailTemplateOwnership: backendModules\n .filter((ownedModule) => Object.keys(ownedModule.emailTemplateDefinitions ?? {}).length > 0)\n .map((ownedModule) => ({\n ownerId: ownedModule.moduleId,\n artifactClass: ownedModule.kind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : CompanionArtifactClass.DOMAIN_MODULE,\n rootsByRole: {\n backend: ownedModule.kind === 'engine'\n ? 'backend-api/src/engine/email'\n : `backend-api/src/modules/${ownedModule.moduleId}/emails`,\n },\n templateRefs: Object.keys(ownedModule.emailTemplateDefinitions ?? {}),\n })),\n };\n },\n 'translation-needed-info': async (_input, context) => {\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n\n return {\n moduleIds: sharedRegistry.moduleIds,\n contributionModuleIds: sharedModules.map((module) => module.moduleId),\n artifactPlacements: sharedModules.map((module) => ({\n ownerId: module.moduleId,\n artifactClass: module.kind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : CompanionArtifactClass.DOMAIN_MODULE,\n rootsByRole: {\n shared: module.kind === 'engine'\n ? 'shared-lib/src/engine'\n : `shared-lib/src/modules/${module.moduleId}`,\n backend: module.kind === 'engine'\n ? 'backend-api/src/engine'\n : `backend-api/src/modules/${module.moduleId}`,\n frontend: module.kind === 'engine'\n ? 'frontend/src/engine'\n : `frontend/src/modules/${module.moduleId}`,\n },\n })),\n resourceOwnership: sharedModules.map((module) => ({\n ownerId: module.moduleId,\n artifactClass: module.kind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : CompanionArtifactClass.DOMAIN_MODULE,\n rootsByRole: {\n shared: module.kind === 'engine'\n ? 'shared-lib/src/engine'\n : `shared-lib/src/modules/${module.moduleId}`,\n backend: module.kind === 'engine'\n ? 'backend-api/src/engine'\n : `backend-api/src/modules/${module.moduleId}`,\n frontend: module.kind === 'engine'\n ? 'frontend/src/engine'\n : `frontend/src/modules/${module.moduleId}`,\n },\n resourceTypes: Object.keys(module.resourceConfigurations ?? {}),\n })),\n };\n },\n 'frontend-artifact-placement-info': async (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n const loadFrontendModules = frontendCompanionExports.loadFrontendModules;\n const loadSharedModules = frontendCompanionExports.loadSharedModules;\n if (!loadFrontendModules) {\n throw new Error('Target frontend companion export does not expose loadFrontendModules().');\n }\n if (!loadSharedModules) {\n throw new Error('Target frontend companion export does not expose loadSharedModules().');\n }\n\n const [frontendModules, sharedModules] = await Promise.all([\n loadFrontendModules(),\n loadSharedModules(),\n ]);\n const sharedModuleKindById = new Map(\n sharedModules.map((module) => [module.moduleId, module.kind] as const),\n );\n const resolvedModuleIds = [...new Set(frontendModules.map((module) => module.moduleId))];\n\n return {\n artifactPlacements: resolvedModuleIds.map((moduleId) => {\n const sharedKind = sharedModuleKindById.get(moduleId);\n const artifactClass = sharedKind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : sharedKind\n ? CompanionArtifactClass.DOMAIN_MODULE\n : CompanionArtifactClass.FRONTEND_ONLY;\n\n return {\n ownerId: moduleId,\n artifactClass,\n rootsByRole: {\n frontend: moduleId === 'engine'\n ? 'frontend/src/engine'\n : `frontend/src/modules/${moduleId}`,\n },\n };\n }),\n };\n },\n 'design-system-source-config': (_input, context) => (\n resolveDesignSystemSourceConfig(resolveFrontendCompanionExports(context.moduleExports))\n ),\n 'design-tokens-css': (_input, context) => (\n generateDesignTokensCssFromSourceConfig(\n resolveDesignSystemSourceConfig(resolveFrontendCompanionExports(context.moduleExports)),\n )\n ),\n 'frontend-labels-needed-info': (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n return runFrontendLabelsNeededInfo(frontendCompanionExports, {\n serviceKey: context.request.serviceKey,\n });\n },\n /*\n * The settings-placement CONTENT sweep, against the CURRENT working tree.\n *\n * Exists because a `SHELL_PLACEMENT` coding task's likeliest defect is invisible to\n * every check it could otherwise name. A placement whose `destinationRef` the engine\n * catalog does not ship is not a type error — `resolveSettingsHubConfig` DROPS it and\n * the section simply never renders — so `check:app-typecheck` passes, the task reports\n * verified, and the application is missing a settings section nobody is told about.\n * Same class as the FK-resolution sweep beside it, and the same remedy: ask the\n * working tree, outside the coding agent.\n *\n * Pure composition of surfaces the engine already owns — resolution, the unknown-ref\n * finder and the verifier. No second copy of the catalog lookup lives here.\n */\n 'settings-placement-content': (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n const authored = frontendCompanionExports.settingsHubConfig;\n const result = verifySettingsHubContent(\n resolveSettingsHubConfig(authored),\n findUnknownDestinationRefs(authored),\n );\n return {\n // An application that has authored no rail is VALID, not empty-and-suspicious:\n // an unplaced rail has nothing to verify. Distinguished so a caller can tell\n // \"nothing authored\" from \"authored and clean\".\n authored: authored !== undefined,\n isValid: result.isValid,\n errors: result.errors.map((error) => ({\n severity: error.severity,\n code: error.code,\n context: error.context,\n message: error.message,\n })),\n };\n },\n 'chart-registration-refs': (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n return runChartRegistrationRefs(frontendCompanionExports, {\n serviceKey: context.request.serviceKey,\n });\n },\n 'resource-specifications': async (_input, context) => {\n const libraryTarget = context.request.resolvedTargets.library;\n if (!libraryTarget) {\n throw new Error(\n 'resource-specifications requires a root-level `libraries.shared` declaration in wildo.saas.config.ts.',\n );\n }\n\n const sharedCompanionModule = await import(pathToFileURL(libraryTarget.entryPath).href) as Record<string, unknown>;\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(sharedCompanionModule);\n // Keep the raw shared modules (not just the flattened registry) so the\n // module→resource membership can be projected below. Only the subprocess\n // knows this mapping — the shared registry the runner sees is already\n // flattened to a resourceType-keyed record with no module ownership.\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n const resourceConfigs = (\n sharedRegistry.resourceConfigurations ?? {}\n ) as Record<\n string,\n | ResourceConfiguration<any, any, any>\n | ((relationships: unknown[]) => ResourceConfiguration<any, any, any>)\n >;\n\n const { resourceSpecifications: specOverlay } = resolveSpecificationsCompanionExports(\n context.moduleExports,\n );\n if (specOverlay === undefined) {\n throw new Error(\n 'resource-specifications introspection requires the specifications package to export `resourceSpecifications`.',\n );\n }\n\n // Materialize all resource configurations once so we can pair them with the\n // spec overlay and run the cross-layer scope alignment check. Materialization\n // is idempotent (the registry-layer factory is pure given its rel inputs)\n // and the per-resource loop below reuses these materialized configs.\n const materializedResourceConfigs: Record<string, ResourceConfiguration<any, any, any>> = {};\n for (const [resourceType, factoryOrConfig] of Object.entries(resourceConfigs)) {\n materializedResourceConfigs[resourceType] = typeof factoryOrConfig === 'function'\n ? (factoryOrConfig as (relationships: unknown[]) => ResourceConfiguration<any, any, any>)(\n sharedRegistry.resourceRelationships ?? [],\n )\n : factoryOrConfig;\n }\n\n // Complete the registry side of the pairing with the CORE (engine) resource\n // configurations. The app's shared registry only carries app-module\n // resources, but the spec overlay merges `engineResourceSpecificationsByType`\n // (every engine resource spec — users, organizations, billing, files, …), so\n // pairing against the app slice alone spec-orphans every scoped engine spec.\n // The backend runtime merges `coreShared_ResourcesConfigurations_FactoryMap`\n // into its registry at init (resources-registry.backend.service.ts), so the\n // core configs ARE runtime truth for this app; the alignment guard must see\n // the same merged view. Core factories are materialized exactly like the\n // OpenAPI projector does (openapi-generation-input.behavior.ts): rels are\n // compiled from app + core-shared inputs against merged field identifiers,\n // and an app registration always wins over a same-keyed core entry. A core\n // factory throw is NOT caught: the backend materializes the same factories\n // at startup, so a throw here is a real cross-layer break that must surface.\n const coreCompiledRelationships = engineMergedCompiledResourceRelationships(\n sharedRegistry.resourceRelationships,\n sharedRegistry.resourceFieldIdentifiers,\n );\n for (const [coreType, coreFactory] of engineResourceConfigurationFactoryEntries()) {\n if (materializedResourceConfigs[coreType]) continue;\n if (typeof coreFactory !== 'function') continue;\n materializedResourceConfigs[coreType] = coreFactory(\n coreCompiledRelationships,\n ) as ResourceConfiguration<any, any, any>;\n }\n\n // Phase 4.5 Step 2.5 Layer 4: cross-layer scope alignment guard.\n // Throws on spec-orphans and on any spec/registry resourcePrimaryScope\n // disagreement — for BOTH app-authored specs (paired with the app shared\n // registry) and engine specs (paired with the materialized core configs).\n // Runs at the canonical pairing site so the failure surfaces on the first\n // introspection call rather than later, against any consumer.\n assertResourceSpecificationsAlignWithRegistry(\n specOverlay as Record<string, AnyResourceSpecificationConfig>,\n materializedResourceConfigs,\n '[companion introspection: resource-specifications]',\n );\n\n const resourceFieldSpecs: Record<\n string,\n { specOverlay: Record<string, unknown> | null; fieldSpecs: unknown[] }\n > = {};\n\n // Phase 2B: thread the registry slice that owns each resource into the\n // extractor entry points so `foreignKeySpec` fields resolve their target\n // via the relationship registry (single source of truth — Q6-2b).\n const allResourceRelationships = sharedRegistry.resourceRelationships ?? [];\n\n for (const [resourceType] of Object.entries(resourceConfigs)) {\n const resourceConfig = materializedResourceConfigs[resourceType];\n const registryContext = {\n currentResourceType: resourceType,\n relationships: allResourceRelationships,\n };\n\n const resourceSpecOverlay = specOverlay?.[resourceType] as AnyResourceSpecificationConfig | undefined;\n const overlayFieldSpecs = resourceSpecOverlay?.fields\n ? extractFieldSpecsFromFieldMap(\n resourceSpecOverlay.fields as Record<string, z.ZodTypeAny>,\n undefined,\n registryContext,\n )\n : [];\n const overlayAdditionalFieldSpecs = resourceSpecOverlay?.additionalFieldSpecs ?? [];\n const fieldSpecs = overlayFieldSpecs.length > 0 || overlayAdditionalFieldSpecs.length > 0\n ? [...overlayFieldSpecs, ...overlayAdditionalFieldSpecs]\n : resourceConfig?.mainSchema\n ? extractResourceFieldSpecs(\n resourceConfig.mainSchema,\n resourceConfig.inheritenceSchemaDefinition,\n registryContext,\n )\n : [];\n\n resourceFieldSpecs[resourceType as ResourceType] = {\n specOverlay: materializeResourceSpecificationOverlay(resourceSpecOverlay),\n fieldSpecs,\n };\n }\n\n // DEC-6: carry module→resource membership so a MODULE-scoped journey can\n // narrow the projected inventory to exactly the modules it targets. Only\n // the subprocess holds this mapping (the runner sees a flattened registry);\n // mirrors `translation-needed-info`'s `resourceOwnership` shape. App shared\n // modules only — Layer-A clean (never framework/engine module content).\n const moduleOwnership = sharedModules.map((module) => ({\n moduleId: module.moduleId,\n /*\n * `kind` distinguishes an ENGINE contribution module from a business DOMAIN one, and dropping\n * it made the two indistinguishable downstream. Wonder CRM's `engine` module carries roles,\n * features, milestones and the product catalog and owns no resources — so it projected as\n * `resourceTypes: []` and read as an empty or broken module rather than as a different KIND of\n * contribution entirely.\n */\n kind: module.kind ?? null,\n resourceTypes: Object.keys(module.resourceConfigurations ?? {}),\n /*\n * Every contribution the module declares, DERIVED from its own keys rather than from a curated\n * list of the ones that exist today.\n *\n * `SharedSaaSModule` admits nine contribution fields and will admit more; a hand-written\n * projection reports the subset its author happened to know about, and a module whose whole\n * contribution is outside that subset looks empty — exactly the defect this replaces. Reading\n * the keys means a contribution added to the contract tomorrow appears here with no change to\n * this handler.\n *\n * Magnitude rather than content: a count says whether the module contributes and how much,\n * which is what an inventory needs. The content belongs to whichever behavior projects that\n * contribution specifically.\n */\n contributions: Object.entries(module)\n .filter(([key]) => !MODULE_IDENTITY_KEYS.has(key))\n .map(([contribution, value]) => ({\n contribution,\n count: Array.isArray(value)\n ? value.length\n : (value && typeof value === 'object' ? Object.keys(value).length : (value === undefined ? 0 : 1)),\n }))\n .filter((entry) => entry.count > 0),\n }));\n\n return { resourceFieldSpecs, moduleOwnership };\n },\n 'specification-context-parts': async (input, context) => {\n const request = parseSpecificationContextFactoryRequest(input);\n const companionExports = resolveSpecificationsCompanionExports(context.moduleExports);\n\n // Phase 2B + Phase 4: load the shared resource registry so resource-family\n // render requests can both\n // - derive `foreignKeySpec` targets from `foreignKeyField` (single\n // source of truth = the relationship registry, per Q6-2b), AND\n // - run the Phase 4 completeness validator against the live\n // `mainSchema` + `inheritenceSchemaDefinition` of every materialized\n // resource configuration before producing the rendered context part.\n //\n // Loading is unconditional today because `renderSpecificationContextPart`\n // dispatches by family inside; non-resource families ignore both slices.\n const libraryTarget = context.request.resolvedTargets.library;\n const { resourceRelationships, resourceMaterializedConfigs } = libraryTarget\n ? await (async () => {\n const sharedCompanionModule = await import(\n pathToFileURL(libraryTarget.entryPath).href\n ) as Record<string, unknown>;\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(sharedCompanionModule);\n const sharedRegistry = buildSharedSaaSModulesRegistry(...await loadSharedModules());\n const relationships = sharedRegistry.resourceRelationships ?? [];\n const resourceConfigs = (\n sharedRegistry.resourceConfigurations ?? {}\n ) as Record<\n string,\n | ResourceConfiguration<any, any, any>\n | ((relationships: unknown[]) => ResourceConfiguration<any, any, any>)\n >;\n // Materialize each registered resource configuration once so\n // the Phase 4 completeness validator sees the same live\n // `mainSchema` / `inheritenceSchemaDefinition` the runtime sees.\n // Mirrors the materialization pass in the `resource-specifications`\n // handler — both paths apply the same registry-relationships input\n // so the result is canonical.\n const materialized: Record<\n string,\n { mainSchema: z.ZodTypeAny; inheritanceDefinition?: ResourceConfiguration<any, any, any>['inheritenceSchemaDefinition'] }\n > = {};\n for (const [resourceType, factoryOrConfig] of Object.entries(resourceConfigs)) {\n const resourceConfig = typeof factoryOrConfig === 'function'\n ? (factoryOrConfig as (relationships: unknown[]) => ResourceConfiguration<any, any, any>)(relationships)\n : factoryOrConfig;\n if (resourceConfig?.mainSchema) {\n materialized[resourceType] = {\n mainSchema: resourceConfig.mainSchema as z.ZodTypeAny,\n inheritanceDefinition: resourceConfig.inheritenceSchemaDefinition,\n };\n }\n }\n\n // Complete the registry side with the CORE (engine) resource configs,\n // symmetrically with the `resource-specifications` handler. The spec\n // overlay merges every engine resource spec (users, organizations,\n // billing, …), so an engine-resource render request would otherwise\n // resolve `materializedConfig === undefined` and SILENTLY SKIP the\n // Phase-4 completeness gate. Materialize the core factories here — and,\n // critically, thread the CORE-MERGED compiled relationships as the gate\n // input (NOT the app-only slice): the FK-completeness walk must see the\n // engine FK edges to gate them, and passing app-only relationships would\n // both under-check engine FKs AND spuriously fail engine specs that\n // correctly authored `.foreignKeySpec()` (their targets are unresolvable\n // without the core edges). App registrations win over same-keyed core\n // entries; a core factory throw is intentionally NOT caught (the backend\n // materializes the same factories at startup, so a throw here is a real\n // cross-layer break that must surface).\n const coreCompiledRelationships = engineMergedCompiledResourceRelationships(\n relationships,\n sharedRegistry.resourceFieldIdentifiers,\n );\n for (const [coreType, coreFactory] of engineResourceConfigurationFactoryEntries()) {\n if (materialized[coreType]) continue;\n if (typeof coreFactory !== 'function') continue;\n const coreConfig = coreFactory(coreCompiledRelationships) as ResourceConfiguration<any, any, any>;\n if (coreConfig?.mainSchema) {\n materialized[coreType] = {\n mainSchema: coreConfig.mainSchema as z.ZodTypeAny,\n inheritanceDefinition: coreConfig.inheritenceSchemaDefinition,\n };\n }\n }\n\n return {\n resourceRelationships: coreCompiledRelationships,\n resourceMaterializedConfigs: materialized,\n };\n })()\n : { resourceRelationships: [], resourceMaterializedConfigs: {} };\n\n return {\n contextPart: renderSpecificationContextPart(companionExports, request, {\n resourceRelationships,\n resourceMaterializedConfigs,\n }),\n };\n },\n 'catalog-context-parts': (input, context) => {\n const request = parseCatalogContextFactoryRequest(input);\n const companionExports = resolveSpecificationsCompanionExports(context.moduleExports);\n\n switch (request.vocabulary) {\n case CatalogContextVocabulary.SCHEMA_ORG: {\n const catalog = (\n companionExports as {\n catalogSpecifications?: { schemaOrg?: readonly { '@type': string }[] };\n }\n ).catalogSpecifications?.schemaOrg;\n if (!catalog) {\n throw new Error(\n 'Specifications companion exports are missing `catalogSpecifications.schemaOrg`.',\n );\n }\n const entry = findCatalogEntryByTypeLastWins(catalog, request.entryType);\n if (!entry) {\n throw new Error(\n `No Schema.org catalog entry \"${request.entryType}\" is exported from the specifications package.`,\n );\n }\n return {\n contextPart: renderCatalogEntryContextPart({\n vocabulary: request.vocabulary,\n entry: entry as Parameters<typeof renderCatalogEntryContextPart>[0]['entry'],\n }),\n };\n }\n default: {\n const unhandledVocabulary: never = request.vocabulary;\n throw new Error(`Unhandled catalog vocabulary: ${String(unhandledVocabulary)}`);\n }\n }\n },\n /**\n * Phase-4 market-context handlers.\n *\n * Both handlers parse a tiny request payload, resolve the authored\n * `MarketSnapshot` via `resolveSpecificationsCompanionExports`, and\n * defer all rendering to the pure `buildMarketContextBlock(...)`\n * builder. Anchored as `companion.introspection.handlers.market` so\n * the `market-companion-prompt-enrichment` SKILL can reference the\n * exact wiring (parser → snapshot resolver → builder).\n *\n * @wildo_source:part:start companion.introspection.handlers.market facet:layer:companion facet:family:market\n */\n 'market-context-for-feature': (input, context) => {\n const { featureRef, outputLanguage } = parseMarketContextFeatureRequest(input);\n const snapshot = resolveMarketSnapshot(context.moduleExports);\n return buildMarketContextBlock({\n snapshot,\n intent: { kind: 'feature', featureRef },\n outputLanguage,\n });\n },\n 'market-context-for-icp': (input, context) => {\n const { icpRef, outputLanguage } = parseMarketContextIcpRequest(input);\n const snapshot = resolveMarketSnapshot(context.moduleExports);\n return buildMarketContextBlock({\n snapshot,\n intent: { kind: 'icp', icpRef },\n outputLanguage,\n });\n },\n /**\n * Phase-4.2 market generation handler. Reuses the same snapshot\n * resolver as the two `market-context-*` handlers (so validation\n * runs once per snapshot identity, with shared WARN dedup) and\n * defers prompt assembly to the pure `renderMarketPrompt(...)`.\n */\n 'market-render-prompt': (input, context) => {\n const request = parseMarketRenderPromptRequest(input);\n const snapshot = resolveMarketSnapshot(context.moduleExports);\n return renderMarketPrompt({ snapshot, request });\n },\n /** @wildo_source:part:end companion.introspection.handlers.market */\n /**\n * Brand logo-generation prompt assembler. Resolves + validates the authored\n * `BrandSnapshot`, reads the optional market `tonesOfVoice` for visual-register\n * enrichment, and defers assembly to the pure `renderBrandPrompt(...)`. No\n * image call — the parent `LogoGenerationCompanionService` invokes the agent.\n */\n 'brand-render-prompt': (_input, context) => {\n const snapshot = resolveBrandSnapshot(context.moduleExports);\n const marketVoices = resolveOptionalMarketVoices(context.moduleExports);\n return renderBrandPrompt({ snapshot, marketVoices });\n },\n /**\n * Expert-persona derivation-inputs projector. Resolves the requested\n * shaping-input snapshots off the specifications companion exports and\n * reports what is missing (the parent derivation service fails closed) and\n * what this target cannot resolve (DESIGN_SYSTEM lives in the frontend\n * service — the parent composes it from `design-system-source-config`).\n * Raw snapshot reads, deliberately WITHOUT each family's validator —\n * derivation inputs are context material; validity enforcement belongs to\n * the families' own authoring flows.\n */\n 'expert-persona-derivation-inputs': (input, context) => {\n const { shapingInputKinds } = parseExpertPersonaDerivationInputsRequest(input);\n return resolveExpertPersonaDerivationInputs(context.moduleExports, shapingInputKinds);\n },\n /**\n * Committed expert-persona charters read-back — the app's\n * `expertPersonaCharters` companion export, `[]` when the app has none yet\n * (a first derivation must not fail on an empty app).\n */\n 'expert-persona-charters': (_input, context) => {\n return { charters: resolveExpertPersonaCharters(context.moduleExports) };\n },\n /**\n * Technical-doc OpenAPI generation input projector\n * (`saas-technical-doc.md` Step 3b). Defers all walking,\n * materialization, URL building, and `z.toJSONSchema()`\n * conversion to the dedicated `openapi-generation-input.behavior`\n * module so the dispatch table here stays a one-liner per\n * behavior. The parent companion service composes the\n * subprocess output with `WildoSaasConfig` metadata before\n * passing the payload to `generateOpenApiDocuments(...)`.\n */\n 'openapi-generation-input': async (input, context) => {\n // `context.moduleExports` is the `library` target — the shared\n // ResourcesRegistry (HTTP shape: paths / verbs / DTOs). The\n // `specifications` target (declared via requiredTargets) carries the\n // authored operation prose that enriches the generated OpenAPI\n // summary/description. Loaded by dynamic import of the resolved target,\n // mirroring the `resource-specifications` handler above.\n const specificationsTarget = context.request.resolvedTargets.specifications;\n const serviceTarget = context.request.resolvedTargets.service;\n if (!specificationsTarget) {\n throw new Error(\n 'openapi-generation-input requires the `specifications` companion target '\n + '(declared via requiredTargets) so authored operation specs can enrich the '\n + 'generated OpenAPI. Ensure a root-level `libraries.specifications` declaration '\n + 'exists in wildo.saas.config.ts.',\n );\n }\n if (!serviceTarget) {\n throw new Error(\n 'openapi-generation-input requires the backend `service` companion target '\n + '(declared via requiredTargets) so application startup capabilities can be projected exactly.',\n );\n }\n const specificationsModule = await import(\n pathToFileURL(specificationsTarget.entryPath).href\n ) as Record<string, unknown>;\n const { resourceSpecifications, roleSpecifications } = resolveSpecificationsCompanionExports(specificationsModule);\n const serviceModule = await import(pathToFileURL(serviceTarget.entryPath).href) as Record<string, unknown>;\n const backendCompanionExports = resolveBackendCompanionExports(serviceModule);\n if (typeof backendCompanionExports.buildApplicationInitializationConfig !== 'function') {\n throw new Error('The backend companion target does not expose buildApplicationInitializationConfig().');\n }\n const applicationInitializationConfig = backendCompanionExports.buildApplicationInitializationConfig();\n // `apiDocResources` opt-in (WildoTechnicalDocConfig) threaded by the parent\n // service via the behavior `input` — documents core engine resources too.\n const { apiDocResourceTypes, excludedCoreResourceTypes } = parseOpenApiGenerationInput(input);\n return runOpenApiGenerationInputBehavior(\n context.moduleExports,\n resourceSpecifications,\n apiDocResourceTypes,\n excludedCoreResourceTypes,\n roleSpecifications,\n {\n organizationUnitNarrowing: applicationInitializationConfig.organizationUnitNarrowing,\n flowActorSystemsFactoryMap: applicationInitializationConfig.flowsActorsRegistry?.flowActorSystemsFactoryMap,\n },\n );\n },\n /**\n * Assertion Surface behaviors (app-creation meta-workflows, master\n * plan S1). One-liner dispatch — real logic lives in\n * `assertions.behavior.ts`, which receives `context.moduleExports`\n * (the `specifications` target carrying `assertionSpecifications`) and\n * `context.request.resolvedTargets` (the `library` target for live\n * derivation), avoiding a subprocess-lane import cycle back through\n * this handlers module (the `openapi-generation-input` precedent).\n */\n 'assertions-list': (input, context) => runAssertionsList(input, context.moduleExports),\n 'assertions-resolve': (input, context) =>\n runAssertionsResolve(input, context.moduleExports, context.request.resolvedTargets),\n 'assertions-reconcile': (input, context) =>\n runAssertionsReconcile(input, context.moduleExports, context.request.resolvedTargets),\n 'definition-specifications': (input, context) =>\n runDefinitionSpecifications(input, context.moduleExports),\n};\n\n/**\n * One-time WARN-deduplication set, keyed by snapshot identity.\n *\n * The dev-companion subprocess is short-lived (one process per\n * behavior call), but the same handler instance can be invoked\n * multiple times in tests and in long-running smoke runs. Without\n * this gate we would re-log every WARN every call, drowning real\n * authoring drift. ERROR severity always throws — no dedup needed.\n */\nconst VALIDATED_SNAPSHOTS = new WeakSet<MarketSnapshot>();\n\n/**\n * Resolves the application's authored `MarketSnapshot` from the\n * specifications companion exports and **runs `validateMarketSnapshot`\n * before handing the snapshot to the pure builder**.\n *\n * The contract on `buildMarketContextBlock(...)` is \"Caller is\n * responsible for running `validateMarketSnapshot` first\" — this\n * resolver is that caller. ERROR-severity issues throw a structured\n * error listing every issue (the market generation CLI surfaces it\n * verbatim); WARN-severity issues are logged once per snapshot\n * identity through `console.warn` (the companion subprocess has no\n * logger DI surface today — a follow-up workstream replaces this with\n * the standard companion logger when one lands).\n *\n * No cross-family ref sets are passed to `validateMarketSnapshot`\n * because the dev-companion does not have access to the application's\n * full feature-spec / product registry at this layer (those live in\n * the backend container). The intra-snapshot rules — including the\n * Phase-4 `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH` — still fire and\n * cover every author-controlled drift mode for market spec authoring.\n */\nfunction resolveMarketSnapshot(moduleExports: Record<string, unknown>): MarketSnapshot {\n const { marketSpecification } = resolveSpecificationsCompanionExports(moduleExports);\n if (!marketSpecification) {\n throw new Error(\n 'Market context behaviors require the specifications package to export `marketSpecification` '\n + '(an authored MarketSnapshot). Author one in `specifications/src/market/` and re-export it '\n + 'from `companion-exports.ts`.',\n );\n }\n\n if (VALIDATED_SNAPSHOTS.has(marketSpecification)) return marketSpecification;\n\n const result = validateMarketSnapshot(marketSpecification);\n const errorIssues = result.issues.filter(i => i.severity === 'ERROR');\n if (errorIssues.length > 0) {\n const lines = errorIssues\n .map(i => ` - [${i.kind}] ${i.path}: ${i.message}`)\n .join('\\n');\n throw new Error(\n `Authored MarketSnapshot fails ${errorIssues.length} ERROR-severity validator rule(s). `\n + `The market-context behaviors refuse to render against an invalid snapshot:\\n${lines}`,\n );\n }\n\n const warnIssues = result.issues.filter(i => i.severity === 'WARN');\n if (warnIssues.length > 0) {\n for (const issue of warnIssues) {\n console.warn(\n `[market-snapshot] ${issue.kind} at ${issue.path}: ${issue.message}`,\n );\n }\n }\n\n VALIDATED_SNAPSHOTS.add(marketSpecification);\n return marketSpecification;\n}\n\n/** One-time WARN-dedup for brand snapshots (mirror of `VALIDATED_SNAPSHOTS`). */\nconst VALIDATED_BRAND_SNAPSHOTS = new WeakSet<BrandSnapshot>();\n\n/**\n * Resolves the application's authored `BrandSnapshot` from the specifications\n * companion exports and runs `validateBrandSnapshot` before handing it to the\n * pure prompt renderer (mirror of `resolveMarketSnapshot`). ERROR-severity\n * issues throw a structured error; WARN-severity issues log once per snapshot\n * identity. A directed-but-ungenerated brand only WARNs — that is exactly the\n * state the logo step consumes.\n */\nfunction resolveBrandSnapshot(moduleExports: Record<string, unknown>): BrandSnapshot {\n const { brandSpecification } = resolveSpecificationsCompanionExports(moduleExports);\n if (!brandSpecification) {\n throw new Error(\n 'The brand-render-prompt behavior requires the specifications package to export '\n + '`brandSpecification` (an authored BrandSnapshot). Author one in `specifications/src/brand/` '\n + 'and wire it into `companion-exports.ts`.',\n );\n }\n\n if (VALIDATED_BRAND_SNAPSHOTS.has(brandSpecification)) return brandSpecification;\n\n const result = validateBrandSnapshot(brandSpecification);\n const errorIssues = result.issues.filter(i => i.severity === 'error');\n if (errorIssues.length > 0) {\n const lines = errorIssues.map(i => ` - [${i.kind}] ${i.path}: ${i.message}`).join('\\n');\n throw new Error(\n `Authored BrandSnapshot fails ${errorIssues.length} ERROR-severity validator rule(s). `\n + `The brand-render-prompt behavior refuses to render against an invalid snapshot:\\n${lines}`,\n );\n }\n\n for (const issue of result.issues.filter(i => i.severity === 'warn')) {\n console.warn(`[brand-snapshot] ${issue.kind} at ${issue.path}: ${issue.message}`);\n }\n\n VALIDATED_BRAND_SNAPSHOTS.add(brandSpecification);\n return brandSpecification;\n}\n\n/**\n * Reads the optional market `tonesOfVoice` for visual-register enrichment.\n * Brand generation does NOT require a market snapshot — returns `[]` when\n * absent (the renderer degrades gracefully to the visual tone alone).\n */\nfunction resolveOptionalMarketVoices(moduleExports: Record<string, unknown>): ToneOfVoiceConfig[] {\n const { marketSpecification } = resolveSpecificationsCompanionExports(moduleExports);\n return marketSpecification?.tonesOfVoice ?? [];\n}\n\n/** Parse + fail-closed-validate the derivation-inputs request payload. */\nfunction parseExpertPersonaDerivationInputsRequest(input: unknown): {\n shapingInputKinds: ExpertShapingInputKind[];\n} {\n if (!isPlainObject(input)) {\n throw new Error('expert-persona-derivation-inputs payload must be an object.');\n }\n const raw = input['shapingInputKinds'];\n if (!Array.isArray(raw) || raw.length === 0) {\n throw new Error('expert-persona-derivation-inputs requires a non-empty `shapingInputKinds` string array.');\n }\n const known = new Set<string>(Object.values(ExpertShapingInputKind));\n const unknown = raw.filter((kind) => typeof kind !== 'string' || !known.has(kind));\n if (unknown.length > 0) {\n throw new Error(\n `expert-persona-derivation-inputs received unknown shaping-input kind(s) [${unknown.join(', ')}]. `\n + `Valid: [${[...known].join(', ')}].`,\n );\n }\n return { shapingInputKinds: raw as ExpertShapingInputKind[] };\n}\n\n/**\n * Resolve the requested shaping inputs off the specifications companion\n * exports and render each present one to its CURATED MARKDOWN BRIEF\n * (`expert-persona-brief.renderer.ts`) — the model is grounded on rendered\n * MEANING, never raw JSON dumps (derivation-quality rework, Lever 2). Per\n * kind:\n * - a resolvable, PRESENT export lands in `briefs` (curated markdown);\n * - a resolvable but ABSENT export lands in `missingKinds` (the parent\n * derivation service fails closed: a persona derived from missing inputs\n * is an incomplete persona);\n * - `DESIGN_SYSTEM` lands in `parentComposedKinds` — it lives in the\n * frontend service, unreachable from this specifications target; the\n * parent composes+renders it from the `design-system-source-config`\n * behavior.\n * - `ACCEPTED_DECISIONS` renders the brand snapshot's `resolvedAssets`\n * (the promoted brand assets) — an EMPTY array is a legitimate \"nothing\n * accepted yet\" state, never a missing kind.\n */\nfunction resolveExpertPersonaDerivationInputs(\n moduleExports: Record<string, unknown>,\n shapingInputKinds: ExpertShapingInputKind[],\n): {\n briefs: Partial<Record<ExpertShapingInputKind, string>>;\n missingKinds: ExpertShapingInputKind[];\n parentComposedKinds: ExpertShapingInputKind[];\n} {\n const exports = resolveSpecificationsCompanionExports(moduleExports);\n const sources: ExpertPersonaBriefSources = {};\n const missingKinds: ExpertShapingInputKind[] = [];\n const parentComposedKinds: ExpertShapingInputKind[] = [];\n\n for (const kind of shapingInputKinds) {\n switch (kind) {\n case ExpertShapingInputKind.VISION:\n if (exports.visionSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.visionSpecification;\n break;\n case ExpertShapingInputKind.MARKET:\n if (exports.marketSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.marketSpecification;\n break;\n case ExpertShapingInputKind.BRAND:\n if (exports.brandSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.brandSpecification;\n break;\n case ExpertShapingInputKind.REQUIREMENTS:\n if (exports.requirementsSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.requirementsSpecification;\n break;\n case ExpertShapingInputKind.BUSINESS_MODEL:\n if (exports.businessModelLiteSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.businessModelLiteSpecification;\n break;\n case ExpertShapingInputKind.ACCEPTED_DECISIONS:\n sources[kind] = exports.brandSpecification?.resolvedAssets ?? [];\n break;\n case ExpertShapingInputKind.DESIGN_SYSTEM:\n parentComposedKinds.push(kind);\n break;\n }\n }\n\n return { briefs: renderShapingInputBriefs(sources), missingKinds, parentComposedKinds };\n}\n\n/**\n * Committed charters read-back — `[]` when the app has not wired (or not yet\n * accepted) any charter. No validator here: the accept step runs\n * `validateExpertPersonaCharters` where the current-inputs digests are\n * computable (parent side).\n */\nfunction resolveExpertPersonaCharters(moduleExports: Record<string, unknown>): ExpertPersonaCharter[] {\n const { expertPersonaCharters } = resolveSpecificationsCompanionExports(moduleExports);\n return expertPersonaCharters ?? [];\n}\n\nfunction parseMarketContextFeatureRequest(input: unknown): {\n featureRef: string;\n outputLanguage: string | undefined;\n} {\n if (!isPlainObject(input)) {\n throw new Error('market-context-for-feature payload must be an object.');\n }\n const featureRef = input['featureRef'];\n if (typeof featureRef !== 'string' || featureRef.length === 0) {\n throw new Error('market-context-for-feature payload requires a non-empty `featureRef` string.');\n }\n const outputLanguageValue = input['outputLanguage'];\n if (outputLanguageValue !== undefined && typeof outputLanguageValue !== 'string') {\n throw new Error('market-context-for-feature `outputLanguage` must be a string when provided.');\n }\n const outputLanguage = typeof outputLanguageValue === 'string' && outputLanguageValue.length > 0\n ? outputLanguageValue\n : undefined;\n return { featureRef, outputLanguage };\n}\n\nfunction parseCatalogContextFactoryRequest(input: unknown): {\n vocabulary: CatalogContextVocabulary.SCHEMA_ORG;\n entryType: string;\n} {\n if (!input || typeof input !== 'object') {\n throw new Error('catalog-context-parts payload must be an object.');\n }\n const vocabulary = (input as { vocabulary?: unknown }).vocabulary;\n if (vocabulary !== CatalogContextVocabulary.SCHEMA_ORG) {\n throw new Error(\n `catalog-context-parts payload requires vocabulary \"${CatalogContextVocabulary.SCHEMA_ORG}\".`,\n );\n }\n const entryType = (input as { entryType?: unknown }).entryType;\n if (typeof entryType !== 'string' || entryType.trim().length === 0) {\n throw new Error('catalog-context-parts payload requires a non-empty `entryType` string.');\n }\n return {\n vocabulary,\n entryType: entryType.trim(),\n };\n}\n\nfunction findCatalogEntryByTypeLastWins<TEntry extends { '@type': string }>(\n catalog: readonly TEntry[],\n entryType: string,\n): TEntry | undefined {\n for (let index = catalog.length - 1; index >= 0; index -= 1) {\n const candidate = catalog[index];\n if (candidate?.['@type'] === entryType) {\n return candidate;\n }\n }\n return undefined;\n}\n\nfunction parseMarketContextIcpRequest(input: unknown): {\n icpRef: string;\n outputLanguage: string | undefined;\n} {\n if (!isPlainObject(input)) {\n throw new Error('market-context-for-icp payload must be an object.');\n }\n const icpRef = input['icpRef'];\n if (typeof icpRef !== 'string' || icpRef.length === 0) {\n throw new Error('market-context-for-icp payload requires a non-empty `icpRef` string.');\n }\n const outputLanguageValue = input['outputLanguage'];\n if (outputLanguageValue !== undefined && typeof outputLanguageValue !== 'string') {\n throw new Error('market-context-for-icp `outputLanguage` must be a string when provided.');\n }\n const outputLanguage = typeof outputLanguageValue === 'string' && outputLanguageValue.length > 0\n ? outputLanguageValue\n : undefined;\n return { icpRef, outputLanguage };\n}\n\nfunction parseMarketRenderPromptRequest(input: unknown): MarketPromptRequest {\n if (!isPlainObject(input)) {\n throw new Error('market-render-prompt payload must be an object.');\n }\n const templateRef = input['templateRef'];\n if (typeof templateRef !== 'string' || templateRef.length === 0) {\n throw new Error('market-render-prompt payload requires a non-empty `templateRef` string.');\n }\n\n const optionalString = (key: string): string | undefined => {\n const value = input[key];\n if (value === undefined) return undefined;\n if (typeof value !== 'string') {\n throw new Error(`market-render-prompt \\`${key}\\` must be a string when provided.`);\n }\n return value.length > 0 ? value : undefined;\n };\n\n return {\n templateRef,\n icpRef: optionalString('icpRef'),\n featureRef: optionalString('featureRef'),\n benefitRef: optionalString('benefitRef'),\n channelRef: optionalString('channelRef'),\n objectionRef: optionalString('objectionRef'),\n outputLanguage: optionalString('outputLanguage'),\n };\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Parse the `apiDocResources` opt-in carried on the `openapi-generation-input`\n * behavior `input` (threaded from `WildoTechnicalDocConfig.apiDocResources` by\n * the parent {@link TechnicalDocCompanionService}). Returns `'all'`, a string\n * array of `CoreResourceType` values, or `undefined` (no core resources). The\n * value crosses the subprocess IPC boundary as plain JSON, so this re-validates\n * defensively rather than trusting the shape.\n */\nexport function parseOpenApiGenerationInput(input: unknown): {\n apiDocResourceTypes?: readonly string[] | 'all';\n excludedCoreResourceTypes?: readonly CoreResourceType[];\n} {\n if (input === undefined) return {};\n if (!isPlainObject(input)) {\n throw new Error('openapi-generation-input `input` must be an object when provided.');\n }\n\n const result: {\n apiDocResourceTypes?: readonly string[] | 'all';\n excludedCoreResourceTypes?: readonly CoreResourceType[];\n } = {};\n const apiDocResources = input.apiDocResources;\n if (apiDocResources !== undefined) {\n if (apiDocResources === 'all') {\n result.apiDocResourceTypes = 'all';\n } else if (\n Array.isArray(apiDocResources)\n && apiDocResources.every((entry) => typeof entry === 'string' && Object.values(CoreResourceType).includes(entry as CoreResourceType))\n ) {\n result.apiDocResourceTypes = apiDocResources;\n } else {\n throw new Error('openapi-generation-input `apiDocResources` must be `all` or contain only CoreResourceType values.');\n }\n }\n\n const excludedCoreResources = input.excludedCoreResourceTypes;\n if (excludedCoreResources !== undefined) {\n const coreResourceTypes = new Set<string>(Object.values(CoreResourceType));\n if (\n !Array.isArray(excludedCoreResources)\n || !excludedCoreResources.every((entry) => typeof entry === 'string' && coreResourceTypes.has(entry))\n ) {\n throw new Error('openapi-generation-input `excludedCoreResourceTypes` must contain only CoreResourceType values.');\n }\n result.excludedCoreResourceTypes = [...new Set(excludedCoreResources as CoreResourceType[])].sort();\n }\n\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"companion-introspection-behavior-handlers.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/companion-introspection-behavior-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,uCAAuC,EAAE,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EACL,wCAAwC,EACxC,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,EAClC,0CAA0C,EAC1C,6CAA6C,EAC7C,8BAA8B,EAC9B,gBAAgB,EAChB,qBAAqB,GAGtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EACL,6CAA6C,EAC7C,sBAAsB,EACtB,6BAA6B,EAC7B,yBAAyB,EACzB,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,GAMvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uCAAuC,EACvC,8BAA8B,GAC/B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAA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C;IAC9D,IAAI,qBAAqB,KAAK,SAAS,EAAE,CAAC;QACxC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC3E,IACE,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAC;eAClC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACrG,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,iGAAiG,CAAC,CAAC;QACrH,CAAC;QACD,MAAM,CAAC,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,qBAA2C,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACtG,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { basename, relative } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type { z } from 'zod';\nimport { generateDesignTokensCssFromSourceConfig } from '@wildo-ai/presets-components-models';\nimport {\n backendResourcesConfigurationsFactoryMap,\n backendResourcesRelationships,\n BackendResourceFieldIdentifier,\n} from '@wildo-ai/saas-backend-lib/backend-resource-registry';\nimport {\n buildSharedSaaSModulesRegistry,\n coreResourceShared_FieldIdentifier,\n coreResourceShared_FieldIdentifierPriority,\n coreShared_ResourcesConfigurations_FactoryMap,\n coreSharedResourceRelationship,\n CoreResourceType,\n Resources_SharedUtils,\n type ResourceConfiguration,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { CompanionArtifactClass } from '@wildo-ai/saas-models/companion';\nimport { getCustomFieldMetadata, getZodObjectShape } from '@wildo-ai/zod-decorators';\nimport {\n assertResourceSpecificationsAlignWithRegistry,\n ExpertShapingInputKind,\n extractFieldSpecsFromFieldMap,\n extractResourceFieldSpecs,\n engineResourceSpecificationsByType,\n validateBrandSnapshot,\n validateMarketSnapshot,\n type AnyResourceSpecificationConfig,\n type BrandSnapshot,\n type ExpertPersonaCharter,\n type MarketSnapshot,\n type ToneOfVoiceConfig,\n} from '@wildo-ai/saas-specifications';\nimport {\n parseSpecificationContextFactoryRequest,\n renderSpecificationContextPart,\n} from '../../specifications/specification-context-factory';\nimport { renderCatalogEntryContextPart } from '../../catalogs/catalog-context.factory';\nimport { CatalogContextVocabulary } from '../../catalogs/catalog-context.factory.models';\nimport {\n resolveBackendCompanionExports,\n resolveDesignSystemSourceConfig,\n resolveFrontendCompanionExports,\n resolveSharedLibraryCompanionExports,\n resolveSpecificationsCompanionExports,\n} from './companion-introspection-module-exports.utils';\nimport { runFrontendLabelsNeededInfo } from './frontend-labels-needed-info.behavior';\nimport {\n findUnknownDestinationRefs,\n resolveSettingsHubConfig,\n verifySettingsHubContent,\n} from '@wildo-ai/saas-frontend-lib';\nimport { runChartRegistrationRefs } from './chart-registration-refs.behavior';\nimport { buildMarketContextBlock } from './market-context-block.builder';\nimport { runOpenApiGenerationInputBehavior } from './openapi-generation-input.behavior';\nimport { renderMarketPrompt, type MarketPromptRequest } from './market-prompt-renderer';\nimport { renderBrandPrompt } from './brand-prompt-renderer';\nimport { renderShapingInputBriefs, type ExpertPersonaBriefSources } from './expert-persona-brief.renderer';\nimport {\n runAssertionsList,\n runAssertionsReconcile,\n runAssertionsResolve,\n} from './assertions.behavior';\nimport { runDefinitionSpecifications } from './definition-specifications.behavior';\nimport { projectSpecificationArtifacts } from './specification-artifacts.behavior';\nimport { projectFamilyAspects } from './family-aspects.behavior';\nimport {\n projectApplicationDomainModel,\n type DomainModelFieldRow,\n type DomainModelOperationRow,\n type DomainModelRelationshipInput,\n} from './application-domain-model.behavior';\nimport {\n asComplianceRelevantConfiguration,\n CompliancePrimaryFactOrigin,\n projectCompliancePrimaryFacts,\n} from './compliance-primary-facts.behavior';\nimport type {\n CompanionIntrospectionBehaviorId,\n CompanionIntrospectionChildRequest,\n CompanionIntrospectionResolvedBehaviorDefinition,\n} from '../models/companion-introspection.models';\n\n\n/**\n * Every engine-owned resource-configuration factory THE BACKEND RUNTIME ACTUALLY MERGES.\n *\n * `resources-registry.backend.service.ts` merges TWO maps at init: the core shared map from\n * `@wildo-ai/saas-models` and the backend map from `@wildo-ai/saas-backend-lib`. Completing the registry\n * side of a pairing with only the first observes half the population, and the half it misses is invisible\n * rather than noisy: on 2026-08-22 that made every `BackendResourceType` carrying an authored\n * specification a spec-orphan by construction, and the whole `resource-specifications` introspection failed\n * on `dataSeedRuns` — the first backend resource to be given a spec.\n *\n * This exists as ONE function because the completion happens at two call sites in this file, and the\n * previous defect was precisely that a population was enumerated correctly at neither. A third map added\n * to the runtime merge must be added here once, not twice.\n */\nfunction engineResourceConfigurationFactoryEntries(): ReadonlyArray<readonly [string, unknown]> {\n return [\n ...Object.entries(coreShared_ResourcesConfigurations_FactoryMap),\n ...Object.entries(backendResourcesConfigurationsFactoryMap),\n ];\n}\n\n/**\n * The relationship set an ENGINE resource-configuration factory must be materialized against.\n *\n * An engine factory buckets its own parent/child edges out of whatever array it is handed, so calling\n * one with the APPLICATION's relationship slice alone produces a configuration whose engine edges have\n * silently vanished — a materialization that succeeds and is wrong. The backend runtime never does\n * that: `resources-registry.backend.service.ts` compiles app + core-shared + core-backend edges\n * together, against the merged field identifiers, before it calls any factory.\n *\n * This exists as ONE function for the same reason {@link engineResourceConfigurationFactoryEntries}\n * does: three call sites in this file now complete the app registry with the engine population, and\n * three hand-written copies of a merge convention are three things that can disagree — invisibly,\n * because each site's own pins would still pass. A fourth relationship source added to the runtime\n * merge is added here once.\n */\nfunction engineMergedCompiledResourceRelationships(\n applicationResourceRelationships: readonly unknown[] | undefined,\n applicationResourceFieldIdentifiers: Record<string, string> | undefined,\n): ReturnType<typeof Resources_SharedUtils.ensureCompiledRelationships> {\n return Resources_SharedUtils.ensureCompiledRelationships(\n [\n ...(applicationResourceRelationships ?? []),\n ...coreSharedResourceRelationship,\n ...backendResourcesRelationships,\n ] as Parameters<typeof Resources_SharedUtils.ensureCompiledRelationships>[0],\n {\n ...(applicationResourceFieldIdentifiers ?? {}),\n ...coreResourceShared_FieldIdentifier,\n ...BackendResourceFieldIdentifier,\n },\n );\n}\n\nexport interface CompanionIntrospectionBehaviorRuntimeContext {\n request: CompanionIntrospectionChildRequest;\n behavior: CompanionIntrospectionResolvedBehaviorDefinition;\n moduleExports: Record<string, unknown>;\n}\n\nexport type CompanionIntrospectionBehaviorHandler = (\n input: unknown,\n context: CompanionIntrospectionBehaviorRuntimeContext,\n) => unknown | Promise<unknown>;\n\nfunction materializeResourceSpecificationOverlay(\n resourceSpecOverlay: AnyResourceSpecificationConfig | undefined,\n): Record<string, unknown> | null {\n if (!resourceSpecOverlay) {\n return null;\n }\n\n return {\n purpose: resourceSpecOverlay.purpose,\n businessRole: resourceSpecOverlay.businessRole,\n lifecycleRole: resourceSpecOverlay.lifecycleRole,\n codeHandling: resourceSpecOverlay.codeHandling,\n businessConstraints: resourceSpecOverlay.businessConstraints,\n operations: resourceSpecOverlay.operations,\n frontend: resourceSpecOverlay.frontend,\n };\n}\n\n/**\n * Module keys that IDENTIFY a module rather than describe what it contributes.\n *\n * Named rather than inlined so the contribution derivation below stays a RULE: a new identity field\n * is added here once, and a new CONTRIBUTION field needs no change at all — which is the whole point\n * of deriving contributions from the module's own keys.\n */\nconst MODULE_IDENTITY_KEYS: ReadonlySet<string> = new Set(['moduleId', 'kind']);\n\nexport const COMPANION_INTROSPECTION_BUILTIN_BEHAVIOR_HANDLERS: Partial<\n Record<CompanionIntrospectionBehaviorId, CompanionIntrospectionBehaviorHandler>\n> = {\n /*\n * Compliance facts, derived rather than elicited.\n *\n * Materializes exactly as `resources-registry` does — `factory(allRelationships)`, the way both\n * runtime registries do — and classifies each resource by ORIGIN using the same engine factory\n * population that helper owns. Reusing `engineResourceConfigurationFactoryEntries()` is not tidiness:\n * that function exists because the runtime merges TWO engine maps and a caller enumerating one of\n * them observes half the population invisibly. Here the consequence would be a privacy notice\n * crediting the application with declarations the ENGINE made, or the reverse.\n */\n 'compliance-primary-facts': async (_input, context) => {\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n const engineResourceTypes = new Set(engineResourceConfigurationFactoryEntries().map(([resourceType]) => resourceType));\n\n const entries: {\n resourceType: string;\n origin: CompliancePrimaryFactOrigin;\n configuration: ReturnType<typeof asComplianceRelevantConfiguration>;\n }[] = [];\n const unmaterializableResourceTypes: string[] = [];\n\n /*\n * Materialize one factory into the projection's narrow slice, naming it rather than dropping it\n * when it throws.\n *\n * A factory that cannot materialize is its own (loud) defect elsewhere — the same policy\n * `resources-registry` takes. It is NAMED rather than skipped: a resource silently missing from\n * this projection would make a document under-report what the application holds, which is the one\n * direction a compliance statement must never fail in. Note the two sibling handlers below\n * deliberately let an engine factory throw escape; this one cannot, because a single broken engine\n * factory would then take the whole compliance projection with it — and reporting nothing is worse\n * here than reporting a named hole.\n */\n const collect = (resourceType: string, factory: unknown, relationships: unknown): void => {\n if (typeof factory !== 'function') {\n return;\n }\n // Typed at the narrow compliance slice rather than at `ResourceConfiguration`, which is generic\n // in three parameters this projection has no opinion about. The slice's own field types come\n // from `saas-models`, so a rename there still breaks the build.\n let configuration: Parameters<typeof asComplianceRelevantConfiguration>[0];\n try {\n configuration = (factory as (rels: unknown) => Parameters<typeof asComplianceRelevantConfiguration>[0])(\n relationships,\n );\n } catch {\n unmaterializableResourceTypes.push(resourceType);\n return;\n }\n entries.push({\n resourceType,\n origin: engineResourceTypes.has(resourceType)\n ? CompliancePrimaryFactOrigin.ENGINE\n : CompliancePrimaryFactOrigin.APPLICATION,\n configuration: asComplianceRelevantConfiguration(configuration),\n });\n };\n\n for (const [resourceType, factory] of Object.entries(sharedRegistry.resourceConfigurations)) {\n collect(resourceType, factory, sharedRegistry.resourceRelationships);\n }\n\n /*\n * COMPLETE THE POPULATION WITH THE ENGINE'S OWN RESOURCES — without this the origin split is inert.\n *\n * `loadSharedModules()` returns the APPLICATION's modules, so `sharedRegistry.resourceConfigurations`\n * carries the app's resources and nothing else. Classifying that slice by engine-key membership can\n * therefore only ever answer APPLICATION: measured live against wonder-crm on 2026-08-29, the ENGINE\n * column read `resources 0` on an application that inherits ~80 engine resources. The branch read as\n * capability and could not execute — and the unit tests could not see it, because they hand the\n * projection both origins directly.\n *\n * That silence is the expensive direction. The whole point of the split is that a produced privacy\n * notice can say \"this much came free, this much is yours to declare\"; an ENGINE column of zero says\n * the framework answers nothing, which is false and unfalsifiable from the document.\n *\n * Symmetric with the `resource-specifications` and `resource-render-inputs` handlers below: the\n * engine factories are materialized against the CORE-MERGED compiled relationships (an engine factory\n * handed the app-only slice loses its own edges), and an app registration always wins over a\n * same-keyed core entry — so this loop adds engine resources the app did not re-register, and never\n * overwrites what the app declared.\n */\n const coreCompiledRelationships = engineMergedCompiledResourceRelationships(\n sharedRegistry.resourceRelationships,\n sharedRegistry.resourceFieldIdentifiers,\n );\n for (const [resourceType, factory] of engineResourceConfigurationFactoryEntries()) {\n if (Object.prototype.hasOwnProperty.call(sharedRegistry.resourceConfigurations, resourceType)) {\n continue;\n }\n collect(resourceType, factory, coreCompiledRelationships);\n }\n\n return { ...projectCompliancePrimaryFacts(entries), unmaterializableResourceTypes };\n },\n\n /*\n * The application's domain model, in ONE derivation.\n *\n * Mirrors `resource-specifications` exactly on the two things that matter: it resolves the shared\n * library from `resolvedTargets.library` and the spec overlay from `context.moduleExports` (the\n * specifications target), so nodes, edges, ownership and specification prose all come from the same\n * import of the same working tree. That is the property the workbench graph needs and the reason\n * this is not assembled from the two behaviors that answer half of it each.\n *\n * Two deliberate divergences from `resource-specifications`, each of which would be a defect if\n * copied without thinking:\n *\n * - **the alignment guard is NOT run.** `assertResourceSpecificationsAlignWithRegistry` THROWS on\n * a spec-orphan or a scope disagreement, which is right for the behavior that IS the pairing and\n * wrong for a read surface: a workbench that refuses to draw the application because one\n * specification is misaligned hides the very structure an operator opened it to inspect. The\n * guard still fires on its own behavior, so nothing stops reporting it.\n * - **a factory that cannot materialize is SKIPPED, not fatal.** Same policy as `resources-registry`\n * beside it: the node still appears with no detail, because a resource missing from the picture\n * is worse than a resource shown thinly.\n *\n * A THIRD divergence used to be listed here and is retired: \"no per-field spec extraction —\n * `extractResourceFieldSpecs` is what makes the sibling expensive, and a domain-model panel reads\n * field NAMES, not field specs\". The premise was right and the conclusion aged badly. A name\n * answers \"does this field exist\", which the node already implies by counting them; a reader\n * opening a resource wants what the field IS. The cost was then MEASURED rather than assumed —\n * 715 fields across the 82 engine resources extract to 264 KB — which is a fraction of what the\n * relationship edges already cost, so the reason to withhold it was gone.\n */\n 'application-domain-model': async (_input, context) => {\n const libraryTarget = context.request.resolvedTargets.library;\n if (!libraryTarget) {\n throw new Error(\n 'application-domain-model requires a root-level `libraries.shared` declaration in wildo.saas.config.ts.',\n );\n }\n\n const sharedCompanionModule = await import(pathToFileURL(libraryTarget.entryPath).href) as Record<string, unknown>;\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(sharedCompanionModule);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n const applicationRelationships = (sharedRegistry.resourceRelationships ?? []) as unknown as DomainModelRelationshipInput[];\n\n /*\n * Field names per node, materialized once.\n *\n * The application's own factories are materialized against the app's relationship slice, exactly\n * as both runtime registries do. The BOUNDARY types — engine resources the application's own\n * edges reach — are materialized against the CORE-MERGED relationships instead: an engine factory\n * buckets its own parent/child edges out of whatever array it is handed, so handing it the\n * app-only slice produces a configuration whose engine edges have silently vanished.\n */\n const fieldsByResourceType: Record<string, DomainModelFieldRow[]> = {};\n const operationsByResourceType: Record<string, DomainModelOperationRow[]> = {};\n const advancedByResourceType: Record<string, Record<string, unknown>> = {};\n\n /**\n * The `ResourceConfiguration` keys that describe HOW a resource behaves rather than what it holds.\n *\n * A DENY list over the configuration's own keys, not an allow list, and that is the whole design:\n * `ResourceConfiguration` has grown several of these fields in as many months, and an allow list\n * reports the subset its author knew about — so a policy added tomorrow would be invisible with\n * nothing to say so. What is excluded is only what belongs to another section of the panel\n * (schemas, relationships, operations) or is a function.\n */\n /**\n * The operation keys that are SCHEMAS, and are therefore never projected.\n *\n * Six DTOs plus the resource's own main schema and relationship set. Each serializes to tens of\n * kilobytes; together they would put megabytes on the wire to say which verbs exist.\n */\n const OPERATION_SCHEMA_KEYS = new Set([\n 'mainSchema',\n 'inheritenceSchemaDefinition',\n 'resourceRelationships',\n 'requestDto',\n 'responseDto',\n 'summaryDto',\n 'contextDto',\n 'internalDto',\n 'repositoryDto',\n ]);\n\n const NON_ADVANCED_CONFIGURATION_KEYS = new Set([\n 'mainSchema',\n 'inheritenceSchemaDefinition',\n 'resourceRelationships',\n 'operations',\n 'coreOperations',\n 'customOperation',\n ]);\n\n const collectResourceDetail = (\n resourceType: string,\n factoryOrConfig: unknown,\n relationships: unknown,\n ): void => {\n try {\n /*\n * A registry entry may be a FACTORY or an already-materialized configuration — the sibling\n * `resource-specifications` handler below handles both, and this one must too. Not for the\n * field list, which would merely be empty: the key's PRESENCE is what the unowned set is\n * computed from, so an entry skipped here would be classified as an engine resource this\n * application references, and then looked for among engine factories where it does not exist.\n */\n const configuration = typeof factoryOrConfig === 'function'\n ? (factoryOrConfig as (rels: unknown) => Record<string, unknown>)(relationships)\n : factoryOrConfig as Record<string, unknown> | undefined;\n\n /*\n * The SAME extractor the `resource-specifications` behavior uses, against the same registry\n * context — so a field's derived facts (its foreign-key target above all) are one answer and\n * not two readings of the same decorators that can disagree.\n */\n const mainSchema = configuration?.mainSchema as z.ZodTypeAny | undefined;\n const extracted = mainSchema\n ? extractResourceFieldSpecs(\n mainSchema,\n configuration?.inheritenceSchemaDefinition as never,\n { currentResourceType: resourceType, relationships: relationships as never },\n )\n : [];\n /*\n * The field's own decorator record, beside the extractor's interpretation of it. `derived`\n * answers what the framework CONCLUDED (kind, primitive, foreign-key target); this is what\n * the schema DECLARED, and it carries the eight structural decorators the interpretation\n * drops — `isSummaryField`, `isHidden`, `excludeFromCreate`/`Update`, `dataCategories`, and\n * the index/unique/primary-key trio.\n */\n const schemaShape = mainSchema\n ? (getZodObjectShape(mainSchema) ?? {}) as Record<string, z.ZodTypeAny>\n : {};\n fieldsByResourceType[resourceType] = extracted.map((spec) => ({\n fieldName: spec.fieldName,\n specDecorator: spec.specDecorator ?? null,\n params: (spec.params ?? null) as Record<string, unknown> | null,\n derived: (spec.derived ?? null) as Record<string, unknown> | null,\n origin: (spec.origin ?? null) as Record<string, unknown> | null,\n metadata: schemaShape[spec.fieldName]\n ? (getCustomFieldMetadata(schemaShape[spec.fieldName]) ?? null) as Record<string, unknown> | null\n : null,\n }));\n\n /*\n * Operations are projected FIELD BY FIELD rather than spread, because a materialized operation\n * carries six Zod schemas — request, response, summary, context, internal and repository DTOs\n * — each of which serializes to tens of kilobytes. Spreading them would put megabytes on the\n * wire to say which verbs exist.\n */\n const operations = (configuration?.operations ?? []) as Record<string, unknown>[];\n operationsByResourceType[resourceType] = operations.map((operation) => {\n /*\n * Everything the operation declares that is not a SCHEMA, by deny list — the third such\n * list in this handler and the one that proved the argument. A hand-picked set of twelve\n * fields shipped without `variantKey`, `httpVerb`, `isBulkOperation` or `serviceRuntimeMode`,\n * and `variantKey` is not detail: it is half of an operation's IDENTITY.\n */\n const attributes: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(operation)) {\n if (OPERATION_SCHEMA_KEYS.has(key)) continue;\n if (typeof value === 'function' || value === undefined) continue;\n attributes[key] = value;\n }\n\n const operationIdentifier = String(operation.operationIdentifier ?? '');\n return {\n operationIdentifier,\n variantType: operation.variantType === undefined ? null : String(operation.variantType),\n variantKey: operation.variantKey === undefined || operation.variantKey === null\n ? null\n : String(operation.variantKey),\n resourceOperationLike: operation.resourceOperationLike === undefined\n || operation.resourceOperationLike === null\n ? null\n : String(operation.resourceOperationLike),\n isDefault: operation.isDefault === true || operation.isOperationDefault === true,\n roles: Array.isArray(operation.roles) ? operation.roles.map(String) : [],\n riskLevel: operation.riskLevel === undefined ? null : String(operation.riskLevel),\n isUnimplemented: operation.unimplementedAcknowledgement !== undefined\n && operation.unimplementedAcknowledgement !== null,\n isDisabled: operation.isDisabled === true,\n requiresStepUpAuthentication: operation.requiresStepUpAuthentication === true,\n admitsCrossTenantPlatformAdministration:\n operation.admitsCrossTenantPlatformAdministration === true,\n auditableEventType: typeof operation.auditableEvent === 'object' && operation.auditableEvent !== null\n ? String((operation.auditableEvent as Record<string, unknown>).eventType ?? '') || null\n : null,\n isMcpExposed: operation.mcp !== undefined && operation.mcp !== null,\n requiredFeatures: Array.isArray(operation.requiredFeatures)\n ? operation.requiredFeatures.map(String)\n : [],\n attributes,\n specification: null as Record<string, unknown> | null,\n view: null as Record<string, unknown> | null,\n };\n });\n\n const advanced: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(configuration ?? {})) {\n if (NON_ADVANCED_CONFIGURATION_KEYS.has(key)) continue;\n if (typeof value === 'function' || value === undefined) continue;\n advanced[key] = value;\n }\n advancedByResourceType[resourceType] = advanced;\n } catch {\n // A factory that cannot materialize is its own (loud) defect elsewhere — the same policy\n // `resources-registry` takes. The node is still drawn; it simply carries no detail.\n fieldsByResourceType[resourceType] = [];\n operationsByResourceType[resourceType] = [];\n advancedByResourceType[resourceType] = {};\n }\n };\n\n for (const [resourceType, factory] of Object.entries(sharedRegistry.resourceConfigurations ?? {})) {\n collectResourceDetail(resourceType, factory, applicationRelationships);\n }\n\n /*\n * EVERY engine resource, and every engine relationship — not only the ones the application's own\n * edges happen to reach.\n *\n * An application does not merge two engine resources, it merges ALL of them: `initializeResources`\n * applies the engine's core factory map unconditionally and the backend registry merges the same\n * two maps at init, so `files`, `apiKeys`, `webhooks`, `billingAccounts` and the rest are as much\n * part of the running application as the eight it declares itself. Projecting only the two an\n * application's scope anchors touch answered \"what is this application's domain model\" while\n * silently implying it was the whole registry.\n *\n * The relationships are the CORE-MERGED compiled set — application PLUS engine — for the same\n * reason: engine resources related only to each other would otherwise arrive as a wall of\n * disconnected nodes, which states less than saying nothing.\n *\n * The consumer decides what to DRAW. It can tell an engine resource from an application one\n * (`moduleId === null`) and a referenced one from the rest (does any of its relationships reach a\n * resource that has a module), so no field is added here to carry a distinction the data already\n * makes.\n */\n const mergedRelationships = engineMergedCompiledResourceRelationships(\n sharedRegistry.resourceRelationships,\n sharedRegistry.resourceFieldIdentifiers,\n ) as unknown as DomainModelRelationshipInput[];\n\n for (const [resourceType, factory] of engineResourceConfigurationFactoryEntries()) {\n // An application registration always wins over a same-keyed engine one, as both runtime\n // registries do — so a resource the app re-registers keeps ITS field set, not the engine's.\n if (Object.prototype.hasOwnProperty.call(fieldsByResourceType, resourceType)) continue;\n collectResourceDetail(resourceType, factory, mergedRelationships);\n }\n\n const { resourceSpecifications: specOverlay } = resolveSpecificationsCompanionExports(\n context.moduleExports,\n );\n\n /*\n * The engine's own specs UNDER the application's, for the fourth time in this handler and for the\n * same reason as the other three: the application half is not the whole registry.\n *\n * Applications are asked by convention to spread `engineResourceSpecificationsByType` into their\n * companion export first, and the dogfood app does. A convention is not a guarantee, and the\n * failure it produces is quiet: an application that omitted the spread would draw 85 engine\n * resources with no `subDomain` between them and no error anywhere. Merging here makes the engine\n * half unconditional; spreading the app's second keeps its override exactly where it was.\n */\n const specificationOverlay: Record<string, AnyResourceSpecificationConfig> = {\n ...(engineResourceSpecificationsByType as Record<string, AnyResourceSpecificationConfig>),\n ...((specOverlay ?? {}) as Record<string, AnyResourceSpecificationConfig>),\n };\n\n /*\n * The authored SPECIFICATION and FRONTEND VIEW for each operation, attached after the overlay is\n * resolved — the operations were projected before it exists, so this is a second pass over the\n * same rows rather than a reordering of the handler.\n *\n * Keyed by `operationIdentifier`, so every VARIANT of one verb carries the same entry. That is\n * what the specification actually describes: one operation, with its per-variant prose nested\n * inside. Attaching per variant would imply the spec says something different about `read:admin`\n * than about `read:summary`, which it does not.\n */\n for (const [resourceType, resourceOperations] of Object.entries(operationsByResourceType)) {\n const resourceSpecification = specificationOverlay[resourceType] as {\n operations?: Record<string, unknown>;\n frontend?: { views?: Record<string, unknown> };\n } | undefined;\n if (!resourceSpecification) continue;\n for (const operation of resourceOperations) {\n operation.specification = (resourceSpecification.operations?.[operation.operationIdentifier]\n ?? null) as Record<string, unknown> | null;\n operation.view = (resourceSpecification.frontend?.views?.[operation.operationIdentifier]\n ?? null) as Record<string, unknown> | null;\n }\n }\n\n return projectApplicationDomainModel({\n sharedModules,\n resourceRelationships: mergedRelationships,\n specificationOverlay,\n resourceFieldsByResourceType: fieldsByResourceType,\n resourceOperationsByResourceType: operationsByResourceType,\n resourceAdvancedByResourceType: advancedByResourceType,\n /*\n * The per-operation FRONTEND overlay refs, from the merged specification. Keys only — the\n * entries are authoring prose about how an operation surfaces, which belongs to a specification\n * reader; what a domain-model panel can act on is WHICH operations have an authored view.\n */\n resourceViewRefsByResourceType: Object.fromEntries(\n Object.entries(specificationOverlay).map(([resourceType, specification]) => [\n resourceType,\n Object.keys((specification as { frontend?: { views?: Record<string, unknown> } })\n .frontend?.views ?? {}),\n ]),\n ),\n });\n },\n\n 'resources-registry': async (_input, context) => {\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n\n /*\n * The FK-resolution SWEEP, run against the CURRENT working tree (this subprocess re-imports\n * the app's shared-lib fresh every time it RUNS — never the companion's boot-time cache; and\n * the parent's derivation cache only skips the run when a source-state observation proves\n * nothing under the application or its resolved `@wildo-ai/*` roots has moved). Same\n * shared implementation the frontend registry refuses on at init\n * (`frontend_fk_resolution_failed`), surfaced here so the app-creation verification lane can\n * refuse a compose/coding mutation that landed a decorated FK with no relationship edge —\n * the wonder-crm 2026-08-27 defect, which typecheck and the backend boot both missed.\n * Factories are materialized exactly as both runtime registries do: `factory(allRelationships)`.\n */\n const mainSchemasByResourceType: Record<string, z.ZodTypeAny | undefined> = {};\n for (const [resourceType, factory] of Object.entries(sharedRegistry.resourceConfigurations)) {\n try {\n mainSchemasByResourceType[resourceType] = (factory as (relationships: unknown) => { mainSchema?: z.ZodTypeAny })(\n sharedRegistry.resourceRelationships,\n )?.mainSchema;\n } catch {\n // A factory that cannot materialize is its own (loud) defect elsewhere; the sweep only\n // judges the schemas it can see.\n mainSchemasByResourceType[resourceType] = undefined;\n }\n }\n const fieldIdentifierToResourceType = Resources_SharedUtils.buildFieldIdentifierToResourceTypeMap({\n allResourceFieldIdentifiers: sharedRegistry.resourceFieldIdentifiers,\n allResourceRelationships: sharedRegistry.resourceRelationships,\n getMainSchema: (resourceType) => mainSchemasByResourceType[resourceType],\n fieldIdentifierPriority: coreResourceShared_FieldIdentifierPriority,\n });\n const unresolvableForeignKeyFields = Resources_SharedUtils.collectUnresolvableForeignKeyFields({\n mainSchemasByResourceType,\n fieldIdentifierToResourceType,\n });\n\n return {\n resourceTypes: Object.keys(sharedRegistry.resourceConfigurations),\n resourceFieldIdentifiers: sharedRegistry.resourceFieldIdentifiers,\n resourceRelationships: sharedRegistry.resourceRelationships,\n customFeatureDefinitionCount: sharedRegistry.customFeatureDefinitions.length,\n customMilestoneDefinitionCount: sharedRegistry.customMilestoneDefinitions.length,\n productDefinitionCount: sharedRegistry.productDefinitions.length,\n unresolvableForeignKeyFields,\n /*\n * WORKSPACE GROUND TRUTH for build planning (J-1 stalls G+H): the REAL module ids and each\n * resource's CURRENT schema fields, so a decompose brief can state them instead of the model\n * inventing a moduleRef (`module-crm`) or emitting \"create the skeleton\" objectives for\n * resources compose already scaffolded. `modules` covers app-authored domain modules only —\n * engine modules are framework-owned and not build-plan targets.\n */\n modules: sharedModules\n .filter((sharedModule) => sharedModule.kind !== 'engine')\n .map((sharedModule) => ({\n moduleId: sharedModule.moduleId,\n resourceTypes: Object.keys(sharedModule.resourceConfigurations ?? {}),\n })),\n resourceSchemaFields: Object.fromEntries(\n Object.entries(mainSchemasByResourceType).map(([resourceType, schema]) => [\n resourceType,\n schema ? Object.keys(getZodObjectShape(schema) ?? {}) : [],\n ]),\n ),\n };\n },\n 'email-template-placement-info': async (_input, context) => {\n const { loadBackendModules } = resolveBackendCompanionExports(context.moduleExports);\n const backendModules = await loadBackendModules();\n\n return {\n emailTemplateOwnership: backendModules\n .filter((ownedModule) => Object.keys(ownedModule.emailTemplateDefinitions ?? {}).length > 0)\n .map((ownedModule) => ({\n ownerId: ownedModule.moduleId,\n artifactClass: ownedModule.kind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : CompanionArtifactClass.DOMAIN_MODULE,\n rootsByRole: {\n backend: ownedModule.kind === 'engine'\n ? 'backend-api/src/engine/email'\n : `backend-api/src/modules/${ownedModule.moduleId}/emails`,\n },\n templateRefs: Object.keys(ownedModule.emailTemplateDefinitions ?? {}),\n })),\n };\n },\n 'translation-needed-info': async (_input, context) => {\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n\n return {\n moduleIds: sharedRegistry.moduleIds,\n contributionModuleIds: sharedModules.map((module) => module.moduleId),\n artifactPlacements: sharedModules.map((module) => ({\n ownerId: module.moduleId,\n artifactClass: module.kind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : CompanionArtifactClass.DOMAIN_MODULE,\n rootsByRole: {\n shared: module.kind === 'engine'\n ? 'shared-lib/src/engine'\n : `shared-lib/src/modules/${module.moduleId}`,\n backend: module.kind === 'engine'\n ? 'backend-api/src/engine'\n : `backend-api/src/modules/${module.moduleId}`,\n frontend: module.kind === 'engine'\n ? 'frontend/src/engine'\n : `frontend/src/modules/${module.moduleId}`,\n },\n })),\n resourceOwnership: sharedModules.map((module) => ({\n ownerId: module.moduleId,\n artifactClass: module.kind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : CompanionArtifactClass.DOMAIN_MODULE,\n rootsByRole: {\n shared: module.kind === 'engine'\n ? 'shared-lib/src/engine'\n : `shared-lib/src/modules/${module.moduleId}`,\n backend: module.kind === 'engine'\n ? 'backend-api/src/engine'\n : `backend-api/src/modules/${module.moduleId}`,\n frontend: module.kind === 'engine'\n ? 'frontend/src/engine'\n : `frontend/src/modules/${module.moduleId}`,\n },\n resourceTypes: Object.keys(module.resourceConfigurations ?? {}),\n })),\n };\n },\n 'frontend-artifact-placement-info': async (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n const loadFrontendModules = frontendCompanionExports.loadFrontendModules;\n const loadSharedModules = frontendCompanionExports.loadSharedModules;\n if (!loadFrontendModules) {\n throw new Error('Target frontend companion export does not expose loadFrontendModules().');\n }\n if (!loadSharedModules) {\n throw new Error('Target frontend companion export does not expose loadSharedModules().');\n }\n\n const [frontendModules, sharedModules] = await Promise.all([\n loadFrontendModules(),\n loadSharedModules(),\n ]);\n const sharedModuleKindById = new Map(\n sharedModules.map((module) => [module.moduleId, module.kind] as const),\n );\n const resolvedModuleIds = [...new Set(frontendModules.map((module) => module.moduleId))];\n\n return {\n artifactPlacements: resolvedModuleIds.map((moduleId) => {\n const sharedKind = sharedModuleKindById.get(moduleId);\n const artifactClass = sharedKind === 'engine'\n ? CompanionArtifactClass.ENGINE\n : sharedKind\n ? CompanionArtifactClass.DOMAIN_MODULE\n : CompanionArtifactClass.FRONTEND_ONLY;\n\n return {\n ownerId: moduleId,\n artifactClass,\n rootsByRole: {\n frontend: moduleId === 'engine'\n ? 'frontend/src/engine'\n : `frontend/src/modules/${moduleId}`,\n },\n };\n }),\n };\n },\n 'design-system-source-config': (_input, context) => (\n resolveDesignSystemSourceConfig(resolveFrontendCompanionExports(context.moduleExports))\n ),\n 'design-tokens-css': (_input, context) => (\n generateDesignTokensCssFromSourceConfig(\n resolveDesignSystemSourceConfig(resolveFrontendCompanionExports(context.moduleExports)),\n )\n ),\n 'frontend-labels-needed-info': (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n return runFrontendLabelsNeededInfo(frontendCompanionExports, {\n serviceKey: context.request.serviceKey,\n });\n },\n /*\n * The settings-placement CONTENT sweep, against the CURRENT working tree.\n *\n * Exists because a `SHELL_PLACEMENT` coding task's likeliest defect is invisible to\n * every check it could otherwise name. A placement whose `destinationRef` the engine\n * catalog does not ship is not a type error — `resolveSettingsHubConfig` DROPS it and\n * the section simply never renders — so `check:app-typecheck` passes, the task reports\n * verified, and the application is missing a settings section nobody is told about.\n * Same class as the FK-resolution sweep beside it, and the same remedy: ask the\n * working tree, outside the coding agent.\n *\n * Pure composition of surfaces the engine already owns — resolution, the unknown-ref\n * finder and the verifier. No second copy of the catalog lookup lives here.\n */\n 'settings-placement-content': (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n const authored = frontendCompanionExports.settingsHubConfig;\n const result = verifySettingsHubContent(\n resolveSettingsHubConfig(authored),\n findUnknownDestinationRefs(authored),\n );\n return {\n // An application that has authored no rail is VALID, not empty-and-suspicious:\n // an unplaced rail has nothing to verify. Distinguished so a caller can tell\n // \"nothing authored\" from \"authored and clean\".\n authored: authored !== undefined,\n isValid: result.isValid,\n errors: result.errors.map((error) => ({\n severity: error.severity,\n code: error.code,\n context: error.context,\n message: error.message,\n })),\n };\n },\n 'chart-registration-refs': (_input, context) => {\n const frontendCompanionExports = resolveFrontendCompanionExports(context.moduleExports);\n return runChartRegistrationRefs(frontendCompanionExports, {\n serviceKey: context.request.serviceKey,\n });\n },\n 'resource-specifications': async (_input, context) => {\n const libraryTarget = context.request.resolvedTargets.library;\n if (!libraryTarget) {\n throw new Error(\n 'resource-specifications requires a root-level `libraries.shared` declaration in wildo.saas.config.ts.',\n );\n }\n\n const sharedCompanionModule = await import(pathToFileURL(libraryTarget.entryPath).href) as Record<string, unknown>;\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(sharedCompanionModule);\n // Keep the raw shared modules (not just the flattened registry) so the\n // module→resource membership can be projected below. Only the subprocess\n // knows this mapping — the shared registry the runner sees is already\n // flattened to a resourceType-keyed record with no module ownership.\n const sharedModules = await loadSharedModules();\n const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);\n const resourceConfigs = (\n sharedRegistry.resourceConfigurations ?? {}\n ) as Record<\n string,\n | ResourceConfiguration<any, any, any>\n | ((relationships: unknown[]) => ResourceConfiguration<any, any, any>)\n >;\n\n const { resourceSpecifications: specOverlay } = resolveSpecificationsCompanionExports(\n context.moduleExports,\n );\n if (specOverlay === undefined) {\n throw new Error(\n 'resource-specifications introspection requires the specifications package to export `resourceSpecifications`.',\n );\n }\n\n // Materialize all resource configurations once so we can pair them with the\n // spec overlay and run the cross-layer scope alignment check. Materialization\n // is idempotent (the registry-layer factory is pure given its rel inputs)\n // and the per-resource loop below reuses these materialized configs.\n const materializedResourceConfigs: Record<string, ResourceConfiguration<any, any, any>> = {};\n for (const [resourceType, factoryOrConfig] of Object.entries(resourceConfigs)) {\n materializedResourceConfigs[resourceType] = typeof factoryOrConfig === 'function'\n ? (factoryOrConfig as (relationships: unknown[]) => ResourceConfiguration<any, any, any>)(\n sharedRegistry.resourceRelationships ?? [],\n )\n : factoryOrConfig;\n }\n\n // Complete the registry side of the pairing with the CORE (engine) resource\n // configurations. The app's shared registry only carries app-module\n // resources, but the spec overlay merges `engineResourceSpecificationsByType`\n // (every engine resource spec — users, organizations, billing, files, …), so\n // pairing against the app slice alone spec-orphans every scoped engine spec.\n // The backend runtime merges `coreShared_ResourcesConfigurations_FactoryMap`\n // into its registry at init (resources-registry.backend.service.ts), so the\n // core configs ARE runtime truth for this app; the alignment guard must see\n // the same merged view. Core factories are materialized exactly like the\n // OpenAPI projector does (openapi-generation-input.behavior.ts): rels are\n // compiled from app + core-shared inputs against merged field identifiers,\n // and an app registration always wins over a same-keyed core entry. A core\n // factory throw is NOT caught: the backend materializes the same factories\n // at startup, so a throw here is a real cross-layer break that must surface.\n const coreCompiledRelationships = engineMergedCompiledResourceRelationships(\n sharedRegistry.resourceRelationships,\n sharedRegistry.resourceFieldIdentifiers,\n );\n for (const [coreType, coreFactory] of engineResourceConfigurationFactoryEntries()) {\n if (materializedResourceConfigs[coreType]) continue;\n if (typeof coreFactory !== 'function') continue;\n materializedResourceConfigs[coreType] = coreFactory(\n coreCompiledRelationships,\n ) as ResourceConfiguration<any, any, any>;\n }\n\n // Phase 4.5 Step 2.5 Layer 4: cross-layer scope alignment guard.\n // Throws on spec-orphans and on any spec/registry resourcePrimaryScope\n // disagreement — for BOTH app-authored specs (paired with the app shared\n // registry) and engine specs (paired with the materialized core configs).\n // Runs at the canonical pairing site so the failure surfaces on the first\n // introspection call rather than later, against any consumer.\n assertResourceSpecificationsAlignWithRegistry(\n specOverlay as Record<string, AnyResourceSpecificationConfig>,\n materializedResourceConfigs,\n '[companion introspection: resource-specifications]',\n );\n\n const resourceFieldSpecs: Record<\n string,\n { specOverlay: Record<string, unknown> | null; fieldSpecs: unknown[] }\n > = {};\n\n // Phase 2B: thread the registry slice that owns each resource into the\n // extractor entry points so `foreignKeySpec` fields resolve their target\n // via the relationship registry (single source of truth — Q6-2b).\n const allResourceRelationships = sharedRegistry.resourceRelationships ?? [];\n\n for (const [resourceType] of Object.entries(resourceConfigs)) {\n const resourceConfig = materializedResourceConfigs[resourceType];\n const registryContext = {\n currentResourceType: resourceType,\n relationships: allResourceRelationships,\n };\n\n const resourceSpecOverlay = specOverlay?.[resourceType] as AnyResourceSpecificationConfig | undefined;\n const overlayFieldSpecs = resourceSpecOverlay?.fields\n ? extractFieldSpecsFromFieldMap(\n resourceSpecOverlay.fields as Record<string, z.ZodTypeAny>,\n undefined,\n registryContext,\n )\n : [];\n const overlayAdditionalFieldSpecs = resourceSpecOverlay?.additionalFieldSpecs ?? [];\n const fieldSpecs = overlayFieldSpecs.length > 0 || overlayAdditionalFieldSpecs.length > 0\n ? [...overlayFieldSpecs, ...overlayAdditionalFieldSpecs]\n : resourceConfig?.mainSchema\n ? extractResourceFieldSpecs(\n resourceConfig.mainSchema,\n resourceConfig.inheritenceSchemaDefinition,\n registryContext,\n )\n : [];\n\n resourceFieldSpecs[resourceType as ResourceType] = {\n specOverlay: materializeResourceSpecificationOverlay(resourceSpecOverlay),\n fieldSpecs,\n };\n }\n\n // DEC-6: carry module→resource membership so a MODULE-scoped journey can\n // narrow the projected inventory to exactly the modules it targets. Only\n // the subprocess holds this mapping (the runner sees a flattened registry);\n // mirrors `translation-needed-info`'s `resourceOwnership` shape. App shared\n // modules only — Layer-A clean (never framework/engine module content).\n const moduleOwnership = sharedModules.map((module) => ({\n moduleId: module.moduleId,\n /*\n * `kind` distinguishes an ENGINE contribution module from a business DOMAIN one, and dropping\n * it made the two indistinguishable downstream. Wonder CRM's `engine` module carries roles,\n * features, milestones and the product catalog and owns no resources — so it projected as\n * `resourceTypes: []` and read as an empty or broken module rather than as a different KIND of\n * contribution entirely.\n */\n kind: module.kind ?? null,\n resourceTypes: Object.keys(module.resourceConfigurations ?? {}),\n /*\n * Every contribution the module declares, DERIVED from its own keys rather than from a curated\n * list of the ones that exist today.\n *\n * `SharedSaaSModule` admits nine contribution fields and will admit more; a hand-written\n * projection reports the subset its author happened to know about, and a module whose whole\n * contribution is outside that subset looks empty — exactly the defect this replaces. Reading\n * the keys means a contribution added to the contract tomorrow appears here with no change to\n * this handler.\n *\n * Magnitude rather than content: a count says whether the module contributes and how much,\n * which is what an inventory needs. The content belongs to whichever behavior projects that\n * contribution specifically.\n */\n contributions: Object.entries(module)\n .filter(([key]) => !MODULE_IDENTITY_KEYS.has(key))\n .map(([contribution, value]) => ({\n contribution,\n count: Array.isArray(value)\n ? value.length\n : (value && typeof value === 'object' ? Object.keys(value).length : (value === undefined ? 0 : 1)),\n }))\n .filter((entry) => entry.count > 0),\n }));\n\n return { resourceFieldSpecs, moduleOwnership };\n },\n 'specification-context-parts': async (input, context) => {\n const request = parseSpecificationContextFactoryRequest(input);\n const companionExports = resolveSpecificationsCompanionExports(context.moduleExports);\n\n // Phase 2B + Phase 4: load the shared resource registry so resource-family\n // render requests can both\n // - derive `foreignKeySpec` targets from `foreignKeyField` (single\n // source of truth = the relationship registry, per Q6-2b), AND\n // - run the Phase 4 completeness validator against the live\n // `mainSchema` + `inheritenceSchemaDefinition` of every materialized\n // resource configuration before producing the rendered context part.\n //\n // Loading is unconditional today because `renderSpecificationContextPart`\n // dispatches by family inside; non-resource families ignore both slices.\n const libraryTarget = context.request.resolvedTargets.library;\n const { resourceRelationships, resourceMaterializedConfigs } = libraryTarget\n ? await (async () => {\n const sharedCompanionModule = await import(\n pathToFileURL(libraryTarget.entryPath).href\n ) as Record<string, unknown>;\n const { loadSharedModules } = resolveSharedLibraryCompanionExports(sharedCompanionModule);\n const sharedRegistry = buildSharedSaaSModulesRegistry(...await loadSharedModules());\n const relationships = sharedRegistry.resourceRelationships ?? [];\n const resourceConfigs = (\n sharedRegistry.resourceConfigurations ?? {}\n ) as Record<\n string,\n | ResourceConfiguration<any, any, any>\n | ((relationships: unknown[]) => ResourceConfiguration<any, any, any>)\n >;\n // Materialize each registered resource configuration once so\n // the Phase 4 completeness validator sees the same live\n // `mainSchema` / `inheritenceSchemaDefinition` the runtime sees.\n // Mirrors the materialization pass in the `resource-specifications`\n // handler — both paths apply the same registry-relationships input\n // so the result is canonical.\n const materialized: Record<\n string,\n { mainSchema: z.ZodTypeAny; inheritanceDefinition?: ResourceConfiguration<any, any, any>['inheritenceSchemaDefinition'] }\n > = {};\n for (const [resourceType, factoryOrConfig] of Object.entries(resourceConfigs)) {\n const resourceConfig = typeof factoryOrConfig === 'function'\n ? (factoryOrConfig as (relationships: unknown[]) => ResourceConfiguration<any, any, any>)(relationships)\n : factoryOrConfig;\n if (resourceConfig?.mainSchema) {\n materialized[resourceType] = {\n mainSchema: resourceConfig.mainSchema as z.ZodTypeAny,\n inheritanceDefinition: resourceConfig.inheritenceSchemaDefinition,\n };\n }\n }\n\n // Complete the registry side with the CORE (engine) resource configs,\n // symmetrically with the `resource-specifications` handler. The spec\n // overlay merges every engine resource spec (users, organizations,\n // billing, …), so an engine-resource render request would otherwise\n // resolve `materializedConfig === undefined` and SILENTLY SKIP the\n // Phase-4 completeness gate. Materialize the core factories here — and,\n // critically, thread the CORE-MERGED compiled relationships as the gate\n // input (NOT the app-only slice): the FK-completeness walk must see the\n // engine FK edges to gate them, and passing app-only relationships would\n // both under-check engine FKs AND spuriously fail engine specs that\n // correctly authored `.foreignKeySpec()` (their targets are unresolvable\n // without the core edges). App registrations win over same-keyed core\n // entries; a core factory throw is intentionally NOT caught (the backend\n // materializes the same factories at startup, so a throw here is a real\n // cross-layer break that must surface).\n const coreCompiledRelationships = engineMergedCompiledResourceRelationships(\n relationships,\n sharedRegistry.resourceFieldIdentifiers,\n );\n for (const [coreType, coreFactory] of engineResourceConfigurationFactoryEntries()) {\n if (materialized[coreType]) continue;\n if (typeof coreFactory !== 'function') continue;\n const coreConfig = coreFactory(coreCompiledRelationships) as ResourceConfiguration<any, any, any>;\n if (coreConfig?.mainSchema) {\n materialized[coreType] = {\n mainSchema: coreConfig.mainSchema as z.ZodTypeAny,\n inheritanceDefinition: coreConfig.inheritenceSchemaDefinition,\n };\n }\n }\n\n return {\n resourceRelationships: coreCompiledRelationships,\n resourceMaterializedConfigs: materialized,\n };\n })()\n : { resourceRelationships: [], resourceMaterializedConfigs: {} };\n\n return {\n contextPart: renderSpecificationContextPart(companionExports, request, {\n resourceRelationships,\n resourceMaterializedConfigs,\n }),\n };\n },\n 'catalog-context-parts': (input, context) => {\n const request = parseCatalogContextFactoryRequest(input);\n const companionExports = resolveSpecificationsCompanionExports(context.moduleExports);\n\n switch (request.vocabulary) {\n case CatalogContextVocabulary.SCHEMA_ORG: {\n const catalog = (\n companionExports as {\n catalogSpecifications?: { schemaOrg?: readonly { '@type': string }[] };\n }\n ).catalogSpecifications?.schemaOrg;\n if (!catalog) {\n throw new Error(\n 'Specifications companion exports are missing `catalogSpecifications.schemaOrg`.',\n );\n }\n const entry = findCatalogEntryByTypeLastWins(catalog, request.entryType);\n if (!entry) {\n throw new Error(\n `No Schema.org catalog entry \"${request.entryType}\" is exported from the specifications package.`,\n );\n }\n return {\n contextPart: renderCatalogEntryContextPart({\n vocabulary: request.vocabulary,\n entry: entry as Parameters<typeof renderCatalogEntryContextPart>[0]['entry'],\n }),\n };\n }\n default: {\n const unhandledVocabulary: never = request.vocabulary;\n throw new Error(`Unhandled catalog vocabulary: ${String(unhandledVocabulary)}`);\n }\n }\n },\n /**\n * Phase-4 market-context handlers.\n *\n * Both handlers parse a tiny request payload, resolve the authored\n * `MarketSnapshot` via `resolveSpecificationsCompanionExports`, and\n * defer all rendering to the pure `buildMarketContextBlock(...)`\n * builder. Anchored as `companion.introspection.handlers.market` so\n * the `market-companion-prompt-enrichment` SKILL can reference the\n * exact wiring (parser → snapshot resolver → builder).\n *\n * @wildo_source:part:start companion.introspection.handlers.market facet:layer:companion facet:family:market\n */\n 'market-context-for-feature': (input, context) => {\n const { featureRef, outputLanguage } = parseMarketContextFeatureRequest(input);\n const snapshot = resolveMarketSnapshot(context.moduleExports);\n return buildMarketContextBlock({\n snapshot,\n intent: { kind: 'feature', featureRef },\n outputLanguage,\n });\n },\n 'market-context-for-icp': (input, context) => {\n const { icpRef, outputLanguage } = parseMarketContextIcpRequest(input);\n const snapshot = resolveMarketSnapshot(context.moduleExports);\n return buildMarketContextBlock({\n snapshot,\n intent: { kind: 'icp', icpRef },\n outputLanguage,\n });\n },\n /**\n * Phase-4.2 market generation handler. Reuses the same snapshot\n * resolver as the two `market-context-*` handlers (so validation\n * runs once per snapshot identity, with shared WARN dedup) and\n * defers prompt assembly to the pure `renderMarketPrompt(...)`.\n */\n 'market-render-prompt': (input, context) => {\n const request = parseMarketRenderPromptRequest(input);\n const snapshot = resolveMarketSnapshot(context.moduleExports);\n return renderMarketPrompt({ snapshot, request });\n },\n /** @wildo_source:part:end companion.introspection.handlers.market */\n /**\n * Brand logo-generation prompt assembler. Resolves + validates the authored\n * `BrandSnapshot`, reads the optional market `tonesOfVoice` for visual-register\n * enrichment, and defers assembly to the pure `renderBrandPrompt(...)`. No\n * image call — the parent `LogoGenerationCompanionService` invokes the agent.\n */\n 'brand-render-prompt': (_input, context) => {\n const snapshot = resolveBrandSnapshot(context.moduleExports);\n const marketVoices = resolveOptionalMarketVoices(context.moduleExports);\n return renderBrandPrompt({ snapshot, marketVoices });\n },\n /**\n * Expert-persona derivation-inputs projector. Resolves the requested\n * shaping-input snapshots off the specifications companion exports and\n * reports what is missing (the parent derivation service fails closed) and\n * what this target cannot resolve (DESIGN_SYSTEM lives in the frontend\n * service — the parent composes it from `design-system-source-config`).\n * Raw snapshot reads, deliberately WITHOUT each family's validator —\n * derivation inputs are context material; validity enforcement belongs to\n * the families' own authoring flows.\n */\n 'expert-persona-derivation-inputs': (input, context) => {\n const { shapingInputKinds } = parseExpertPersonaDerivationInputsRequest(input);\n return resolveExpertPersonaDerivationInputs(context.moduleExports, shapingInputKinds);\n },\n /**\n * Committed expert-persona charters read-back — the app's\n * `expertPersonaCharters` companion export, `[]` when the app has none yet\n * (a first derivation must not fail on an empty app).\n */\n 'expert-persona-charters': (_input, context) => {\n return { charters: resolveExpertPersonaCharters(context.moduleExports) };\n },\n /**\n * Technical-doc OpenAPI generation input projector\n * (`saas-technical-doc.md` Step 3b). Defers all walking,\n * materialization, URL building, and `z.toJSONSchema()`\n * conversion to the dedicated `openapi-generation-input.behavior`\n * module so the dispatch table here stays a one-liner per\n * behavior. The parent companion service composes the\n * subprocess output with `WildoSaasConfig` metadata before\n * passing the payload to `generateOpenApiDocuments(...)`.\n */\n 'openapi-generation-input': async (input, context) => {\n // `context.moduleExports` is the `library` target — the shared\n // ResourcesRegistry (HTTP shape: paths / verbs / DTOs). The\n // `specifications` target (declared via requiredTargets) carries the\n // authored operation prose that enriches the generated OpenAPI\n // summary/description. Loaded by dynamic import of the resolved target,\n // mirroring the `resource-specifications` handler above.\n const specificationsTarget = context.request.resolvedTargets.specifications;\n const serviceTarget = context.request.resolvedTargets.service;\n if (!specificationsTarget) {\n throw new Error(\n 'openapi-generation-input requires the `specifications` companion target '\n + '(declared via requiredTargets) so authored operation specs can enrich the '\n + 'generated OpenAPI. Ensure a root-level `libraries.specifications` declaration '\n + 'exists in wildo.saas.config.ts.',\n );\n }\n if (!serviceTarget) {\n throw new Error(\n 'openapi-generation-input requires the backend `service` companion target '\n + '(declared via requiredTargets) so application startup capabilities can be projected exactly.',\n );\n }\n const specificationsModule = await import(\n pathToFileURL(specificationsTarget.entryPath).href\n ) as Record<string, unknown>;\n const { resourceSpecifications, roleSpecifications } = resolveSpecificationsCompanionExports(specificationsModule);\n const serviceModule = await import(pathToFileURL(serviceTarget.entryPath).href) as Record<string, unknown>;\n const backendCompanionExports = resolveBackendCompanionExports(serviceModule);\n if (typeof backendCompanionExports.buildApplicationInitializationConfig !== 'function') {\n throw new Error('The backend companion target does not expose buildApplicationInitializationConfig().');\n }\n const applicationInitializationConfig = backendCompanionExports.buildApplicationInitializationConfig();\n // `apiDocResources` opt-in (WildoTechnicalDocConfig) threaded by the parent\n // service via the behavior `input` — documents core engine resources too.\n const { apiDocResourceTypes, excludedCoreResourceTypes } = parseOpenApiGenerationInput(input);\n return runOpenApiGenerationInputBehavior(\n context.moduleExports,\n resourceSpecifications,\n apiDocResourceTypes,\n excludedCoreResourceTypes,\n roleSpecifications,\n {\n organizationUnitNarrowing: applicationInitializationConfig.organizationUnitNarrowing,\n flowActorSystemsFactoryMap: applicationInitializationConfig.flowsActorsRegistry?.flowActorSystemsFactoryMap,\n },\n );\n },\n /**\n * Assertion Surface behaviors (app-creation meta-workflows, master\n * plan S1). One-liner dispatch — real logic lives in\n * `assertions.behavior.ts`, which receives `context.moduleExports`\n * (the `specifications` target carrying `assertionSpecifications`) and\n * `context.request.resolvedTargets` (the `library` target for live\n * derivation), avoiding a subprocess-lane import cycle back through\n * this handlers module (the `openapi-generation-input` precedent).\n */\n 'assertions-list': (input, context) => runAssertionsList(input, context.moduleExports),\n 'assertions-resolve': (input, context) =>\n runAssertionsResolve(input, context.moduleExports, context.request.resolvedTargets),\n 'assertions-reconcile': (input, context) =>\n runAssertionsReconcile(input, context.moduleExports, context.request.resolvedTargets),\n 'definition-specifications': (input, context) =>\n runDefinitionSpecifications(input, context.moduleExports),\n /**\n * The workbench's operator-facing view of the same authored families (issue #162).\n *\n * The path arithmetic is here rather than in the projection because only this layer knows the\n * homes: `packageRoot` is where the specifications package sits on disk, and the prefix is that\n * directory's name relative to the application — so a row names `specifications/src/vision/index.ts`,\n * a path an operator recognizes, instead of a package-internal one or an absolute one carrying\n * somebody's home directory.\n *\n * `evaluatedAt` is stamped HERE for the same reason: the projection stays a pure function of its\n * inputs, which is what makes it testable without freezing a clock.\n */\n 'specification-artifacts': (_input, context) => projectSpecificationArtifacts({\n moduleExports: context.moduleExports,\n packageRoot: context.request.packageRoot,\n appRelativePackagePrefix: toAppRelativeDirectoryName(\n context.request.homes.appDeclarationRoot,\n context.request.packageRoot,\n ),\n evaluatedAt: new Date().toISOString(),\n }),\n\n /*\n * Every second-level aspect row of every landed family, in ONE projection — forty resources\n * bind this behavior at their own `rowsPath`. Single-import for the same reason as\n * `application-domain-model`: the rows cross-reference each other, so both ends of every edge\n * must describe the same working tree. See `family-aspects.behavior.ts`.\n */\n 'family-aspects': (_input, context) => projectFamilyAspects({\n moduleExports: context.moduleExports,\n evaluatedAt: new Date().toISOString(),\n }),\n};\n\n/**\n * The target package's directory as an operator would name it, relative to the application root.\n *\n * Falls back to the package directory's own basename when the two roots are unrelated — which is\n * what a `..`-prefixed relative path would mean, and a path climbing out of the application would be\n * a worse answer than a bare directory name. Never absolute: an absolute path leaks the developer's\n * home directory into a projection served over HTTP.\n */\nfunction toAppRelativeDirectoryName(appDeclarationRoot: string, packageRoot: string): string {\n const relativePath = relative(appDeclarationRoot, packageRoot);\n return relativePath.length > 0 && !relativePath.startsWith('..') ? relativePath : basename(packageRoot);\n}\n\n/**\n * One-time WARN-deduplication set, keyed by snapshot identity.\n *\n * The dev-companion subprocess is short-lived (one process per\n * behavior call), but the same handler instance can be invoked\n * multiple times in tests and in long-running smoke runs. Without\n * this gate we would re-log every WARN every call, drowning real\n * authoring drift. ERROR severity always throws — no dedup needed.\n */\nconst VALIDATED_SNAPSHOTS = new WeakSet<MarketSnapshot>();\n\n/**\n * Resolves the application's authored `MarketSnapshot` from the\n * specifications companion exports and **runs `validateMarketSnapshot`\n * before handing the snapshot to the pure builder**.\n *\n * The contract on `buildMarketContextBlock(...)` is \"Caller is\n * responsible for running `validateMarketSnapshot` first\" — this\n * resolver is that caller. ERROR-severity issues throw a structured\n * error listing every issue (the market generation CLI surfaces it\n * verbatim); WARN-severity issues are logged once per snapshot\n * identity through `console.warn` (the companion subprocess has no\n * logger DI surface today — a follow-up workstream replaces this with\n * the standard companion logger when one lands).\n *\n * No cross-family ref sets are passed to `validateMarketSnapshot`\n * because the dev-companion does not have access to the application's\n * full feature-spec / product registry at this layer (those live in\n * the backend container). The intra-snapshot rules — including the\n * Phase-4 `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH` — still fire and\n * cover every author-controlled drift mode for market spec authoring.\n */\nfunction resolveMarketSnapshot(moduleExports: Record<string, unknown>): MarketSnapshot {\n const { marketSpecification } = resolveSpecificationsCompanionExports(moduleExports);\n if (!marketSpecification) {\n throw new Error(\n 'Market context behaviors require the specifications package to export `marketSpecification` '\n + '(an authored MarketSnapshot). Author one in `specifications/src/market/` and re-export it '\n + 'from `companion-exports.ts`.',\n );\n }\n\n if (VALIDATED_SNAPSHOTS.has(marketSpecification)) return marketSpecification;\n\n const result = validateMarketSnapshot(marketSpecification);\n const errorIssues = result.issues.filter(i => i.severity === 'ERROR');\n if (errorIssues.length > 0) {\n const lines = errorIssues\n .map(i => ` - [${i.kind}] ${i.path}: ${i.message}`)\n .join('\\n');\n throw new Error(\n `Authored MarketSnapshot fails ${errorIssues.length} ERROR-severity validator rule(s). `\n + `The market-context behaviors refuse to render against an invalid snapshot:\\n${lines}`,\n );\n }\n\n const warnIssues = result.issues.filter(i => i.severity === 'WARN');\n if (warnIssues.length > 0) {\n for (const issue of warnIssues) {\n console.warn(\n `[market-snapshot] ${issue.kind} at ${issue.path}: ${issue.message}`,\n );\n }\n }\n\n VALIDATED_SNAPSHOTS.add(marketSpecification);\n return marketSpecification;\n}\n\n/** One-time WARN-dedup for brand snapshots (mirror of `VALIDATED_SNAPSHOTS`). */\nconst VALIDATED_BRAND_SNAPSHOTS = new WeakSet<BrandSnapshot>();\n\n/**\n * Resolves the application's authored `BrandSnapshot` from the specifications\n * companion exports and runs `validateBrandSnapshot` before handing it to the\n * pure prompt renderer (mirror of `resolveMarketSnapshot`). ERROR-severity\n * issues throw a structured error; WARN-severity issues log once per snapshot\n * identity. A directed-but-ungenerated brand only WARNs — that is exactly the\n * state the logo step consumes.\n */\nfunction resolveBrandSnapshot(moduleExports: Record<string, unknown>): BrandSnapshot {\n const { brandSpecification } = resolveSpecificationsCompanionExports(moduleExports);\n if (!brandSpecification) {\n throw new Error(\n 'The brand-render-prompt behavior requires the specifications package to export '\n + '`brandSpecification` (an authored BrandSnapshot). Author one in `specifications/src/brand/` '\n + 'and wire it into `companion-exports.ts`.',\n );\n }\n\n if (VALIDATED_BRAND_SNAPSHOTS.has(brandSpecification)) return brandSpecification;\n\n const result = validateBrandSnapshot(brandSpecification);\n const errorIssues = result.issues.filter(i => i.severity === 'error');\n if (errorIssues.length > 0) {\n const lines = errorIssues.map(i => ` - [${i.kind}] ${i.path}: ${i.message}`).join('\\n');\n throw new Error(\n `Authored BrandSnapshot fails ${errorIssues.length} ERROR-severity validator rule(s). `\n + `The brand-render-prompt behavior refuses to render against an invalid snapshot:\\n${lines}`,\n );\n }\n\n for (const issue of result.issues.filter(i => i.severity === 'warn')) {\n console.warn(`[brand-snapshot] ${issue.kind} at ${issue.path}: ${issue.message}`);\n }\n\n VALIDATED_BRAND_SNAPSHOTS.add(brandSpecification);\n return brandSpecification;\n}\n\n/**\n * Reads the optional market `tonesOfVoice` for visual-register enrichment.\n * Brand generation does NOT require a market snapshot — returns `[]` when\n * absent (the renderer degrades gracefully to the visual tone alone).\n */\nfunction resolveOptionalMarketVoices(moduleExports: Record<string, unknown>): ToneOfVoiceConfig[] {\n const { marketSpecification } = resolveSpecificationsCompanionExports(moduleExports);\n return marketSpecification?.tonesOfVoice ?? [];\n}\n\n/** Parse + fail-closed-validate the derivation-inputs request payload. */\nfunction parseExpertPersonaDerivationInputsRequest(input: unknown): {\n shapingInputKinds: ExpertShapingInputKind[];\n} {\n if (!isPlainObject(input)) {\n throw new Error('expert-persona-derivation-inputs payload must be an object.');\n }\n const raw = input['shapingInputKinds'];\n if (!Array.isArray(raw) || raw.length === 0) {\n throw new Error('expert-persona-derivation-inputs requires a non-empty `shapingInputKinds` string array.');\n }\n const known = new Set<string>(Object.values(ExpertShapingInputKind));\n const unknown = raw.filter((kind) => typeof kind !== 'string' || !known.has(kind));\n if (unknown.length > 0) {\n throw new Error(\n `expert-persona-derivation-inputs received unknown shaping-input kind(s) [${unknown.join(', ')}]. `\n + `Valid: [${[...known].join(', ')}].`,\n );\n }\n return { shapingInputKinds: raw as ExpertShapingInputKind[] };\n}\n\n/**\n * Resolve the requested shaping inputs off the specifications companion\n * exports and render each present one to its CURATED MARKDOWN BRIEF\n * (`expert-persona-brief.renderer.ts`) — the model is grounded on rendered\n * MEANING, never raw JSON dumps (derivation-quality rework, Lever 2). Per\n * kind:\n * - a resolvable, PRESENT export lands in `briefs` (curated markdown);\n * - a resolvable but ABSENT export lands in `missingKinds` (the parent\n * derivation service fails closed: a persona derived from missing inputs\n * is an incomplete persona);\n * - `DESIGN_SYSTEM` lands in `parentComposedKinds` — it lives in the\n * frontend service, unreachable from this specifications target; the\n * parent composes+renders it from the `design-system-source-config`\n * behavior.\n * - `ACCEPTED_DECISIONS` renders the brand snapshot's `resolvedAssets`\n * (the promoted brand assets) — an EMPTY array is a legitimate \"nothing\n * accepted yet\" state, never a missing kind.\n */\nfunction resolveExpertPersonaDerivationInputs(\n moduleExports: Record<string, unknown>,\n shapingInputKinds: ExpertShapingInputKind[],\n): {\n briefs: Partial<Record<ExpertShapingInputKind, string>>;\n missingKinds: ExpertShapingInputKind[];\n parentComposedKinds: ExpertShapingInputKind[];\n} {\n const exports = resolveSpecificationsCompanionExports(moduleExports);\n const sources: ExpertPersonaBriefSources = {};\n const missingKinds: ExpertShapingInputKind[] = [];\n const parentComposedKinds: ExpertShapingInputKind[] = [];\n\n for (const kind of shapingInputKinds) {\n switch (kind) {\n case ExpertShapingInputKind.VISION:\n if (exports.visionSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.visionSpecification;\n break;\n case ExpertShapingInputKind.MARKET:\n if (exports.marketSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.marketSpecification;\n break;\n case ExpertShapingInputKind.BRAND:\n if (exports.brandSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.brandSpecification;\n break;\n case ExpertShapingInputKind.REQUIREMENTS:\n if (exports.requirementsSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.requirementsSpecification;\n break;\n case ExpertShapingInputKind.BUSINESS_MODEL:\n if (exports.businessModelLiteSpecification === undefined) missingKinds.push(kind);\n else sources[kind] = exports.businessModelLiteSpecification;\n break;\n case ExpertShapingInputKind.ACCEPTED_DECISIONS:\n sources[kind] = exports.brandSpecification?.resolvedAssets ?? [];\n break;\n case ExpertShapingInputKind.DESIGN_SYSTEM:\n parentComposedKinds.push(kind);\n break;\n }\n }\n\n return { briefs: renderShapingInputBriefs(sources), missingKinds, parentComposedKinds };\n}\n\n/**\n * Committed charters read-back — `[]` when the app has not wired (or not yet\n * accepted) any charter. No validator here: the accept step runs\n * `validateExpertPersonaCharters` where the current-inputs digests are\n * computable (parent side).\n */\nfunction resolveExpertPersonaCharters(moduleExports: Record<string, unknown>): ExpertPersonaCharter[] {\n const { expertPersonaCharters } = resolveSpecificationsCompanionExports(moduleExports);\n return expertPersonaCharters ?? [];\n}\n\nfunction parseMarketContextFeatureRequest(input: unknown): {\n featureRef: string;\n outputLanguage: string | undefined;\n} {\n if (!isPlainObject(input)) {\n throw new Error('market-context-for-feature payload must be an object.');\n }\n const featureRef = input['featureRef'];\n if (typeof featureRef !== 'string' || featureRef.length === 0) {\n throw new Error('market-context-for-feature payload requires a non-empty `featureRef` string.');\n }\n const outputLanguageValue = input['outputLanguage'];\n if (outputLanguageValue !== undefined && typeof outputLanguageValue !== 'string') {\n throw new Error('market-context-for-feature `outputLanguage` must be a string when provided.');\n }\n const outputLanguage = typeof outputLanguageValue === 'string' && outputLanguageValue.length > 0\n ? outputLanguageValue\n : undefined;\n return { featureRef, outputLanguage };\n}\n\nfunction parseCatalogContextFactoryRequest(input: unknown): {\n vocabulary: CatalogContextVocabulary.SCHEMA_ORG;\n entryType: string;\n} {\n if (!input || typeof input !== 'object') {\n throw new Error('catalog-context-parts payload must be an object.');\n }\n const vocabulary = (input as { vocabulary?: unknown }).vocabulary;\n if (vocabulary !== CatalogContextVocabulary.SCHEMA_ORG) {\n throw new Error(\n `catalog-context-parts payload requires vocabulary \"${CatalogContextVocabulary.SCHEMA_ORG}\".`,\n );\n }\n const entryType = (input as { entryType?: unknown }).entryType;\n if (typeof entryType !== 'string' || entryType.trim().length === 0) {\n throw new Error('catalog-context-parts payload requires a non-empty `entryType` string.');\n }\n return {\n vocabulary,\n entryType: entryType.trim(),\n };\n}\n\nfunction findCatalogEntryByTypeLastWins<TEntry extends { '@type': string }>(\n catalog: readonly TEntry[],\n entryType: string,\n): TEntry | undefined {\n for (let index = catalog.length - 1; index >= 0; index -= 1) {\n const candidate = catalog[index];\n if (candidate?.['@type'] === entryType) {\n return candidate;\n }\n }\n return undefined;\n}\n\nfunction parseMarketContextIcpRequest(input: unknown): {\n icpRef: string;\n outputLanguage: string | undefined;\n} {\n if (!isPlainObject(input)) {\n throw new Error('market-context-for-icp payload must be an object.');\n }\n const icpRef = input['icpRef'];\n if (typeof icpRef !== 'string' || icpRef.length === 0) {\n throw new Error('market-context-for-icp payload requires a non-empty `icpRef` string.');\n }\n const outputLanguageValue = input['outputLanguage'];\n if (outputLanguageValue !== undefined && typeof outputLanguageValue !== 'string') {\n throw new Error('market-context-for-icp `outputLanguage` must be a string when provided.');\n }\n const outputLanguage = typeof outputLanguageValue === 'string' && outputLanguageValue.length > 0\n ? outputLanguageValue\n : undefined;\n return { icpRef, outputLanguage };\n}\n\nfunction parseMarketRenderPromptRequest(input: unknown): MarketPromptRequest {\n if (!isPlainObject(input)) {\n throw new Error('market-render-prompt payload must be an object.');\n }\n const templateRef = input['templateRef'];\n if (typeof templateRef !== 'string' || templateRef.length === 0) {\n throw new Error('market-render-prompt payload requires a non-empty `templateRef` string.');\n }\n\n const optionalString = (key: string): string | undefined => {\n const value = input[key];\n if (value === undefined) return undefined;\n if (typeof value !== 'string') {\n throw new Error(`market-render-prompt \\`${key}\\` must be a string when provided.`);\n }\n return value.length > 0 ? value : undefined;\n };\n\n return {\n templateRef,\n icpRef: optionalString('icpRef'),\n featureRef: optionalString('featureRef'),\n benefitRef: optionalString('benefitRef'),\n channelRef: optionalString('channelRef'),\n objectionRef: optionalString('objectionRef'),\n outputLanguage: optionalString('outputLanguage'),\n };\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Parse the `apiDocResources` opt-in carried on the `openapi-generation-input`\n * behavior `input` (threaded from `WildoTechnicalDocConfig.apiDocResources` by\n * the parent {@link TechnicalDocCompanionService}). Returns `'all'`, a string\n * array of `CoreResourceType` values, or `undefined` (no core resources). The\n * value crosses the subprocess IPC boundary as plain JSON, so this re-validates\n * defensively rather than trusting the shape.\n */\nexport function parseOpenApiGenerationInput(input: unknown): {\n apiDocResourceTypes?: readonly string[] | 'all';\n excludedCoreResourceTypes?: readonly CoreResourceType[];\n} {\n if (input === undefined) return {};\n if (!isPlainObject(input)) {\n throw new Error('openapi-generation-input `input` must be an object when provided.');\n }\n\n const result: {\n apiDocResourceTypes?: readonly string[] | 'all';\n excludedCoreResourceTypes?: readonly CoreResourceType[];\n } = {};\n const apiDocResources = input.apiDocResources;\n if (apiDocResources !== undefined) {\n if (apiDocResources === 'all') {\n result.apiDocResourceTypes = 'all';\n } else if (\n Array.isArray(apiDocResources)\n && apiDocResources.every((entry) => typeof entry === 'string' && Object.values(CoreResourceType).includes(entry as CoreResourceType))\n ) {\n result.apiDocResourceTypes = apiDocResources;\n } else {\n throw new Error('openapi-generation-input `apiDocResources` must be `all` or contain only CoreResourceType values.');\n }\n }\n\n const excludedCoreResources = input.excludedCoreResourceTypes;\n if (excludedCoreResources !== undefined) {\n const coreResourceTypes = new Set<string>(Object.values(CoreResourceType));\n if (\n !Array.isArray(excludedCoreResources)\n || !excludedCoreResources.every((entry) => typeof entry === 'string' && coreResourceTypes.has(entry))\n ) {\n throw new Error('openapi-generation-input `excludedCoreResourceTypes` must contain only CoreResourceType values.');\n }\n result.excludedCoreResourceTypes = [...new Set(excludedCoreResources as CoreResourceType[])].sort();\n }\n\n return result;\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface FamilyAspectRow {
|
|
2
|
+
readonly [field: string]: unknown;
|
|
3
|
+
}
|
|
4
|
+
export type FamilyAspectsResponse = {
|
|
5
|
+
readonly trace: FamilyAspectsTrace;
|
|
6
|
+
} & {
|
|
7
|
+
readonly [rowsPath: string]: readonly FamilyAspectRow[] | FamilyAspectsTrace;
|
|
8
|
+
};
|
|
9
|
+
export interface FamilyAspectsTrace {
|
|
10
|
+
readonly aspects: number;
|
|
11
|
+
readonly rows: number;
|
|
12
|
+
readonly evaluatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function projectFamilyAspects(input: {
|
|
15
|
+
readonly moduleExports: Record<string, unknown>;
|
|
16
|
+
readonly evaluatedAt: string;
|
|
17
|
+
}): FamilyAspectsResponse;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=family-aspects.behavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"family-aspects.behavior.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/family-aspects.behavior.ts"],"names":[],"mappings":"AAsDA,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;CACpC,GAAG;IACF,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,eAAe,EAAE,GAAG,kBAAkB,CAAC;CAC9E,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,GAAG,qBAAqB,CAwExB"}
|