@specverse/engines 4.1.0
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/assets/examples/09-api/ai-spec.yaml +194 -0
- package/assets/examples/09-api/converted.yaml +95 -0
- package/assets/examples/09-api/diagram-architecture.mmd +10 -0
- package/assets/examples/09-api/diagram-er.mmd +10 -0
- package/assets/examples/09-api/documentation.html +104 -0
- package/assets/examples/09-api/documentation.md +95 -0
- package/assets/examples/09-api/inferred-spec.yaml +420 -0
- package/assets/examples/09-api/openapi.json +61 -0
- package/assets/examples/10-api/README.md +216 -0
- package/assets/examples/10-api/ai-spec.yaml +194 -0
- package/assets/examples/10-api/converted.yaml +96 -0
- package/assets/examples/10-api/diagram-architecture.mmd +10 -0
- package/assets/examples/10-api/diagram-er.mmd +10 -0
- package/assets/examples/10-api/documentation.html +104 -0
- package/assets/examples/10-api/documentation.md +95 -0
- package/assets/examples/10-api/inferred-spec.yaml +7 -0
- package/assets/examples/10-api/metadata.yaml +89 -0
- package/assets/examples/10-api/openapi.json +61 -0
- package/assets/examples/10-api/package-integration-test.js +177 -0
- package/assets/examples/10-api/usage-example.js +323 -0
- package/assets/examples/10-api/usage-example.ts +363 -0
- package/assets/examples/10-api/workflow-test.js +113 -0
- package/assets/examples/manifests/01-simple-default-mappings.yaml +36 -0
- package/assets/examples/manifests/02-capability-mappings.yaml +55 -0
- package/assets/examples/manifests/03-hybrid-mappings.yaml +109 -0
- package/assets/examples/manifests/README.md +245 -0
- package/assets/examples/manifests/backend-only.yaml +43 -0
- package/assets/examples/manifests/blog-api.md +78 -0
- package/assets/examples/manifests/blog-api.specly +79 -0
- package/assets/examples/manifests/frontend-only.yaml +27 -0
- package/assets/examples/manifests/fullstack-app.yaml +44 -0
- package/assets/examples/manifests/fullstack-monorepo.yaml +62 -0
- package/assets/examples/validate-examples-with-expected-failures.cjs +328 -0
- package/assets/examples/validate-examples.cjs +225 -0
- package/assets/examples-decomposed/cloud-native-manifest.example.yaml +8 -0
- package/assets/examples-decomposed/cloud-native-manifest.md +379 -0
- package/assets/examples-decomposed/cloud-native-manifest.specly +60 -0
- package/assets/examples-decomposed/docker-compose-manifest.example.yaml +8 -0
- package/assets/examples-decomposed/docker-compose-manifest.md +326 -0
- package/assets/examples-decomposed/docker-compose-manifest.specly +40 -0
- package/assets/examples-decomposed/kubernetes-deployment-manifest.example.yaml +8 -0
- package/assets/examples-decomposed/kubernetes-deployment-manifest.md +237 -0
- package/assets/examples-decomposed/kubernetes-deployment-manifest.specly +41 -0
- package/assets/examples-inference/inference-engine-demo.example.yaml +8 -0
- package/assets/examples-inference/inference-engine-demo.md +574 -0
- package/assets/examples-inference/inference-engine-demo.specly +216 -0
- package/assets/prompts/MOVED.md +35 -0
- package/assets/prompts/SUMMARY-v8-PROMOTION.md +445 -0
- package/assets/prompts/core/CHANGELOG.md +158 -0
- package/assets/prompts/core/MIGRATION-v6-to-v7.md +379 -0
- package/assets/prompts/core/README.md +319 -0
- package/assets/prompts/core/base-terminal-prompt.md +201 -0
- package/assets/prompts/core/examples/example-usage.ts +140 -0
- package/assets/prompts/core/schemas/prompt.schema.json +309 -0
- package/assets/prompts/core/schemas/prompt.schema.yaml +229 -0
- package/assets/prompts/core/standard/archive/v1/analyse.prompt.yaml +259 -0
- package/assets/prompts/core/standard/archive/v1/create.prompt.yaml +302 -0
- package/assets/prompts/core/standard/archive/v1/materialise.prompt.yaml +328 -0
- package/assets/prompts/core/standard/archive/v1/realize.prompt.yaml +606 -0
- package/assets/prompts/core/standard/archive/v2/README.md +110 -0
- package/assets/prompts/core/standard/archive/v2/analyse.prompt.yaml +151 -0
- package/assets/prompts/core/standard/archive/v2/create.prompt.yaml +151 -0
- package/assets/prompts/core/standard/archive/v2/materialise.prompt.yaml +132 -0
- package/assets/prompts/core/standard/archive/v2/realize.prompt.yaml +147 -0
- package/assets/prompts/core/standard/archive/v3/README.md +279 -0
- package/assets/prompts/core/standard/archive/v3/analyse.prompt.yaml +309 -0
- package/assets/prompts/core/standard/archive/v3/create.prompt.yaml +351 -0
- package/assets/prompts/core/standard/archive/v3/materialise.prompt.yaml +247 -0
- package/assets/prompts/core/standard/archive/v3/realize.prompt.yaml +344 -0
- package/assets/prompts/core/standard/archive/v4/README.md +79 -0
- package/assets/prompts/core/standard/archive/v4/analyse.prompt.yaml +204 -0
- package/assets/prompts/core/standard/archive/v4/create.prompt.yaml +185 -0
- package/assets/prompts/core/standard/archive/v5/README.md +224 -0
- package/assets/prompts/core/standard/archive/v5/analyse.prompt.yaml +209 -0
- package/assets/prompts/core/standard/archive/v5/create.prompt.yaml +225 -0
- package/assets/prompts/core/standard/archive/v5/materialise.prompt.yaml +242 -0
- package/assets/prompts/core/standard/archive/v5/realize.prompt.yaml +336 -0
- package/assets/prompts/core/standard/archive/v6/README.md +187 -0
- package/assets/prompts/core/standard/archive/v6/analyse.prompt.yaml +219 -0
- package/assets/prompts/core/standard/archive/v6/create.prompt.yaml +180 -0
- package/assets/prompts/core/standard/archive/v6/materialise.prompt.yaml +203 -0
- package/assets/prompts/core/standard/archive/v6/realize.prompt.yaml +215 -0
- package/assets/prompts/core/standard/archive/v7/analyse.prompt.nick.yaml +144 -0
- package/assets/prompts/core/standard/archive/v7/analyse.prompt.old.yaml +146 -0
- package/assets/prompts/core/standard/archive/v7/analyse.prompt.yaml +129 -0
- package/assets/prompts/core/standard/archive/v7/create.prompt.yaml +146 -0
- package/assets/prompts/core/standard/archive/v7/materialise.prompt.yaml +297 -0
- package/assets/prompts/core/standard/archive/v7/realize.prompt.yaml +294 -0
- package/assets/prompts/core/standard/archive/v8/README.md +400 -0
- package/assets/prompts/core/standard/archive/v8/analyse.prompt.yaml +185 -0
- package/assets/prompts/core/standard/archive/v8/create.prompt.yaml +203 -0
- package/assets/prompts/core/standard/archive/v8/materialise.prompt.yaml +297 -0
- package/assets/prompts/core/standard/archive/v8/realize.prompt.yaml +294 -0
- package/assets/prompts/core/standard/default/analyse.prompt.yaml +496 -0
- package/assets/prompts/core/standard/default/app-demo.prompt.yaml +213 -0
- package/assets/prompts/core/standard/default/create.prompt.yaml +418 -0
- package/assets/prompts/core/standard/default/materialise.prompt.yaml +814 -0
- package/assets/prompts/core/standard/default/realize.prompt.yaml +574 -0
- package/assets/prompts/core/standard/v9/analyse.prompt.yaml +496 -0
- package/assets/prompts/core/standard/v9/create.prompt.yaml +418 -0
- package/assets/prompts/core/standard/v9/materialise.prompt.yaml +814 -0
- package/assets/prompts/core/standard/v9/realize.prompt.yaml +574 -0
- package/assets/prompts/templates/api-orchestrator-template.yaml +188 -0
- package/assets/prompts/templates/claude-integration-template.md +121 -0
- package/assets/prompts/templates/terminal-prompt-template.md +97 -0
- package/dist/ai/commands/enhance.d.ts +8 -0
- package/dist/ai/commands/enhance.d.ts.map +1 -0
- package/dist/ai/commands/enhance.js +155 -0
- package/dist/ai/commands/enhance.js.map +1 -0
- package/dist/ai/commands/fill.d.ts +8 -0
- package/dist/ai/commands/fill.d.ts.map +1 -0
- package/dist/ai/commands/fill.js +179 -0
- package/dist/ai/commands/fill.js.map +1 -0
- package/dist/ai/commands/index.d.ts +11 -0
- package/dist/ai/commands/index.d.ts.map +1 -0
- package/dist/ai/commands/index.js +11 -0
- package/dist/ai/commands/index.js.map +1 -0
- package/dist/ai/commands/spec-analyser.d.ts +18 -0
- package/dist/ai/commands/spec-analyser.d.ts.map +1 -0
- package/dist/ai/commands/spec-analyser.js +175 -0
- package/dist/ai/commands/spec-analyser.js.map +1 -0
- package/dist/ai/commands/suggest.d.ts +8 -0
- package/dist/ai/commands/suggest.d.ts.map +1 -0
- package/dist/ai/commands/suggest.js +101 -0
- package/dist/ai/commands/suggest.js.map +1 -0
- package/dist/ai/commands/template.d.ts +8 -0
- package/dist/ai/commands/template.d.ts.map +1 -0
- package/dist/ai/commands/template.js +136 -0
- package/dist/ai/commands/template.js.map +1 -0
- package/dist/ai/config/index.d.ts +71 -0
- package/dist/ai/config/index.d.ts.map +1 -0
- package/dist/ai/config/index.js +193 -0
- package/dist/ai/config/index.js.map +1 -0
- package/dist/ai/config-loader.d.ts +31 -0
- package/dist/ai/config-loader.d.ts.map +1 -0
- package/dist/ai/config-loader.js +66 -0
- package/dist/ai/config-loader.js.map +1 -0
- package/dist/ai/core/ecosystem-prompt-manager.d.ts +107 -0
- package/dist/ai/core/ecosystem-prompt-manager.d.ts.map +1 -0
- package/dist/ai/core/ecosystem-prompt-manager.js +462 -0
- package/dist/ai/core/ecosystem-prompt-manager.js.map +1 -0
- package/dist/ai/examples/basic-usage.d.ts +9 -0
- package/dist/ai/examples/basic-usage.d.ts.map +1 -0
- package/dist/ai/examples/basic-usage.js +94 -0
- package/dist/ai/examples/basic-usage.js.map +1 -0
- package/dist/ai/index.d.ts +44 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +164 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/orchestrator/index.d.ts +3 -0
- package/dist/ai/orchestrator/index.d.ts.map +1 -0
- package/dist/ai/orchestrator/index.js +3 -0
- package/dist/ai/orchestrator/index.js.map +1 -0
- package/dist/ai/orchestrator/interactive-workflow.d.ts +66 -0
- package/dist/ai/orchestrator/interactive-workflow.d.ts.map +1 -0
- package/dist/ai/orchestrator/interactive-workflow.js +214 -0
- package/dist/ai/orchestrator/interactive-workflow.js.map +1 -0
- package/dist/ai/orchestrator/specverse-orchestrator.d.ts +217 -0
- package/dist/ai/orchestrator/specverse-orchestrator.d.ts.map +1 -0
- package/dist/ai/orchestrator/specverse-orchestrator.js +745 -0
- package/dist/ai/orchestrator/specverse-orchestrator.js.map +1 -0
- package/dist/ai/prompt-loader.d.ts +24 -0
- package/dist/ai/prompt-loader.d.ts.map +1 -0
- package/dist/ai/prompt-loader.js +159 -0
- package/dist/ai/prompt-loader.js.map +1 -0
- package/dist/ai/providers/anthropic-provider.d.ts +38 -0
- package/dist/ai/providers/anthropic-provider.d.ts.map +1 -0
- package/dist/ai/providers/anthropic-provider.js +235 -0
- package/dist/ai/providers/anthropic-provider.js.map +1 -0
- package/dist/ai/providers/index.d.ts +6 -0
- package/dist/ai/providers/index.d.ts.map +1 -0
- package/dist/ai/providers/index.js +6 -0
- package/dist/ai/providers/index.js.map +1 -0
- package/dist/ai/providers/interactive-provider.d.ts +67 -0
- package/dist/ai/providers/interactive-provider.d.ts.map +1 -0
- package/dist/ai/providers/interactive-provider.js +337 -0
- package/dist/ai/providers/interactive-provider.js.map +1 -0
- package/dist/ai/providers/llm-provider.d.ts +127 -0
- package/dist/ai/providers/llm-provider.d.ts.map +1 -0
- package/dist/ai/providers/llm-provider.js +141 -0
- package/dist/ai/providers/llm-provider.js.map +1 -0
- package/dist/ai/providers/openai-provider.d.ts +39 -0
- package/dist/ai/providers/openai-provider.d.ts.map +1 -0
- package/dist/ai/providers/openai-provider.js +193 -0
- package/dist/ai/providers/openai-provider.js.map +1 -0
- package/dist/ai/providers/provider-factory.d.ts +47 -0
- package/dist/ai/providers/provider-factory.d.ts.map +1 -0
- package/dist/ai/providers/provider-factory.js +159 -0
- package/dist/ai/providers/provider-factory.js.map +1 -0
- package/dist/ai/session/claude-executor.d.ts +39 -0
- package/dist/ai/session/claude-executor.d.ts.map +1 -0
- package/dist/ai/session/claude-executor.js +136 -0
- package/dist/ai/session/claude-executor.js.map +1 -0
- package/dist/ai/session/session-manager.d.ts +72 -0
- package/dist/ai/session/session-manager.d.ts.map +1 -0
- package/dist/ai/session/session-manager.js +294 -0
- package/dist/ai/session/session-manager.js.map +1 -0
- package/dist/ai/session/types.d.ts +152 -0
- package/dist/ai/session/types.d.ts.map +1 -0
- package/dist/ai/session/types.js +6 -0
- package/dist/ai/session/types.js.map +1 -0
- package/dist/ai/types/index.d.ts +83 -0
- package/dist/ai/types/index.d.ts.map +1 -0
- package/dist/ai/types/index.js +5 -0
- package/dist/ai/types/index.js.map +1 -0
- package/dist/generators/UML-generator.d.ts +64 -0
- package/dist/generators/UML-generator.d.ts.map +1 -0
- package/dist/generators/UML-generator.js +541 -0
- package/dist/generators/UML-generator.js.map +1 -0
- package/dist/generators/ai-view-generator.d.ts +391 -0
- package/dist/generators/ai-view-generator.d.ts.map +1 -0
- package/dist/generators/ai-view-generator.js +907 -0
- package/dist/generators/ai-view-generator.js.map +1 -0
- package/dist/generators/diagram-engine/core/BaseDiagramPlugin.d.ts +41 -0
- package/dist/generators/diagram-engine/core/BaseDiagramPlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/core/BaseDiagramPlugin.js +64 -0
- package/dist/generators/diagram-engine/core/BaseDiagramPlugin.js.map +1 -0
- package/dist/generators/diagram-engine/core/DiagramContext.d.ts +155 -0
- package/dist/generators/diagram-engine/core/DiagramContext.d.ts.map +1 -0
- package/dist/generators/diagram-engine/core/DiagramContext.js +481 -0
- package/dist/generators/diagram-engine/core/DiagramContext.js.map +1 -0
- package/dist/generators/diagram-engine/core/StyleManager.d.ts +51 -0
- package/dist/generators/diagram-engine/core/StyleManager.d.ts.map +1 -0
- package/dist/generators/diagram-engine/core/StyleManager.js +227 -0
- package/dist/generators/diagram-engine/core/StyleManager.js.map +1 -0
- package/dist/generators/diagram-engine/core/UnifiedDiagramGenerator.d.ts +83 -0
- package/dist/generators/diagram-engine/core/UnifiedDiagramGenerator.d.ts.map +1 -0
- package/dist/generators/diagram-engine/core/UnifiedDiagramGenerator.js +200 -0
- package/dist/generators/diagram-engine/core/UnifiedDiagramGenerator.js.map +1 -0
- package/dist/generators/diagram-engine/index.d.ts +41 -0
- package/dist/generators/diagram-engine/index.d.ts.map +1 -0
- package/dist/generators/diagram-engine/index.js +74 -0
- package/dist/generators/diagram-engine/index.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/architecture/ArchitecturePlugin.d.ts +65 -0
- package/dist/generators/diagram-engine/plugins/architecture/ArchitecturePlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/architecture/ArchitecturePlugin.js +490 -0
- package/dist/generators/diagram-engine/plugins/architecture/ArchitecturePlugin.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/class-diagram/ClassDiagramPlugin.d.ts +40 -0
- package/dist/generators/diagram-engine/plugins/class-diagram/ClassDiagramPlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/class-diagram/ClassDiagramPlugin.js +323 -0
- package/dist/generators/diagram-engine/plugins/class-diagram/ClassDiagramPlugin.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/deployment/DeploymentPlugin.d.ts +46 -0
- package/dist/generators/diagram-engine/plugins/deployment/DeploymentPlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/deployment/DeploymentPlugin.js +391 -0
- package/dist/generators/diagram-engine/plugins/deployment/DeploymentPlugin.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/er-diagram/ERDiagramPlugin.d.ts +57 -0
- package/dist/generators/diagram-engine/plugins/er-diagram/ERDiagramPlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/er-diagram/ERDiagramPlugin.js +300 -0
- package/dist/generators/diagram-engine/plugins/er-diagram/ERDiagramPlugin.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/event-flow/EventFlowPlugin.d.ts +70 -0
- package/dist/generators/diagram-engine/plugins/event-flow/EventFlowPlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/event-flow/EventFlowPlugin.js +955 -0
- package/dist/generators/diagram-engine/plugins/event-flow/EventFlowPlugin.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/lifecycle/LifecyclePlugin.d.ts +40 -0
- package/dist/generators/diagram-engine/plugins/lifecycle/LifecyclePlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/lifecycle/LifecyclePlugin.js +183 -0
- package/dist/generators/diagram-engine/plugins/lifecycle/LifecyclePlugin.js.map +1 -0
- package/dist/generators/diagram-engine/plugins/manifest/ManifestPlugin.d.ts +71 -0
- package/dist/generators/diagram-engine/plugins/manifest/ManifestPlugin.d.ts.map +1 -0
- package/dist/generators/diagram-engine/plugins/manifest/ManifestPlugin.js +396 -0
- package/dist/generators/diagram-engine/plugins/manifest/ManifestPlugin.js.map +1 -0
- package/dist/generators/diagram-engine/renderers/MermaidRenderer.d.ts +72 -0
- package/dist/generators/diagram-engine/renderers/MermaidRenderer.d.ts.map +1 -0
- package/dist/generators/diagram-engine/renderers/MermaidRenderer.js +441 -0
- package/dist/generators/diagram-engine/renderers/MermaidRenderer.js.map +1 -0
- package/dist/generators/diagram-engine/types/index.d.ts +261 -0
- package/dist/generators/diagram-engine/types/index.d.ts.map +1 -0
- package/dist/generators/diagram-engine/types/index.js +7 -0
- package/dist/generators/diagram-engine/types/index.js.map +1 -0
- package/dist/generators/documentation-generator.d.ts +54 -0
- package/dist/generators/documentation-generator.d.ts.map +1 -0
- package/dist/generators/documentation-generator.js +756 -0
- package/dist/generators/documentation-generator.js.map +1 -0
- package/dist/generators/index.d.ts +47 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +51 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/inference/comprehensive-engine.d.ts +71 -0
- package/dist/inference/comprehensive-engine.d.ts.map +1 -0
- package/dist/inference/comprehensive-engine.js +271 -0
- package/dist/inference/comprehensive-engine.js.map +1 -0
- package/dist/inference/core/context.d.ts +60 -0
- package/dist/inference/core/context.d.ts.map +1 -0
- package/dist/inference/core/context.js +292 -0
- package/dist/inference/core/context.js.map +1 -0
- package/dist/inference/core/index.d.ts +14 -0
- package/dist/inference/core/index.d.ts.map +1 -0
- package/dist/inference/core/index.js +18 -0
- package/dist/inference/core/index.js.map +1 -0
- package/dist/inference/core/rule-engine.d.ts +52 -0
- package/dist/inference/core/rule-engine.d.ts.map +1 -0
- package/dist/inference/core/rule-engine.js +1329 -0
- package/dist/inference/core/rule-engine.js.map +1 -0
- package/dist/inference/core/rule-file-types.d.ts +225 -0
- package/dist/inference/core/rule-file-types.d.ts.map +1 -0
- package/dist/inference/core/rule-file-types.js +79 -0
- package/dist/inference/core/rule-file-types.js.map +1 -0
- package/dist/inference/core/rule-loader.d.ts +93 -0
- package/dist/inference/core/rule-loader.d.ts.map +1 -0
- package/dist/inference/core/rule-loader.js +645 -0
- package/dist/inference/core/rule-loader.js.map +1 -0
- package/dist/inference/core/specly-converter.d.ts +50 -0
- package/dist/inference/core/specly-converter.d.ts.map +1 -0
- package/dist/inference/core/specly-converter.js +885 -0
- package/dist/inference/core/specly-converter.js.map +1 -0
- package/dist/inference/core/types.d.ts +395 -0
- package/dist/inference/core/types.d.ts.map +1 -0
- package/dist/inference/core/types.js +31 -0
- package/dist/inference/core/types.js.map +1 -0
- package/dist/inference/deployment/deployment-generator.d.ts +48 -0
- package/dist/inference/deployment/deployment-generator.d.ts.map +1 -0
- package/dist/inference/deployment/deployment-generator.js +343 -0
- package/dist/inference/deployment/deployment-generator.js.map +1 -0
- package/dist/inference/deployment/index.d.ts +6 -0
- package/dist/inference/deployment/index.d.ts.map +1 -0
- package/dist/inference/deployment/index.js +5 -0
- package/dist/inference/deployment/index.js.map +1 -0
- package/dist/inference/dev-specly-generator.d.ts +19 -0
- package/dist/inference/dev-specly-generator.d.ts.map +1 -0
- package/dist/inference/dev-specly-generator.js +127 -0
- package/dist/inference/dev-specly-generator.js.map +1 -0
- package/dist/inference/index.d.ts +29 -0
- package/dist/inference/index.d.ts.map +1 -0
- package/dist/inference/index.js +170 -0
- package/dist/inference/index.js.map +1 -0
- package/dist/inference/logical/generators/component-type-resolver.d.ts +82 -0
- package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -0
- package/dist/inference/logical/generators/component-type-resolver.js +151 -0
- package/dist/inference/logical/generators/component-type-resolver.js.map +1 -0
- package/dist/inference/logical/generators/controller-generator.d.ts +43 -0
- package/dist/inference/logical/generators/controller-generator.d.ts.map +1 -0
- package/dist/inference/logical/generators/controller-generator.js +303 -0
- package/dist/inference/logical/generators/controller-generator.js.map +1 -0
- package/dist/inference/logical/generators/event-generator.d.ts +67 -0
- package/dist/inference/logical/generators/event-generator.d.ts.map +1 -0
- package/dist/inference/logical/generators/event-generator.js +466 -0
- package/dist/inference/logical/generators/event-generator.js.map +1 -0
- package/dist/inference/logical/generators/promotion-generator.d.ts +32 -0
- package/dist/inference/logical/generators/promotion-generator.d.ts.map +1 -0
- package/dist/inference/logical/generators/promotion-generator.js +133 -0
- package/dist/inference/logical/generators/promotion-generator.js.map +1 -0
- package/dist/inference/logical/generators/service-generator.d.ts +51 -0
- package/dist/inference/logical/generators/service-generator.d.ts.map +1 -0
- package/dist/inference/logical/generators/service-generator.js +268 -0
- package/dist/inference/logical/generators/service-generator.js.map +1 -0
- package/dist/inference/logical/generators/specialist-view-expander.d.ts +75 -0
- package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -0
- package/dist/inference/logical/generators/specialist-view-expander.js +182 -0
- package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -0
- package/dist/inference/logical/generators/view-generator.d.ts +131 -0
- package/dist/inference/logical/generators/view-generator.d.ts.map +1 -0
- package/dist/inference/logical/generators/view-generator.js +1115 -0
- package/dist/inference/logical/generators/view-generator.js.map +1 -0
- package/dist/inference/logical/index.d.ts +19 -0
- package/dist/inference/logical/index.d.ts.map +1 -0
- package/dist/inference/logical/index.js +15 -0
- package/dist/inference/logical/index.js.map +1 -0
- package/dist/inference/logical/logical-engine.d.ts +68 -0
- package/dist/inference/logical/logical-engine.d.ts.map +1 -0
- package/dist/inference/logical/logical-engine.js +484 -0
- package/dist/inference/logical/logical-engine.js.map +1 -0
- package/dist/inference/quint-transpiler.d.ts +64 -0
- package/dist/inference/quint-transpiler.d.ts.map +1 -0
- package/dist/inference/quint-transpiler.js +433 -0
- package/dist/inference/quint-transpiler.js.map +1 -0
- package/dist/inference/test-harness.d.ts +41 -0
- package/dist/inference/test-harness.d.ts.map +1 -0
- package/dist/inference/test-harness.js +357 -0
- package/dist/inference/test-harness.js.map +1 -0
- package/dist/parser/convention-processor.d.ts +66 -0
- package/dist/parser/convention-processor.d.ts.map +1 -0
- package/dist/parser/convention-processor.js +349 -0
- package/dist/parser/convention-processor.js.map +1 -0
- package/dist/parser/import-resolver/cache.d.ts +56 -0
- package/dist/parser/import-resolver/cache.d.ts.map +1 -0
- package/dist/parser/import-resolver/cache.js +191 -0
- package/dist/parser/import-resolver/cache.js.map +1 -0
- package/dist/parser/import-resolver/index.d.ts +10 -0
- package/dist/parser/import-resolver/index.d.ts.map +1 -0
- package/dist/parser/import-resolver/index.js +9 -0
- package/dist/parser/import-resolver/index.js.map +1 -0
- package/dist/parser/import-resolver/resolver.d.ts +102 -0
- package/dist/parser/import-resolver/resolver.d.ts.map +1 -0
- package/dist/parser/import-resolver/resolver.js +669 -0
- package/dist/parser/import-resolver/resolver.js.map +1 -0
- package/dist/parser/import-resolver/types.d.ts +55 -0
- package/dist/parser/import-resolver/types.d.ts.map +1 -0
- package/dist/parser/import-resolver/types.js +5 -0
- package/dist/parser/import-resolver/types.js.map +1 -0
- package/dist/parser/index.d.ts +38 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +61 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/namespace-utils.d.ts +61 -0
- package/dist/parser/namespace-utils.d.ts.map +1 -0
- package/dist/parser/namespace-utils.js +191 -0
- package/dist/parser/namespace-utils.js.map +1 -0
- package/dist/parser/processors/AbstractProcessor.d.ts +10 -0
- package/dist/parser/processors/AbstractProcessor.d.ts.map +1 -0
- package/dist/parser/processors/AbstractProcessor.js +11 -0
- package/dist/parser/processors/AbstractProcessor.js.map +1 -0
- package/dist/parser/processors/AttributeProcessor.d.ts +19 -0
- package/dist/parser/processors/AttributeProcessor.d.ts.map +1 -0
- package/dist/parser/processors/AttributeProcessor.js +154 -0
- package/dist/parser/processors/AttributeProcessor.js.map +1 -0
- package/dist/parser/processors/ControllerProcessor.d.ts +9 -0
- package/dist/parser/processors/ControllerProcessor.d.ts.map +1 -0
- package/dist/parser/processors/ControllerProcessor.js +74 -0
- package/dist/parser/processors/ControllerProcessor.js.map +1 -0
- package/dist/parser/processors/DeploymentProcessor.d.ts +19 -0
- package/dist/parser/processors/DeploymentProcessor.d.ts.map +1 -0
- package/dist/parser/processors/DeploymentProcessor.js +244 -0
- package/dist/parser/processors/DeploymentProcessor.js.map +1 -0
- package/dist/parser/processors/EventProcessor.d.ts +8 -0
- package/dist/parser/processors/EventProcessor.d.ts.map +1 -0
- package/dist/parser/processors/EventProcessor.js +28 -0
- package/dist/parser/processors/EventProcessor.js.map +1 -0
- package/dist/parser/processors/ExecutableProcessor.d.ts +21 -0
- package/dist/parser/processors/ExecutableProcessor.d.ts.map +1 -0
- package/dist/parser/processors/ExecutableProcessor.js +135 -0
- package/dist/parser/processors/ExecutableProcessor.js.map +1 -0
- package/dist/parser/processors/LifecycleProcessor.d.ts +9 -0
- package/dist/parser/processors/LifecycleProcessor.d.ts.map +1 -0
- package/dist/parser/processors/LifecycleProcessor.js +41 -0
- package/dist/parser/processors/LifecycleProcessor.js.map +1 -0
- package/dist/parser/processors/ModelProcessor.d.ts +67 -0
- package/dist/parser/processors/ModelProcessor.d.ts.map +1 -0
- package/dist/parser/processors/ModelProcessor.js +495 -0
- package/dist/parser/processors/ModelProcessor.js.map +1 -0
- package/dist/parser/processors/RelationshipProcessor.d.ts +10 -0
- package/dist/parser/processors/RelationshipProcessor.d.ts.map +1 -0
- package/dist/parser/processors/RelationshipProcessor.js +55 -0
- package/dist/parser/processors/RelationshipProcessor.js.map +1 -0
- package/dist/parser/processors/ServiceProcessor.d.ts +9 -0
- package/dist/parser/processors/ServiceProcessor.d.ts.map +1 -0
- package/dist/parser/processors/ServiceProcessor.js +59 -0
- package/dist/parser/processors/ServiceProcessor.js.map +1 -0
- package/dist/parser/processors/ViewProcessor.d.ts +7 -0
- package/dist/parser/processors/ViewProcessor.d.ts.map +1 -0
- package/dist/parser/processors/ViewProcessor.js +66 -0
- package/dist/parser/processors/ViewProcessor.js.map +1 -0
- package/dist/parser/types/ast.d.ts +518 -0
- package/dist/parser/types/ast.d.ts.map +1 -0
- package/dist/parser/types/ast.js +8 -0
- package/dist/parser/types/ast.js.map +1 -0
- package/dist/parser/types/views.d.ts +186 -0
- package/dist/parser/types/views.d.ts.map +1 -0
- package/dist/parser/types/views.js +8 -0
- package/dist/parser/types/views.js.map +1 -0
- package/dist/parser/unified-parser.d.ts +195 -0
- package/dist/parser/unified-parser.d.ts.map +1 -0
- package/dist/parser/unified-parser.js +1180 -0
- package/dist/parser/unified-parser.js.map +1 -0
- package/dist/parser/vitest.config.d.ts +3 -0
- package/dist/parser/vitest.config.d.ts.map +1 -0
- package/dist/parser/vitest.config.js +27 -0
- package/dist/parser/vitest.config.js.map +1 -0
- package/dist/realize/engines/code-generator.d.ts +86 -0
- package/dist/realize/engines/code-generator.d.ts.map +1 -0
- package/dist/realize/engines/code-generator.js +159 -0
- package/dist/realize/engines/code-generator.js.map +1 -0
- package/dist/realize/engines/engine-registry.d.ts +94 -0
- package/dist/realize/engines/engine-registry.d.ts.map +1 -0
- package/dist/realize/engines/engine-registry.js +163 -0
- package/dist/realize/engines/engine-registry.js.map +1 -0
- package/dist/realize/engines/index.d.ts +10 -0
- package/dist/realize/engines/index.d.ts.map +1 -0
- package/dist/realize/engines/index.js +12 -0
- package/dist/realize/engines/index.js.map +1 -0
- package/dist/realize/engines/typescript-engine.d.ts +74 -0
- package/dist/realize/engines/typescript-engine.d.ts.map +1 -0
- package/dist/realize/engines/typescript-engine.js +289 -0
- package/dist/realize/engines/typescript-engine.js.map +1 -0
- package/dist/realize/generators/index.d.ts +11 -0
- package/dist/realize/generators/index.d.ts.map +1 -0
- package/dist/realize/generators/index.js +11 -0
- package/dist/realize/generators/index.js.map +1 -0
- package/dist/realize/index.d.ts +48 -0
- package/dist/realize/index.d.ts.map +1 -0
- package/dist/realize/index.js +529 -0
- package/dist/realize/index.js.map +1 -0
- package/dist/realize/library/index.d.ts +12 -0
- package/dist/realize/library/index.d.ts.map +1 -0
- package/dist/realize/library/index.js +15 -0
- package/dist/realize/library/index.js.map +1 -0
- package/dist/realize/library/library.d.ts +132 -0
- package/dist/realize/library/library.d.ts.map +1 -0
- package/dist/realize/library/library.js +343 -0
- package/dist/realize/library/library.js.map +1 -0
- package/dist/realize/library/loader.d.ts +73 -0
- package/dist/realize/library/loader.d.ts.map +1 -0
- package/dist/realize/library/loader.js +159 -0
- package/dist/realize/library/loader.js.map +1 -0
- package/dist/realize/library/resolver.d.ts +104 -0
- package/dist/realize/library/resolver.d.ts.map +1 -0
- package/dist/realize/library/resolver.js +299 -0
- package/dist/realize/library/resolver.js.map +1 -0
- package/dist/realize/library/validator.d.ts +65 -0
- package/dist/realize/library/validator.d.ts.map +1 -0
- package/dist/realize/library/validator.js +203 -0
- package/dist/realize/library/validator.js.map +1 -0
- package/dist/realize/types/index.d.ts +5 -0
- package/dist/realize/types/index.d.ts.map +1 -0
- package/dist/realize/types/index.js +5 -0
- package/dist/realize/types/index.js.map +1 -0
- package/dist/realize/types/instance-factory.d.ts +7 -0
- package/dist/realize/types/instance-factory.d.ts.map +1 -0
- package/dist/realize/types/instance-factory.js +2 -0
- package/dist/realize/types/instance-factory.js.map +1 -0
- package/dist/realize/types/unified-mappings.d.ts +163 -0
- package/dist/realize/types/unified-mappings.d.ts.map +1 -0
- package/dist/realize/types/unified-mappings.js +110 -0
- package/dist/realize/types/unified-mappings.js.map +1 -0
- package/dist/realize/utils/ai-spec-loader.d.ts +77 -0
- package/dist/realize/utils/ai-spec-loader.d.ts.map +1 -0
- package/dist/realize/utils/ai-spec-loader.js +142 -0
- package/dist/realize/utils/ai-spec-loader.js.map +1 -0
- package/dist/realize/utils/index.d.ts +9 -0
- package/dist/realize/utils/index.d.ts.map +1 -0
- package/dist/realize/utils/index.js +9 -0
- package/dist/realize/utils/index.js.map +1 -0
- package/dist/realize/utils/manifest-loader.d.ts +107 -0
- package/dist/realize/utils/manifest-loader.d.ts.map +1 -0
- package/dist/realize/utils/manifest-loader.js +168 -0
- package/dist/realize/utils/manifest-loader.js.map +1 -0
- package/dist/realize/utils/mapping-migration.d.ts +53 -0
- package/dist/realize/utils/mapping-migration.d.ts.map +1 -0
- package/dist/realize/utils/mapping-migration.js +194 -0
- package/dist/realize/utils/mapping-migration.js.map +1 -0
- package/dist/registry/cache/cache-manager.d.ts +132 -0
- package/dist/registry/cache/cache-manager.d.ts.map +1 -0
- package/dist/registry/cache/cache-manager.js +218 -0
- package/dist/registry/cache/cache-manager.js.map +1 -0
- package/dist/registry/client/registry-client.d.ts +129 -0
- package/dist/registry/client/registry-client.d.ts.map +1 -0
- package/dist/registry/client/registry-client.js +317 -0
- package/dist/registry/client/registry-client.js.map +1 -0
- package/dist/registry/formatters/error-formatter.d.ts +100 -0
- package/dist/registry/formatters/error-formatter.d.ts.map +1 -0
- package/dist/registry/formatters/error-formatter.js +290 -0
- package/dist/registry/formatters/error-formatter.js.map +1 -0
- package/dist/registry/formatters/index.d.ts +8 -0
- package/dist/registry/formatters/index.d.ts.map +1 -0
- package/dist/registry/formatters/index.js +7 -0
- package/dist/registry/formatters/index.js.map +1 -0
- package/dist/registry/index.d.ts +19 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +22 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/offline/offline-handler.d.ts +150 -0
- package/dist/registry/offline/offline-handler.d.ts.map +1 -0
- package/dist/registry/offline/offline-handler.js +290 -0
- package/dist/registry/offline/offline-handler.js.map +1 -0
- package/dist/registry/types/index.d.ts +13 -0
- package/dist/registry/types/index.d.ts.map +1 -0
- package/dist/registry/types/index.js +11 -0
- package/dist/registry/types/index.js.map +1 -0
- package/dist/registry/types/registry.d.ts +220 -0
- package/dist/registry/types/registry.d.ts.map +1 -0
- package/dist/registry/types/registry.js +55 -0
- package/dist/registry/types/registry.js.map +1 -0
- package/dist/registry/types/validation.d.ts +197 -0
- package/dist/registry/types/validation.d.ts.map +1 -0
- package/dist/registry/types/validation.js +140 -0
- package/dist/registry/types/validation.js.map +1 -0
- package/dist/registry/utils/manifest-adapter.d.ts +42 -0
- package/dist/registry/utils/manifest-adapter.d.ts.map +1 -0
- package/dist/registry/utils/manifest-adapter.js +182 -0
- package/dist/registry/utils/manifest-adapter.js.map +1 -0
- package/dist/registry/validators/index.d.ts +12 -0
- package/dist/registry/validators/index.d.ts.map +1 -0
- package/dist/registry/validators/index.js +9 -0
- package/dist/registry/validators/index.js.map +1 -0
- package/dist/registry/validators/installation-validator.d.ts +75 -0
- package/dist/registry/validators/installation-validator.d.ts.map +1 -0
- package/dist/registry/validators/installation-validator.js +142 -0
- package/dist/registry/validators/installation-validator.js.map +1 -0
- package/dist/registry/validators/manifest-validator.d.ts +82 -0
- package/dist/registry/validators/manifest-validator.d.ts.map +1 -0
- package/dist/registry/validators/manifest-validator.js +213 -0
- package/dist/registry/validators/manifest-validator.js.map +1 -0
- package/dist/registry/validators/validator.d.ts +113 -0
- package/dist/registry/validators/validator.d.ts.map +1 -0
- package/dist/registry/validators/validator.js +165 -0
- package/dist/registry/validators/validator.js.map +1 -0
- package/libs/instance-factories/CURVED-INTERFACE.md +278 -0
- package/libs/instance-factories/README.md +73 -0
- package/libs/instance-factories/applications/README.md +51 -0
- package/libs/instance-factories/applications/generic-app.yaml +52 -0
- package/libs/instance-factories/applications/react-app-runtime.yaml +139 -0
- package/libs/instance-factories/applications/react-app.yaml +186 -0
- package/libs/instance-factories/applications/templates/generic/backend-env-generator.ts +31 -0
- package/libs/instance-factories/applications/templates/generic/backend-package-json-generator.ts +84 -0
- package/libs/instance-factories/applications/templates/generic/backend-tsconfig-generator.ts +69 -0
- package/libs/instance-factories/applications/templates/generic/main-generator.ts +308 -0
- package/libs/instance-factories/applications/templates/react/_view-components-source.ts +555 -0
- package/libs/instance-factories/applications/templates/react/api-client-generator.ts +436 -0
- package/libs/instance-factories/applications/templates/react/api-types-generator.ts +153 -0
- package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +94 -0
- package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -0
- package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +106 -0
- package/libs/instance-factories/applications/templates/react/gitignore-generator.ts +38 -0
- package/libs/instance-factories/applications/templates/react/index-css-generator.ts +14 -0
- package/libs/instance-factories/applications/templates/react/index-html-generator.ts +30 -0
- package/libs/instance-factories/applications/templates/react/main-tsx-generator.ts +34 -0
- package/libs/instance-factories/applications/templates/react/package-json-generator.ts +57 -0
- package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +179 -0
- package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +1347 -0
- package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +150 -0
- package/libs/instance-factories/applications/templates/react/runtime-app-tsx-generator.ts +90 -0
- package/libs/instance-factories/applications/templates/react/runtime-package-json-generator.ts +61 -0
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +704 -0
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +84 -0
- package/libs/instance-factories/applications/templates/react/tsconfig-generator.ts +35 -0
- package/libs/instance-factories/applications/templates/react/use-api-hooks-generator.ts +121 -0
- package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +150 -0
- package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +150 -0
- package/libs/instance-factories/applications/templates/react/view-form-generator.ts +362 -0
- package/libs/instance-factories/applications/templates/react/view-list-generator.ts +98 -0
- package/libs/instance-factories/applications/templates/react/view-router-generator.ts +89 -0
- package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +49 -0
- package/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
- package/libs/instance-factories/cli/README.md +43 -0
- package/libs/instance-factories/cli/commander-js.yaml +55 -0
- package/libs/instance-factories/cli/templates/commander/cli-bin-wrapper-generator.ts +20 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.d.ts +12 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.d.ts.map +1 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.js +115 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.js.map +1 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.ts +168 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.d.ts +14 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.d.ts.map +1 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.js +182 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.js.map +1 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +1036 -0
- package/libs/instance-factories/communication/README.md +47 -0
- package/libs/instance-factories/communication/event-emitter.yaml +56 -0
- package/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
- package/libs/instance-factories/communication/templates/eventemitter/bus-generator.ts +93 -0
- package/libs/instance-factories/communication/templates/eventemitter/publisher-generator.ts +117 -0
- package/libs/instance-factories/communication/templates/eventemitter/subscriber-generator.ts +101 -0
- package/libs/instance-factories/controllers/README.md +42 -0
- package/libs/instance-factories/controllers/fastify.yaml +127 -0
- package/libs/instance-factories/controllers/templates/fastify/meta-routes-generator.ts +103 -0
- package/libs/instance-factories/controllers/templates/fastify/routes-generator.ts +389 -0
- package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +76 -0
- package/libs/instance-factories/infrastructure/README.md +29 -0
- package/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
- package/libs/instance-factories/infrastructure/templates/docker-k8s/infrastructure-generator.ts +46 -0
- package/libs/instance-factories/orms/README.md +54 -0
- package/libs/instance-factories/orms/prisma.yaml +89 -0
- package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +576 -0
- package/libs/instance-factories/orms/templates/prisma/services-generator.ts +408 -0
- package/libs/instance-factories/scaffolding/README.md +49 -0
- package/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
- package/libs/instance-factories/scaffolding/templates/generic/env-example-generator.ts +73 -0
- package/libs/instance-factories/scaffolding/templates/generic/env-generator.ts +85 -0
- package/libs/instance-factories/scaffolding/templates/generic/gitignore-generator.ts +69 -0
- package/libs/instance-factories/scaffolding/templates/generic/package-json-generator.ts +176 -0
- package/libs/instance-factories/scaffolding/templates/generic/readme-generator.ts +207 -0
- package/libs/instance-factories/scaffolding/templates/generic/tsconfig-generator.ts +78 -0
- package/libs/instance-factories/scaffolding/templates/generic/tsconfig-react-generator.ts +41 -0
- package/libs/instance-factories/sdks/README.md +28 -0
- package/libs/instance-factories/sdks/python-sdk.yaml +66 -0
- package/libs/instance-factories/sdks/templates/python/sdk-generator.ts +50 -0
- package/libs/instance-factories/sdks/templates/typescript/sdk-generator.ts +49 -0
- package/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
- package/libs/instance-factories/services/README.md +55 -0
- package/libs/instance-factories/services/prisma-services.yaml +71 -0
- package/libs/instance-factories/services/templates/memory/generate-interpreter.ts +25 -0
- package/libs/instance-factories/services/templates/memory/step-conventions-memory.ts +465 -0
- package/libs/instance-factories/services/templates/prisma/behavior-generator.ts +304 -0
- package/libs/instance-factories/services/templates/prisma/controller-generator.ts +532 -0
- package/libs/instance-factories/services/templates/prisma/service-generator.ts +334 -0
- package/libs/instance-factories/services/templates/prisma/step-conventions.ts +309 -0
- package/libs/instance-factories/services/templates/shared-patterns.ts +38 -0
- package/libs/instance-factories/shared/path-resolver.ts +111 -0
- package/libs/instance-factories/storage/README.md +34 -0
- package/libs/instance-factories/storage/mongodb.yaml +79 -0
- package/libs/instance-factories/storage/postgresql.yaml +75 -0
- package/libs/instance-factories/storage/redis.yaml +79 -0
- package/libs/instance-factories/storage/templates/mongodb/config-generator.ts +15 -0
- package/libs/instance-factories/storage/templates/mongodb/docker-generator.ts +18 -0
- package/libs/instance-factories/storage/templates/postgresql/config-generator.ts +54 -0
- package/libs/instance-factories/storage/templates/postgresql/docker-generator.ts +55 -0
- package/libs/instance-factories/storage/templates/redis/config-generator.ts +16 -0
- package/libs/instance-factories/storage/templates/redis/docker-generator.ts +18 -0
- package/libs/instance-factories/test-generation.ts +192 -0
- package/libs/instance-factories/testing/README.md +40 -0
- package/libs/instance-factories/testing/templates/vitest/tests-generator.ts +51 -0
- package/libs/instance-factories/testing/vitest-tests.yaml +63 -0
- package/libs/instance-factories/tools/README.md +70 -0
- package/libs/instance-factories/tools/mcp.yaml +36 -0
- package/libs/instance-factories/tools/templates/mcp/mcp-server-generator.ts +190 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/DEPLOYMENT_GUIDE.md +630 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/HYBRID_RESOURCE_SYSTEM.md +330 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/EXTENSION_DEPLOYMENT.md +552 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/LOCAL_DEPLOYMENT.md +164 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/WEB_DEPLOYMENT.md +247 -0
- package/libs/instance-factories/tools/templates/mcp/static/package.json +94 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-enterprise.js +284 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-extension.js +139 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-local.js +74 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-web.js +156 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/copy-canonical-files.js +41 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-deployments.js +259 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-hybrid-resources.js +231 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-hybrid-simple.js +196 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/controllers/MCPServerController.ts +293 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/events/EventEmitter.ts +90 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/index.ts +24 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/interfaces/ResourceProvider.ts +15 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/models/LibrarySuggestion.ts +106 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/models/SpecVerseResource.ts +75 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/server/mcp-server.ts +239 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/CLIProxyService.ts +1501 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/EmbeddedResourcesAdapter.ts +211 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/EntityModuleService.ts +308 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/HybridResourcesProvider.ts +210 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/LibraryToolsService.ts +356 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorBridge.ts +522 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorToolsService.ts +530 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/PromptToolsService.ts +594 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/ResourcesProviderService.ts +170 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/CLIProxyService.init.test.ts +544 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/CLIProxyService.test.ts +189 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/ResourcesProviderService.test.ts +89 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/types/index.ts +110 -0
- package/libs/instance-factories/tools/templates/mcp/static/tsconfig.json +28 -0
- package/libs/instance-factories/tools/templates/vscode/static/extension.ts +1195 -0
- package/libs/instance-factories/tools/templates/vscode/static/language-configuration.json +34 -0
- package/libs/instance-factories/tools/templates/vscode/static/schemas/specverse-v3-schema.json +4279 -0
- package/libs/instance-factories/tools/templates/vscode/static/syntaxes/specverse.tmLanguage.json +138 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/README.md +74 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/complete-specverse-colors.json +122 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/specverse-basic-theme.json +65 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/specverse-complete-theme.json +123 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/specverse-theme-colors.json +64 -0
- package/libs/instance-factories/tools/templates/vscode/vscode-extension-generator.ts +300 -0
- package/libs/instance-factories/tools/vscode.yaml +35 -0
- package/libs/instance-factories/validation/README.md +38 -0
- package/libs/instance-factories/validation/templates/zod/validation-generator.ts +46 -0
- package/libs/instance-factories/validation/zod.yaml +56 -0
- package/libs/instance-factories/views/README.md +62 -0
- package/libs/instance-factories/views/index.d.ts +13 -0
- package/libs/instance-factories/views/index.d.ts.map +1 -0
- package/libs/instance-factories/views/index.js +18 -0
- package/libs/instance-factories/views/index.js.map +1 -0
- package/libs/instance-factories/views/index.ts +45 -0
- package/libs/instance-factories/views/react-components.yaml +129 -0
- package/libs/instance-factories/views/templates/ARCHITECTURE.md +198 -0
- package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +869 -0
- package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +953 -0
- package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +806 -0
- package/libs/instance-factories/views/templates/react/app-generator.ts +55 -0
- package/libs/instance-factories/views/templates/react/components-generator.ts +887 -0
- package/libs/instance-factories/views/templates/react/forms-generator.ts +343 -0
- package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +57 -0
- package/libs/instance-factories/views/templates/react/hooks-generator.ts +122 -0
- package/libs/instance-factories/views/templates/react/index-css-generator.ts +14 -0
- package/libs/instance-factories/views/templates/react/index-html-generator.ts +34 -0
- package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +29 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +152 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.js +398 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.js.map +1 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.ts +533 -0
- package/libs/instance-factories/views/templates/react/router-generator.ts +197 -0
- package/libs/instance-factories/views/templates/react/router-generic-generator.ts +132 -0
- package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +188 -0
- package/libs/instance-factories/views/templates/react/spec-json-generator.ts +17 -0
- package/libs/instance-factories/views/templates/react/types-generator.ts +76 -0
- package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +42 -0
- package/libs/instance-factories/views/templates/react/vite-config-generator.ts +38 -0
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +1 -0
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +474 -0
- package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +242 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +77 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.js +47 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.ts +142 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +63 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +822 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +908 -0
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts +247 -0
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/base-generator.js +363 -0
- package/libs/instance-factories/views/templates/shared/base-generator.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/base-generator.ts +608 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +254 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.js +602 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.ts +803 -0
- package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +250 -0
- package/libs/instance-factories/views/templates/shared/composite-patterns.ts +535 -0
- package/libs/instance-factories/views/templates/shared/index.ts +68 -0
- package/libs/instance-factories/views/templates/shared/pattern-validator.ts +279 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +149 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.js +580 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.ts +700 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +143 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js +420 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +539 -0
- package/package.json +63 -0
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
name: materialise
|
|
2
|
+
version: 9.1.0
|
|
3
|
+
description: Generate complete production-ready implementations from SpecVerse specifications using three-layer architecture, instance factories, and business logic generation
|
|
4
|
+
category: code-generation
|
|
5
|
+
tags:
|
|
6
|
+
- implementation
|
|
7
|
+
- production
|
|
8
|
+
- full-stack
|
|
9
|
+
- instance-factories
|
|
10
|
+
- three-layer-architecture
|
|
11
|
+
- business-logic-generation
|
|
12
|
+
|
|
13
|
+
metadata:
|
|
14
|
+
author: SpecVerse Team
|
|
15
|
+
lastUpdated: 2025-11-27
|
|
16
|
+
compatibleWith:
|
|
17
|
+
- specverse: ">=3.4.9"
|
|
18
|
+
breaking_changes_from_v8:
|
|
19
|
+
- Now uses three-layer architecture (Components/Deployments/Manifests)
|
|
20
|
+
- Uses instance factories for technology-specific code generation
|
|
21
|
+
- Leverages operational policies from Deployments layer
|
|
22
|
+
- Uses capability mappings from Manifests
|
|
23
|
+
- Removes direct technology assumptions (no hardcoded NestJS/React/etc)
|
|
24
|
+
new_in_v9_1:
|
|
25
|
+
- Generates business logic from requires/ensures/steps/publishes
|
|
26
|
+
- Pattern-based step implementation generation
|
|
27
|
+
- Precondition and postcondition enforcement
|
|
28
|
+
- Automatic event publishing from operations
|
|
29
|
+
- Complete executable code (not just scaffolding)
|
|
30
|
+
|
|
31
|
+
prompt: |
|
|
32
|
+
# SpecVerse Materialisation - v9.1.0
|
|
33
|
+
|
|
34
|
+
You are an expert code generator that creates complete, production-ready implementations from SpecVerse specifications.
|
|
35
|
+
|
|
36
|
+
## Core Philosophy: Three-Layer Architecture
|
|
37
|
+
|
|
38
|
+
SpecVerse separates concerns into three distinct layers:
|
|
39
|
+
|
|
40
|
+
1. **Components (WHAT)**: Pure logical structure - technology-agnostic, environment-agnostic
|
|
41
|
+
- Data models, services, controllers, views, events
|
|
42
|
+
- Logical capabilities (authentication, validation, search)
|
|
43
|
+
- Component composition and relationships
|
|
44
|
+
- **Business logic contracts**: requires, ensures, steps, publishes
|
|
45
|
+
|
|
46
|
+
2. **Deployments (WHERE/HOW IT BEHAVES)**: Environment-specific operational behavior
|
|
47
|
+
- Operational policies: transactions, retries, circuit breakers, timeouts
|
|
48
|
+
- Security enforcement: authentication, authorization, encryption
|
|
49
|
+
- Performance: caching, rate limiting, resource limits
|
|
50
|
+
- Reliability: health checks, autoscaling, network policies
|
|
51
|
+
- Environment variations: dev vs staging vs production
|
|
52
|
+
|
|
53
|
+
3. **Manifests (HOW TO BUILD)**: Technology mapping via instance factories
|
|
54
|
+
- Technology selection (NestJS, React, PostgreSQL, Redis, etc)
|
|
55
|
+
- Capability mappings: logical capabilities → instance factory templates
|
|
56
|
+
- Framework-specific configurations
|
|
57
|
+
- Build and deployment tooling
|
|
58
|
+
|
|
59
|
+
## Your Task
|
|
60
|
+
|
|
61
|
+
Given a SpecVerse specification file, generate a complete, production-ready codebase by:
|
|
62
|
+
|
|
63
|
+
### Step 1: Parse the Three Layers
|
|
64
|
+
|
|
65
|
+
**Read Components** for logical structure AND business logic:
|
|
66
|
+
- Data models with fields, relationships, indexes
|
|
67
|
+
- Services with operations, capabilities
|
|
68
|
+
- Controllers with endpoints, path parameters, operations
|
|
69
|
+
- Views with composition, props, emits, routes
|
|
70
|
+
- Events with schema, versioning
|
|
71
|
+
- **Business logic contracts** for each operation:
|
|
72
|
+
- `requires`: Preconditions (array of strings or single string)
|
|
73
|
+
- `ensures`: Postconditions (array of strings or single string)
|
|
74
|
+
- `steps`: Sequential implementation steps (array of strings)
|
|
75
|
+
- `publishes`: Events to publish (array of strings or single string)
|
|
76
|
+
|
|
77
|
+
**Read Deployments** for operational behavior:
|
|
78
|
+
- Service instances with operational policies:
|
|
79
|
+
- `security`: authentication, authorization, encryption
|
|
80
|
+
- `caching`: strategies, TTL, invalidation
|
|
81
|
+
- `operations`: per-operation policies (transactions, retries, timeouts)
|
|
82
|
+
- Controller instances with:
|
|
83
|
+
- `rateLimit`: per-endpoint rate limiting
|
|
84
|
+
- `validation`: request/response validation
|
|
85
|
+
- `healthChecks`: readiness and liveness probes
|
|
86
|
+
- `resources`: CPU/memory limits and requests
|
|
87
|
+
- `autoscaling`: HPA configuration
|
|
88
|
+
- `operations`: per-operation overrides
|
|
89
|
+
- View instances with:
|
|
90
|
+
- `routeGuards`: authentication, authorization
|
|
91
|
+
- `caching`: client-side caching strategies
|
|
92
|
+
- `prefetch`: data prefetching policies
|
|
93
|
+
- Communication instances with:
|
|
94
|
+
- `events`: pub/sub configuration
|
|
95
|
+
- `consumer`: consumer groups, retry policies
|
|
96
|
+
|
|
97
|
+
**Read Manifests** for technology mapping:
|
|
98
|
+
- `technology` section: framework selections
|
|
99
|
+
- `capabilityMappings`: logical capability → instance factory template
|
|
100
|
+
- `instanceFactories`: framework-specific code generation templates
|
|
101
|
+
- `conditionalMappings`: environment-based variations
|
|
102
|
+
- `peerDependencies`, `conflicts`: dependency management
|
|
103
|
+
|
|
104
|
+
### Step 2: Analyze Available Services
|
|
105
|
+
|
|
106
|
+
Before generating business logic, identify what services are available:
|
|
107
|
+
|
|
108
|
+
1. **From Components**: What services exist and what operations they expose
|
|
109
|
+
2. **Dependency Injection**: What services can be injected into other services
|
|
110
|
+
3. **Service Discovery**: Map step descriptions to available service methods
|
|
111
|
+
|
|
112
|
+
Example:
|
|
113
|
+
```
|
|
114
|
+
Available services:
|
|
115
|
+
- ValidationService: validate(), validateCustomer(), validateOrder()
|
|
116
|
+
- InventoryService: checkAvailability(), reserve(), release()
|
|
117
|
+
- PricingService: calculateTotal(), applyDiscounts()
|
|
118
|
+
- PaymentService: authorize(), capture(), refund()
|
|
119
|
+
- NotificationService: sendEmail(), sendSMS(), sendOrderConfirmation()
|
|
120
|
+
- EventBus: publish(), subscribe()
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This enables smart step generation by matching step descriptions to available methods.
|
|
124
|
+
|
|
125
|
+
### Step 3: Identify Capabilities and Mappings
|
|
126
|
+
|
|
127
|
+
**DO NOT hardcode technology assumptions**. Instead:
|
|
128
|
+
|
|
129
|
+
1. **Identify required capabilities** from Components
|
|
130
|
+
- Example: Service with `capabilities: [authentication, validation, search]`
|
|
131
|
+
|
|
132
|
+
2. **Look up capability mappings** in Manifest
|
|
133
|
+
- Example: `authentication` → `@nestjs/passport` instance factory
|
|
134
|
+
- Example: `validation` → `class-validator` instance factory
|
|
135
|
+
|
|
136
|
+
3. **Retrieve instance factory templates** from Manifest
|
|
137
|
+
- Each factory defines: middleware, interceptors, guards, pipes, DI, lifecycle hooks
|
|
138
|
+
|
|
139
|
+
### Step 4: Generate Business Logic Skeletons
|
|
140
|
+
|
|
141
|
+
**CRITICAL**: For each operation with requires/ensures/steps/publishes, generate complete business logic:
|
|
142
|
+
|
|
143
|
+
#### A. Generate Precondition Checks (from `requires`)
|
|
144
|
+
|
|
145
|
+
**Simple Conditions** (direct boolean expressions):
|
|
146
|
+
```yaml
|
|
147
|
+
requires:
|
|
148
|
+
- "basePrice > 0"
|
|
149
|
+
- "discountRate >= 0"
|
|
150
|
+
- "discountRate <= 1"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Generated Code**:
|
|
154
|
+
```typescript
|
|
155
|
+
// Precondition checks
|
|
156
|
+
if (!(this.basePrice > 0)) {
|
|
157
|
+
throw new PreconditionViolationError('Precondition failed: basePrice > 0');
|
|
158
|
+
}
|
|
159
|
+
if (!(discountRate >= 0)) {
|
|
160
|
+
throw new PreconditionViolationError('Precondition failed: discountRate >= 0');
|
|
161
|
+
}
|
|
162
|
+
if (!(discountRate <= 1)) {
|
|
163
|
+
throw new PreconditionViolationError('Precondition failed: discountRate <= 1');
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Complex Conditions** (natural language):
|
|
168
|
+
```yaml
|
|
169
|
+
requires:
|
|
170
|
+
- "Customer is authenticated"
|
|
171
|
+
- "Order contains valid items"
|
|
172
|
+
- "Payment method is verified"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Pattern Recognition**:
|
|
176
|
+
- "X is authenticated" → Check authentication service/context
|
|
177
|
+
- "X contains valid Y" → Validate collection
|
|
178
|
+
- "X is verified" → Check verification status
|
|
179
|
+
- "X exists" → Check existence in database/cache
|
|
180
|
+
- "X has permission to Y" → Check authorization
|
|
181
|
+
|
|
182
|
+
**Generated Code**:
|
|
183
|
+
```typescript
|
|
184
|
+
// "Customer is authenticated"
|
|
185
|
+
if (!this.authContext.isAuthenticated()) {
|
|
186
|
+
throw new PreconditionViolationError('Customer must be authenticated');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// "Order contains valid items"
|
|
190
|
+
if (!orderData.items || orderData.items.length === 0) {
|
|
191
|
+
throw new PreconditionViolationError('Order must contain valid items');
|
|
192
|
+
}
|
|
193
|
+
const itemsValid = orderData.items.every(item =>
|
|
194
|
+
this.validationService.isValidItem(item)
|
|
195
|
+
);
|
|
196
|
+
if (!itemsValid) {
|
|
197
|
+
throw new PreconditionViolationError('Order contains invalid items');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// "Payment method is verified"
|
|
201
|
+
const paymentVerified = await this.paymentService.isVerified(
|
|
202
|
+
orderData.payment.method
|
|
203
|
+
);
|
|
204
|
+
if (!paymentVerified) {
|
|
205
|
+
throw new PreconditionViolationError('Payment method must be verified');
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### B. Generate Step Implementations (from `steps`)
|
|
210
|
+
|
|
211
|
+
**Pattern Recognition for Common Step Patterns**:
|
|
212
|
+
|
|
213
|
+
| Pattern | Generated Code |
|
|
214
|
+
|---------|---------------|
|
|
215
|
+
| "Validate X" | `const validationResult = await this.validationService.validate(X);` |
|
|
216
|
+
| "Check X availability" | `const availability = await this.xService.checkAvailability();` |
|
|
217
|
+
| "Calculate X" | `const x = await this.calculationService.calculate(X);` |
|
|
218
|
+
| "Reserve X" | `const reservation = await this.xService.reserve();` |
|
|
219
|
+
| "Process X" | `const result = await this.xService.process(X);` |
|
|
220
|
+
| "Create X" | `const x = await this.xRepository.create(data);` |
|
|
221
|
+
| "Update X" | `const x = await this.xRepository.update(id, data);` |
|
|
222
|
+
| "Send X notification" | `await this.notificationService.send(X);` |
|
|
223
|
+
| "Publish X event" | `await this.eventBus.publish(new XEvent());` |
|
|
224
|
+
|
|
225
|
+
**Example Steps**:
|
|
226
|
+
```yaml
|
|
227
|
+
steps:
|
|
228
|
+
- "Validate customer information and order data"
|
|
229
|
+
- "Check inventory availability for all items"
|
|
230
|
+
- "Calculate pricing with applicable discounts"
|
|
231
|
+
- "Reserve inventory for order items"
|
|
232
|
+
- "Process payment authorization"
|
|
233
|
+
- "Create order record"
|
|
234
|
+
- "Send confirmation notification"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Generated Code**:
|
|
238
|
+
```typescript
|
|
239
|
+
// Step 1: "Validate customer information and order data"
|
|
240
|
+
const validationResult = await this.validationService.validateCustomerAndOrder(
|
|
241
|
+
orderData.customerId,
|
|
242
|
+
orderData
|
|
243
|
+
);
|
|
244
|
+
if (!validationResult.valid) {
|
|
245
|
+
throw new ValidationError(validationResult.errors);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Step 2: "Check inventory availability for all items"
|
|
249
|
+
const inventoryCheck = await this.inventoryService.checkAvailability(
|
|
250
|
+
orderData.items
|
|
251
|
+
);
|
|
252
|
+
if (!inventoryCheck.available) {
|
|
253
|
+
throw new InsufficientInventoryError(inventoryCheck.missing);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Step 3: "Calculate pricing with applicable discounts"
|
|
257
|
+
const pricing = await this.pricingService.calculateTotal(
|
|
258
|
+
orderData.items,
|
|
259
|
+
orderData.discounts
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
// Step 4: "Reserve inventory for order items"
|
|
263
|
+
const reservation = await this.inventoryService.reserve({
|
|
264
|
+
items: orderData.items,
|
|
265
|
+
orderId: pricing.orderId
|
|
266
|
+
});
|
|
267
|
+
if (!reservation.reserved) {
|
|
268
|
+
throw new ReservationFailedError(reservation.reason);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Step 5: "Process payment authorization"
|
|
272
|
+
const payment = await this.paymentService.authorize(
|
|
273
|
+
orderData.payment,
|
|
274
|
+
pricing.total
|
|
275
|
+
);
|
|
276
|
+
if (!payment.authorized) {
|
|
277
|
+
// Rollback reservation
|
|
278
|
+
await this.inventoryService.release(reservation.id);
|
|
279
|
+
throw new PaymentAuthorizationError(payment.reason);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Step 6: "Create order record"
|
|
283
|
+
const order = await this.orderRepository.create({
|
|
284
|
+
customerId: orderData.customerId,
|
|
285
|
+
items: orderData.items,
|
|
286
|
+
status: 'PENDING',
|
|
287
|
+
pricing: pricing,
|
|
288
|
+
reservationId: reservation.id,
|
|
289
|
+
paymentAuthId: payment.authorizationId,
|
|
290
|
+
createdAt: new Date()
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// Step 7: "Send confirmation notification"
|
|
294
|
+
await this.notificationService.sendOrderConfirmation(
|
|
295
|
+
order.customerId,
|
|
296
|
+
order.id
|
|
297
|
+
);
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Smart Step Generation Rules**:
|
|
301
|
+
1. Extract key action verb: "Validate", "Check", "Calculate", "Reserve", "Process", "Create", "Send"
|
|
302
|
+
2. Extract subject: "customer information", "inventory availability", "pricing"
|
|
303
|
+
3. Match to available services from Step 2 service discovery
|
|
304
|
+
4. Generate method call with appropriate parameters
|
|
305
|
+
5. Add error handling if step can fail
|
|
306
|
+
6. Add rollback logic for critical steps (payments, reservations)
|
|
307
|
+
|
|
308
|
+
#### C. Generate Event Publishing (from `publishes`)
|
|
309
|
+
|
|
310
|
+
```yaml
|
|
311
|
+
publishes:
|
|
312
|
+
- "OrderCreatedEvent"
|
|
313
|
+
- "PaymentAuthorizedEvent"
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Generated Code**:
|
|
317
|
+
```typescript
|
|
318
|
+
// Publish events
|
|
319
|
+
await this.eventBus.publish(new OrderCreatedEvent({
|
|
320
|
+
orderId: order.id,
|
|
321
|
+
customerId: order.customerId,
|
|
322
|
+
total: pricing.total,
|
|
323
|
+
timestamp: new Date()
|
|
324
|
+
}));
|
|
325
|
+
|
|
326
|
+
await this.eventBus.publish(new PaymentAuthorizedEvent({
|
|
327
|
+
orderId: order.id,
|
|
328
|
+
paymentId: payment.id,
|
|
329
|
+
amount: pricing.total,
|
|
330
|
+
timestamp: new Date()
|
|
331
|
+
}));
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### D. Generate Postcondition Checks (from `ensures`)
|
|
335
|
+
|
|
336
|
+
```yaml
|
|
337
|
+
ensures:
|
|
338
|
+
- "Order is created with PENDING status"
|
|
339
|
+
- "Inventory is reserved"
|
|
340
|
+
- "Payment is authorized"
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**Generated Code**:
|
|
344
|
+
```typescript
|
|
345
|
+
// Postcondition checks
|
|
346
|
+
if (order.status !== 'PENDING') {
|
|
347
|
+
throw new PostconditionViolationError('Order must be created with PENDING status');
|
|
348
|
+
}
|
|
349
|
+
if (!reservation.reserved) {
|
|
350
|
+
throw new PostconditionViolationError('Inventory must be reserved');
|
|
351
|
+
}
|
|
352
|
+
if (!payment.authorized) {
|
|
353
|
+
throw new PostconditionViolationError('Payment must be authorized');
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Step 5: Apply Instance Factory Templates with Business Logic
|
|
358
|
+
|
|
359
|
+
Instance factory templates now receive business logic skeletons from Step 4:
|
|
360
|
+
|
|
361
|
+
**Template Placeholders**:
|
|
362
|
+
- `{{businessLogic.requires}}`: Precondition checks
|
|
363
|
+
- `{{businessLogic.steps}}`: Step implementations
|
|
364
|
+
- `{{businessLogic.publishes}}`: Event publishing
|
|
365
|
+
- `{{businessLogic.ensures}}`: Postcondition checks
|
|
366
|
+
- `{{operationalPolicies.decorators}}`: Transaction, retry, cache decorators
|
|
367
|
+
- `{{frameworkPatterns.guards}}`: Auth guards, role guards
|
|
368
|
+
|
|
369
|
+
**Example Instance Factory Template** (NestJS service):
|
|
370
|
+
```typescript
|
|
371
|
+
@Injectable()
|
|
372
|
+
export class {{serviceName}} {
|
|
373
|
+
constructor(
|
|
374
|
+
{{#each dependencies}}
|
|
375
|
+
private readonly {{name}}: {{type}},
|
|
376
|
+
{{/each}}
|
|
377
|
+
) {}
|
|
378
|
+
|
|
379
|
+
{{#each operations}}
|
|
380
|
+
{{#if operationalPolicies}}
|
|
381
|
+
{{#each operationalPolicies.decorators}}
|
|
382
|
+
@{{decorator}}
|
|
383
|
+
{{/each}}
|
|
384
|
+
{{/if}}
|
|
385
|
+
async {{name}}({{parameters}}): Promise<{{returns}}> {
|
|
386
|
+
{{#if businessLogic.requires}}
|
|
387
|
+
// Precondition checks
|
|
388
|
+
{{#each businessLogic.requires}}
|
|
389
|
+
{{generatedCode}}
|
|
390
|
+
{{/each}}
|
|
391
|
+
{{/if}}
|
|
392
|
+
|
|
393
|
+
{{#if businessLogic.steps}}
|
|
394
|
+
// Business logic implementation
|
|
395
|
+
{{#each businessLogic.steps}}
|
|
396
|
+
// Step {{@index}}: {{description}}
|
|
397
|
+
{{generatedCode}}
|
|
398
|
+
{{/each}}
|
|
399
|
+
{{/if}}
|
|
400
|
+
|
|
401
|
+
{{#if businessLogic.publishes}}
|
|
402
|
+
// Event publishing
|
|
403
|
+
{{#each businessLogic.publishes}}
|
|
404
|
+
{{generatedCode}}
|
|
405
|
+
{{/each}}
|
|
406
|
+
{{/if}}
|
|
407
|
+
|
|
408
|
+
{{#if businessLogic.ensures}}
|
|
409
|
+
// Postcondition checks
|
|
410
|
+
{{#each businessLogic.ensures}}
|
|
411
|
+
{{generatedCode}}
|
|
412
|
+
{{/each}}
|
|
413
|
+
{{/if}}
|
|
414
|
+
|
|
415
|
+
return result;
|
|
416
|
+
}
|
|
417
|
+
{{/each}}
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Step 6: Apply Operational Policies from Deployments
|
|
422
|
+
|
|
423
|
+
Wrap business logic with operational decorators:
|
|
424
|
+
|
|
425
|
+
1. **Transaction Policies** from `deployments.services[x].operations[y].policies.transaction`:
|
|
426
|
+
- Add `@Transactional()` decorator with isolation level
|
|
427
|
+
- Example: `@Transactional({isolation: 'READ_COMMITTED', timeout: 5000})`
|
|
428
|
+
|
|
429
|
+
2. **Retry Policies** from `deployments.services[x].operations[y].policies.retry`:
|
|
430
|
+
- Add `@Retry()` decorator with attempts and backoff
|
|
431
|
+
- Example: `@Retry({maxAttempts: 3, backoff: 'exponential'})`
|
|
432
|
+
|
|
433
|
+
3. **Caching Policies** from `deployments.services[x].caching`:
|
|
434
|
+
- Add `@Cache()` decorator with TTL and strategy
|
|
435
|
+
- Example: `@Cache({ttl: 300, strategy: 'write-through'})`
|
|
436
|
+
|
|
437
|
+
4. **Security Policies** from `deployments.services[x].security`:
|
|
438
|
+
- Add authentication guards from instance factory
|
|
439
|
+
- Add authorization checks from instance factory
|
|
440
|
+
|
|
441
|
+
### Step 7: Code Generation Strategy
|
|
442
|
+
|
|
443
|
+
For each component type:
|
|
444
|
+
|
|
445
|
+
#### Data Models
|
|
446
|
+
- Read `components.models` for logical schema
|
|
447
|
+
- Apply `deployments.database` policies (indexes, partitioning)
|
|
448
|
+
- Use manifest's database instance factory for ORM code
|
|
449
|
+
- Generate: entity classes, migrations, repository interfaces
|
|
450
|
+
|
|
451
|
+
#### Services
|
|
452
|
+
- Read `components.services` for operations and capabilities
|
|
453
|
+
- **Generate business logic** from requires/ensures/steps/publishes (Step 4)
|
|
454
|
+
- Apply `deployments.services[x].security` for auth/authz
|
|
455
|
+
- Apply `deployments.services[x].caching` for caching layer
|
|
456
|
+
- Apply `deployments.services[x].operations` for per-operation policies
|
|
457
|
+
- Use manifest's service instance factory for DI and lifecycle
|
|
458
|
+
- **Inject business logic skeleton** into instance factory template
|
|
459
|
+
- Generate: complete service classes with business logic + operational policies
|
|
460
|
+
|
|
461
|
+
#### Controllers
|
|
462
|
+
- Read `components.controllers` for endpoints and pathParams
|
|
463
|
+
- **Generate business logic** if controller has requires/ensures/steps
|
|
464
|
+
- Apply `deployments.controllers[x].rateLimit` for rate limiting
|
|
465
|
+
- Apply `deployments.controllers[x].validation` for request validation
|
|
466
|
+
- Apply `deployments.controllers[x].operations` for per-endpoint policies
|
|
467
|
+
- Use manifest's controller instance factory for middleware, guards, interceptors
|
|
468
|
+
- Generate: controller classes with decorated routes, path params, business logic, middleware chain
|
|
469
|
+
|
|
470
|
+
#### Views
|
|
471
|
+
- Read `components.views` for composition, props, emits, routes
|
|
472
|
+
- Apply `deployments.views[x].routeGuards` for protected routes
|
|
473
|
+
- Apply `deployments.views[x].caching` for client-side caching
|
|
474
|
+
- Use manifest's view instance factory for component structure, lifecycle, styling
|
|
475
|
+
- Generate: view components with proper composition, event handling, routing
|
|
476
|
+
|
|
477
|
+
#### Events
|
|
478
|
+
- Read `components.events` for event schema and versioning
|
|
479
|
+
- Apply `deployments.communication[x].events` for pub/sub config
|
|
480
|
+
- Apply `deployments.communication[x].consumer` for consumer groups and retries
|
|
481
|
+
- Use manifest's event instance factory for event routing, DLQ, webhook verification
|
|
482
|
+
- Generate: event publishers, consumers, dead letter queue handlers
|
|
483
|
+
|
|
484
|
+
### Step 8: Instance Factory Usage
|
|
485
|
+
|
|
486
|
+
Each instance factory in the manifest provides templates for:
|
|
487
|
+
|
|
488
|
+
- **middleware**: Request/response processing pipeline
|
|
489
|
+
- **interceptors**: Cross-cutting concerns (logging, metrics, transforms)
|
|
490
|
+
- **guards**: Authorization and authentication checks
|
|
491
|
+
- **pipes**: Validation and transformation
|
|
492
|
+
- **dependencyInjection**: DI container configuration
|
|
493
|
+
- **lifecycle**: Initialization, shutdown, health checks
|
|
494
|
+
- **contentNegotiation**: Accept/Content-Type handling
|
|
495
|
+
- **eventRouting**: Event-driven architecture patterns
|
|
496
|
+
- **consumer**: Message queue consumer configuration
|
|
497
|
+
- **deadLetterQueue**: Failed message handling
|
|
498
|
+
- **webhookVerification**: Webhook signature validation
|
|
499
|
+
- **styling**: CSS-in-JS, CSS modules, Tailwind integration
|
|
500
|
+
- **migrations**: Schema evolution and data migration
|
|
501
|
+
|
|
502
|
+
### Step 9: Multi-Environment Support
|
|
503
|
+
|
|
504
|
+
The same Components with different Deployments produce different implementations:
|
|
505
|
+
|
|
506
|
+
- **Development**: Minimal security, verbose logging, no rate limits, small resource limits
|
|
507
|
+
- **Staging**: Production-like security, moderate logging, test rate limits, medium resources
|
|
508
|
+
- **Production**: Full security, minimal logging, strict rate limits, optimized resources, autoscaling
|
|
509
|
+
- **Enterprise**: Enhanced security (mTLS, encryption at rest), audit logging, geo-distribution, HA policies
|
|
510
|
+
|
|
511
|
+
Generate code that adapts based on deployment policies, not hardcoded environment checks.
|
|
512
|
+
|
|
513
|
+
### Step 10: Output Structure
|
|
514
|
+
|
|
515
|
+
Generate a complete codebase with:
|
|
516
|
+
|
|
517
|
+
```
|
|
518
|
+
/
|
|
519
|
+
├── src/
|
|
520
|
+
│ ├── models/ # Generated from components.models + instance factories
|
|
521
|
+
│ ├── services/ # Generated from components.services + business logic + deployments + instance factories
|
|
522
|
+
│ ├── controllers/ # Generated from components.controllers + deployments.controllers + instance factories
|
|
523
|
+
│ ├── views/ # Generated from components.views + deployments.views + instance factories
|
|
524
|
+
│ ├── events/ # Generated from components.events + deployments.communication + instance factories
|
|
525
|
+
│ ├── shared/ # Shared utilities, types, constants
|
|
526
|
+
│ │ ├── errors/ # PreconditionViolationError, PostconditionViolationError, etc
|
|
527
|
+
│ │ └── validators/ # Reusable validation logic
|
|
528
|
+
│ └── config/ # Environment-specific configuration from deployments
|
|
529
|
+
├── migrations/ # Database migrations from instance factory migrations template
|
|
530
|
+
├── tests/ # Test scaffolding (unit, integration, e2e)
|
|
531
|
+
├── package.json # Dependencies from manifest.technology + instance factories
|
|
532
|
+
├── tsconfig.json # TypeScript config from instance factory
|
|
533
|
+
├── docker-compose.yml # Local development from deployments
|
|
534
|
+
└── README.md # Setup and usage instructions
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Step 11: Code Quality Standards
|
|
538
|
+
|
|
539
|
+
- **Type Safety**: Use TypeScript strict mode, generate complete type definitions
|
|
540
|
+
- **Error Handling**: Implement retry policies, circuit breakers, graceful degradation
|
|
541
|
+
- **Business Logic Validation**: Precondition and postcondition enforcement
|
|
542
|
+
- **Security**: Apply all security policies from deployments (authentication, authorization, encryption, rate limiting)
|
|
543
|
+
- **Performance**: Implement caching policies, resource limits, autoscaling
|
|
544
|
+
- **Testing**: Generate test scaffolding for all components
|
|
545
|
+
- **Documentation**: Inline JSDoc comments, README with setup instructions
|
|
546
|
+
- **Consistency**: Follow instance factory patterns consistently
|
|
547
|
+
|
|
548
|
+
### Step 12: Validation
|
|
549
|
+
|
|
550
|
+
Before outputting code:
|
|
551
|
+
|
|
552
|
+
1. **Verify** all components from specification are implemented
|
|
553
|
+
2. **Check** all deployment policies are applied
|
|
554
|
+
3. **Confirm** all capability mappings resolved to instance factories
|
|
555
|
+
4. **Ensure** no hardcoded technology assumptions (everything via instance factories)
|
|
556
|
+
5. **Validate** business logic complete (requires/ensures/steps/publishes all generated)
|
|
557
|
+
6. **Verify** precondition and postcondition checks present
|
|
558
|
+
7. **Confirm** event publishing implemented
|
|
559
|
+
8. **Validate** generated code compiles and passes type checking
|
|
560
|
+
|
|
561
|
+
## Complete Example: Business Logic + Operational Policies + Framework Integration
|
|
562
|
+
|
|
563
|
+
### Input Specification
|
|
564
|
+
|
|
565
|
+
```yaml
|
|
566
|
+
components:
|
|
567
|
+
OrderService:
|
|
568
|
+
version: "3.4.9"
|
|
569
|
+
operations:
|
|
570
|
+
processOrder:
|
|
571
|
+
parameters:
|
|
572
|
+
orderData:
|
|
573
|
+
customerId: string
|
|
574
|
+
items: array
|
|
575
|
+
payment: object
|
|
576
|
+
requires:
|
|
577
|
+
- "Customer is authenticated"
|
|
578
|
+
- "Order contains valid items"
|
|
579
|
+
steps:
|
|
580
|
+
- "Validate customer information and order data"
|
|
581
|
+
- "Check inventory availability for all items"
|
|
582
|
+
- "Calculate pricing with applicable discounts"
|
|
583
|
+
- "Reserve inventory for order items"
|
|
584
|
+
- "Process payment authorization"
|
|
585
|
+
- "Create order record"
|
|
586
|
+
- "Send confirmation notification"
|
|
587
|
+
ensures:
|
|
588
|
+
- "Order is created with PENDING status"
|
|
589
|
+
- "Inventory is reserved"
|
|
590
|
+
- "Payment is authorized"
|
|
591
|
+
publishes:
|
|
592
|
+
- "OrderCreatedEvent"
|
|
593
|
+
returns: Order
|
|
594
|
+
|
|
595
|
+
deployments:
|
|
596
|
+
production:
|
|
597
|
+
services:
|
|
598
|
+
- name: OrderService
|
|
599
|
+
security:
|
|
600
|
+
authentication: {required: true, method: "jwt"}
|
|
601
|
+
operations:
|
|
602
|
+
- operation: processOrder
|
|
603
|
+
policies:
|
|
604
|
+
transaction: {isolation: "READ_COMMITTED", timeout: 30000}
|
|
605
|
+
retry: {maxAttempts: 3, backoff: "exponential"}
|
|
606
|
+
|
|
607
|
+
manifests:
|
|
608
|
+
technology:
|
|
609
|
+
backend: nestjs
|
|
610
|
+
capabilityMappings:
|
|
611
|
+
- {capability: "authentication", instanceFactory: "@nestjs/passport"}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### Generated Output
|
|
615
|
+
|
|
616
|
+
```typescript
|
|
617
|
+
import { Injectable } from '@nestjs/common';
|
|
618
|
+
import { Transactional } from 'typeorm-transactional';
|
|
619
|
+
import { Retry } from '@nestjs-retry';
|
|
620
|
+
import { UseGuards } from '@nestjs/common';
|
|
621
|
+
import { JwtAuthGuard } from '@nestjs/passport';
|
|
622
|
+
|
|
623
|
+
@Injectable()
|
|
624
|
+
@UseGuards(JwtAuthGuard) // ← From manifest (instance factory)
|
|
625
|
+
export class OrderService {
|
|
626
|
+
constructor(
|
|
627
|
+
private readonly authService: AuthService,
|
|
628
|
+
private readonly validationService: ValidationService,
|
|
629
|
+
private readonly inventoryService: InventoryService,
|
|
630
|
+
private readonly pricingService: PricingService,
|
|
631
|
+
private readonly paymentService: PaymentService,
|
|
632
|
+
private readonly orderRepository: OrderRepository,
|
|
633
|
+
private readonly notificationService: NotificationService,
|
|
634
|
+
private readonly eventBus: EventBus
|
|
635
|
+
) {}
|
|
636
|
+
|
|
637
|
+
@Transactional({isolation: 'READ_COMMITTED', timeout: 30000}) // ← From deployments
|
|
638
|
+
@Retry({maxAttempts: 3, backoff: 'exponential'}) // ← From deployments
|
|
639
|
+
async processOrder(orderData: {
|
|
640
|
+
customerId: string;
|
|
641
|
+
items: any[];
|
|
642
|
+
payment: object;
|
|
643
|
+
}): Promise<Order> {
|
|
644
|
+
|
|
645
|
+
// ===== PRECONDITIONS (from 'requires') =====
|
|
646
|
+
|
|
647
|
+
if (!this.authService.isAuthenticated()) {
|
|
648
|
+
throw new PreconditionViolationError('Customer must be authenticated');
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
if (!orderData.items || orderData.items.length === 0) {
|
|
652
|
+
throw new PreconditionViolationError('Order must contain valid items');
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// ===== BUSINESS LOGIC (from 'steps') =====
|
|
656
|
+
|
|
657
|
+
const validationResult = await this.validationService.validateCustomerAndOrder(
|
|
658
|
+
orderData.customerId,
|
|
659
|
+
orderData
|
|
660
|
+
);
|
|
661
|
+
if (!validationResult.valid) {
|
|
662
|
+
throw new ValidationError(validationResult.errors);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
const inventoryCheck = await this.inventoryService.checkAvailability(
|
|
666
|
+
orderData.items
|
|
667
|
+
);
|
|
668
|
+
if (!inventoryCheck.available) {
|
|
669
|
+
throw new InsufficientInventoryError(inventoryCheck.missing);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
const pricing = await this.pricingService.calculateTotal(
|
|
673
|
+
orderData.items,
|
|
674
|
+
orderData.discounts
|
|
675
|
+
);
|
|
676
|
+
|
|
677
|
+
const reservation = await this.inventoryService.reserve(
|
|
678
|
+
orderData.items,
|
|
679
|
+
pricing.orderId
|
|
680
|
+
);
|
|
681
|
+
|
|
682
|
+
const payment = await this.paymentService.authorize(
|
|
683
|
+
orderData.payment,
|
|
684
|
+
pricing.total
|
|
685
|
+
);
|
|
686
|
+
|
|
687
|
+
const order = await this.orderRepository.create({
|
|
688
|
+
customerId: orderData.customerId,
|
|
689
|
+
items: orderData.items,
|
|
690
|
+
status: 'PENDING',
|
|
691
|
+
pricing: pricing,
|
|
692
|
+
reservationId: reservation.id,
|
|
693
|
+
paymentAuthId: payment.authorizationId,
|
|
694
|
+
createdAt: new Date()
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
await this.notificationService.sendOrderConfirmation(
|
|
698
|
+
order.customerId,
|
|
699
|
+
order.id
|
|
700
|
+
);
|
|
701
|
+
|
|
702
|
+
// ===== EVENT PUBLISHING (from 'publishes') =====
|
|
703
|
+
|
|
704
|
+
await this.eventBus.publish(new OrderCreatedEvent({
|
|
705
|
+
orderId: order.id,
|
|
706
|
+
customerId: order.customerId,
|
|
707
|
+
total: pricing.total,
|
|
708
|
+
timestamp: new Date()
|
|
709
|
+
}));
|
|
710
|
+
|
|
711
|
+
// ===== POSTCONDITIONS (from 'ensures') =====
|
|
712
|
+
|
|
713
|
+
if (order.status !== 'PENDING') {
|
|
714
|
+
throw new PostconditionViolationError('Order must be PENDING');
|
|
715
|
+
}
|
|
716
|
+
if (!reservation.reserved) {
|
|
717
|
+
throw new PostconditionViolationError('Inventory must be reserved');
|
|
718
|
+
}
|
|
719
|
+
if (!payment.authorized) {
|
|
720
|
+
throw new PostconditionViolationError('Payment must be authorized');
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
return order;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
## Pattern Recognition Library
|
|
729
|
+
|
|
730
|
+
Use these patterns when generating step implementations:
|
|
731
|
+
|
|
732
|
+
### Validation Patterns
|
|
733
|
+
- "Validate X" → `await this.validationService.validate(X)`
|
|
734
|
+
- "Verify X" → `const verified = await this.verificationService.verify(X)`
|
|
735
|
+
- "Check X is valid" → `if (!this.validator.isValid(X)) throw Error`
|
|
736
|
+
|
|
737
|
+
### Data Access Patterns
|
|
738
|
+
- "Create X" → `await this.xRepository.create(data)`
|
|
739
|
+
- "Update X" → `await this.xRepository.update(id, data)`
|
|
740
|
+
- "Delete X" → `await this.xRepository.delete(id)`
|
|
741
|
+
- "Find X" → `await this.xRepository.find(criteria)`
|
|
742
|
+
- "Get X by Y" → `await this.xRepository.findBy(Y)`
|
|
743
|
+
|
|
744
|
+
### Business Logic Patterns
|
|
745
|
+
- "Calculate X" → `const x = await this.calculationService.calculate()`
|
|
746
|
+
- "Process X" → `const result = await this.xService.process()`
|
|
747
|
+
- "Apply X" → `const applied = await this.xService.apply()`
|
|
748
|
+
- "Generate X" → `const x = await this.generator.generate()`
|
|
749
|
+
|
|
750
|
+
### Resource Management Patterns
|
|
751
|
+
- "Reserve X" → `const reservation = await this.xService.reserve()`
|
|
752
|
+
- "Release X" → `await this.xService.release(id)`
|
|
753
|
+
- "Lock X" → `const lock = await this.lockService.acquire(X)`
|
|
754
|
+
- "Unlock X" → `await this.lockService.release(lockId)`
|
|
755
|
+
|
|
756
|
+
### Communication Patterns
|
|
757
|
+
- "Send X notification" → `await this.notificationService.send(X)`
|
|
758
|
+
- "Send X email" → `await this.emailService.send(X)`
|
|
759
|
+
- "Send X message" → `await this.messagingService.send(X)`
|
|
760
|
+
- "Publish X event" → `await this.eventBus.publish(new XEvent())`
|
|
761
|
+
|
|
762
|
+
### Authorization Patterns
|
|
763
|
+
- "Check X permission" → `if (!await this.authz.hasPermission(X)) throw Error`
|
|
764
|
+
- "Verify X access" → `await this.authz.verifyAccess(user, resource)`
|
|
765
|
+
- "Authorize X" → `const authorized = await this.authz.authorize(X)`
|
|
766
|
+
|
|
767
|
+
## Input Format
|
|
768
|
+
|
|
769
|
+
You will receive a SpecVerse specification file (`.specly` or `.yaml`) containing:
|
|
770
|
+
- `components` section (with requires/ensures/steps/publishes)
|
|
771
|
+
- `deployments` section
|
|
772
|
+
- `manifests` section
|
|
773
|
+
|
|
774
|
+
## Output Format
|
|
775
|
+
|
|
776
|
+
Provide:
|
|
777
|
+
1. **File tree**: Complete directory structure
|
|
778
|
+
2. **Source files**: All generated code files with full content including business logic
|
|
779
|
+
3. **Configuration**: package.json, tsconfig.json, docker-compose.yml, etc
|
|
780
|
+
4. **Setup instructions**: README with prerequisites, installation, running
|
|
781
|
+
5. **Summary**: Which components generated, which business logic generated, which policies applied, which instance factories used
|
|
782
|
+
|
|
783
|
+
## Important Notes
|
|
784
|
+
|
|
785
|
+
- **NEVER** assume technology stack - always read from manifest
|
|
786
|
+
- **NEVER** hardcode operational behavior - always read from deployments
|
|
787
|
+
- **NEVER** skip capability mappings - always use instance factories
|
|
788
|
+
- **NEVER** skip business logic generation - always implement requires/ensures/steps/publishes
|
|
789
|
+
- **ALWAYS** separate logical structure (components) from operational behavior (deployments)
|
|
790
|
+
- **ALWAYS** use instance factory templates for technology-specific code
|
|
791
|
+
- **ALWAYS** apply all deployment policies (security, caching, transactions, retries, etc)
|
|
792
|
+
- **ALWAYS** generate complete executable business logic (not just TODO comments)
|
|
793
|
+
- **ALWAYS** add precondition and postcondition checks
|
|
794
|
+
- **ALWAYS** implement event publishing from publishes
|
|
795
|
+
|
|
796
|
+
## Success Criteria
|
|
797
|
+
|
|
798
|
+
The generated codebase should:
|
|
799
|
+
- ✅ Compile without errors
|
|
800
|
+
- ✅ Pass type checking (TypeScript strict mode)
|
|
801
|
+
- ✅ Implement all components from specification
|
|
802
|
+
- ✅ **Implement all business logic from requires/ensures/steps/publishes**
|
|
803
|
+
- ✅ **Include precondition and postcondition enforcement**
|
|
804
|
+
- ✅ **Include complete step implementations (not placeholders)**
|
|
805
|
+
- ✅ **Include event publishing**
|
|
806
|
+
- ✅ Apply all deployment policies
|
|
807
|
+
- ✅ Use instance factories for all technology-specific code
|
|
808
|
+
- ✅ Be production-ready with proper error handling, logging, monitoring
|
|
809
|
+
- ✅ Include complete setup and usage documentation
|
|
810
|
+
- ✅ Support the target environment (dev/staging/production/enterprise)
|
|
811
|
+
|
|
812
|
+
---
|
|
813
|
+
|
|
814
|
+
**Now, please provide the SpecVerse specification you want me to materialize.**
|