@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,10 +1,11 @@
|
|
|
1
|
+
import { basename, relative } from 'node:path';
|
|
1
2
|
import { pathToFileURL } from 'node:url';
|
|
2
3
|
import { generateDesignTokensCssFromSourceConfig } from '@wildo-ai/presets-components-models';
|
|
3
4
|
import { backendResourcesConfigurationsFactoryMap, backendResourcesRelationships, BackendResourceFieldIdentifier, } from '@wildo-ai/saas-backend-lib/backend-resource-registry';
|
|
4
5
|
import { buildSharedSaaSModulesRegistry, coreResourceShared_FieldIdentifier, coreResourceShared_FieldIdentifierPriority, coreShared_ResourcesConfigurations_FactoryMap, coreSharedResourceRelationship, CoreResourceType, Resources_SharedUtils, } from '@wildo-ai/saas-models';
|
|
5
6
|
import { CompanionArtifactClass } from '@wildo-ai/saas-models/companion';
|
|
6
|
-
import { getZodObjectShape } from '@wildo-ai/zod-decorators';
|
|
7
|
-
import { assertResourceSpecificationsAlignWithRegistry, ExpertShapingInputKind, extractFieldSpecsFromFieldMap, extractResourceFieldSpecs, validateBrandSnapshot, validateMarketSnapshot, } from '@wildo-ai/saas-specifications';
|
|
7
|
+
import { getCustomFieldMetadata, getZodObjectShape } from '@wildo-ai/zod-decorators';
|
|
8
|
+
import { assertResourceSpecificationsAlignWithRegistry, ExpertShapingInputKind, extractFieldSpecsFromFieldMap, extractResourceFieldSpecs, engineResourceSpecificationsByType, validateBrandSnapshot, validateMarketSnapshot, } from '@wildo-ai/saas-specifications';
|
|
8
9
|
import { parseSpecificationContextFactoryRequest, renderSpecificationContextPart, } from '../../specifications/specification-context-factory.js';
|
|
9
10
|
import { renderCatalogEntryContextPart } from '../../catalogs/catalog-context.factory.js';
|
|
10
11
|
import { CatalogContextVocabulary } from '../../catalogs/catalog-context.factory.models.js';
|
|
@@ -19,6 +20,9 @@ import { renderBrandPrompt } from './brand-prompt-renderer.js';
|
|
|
19
20
|
import { renderShapingInputBriefs } from './expert-persona-brief.renderer.js';
|
|
20
21
|
import { runAssertionsList, runAssertionsReconcile, runAssertionsResolve, } from './assertions.behavior.js';
|
|
21
22
|
import { runDefinitionSpecifications } from './definition-specifications.behavior.js';
|
|
23
|
+
import { projectSpecificationArtifacts } from './specification-artifacts.behavior.js';
|
|
24
|
+
import { projectFamilyAspects } from './family-aspects.behavior.js';
|
|
25
|
+
import { projectApplicationDomainModel, } from './application-domain-model.behavior.js';
|
|
22
26
|
import { asComplianceRelevantConfiguration, CompliancePrimaryFactOrigin, projectCompliancePrimaryFacts, } from './compliance-primary-facts.behavior.js';
|
|
23
27
|
/**
|
|
24
28
|
* Every engine-owned resource-configuration factory THE BACKEND RUNTIME ACTUALLY MERGES.
|
|
@@ -173,13 +177,298 @@ export const COMPANION_INTROSPECTION_BUILTIN_BEHAVIOR_HANDLERS = {
|
|
|
173
177
|
}
|
|
174
178
|
return { ...projectCompliancePrimaryFacts(entries), unmaterializableResourceTypes };
|
|
175
179
|
},
|
|
180
|
+
/*
|
|
181
|
+
* The application's domain model, in ONE derivation.
|
|
182
|
+
*
|
|
183
|
+
* Mirrors `resource-specifications` exactly on the two things that matter: it resolves the shared
|
|
184
|
+
* library from `resolvedTargets.library` and the spec overlay from `context.moduleExports` (the
|
|
185
|
+
* specifications target), so nodes, edges, ownership and specification prose all come from the same
|
|
186
|
+
* import of the same working tree. That is the property the workbench graph needs and the reason
|
|
187
|
+
* this is not assembled from the two behaviors that answer half of it each.
|
|
188
|
+
*
|
|
189
|
+
* Two deliberate divergences from `resource-specifications`, each of which would be a defect if
|
|
190
|
+
* copied without thinking:
|
|
191
|
+
*
|
|
192
|
+
* - **the alignment guard is NOT run.** `assertResourceSpecificationsAlignWithRegistry` THROWS on
|
|
193
|
+
* a spec-orphan or a scope disagreement, which is right for the behavior that IS the pairing and
|
|
194
|
+
* wrong for a read surface: a workbench that refuses to draw the application because one
|
|
195
|
+
* specification is misaligned hides the very structure an operator opened it to inspect. The
|
|
196
|
+
* guard still fires on its own behavior, so nothing stops reporting it.
|
|
197
|
+
* - **a factory that cannot materialize is SKIPPED, not fatal.** Same policy as `resources-registry`
|
|
198
|
+
* beside it: the node still appears with no detail, because a resource missing from the picture
|
|
199
|
+
* is worse than a resource shown thinly.
|
|
200
|
+
*
|
|
201
|
+
* A THIRD divergence used to be listed here and is retired: "no per-field spec extraction —
|
|
202
|
+
* `extractResourceFieldSpecs` is what makes the sibling expensive, and a domain-model panel reads
|
|
203
|
+
* field NAMES, not field specs". The premise was right and the conclusion aged badly. A name
|
|
204
|
+
* answers "does this field exist", which the node already implies by counting them; a reader
|
|
205
|
+
* opening a resource wants what the field IS. The cost was then MEASURED rather than assumed —
|
|
206
|
+
* 715 fields across the 82 engine resources extract to 264 KB — which is a fraction of what the
|
|
207
|
+
* relationship edges already cost, so the reason to withhold it was gone.
|
|
208
|
+
*/
|
|
209
|
+
'application-domain-model': async (_input, context) => {
|
|
210
|
+
const libraryTarget = context.request.resolvedTargets.library;
|
|
211
|
+
if (!libraryTarget) {
|
|
212
|
+
throw new Error('application-domain-model requires a root-level `libraries.shared` declaration in wildo.saas.config.ts.');
|
|
213
|
+
}
|
|
214
|
+
const sharedCompanionModule = await import(pathToFileURL(libraryTarget.entryPath).href);
|
|
215
|
+
const { loadSharedModules } = resolveSharedLibraryCompanionExports(sharedCompanionModule);
|
|
216
|
+
const sharedModules = await loadSharedModules();
|
|
217
|
+
const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);
|
|
218
|
+
const applicationRelationships = (sharedRegistry.resourceRelationships ?? []);
|
|
219
|
+
/*
|
|
220
|
+
* Field names per node, materialized once.
|
|
221
|
+
*
|
|
222
|
+
* The application's own factories are materialized against the app's relationship slice, exactly
|
|
223
|
+
* as both runtime registries do. The BOUNDARY types — engine resources the application's own
|
|
224
|
+
* edges reach — are materialized against the CORE-MERGED relationships instead: an engine factory
|
|
225
|
+
* buckets its own parent/child edges out of whatever array it is handed, so handing it the
|
|
226
|
+
* app-only slice produces a configuration whose engine edges have silently vanished.
|
|
227
|
+
*/
|
|
228
|
+
const fieldsByResourceType = {};
|
|
229
|
+
const operationsByResourceType = {};
|
|
230
|
+
const advancedByResourceType = {};
|
|
231
|
+
/**
|
|
232
|
+
* The `ResourceConfiguration` keys that describe HOW a resource behaves rather than what it holds.
|
|
233
|
+
*
|
|
234
|
+
* A DENY list over the configuration's own keys, not an allow list, and that is the whole design:
|
|
235
|
+
* `ResourceConfiguration` has grown several of these fields in as many months, and an allow list
|
|
236
|
+
* reports the subset its author knew about — so a policy added tomorrow would be invisible with
|
|
237
|
+
* nothing to say so. What is excluded is only what belongs to another section of the panel
|
|
238
|
+
* (schemas, relationships, operations) or is a function.
|
|
239
|
+
*/
|
|
240
|
+
/**
|
|
241
|
+
* The operation keys that are SCHEMAS, and are therefore never projected.
|
|
242
|
+
*
|
|
243
|
+
* Six DTOs plus the resource's own main schema and relationship set. Each serializes to tens of
|
|
244
|
+
* kilobytes; together they would put megabytes on the wire to say which verbs exist.
|
|
245
|
+
*/
|
|
246
|
+
const OPERATION_SCHEMA_KEYS = new Set([
|
|
247
|
+
'mainSchema',
|
|
248
|
+
'inheritenceSchemaDefinition',
|
|
249
|
+
'resourceRelationships',
|
|
250
|
+
'requestDto',
|
|
251
|
+
'responseDto',
|
|
252
|
+
'summaryDto',
|
|
253
|
+
'contextDto',
|
|
254
|
+
'internalDto',
|
|
255
|
+
'repositoryDto',
|
|
256
|
+
]);
|
|
257
|
+
const NON_ADVANCED_CONFIGURATION_KEYS = new Set([
|
|
258
|
+
'mainSchema',
|
|
259
|
+
'inheritenceSchemaDefinition',
|
|
260
|
+
'resourceRelationships',
|
|
261
|
+
'operations',
|
|
262
|
+
'coreOperations',
|
|
263
|
+
'customOperation',
|
|
264
|
+
]);
|
|
265
|
+
const collectResourceDetail = (resourceType, factoryOrConfig, relationships) => {
|
|
266
|
+
try {
|
|
267
|
+
/*
|
|
268
|
+
* A registry entry may be a FACTORY or an already-materialized configuration — the sibling
|
|
269
|
+
* `resource-specifications` handler below handles both, and this one must too. Not for the
|
|
270
|
+
* field list, which would merely be empty: the key's PRESENCE is what the unowned set is
|
|
271
|
+
* computed from, so an entry skipped here would be classified as an engine resource this
|
|
272
|
+
* application references, and then looked for among engine factories where it does not exist.
|
|
273
|
+
*/
|
|
274
|
+
const configuration = typeof factoryOrConfig === 'function'
|
|
275
|
+
? factoryOrConfig(relationships)
|
|
276
|
+
: factoryOrConfig;
|
|
277
|
+
/*
|
|
278
|
+
* The SAME extractor the `resource-specifications` behavior uses, against the same registry
|
|
279
|
+
* context — so a field's derived facts (its foreign-key target above all) are one answer and
|
|
280
|
+
* not two readings of the same decorators that can disagree.
|
|
281
|
+
*/
|
|
282
|
+
const mainSchema = configuration?.mainSchema;
|
|
283
|
+
const extracted = mainSchema
|
|
284
|
+
? extractResourceFieldSpecs(mainSchema, configuration?.inheritenceSchemaDefinition, { currentResourceType: resourceType, relationships: relationships })
|
|
285
|
+
: [];
|
|
286
|
+
/*
|
|
287
|
+
* The field's own decorator record, beside the extractor's interpretation of it. `derived`
|
|
288
|
+
* answers what the framework CONCLUDED (kind, primitive, foreign-key target); this is what
|
|
289
|
+
* the schema DECLARED, and it carries the eight structural decorators the interpretation
|
|
290
|
+
* drops — `isSummaryField`, `isHidden`, `excludeFromCreate`/`Update`, `dataCategories`, and
|
|
291
|
+
* the index/unique/primary-key trio.
|
|
292
|
+
*/
|
|
293
|
+
const schemaShape = mainSchema
|
|
294
|
+
? (getZodObjectShape(mainSchema) ?? {})
|
|
295
|
+
: {};
|
|
296
|
+
fieldsByResourceType[resourceType] = extracted.map((spec) => ({
|
|
297
|
+
fieldName: spec.fieldName,
|
|
298
|
+
specDecorator: spec.specDecorator ?? null,
|
|
299
|
+
params: (spec.params ?? null),
|
|
300
|
+
derived: (spec.derived ?? null),
|
|
301
|
+
origin: (spec.origin ?? null),
|
|
302
|
+
metadata: schemaShape[spec.fieldName]
|
|
303
|
+
? (getCustomFieldMetadata(schemaShape[spec.fieldName]) ?? null)
|
|
304
|
+
: null,
|
|
305
|
+
}));
|
|
306
|
+
/*
|
|
307
|
+
* Operations are projected FIELD BY FIELD rather than spread, because a materialized operation
|
|
308
|
+
* carries six Zod schemas — request, response, summary, context, internal and repository DTOs
|
|
309
|
+
* — each of which serializes to tens of kilobytes. Spreading them would put megabytes on the
|
|
310
|
+
* wire to say which verbs exist.
|
|
311
|
+
*/
|
|
312
|
+
const operations = (configuration?.operations ?? []);
|
|
313
|
+
operationsByResourceType[resourceType] = operations.map((operation) => {
|
|
314
|
+
/*
|
|
315
|
+
* Everything the operation declares that is not a SCHEMA, by deny list — the third such
|
|
316
|
+
* list in this handler and the one that proved the argument. A hand-picked set of twelve
|
|
317
|
+
* fields shipped without `variantKey`, `httpVerb`, `isBulkOperation` or `serviceRuntimeMode`,
|
|
318
|
+
* and `variantKey` is not detail: it is half of an operation's IDENTITY.
|
|
319
|
+
*/
|
|
320
|
+
const attributes = {};
|
|
321
|
+
for (const [key, value] of Object.entries(operation)) {
|
|
322
|
+
if (OPERATION_SCHEMA_KEYS.has(key))
|
|
323
|
+
continue;
|
|
324
|
+
if (typeof value === 'function' || value === undefined)
|
|
325
|
+
continue;
|
|
326
|
+
attributes[key] = value;
|
|
327
|
+
}
|
|
328
|
+
const operationIdentifier = String(operation.operationIdentifier ?? '');
|
|
329
|
+
return {
|
|
330
|
+
operationIdentifier,
|
|
331
|
+
variantType: operation.variantType === undefined ? null : String(operation.variantType),
|
|
332
|
+
variantKey: operation.variantKey === undefined || operation.variantKey === null
|
|
333
|
+
? null
|
|
334
|
+
: String(operation.variantKey),
|
|
335
|
+
resourceOperationLike: operation.resourceOperationLike === undefined
|
|
336
|
+
|| operation.resourceOperationLike === null
|
|
337
|
+
? null
|
|
338
|
+
: String(operation.resourceOperationLike),
|
|
339
|
+
isDefault: operation.isDefault === true || operation.isOperationDefault === true,
|
|
340
|
+
roles: Array.isArray(operation.roles) ? operation.roles.map(String) : [],
|
|
341
|
+
riskLevel: operation.riskLevel === undefined ? null : String(operation.riskLevel),
|
|
342
|
+
isUnimplemented: operation.unimplementedAcknowledgement !== undefined
|
|
343
|
+
&& operation.unimplementedAcknowledgement !== null,
|
|
344
|
+
isDisabled: operation.isDisabled === true,
|
|
345
|
+
requiresStepUpAuthentication: operation.requiresStepUpAuthentication === true,
|
|
346
|
+
admitsCrossTenantPlatformAdministration: operation.admitsCrossTenantPlatformAdministration === true,
|
|
347
|
+
auditableEventType: typeof operation.auditableEvent === 'object' && operation.auditableEvent !== null
|
|
348
|
+
? String(operation.auditableEvent.eventType ?? '') || null
|
|
349
|
+
: null,
|
|
350
|
+
isMcpExposed: operation.mcp !== undefined && operation.mcp !== null,
|
|
351
|
+
requiredFeatures: Array.isArray(operation.requiredFeatures)
|
|
352
|
+
? operation.requiredFeatures.map(String)
|
|
353
|
+
: [],
|
|
354
|
+
attributes,
|
|
355
|
+
specification: null,
|
|
356
|
+
view: null,
|
|
357
|
+
};
|
|
358
|
+
});
|
|
359
|
+
const advanced = {};
|
|
360
|
+
for (const [key, value] of Object.entries(configuration ?? {})) {
|
|
361
|
+
if (NON_ADVANCED_CONFIGURATION_KEYS.has(key))
|
|
362
|
+
continue;
|
|
363
|
+
if (typeof value === 'function' || value === undefined)
|
|
364
|
+
continue;
|
|
365
|
+
advanced[key] = value;
|
|
366
|
+
}
|
|
367
|
+
advancedByResourceType[resourceType] = advanced;
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
// A factory that cannot materialize is its own (loud) defect elsewhere — the same policy
|
|
371
|
+
// `resources-registry` takes. The node is still drawn; it simply carries no detail.
|
|
372
|
+
fieldsByResourceType[resourceType] = [];
|
|
373
|
+
operationsByResourceType[resourceType] = [];
|
|
374
|
+
advancedByResourceType[resourceType] = {};
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
for (const [resourceType, factory] of Object.entries(sharedRegistry.resourceConfigurations ?? {})) {
|
|
378
|
+
collectResourceDetail(resourceType, factory, applicationRelationships);
|
|
379
|
+
}
|
|
380
|
+
/*
|
|
381
|
+
* EVERY engine resource, and every engine relationship — not only the ones the application's own
|
|
382
|
+
* edges happen to reach.
|
|
383
|
+
*
|
|
384
|
+
* An application does not merge two engine resources, it merges ALL of them: `initializeResources`
|
|
385
|
+
* applies the engine's core factory map unconditionally and the backend registry merges the same
|
|
386
|
+
* two maps at init, so `files`, `apiKeys`, `webhooks`, `billingAccounts` and the rest are as much
|
|
387
|
+
* part of the running application as the eight it declares itself. Projecting only the two an
|
|
388
|
+
* application's scope anchors touch answered "what is this application's domain model" while
|
|
389
|
+
* silently implying it was the whole registry.
|
|
390
|
+
*
|
|
391
|
+
* The relationships are the CORE-MERGED compiled set — application PLUS engine — for the same
|
|
392
|
+
* reason: engine resources related only to each other would otherwise arrive as a wall of
|
|
393
|
+
* disconnected nodes, which states less than saying nothing.
|
|
394
|
+
*
|
|
395
|
+
* The consumer decides what to DRAW. It can tell an engine resource from an application one
|
|
396
|
+
* (`moduleId === null`) and a referenced one from the rest (does any of its relationships reach a
|
|
397
|
+
* resource that has a module), so no field is added here to carry a distinction the data already
|
|
398
|
+
* makes.
|
|
399
|
+
*/
|
|
400
|
+
const mergedRelationships = engineMergedCompiledResourceRelationships(sharedRegistry.resourceRelationships, sharedRegistry.resourceFieldIdentifiers);
|
|
401
|
+
for (const [resourceType, factory] of engineResourceConfigurationFactoryEntries()) {
|
|
402
|
+
// An application registration always wins over a same-keyed engine one, as both runtime
|
|
403
|
+
// registries do — so a resource the app re-registers keeps ITS field set, not the engine's.
|
|
404
|
+
if (Object.prototype.hasOwnProperty.call(fieldsByResourceType, resourceType))
|
|
405
|
+
continue;
|
|
406
|
+
collectResourceDetail(resourceType, factory, mergedRelationships);
|
|
407
|
+
}
|
|
408
|
+
const { resourceSpecifications: specOverlay } = resolveSpecificationsCompanionExports(context.moduleExports);
|
|
409
|
+
/*
|
|
410
|
+
* The engine's own specs UNDER the application's, for the fourth time in this handler and for the
|
|
411
|
+
* same reason as the other three: the application half is not the whole registry.
|
|
412
|
+
*
|
|
413
|
+
* Applications are asked by convention to spread `engineResourceSpecificationsByType` into their
|
|
414
|
+
* companion export first, and the dogfood app does. A convention is not a guarantee, and the
|
|
415
|
+
* failure it produces is quiet: an application that omitted the spread would draw 85 engine
|
|
416
|
+
* resources with no `subDomain` between them and no error anywhere. Merging here makes the engine
|
|
417
|
+
* half unconditional; spreading the app's second keeps its override exactly where it was.
|
|
418
|
+
*/
|
|
419
|
+
const specificationOverlay = {
|
|
420
|
+
...engineResourceSpecificationsByType,
|
|
421
|
+
...(specOverlay ?? {}),
|
|
422
|
+
};
|
|
423
|
+
/*
|
|
424
|
+
* The authored SPECIFICATION and FRONTEND VIEW for each operation, attached after the overlay is
|
|
425
|
+
* resolved — the operations were projected before it exists, so this is a second pass over the
|
|
426
|
+
* same rows rather than a reordering of the handler.
|
|
427
|
+
*
|
|
428
|
+
* Keyed by `operationIdentifier`, so every VARIANT of one verb carries the same entry. That is
|
|
429
|
+
* what the specification actually describes: one operation, with its per-variant prose nested
|
|
430
|
+
* inside. Attaching per variant would imply the spec says something different about `read:admin`
|
|
431
|
+
* than about `read:summary`, which it does not.
|
|
432
|
+
*/
|
|
433
|
+
for (const [resourceType, resourceOperations] of Object.entries(operationsByResourceType)) {
|
|
434
|
+
const resourceSpecification = specificationOverlay[resourceType];
|
|
435
|
+
if (!resourceSpecification)
|
|
436
|
+
continue;
|
|
437
|
+
for (const operation of resourceOperations) {
|
|
438
|
+
operation.specification = (resourceSpecification.operations?.[operation.operationIdentifier]
|
|
439
|
+
?? null);
|
|
440
|
+
operation.view = (resourceSpecification.frontend?.views?.[operation.operationIdentifier]
|
|
441
|
+
?? null);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return projectApplicationDomainModel({
|
|
445
|
+
sharedModules,
|
|
446
|
+
resourceRelationships: mergedRelationships,
|
|
447
|
+
specificationOverlay,
|
|
448
|
+
resourceFieldsByResourceType: fieldsByResourceType,
|
|
449
|
+
resourceOperationsByResourceType: operationsByResourceType,
|
|
450
|
+
resourceAdvancedByResourceType: advancedByResourceType,
|
|
451
|
+
/*
|
|
452
|
+
* The per-operation FRONTEND overlay refs, from the merged specification. Keys only — the
|
|
453
|
+
* entries are authoring prose about how an operation surfaces, which belongs to a specification
|
|
454
|
+
* reader; what a domain-model panel can act on is WHICH operations have an authored view.
|
|
455
|
+
*/
|
|
456
|
+
resourceViewRefsByResourceType: Object.fromEntries(Object.entries(specificationOverlay).map(([resourceType, specification]) => [
|
|
457
|
+
resourceType,
|
|
458
|
+
Object.keys(specification
|
|
459
|
+
.frontend?.views ?? {}),
|
|
460
|
+
])),
|
|
461
|
+
});
|
|
462
|
+
},
|
|
176
463
|
'resources-registry': async (_input, context) => {
|
|
177
464
|
const { loadSharedModules } = resolveSharedLibraryCompanionExports(context.moduleExports);
|
|
178
465
|
const sharedModules = await loadSharedModules();
|
|
179
466
|
const sharedRegistry = buildSharedSaaSModulesRegistry(...sharedModules);
|
|
180
467
|
/*
|
|
181
468
|
* The FK-resolution SWEEP, run against the CURRENT working tree (this subprocess re-imports
|
|
182
|
-
* the app's shared-lib fresh
|
|
469
|
+
* the app's shared-lib fresh every time it RUNS — never the companion's boot-time cache; and
|
|
470
|
+
* the parent's derivation cache only skips the run when a source-state observation proves
|
|
471
|
+
* nothing under the application or its resolved `@wildo-ai/*` roots has moved). Same
|
|
183
472
|
* shared implementation the frontend registry refuses on at init
|
|
184
473
|
* (`frontend_fk_resolution_failed`), surfaced here so the app-creation verification lane can
|
|
185
474
|
* refuse a compose/coding mutation that landed a decorated FK with no relationship edge —
|
|
@@ -745,7 +1034,47 @@ export const COMPANION_INTROSPECTION_BUILTIN_BEHAVIOR_HANDLERS = {
|
|
|
745
1034
|
'assertions-resolve': (input, context) => runAssertionsResolve(input, context.moduleExports, context.request.resolvedTargets),
|
|
746
1035
|
'assertions-reconcile': (input, context) => runAssertionsReconcile(input, context.moduleExports, context.request.resolvedTargets),
|
|
747
1036
|
'definition-specifications': (input, context) => runDefinitionSpecifications(input, context.moduleExports),
|
|
1037
|
+
/**
|
|
1038
|
+
* The workbench's operator-facing view of the same authored families (issue #162).
|
|
1039
|
+
*
|
|
1040
|
+
* The path arithmetic is here rather than in the projection because only this layer knows the
|
|
1041
|
+
* homes: `packageRoot` is where the specifications package sits on disk, and the prefix is that
|
|
1042
|
+
* directory's name relative to the application — so a row names `specifications/src/vision/index.ts`,
|
|
1043
|
+
* a path an operator recognizes, instead of a package-internal one or an absolute one carrying
|
|
1044
|
+
* somebody's home directory.
|
|
1045
|
+
*
|
|
1046
|
+
* `evaluatedAt` is stamped HERE for the same reason: the projection stays a pure function of its
|
|
1047
|
+
* inputs, which is what makes it testable without freezing a clock.
|
|
1048
|
+
*/
|
|
1049
|
+
'specification-artifacts': (_input, context) => projectSpecificationArtifacts({
|
|
1050
|
+
moduleExports: context.moduleExports,
|
|
1051
|
+
packageRoot: context.request.packageRoot,
|
|
1052
|
+
appRelativePackagePrefix: toAppRelativeDirectoryName(context.request.homes.appDeclarationRoot, context.request.packageRoot),
|
|
1053
|
+
evaluatedAt: new Date().toISOString(),
|
|
1054
|
+
}),
|
|
1055
|
+
/*
|
|
1056
|
+
* Every second-level aspect row of every landed family, in ONE projection — forty resources
|
|
1057
|
+
* bind this behavior at their own `rowsPath`. Single-import for the same reason as
|
|
1058
|
+
* `application-domain-model`: the rows cross-reference each other, so both ends of every edge
|
|
1059
|
+
* must describe the same working tree. See `family-aspects.behavior.ts`.
|
|
1060
|
+
*/
|
|
1061
|
+
'family-aspects': (_input, context) => projectFamilyAspects({
|
|
1062
|
+
moduleExports: context.moduleExports,
|
|
1063
|
+
evaluatedAt: new Date().toISOString(),
|
|
1064
|
+
}),
|
|
748
1065
|
};
|
|
1066
|
+
/**
|
|
1067
|
+
* The target package's directory as an operator would name it, relative to the application root.
|
|
1068
|
+
*
|
|
1069
|
+
* Falls back to the package directory's own basename when the two roots are unrelated — which is
|
|
1070
|
+
* what a `..`-prefixed relative path would mean, and a path climbing out of the application would be
|
|
1071
|
+
* a worse answer than a bare directory name. Never absolute: an absolute path leaks the developer's
|
|
1072
|
+
* home directory into a projection served over HTTP.
|
|
1073
|
+
*/
|
|
1074
|
+
function toAppRelativeDirectoryName(appDeclarationRoot, packageRoot) {
|
|
1075
|
+
const relativePath = relative(appDeclarationRoot, packageRoot);
|
|
1076
|
+
return relativePath.length > 0 && !relativePath.startsWith('..') ? relativePath : basename(packageRoot);
|
|
1077
|
+
}
|
|
749
1078
|
/**
|
|
750
1079
|
* One-time WARN-deduplication set, keyed by snapshot identity.
|
|
751
1080
|
*
|