@wildo-ai/dev-companion 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +12 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +11 -0
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +153 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +419 -41
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +25 -10
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js +65 -24
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +86 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +127 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -0
- package/dist/esm/companion-api/companion-api.schemas.d.ts +59 -2
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +60 -0
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +322 -21
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/inject/models/container.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.js +11 -0
- package/dist/esm/core/inject/models/container.js.map +1 -1
- package/dist/esm/core/inject/models/service-types.d.ts +5 -0
- package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/core/inject/models/service-types.js +5 -0
- package/dist/esm/core/inject/models/service-types.js.map +1 -1
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.d.ts.map +1 -1
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js +81 -0
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts +11 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.js +39 -0
- package/dist/esm/core/introspection/models/companion-introspection.models.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +8 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +317 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts +45 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +250 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts +123 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js +298 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts +78 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js +155 -6
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +131 -2
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +259 -9
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +243 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +417 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +186 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +368 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts +101 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js +278 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts +365 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js +167 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +332 -3
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts +19 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +164 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +3 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +36 -23
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts +51 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +391 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -0
- package/dist/esm/core/runtime/companion-startup-assembly.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-startup-assembly.js +5 -0
- package/dist/esm/core/runtime/companion-startup-assembly.js.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +103 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js +124 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -0
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +39 -2
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +122 -11
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts +6 -0
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.js.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts +23 -0
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.js +26 -4
- package/dist/esm/core/specifications/specification-context-factory.shared.js.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts +82 -3
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +126 -12
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts +12 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js +12 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts +13 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.js +91 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.js.map +1 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts +38 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.js +41 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.js.map +1 -0
- package/dist/esm/i18n/index.d.ts +3 -3
- package/dist/esm/i18n/index.js +3 -3
- package/dist/esm/i18n/index.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts +24 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js +20 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts +31 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js +27 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts +24 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js +20 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +28 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +24 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts +138 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.js +100 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts +29 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.js +25 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts +27 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js +23 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +806 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +326 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts +26 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.js +22 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.js.map +1 -0
- package/dist/esm/i18n/system_enums/market.en.d.ts +202 -0
- package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -0
- package/dist/esm/i18n/system_enums/market.en.js +209 -0
- package/dist/esm/i18n/system_enums/market.en.js.map +1 -0
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +112 -2
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +201 -34
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts +31 -3
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js +48 -12
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts +36 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +75 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +105 -7
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +298 -24
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +46 -3
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +95 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts +9 -0
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js +13 -0
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +12 -0
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +23 -0
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +120 -3
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +636 -81
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts +40 -0
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js +63 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +21 -0
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.js +86 -2
- package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +12 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +47 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
- package/package.json +17 -17
- package/dist/esm/.builder.pid +0 -9
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts +0 -36
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts.map +0 -1
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.js +0 -32
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.js.map +0 -1
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts +0 -29
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts.map +0 -1
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js +0 -25
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js.map +0 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { FAMILY_ASPECTS_REGISTRY, FamilyAspectKind, } from '@wildo-ai/saas-specifications';
|
|
2
|
+
import { APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS } from '@wildo-ai/application-creation-runtime';
|
|
3
|
+
import { WORKBENCH_ASPECT_DESCRIPTORS, WorkbenchShared_ResourceFieldIdentifier, } from '@wildo-ai/platform-core-shared';
|
|
4
|
+
import { resolveSpecificationsCompanionExports } from './companion-introspection-module-exports.utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* FAMILY ASPECTS — every second-level aspect row of every landed family, in ONE projection.
|
|
7
|
+
*
|
|
8
|
+
* One behavior for forty resources, on the same single-import consistency argument as
|
|
9
|
+
* `application-domain-model`: the aspect rows CROSS-REFERENCE each other (a requirement's
|
|
10
|
+
* `icpRefs` must be routable against the ICP key set), so deriving them from one read of one
|
|
11
|
+
* companion-exports module is the only shape in which the graph's two ends describe the same
|
|
12
|
+
* working tree. Each aspect resource binds this behavior at its own `rowsPath`.
|
|
13
|
+
*
|
|
14
|
+
* ## What a row is
|
|
15
|
+
*
|
|
16
|
+
* The spine envelope (see `workbench-aspect-resources.custom.shared.schemas.ts`): composed
|
|
17
|
+
* identity, `family` backlink, `aspectKey`, `title` (the registry's headline field), the full
|
|
18
|
+
* item as `content`, plus the aspect's FLATTENED reference fields. Flattening happens here:
|
|
19
|
+
*
|
|
20
|
+
* - through-edges lift the key(s) out of edge objects (`jobs[].jobRef` → `jobRefs`),
|
|
21
|
+
* - multi-target edges route each key BY MEMBERSHIP into its per-target split field
|
|
22
|
+
* (`deliversRequirementRefs` → `deliversFunctionalRequirementRefs` + …); a key belonging to
|
|
23
|
+
* NO target keeps the graph honest by landing in none of them — the raw value stays readable
|
|
24
|
+
* in `content`, so a dangling ref is visible without becoming a dead reference control.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The headline value at a declared field path — plain-object segments only.
|
|
28
|
+
*
|
|
29
|
+
* A path rather than a key because a family's reader-facing name is not always top-level: a feature
|
|
30
|
+
* draft's is `draft.purpose`, under a wrapper that exists because the payload is authored ref-lessly.
|
|
31
|
+
* A missing segment yields `undefined` and the caller falls back to the row identity, so a drifted
|
|
32
|
+
* path degrades to the slug rather than throwing — and the registry pin is what stops it drifting.
|
|
33
|
+
*/
|
|
34
|
+
function resolveHeadlineValue(item, fieldPath) {
|
|
35
|
+
let current = item;
|
|
36
|
+
for (const segment of fieldPath.split('.')) {
|
|
37
|
+
if (current === null || typeof current !== 'object')
|
|
38
|
+
return undefined;
|
|
39
|
+
current = current[segment];
|
|
40
|
+
}
|
|
41
|
+
return current;
|
|
42
|
+
}
|
|
43
|
+
const DESCRIPTOR_BY_ASPECT_KEY = new Map(WORKBENCH_ASPECT_DESCRIPTORS.map((descriptor) => [descriptor.aspectKey, descriptor]));
|
|
44
|
+
export function projectFamilyAspects(input) {
|
|
45
|
+
const companionExports = resolveSpecificationsCompanionExports(input.moduleExports);
|
|
46
|
+
const bindingBySchemaRef = new Map(APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS.map((binding) => [binding.schemaRef, binding]));
|
|
47
|
+
// ── Pass 1: raw items per aspect (needed before edges — membership routing reads key sets). ──
|
|
48
|
+
const itemsByAspectKey = new Map();
|
|
49
|
+
for (const familyDeclaration of FAMILY_ASPECTS_REGISTRY) {
|
|
50
|
+
const binding = bindingBySchemaRef.get(familyDeclaration.schemaRef);
|
|
51
|
+
if (!binding)
|
|
52
|
+
continue;
|
|
53
|
+
const snapshot = binding.companionExportsField === undefined
|
|
54
|
+
? undefined
|
|
55
|
+
: companionExports[binding.companionExportsField];
|
|
56
|
+
for (const aspect of familyDeclaration.aspects) {
|
|
57
|
+
const member = snapshot?.[aspect.snapshotPath];
|
|
58
|
+
const items = aspect.kind === FamilyAspectKind.SINGLETON
|
|
59
|
+
? (member && typeof member === 'object' ? [member] : [])
|
|
60
|
+
: (Array.isArray(member) ? member : []);
|
|
61
|
+
itemsByAspectKey.set(aspect.key, { family: binding.family, items, declaration: aspect });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ── Key sets per aspect, for membership routing of multi-target edges. ──
|
|
65
|
+
const keySetByAspectKey = new Map();
|
|
66
|
+
for (const [aspectKey, { items, declaration }] of itemsByAspectKey) {
|
|
67
|
+
const keys = new Set();
|
|
68
|
+
if (declaration.businessKey !== undefined) {
|
|
69
|
+
for (const item of items) {
|
|
70
|
+
const value = item[declaration.businessKey];
|
|
71
|
+
if (typeof value === 'string')
|
|
72
|
+
keys.add(value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
keySetByAspectKey.set(aspectKey, keys);
|
|
76
|
+
}
|
|
77
|
+
// ── Pass 2: envelope rows. ──
|
|
78
|
+
const rowsByPath = {};
|
|
79
|
+
let totalRows = 0;
|
|
80
|
+
for (const [aspectKey, { family, items, declaration }] of itemsByAspectKey) {
|
|
81
|
+
const descriptor = DESCRIPTOR_BY_ASPECT_KEY.get(aspectKey);
|
|
82
|
+
if (!descriptor)
|
|
83
|
+
continue; // spine coverage is the parity test's business, not a crash site
|
|
84
|
+
// The projection must emit the exact composed field the spine's identifier map names.
|
|
85
|
+
const identityField = WorkbenchShared_ResourceFieldIdentifier[descriptor.resourceType];
|
|
86
|
+
rowsByPath[descriptor.rowsPath] = items.map((item, index) => {
|
|
87
|
+
const identity = declaration.businessKey !== undefined
|
|
88
|
+
? String(item[declaration.businessKey] ?? `${aspectKey}[${index}]`)
|
|
89
|
+
: declaration.kind === FamilyAspectKind.SINGLETON ? aspectKey : `${aspectKey}[${index}]`;
|
|
90
|
+
const headline = resolveHeadlineValue(item, declaration.headlineField);
|
|
91
|
+
const row = {
|
|
92
|
+
[identityField]: identity,
|
|
93
|
+
family,
|
|
94
|
+
aspectKey,
|
|
95
|
+
title: typeof headline === 'string' ? headline : identity,
|
|
96
|
+
content: item,
|
|
97
|
+
};
|
|
98
|
+
for (const edge of declaration.edges) {
|
|
99
|
+
applyEdge({ row, item, aspect: declaration, edge, descriptor, keySetByAspectKey });
|
|
100
|
+
}
|
|
101
|
+
return row;
|
|
102
|
+
});
|
|
103
|
+
totalRows += items.length;
|
|
104
|
+
}
|
|
105
|
+
const trace = {
|
|
106
|
+
aspects: itemsByAspectKey.size,
|
|
107
|
+
rows: totalRows,
|
|
108
|
+
evaluatedAt: input.evaluatedAt,
|
|
109
|
+
};
|
|
110
|
+
return { ...rowsByPath, trace };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Flatten one registry edge into the row's spine field(s).
|
|
114
|
+
*
|
|
115
|
+
* The spine field for a target is the descriptor edge whose `targetAspectKey` matches — unique
|
|
116
|
+
* per (aspect, target) by construction, and the parity test pins that uniqueness, because this
|
|
117
|
+
* join is exactly where a second same-target edge would silently merge two meanings.
|
|
118
|
+
*/
|
|
119
|
+
function applyEdge(context) {
|
|
120
|
+
const keys = extractEdgeKeys(context.item, context.edge);
|
|
121
|
+
for (const targetAspectKey of context.edge.targetAspects) {
|
|
122
|
+
const spineEdge = context.descriptor.edges.find((entry) => entry.targetAspectKey === targetAspectKey);
|
|
123
|
+
if (!spineEdge)
|
|
124
|
+
continue;
|
|
125
|
+
const targetKeys = context.edge.targetAspects.length === 1
|
|
126
|
+
? keys
|
|
127
|
+
: keys.filter((key) => context.keySetByAspectKey.get(targetAspectKey)?.has(key));
|
|
128
|
+
if (spineEdge.many) {
|
|
129
|
+
context.row[spineEdge.field] = targetKeys;
|
|
130
|
+
}
|
|
131
|
+
else if (targetKeys.length > 0) {
|
|
132
|
+
context.row[spineEdge.field] = targetKeys[0];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** Lift the reference key(s) out of the item — plain, array, or through an edge object/array. */
|
|
137
|
+
function extractEdgeKeys(item, edge) {
|
|
138
|
+
const raw = item[edge.field];
|
|
139
|
+
if (raw === undefined || raw === null)
|
|
140
|
+
return [];
|
|
141
|
+
if (edge.throughField === undefined) {
|
|
142
|
+
if (typeof raw === 'string')
|
|
143
|
+
return [raw];
|
|
144
|
+
if (Array.isArray(raw))
|
|
145
|
+
return raw.filter((entry) => typeof entry === 'string');
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
const carriers = Array.isArray(raw) ? raw : [raw];
|
|
149
|
+
const keys = [];
|
|
150
|
+
for (const carrier of carriers) {
|
|
151
|
+
if (!carrier || typeof carrier !== 'object')
|
|
152
|
+
continue;
|
|
153
|
+
const through = carrier[edge.throughField];
|
|
154
|
+
if (typeof through === 'string')
|
|
155
|
+
keys.push(through);
|
|
156
|
+
else if (Array.isArray(through)) {
|
|
157
|
+
for (const entry of through)
|
|
158
|
+
if (typeof entry === 'string')
|
|
159
|
+
keys.push(entry);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return keys;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=family-aspects.behavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"family-aspects.behavior.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/family-aspects.behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAGvB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kDAAkD,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,GAExC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAAC,IAAqB,EAAE,SAAiB;IACpE,IAAI,OAAO,GAAY,IAAI,CAAC;IAC5B,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QACtE,OAAO,GAAI,OAAmC,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAkBD,MAAM,wBAAwB,GAAmD,IAAI,GAAG,CACtF,4BAA4B,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CACrF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,KAGpC;IACC,MAAM,gBAAgB,GAAG,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,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;YAAE,SAAS;QACtD,MAAM,OAAO,GAAI,OAAmC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxE,IAAI,OAAO,OAAO,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,KAAK,MAAM,KAAK,IAAI,OAAO;gBAAE,IAAI,OAAO,KAAK,KAAK,QAAQ;oBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {\n FAMILY_ASPECTS_REGISTRY,\n type FamilyAspectDeclaration,\n type FamilyAspectEdge,\n FamilyAspectKind,\n} from '@wildo-ai/saas-specifications';\nimport { APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS } from '@wildo-ai/application-creation-runtime';\nimport {\n WORKBENCH_ASPECT_DESCRIPTORS,\n WorkbenchShared_ResourceFieldIdentifier,\n type WorkbenchAspectDescriptor,\n} from '@wildo-ai/platform-core-shared';\n\nimport { resolveSpecificationsCompanionExports } from './companion-introspection-module-exports.utils';\n\n/**\n * FAMILY ASPECTS — every second-level aspect row of every landed family, in ONE projection.\n *\n * One behavior for forty resources, on the same single-import consistency argument as\n * `application-domain-model`: the aspect rows CROSS-REFERENCE each other (a requirement's\n * `icpRefs` must be routable against the ICP key set), so deriving them from one read of one\n * companion-exports module is the only shape in which the graph's two ends describe the same\n * working tree. Each aspect resource binds this behavior at its own `rowsPath`.\n *\n * ## What a row is\n *\n * The spine envelope (see `workbench-aspect-resources.custom.shared.schemas.ts`): composed\n * identity, `family` backlink, `aspectKey`, `title` (the registry's headline field), the full\n * item as `content`, plus the aspect's FLATTENED reference fields. Flattening happens here:\n *\n * - through-edges lift the key(s) out of edge objects (`jobs[].jobRef` → `jobRefs`),\n * - multi-target edges route each key BY MEMBERSHIP into its per-target split field\n * (`deliversRequirementRefs` → `deliversFunctionalRequirementRefs` + …); a key belonging to\n * NO target keeps the graph honest by landing in none of them — the raw value stays readable\n * in `content`, so a dangling ref is visible without becoming a dead reference control.\n */\n\n/**\n * The headline value at a declared field path — plain-object segments only.\n *\n * A path rather than a key because a family's reader-facing name is not always top-level: a feature\n * draft's is `draft.purpose`, under a wrapper that exists because the payload is authored ref-lessly.\n * A missing segment yields `undefined` and the caller falls back to the row identity, so a drifted\n * path degrades to the slug rather than throwing — and the registry pin is what stops it drifting.\n */\nfunction resolveHeadlineValue(item: FamilyAspectRow, fieldPath: string): unknown {\n let current: unknown = item;\n for (const segment of fieldPath.split('.')) {\n if (current === null || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[segment];\n }\n return current;\n}\n\ninterface FamilyAspectRow {\n readonly [field: string]: unknown;\n}\n\nexport type FamilyAspectsResponse = {\n readonly trace: FamilyAspectsTrace;\n} & {\n readonly [rowsPath: string]: readonly FamilyAspectRow[] | FamilyAspectsTrace;\n};\n\nexport interface FamilyAspectsTrace {\n readonly aspects: number;\n readonly rows: number;\n readonly evaluatedAt: string;\n}\n\nconst DESCRIPTOR_BY_ASPECT_KEY: ReadonlyMap<string, WorkbenchAspectDescriptor> = new Map(\n WORKBENCH_ASPECT_DESCRIPTORS.map((descriptor) => [descriptor.aspectKey, descriptor]),\n);\n\nexport function projectFamilyAspects(input: {\n readonly moduleExports: Record<string, unknown>;\n readonly evaluatedAt: string;\n}): FamilyAspectsResponse {\n const companionExports = resolveSpecificationsCompanionExports(input.moduleExports) as unknown as Record<string, unknown>;\n const bindingBySchemaRef = new Map(\n APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS.map((binding) => [binding.schemaRef as string, binding]),\n );\n\n // ── Pass 1: raw items per aspect (needed before edges — membership routing reads key sets). ──\n const itemsByAspectKey = new Map<string, { family: string; items: Record<string, unknown>[]; declaration: FamilyAspectDeclaration }>();\n for (const familyDeclaration of FAMILY_ASPECTS_REGISTRY) {\n const binding = bindingBySchemaRef.get(familyDeclaration.schemaRef);\n if (!binding) continue;\n const snapshot = binding.companionExportsField === undefined\n ? undefined\n : (companionExports[binding.companionExportsField] as Record<string, unknown> | undefined);\n for (const aspect of familyDeclaration.aspects) {\n const member = snapshot?.[aspect.snapshotPath];\n const items = aspect.kind === FamilyAspectKind.SINGLETON\n ? (member && typeof member === 'object' ? [member as Record<string, unknown>] : [])\n : (Array.isArray(member) ? (member as Record<string, unknown>[]) : []);\n itemsByAspectKey.set(aspect.key, { family: binding.family, items, declaration: aspect });\n }\n }\n\n // ── Key sets per aspect, for membership routing of multi-target edges. ──\n const keySetByAspectKey = new Map<string, Set<string>>();\n for (const [aspectKey, { items, declaration }] of itemsByAspectKey) {\n const keys = new Set<string>();\n if (declaration.businessKey !== undefined) {\n for (const item of items) {\n const value = item[declaration.businessKey];\n if (typeof value === 'string') keys.add(value);\n }\n }\n keySetByAspectKey.set(aspectKey, keys);\n }\n\n // ── Pass 2: envelope rows. ──\n const rowsByPath: Record<string, FamilyAspectRow[]> = {};\n let totalRows = 0;\n for (const [aspectKey, { family, items, declaration }] of itemsByAspectKey) {\n const descriptor = DESCRIPTOR_BY_ASPECT_KEY.get(aspectKey);\n if (!descriptor) continue; // spine coverage is the parity test's business, not a crash site\n // The projection must emit the exact composed field the spine's identifier map names.\n const identityField = WorkbenchShared_ResourceFieldIdentifier[descriptor.resourceType];\n\n rowsByPath[descriptor.rowsPath] = items.map((item, index) => {\n const identity = declaration.businessKey !== undefined\n ? String(item[declaration.businessKey] ?? `${aspectKey}[${index}]`)\n : declaration.kind === FamilyAspectKind.SINGLETON ? aspectKey : `${aspectKey}[${index}]`;\n const headline = resolveHeadlineValue(item, declaration.headlineField);\n\n const row: Record<string, unknown> = {\n [identityField]: identity,\n family,\n aspectKey,\n title: typeof headline === 'string' ? headline : identity,\n content: item,\n };\n for (const edge of declaration.edges) {\n applyEdge({ row, item, aspect: declaration, edge, descriptor, keySetByAspectKey });\n }\n return row;\n });\n totalRows += items.length;\n }\n\n const trace: FamilyAspectsTrace = {\n aspects: itemsByAspectKey.size,\n rows: totalRows,\n evaluatedAt: input.evaluatedAt,\n };\n return { ...rowsByPath, trace };\n}\n\n/**\n * Flatten one registry edge into the row's spine field(s).\n *\n * The spine field for a target is the descriptor edge whose `targetAspectKey` matches — unique\n * per (aspect, target) by construction, and the parity test pins that uniqueness, because this\n * join is exactly where a second same-target edge would silently merge two meanings.\n */\nfunction applyEdge(context: {\n row: Record<string, unknown>;\n item: Record<string, unknown>;\n aspect: FamilyAspectDeclaration;\n edge: FamilyAspectEdge;\n descriptor: WorkbenchAspectDescriptor;\n keySetByAspectKey: ReadonlyMap<string, Set<string>>;\n}): void {\n const keys = extractEdgeKeys(context.item, context.edge);\n for (const targetAspectKey of context.edge.targetAspects) {\n const spineEdge = context.descriptor.edges.find((entry) => entry.targetAspectKey === targetAspectKey);\n if (!spineEdge) continue;\n const targetKeys = context.edge.targetAspects.length === 1\n ? keys\n : keys.filter((key) => context.keySetByAspectKey.get(targetAspectKey)?.has(key));\n if (spineEdge.many) {\n context.row[spineEdge.field] = targetKeys;\n } else if (targetKeys.length > 0) {\n context.row[spineEdge.field] = targetKeys[0];\n }\n }\n}\n\n/** Lift the reference key(s) out of the item — plain, array, or through an edge object/array. */\nfunction extractEdgeKeys(item: Record<string, unknown>, edge: FamilyAspectEdge): string[] {\n const raw = item[edge.field];\n if (raw === undefined || raw === null) return [];\n if (edge.throughField === undefined) {\n if (typeof raw === 'string') return [raw];\n if (Array.isArray(raw)) return raw.filter((entry): entry is string => typeof entry === 'string');\n return [];\n }\n const carriers = Array.isArray(raw) ? raw : [raw];\n const keys: string[] = [];\n for (const carrier of carriers) {\n if (!carrier || typeof carrier !== 'object') continue;\n const through = (carrier as Record<string, unknown>)[edge.throughField];\n if (typeof through === 'string') keys.push(through);\n else if (Array.isArray(through)) {\n for (const entry of through) if (typeof entry === 'string') keys.push(entry);\n }\n }\n return keys;\n}\n"]}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { CoreResourceType, type ResourceConfiguration_Operation, type ResourceConfiguration_Operation_ApiCall, type ResourceConfiguration_Operation_ApiCallWithCallback, type ResourceConfiguration_Operation_UrlInitiatorInfo, type ResourceRelationship, type FlowActorSystem } from '@wildo-ai/saas-models';
|
|
38
38
|
import { type AnyResourceSpecificationConfig } from '@wildo-ai/saas-specifications';
|
|
39
|
-
import { OpenApiSection, type OperationDoc, type OperationHttpDoc, type OpenApiGenerationProjectorStats, type OperationProjection, type ResourceTag, type ApplicationOrganizationRoleDocumentationSource, type ApplicationOrganizationUnitResourceDocumentation, type ApplicationRoleDocumentationSource } from '@wildo-ai/saas-technical-doc/companion';
|
|
39
|
+
import { OpenApiSection, type OperationDoc, type OperationHttpDoc, type OpenApiGenerationProjectorStats, type OperationProjection, type ResourceTag, type ApplicationOrganizationRoleDocumentationSource, type ApplicationOrganizationUnitResourceDocumentation, type ApplicationRoleDocumentationSource, type ApplicationMcpToolSource, type ApplicationWebhookEventSource } from '@wildo-ai/saas-technical-doc/companion';
|
|
40
40
|
/**
|
|
41
41
|
* Wire format returned by the `'openapi-generation-input'` subprocess
|
|
42
42
|
* behavior. It carries the JSON-safe facts that require the application module
|
|
@@ -54,6 +54,8 @@ export interface OpenApiGenerationInputSubprocessOutput {
|
|
|
54
54
|
operations: OperationProjection[];
|
|
55
55
|
/** True when the final application registry declares at least one usable MCP tool operation. */
|
|
56
56
|
hasConfiguredMcpToolOperations: boolean;
|
|
57
|
+
mcpTools: readonly ApplicationMcpToolSource[];
|
|
58
|
+
webhookEvents: readonly ApplicationWebhookEventSource[];
|
|
57
59
|
/** True when the final startup declaration contains at least one actor system that A2A can expose as a skill. */
|
|
58
60
|
hasConfiguredA2aSkills: boolean;
|
|
59
61
|
/** Every resolved organization-scoped role, joined to its authored semantics. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi-generation-input.behavior.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/openapi-generation-input.behavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAaL,gBAAgB,EAgBhB,KAAK,+BAA+B,EACpC,KAAK,uCAAuC,EAC5C,KAAK,mDAAmD,EACxD,KAAK,gDAAgD,EACrD,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAKL,KAAK,8BAA8B,EAEpC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAOL,cAAc,EAMd,KAAK,YAAY,EAEjB,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EAQxB,KAAK,WAAW,EAChB,KAAK,8CAA8C,EACnD,KAAK,gDAAgD,EACrD,KAAK,kCAAkC,
|
|
1
|
+
{"version":3,"file":"openapi-generation-input.behavior.d.ts","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/openapi-generation-input.behavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAaL,gBAAgB,EAgBhB,KAAK,+BAA+B,EACpC,KAAK,uCAAuC,EAC5C,KAAK,mDAAmD,EACxD,KAAK,gDAAgD,EACrD,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAKL,KAAK,8BAA8B,EAEpC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAOL,cAAc,EAMd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AKG;AACH,wBAAgB,2CAA2C,CACzD,aAAa,EAAE,8BAA8B,GAAG,SAAS,EACzD,SAAS,EAAE,mBAAmB,GAC7B,gBAAgB,CAuBlB;AA+GD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,mBAAmB,EAC9B,aAAa,EAAE,gDAAgD,EAC/D,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EACtB,YAAY,GAAE,YAAiB,EAC/B,cAAc,GAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,kCAAkC,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAa,EAC/H,wBAAwB,UAAQ,GAC/B,mBAAmB,CA+GrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,mBAAmB,EAC9B,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACrB,MAAM,CAqBR"}
|
|
@@ -392,12 +392,15 @@ startupProjection) {
|
|
|
392
392
|
mergeResourceProjection(projectResource(preparedResource));
|
|
393
393
|
const consideredOperationCount = preparedResources.reduce((count, resource) => count + resource.documentableApiOperationCount, 0);
|
|
394
394
|
const organizationUnitAwareResources = projectApplicationOrganizationUnitResourceDocumentation(startupProjection?.organizationUnitNarrowing, resourceTags);
|
|
395
|
-
const
|
|
395
|
+
const integrationSurfaces = collectIntegrationSurfaces(preparedResources, resourceConfigs, excludedCoreResourceTypeSet, resourceFieldIdentifiers, relationships);
|
|
396
|
+
const hasConfiguredMcpToolOperations = integrationSurfaces.mcpTools.length > 0;
|
|
396
397
|
const hasConfiguredA2aSkills = hasConfiguredA2aSkill(startupProjection?.flowActorSystemsFactoryMap);
|
|
397
398
|
return {
|
|
398
399
|
operations,
|
|
399
400
|
hasConfiguredMcpToolOperations,
|
|
400
401
|
hasConfiguredA2aSkills,
|
|
402
|
+
mcpTools: integrationSurfaces.mcpTools,
|
|
403
|
+
webhookEvents: integrationSurfaces.webhookEvents,
|
|
401
404
|
organizationRoles,
|
|
402
405
|
organizationUnitAwareResources,
|
|
403
406
|
errorResponseSchema: convertZodSchemaToOpenApiSchema(ErrorResponseSchema),
|
|
@@ -417,39 +420,49 @@ startupProjection) {
|
|
|
417
420
|
});
|
|
418
421
|
}
|
|
419
422
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
* runtime-eligible core resource; it is intentionally independent from the
|
|
425
|
-
* narrower `apiDocResources` selection, which controls reference content rather
|
|
426
|
-
* than whether the application has an MCP surface.
|
|
423
|
+
* Walks the application's own resources AND the selected core resources once, collecting both
|
|
424
|
+
* integration surfaces. Core resources are materialized from the same factory map the runtime uses,
|
|
425
|
+
* so a core resource this application excluded contributes nothing — exactly as it contributes no
|
|
426
|
+
* route.
|
|
427
427
|
*/
|
|
428
|
-
function
|
|
429
|
-
const
|
|
428
|
+
function collectIntegrationSurfaces(preparedApplicationAndSelectedCoreResources, applicationResourceConfigurations, excludedCoreResourceTypes, applicationFieldIdentifiers, applicationRelationships) {
|
|
429
|
+
const mcpTools = [];
|
|
430
|
+
const webhookEvents = [];
|
|
431
|
+
const collectFrom = (configuration) => {
|
|
430
432
|
const resourceIdentifier = String(configuration.resourceIdentifier);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
// A resource whose own identifier contains the tool separator could not produce an
|
|
434
|
+
// unambiguous tool name, so it is skipped here exactly as the adapter skips it.
|
|
435
|
+
const resourceCanCarryTools = !resourceIdentifier.includes(MCP_TOOL_NAME_SEPARATOR);
|
|
436
|
+
for (const operation of configuration.operations) {
|
|
434
437
|
const operationIdentifier = String(operation.operationIdentifier);
|
|
435
|
-
|
|
438
|
+
const toolName = `${resourceIdentifier}${MCP_TOOL_NAME_SEPARATOR}${operationIdentifier}`;
|
|
439
|
+
if (resourceCanCarryTools
|
|
440
|
+
&& isDefaultUrlBearingOperation(operation, operationIdentifier)
|
|
436
441
|
&& operation.mcp?.exposed === true
|
|
437
442
|
&& operation.unimplementedAcknowledgement === undefined
|
|
438
|
-
&& isSpecConformantMcpToolName(
|
|
439
|
-
|
|
443
|
+
&& isSpecConformantMcpToolName(toolName)) {
|
|
444
|
+
mcpTools.push({ toolName, resourceIdentifier, operationIdentifier });
|
|
445
|
+
}
|
|
446
|
+
for (const notification of operation.m2mNotifications ?? []) {
|
|
447
|
+
const channel = String(notification.channel ?? '');
|
|
448
|
+
if (channel.length === 0)
|
|
449
|
+
continue;
|
|
450
|
+
webhookEvents.push({ resourceIdentifier, operationIdentifier, channel });
|
|
451
|
+
}
|
|
452
|
+
}
|
|
440
453
|
};
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
454
|
+
for (const prepared of preparedApplicationAndSelectedCoreResources)
|
|
455
|
+
collectFrom(prepared.materializedConfig);
|
|
444
456
|
const coreCompiledRelationships = Resources_SharedUtils.ensureCompiledRelationships([...applicationRelationships, ...coreSharedResourceRelationship], { ...applicationFieldIdentifiers, ...coreResourceShared_FieldIdentifier });
|
|
445
457
|
for (const [coreType, factory] of Object.entries(coreShared_ResourcesConfigurations_FactoryMap)) {
|
|
446
458
|
if (applicationResourceConfigurations[coreType] !== undefined || excludedCoreResourceTypes.has(coreType))
|
|
447
459
|
continue;
|
|
448
|
-
if (typeof factory === 'function'
|
|
449
|
-
|
|
450
|
-
}
|
|
460
|
+
if (typeof factory === 'function')
|
|
461
|
+
collectFrom(factory(coreCompiledRelationships));
|
|
451
462
|
}
|
|
452
|
-
|
|
463
|
+
const byToolName = (left, right) => left.toolName.localeCompare(right.toolName, 'en-US');
|
|
464
|
+
const byEvent = (left, right) => `${left.resourceIdentifier}.${left.operationIdentifier}.${left.channel}`.localeCompare(`${right.resourceIdentifier}.${right.operationIdentifier}.${right.channel}`, 'en-US');
|
|
465
|
+
return { mcpTools: mcpTools.sort(byToolName), webhookEvents: webhookEvents.sort(byEvent) };
|
|
453
466
|
}
|
|
454
467
|
/** Match the A2A runtime's skill filter exactly: only agentic ACTOR systems backed by an agent ref are advertised. */
|
|
455
468
|
function hasConfiguredA2aSkill(factories) {
|