@wildo-ai/dev-companion 1.1.1 → 1.1.3
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 +408 -38
- 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 +70 -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 +110 -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 +62 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +295 -19
- 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 +243 -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 +370 -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 +40 -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 +126 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -0
- 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/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.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +13 -8
- 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 +31 -0
- 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 +91 -8
- 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 +4 -2
- 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 +10 -7
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +80 -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 +261 -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 +113 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +517 -54
- 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 +84 -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 +10 -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 +10 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-introspection.models.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/models/companion-introspection.models.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,mDAAoD,CAAC;AACzG,MAAM,MAAM,mCAAmC,GAAG,OAAO,uCAAuC,CAAC,MAAM,CAAC,CAAC;AAEzG,eAAO,MAAM,uCAAuC,kCAAmC,CAAC;AACxF,MAAM,MAAM,iCAAiC,GAAG,OAAO,uCAAuC,CAAC,MAAM,CAAC,CAAC;AAEvG,eAAO,MAAM,sCAAsC,
|
|
1
|
+
{"version":3,"file":"companion-introspection.models.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/models/companion-introspection.models.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,mDAAoD,CAAC;AACzG,MAAM,MAAM,mCAAmC,GAAG,OAAO,uCAAuC,CAAC,MAAM,CAAC,CAAC;AAEzG,eAAO,MAAM,uCAAuC,kCAAmC,CAAC;AACxF,MAAM,MAAM,iCAAiC,GAAG,OAAO,uCAAuC,CAAC,MAAM,CAAC,CAAC;AAEvG,eAAO,MAAM,sCAAsC,quBA0KzC,CAAC;AACX,MAAM,MAAM,gCAAgC,GAAG,OAAO,sCAAsC,CAAC,MAAM,CAAC,CAAC;AAErG,eAAO,MAAM,4CAA4C,qLAa/C,CAAC;AACX,MAAM,MAAM,sCAAsC,GAChD,OAAO,4CAA4C,CAAC,MAAM,CAAC,CAAC;A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AW,mCAAmC;IAClD,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,iCAAiC,CAAC;IAC/C,gBAAgB,EAAE,sCAAsC,CAAC;IACzD,mBAAmB,EAAE,yCAAyC,CAAC;IAC/D,QAAQ,EAAE,mCAAmC,CAAC;IAC9C,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,KAAK,CAAC;IACf,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,iCAAiC,CAAC;IAC/C,gBAAgB,EAAE,sCAAsC,CAAC;IACzD,mBAAmB,EAAE,yCAAyC,CAAC;IAC/D,QAAQ,EAAE,mCAAmC,CAAC;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,kCAAkC,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,4BAA4B,GACpC,mCAAmC,GACnC,mCAAmC,CAAC"}
|
|
@@ -131,6 +131,45 @@ export const CompanionIntrospectionBehaviorIdValues = [
|
|
|
131
131
|
* construction — every value is a lookup of a declaration already written down.
|
|
132
132
|
*/
|
|
133
133
|
'compliance-primary-facts',
|
|
134
|
+
/**
|
|
135
|
+
* **application-domain-model** — the observed application's resources, the module that owns each,
|
|
136
|
+
* the relationships they participate in, and the prose of their specifications, in ONE projection.
|
|
137
|
+
*
|
|
138
|
+
* Needs BOTH targets, which is the whole point: module ownership and the specification overlay live
|
|
139
|
+
* on the `specifications` target, the relationship edges on the `library` one. Reading them through
|
|
140
|
+
* the two behaviors that already answer half each (`resource-specifications`, `resources-registry`)
|
|
141
|
+
* means two subprocess runs against a working tree an operator is editing, so the nodes may come
|
|
142
|
+
* from one state of the application and the edges from the next — a picture of an application that
|
|
143
|
+
* never existed, with nothing to detect it.
|
|
144
|
+
*/
|
|
145
|
+
'application-domain-model',
|
|
146
|
+
/**
|
|
147
|
+
* **specification-artifacts** — every application-specification family the journey produces,
|
|
148
|
+
* projected for a HUMAN reviewer rather than for a language model.
|
|
149
|
+
*
|
|
150
|
+
* The companion already reads this content: `market-context-for-icp`, `market-render-prompt`,
|
|
151
|
+
* `brand-render-prompt`, `specification-context-parts` and their siblings all resolve the same
|
|
152
|
+
* authored snapshots — and every one of them renders PROSE FOR A MODEL. The loading and resolution
|
|
153
|
+
* paths were proven; the projection whose consumer is an operator did not exist, so a creator could
|
|
154
|
+
* not review what the journey had decided about their product without opening TypeScript files
|
|
155
|
+
* (issue #162).
|
|
156
|
+
*
|
|
157
|
+
* Enumerates `APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS` — so the population cannot drift
|
|
158
|
+
* from the authority — and, per family, reports whether it landed, whether its own `_core`
|
|
159
|
+
* validator still passes, which playbooks produce it, and the artifact rendered as a document.
|
|
160
|
+
*
|
|
161
|
+
* ## Where it deliberately differs from `definition-specifications`
|
|
162
|
+
*
|
|
163
|
+
* That behavior THROWS on any ERROR-severity structural issue, which is correct for a load-time
|
|
164
|
+
* guard and exactly wrong here: it would make an invalid artifact the one thing a reviewer cannot
|
|
165
|
+
* look at, at the moment they most need to. This one REPORTS. Both run the same validators through
|
|
166
|
+
* the same authority, so they cannot disagree about what is valid — only about what to do about it.
|
|
167
|
+
*
|
|
168
|
+
* Pure/deterministic and modelless. `specifications` target only: every family's accepted value is
|
|
169
|
+
* a companion export of that package.
|
|
170
|
+
*/
|
|
171
|
+
'specification-artifacts',
|
|
172
|
+
'family-aspects',
|
|
134
173
|
];
|
|
135
174
|
export const CompanionIntrospectionBehaviorCategoryValues = [
|
|
136
175
|
'resources',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-introspection.models.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/models/companion-introspection.models.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAU,CAAC;AAGzG,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAU,CAAC;AAGxF,MAAM,CAAC,MAAM,sCAAsC,GAAG;IACpD,oBAAoB;IACpB,+BAA+B;IAC/B,yBAAyB;IACzB,kCAAkC;IAClC,6BAA6B;IAC7B,mBAAmB;IACnB,6BAA6B;IAC7B,yBAAyB;IACzB,6BAA6B;IAC7B,uBAAuB;IACvB,4BAA4B;IAC5B,wBAAwB;IACxB,sBAAsB;IACtB;;;;;;;;;;;;;;;;OAgBG;IACH,0BAA0B;IAC1B;;;;;;;OAOG;IACH,yBAAyB;IACzB;;;;;;;;;;OAUG;IACH,4BAA4B;IAC5B;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB;IACjB,oBAAoB;IACpB,sBAAsB;IACtB;;;;;;;;;;OAUG;IACH,2BAA2B;IAC3B;;;;;;;;OAQG;IACH,qBAAqB;IACrB;;;;;;;;;;OAUG;IACH,kCAAkC;IAClC;;;;;;OAMG;IACH,yBAAyB;IACzB;;;;;;;;;;;;;;OAcG;IACH,0BAA0B;CAClB,CAAC;AAGX,MAAM,CAAC,MAAM,4CAA4C,GAAG;IAC1D,WAAW;IACX,aAAa;IACb,OAAO;IACP,wBAAwB;IACxB,QAAQ;IACR,gBAAgB;IAChB,QAAQ;IACR,OAAO;IACP,iBAAiB;IACjB,eAAe;IACf,QAAQ;IACR,YAAY;CACJ,CAAC;AAIX,MAAM,CAAC,MAAM,+CAA+C,GAAG;IAC7D,eAAe;IACf,eAAe;CACP,CAAC","sourcesContent":["export const CompanionIntrospectionRouteTargetValues = ['service', 'library', 'specifications'] as const;\nexport type CompanionIntrospectionRouteTargetId = typeof CompanionIntrospectionRouteTargetValues[number];\n\nexport const CompanionIntrospectionServiceKindValues = ['backend', 'frontend'] as const;\nexport type CompanionIntrospectionServiceKind = typeof CompanionIntrospectionServiceKindValues[number];\n\nexport const CompanionIntrospectionBehaviorIdValues = [\n 'resources-registry',\n 'email-template-placement-info',\n 'translation-needed-info',\n 'frontend-artifact-placement-info',\n 'design-system-source-config',\n 'design-tokens-css',\n 'frontend-labels-needed-info',\n 'resource-specifications',\n 'specification-context-parts',\n 'catalog-context-parts',\n 'market-context-for-feature',\n 'market-context-for-icp',\n 'market-render-prompt',\n /**\n * Technical-documentation OpenAPI generator input projection\n * (`saas-technical-doc.md` Step 3b). Walks the resolved\n * `ResourcesRegistry` in the backend subprocess, materializes every\n * resource configuration, runs the URL builder so per-operation\n * `initiatorInfos[].url` are populated, and projects each\n * `(operation × initiatorInfo)` row into the\n * `OpenApiGenerationInputSchema` shape declared in\n * `@wildo-ai/saas-technical-doc/companion`.\n *\n * Why subprocess-side: the projection runs `z.toJSONSchema(...)` on\n * each operation's `requestDto` / `responseDto`, which requires\n * loading `@wildo-ai/saas-models` (and its `initZodDecorators()`\n * boot). Doing this in the subprocess keeps the parent companion\n * bundle decorator-framework-free per `saas-models-public-runtime.md`\n * K-3.\n */\n 'openapi-generation-input',\n /**\n * Frontend chart-registration refs — every `chartViews[].chartDefinition.ref`\n * across the app's resources, materialized in the FRONTEND subprocess. The\n * parent composes these with the backend-registered chart refs to detect a\n * frontend chartView whose chart is not registered backend-side (a silent\n * runtime `chart_not_found` 404). Kept separate from `frontend-labels-needed-info`\n * so chart-registration data does not thread through the labelling pipeline.\n */\n 'chart-registration-refs',\n /**\n * The application's authored settings rail, verified against the engine destination\n * catalog in the FRONTEND subprocess (fresh working-tree import).\n *\n * Exists for a failure that is silent by construction: a placement naming a\n * `destinationRef` the catalog does not ship is not a type error —\n * `resolveSettingsHubConfig` DROPS it and the section simply never renders. So a\n * `SHELL_PLACEMENT` coding task can pass `check:app-typecheck`, report verified, and\n * leave the application missing a settings section nobody is told about. Same class\n * as the FK-resolution sweep, and answered the same way: ask the working tree.\n */\n 'settings-placement-content',\n /**\n * Assertion Surface behaviors (app-creation meta-workflows, master\n * plan S1). Serve the authored `AssertionSpecificationSnapshot` from\n * the specifications target:\n *\n * - `assertions-list` — authored entries, filtered by lane / kind\n * (pure projection; no live registry).\n * - `assertions-resolve` — entries plus live probe findings derived\n * at query time against the resources registry (requires the\n * `library` target); the parent composes LLM interpretation on top.\n * - `assertions-reconcile` — computes per-entry status\n * (assumed → landed → drifted / unverifiable) by diffing authored\n * assumptions against introspected reality (requires `library`).\n *\n * Kebab-case string-tuple ids (the introspection plane convention —\n * one behavior id per operation, no `input.op` discriminator).\n */\n 'assertions-list',\n 'assertions-resolve',\n 'assertions-reconcile',\n /**\n * Top-down **definition-specifications** projection (app-creation\n * meta-workflows, journey-buildout GAP-D1-9). Serves the presence +\n * structural validity + cross-family coherence of the authored C-4\n * definition set (`vision-brief` / `market-snapshot` / `requirements` /\n * `roadmap` / `business-model`) off the specifications target's companion\n * exports. Runs each family's `_core` validator (shared with the\n * journey-snapshot per-artifact validation seam) as a durable load-time\n * guard — an ERROR or an unresolved cross-family ref fails closed instead of\n * shipping silently. Pure/deterministic; no live registry, no LLM.\n */\n 'definition-specifications',\n /**\n * Brand logo-generation prompt assembly (app-creation meta-workflows —\n * brand-identity). Reads the authored `BrandSnapshot` off the specifications\n * target's companion exports, validates it (`validateBrandSnapshot`), and\n * assembles the text-to-image prompt (brand name + logo direction + visual\n * tone, optionally enriched by the market `tonesOfVoice`). Pure/deterministic\n * — no image call here; the parent `LogoGenerationCompanionService` invokes\n * the image agent with the returned prompt.\n */\n 'brand-render-prompt',\n /**\n * Expert-persona DERIVATION INPUTS projection (agentic deliberation\n * system, Step 2). Resolves the specification-tier snapshots a role's\n * charter derivation is shaped by (`shapingInputKinds` of the framework\n * `ExpertRoleTemplate`: vision / market / brand / requirements /\n * business-model / accepted-decisions), returning the resolved subset plus\n * the kinds that are missing (the parent derivation service fails closed\n * on missing kinds) and the kinds this target cannot resolve\n * (DESIGN_SYSTEM — the parent composes it from the frontend\n * `design-system-source-config` behavior). Pure/deterministic; no LLM.\n */\n 'expert-persona-derivation-inputs',\n /**\n * Committed expert-persona CHARTERS read-back (agentic deliberation\n * system). Serves the app's `expertPersonaCharters` companion export\n * (the accepted charters under `specifications/src/personas/`) — consumed\n * by the accept step's human-edit overwrite guard + validator run, and by\n * the deliberation system's startup agent factory. Pure/deterministic.\n */\n 'expert-persona-charters',\n /**\n * **compliance-primary-facts** — what a compliance document can say about this application,\n * derived from its resource configurations.\n *\n * Reads the five compliance-bearing declarations off every materialized resource\n * (`retentionPolicy.mode`, `dataSubjectPolicy.kind`, `systemAccessPolicy.exportSubject` and the\n * two retained see-through verbs) and reports them split by ORIGIN — engine-declared versus\n * application-declared. The split is the finding: the engine already answers most of a privacy\n * notice for every generated application, and what it cannot answer is the application's own\n * domain data about third parties, which is most of what such a notice exists to describe.\n *\n * Needs the `library` target (resource CONFIGS live in the app's shared-lib; the specifications\n * target carries SPECS, which do not hold these fields). Pure/deterministic, and modelless by\n * construction — every value is a lookup of a declaration already written down.\n */\n 'compliance-primary-facts',\n] as const;\nexport type CompanionIntrospectionBehaviorId = typeof CompanionIntrospectionBehaviorIdValues[number];\n\nexport const CompanionIntrospectionBehaviorCategoryValues = [\n 'resources',\n 'translation',\n 'email',\n 'frontend-design-system',\n 'labels',\n 'specifications',\n 'market',\n 'brand',\n 'expert-personas',\n 'technical-doc',\n 'charts',\n 'assertions',\n] as const;\nexport type CompanionIntrospectionBehaviorCategory =\n typeof CompanionIntrospectionBehaviorCategoryValues[number];\n\nexport const CompanionIntrospectionMaterializationKindValues = [\n 'json-snapshot',\n 'text-artifact',\n] as const;\nexport type CompanionIntrospectionMaterializationKind =\n typeof CompanionIntrospectionMaterializationKindValues[number];\n\nexport interface CompanionIntrospectionBehaviorRoutingDefinition {\n target: CompanionIntrospectionRouteTargetId;\n requiredTargets?: CompanionIntrospectionRouteTargetId[];\n}\n\nexport interface CompanionIntrospectionBehaviorExecutionDefinition {\n materializationBoundary: 'subprocess';\n compositionBoundary: 'parent';\n materializationKind: CompanionIntrospectionMaterializationKind;\n}\n\nexport interface CompanionIntrospectionBehaviorDefinition {\n behaviorId: CompanionIntrospectionBehaviorId;\n description: string;\n category: CompanionIntrospectionBehaviorCategory;\n supportedServiceKinds: CompanionIntrospectionServiceKind[];\n routingByServiceKind: Partial<\n Record<CompanionIntrospectionServiceKind, CompanionIntrospectionBehaviorRoutingDefinition>\n >;\n execution: CompanionIntrospectionBehaviorExecutionDefinition;\n}\n\nexport interface CompanionIntrospectionResolvedBehaviorDefinition {\n behaviorId: CompanionIntrospectionBehaviorId;\n description: string;\n category: CompanionIntrospectionBehaviorCategory;\n serviceKind: CompanionIntrospectionServiceKind;\n route: CompanionIntrospectionBehaviorRoutingDefinition;\n execution: CompanionIntrospectionBehaviorExecutionDefinition;\n}\n\nexport interface CompanionIntrospectionResolvedPackageTarget {\n targetId: CompanionIntrospectionRouteTargetId;\n packageRoot: string;\n entryPath: string;\n declaredPath?: string;\n}\n\n/**\n * Minimal trusted homes snapshot passed from the parent companion process into\n * introspection children so subprocesses never need to rediscover app or\n * framework roots from cwd.\n */\nexport interface CompanionIntrospectionHomesSnapshot {\n appDeclarationRoot: string;\n appRuntimeHome: string;\n companionHome: string;\n frameworkRepositoryRoot: string | null;\n}\n\nexport interface CompanionIntrospectionRequest {\n serviceKey: string;\n behavior: CompanionIntrospectionBehaviorId;\n input?: unknown;\n}\n\nexport interface CompanionIntrospectionResolvedTarget {\n serviceKey: string;\n servicePath: string;\n serviceName: string;\n serviceKind: CompanionIntrospectionServiceKind;\n behavior: CompanionIntrospectionBehaviorId;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n packageRoot: string;\n entryPath: string;\n resolvedTargets: Partial<Record<CompanionIntrospectionRouteTargetId, CompanionIntrospectionResolvedPackageTarget>>;\n resolvedBehavior: CompanionIntrospectionResolvedBehaviorDefinition;\n input?: unknown;\n}\n\nexport interface CompanionIntrospectionChildRequest {\n behavior: CompanionIntrospectionBehaviorId;\n serviceKind: CompanionIntrospectionServiceKind;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n serviceKey: string;\n entryPath: string;\n packageRoot: string;\n homes: CompanionIntrospectionHomesSnapshot;\n resolvedTargets: Partial<Record<CompanionIntrospectionRouteTargetId, CompanionIntrospectionResolvedPackageTarget>>;\n input?: unknown;\n}\n\nexport interface CompanionIntrospectionErrorDetails {\n message: string;\n name?: string;\n stack?: string;\n}\n\nexport interface CompanionIntrospectionSuccessResult {\n success: true;\n behavior: CompanionIntrospectionBehaviorId;\n serviceKey: string;\n serviceKind: CompanionIntrospectionServiceKind;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n data: unknown;\n durationMs: number;\n stdout?: string;\n stderr?: string;\n}\n\nexport interface CompanionIntrospectionFailureResult {\n success: false;\n behavior: CompanionIntrospectionBehaviorId;\n serviceKey: string;\n serviceKind: CompanionIntrospectionServiceKind;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n durationMs: number;\n error: CompanionIntrospectionErrorDetails;\n stdout?: string;\n stderr?: string;\n}\n\nexport type CompanionIntrospectionResult =\n | CompanionIntrospectionSuccessResult\n | CompanionIntrospectionFailureResult;\n"]}
|
|
1
|
+
{"version":3,"file":"companion-introspection.models.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/models/companion-introspection.models.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAU,CAAC;AAGzG,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAU,CAAC;AAGxF,MAAM,CAAC,MAAM,sCAAsC,GAAG;IACpD,oBAAoB;IACpB,+BAA+B;IAC/B,yBAAyB;IACzB,kCAAkC;IAClC,6BAA6B;IAC7B,mBAAmB;IACnB,6BAA6B;IAC7B,yBAAyB;IACzB,6BAA6B;IAC7B,uBAAuB;IACvB,4BAA4B;IAC5B,wBAAwB;IACxB,sBAAsB;IACtB;;;;;;;;;;;;;;;;OAgBG;IACH,0BAA0B;IAC1B;;;;;;;OAOG;IACH,yBAAyB;IACzB;;;;;;;;;;OAUG;IACH,4BAA4B;IAC5B;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB;IACjB,oBAAoB;IACpB,sBAAsB;IACtB;;;;;;;;;;OAUG;IACH,2BAA2B;IAC3B;;;;;;;;OAQG;IACH,qBAAqB;IACrB;;;;;;;;;;OAUG;IACH,kCAAkC;IAClC;;;;;;OAMG;IACH,yBAAyB;IACzB;;;;;;;;;;;;;;OAcG;IACH,0BAA0B;IAC1B;;;;;;;;;;OAUG;IACH,0BAA0B;IAC1B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,yBAAyB;IACzB,gBAAgB;CACR,CAAC;AAGX,MAAM,CAAC,MAAM,4CAA4C,GAAG;IAC1D,WAAW;IACX,aAAa;IACb,OAAO;IACP,wBAAwB;IACxB,QAAQ;IACR,gBAAgB;IAChB,QAAQ;IACR,OAAO;IACP,iBAAiB;IACjB,eAAe;IACf,QAAQ;IACR,YAAY;CACJ,CAAC;AAIX,MAAM,CAAC,MAAM,+CAA+C,GAAG;IAC7D,eAAe;IACf,eAAe;CACP,CAAC","sourcesContent":["export const CompanionIntrospectionRouteTargetValues = ['service', 'library', 'specifications'] as const;\nexport type CompanionIntrospectionRouteTargetId = typeof CompanionIntrospectionRouteTargetValues[number];\n\nexport const CompanionIntrospectionServiceKindValues = ['backend', 'frontend'] as const;\nexport type CompanionIntrospectionServiceKind = typeof CompanionIntrospectionServiceKindValues[number];\n\nexport const CompanionIntrospectionBehaviorIdValues = [\n 'resources-registry',\n 'email-template-placement-info',\n 'translation-needed-info',\n 'frontend-artifact-placement-info',\n 'design-system-source-config',\n 'design-tokens-css',\n 'frontend-labels-needed-info',\n 'resource-specifications',\n 'specification-context-parts',\n 'catalog-context-parts',\n 'market-context-for-feature',\n 'market-context-for-icp',\n 'market-render-prompt',\n /**\n * Technical-documentation OpenAPI generator input projection\n * (`saas-technical-doc.md` Step 3b). Walks the resolved\n * `ResourcesRegistry` in the backend subprocess, materializes every\n * resource configuration, runs the URL builder so per-operation\n * `initiatorInfos[].url` are populated, and projects each\n * `(operation × initiatorInfo)` row into the\n * `OpenApiGenerationInputSchema` shape declared in\n * `@wildo-ai/saas-technical-doc/companion`.\n *\n * Why subprocess-side: the projection runs `z.toJSONSchema(...)` on\n * each operation's `requestDto` / `responseDto`, which requires\n * loading `@wildo-ai/saas-models` (and its `initZodDecorators()`\n * boot). Doing this in the subprocess keeps the parent companion\n * bundle decorator-framework-free per `saas-models-public-runtime.md`\n * K-3.\n */\n 'openapi-generation-input',\n /**\n * Frontend chart-registration refs — every `chartViews[].chartDefinition.ref`\n * across the app's resources, materialized in the FRONTEND subprocess. The\n * parent composes these with the backend-registered chart refs to detect a\n * frontend chartView whose chart is not registered backend-side (a silent\n * runtime `chart_not_found` 404). Kept separate from `frontend-labels-needed-info`\n * so chart-registration data does not thread through the labelling pipeline.\n */\n 'chart-registration-refs',\n /**\n * The application's authored settings rail, verified against the engine destination\n * catalog in the FRONTEND subprocess (fresh working-tree import).\n *\n * Exists for a failure that is silent by construction: a placement naming a\n * `destinationRef` the catalog does not ship is not a type error —\n * `resolveSettingsHubConfig` DROPS it and the section simply never renders. So a\n * `SHELL_PLACEMENT` coding task can pass `check:app-typecheck`, report verified, and\n * leave the application missing a settings section nobody is told about. Same class\n * as the FK-resolution sweep, and answered the same way: ask the working tree.\n */\n 'settings-placement-content',\n /**\n * Assertion Surface behaviors (app-creation meta-workflows, master\n * plan S1). Serve the authored `AssertionSpecificationSnapshot` from\n * the specifications target:\n *\n * - `assertions-list` — authored entries, filtered by lane / kind\n * (pure projection; no live registry).\n * - `assertions-resolve` — entries plus live probe findings derived\n * at query time against the resources registry (requires the\n * `library` target); the parent composes LLM interpretation on top.\n * - `assertions-reconcile` — computes per-entry status\n * (assumed → landed → drifted / unverifiable) by diffing authored\n * assumptions against introspected reality (requires `library`).\n *\n * Kebab-case string-tuple ids (the introspection plane convention —\n * one behavior id per operation, no `input.op` discriminator).\n */\n 'assertions-list',\n 'assertions-resolve',\n 'assertions-reconcile',\n /**\n * Top-down **definition-specifications** projection (app-creation\n * meta-workflows, journey-buildout GAP-D1-9). Serves the presence +\n * structural validity + cross-family coherence of the authored C-4\n * definition set (`vision-brief` / `market-snapshot` / `requirements` /\n * `roadmap` / `business-model`) off the specifications target's companion\n * exports. Runs each family's `_core` validator (shared with the\n * journey-snapshot per-artifact validation seam) as a durable load-time\n * guard — an ERROR or an unresolved cross-family ref fails closed instead of\n * shipping silently. Pure/deterministic; no live registry, no LLM.\n */\n 'definition-specifications',\n /**\n * Brand logo-generation prompt assembly (app-creation meta-workflows —\n * brand-identity). Reads the authored `BrandSnapshot` off the specifications\n * target's companion exports, validates it (`validateBrandSnapshot`), and\n * assembles the text-to-image prompt (brand name + logo direction + visual\n * tone, optionally enriched by the market `tonesOfVoice`). Pure/deterministic\n * — no image call here; the parent `LogoGenerationCompanionService` invokes\n * the image agent with the returned prompt.\n */\n 'brand-render-prompt',\n /**\n * Expert-persona DERIVATION INPUTS projection (agentic deliberation\n * system, Step 2). Resolves the specification-tier snapshots a role's\n * charter derivation is shaped by (`shapingInputKinds` of the framework\n * `ExpertRoleTemplate`: vision / market / brand / requirements /\n * business-model / accepted-decisions), returning the resolved subset plus\n * the kinds that are missing (the parent derivation service fails closed\n * on missing kinds) and the kinds this target cannot resolve\n * (DESIGN_SYSTEM — the parent composes it from the frontend\n * `design-system-source-config` behavior). Pure/deterministic; no LLM.\n */\n 'expert-persona-derivation-inputs',\n /**\n * Committed expert-persona CHARTERS read-back (agentic deliberation\n * system). Serves the app's `expertPersonaCharters` companion export\n * (the accepted charters under `specifications/src/personas/`) — consumed\n * by the accept step's human-edit overwrite guard + validator run, and by\n * the deliberation system's startup agent factory. Pure/deterministic.\n */\n 'expert-persona-charters',\n /**\n * **compliance-primary-facts** — what a compliance document can say about this application,\n * derived from its resource configurations.\n *\n * Reads the five compliance-bearing declarations off every materialized resource\n * (`retentionPolicy.mode`, `dataSubjectPolicy.kind`, `systemAccessPolicy.exportSubject` and the\n * two retained see-through verbs) and reports them split by ORIGIN — engine-declared versus\n * application-declared. The split is the finding: the engine already answers most of a privacy\n * notice for every generated application, and what it cannot answer is the application's own\n * domain data about third parties, which is most of what such a notice exists to describe.\n *\n * Needs the `library` target (resource CONFIGS live in the app's shared-lib; the specifications\n * target carries SPECS, which do not hold these fields). Pure/deterministic, and modelless by\n * construction — every value is a lookup of a declaration already written down.\n */\n 'compliance-primary-facts',\n /**\n * **application-domain-model** — the observed application's resources, the module that owns each,\n * the relationships they participate in, and the prose of their specifications, in ONE projection.\n *\n * Needs BOTH targets, which is the whole point: module ownership and the specification overlay live\n * on the `specifications` target, the relationship edges on the `library` one. Reading them through\n * the two behaviors that already answer half each (`resource-specifications`, `resources-registry`)\n * means two subprocess runs against a working tree an operator is editing, so the nodes may come\n * from one state of the application and the edges from the next — a picture of an application that\n * never existed, with nothing to detect it.\n */\n 'application-domain-model',\n /**\n * **specification-artifacts** — every application-specification family the journey produces,\n * projected for a HUMAN reviewer rather than for a language model.\n *\n * The companion already reads this content: `market-context-for-icp`, `market-render-prompt`,\n * `brand-render-prompt`, `specification-context-parts` and their siblings all resolve the same\n * authored snapshots — and every one of them renders PROSE FOR A MODEL. The loading and resolution\n * paths were proven; the projection whose consumer is an operator did not exist, so a creator could\n * not review what the journey had decided about their product without opening TypeScript files\n * (issue #162).\n *\n * Enumerates `APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS` — so the population cannot drift\n * from the authority — and, per family, reports whether it landed, whether its own `_core`\n * validator still passes, which playbooks produce it, and the artifact rendered as a document.\n *\n * ## Where it deliberately differs from `definition-specifications`\n *\n * That behavior THROWS on any ERROR-severity structural issue, which is correct for a load-time\n * guard and exactly wrong here: it would make an invalid artifact the one thing a reviewer cannot\n * look at, at the moment they most need to. This one REPORTS. Both run the same validators through\n * the same authority, so they cannot disagree about what is valid — only about what to do about it.\n *\n * Pure/deterministic and modelless. `specifications` target only: every family's accepted value is\n * a companion export of that package.\n */\n 'specification-artifacts',\n 'family-aspects',\n] as const;\nexport type CompanionIntrospectionBehaviorId = typeof CompanionIntrospectionBehaviorIdValues[number];\n\nexport const CompanionIntrospectionBehaviorCategoryValues = [\n 'resources',\n 'translation',\n 'email',\n 'frontend-design-system',\n 'labels',\n 'specifications',\n 'market',\n 'brand',\n 'expert-personas',\n 'technical-doc',\n 'charts',\n 'assertions',\n] as const;\nexport type CompanionIntrospectionBehaviorCategory =\n typeof CompanionIntrospectionBehaviorCategoryValues[number];\n\nexport const CompanionIntrospectionMaterializationKindValues = [\n 'json-snapshot',\n 'text-artifact',\n] as const;\nexport type CompanionIntrospectionMaterializationKind =\n typeof CompanionIntrospectionMaterializationKindValues[number];\n\nexport interface CompanionIntrospectionBehaviorRoutingDefinition {\n target: CompanionIntrospectionRouteTargetId;\n requiredTargets?: CompanionIntrospectionRouteTargetId[];\n}\n\nexport interface CompanionIntrospectionBehaviorExecutionDefinition {\n materializationBoundary: 'subprocess';\n compositionBoundary: 'parent';\n materializationKind: CompanionIntrospectionMaterializationKind;\n}\n\nexport interface CompanionIntrospectionBehaviorDefinition {\n behaviorId: CompanionIntrospectionBehaviorId;\n description: string;\n category: CompanionIntrospectionBehaviorCategory;\n supportedServiceKinds: CompanionIntrospectionServiceKind[];\n routingByServiceKind: Partial<\n Record<CompanionIntrospectionServiceKind, CompanionIntrospectionBehaviorRoutingDefinition>\n >;\n execution: CompanionIntrospectionBehaviorExecutionDefinition;\n}\n\nexport interface CompanionIntrospectionResolvedBehaviorDefinition {\n behaviorId: CompanionIntrospectionBehaviorId;\n description: string;\n category: CompanionIntrospectionBehaviorCategory;\n serviceKind: CompanionIntrospectionServiceKind;\n route: CompanionIntrospectionBehaviorRoutingDefinition;\n execution: CompanionIntrospectionBehaviorExecutionDefinition;\n}\n\nexport interface CompanionIntrospectionResolvedPackageTarget {\n targetId: CompanionIntrospectionRouteTargetId;\n packageRoot: string;\n entryPath: string;\n declaredPath?: string;\n}\n\n/**\n * Minimal trusted homes snapshot passed from the parent companion process into\n * introspection children so subprocesses never need to rediscover app or\n * framework roots from cwd.\n */\nexport interface CompanionIntrospectionHomesSnapshot {\n appDeclarationRoot: string;\n appRuntimeHome: string;\n companionHome: string;\n frameworkRepositoryRoot: string | null;\n}\n\nexport interface CompanionIntrospectionRequest {\n serviceKey: string;\n behavior: CompanionIntrospectionBehaviorId;\n input?: unknown;\n}\n\nexport interface CompanionIntrospectionResolvedTarget {\n serviceKey: string;\n servicePath: string;\n serviceName: string;\n serviceKind: CompanionIntrospectionServiceKind;\n behavior: CompanionIntrospectionBehaviorId;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n packageRoot: string;\n entryPath: string;\n resolvedTargets: Partial<Record<CompanionIntrospectionRouteTargetId, CompanionIntrospectionResolvedPackageTarget>>;\n resolvedBehavior: CompanionIntrospectionResolvedBehaviorDefinition;\n input?: unknown;\n}\n\nexport interface CompanionIntrospectionChildRequest {\n behavior: CompanionIntrospectionBehaviorId;\n serviceKind: CompanionIntrospectionServiceKind;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n serviceKey: string;\n entryPath: string;\n packageRoot: string;\n homes: CompanionIntrospectionHomesSnapshot;\n resolvedTargets: Partial<Record<CompanionIntrospectionRouteTargetId, CompanionIntrospectionResolvedPackageTarget>>;\n input?: unknown;\n}\n\nexport interface CompanionIntrospectionErrorDetails {\n message: string;\n name?: string;\n stack?: string;\n}\n\nexport interface CompanionIntrospectionSuccessResult {\n success: true;\n behavior: CompanionIntrospectionBehaviorId;\n serviceKey: string;\n serviceKind: CompanionIntrospectionServiceKind;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n data: unknown;\n durationMs: number;\n stdout?: string;\n stderr?: string;\n /**\n * Set when this exact derivation was memoized against a source-tree observation that still matches,\n * so no subprocess ran and no application module graph was re-imported.\n *\n * Provenance, not a control: `durationMs` stays the ORIGINAL derivation's cost, because that is the\n * number the acceptance measurement is about. Absent on a freshly derived result rather than\n * `false`, so a consumer reading it can tell \"not cached\" from \"an older companion that had no\n * cache\".\n */\n servedFromCache?: true;\n}\n\nexport interface CompanionIntrospectionFailureResult {\n success: false;\n behavior: CompanionIntrospectionBehaviorId;\n serviceKey: string;\n serviceKind: CompanionIntrospectionServiceKind;\n behaviorCategory: CompanionIntrospectionBehaviorCategory;\n materializationKind: CompanionIntrospectionMaterializationKind;\n targetId: CompanionIntrospectionRouteTargetId;\n durationMs: number;\n error: CompanionIntrospectionErrorDetails;\n stdout?: string;\n stderr?: string;\n}\n\nexport type CompanionIntrospectionResult =\n | CompanionIntrospectionSuccessResult\n | CompanionIntrospectionFailureResult;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ResourceCustomServiceImplementationFactory } from '@wildo-ai/saas-backend-lib';
|
|
2
|
+
/**
|
|
3
|
+
* The factories `customImplRegistry.initialize()` consumes — companion startup passes exactly this
|
|
4
|
+
* list after the workbench resources register (registrations validate against configured operation
|
|
5
|
+
* paths at init, so a drifting identifier fails the boot instead of becoming unreachable code).
|
|
6
|
+
*/
|
|
7
|
+
export declare function createCreationPlaneDispatchFactories(): ResourceCustomServiceImplementationFactory[];
|
|
8
|
+
//# sourceMappingURL=creation-plane-dispatch.custom-impl.companion.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creation-plane-dispatch.custom-impl.companion.service.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4BAA4B,CAAC;AA8WpC;;;;GAIG;AACH,wBAAgB,oCAAoC,IAAI,0CAA0C,EAAE,CAOnG"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { PlaybookClarificationAction, PlaybookElicitationError } from '@wildo-ai/application-creation-runtime';
|
|
2
|
+
import { ErrorCustomMessageReference, ErrorType, ResourceOperationVariantType, } from '@wildo-ai/saas-models';
|
|
3
|
+
import { Workbench_BuildPlanDispatchNextRequest_Schema, Workbench_BuildPlanDispatchOutcome_Schema, Workbench_PlaybookResumeRequest_Schema, Workbench_PlaybookRunOutcome_Schema, Workbench_PlaybookRunRequest_Schema, Workbench_RunWriteRevertOutcome_Schema, Workbench_RunWriteRevertRequest_Schema, WorkbenchBuildPlanTasks_Operations, WorkbenchCreationPlaneBehavior, WorkbenchPlaybooks_Operations, WorkbenchRunWriteRecords_Operations, WorkbenchShared_ResourceType, } from '@wildo-ai/platform-core-shared';
|
|
4
|
+
import { createResourceCustomServiceImplementation, } from '@wildo-ai/saas-backend-lib';
|
|
5
|
+
import { COMPANION_SERVICE_TYPES } from '../../inject/models/service-types.js';
|
|
6
|
+
import { PlaybookLoopAlreadyRunningError, PlaybookNotReadyError, UnknownPlaybookError, } from '../../../meta-workflows/services/playbook-run.companion.service.js';
|
|
7
|
+
import { SuspendedPlaybookRunNotFoundError } from '../../../meta-workflows/services/playbook-suspended-run.companion.service.js';
|
|
8
|
+
import { FoundationExecutionError } from '../../../meta-workflows/services/foundation-executor.companion.service.js';
|
|
9
|
+
import { ApplicationBuildPlanExhaustedError, ApplicationBuildPlanUnavailableError, } from '../../../meta-workflows/services/application-build-dispatch.companion.service.js';
|
|
10
|
+
import { PlaybookRunWriteRecordNotFoundError } from '../../../meta-workflows/services/playbook-run-write-register.companion.service.js';
|
|
11
|
+
import { sanitizeCreationPlaneIdentity, } from './creation-plane-projection.companion.service.js';
|
|
12
|
+
import { CompanionTraceabilityLevel } from '../../traceability/companion-traceability.models.js';
|
|
13
|
+
/**
|
|
14
|
+
* The creation board's DISPATCHES as custom-operation implementations — Phase 3 of
|
|
15
|
+
* `workbench-creation-board-resources.md` (plan D3).
|
|
16
|
+
*
|
|
17
|
+
* Every handler is `OVERRIDE_ALL`, deliberately and necessarily: the framework pipeline still runs
|
|
18
|
+
* everything a dispatch WANTS from it — authentication, the role gate, request-DTO validation, the
|
|
19
|
+
* `currentObject` preflight READ — and the override returns before everything a derived resource
|
|
20
|
+
* CANNOT give it: the repository write the introspection adapter refuses, and the transaction
|
|
21
|
+
* machinery there is nothing to transact against. The work itself is a delegation to the same
|
|
22
|
+
* companion services the bespoke routes call; those routes survive for the CLI, and both doors now
|
|
23
|
+
* converge on one service seam.
|
|
24
|
+
*
|
|
25
|
+
* ## Identity resolution is a LOOKUP, never a reverse-sanitization
|
|
26
|
+
*
|
|
27
|
+
* An instance-targeted dispatch arrives addressed by the row's SANITIZED id
|
|
28
|
+
* (`top_down__phase-gate`). The sanitizer is not injective in general, so the handlers resolve the
|
|
29
|
+
* business key by matching the sanitized form against the live rows (playbooks: the cached
|
|
30
|
+
* eligibility derivation; write records: the register list) — exact, and refusing honestly when
|
|
31
|
+
* nothing matches.
|
|
32
|
+
*
|
|
33
|
+
* ## Cache invalidation
|
|
34
|
+
*
|
|
35
|
+
* A run or resume that lands files already invalidates the eligibility cache through the write
|
|
36
|
+
* register's mutation seam. The explicit `invalidateEligibility()` after run/resume/dispatch covers
|
|
37
|
+
* the outcomes that DON'T write (a refusal that consumed budget state, a clarification stop, a
|
|
38
|
+
* dispatch that only started a coding run) — the board must not answer "as of before your dispatch"
|
|
39
|
+
* to the person who just dispatched.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Translate the companion services' NAMED refusals into the transport-honest errors the bespoke
|
|
43
|
+
* routes answer — mirroring the controller's own mapping, so a refusal reads the same through both
|
|
44
|
+
* doors. Anything unnamed propagates untouched and surfaces as the 500 it is.
|
|
45
|
+
*
|
|
46
|
+
* The controller maps almost all of these to VALIDATION (400) with the message carried verbatim —
|
|
47
|
+
* a refusal from this plane is nearly always actionable ("no ready build-plan task", "no suspended
|
|
48
|
+
* run") — and the one genuinely stateful collision (a loop already holding the lane) to CONFLICT.
|
|
49
|
+
*/
|
|
50
|
+
function translateCreationPlaneDispatchError(error, executionContext, utils) {
|
|
51
|
+
/*
|
|
52
|
+
* Called THROUGH the builder object, never extracted: `buildError` reads `this` internally
|
|
53
|
+
* (`executeBackendActions`), and a detached reference throws `Cannot read properties of
|
|
54
|
+
* undefined` from inside the error path — measured live, an error builder failing to build the
|
|
55
|
+
* error it was translating.
|
|
56
|
+
*/
|
|
57
|
+
const builder = utils.errorBuilder;
|
|
58
|
+
if (error instanceof PlaybookLoopAlreadyRunningError) {
|
|
59
|
+
return builder.buildError(ErrorType.CONFLICT, executionContext, {
|
|
60
|
+
customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,
|
|
61
|
+
context: { message: error.message },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (error instanceof UnknownPlaybookError
|
|
65
|
+
|| error instanceof PlaybookNotReadyError
|
|
66
|
+
/* A declared interview missing an answer — found live: `run(domain-plan)` without `tenancy`. */
|
|
67
|
+
|| error instanceof PlaybookElicitationError
|
|
68
|
+
|| error instanceof FoundationExecutionError
|
|
69
|
+
|| error instanceof SuspendedPlaybookRunNotFoundError
|
|
70
|
+
|| error instanceof ApplicationBuildPlanUnavailableError
|
|
71
|
+
|| error instanceof ApplicationBuildPlanExhaustedError
|
|
72
|
+
|| error instanceof PlaybookRunWriteRecordNotFoundError) {
|
|
73
|
+
return builder.buildError(ErrorType.VALIDATION, executionContext, {
|
|
74
|
+
customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,
|
|
75
|
+
context: { message: error.message },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const CREATION_PLANE_DISPATCH_PATH_BASE = {
|
|
81
|
+
variantType: ResourceOperationVariantType.API_CALL,
|
|
82
|
+
isOperationDefault: true,
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Open a trace session for one board dispatch — the parity the bespoke routes get from
|
|
86
|
+
* `attachRequestTraceSession` middleware, which the resource lane bypasses (the engine's controller
|
|
87
|
+
* mounts these operations, so no companion middleware runs). Without it a dispatched run has no
|
|
88
|
+
* trace directory, a `run-` prefixed runId (the `session?.sessionId ?? 'run'` fallback), and a
|
|
89
|
+
* null `workbenchTraceSessionId` join key on its write record — issue #238, measured live.
|
|
90
|
+
*
|
|
91
|
+
* Opening is unconditional and cheap: session factories do no disk I/O until the first event or
|
|
92
|
+
* artifact that passes the level gate, so an untraced deployment pays nothing.
|
|
93
|
+
*/
|
|
94
|
+
function openDispatchTraceSession(container, routePath) {
|
|
95
|
+
const traceability = container.get(COMPANION_SERVICE_TYPES.TraceabilityService);
|
|
96
|
+
const session = traceability.createApiRequestSession({
|
|
97
|
+
method: 'put',
|
|
98
|
+
routePath,
|
|
99
|
+
urlPath: routePath,
|
|
100
|
+
// ip/userAgent are genuinely unavailable here: the resource lane's handlers never see the
|
|
101
|
+
// Express request. Everything else matches the middleware's bookkeeping.
|
|
102
|
+
});
|
|
103
|
+
// Middleware parity (completion-review finding 11b): the bespoke routes bookend each request
|
|
104
|
+
// with start/finish events; the dispatch lane emits the same pair so a session dir reads the
|
|
105
|
+
// same either way. Fire-and-forget like the middleware's own emits.
|
|
106
|
+
void traceability.traceEvent({
|
|
107
|
+
session,
|
|
108
|
+
minimumLevel: CompanionTraceabilityLevel.DEBUG,
|
|
109
|
+
type: 'api-request-start',
|
|
110
|
+
summary: `Start PUT ${routePath}`,
|
|
111
|
+
payload: { method: 'PUT', url: routePath },
|
|
112
|
+
});
|
|
113
|
+
return session;
|
|
114
|
+
}
|
|
115
|
+
/** The finish half of the bookend pair — called from each dispatch handler's `finally`. */
|
|
116
|
+
function closeDispatchTraceSession(container, session, routePath, outcome) {
|
|
117
|
+
const traceability = container.get(COMPANION_SERVICE_TYPES.TraceabilityService);
|
|
118
|
+
void traceability.traceEvent({
|
|
119
|
+
session,
|
|
120
|
+
minimumLevel: CompanionTraceabilityLevel.DEBUG,
|
|
121
|
+
type: 'api-request-finish',
|
|
122
|
+
summary: `Finish PUT ${routePath} (${outcome})`,
|
|
123
|
+
payload: { method: 'PUT', url: routePath, outcome },
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function buildPlaybookRunFactory(container) {
|
|
127
|
+
return createResourceCustomServiceImplementation({
|
|
128
|
+
operationPath: {
|
|
129
|
+
...CREATION_PLANE_DISPATCH_PATH_BASE,
|
|
130
|
+
resourceIdentifier: WorkbenchShared_ResourceType.PLAYBOOKS,
|
|
131
|
+
operationIdentifier: WorkbenchPlaybooks_Operations.RUN,
|
|
132
|
+
},
|
|
133
|
+
requestDtoSchema: Workbench_PlaybookRunRequest_Schema,
|
|
134
|
+
responseDtoSchema: Workbench_PlaybookRunOutcome_Schema,
|
|
135
|
+
debugLabel: 'creation-plane.playbooks.run',
|
|
136
|
+
handlers: {
|
|
137
|
+
overrideAll: async (id, input, executionContext, _operationPath, utils) => {
|
|
138
|
+
const projection = container.get(COMPANION_SERVICE_TYPES.CreationPlaneProjectionService);
|
|
139
|
+
const playbookRunService = container.get(COMPANION_SERVICE_TYPES.PlaybookRunService);
|
|
140
|
+
const rowId = String(id ?? '');
|
|
141
|
+
const rows = await projection.deriveRows(WorkbenchCreationPlaneBehavior.PLAYBOOK_ELIGIBILITY);
|
|
142
|
+
const row = rows.find((candidate) => candidate.workbenchPlaybookId === rowId);
|
|
143
|
+
if (!row) {
|
|
144
|
+
throw utils.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {
|
|
145
|
+
customMessageReference: ErrorCustomMessageReference.NOT_FOUND,
|
|
146
|
+
context: { message: `No playbook row matches id "${rowId}".` },
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const request = (input ?? {});
|
|
150
|
+
const runRoute = `/workbench-playbooks/${rowId}/run`;
|
|
151
|
+
const session = openDispatchTraceSession(container, runRoute);
|
|
152
|
+
let outcome = 'error';
|
|
153
|
+
try {
|
|
154
|
+
const result = await playbookRunService.runPlaybook({
|
|
155
|
+
playbookRef: String(row.playbookRef),
|
|
156
|
+
session,
|
|
157
|
+
...(request.creatorBrief ? { creatorBrief: request.creatorBrief } : {}),
|
|
158
|
+
...(request.elicitationAnswers?.length ? { elicitationAnswers: request.elicitationAnswers } : {}),
|
|
159
|
+
...(request.dryRun ? { dryRun: true } : {}),
|
|
160
|
+
});
|
|
161
|
+
outcome = 'success';
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
projection.invalidateEligibility();
|
|
169
|
+
closeDispatchTraceSession(container, session, runRoute, outcome);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function buildPlaybookResumeFactory(container) {
|
|
176
|
+
return createResourceCustomServiceImplementation({
|
|
177
|
+
operationPath: {
|
|
178
|
+
...CREATION_PLANE_DISPATCH_PATH_BASE,
|
|
179
|
+
resourceIdentifier: WorkbenchShared_ResourceType.PLAYBOOKS,
|
|
180
|
+
operationIdentifier: WorkbenchPlaybooks_Operations.RESUME,
|
|
181
|
+
},
|
|
182
|
+
requestDtoSchema: Workbench_PlaybookResumeRequest_Schema,
|
|
183
|
+
responseDtoSchema: Workbench_PlaybookRunOutcome_Schema,
|
|
184
|
+
debugLabel: 'creation-plane.playbooks.resume',
|
|
185
|
+
handlers: {
|
|
186
|
+
overrideAll: async (_id, input, executionContext, _operationPath, utils) => {
|
|
187
|
+
const projection = container.get(COMPANION_SERVICE_TYPES.CreationPlaneProjectionService);
|
|
188
|
+
const playbookRunService = container.get(COMPANION_SERVICE_TYPES.PlaybookRunService);
|
|
189
|
+
const request = (input ?? {});
|
|
190
|
+
const action = Object.values(PlaybookClarificationAction)
|
|
191
|
+
.find((candidate) => candidate === request.action);
|
|
192
|
+
if (!action || !request.runId) {
|
|
193
|
+
throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {
|
|
194
|
+
customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,
|
|
195
|
+
context: {
|
|
196
|
+
message: !request.runId
|
|
197
|
+
? '`runId` is required — it is the handle `run` returned when the derivation stopped to ask.'
|
|
198
|
+
: `Unknown action \`${request.action}\`. Expected one of: ${Object.values(PlaybookClarificationAction).join(', ')}.`,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/*
|
|
203
|
+
* "I answered" and "you decide" produce different artifacts, so an empty accept is refused
|
|
204
|
+
* rather than treated as a decline — mirroring the companion route's own contract.
|
|
205
|
+
*/
|
|
206
|
+
if (action === PlaybookClarificationAction.ACCEPT && !(request.answers?.length)) {
|
|
207
|
+
throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {
|
|
208
|
+
customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,
|
|
209
|
+
context: { message: '`accept` requires at least one answer.' },
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
const resumeRoute = '/workbench-playbooks/resume-run';
|
|
213
|
+
const session = openDispatchTraceSession(container, resumeRoute);
|
|
214
|
+
let outcome = 'error';
|
|
215
|
+
try {
|
|
216
|
+
const result = await playbookRunService.resumePlaybookRun({
|
|
217
|
+
runId: request.runId,
|
|
218
|
+
action,
|
|
219
|
+
session,
|
|
220
|
+
...(request.answers?.length ? { answers: request.answers } : {}),
|
|
221
|
+
});
|
|
222
|
+
outcome = 'success';
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
projection.invalidateEligibility();
|
|
230
|
+
closeDispatchTraceSession(container, session, resumeRoute, outcome);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function buildDispatchNextFactory(container) {
|
|
237
|
+
return createResourceCustomServiceImplementation({
|
|
238
|
+
operationPath: {
|
|
239
|
+
...CREATION_PLANE_DISPATCH_PATH_BASE,
|
|
240
|
+
resourceIdentifier: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS,
|
|
241
|
+
operationIdentifier: WorkbenchBuildPlanTasks_Operations.DISPATCH_NEXT,
|
|
242
|
+
},
|
|
243
|
+
requestDtoSchema: Workbench_BuildPlanDispatchNextRequest_Schema,
|
|
244
|
+
responseDtoSchema: Workbench_BuildPlanDispatchOutcome_Schema,
|
|
245
|
+
debugLabel: 'creation-plane.build-plan.dispatch-next',
|
|
246
|
+
handlers: {
|
|
247
|
+
overrideAll: async (_id, input, executionContext, _operationPath, utils) => {
|
|
248
|
+
const projection = container.get(COMPANION_SERVICE_TYPES.CreationPlaneProjectionService);
|
|
249
|
+
const buildDispatchService = container.get(COMPANION_SERVICE_TYPES.ApplicationBuildDispatchService);
|
|
250
|
+
const request = (input ?? {});
|
|
251
|
+
const dispatchRoute = '/workbench-build-plan-tasks/dispatch-next';
|
|
252
|
+
const session = openDispatchTraceSession(container, dispatchRoute);
|
|
253
|
+
let outcome = 'error';
|
|
254
|
+
try {
|
|
255
|
+
const result = await buildDispatchService.dispatchNextBuildTask(request.maximumTokenBudget ? { maximumTokenBudget: request.maximumTokenBudget } : {}, session);
|
|
256
|
+
outcome = 'success';
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;
|
|
261
|
+
}
|
|
262
|
+
finally {
|
|
263
|
+
projection.invalidateEligibility();
|
|
264
|
+
closeDispatchTraceSession(container, session, dispatchRoute, outcome);
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function buildRevertWritesFactory(container) {
|
|
271
|
+
return createResourceCustomServiceImplementation({
|
|
272
|
+
operationPath: {
|
|
273
|
+
...CREATION_PLANE_DISPATCH_PATH_BASE,
|
|
274
|
+
resourceIdentifier: WorkbenchShared_ResourceType.RUN_WRITE_RECORDS,
|
|
275
|
+
operationIdentifier: WorkbenchRunWriteRecords_Operations.REVERT,
|
|
276
|
+
},
|
|
277
|
+
requestDtoSchema: Workbench_RunWriteRevertRequest_Schema,
|
|
278
|
+
responseDtoSchema: Workbench_RunWriteRevertOutcome_Schema,
|
|
279
|
+
debugLabel: 'creation-plane.run-writes.revert',
|
|
280
|
+
handlers: {
|
|
281
|
+
overrideAll: async (id, input, executionContext, _operationPath, utils) => {
|
|
282
|
+
const runWriteRegister = container.get(COMPANION_SERVICE_TYPES.PlaybookRunWriteRegisterService);
|
|
283
|
+
const rowId = String(id ?? '');
|
|
284
|
+
const records = await runWriteRegister.list();
|
|
285
|
+
const record = records.find((candidate) => sanitizeCreationPlaneIdentity(candidate.runId) === rowId);
|
|
286
|
+
if (!record) {
|
|
287
|
+
throw utils.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {
|
|
288
|
+
customMessageReference: ErrorCustomMessageReference.NOT_FOUND,
|
|
289
|
+
context: { message: `No write record matches id "${rowId}".` },
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
const request = (input ?? {});
|
|
293
|
+
try {
|
|
294
|
+
// The register's own mutation seam invalidates the eligibility cache on a landed revert.
|
|
295
|
+
return await runWriteRegister.revert(record.runId, { force: request.force === true });
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The factories `customImplRegistry.initialize()` consumes — companion startup passes exactly this
|
|
306
|
+
* list after the workbench resources register (registrations validate against configured operation
|
|
307
|
+
* paths at init, so a drifting identifier fails the boot instead of becoming unreachable code).
|
|
308
|
+
*/
|
|
309
|
+
export function createCreationPlaneDispatchFactories() {
|
|
310
|
+
return [
|
|
311
|
+
(_registry, container) => buildPlaybookRunFactory(container),
|
|
312
|
+
(_registry, container) => buildPlaybookResumeFactory(container),
|
|
313
|
+
(_registry, container) => buildDispatchNextFactory(container),
|
|
314
|
+
(_registry, container) => buildRevertWritesFactory(container),
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=creation-plane-dispatch.custom-impl.companion.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creation-plane-dispatch.custom-impl.companion.service.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAC/G,OAAO,EACL,2BAA2B,EAC3B,SAAS,EACT,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6CAA6C,EAC7C,yCAAyC,EACzC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ACD,MAAM,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE,CAAwB,CAAC;gBACrD,IAAI,CAAC;oBACH,yFAAyF;oBACzF,OAAO,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC,CAAC;gBACxF,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,mCAAmC,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC;gBACrF,CAAC;YACH,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oCAAoC;IAClD,OAAO;QACL,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,uBAAuB,CAAC,SAAS,CAAC;QAC5D,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,0BAA0B,CAAC,SAAS,CAAC;QAC/D,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,wBAAwB,CAAC,SAAS,CAAC;QAC7D,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,wBAAwB,CAAC,SAAS,CAAC;KAC9D,CAAC;AACJ,CAAC","sourcesContent":["import type { Container } from 'inversify';\nimport { PlaybookClarificationAction, PlaybookElicitationError } from '@wildo-ai/application-creation-runtime';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n ResourceOperationVariantType,\n} from '@wildo-ai/saas-models';\nimport {\n Workbench_BuildPlanDispatchNextRequest_Schema,\n Workbench_BuildPlanDispatchOutcome_Schema,\n Workbench_PlaybookResumeRequest_Schema,\n Workbench_PlaybookRunOutcome_Schema,\n Workbench_PlaybookRunRequest_Schema,\n Workbench_RunWriteRevertOutcome_Schema,\n Workbench_RunWriteRevertRequest_Schema,\n WorkbenchBuildPlanTasks_Operations,\n WorkbenchCreationPlaneBehavior,\n WorkbenchPlaybooks_Operations,\n WorkbenchRunWriteRecords_Operations,\n WorkbenchShared_ResourceType,\n} from '@wildo-ai/platform-core-shared';\nimport {\n createResourceCustomServiceImplementation,\n type ResourceCustomServiceImplementationFactory,\n} from '@wildo-ai/saas-backend-lib';\n\nimport { COMPANION_SERVICE_TYPES } from '../../inject/models/service-types';\nimport {\n PlaybookLoopAlreadyRunningError,\n PlaybookNotReadyError,\n UnknownPlaybookError,\n type PlaybookRunCompanionService,\n} from '../../../meta-workflows/services/playbook-run.companion.service';\nimport { SuspendedPlaybookRunNotFoundError } from '../../../meta-workflows/services/playbook-suspended-run.companion.service';\nimport { FoundationExecutionError } from '../../../meta-workflows/services/foundation-executor.companion.service';\nimport {\n ApplicationBuildPlanExhaustedError,\n ApplicationBuildPlanUnavailableError,\n} from '../../../meta-workflows/services/application-build-dispatch.companion.service';\nimport { PlaybookRunWriteRecordNotFoundError } from '../../../meta-workflows/services/playbook-run-write-register.companion.service';\nimport type { ApplicationBuildDispatchCompanionService } from '../../../meta-workflows/services/application-build-dispatch.companion.service';\nimport type { PlaybookRunWriteRegisterCompanionService } from '../../../meta-workflows/services/playbook-run-write-register.companion.service';\nimport {\n CreationPlaneProjectionCompanionService,\n sanitizeCreationPlaneIdentity,\n} from './creation-plane-projection.companion.service';\nimport type { CompanionTraceabilityService } from '../../traceability/companion-traceability.service';\nimport { CompanionTraceabilityLevel } from '../../traceability/companion-traceability.models';\n\n/**\n * The creation board's DISPATCHES as custom-operation implementations — Phase 3 of\n * `workbench-creation-board-resources.md` (plan D3).\n *\n * Every handler is `OVERRIDE_ALL`, deliberately and necessarily: the framework pipeline still runs\n * everything a dispatch WANTS from it — authentication, the role gate, request-DTO validation, the\n * `currentObject` preflight READ — and the override returns before everything a derived resource\n * CANNOT give it: the repository write the introspection adapter refuses, and the transaction\n * machinery there is nothing to transact against. The work itself is a delegation to the same\n * companion services the bespoke routes call; those routes survive for the CLI, and both doors now\n * converge on one service seam.\n *\n * ## Identity resolution is a LOOKUP, never a reverse-sanitization\n *\n * An instance-targeted dispatch arrives addressed by the row's SANITIZED id\n * (`top_down__phase-gate`). The sanitizer is not injective in general, so the handlers resolve the\n * business key by matching the sanitized form against the live rows (playbooks: the cached\n * eligibility derivation; write records: the register list) — exact, and refusing honestly when\n * nothing matches.\n *\n * ## Cache invalidation\n *\n * A run or resume that lands files already invalidates the eligibility cache through the write\n * register's mutation seam. The explicit `invalidateEligibility()` after run/resume/dispatch covers\n * the outcomes that DON'T write (a refusal that consumed budget state, a clarification stop, a\n * dispatch that only started a coding run) — the board must not answer \"as of before your dispatch\"\n * to the person who just dispatched.\n */\n\n/**\n * Translate the companion services' NAMED refusals into the transport-honest errors the bespoke\n * routes answer — mirroring the controller's own mapping, so a refusal reads the same through both\n * doors. Anything unnamed propagates untouched and surfaces as the 500 it is.\n *\n * The controller maps almost all of these to VALIDATION (400) with the message carried verbatim —\n * a refusal from this plane is nearly always actionable (\"no ready build-plan task\", \"no suspended\n * run\") — and the one genuinely stateful collision (a loop already holding the lane) to CONFLICT.\n */\nfunction translateCreationPlaneDispatchError(\n error: unknown,\n executionContext: unknown,\n utils: { errorBuilder: { buildError: (...args: never[]) => unknown } },\n): unknown {\n /*\n * Called THROUGH the builder object, never extracted: `buildError` reads `this` internally\n * (`executeBackendActions`), and a detached reference throws `Cannot read properties of\n * undefined` from inside the error path — measured live, an error builder failing to build the\n * error it was translating.\n */\n const builder = utils.errorBuilder as unknown as {\n buildError: (\n type: ErrorType,\n ctx: unknown,\n params: { customMessageReference: ErrorCustomMessageReference; context: { message: string } },\n ) => unknown;\n };\n if (error instanceof PlaybookLoopAlreadyRunningError) {\n return builder.buildError(ErrorType.CONFLICT, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: { message: error.message },\n });\n }\n if (\n error instanceof UnknownPlaybookError\n || error instanceof PlaybookNotReadyError\n /* A declared interview missing an answer — found live: `run(domain-plan)` without `tenancy`. */\n || error instanceof PlaybookElicitationError\n || error instanceof FoundationExecutionError\n || error instanceof SuspendedPlaybookRunNotFoundError\n || error instanceof ApplicationBuildPlanUnavailableError\n || error instanceof ApplicationBuildPlanExhaustedError\n || error instanceof PlaybookRunWriteRecordNotFoundError\n ) {\n return builder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: { message: error.message },\n });\n }\n return undefined;\n}\n\nconst CREATION_PLANE_DISPATCH_PATH_BASE = {\n variantType: ResourceOperationVariantType.API_CALL,\n isOperationDefault: true,\n} as const;\n\n/**\n * Open a trace session for one board dispatch — the parity the bespoke routes get from\n * `attachRequestTraceSession` middleware, which the resource lane bypasses (the engine's controller\n * mounts these operations, so no companion middleware runs). Without it a dispatched run has no\n * trace directory, a `run-` prefixed runId (the `session?.sessionId ?? 'run'` fallback), and a\n * null `workbenchTraceSessionId` join key on its write record — issue #238, measured live.\n *\n * Opening is unconditional and cheap: session factories do no disk I/O until the first event or\n * artifact that passes the level gate, so an untraced deployment pays nothing.\n */\nfunction openDispatchTraceSession(container: Container, routePath: string) {\n const traceability = container.get<CompanionTraceabilityService>(\n COMPANION_SERVICE_TYPES.TraceabilityService,\n );\n const session = traceability.createApiRequestSession({\n method: 'put',\n routePath,\n urlPath: routePath,\n // ip/userAgent are genuinely unavailable here: the resource lane's handlers never see the\n // Express request. Everything else matches the middleware's bookkeeping.\n });\n // Middleware parity (completion-review finding 11b): the bespoke routes bookend each request\n // with start/finish events; the dispatch lane emits the same pair so a session dir reads the\n // same either way. Fire-and-forget like the middleware's own emits.\n void traceability.traceEvent({\n session,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'api-request-start',\n summary: `Start PUT ${routePath}`,\n payload: { method: 'PUT', url: routePath },\n });\n return session;\n}\n\n/** The finish half of the bookend pair — called from each dispatch handler's `finally`. */\nfunction closeDispatchTraceSession(\n container: Container,\n session: ReturnType<CompanionTraceabilityService['createApiRequestSession']>,\n routePath: string,\n outcome: 'success' | 'error',\n): void {\n const traceability = container.get<CompanionTraceabilityService>(\n COMPANION_SERVICE_TYPES.TraceabilityService,\n );\n void traceability.traceEvent({\n session,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: 'api-request-finish',\n summary: `Finish PUT ${routePath} (${outcome})`,\n payload: { method: 'PUT', url: routePath, outcome },\n });\n}\n\nfunction buildPlaybookRunFactory(container: Container) {\n return createResourceCustomServiceImplementation({\n operationPath: {\n ...CREATION_PLANE_DISPATCH_PATH_BASE,\n resourceIdentifier: WorkbenchShared_ResourceType.PLAYBOOKS,\n operationIdentifier: WorkbenchPlaybooks_Operations.RUN,\n },\n requestDtoSchema: Workbench_PlaybookRunRequest_Schema,\n responseDtoSchema: Workbench_PlaybookRunOutcome_Schema,\n debugLabel: 'creation-plane.playbooks.run',\n handlers: {\n overrideAll: async (id, input, executionContext, _operationPath, utils) => {\n const projection = container.get<CreationPlaneProjectionCompanionService>(\n COMPANION_SERVICE_TYPES.CreationPlaneProjectionService,\n );\n const playbookRunService = container.get<PlaybookRunCompanionService>(\n COMPANION_SERVICE_TYPES.PlaybookRunService,\n );\n const rowId = String(id ?? '');\n const rows = await projection.deriveRows(WorkbenchCreationPlaneBehavior.PLAYBOOK_ELIGIBILITY);\n const row = rows.find((candidate) => candidate.workbenchPlaybookId === rowId);\n if (!row) {\n throw utils.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: { message: `No playbook row matches id \"${rowId}\".` },\n });\n }\n const request = (input ?? {}) as {\n creatorBrief?: string;\n elicitationAnswers?: readonly { questionRef: string; answer: string }[];\n dryRun?: boolean;\n };\n const runRoute = `/workbench-playbooks/${rowId}/run`;\n const session = openDispatchTraceSession(container, runRoute);\n let outcome: 'success' | 'error' = 'error';\n try {\n const result = await playbookRunService.runPlaybook({\n playbookRef: String(row.playbookRef),\n session,\n ...(request.creatorBrief ? { creatorBrief: request.creatorBrief } : {}),\n ...(request.elicitationAnswers?.length ? { elicitationAnswers: request.elicitationAnswers } : {}),\n ...(request.dryRun ? { dryRun: true } : {}),\n });\n outcome = 'success';\n return result;\n } catch (error) {\n throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;\n } finally {\n projection.invalidateEligibility();\n closeDispatchTraceSession(container, session, runRoute, outcome);\n }\n },\n },\n });\n}\n\nfunction buildPlaybookResumeFactory(container: Container) {\n return createResourceCustomServiceImplementation({\n operationPath: {\n ...CREATION_PLANE_DISPATCH_PATH_BASE,\n resourceIdentifier: WorkbenchShared_ResourceType.PLAYBOOKS,\n operationIdentifier: WorkbenchPlaybooks_Operations.RESUME,\n },\n requestDtoSchema: Workbench_PlaybookResumeRequest_Schema,\n responseDtoSchema: Workbench_PlaybookRunOutcome_Schema,\n debugLabel: 'creation-plane.playbooks.resume',\n handlers: {\n overrideAll: async (_id, input, executionContext, _operationPath, utils) => {\n const projection = container.get<CreationPlaneProjectionCompanionService>(\n COMPANION_SERVICE_TYPES.CreationPlaneProjectionService,\n );\n const playbookRunService = container.get<PlaybookRunCompanionService>(\n COMPANION_SERVICE_TYPES.PlaybookRunService,\n );\n const request = (input ?? {}) as {\n runId?: string;\n action?: string;\n answers?: readonly { ref: string; answer: string }[];\n };\n const action = Object.values(PlaybookClarificationAction)\n .find((candidate) => candidate === request.action);\n if (!action || !request.runId) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n message: !request.runId\n ? '`runId` is required — it is the handle `run` returned when the derivation stopped to ask.'\n : `Unknown action \\`${request.action}\\`. Expected one of: ${Object.values(PlaybookClarificationAction).join(', ')}.`,\n },\n });\n }\n /*\n * \"I answered\" and \"you decide\" produce different artifacts, so an empty accept is refused\n * rather than treated as a decline — mirroring the companion route's own contract.\n */\n if (action === PlaybookClarificationAction.ACCEPT && !(request.answers?.length)) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: { message: '`accept` requires at least one answer.' },\n });\n }\n const resumeRoute = '/workbench-playbooks/resume-run';\n const session = openDispatchTraceSession(container, resumeRoute);\n let outcome: 'success' | 'error' = 'error';\n try {\n const result = await playbookRunService.resumePlaybookRun({\n runId: request.runId,\n action,\n session,\n ...(request.answers?.length ? { answers: request.answers } : {}),\n });\n outcome = 'success';\n return result;\n } catch (error) {\n throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;\n } finally {\n projection.invalidateEligibility();\n closeDispatchTraceSession(container, session, resumeRoute, outcome);\n }\n },\n },\n });\n}\n\nfunction buildDispatchNextFactory(container: Container) {\n return createResourceCustomServiceImplementation({\n operationPath: {\n ...CREATION_PLANE_DISPATCH_PATH_BASE,\n resourceIdentifier: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS,\n operationIdentifier: WorkbenchBuildPlanTasks_Operations.DISPATCH_NEXT,\n },\n requestDtoSchema: Workbench_BuildPlanDispatchNextRequest_Schema,\n responseDtoSchema: Workbench_BuildPlanDispatchOutcome_Schema,\n debugLabel: 'creation-plane.build-plan.dispatch-next',\n handlers: {\n overrideAll: async (_id, input, executionContext, _operationPath, utils) => {\n const projection = container.get<CreationPlaneProjectionCompanionService>(\n COMPANION_SERVICE_TYPES.CreationPlaneProjectionService,\n );\n const buildDispatchService = container.get<ApplicationBuildDispatchCompanionService>(\n COMPANION_SERVICE_TYPES.ApplicationBuildDispatchService,\n );\n const request = (input ?? {}) as { maximumTokenBudget?: number };\n const dispatchRoute = '/workbench-build-plan-tasks/dispatch-next';\n const session = openDispatchTraceSession(container, dispatchRoute);\n let outcome: 'success' | 'error' = 'error';\n try {\n const result = await buildDispatchService.dispatchNextBuildTask(\n request.maximumTokenBudget ? { maximumTokenBudget: request.maximumTokenBudget } : {},\n session,\n );\n outcome = 'success';\n return result;\n } catch (error) {\n throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;\n } finally {\n projection.invalidateEligibility();\n closeDispatchTraceSession(container, session, dispatchRoute, outcome);\n }\n },\n },\n });\n}\n\nfunction buildRevertWritesFactory(container: Container) {\n return createResourceCustomServiceImplementation({\n operationPath: {\n ...CREATION_PLANE_DISPATCH_PATH_BASE,\n resourceIdentifier: WorkbenchShared_ResourceType.RUN_WRITE_RECORDS,\n operationIdentifier: WorkbenchRunWriteRecords_Operations.REVERT,\n },\n requestDtoSchema: Workbench_RunWriteRevertRequest_Schema,\n responseDtoSchema: Workbench_RunWriteRevertOutcome_Schema,\n debugLabel: 'creation-plane.run-writes.revert',\n handlers: {\n overrideAll: async (id, input, executionContext, _operationPath, utils) => {\n const runWriteRegister = container.get<PlaybookRunWriteRegisterCompanionService>(\n COMPANION_SERVICE_TYPES.PlaybookRunWriteRegisterService,\n );\n const rowId = String(id ?? '');\n const records = await runWriteRegister.list();\n const record = records.find(\n (candidate) => sanitizeCreationPlaneIdentity(candidate.runId) === rowId,\n );\n if (!record) {\n throw utils.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: { message: `No write record matches id \"${rowId}\".` },\n });\n }\n const request = (input ?? {}) as { force?: boolean };\n try {\n // The register's own mutation seam invalidates the eligibility cache on a landed revert.\n return await runWriteRegister.revert(record.runId, { force: request.force === true });\n } catch (error) {\n throw translateCreationPlaneDispatchError(error, executionContext, utils) ?? error;\n }\n },\n },\n });\n}\n\n/**\n * The factories `customImplRegistry.initialize()` consumes — companion startup passes exactly this\n * list after the workbench resources register (registrations validate against configured operation\n * paths at init, so a drifting identifier fails the boot instead of becoming unreachable code).\n */\nexport function createCreationPlaneDispatchFactories(): ResourceCustomServiceImplementationFactory[] {\n return [\n (_registry, container) => buildPlaybookRunFactory(container),\n (_registry, container) => buildPlaybookResumeFactory(container),\n (_registry, container) => buildDispatchNextFactory(container),\n (_registry, container) => buildRevertWritesFactory(container),\n ];\n}\n"]}
|
package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { sanitizeWorkbenchCreationPlaneIdentity } from '@wildo-ai/platform-core-shared';
|
|
2
|
+
import type { PlaybookRunCompanionService } from '../../../meta-workflows/services/playbook-run.companion.service';
|
|
3
|
+
import type { ApplicationBuildDispatchCompanionService } from '../../../meta-workflows/services/application-build-dispatch.companion.service';
|
|
4
|
+
import type { PlaybookRunWriteRegisterCompanionService } from '../../../meta-workflows/services/playbook-run-write-register.companion.service';
|
|
5
|
+
import type { ExecutionTraceReadCompanionService } from '../../../meta-workflows/services/execution-trace-read.companion.service';
|
|
6
|
+
/**
|
|
7
|
+
* Re-exported from the SHARED vocabulary (`@wildo-ai/platform-core-shared`), where the identity
|
|
8
|
+
* rule moved once the frontend needed it too — an interrupted run's re-dispatch derives the row
|
|
9
|
+
* address from its `playbookRef`. One named source; this alias keeps companion-side call sites
|
|
10
|
+
* and pins stable.
|
|
11
|
+
*/
|
|
12
|
+
export declare const sanitizeCreationPlaneIdentity: typeof sanitizeWorkbenchCreationPlaneIdentity;
|
|
13
|
+
export declare class CreationPlaneProjectionCompanionService {
|
|
14
|
+
private readonly playbookRunService;
|
|
15
|
+
private readonly buildDispatchService;
|
|
16
|
+
private readonly runWriteRegister;
|
|
17
|
+
private readonly executionTraceReadService;
|
|
18
|
+
private eligibilityCache;
|
|
19
|
+
private eligibilityCachedAtMs;
|
|
20
|
+
/**
|
|
21
|
+
* Bumped by every {@link invalidateEligibility}. A recompute captures it BEFORE deriving and
|
|
22
|
+
* refuses to populate the cache when it moved — without this, an invalidation that fires while
|
|
23
|
+
* a recompute is in flight (a poll-started derivation straddling a dispatch's post-operation
|
|
24
|
+
* invalidation) is silently cancelled out: the in-flight closure would repopulate the cache
|
|
25
|
+
* with the PRE-mutation board for up to the TTL, which is the exact "as of before your
|
|
26
|
+
* dispatch" answer this cache's contract forbids.
|
|
27
|
+
*/
|
|
28
|
+
private eligibilityEpoch;
|
|
29
|
+
/** Concurrent LISTs during a cold recompute share ONE derivation instead of stacking ~10s reads. */
|
|
30
|
+
private eligibilityInFlight;
|
|
31
|
+
constructor(playbookRunService: PlaybookRunCompanionService, buildDispatchService: ApplicationBuildDispatchCompanionService, runWriteRegister: PlaybookRunWriteRegisterCompanionService, executionTraceReadService: ExecutionTraceReadCompanionService);
|
|
32
|
+
supports(behaviorId: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Drop the eligibility cache. Called after every creation-plane mutation — the board must not
|
|
35
|
+
* answer "as of before your dispatch" to the person who just dispatched.
|
|
36
|
+
*/
|
|
37
|
+
invalidateEligibility(): void;
|
|
38
|
+
deriveRows(behaviorId: string): Promise<readonly Record<string, unknown>[]>;
|
|
39
|
+
private derivePlaybookEligibilityRows;
|
|
40
|
+
private deriveBuildPlanTaskRows;
|
|
41
|
+
private deriveRunWriteRecordRows;
|
|
42
|
+
private deriveTraceSessionRows;
|
|
43
|
+
private stampIdentities;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=creation-plane-projection.companion.service.d.ts.map
|
package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creation-plane-projection.companion.service.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/resources/creation-plane-projection.companion.service.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,sCAAsC,EACvC,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iEAAiE,CAAC;AACnH,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,+EAA+E,CAAC;AAC9I,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,gFAAgF,CAAC;AAC/I,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,yEAAyE,CAAC;AAwClI;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,+CAAyC,CAAC;AAEpF,qBACa,uCAAuC;IAiBhD,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAEnC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAErC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAEjC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAtB5C,OAAO,CAAC,gBAAgB,CAAiF;IACzG,OAAO,CAAC,qBAAqB,CAAK;IAClC;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB,CAAK;IAC7B,oGAAoG;IACpG,OAAO,CAAC,mBAAmB,CAA4D;gBAIpE,kBAAkB,EAAE,2BAA2B,EAE/C,oBAAoB,EAAE,wCAAwC,EAE9D,gBAAgB,EAAE,wCAAwC,EAE1D,yBAAyB,EAAE,kCAAkC;IAYzE,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI5C;;;OAGG;IACI,qBAAqB,IAAI,IAAI;IAYvB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;YAkB1E,6BAA6B;YAgD7B,uBAAuB;YAUvB,wBAAwB;YA2CxB,sBAAsB;IAgBpC,OAAO,CAAC,eAAe;CAsBxB"}
|