@specverse/engine-realize 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/templates/README.md +559 -0
- package/assets/templates/TEMPLATE-ENHANCEMENTS-V33.md +462 -0
- package/assets/templates/backend-only/CLAUDE.md +73 -0
- package/assets/templates/backend-only/README.md +197 -0
- package/assets/templates/backend-only/deployments/README.md +149 -0
- package/assets/templates/backend-only/deployments/development.specly +53 -0
- package/assets/templates/backend-only/deployments/production.specly +87 -0
- package/assets/templates/backend-only/docs/README.md +50 -0
- package/assets/templates/backend-only/docs/api/README.md +7 -0
- package/assets/templates/backend-only/docs/diagrams/README.md +85 -0
- package/assets/templates/backend-only/docs/example-documentation-template.md +269 -0
- package/assets/templates/backend-only/docs/guides/README.md +15 -0
- package/assets/templates/backend-only/dot.env.example +18 -0
- package/assets/templates/backend-only/generated/README.md +56 -0
- package/assets/templates/backend-only/generated/code/integration-test.template.js +320 -0
- package/assets/templates/backend-only/generated/code/package.json.template +34 -0
- package/assets/templates/backend-only/generated/docs/README.md +49 -0
- package/assets/templates/backend-only/gitignore +54 -0
- package/assets/templates/backend-only/manifests/README.md +72 -0
- package/assets/templates/backend-only/manifests/docker-compose.specly +91 -0
- package/assets/templates/backend-only/manifests/implementation.yaml +100 -0
- package/assets/templates/backend-only/manifests/kubernetes.specly +140 -0
- package/assets/templates/backend-only/package.json +59 -0
- package/assets/templates/backend-only/scripts/test-all.sh +160 -0
- package/assets/templates/backend-only/scripts/test-generated-code.sh +165 -0
- package/assets/templates/backend-only/specs/main.specly +67 -0
- package/assets/templates/default/CLAUDE.md +141 -0
- package/assets/templates/default/README.md +404 -0
- package/assets/templates/default/deployments/README.md +149 -0
- package/assets/templates/default/deployments/development.specly +53 -0
- package/assets/templates/default/deployments/production.specly +87 -0
- package/assets/templates/default/docs/README.md +50 -0
- package/assets/templates/default/docs/api/README.md +7 -0
- package/assets/templates/default/docs/diagrams/README.md +85 -0
- package/assets/templates/default/docs/example-documentation-template.md +269 -0
- package/assets/templates/default/docs/guides/README.md +15 -0
- package/assets/templates/default/dot.env.example +18 -0
- package/assets/templates/default/generated/README.md +56 -0
- package/assets/templates/default/generated/code/integration-test.template.js +320 -0
- package/assets/templates/default/generated/code/package.json.template +34 -0
- package/assets/templates/default/generated/docs/README.md +49 -0
- package/assets/templates/default/gitignore +54 -0
- package/assets/templates/default/manifests/README.md +72 -0
- package/assets/templates/default/manifests/docker-compose.specly +91 -0
- package/assets/templates/default/manifests/implementation.yaml +176 -0
- package/assets/templates/default/manifests/kubernetes.specly +140 -0
- package/assets/templates/default/package.json +61 -0
- package/assets/templates/default/scripts/test-all.sh +160 -0
- package/assets/templates/default/scripts/test-generated-code.sh +165 -0
- package/assets/templates/default/specs/main.specly +67 -0
- package/assets/templates/frontend-only/CLAUDE.md +75 -0
- package/assets/templates/frontend-only/README.md +231 -0
- package/assets/templates/frontend-only/deployments/README.md +149 -0
- package/assets/templates/frontend-only/deployments/development.specly +53 -0
- package/assets/templates/frontend-only/deployments/production.specly +87 -0
- package/assets/templates/frontend-only/docs/README.md +50 -0
- package/assets/templates/frontend-only/docs/api/README.md +7 -0
- package/assets/templates/frontend-only/docs/diagrams/README.md +85 -0
- package/assets/templates/frontend-only/docs/example-documentation-template.md +269 -0
- package/assets/templates/frontend-only/docs/guides/README.md +15 -0
- package/assets/templates/frontend-only/dot.env.example +18 -0
- package/assets/templates/frontend-only/generated/README.md +56 -0
- package/assets/templates/frontend-only/generated/code/integration-test.template.js +320 -0
- package/assets/templates/frontend-only/generated/code/package.json.template +34 -0
- package/assets/templates/frontend-only/generated/docs/README.md +49 -0
- package/assets/templates/frontend-only/gitignore +54 -0
- package/assets/templates/frontend-only/manifests/README.md +72 -0
- package/assets/templates/frontend-only/manifests/docker-compose.specly +91 -0
- package/assets/templates/frontend-only/manifests/implementation.yaml +58 -0
- package/assets/templates/frontend-only/manifests/kubernetes.specly +140 -0
- package/assets/templates/frontend-only/package.json +59 -0
- package/assets/templates/frontend-only/scripts/test-all.sh +160 -0
- package/assets/templates/frontend-only/scripts/test-generated-code.sh +165 -0
- package/assets/templates/frontend-only/specs/main.specly +57 -0
- package/assets/templates/full-stack/AI-GUIDE.md +60 -0
- package/assets/templates/full-stack/CLAUDE.md +141 -0
- package/assets/templates/full-stack/README.md +382 -0
- package/assets/templates/full-stack/archive/AI-GUIDE-legacy.md +392 -0
- package/assets/templates/full-stack/deployments/README.md +149 -0
- package/assets/templates/full-stack/deployments/development.specly +53 -0
- package/assets/templates/full-stack/deployments/production.specly +87 -0
- package/assets/templates/full-stack/docs/README.md +51 -0
- package/assets/templates/full-stack/docs/api/README.md +7 -0
- package/assets/templates/full-stack/docs/diagrams/README.md +85 -0
- package/assets/templates/full-stack/docs/example-documentation-template.md +269 -0
- package/assets/templates/full-stack/docs/guides/README.md +15 -0
- package/assets/templates/full-stack/generated/README.md +56 -0
- package/assets/templates/full-stack/generated/code/integration-test.template.js +320 -0
- package/assets/templates/full-stack/generated/code/package.json.template +34 -0
- package/assets/templates/full-stack/generated/docs/README.md +49 -0
- package/assets/templates/full-stack/gitignore +54 -0
- package/assets/templates/full-stack/manifests/README.md +72 -0
- package/assets/templates/full-stack/manifests/docker-compose.specly +91 -0
- package/assets/templates/full-stack/manifests/implementation.yaml +155 -0
- package/assets/templates/full-stack/manifests/kubernetes.specly +140 -0
- package/assets/templates/full-stack/package.json +45 -0
- package/assets/templates/full-stack/scripts/test-all.sh +160 -0
- package/assets/templates/full-stack/scripts/test-generated-code.sh +165 -0
- package/assets/templates/full-stack/specs/example-v33.specly +297 -0
- package/assets/templates/full-stack/specs/main-simple.specly +73 -0
- package/assets/templates/full-stack/specs/main.specly +408 -0
- package/dist/engines/code-generator.d.ts +86 -0
- package/dist/engines/code-generator.d.ts.map +1 -0
- package/dist/engines/code-generator.js +159 -0
- package/dist/engines/code-generator.js.map +1 -0
- package/dist/engines/engine-registry.d.ts +94 -0
- package/dist/engines/engine-registry.d.ts.map +1 -0
- package/dist/engines/engine-registry.js +163 -0
- package/dist/engines/engine-registry.js.map +1 -0
- package/dist/engines/index.d.ts +10 -0
- package/dist/engines/index.d.ts.map +1 -0
- package/dist/engines/index.js +12 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/typescript-engine.d.ts +74 -0
- package/dist/engines/typescript-engine.d.ts.map +1 -0
- package/dist/engines/typescript-engine.js +288 -0
- package/dist/engines/typescript-engine.js.map +1 -0
- package/dist/generators/index.d.ts +11 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +11 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +434 -0
- package/dist/index.js.map +1 -0
- package/dist/library/index.d.ts +12 -0
- package/dist/library/index.d.ts.map +1 -0
- package/dist/library/index.js +15 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/library.d.ts +132 -0
- package/dist/library/library.d.ts.map +1 -0
- package/dist/library/library.js +343 -0
- package/dist/library/library.js.map +1 -0
- package/dist/library/loader.d.ts +73 -0
- package/dist/library/loader.d.ts.map +1 -0
- package/dist/library/loader.js +150 -0
- package/dist/library/loader.js.map +1 -0
- package/dist/library/resolver.d.ts +104 -0
- package/dist/library/resolver.d.ts.map +1 -0
- package/dist/library/resolver.js +299 -0
- package/dist/library/resolver.js.map +1 -0
- package/dist/library/validator.d.ts +65 -0
- package/dist/library/validator.d.ts.map +1 -0
- package/dist/library/validator.js +203 -0
- package/dist/library/validator.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/instance-factory.d.ts +289 -0
- package/dist/types/instance-factory.d.ts.map +1 -0
- package/dist/types/instance-factory.js +8 -0
- package/dist/types/instance-factory.js.map +1 -0
- package/dist/types/unified-mappings.d.ts +163 -0
- package/dist/types/unified-mappings.d.ts.map +1 -0
- package/dist/types/unified-mappings.js +110 -0
- package/dist/types/unified-mappings.js.map +1 -0
- package/dist/utils/ai-spec-loader.d.ts +77 -0
- package/dist/utils/ai-spec-loader.d.ts.map +1 -0
- package/dist/utils/ai-spec-loader.js +138 -0
- package/dist/utils/ai-spec-loader.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/manifest-loader.d.ts +107 -0
- package/dist/utils/manifest-loader.d.ts.map +1 -0
- package/dist/utils/manifest-loader.js +168 -0
- package/dist/utils/manifest-loader.js.map +1 -0
- package/dist/utils/mapping-migration.d.ts +53 -0
- package/dist/utils/mapping-migration.d.ts.map +1 -0
- package/dist/utils/mapping-migration.js +194 -0
- package/dist/utils/mapping-migration.js.map +1 -0
- package/libs/instance-factories/CURVED-INTERFACE.md +278 -0
- package/libs/instance-factories/README.md +433 -0
- package/libs/instance-factories/applications/generic-app.yaml +52 -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 +80 -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 +85 -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 +54 -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/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/commander-js.yaml +55 -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 +145 -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 +992 -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/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/docker-k8s.yaml +61 -0
- package/libs/instance-factories/infrastructure/templates/docker-k8s/infrastructure-generator.ts +46 -0
- package/libs/instance-factories/orms/prisma.yaml +89 -0
- package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +563 -0
- package/libs/instance-factories/orms/templates/prisma/services-generator.ts +408 -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/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/prisma-services.yaml +71 -0
- package/libs/instance-factories/services/templates/prisma/behavior-generator.ts +303 -0
- package/libs/instance-factories/services/templates/prisma/controller-generator.ts +532 -0
- package/libs/instance-factories/services/templates/prisma/service-generator.ts +315 -0
- package/libs/instance-factories/shared/path-resolver.ts +111 -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/templates/vitest/tests-generator.ts +51 -0
- package/libs/instance-factories/testing/vitest-tests.yaml +63 -0
- package/libs/instance-factories/tools/templates/mcp/mcp-server-generator.ts +136 -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 +92 -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 +524 -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 +214 -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/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 +391 -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 +54 -0
- package/libs/instance-factories/views/templates/react/hooks-generator.ts +122 -0
- package/libs/instance-factories/views/templates/react/index-css-generator.ts +209 -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 +103 -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 +42 -0
- package/schema/SPECVERSE-SCHEMA.json +4274 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Two-Level Mapping System (v3.6+)
|
|
3
|
+
*
|
|
4
|
+
* Simplifies factory mappings with a clear two-level system:
|
|
5
|
+
* - Level 1: defaults (sugar syntax for common cases)
|
|
6
|
+
* - Level 2: overrides (explicit with optional configuration)
|
|
7
|
+
*
|
|
8
|
+
* @module realize/types/unified-mappings
|
|
9
|
+
* @version 3.6.0
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Default Mappings (Level 1)
|
|
13
|
+
*
|
|
14
|
+
* Simple category → factory alias mappings.
|
|
15
|
+
* Uses sugar syntax for convenience.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```yaml
|
|
19
|
+
* defaults:
|
|
20
|
+
* orm: "prisma" # All storage.database → PrismaPostgres
|
|
21
|
+
* api: "fastify" # All api.rest → FastifyRoutes
|
|
22
|
+
* cache: "redis" # All storage.cache → RedisCache
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface DefaultMappingsV2 {
|
|
26
|
+
/** ORM/Database factory (maps to storage.database.*) */
|
|
27
|
+
orm?: string;
|
|
28
|
+
/** API framework factory (maps to api.rest.*) */
|
|
29
|
+
api?: string;
|
|
30
|
+
/** Cache factory (maps to storage.cache.*) */
|
|
31
|
+
cache?: string;
|
|
32
|
+
/** Queue/Message broker factory (maps to messaging.queue.*) */
|
|
33
|
+
queue?: string;
|
|
34
|
+
/** Authentication factory (maps to security.authentication.*) */
|
|
35
|
+
auth?: string;
|
|
36
|
+
/** Email service factory (maps to communication.email.*) */
|
|
37
|
+
email?: string;
|
|
38
|
+
/** File storage factory (maps to storage.files.*) */
|
|
39
|
+
storage?: string;
|
|
40
|
+
/** Search engine factory (maps to storage.search.*) */
|
|
41
|
+
search?: string;
|
|
42
|
+
/** Logging factory (maps to observability.logging.*) */
|
|
43
|
+
logging?: string;
|
|
44
|
+
/** Monitoring factory (maps to observability.monitoring.*) */
|
|
45
|
+
monitoring?: string;
|
|
46
|
+
/** Additional custom categories */
|
|
47
|
+
[category: string]: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Override Mapping (Level 2)
|
|
51
|
+
*
|
|
52
|
+
* Explicit mapping with optional instance-specific configuration.
|
|
53
|
+
* Can target either:
|
|
54
|
+
* - A capability pattern (e.g., "storage.database.postgres")
|
|
55
|
+
* - An instance name (e.g., "primary-db" from deployment)
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```yaml
|
|
59
|
+
* overrides:
|
|
60
|
+
* # Capability override
|
|
61
|
+
* - target: "storage.database.postgres"
|
|
62
|
+
* factory: "PrismaPostgres"
|
|
63
|
+
*
|
|
64
|
+
* # Instance override with config
|
|
65
|
+
* - target: "primary-db"
|
|
66
|
+
* factory: "PrismaPostgres"
|
|
67
|
+
* configuration:
|
|
68
|
+
* url: "${DATABASE_URL}"
|
|
69
|
+
* poolSize: 20
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export interface OverrideMapping {
|
|
73
|
+
/**
|
|
74
|
+
* Target to override
|
|
75
|
+
*
|
|
76
|
+
* Can be:
|
|
77
|
+
* - Capability pattern: "storage.database", "api.rest.crud"
|
|
78
|
+
* - Instance name: "primary-db", "cache-cluster"
|
|
79
|
+
*/
|
|
80
|
+
target: string;
|
|
81
|
+
/**
|
|
82
|
+
* Factory name to use
|
|
83
|
+
*
|
|
84
|
+
* Must match a factory declared in instanceFactories section.
|
|
85
|
+
*/
|
|
86
|
+
factory: string;
|
|
87
|
+
/**
|
|
88
|
+
* Instance-specific configuration (optional)
|
|
89
|
+
*
|
|
90
|
+
* Only applies when target is an instance name.
|
|
91
|
+
*/
|
|
92
|
+
configuration?: Record<string, any>;
|
|
93
|
+
/**
|
|
94
|
+
* Version constraint (optional)
|
|
95
|
+
*
|
|
96
|
+
* Overrides the version from instanceFactories declaration.
|
|
97
|
+
*/
|
|
98
|
+
version?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Namespace for grouping (optional)
|
|
101
|
+
*/
|
|
102
|
+
namespace?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Target type discrimination
|
|
106
|
+
*/
|
|
107
|
+
export type TargetType = 'capability' | 'instance';
|
|
108
|
+
/**
|
|
109
|
+
* Resolved override with type information
|
|
110
|
+
*/
|
|
111
|
+
export interface ResolvedOverride extends OverrideMapping {
|
|
112
|
+
/** Whether target is a capability or instance name */
|
|
113
|
+
targetType: TargetType;
|
|
114
|
+
/** Original target before resolution */
|
|
115
|
+
originalTarget: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Helper functions
|
|
119
|
+
*/
|
|
120
|
+
/**
|
|
121
|
+
* Determine if a target is a capability pattern
|
|
122
|
+
*
|
|
123
|
+
* Capability patterns contain dots (e.g., "storage.database")
|
|
124
|
+
* Instance names typically don't (e.g., "primary-db")
|
|
125
|
+
*
|
|
126
|
+
* @param target - Target string to check
|
|
127
|
+
* @returns True if target looks like a capability
|
|
128
|
+
*/
|
|
129
|
+
export declare function isCapabilityTarget(target: string): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Determine if a target is an instance name
|
|
132
|
+
*
|
|
133
|
+
* @param target - Target string to check
|
|
134
|
+
* @returns True if target looks like an instance name
|
|
135
|
+
*/
|
|
136
|
+
export declare function isInstanceTarget(target: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Resolve target type for an override
|
|
139
|
+
*
|
|
140
|
+
* @param override - Override mapping to analyze
|
|
141
|
+
* @returns Resolved override with type information
|
|
142
|
+
*/
|
|
143
|
+
export declare function resolveOverrideType(override: OverrideMapping): ResolvedOverride;
|
|
144
|
+
/**
|
|
145
|
+
* Expand defaults to capability mappings
|
|
146
|
+
*
|
|
147
|
+
* Converts sugar syntax to explicit capability patterns.
|
|
148
|
+
*
|
|
149
|
+
* @param defaults - Default mappings
|
|
150
|
+
* @returns Map of capability patterns to factory aliases
|
|
151
|
+
*/
|
|
152
|
+
export declare function expandDefaults(defaults: DefaultMappingsV2): Map<string, string>;
|
|
153
|
+
/**
|
|
154
|
+
* Validate override references
|
|
155
|
+
*
|
|
156
|
+
* Checks that overrides reference declared factories.
|
|
157
|
+
*
|
|
158
|
+
* @param overrides - Override mappings to validate
|
|
159
|
+
* @param declaredFactories - Set of declared factory names
|
|
160
|
+
* @returns Validation errors (empty if valid)
|
|
161
|
+
*/
|
|
162
|
+
export declare function validateOverrides(overrides: OverrideMapping[], declaredFactories: Set<string>): string[];
|
|
163
|
+
//# sourceMappingURL=unified-mappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified-mappings.d.ts","sourceRoot":"","sources":["../../src/types/unified-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mCAAmC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,sDAAsD;IACtD,UAAU,EAAE,UAAU,CAAC;IAEvB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,gBAAgB,CAU/E;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA4B/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,eAAe,EAAE,EAC5B,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC7B,MAAM,EAAE,CAqBV"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Two-Level Mapping System (v3.6+)
|
|
3
|
+
*
|
|
4
|
+
* Simplifies factory mappings with a clear two-level system:
|
|
5
|
+
* - Level 1: defaults (sugar syntax for common cases)
|
|
6
|
+
* - Level 2: overrides (explicit with optional configuration)
|
|
7
|
+
*
|
|
8
|
+
* @module realize/types/unified-mappings
|
|
9
|
+
* @version 3.6.0
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Helper functions
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Determine if a target is a capability pattern
|
|
16
|
+
*
|
|
17
|
+
* Capability patterns contain dots (e.g., "storage.database")
|
|
18
|
+
* Instance names typically don't (e.g., "primary-db")
|
|
19
|
+
*
|
|
20
|
+
* @param target - Target string to check
|
|
21
|
+
* @returns True if target looks like a capability
|
|
22
|
+
*/
|
|
23
|
+
export function isCapabilityTarget(target) {
|
|
24
|
+
// Capability patterns have dots and match capability naming convention
|
|
25
|
+
// storage.database, api.rest.crud, security.authentication
|
|
26
|
+
return /^[a-z]+\.[a-z]+(\.[a-z]+)*$/.test(target);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Determine if a target is an instance name
|
|
30
|
+
*
|
|
31
|
+
* @param target - Target string to check
|
|
32
|
+
* @returns True if target looks like an instance name
|
|
33
|
+
*/
|
|
34
|
+
export function isInstanceTarget(target) {
|
|
35
|
+
return !isCapabilityTarget(target);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Resolve target type for an override
|
|
39
|
+
*
|
|
40
|
+
* @param override - Override mapping to analyze
|
|
41
|
+
* @returns Resolved override with type information
|
|
42
|
+
*/
|
|
43
|
+
export function resolveOverrideType(override) {
|
|
44
|
+
const targetType = isCapabilityTarget(override.target)
|
|
45
|
+
? 'capability'
|
|
46
|
+
: 'instance';
|
|
47
|
+
return {
|
|
48
|
+
...override,
|
|
49
|
+
targetType,
|
|
50
|
+
originalTarget: override.target
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Expand defaults to capability mappings
|
|
55
|
+
*
|
|
56
|
+
* Converts sugar syntax to explicit capability patterns.
|
|
57
|
+
*
|
|
58
|
+
* @param defaults - Default mappings
|
|
59
|
+
* @returns Map of capability patterns to factory aliases
|
|
60
|
+
*/
|
|
61
|
+
export function expandDefaults(defaults) {
|
|
62
|
+
const expanded = new Map();
|
|
63
|
+
// Predefined category → capability mappings
|
|
64
|
+
const categoryMappings = {
|
|
65
|
+
orm: ['storage.database'],
|
|
66
|
+
api: ['api.rest', 'api.rest.crud'],
|
|
67
|
+
cache: ['storage.cache'],
|
|
68
|
+
queue: ['messaging.queue'],
|
|
69
|
+
auth: ['security.authentication', 'security.authorization'],
|
|
70
|
+
email: ['communication.email'],
|
|
71
|
+
storage: ['storage.files', 'storage.objects'],
|
|
72
|
+
search: ['storage.search'],
|
|
73
|
+
logging: ['observability.logging'],
|
|
74
|
+
monitoring: ['observability.monitoring', 'observability.metrics']
|
|
75
|
+
};
|
|
76
|
+
for (const [category, factoryAlias] of Object.entries(defaults)) {
|
|
77
|
+
if (!factoryAlias)
|
|
78
|
+
continue;
|
|
79
|
+
const capabilities = categoryMappings[category] || [category];
|
|
80
|
+
for (const capability of capabilities) {
|
|
81
|
+
expanded.set(capability, factoryAlias);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return expanded;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Validate override references
|
|
88
|
+
*
|
|
89
|
+
* Checks that overrides reference declared factories.
|
|
90
|
+
*
|
|
91
|
+
* @param overrides - Override mappings to validate
|
|
92
|
+
* @param declaredFactories - Set of declared factory names
|
|
93
|
+
* @returns Validation errors (empty if valid)
|
|
94
|
+
*/
|
|
95
|
+
export function validateOverrides(overrides, declaredFactories) {
|
|
96
|
+
const errors = [];
|
|
97
|
+
for (const override of overrides) {
|
|
98
|
+
if (!declaredFactories.has(override.factory)) {
|
|
99
|
+
errors.push(`Override references undeclared factory: "${override.factory}" for target "${override.target}". ` +
|
|
100
|
+
`Add it to instanceFactories section.`);
|
|
101
|
+
}
|
|
102
|
+
// Warn if configuration is used with capability target
|
|
103
|
+
if (override.configuration && isCapabilityTarget(override.target)) {
|
|
104
|
+
errors.push(`Override for capability "${override.target}" has configuration, but capabilities don't support instance config. ` +
|
|
105
|
+
`Use an instance name as target instead.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return errors;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=unified-mappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified-mappings.js","sourceRoot":"","sources":["../../src/types/unified-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA+HH;;GAEG;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,uEAAuE;IACvE,2DAA2D;IAC3D,OAAO,6BAA6B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAyB;IAC3D,MAAM,UAAU,GAAe,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC;QAChE,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,UAAU,CAAC;IAEf,OAAO;QACL,GAAG,QAAQ;QACX,UAAU;QACV,cAAc,EAAE,QAAQ,CAAC,MAAM;KAChC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,QAA2B;IACxD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE3C,4CAA4C;IAC5C,MAAM,gBAAgB,GAA6B;QACjD,GAAG,EAAE,CAAC,kBAAkB,CAAC;QACzB,GAAG,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC;QAClC,KAAK,EAAE,CAAC,eAAe,CAAC;QACxB,KAAK,EAAE,CAAC,iBAAiB,CAAC;QAC1B,IAAI,EAAE,CAAC,yBAAyB,EAAE,wBAAwB,CAAC;QAC3D,KAAK,EAAE,CAA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AAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI-Optimized Spec Loader Utility
|
|
3
|
+
*
|
|
4
|
+
* Loads SpecVerse YAML files and generates AIOptimizedSpec using:
|
|
5
|
+
* 1. UnifiedSpecVerseParser - Handles YAML parsing, imports, conventions
|
|
6
|
+
* 2. AIViewGenerator - Generates optimized spec with inference
|
|
7
|
+
*
|
|
8
|
+
* This utility eliminates duplicate parsing logic across all generators.
|
|
9
|
+
*/
|
|
10
|
+
export interface LoadOptions {
|
|
11
|
+
deployment?: string;
|
|
12
|
+
instance?: string;
|
|
13
|
+
manifest?: any;
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentMetadata {
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
deployment?: string;
|
|
21
|
+
instance?: string;
|
|
22
|
+
manifest?: any;
|
|
23
|
+
}
|
|
24
|
+
export interface AIOptimizedSpec {
|
|
25
|
+
metadata: {
|
|
26
|
+
component: string;
|
|
27
|
+
version: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
tags?: string[];
|
|
30
|
+
deployment?: string;
|
|
31
|
+
instance?: string;
|
|
32
|
+
manifest?: any;
|
|
33
|
+
};
|
|
34
|
+
models: any[];
|
|
35
|
+
controllers: any[];
|
|
36
|
+
services: any[];
|
|
37
|
+
events: any[];
|
|
38
|
+
views?: any[];
|
|
39
|
+
infrastructure?: any;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Load and generate AIOptimizedSpec from a SpecVerse YAML file
|
|
43
|
+
*/
|
|
44
|
+
export declare function loadAIOptimizedSpec(yamlFile: string, options?: LoadOptions): AIOptimizedSpec;
|
|
45
|
+
/**
|
|
46
|
+
* Load AIOptimizedSpec with deployment filtering
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadForDeployment(yamlFile: string, deploymentName: string, instanceName: string): AIOptimizedSpec;
|
|
49
|
+
/**
|
|
50
|
+
* Load AIOptimizedSpec with manifest configuration
|
|
51
|
+
*/
|
|
52
|
+
export declare function loadWithManifest(yamlFile: string, manifestConfig: any): AIOptimizedSpec;
|
|
53
|
+
/**
|
|
54
|
+
* Get component metadata from AIOptimizedSpec
|
|
55
|
+
*/
|
|
56
|
+
export declare function getComponentMetadata(spec: AIOptimizedSpec): ComponentMetadata;
|
|
57
|
+
/**
|
|
58
|
+
* Get all models from AIOptimizedSpec
|
|
59
|
+
*/
|
|
60
|
+
export declare function getModels(spec: AIOptimizedSpec): any[];
|
|
61
|
+
/**
|
|
62
|
+
* Get all controllers from AIOptimizedSpec
|
|
63
|
+
*/
|
|
64
|
+
export declare function getControllers(spec: AIOptimizedSpec): any[];
|
|
65
|
+
/**
|
|
66
|
+
* Get all services from AIOptimizedSpec
|
|
67
|
+
*/
|
|
68
|
+
export declare function getServices(spec: AIOptimizedSpec): any[];
|
|
69
|
+
/**
|
|
70
|
+
* Get all events from AIOptimizedSpec
|
|
71
|
+
*/
|
|
72
|
+
export declare function getEvents(spec: AIOptimizedSpec): any[];
|
|
73
|
+
/**
|
|
74
|
+
* Get infrastructure requirements from AIOptimizedSpec
|
|
75
|
+
*/
|
|
76
|
+
export declare function getInfrastructure(spec: AIOptimizedSpec): any;
|
|
77
|
+
//# sourceMappingURL=ai-spec-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-spec-loader.d.ts","sourceRoot":"","sources":["../../src/utils/ai-spec-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAqCH,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,M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I,EAAE,eAAe,GAAG,GAAG,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,GAAG,EAAE,CAExD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,eAAe,GAAG,GAAG,EAAE,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,GAAG,CAE5D"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI-Optimized Spec Loader Utility
|
|
3
|
+
*
|
|
4
|
+
* Loads SpecVerse YAML files and generates AIOptimizedSpec using:
|
|
5
|
+
* 1. UnifiedSpecVerseParser - Handles YAML parsing, imports, conventions
|
|
6
|
+
* 2. AIViewGenerator - Generates optimized spec with inference
|
|
7
|
+
*
|
|
8
|
+
* This utility eliminates duplicate parsing logic across all generators.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync, existsSync } from 'fs';
|
|
11
|
+
import { resolve, dirname } from 'path';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
import { UnifiedSpecVerseParser } from '@specverse/engine-parser';
|
|
14
|
+
import { AIViewGenerator } from '@specverse/engine-generators';
|
|
15
|
+
// ES module equivalent of __dirname
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
// Load JSON schema
|
|
19
|
+
const getSchemaPath = () => {
|
|
20
|
+
// Try multiple paths for schema location
|
|
21
|
+
const possiblePaths = [
|
|
22
|
+
resolve(process.cwd(), 'schema/SPECVERSE-SCHEMA.json'),
|
|
23
|
+
resolve(__dirname, '../../../schema/SPECVERSE-SCHEMA.json'),
|
|
24
|
+
resolve(__dirname, '../../schema/SPECVERSE-SCHEMA.json'),
|
|
25
|
+
];
|
|
26
|
+
for (const path of possiblePaths) {
|
|
27
|
+
try {
|
|
28
|
+
if (existsSync(path)) {
|
|
29
|
+
return path;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
// Continue to next path
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return possiblePaths[0]; // Fallback to cwd
|
|
37
|
+
};
|
|
38
|
+
const schemaPath = getSchemaPath();
|
|
39
|
+
const schemaJson = JSON.parse(readFileSync(schemaPath, 'utf8'));
|
|
40
|
+
/**
|
|
41
|
+
* Load and generate AIOptimizedSpec from a SpecVerse YAML file
|
|
42
|
+
*/
|
|
43
|
+
export function loadAIOptimizedSpec(yamlFile, options = {}) {
|
|
44
|
+
try {
|
|
45
|
+
// 1. Read YAML file
|
|
46
|
+
const yamlContent = readFileSync(yamlFile, 'utf8');
|
|
47
|
+
// 2. Parse with UnifiedSpecVerseParser (handles imports, conventions, validation)
|
|
48
|
+
const parser = new UnifiedSpecVerseParser(schemaJson);
|
|
49
|
+
const result = parser.parse(yamlContent, 'specly');
|
|
50
|
+
// Check for parse errors
|
|
51
|
+
if (result.errors && result.errors.length > 0) {
|
|
52
|
+
const errorMessages = result.errors
|
|
53
|
+
.map((err) => ` - ${err.message} (line ${err.line || '?'}, col ${err.column || '?'})`)
|
|
54
|
+
.join('\n');
|
|
55
|
+
throw new Error(`Parse errors in ${yamlFile}:\n${errorMessages}`);
|
|
56
|
+
}
|
|
57
|
+
// Check for warnings (non-fatal)
|
|
58
|
+
if (result.warnings && result.warnings.length > 0) {
|
|
59
|
+
console.warn(`⚠️ Warnings in ${yamlFile}:`);
|
|
60
|
+
result.warnings.forEach((warn) => {
|
|
61
|
+
console.warn(` - ${warn.message}`);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// 3. Generate AIOptimizedSpec (runs inference, expands CURED, etc.)
|
|
65
|
+
const generator = new AIViewGenerator();
|
|
66
|
+
const optimized = generator.generate(result.ast, options);
|
|
67
|
+
return optimized;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
// Provide helpful error messages
|
|
71
|
+
if (error.code === 'ENOENT') {
|
|
72
|
+
throw new Error(`File not found: ${yamlFile}`);
|
|
73
|
+
}
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Load AIOptimizedSpec with deployment filtering
|
|
79
|
+
*/
|
|
80
|
+
export function loadForDeployment(yamlFile, deploymentName, instanceName) {
|
|
81
|
+
return loadAIOptimizedSpec(yamlFile, {
|
|
82
|
+
deployment: deploymentName,
|
|
83
|
+
instance: instanceName
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Load AIOptimizedSpec with manifest configuration
|
|
88
|
+
*/
|
|
89
|
+
export function loadWithManifest(yamlFile, manifestConfig) {
|
|
90
|
+
return loadAIOptimizedSpec(yamlFile, {
|
|
91
|
+
manifest: manifestConfig
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get component metadata from AIOptimizedSpec
|
|
96
|
+
*/
|
|
97
|
+
export function getComponentMetadata(spec) {
|
|
98
|
+
return {
|
|
99
|
+
name: spec.metadata.component,
|
|
100
|
+
version: spec.metadata.version,
|
|
101
|
+
description: spec.metadata.description,
|
|
102
|
+
tags: spec.metadata.tags,
|
|
103
|
+
deployment: spec.metadata.deployment,
|
|
104
|
+
instance: spec.metadata.instance,
|
|
105
|
+
manifest: spec.metadata.manifest
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get all models from AIOptimizedSpec
|
|
110
|
+
*/
|
|
111
|
+
export function getModels(spec) {
|
|
112
|
+
return spec.models || [];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get all controllers from AIOptimizedSpec
|
|
116
|
+
*/
|
|
117
|
+
export function getControllers(spec) {
|
|
118
|
+
return spec.controllers || [];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get all services from AIOptimizedSpec
|
|
122
|
+
*/
|
|
123
|
+
export function getServices(spec) {
|
|
124
|
+
return spec.services || [];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get all events from AIOptimizedSpec
|
|
128
|
+
*/
|
|
129
|
+
export function getEvents(spec) {
|
|
130
|
+
return spec.events || [];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get infrastructure requirements from AIOptimizedSpec
|
|
134
|
+
*/
|
|
135
|
+
export function getInfrastructure(spec) {
|
|
136
|
+
return spec.infrastructure || {};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=ai-spec-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-spec-loader.js","sourceRoot":"","sources":["../../src/utils/ai-spec-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,oCAAoC;AACpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,mBAAmB;AACnB,MAAM,aAAa,GAAG,GAAW,EAAE;IACjC,yCAAyC;IACzC,MAAM,aAAa,GAAG;QACpB,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,8BAA8B,CAAC;QACtD,OAAO,CAAC,SAAS,EAAE,uCAAuC,CAAC;QAC3D,OAAO,CAAC,SAAS,EAAE,oCAAoC,CAAC;KACzD,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,IAAI,CAAC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AW;QACtC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI;QACxB,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU;QACpC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;QAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;KACjC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAqB;IAC7C,OAAO,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAqB;IAClD,OAAO,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAqB;IAC/C,OAAO,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAqB;IAC7C,OAAO,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACrD,OAAO,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest Loader Utility
|
|
3
|
+
*
|
|
4
|
+
* Loads and validates SpecVerse manifest files.
|
|
5
|
+
* Provides default manifests for testing and development.
|
|
6
|
+
*/
|
|
7
|
+
import type { CapabilityMapping, InstanceMapping, DefaultMappings, DeploymentReference } from '../types/index.js';
|
|
8
|
+
import type { DefaultMappingsV2, OverrideMapping } from '../types/unified-mappings.js';
|
|
9
|
+
/**
|
|
10
|
+
* Instance Factory Declaration
|
|
11
|
+
*
|
|
12
|
+
* Declares an instance factory with its source metadata.
|
|
13
|
+
* Source structure matches registry FactorySource exactly.
|
|
14
|
+
*/
|
|
15
|
+
export interface InstanceFactoryDeclaration {
|
|
16
|
+
/** Factory name (must match registry) */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Source metadata */
|
|
19
|
+
source: {
|
|
20
|
+
/** Source type */
|
|
21
|
+
type: 'npm' | 'git' | 'url';
|
|
22
|
+
/** NPM package name (for npm type) */
|
|
23
|
+
package?: string;
|
|
24
|
+
/** Version constraint (for npm type) */
|
|
25
|
+
version?: string;
|
|
26
|
+
/** Git repository URL (for git type) */
|
|
27
|
+
url?: string;
|
|
28
|
+
/** Entry point file path */
|
|
29
|
+
entrypoint?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface ManifestConfig {
|
|
33
|
+
specVersion: string;
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
version: string;
|
|
37
|
+
/** v3.3 Deployment Reference (REQUIRED) */
|
|
38
|
+
deployment: DeploymentReference;
|
|
39
|
+
/**
|
|
40
|
+
* Instance Factories (NEW - v3.6+)
|
|
41
|
+
*
|
|
42
|
+
* Explicit declarations of instance factories with source metadata.
|
|
43
|
+
* This allows validation without registry lookup.
|
|
44
|
+
*/
|
|
45
|
+
instanceFactories?: InstanceFactoryDeclaration[];
|
|
46
|
+
/**
|
|
47
|
+
* Two-Level Mapping System (v3.6+) - RECOMMENDED
|
|
48
|
+
*
|
|
49
|
+
* Simplified mapping system with two clear levels:
|
|
50
|
+
* - defaults: Sugar syntax for common cases
|
|
51
|
+
* - overrides: Explicit control with optional configuration
|
|
52
|
+
*/
|
|
53
|
+
defaults?: DefaultMappingsV2;
|
|
54
|
+
overrides?: OverrideMapping[];
|
|
55
|
+
/**
|
|
56
|
+
* Three-Level Mapping System (v3.3) - LEGACY
|
|
57
|
+
*
|
|
58
|
+
* Maintained for backward compatibility.
|
|
59
|
+
* Will be deprecated in future versions.
|
|
60
|
+
* Use two-level system (defaults + overrides) instead.
|
|
61
|
+
*/
|
|
62
|
+
defaultMappings?: DefaultMappings;
|
|
63
|
+
capabilityMappings?: CapabilityMapping[];
|
|
64
|
+
instanceMappings?: InstanceMapping[];
|
|
65
|
+
/** Global configuration */
|
|
66
|
+
configuration?: Record<string, any>;
|
|
67
|
+
/** Manifest templates for common tech stacks */
|
|
68
|
+
manifestTemplates?: Array<{
|
|
69
|
+
template: string;
|
|
70
|
+
version?: string;
|
|
71
|
+
}>;
|
|
72
|
+
/** Internal metadata */
|
|
73
|
+
_manifestName?: string;
|
|
74
|
+
_manifestPath?: string;
|
|
75
|
+
_isDefault?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface ManifestValidationResult {
|
|
78
|
+
valid: boolean;
|
|
79
|
+
errors: string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Load manifest from file
|
|
83
|
+
*/
|
|
84
|
+
export declare function loadManifest(manifestPath: string): ManifestConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Get manifest configuration value by path
|
|
87
|
+
*/
|
|
88
|
+
export declare function getManifestValue(manifest: ManifestConfig | null | undefined, path: string, defaultValue?: any): any;
|
|
89
|
+
/**
|
|
90
|
+
* Validate manifest structure (v3.3 only - no backward compatibility)
|
|
91
|
+
*/
|
|
92
|
+
export declare function validateManifest(manifest: ManifestConfig | null | undefined): ManifestValidationResult;
|
|
93
|
+
/**
|
|
94
|
+
* Merge manifests (v3.3 composition)
|
|
95
|
+
*/
|
|
96
|
+
export declare function mergeManifests(baseManifest: ManifestConfig | null | undefined, overrideManifest: ManifestConfig | null | undefined): ManifestConfig | null;
|
|
97
|
+
/**
|
|
98
|
+
* Get manifest summary for debugging
|
|
99
|
+
*/
|
|
100
|
+
export declare function getManifestSummary(manifest: ManifestConfig): {
|
|
101
|
+
name: string;
|
|
102
|
+
version: string;
|
|
103
|
+
deployment: string;
|
|
104
|
+
mappingStrategies: string[];
|
|
105
|
+
instanceCount?: number;
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=manifest-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-loader.d.ts","sourceRoot":"","sources":["../../src/utils/manifest-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,sBAAsB;IACtB,MAAM,EAAE;QACN,kBAAkB;QAClB,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;QAE5B,sCAAsC;QACtC,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,wCAAwC;QACxC,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,wCAAwC;QACxC,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb,4BAA4B;QAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,2CAA2C;IAC3C,UAAU,EA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