@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
package/libs/instance-factories/tools/templates/mcp/static/src/services/EmbeddedResourcesAdapter.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmbeddedResourcesAdapter
|
|
3
|
+
* Handles embedded resources for web deployments
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { SpecVerseResourceModel } from '../models/SpecVerseResource.js';
|
|
7
|
+
import type { ResourceProvider } from '../interfaces/ResourceProvider.js';
|
|
8
|
+
import type { SpecVerseResource, MCPToolResult } from '../types/index.js';
|
|
9
|
+
|
|
10
|
+
export interface EmbeddedResourceData {
|
|
11
|
+
content: string;
|
|
12
|
+
mimeType: string;
|
|
13
|
+
size: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface EmbeddedResourcesMap {
|
|
17
|
+
[path: string]: EmbeddedResourceData;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class EmbeddedResourcesAdapter implements ResourceProvider {
|
|
21
|
+
private resourceCatalog: Map<string, SpecVerseResourceModel> = new Map();
|
|
22
|
+
private embeddedResources: EmbeddedResourcesMap;
|
|
23
|
+
private isInitialized = false;
|
|
24
|
+
|
|
25
|
+
constructor(embeddedResources: EmbeddedResourcesMap) {
|
|
26
|
+
this.embeddedResources = embeddedResources;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async initializeResources(): Promise<void> {
|
|
30
|
+
if (this.isInitialized) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Initialize resource catalog with known resources using embedded content
|
|
35
|
+
const resources: SpecVerseResource[] = [
|
|
36
|
+
{
|
|
37
|
+
uri: 'specverse://schema/json',
|
|
38
|
+
name: 'SpecVerse v3.1 JSON Schema',
|
|
39
|
+
description: 'Complete JSON schema for SpecVerse v3.1 specifications',
|
|
40
|
+
mimeType: 'application/json'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
uri: 'specverse://schema/ai-yaml',
|
|
44
|
+
name: 'SpecVerse v3.1 AI-Optimized Schema',
|
|
45
|
+
description: 'AI-friendly YAML schema with guidance and examples',
|
|
46
|
+
mimeType: 'application/x-yaml'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
uri: 'specverse://prompts/create',
|
|
50
|
+
name: 'Create Prompt Template',
|
|
51
|
+
description: 'Template for generating SpecVerse specifications from requirements',
|
|
52
|
+
mimeType: 'application/x-yaml'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
uri: 'specverse://prompts/analyse',
|
|
56
|
+
name: 'Analysis Prompt Template',
|
|
57
|
+
description: 'Template for extracting specifications from existing code',
|
|
58
|
+
mimeType: 'application/x-yaml'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
uri: 'specverse://prompts/materialise',
|
|
62
|
+
name: 'Implementation Planning Template',
|
|
63
|
+
description: 'Template for creating implementation plans from specifications',
|
|
64
|
+
mimeType: 'application/x-yaml'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
uri: 'specverse://prompts/realize',
|
|
68
|
+
name: 'Code Generation Template',
|
|
69
|
+
description: 'Template for generating source code from specifications',
|
|
70
|
+
mimeType: 'application/x-yaml'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
uri: 'specverse://libraries/catalog',
|
|
74
|
+
name: 'SpecVerse Library Catalog',
|
|
75
|
+
description: 'Complete catalog of available SpecVerse libraries with AI metadata',
|
|
76
|
+
mimeType: 'application/x-yaml'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
uri: 'specverse://examples/chat-prompts',
|
|
80
|
+
name: 'Chat Prompt Examples',
|
|
81
|
+
description: 'Example prompts for terminal/chat-based AI interactions',
|
|
82
|
+
mimeType: 'text/markdown'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
uri: 'specverse://examples/api-calls',
|
|
86
|
+
name: 'API Integration Examples',
|
|
87
|
+
description: 'Examples for API-based AI integrations',
|
|
88
|
+
mimeType: 'application/javascript'
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
for (const resourceData of resources) {
|
|
93
|
+
const resource = SpecVerseResourceModel.create(resourceData);
|
|
94
|
+
this.resourceCatalog.set(resource.uri, resource);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this.isInitialized = true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async listResources(): Promise<SpecVerseResource[]> {
|
|
101
|
+
await this.initializeResources();
|
|
102
|
+
|
|
103
|
+
return Array.from(this.resourceCatalog.values()).map(resource => ({
|
|
104
|
+
uri: resource.uri,
|
|
105
|
+
name: resource.name,
|
|
106
|
+
description: resource.description,
|
|
107
|
+
mimeType: resource.mimeType,
|
|
108
|
+
content: resource.content,
|
|
109
|
+
metadata: resource.metadata
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async getResourceContent(uri: string): Promise<string> {
|
|
114
|
+
await this.initializeResources();
|
|
115
|
+
|
|
116
|
+
const resource = this.resourceCatalog.get(uri);
|
|
117
|
+
if (!resource) {
|
|
118
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (resource.isLoaded()) {
|
|
122
|
+
return resource.content!;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Load content from embedded resources
|
|
126
|
+
const resourcePath = this.resolveResourcePath(uri);
|
|
127
|
+
const embeddedResource = this.embeddedResources[resourcePath];
|
|
128
|
+
|
|
129
|
+
if (!embeddedResource) {
|
|
130
|
+
throw new Error(`Embedded resource not found: ${resourcePath} for URI: ${uri}`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Update resource with loaded content
|
|
134
|
+
const updatedResource = resource.withContent(embeddedResource.content);
|
|
135
|
+
this.resourceCatalog.set(uri, updatedResource);
|
|
136
|
+
|
|
137
|
+
return embeddedResource.content;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async readResource(uri: string): Promise<MCPToolResult> {
|
|
141
|
+
try {
|
|
142
|
+
const content = await this.getResourceContent(uri);
|
|
143
|
+
const resource = this.resourceCatalog.get(uri)!;
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
content: [{
|
|
147
|
+
type: 'resource',
|
|
148
|
+
resource: {
|
|
149
|
+
uri: resource.uri,
|
|
150
|
+
name: resource.name,
|
|
151
|
+
description: resource.description,
|
|
152
|
+
mimeType: resource.mimeType,
|
|
153
|
+
content
|
|
154
|
+
}
|
|
155
|
+
}]
|
|
156
|
+
};
|
|
157
|
+
} catch (error) {
|
|
158
|
+
return {
|
|
159
|
+
content: [{
|
|
160
|
+
type: 'text',
|
|
161
|
+
text: `Error reading resource: ${error instanceof Error ? error.message : String(error)}`
|
|
162
|
+
}],
|
|
163
|
+
isError: true
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private resolveResourcePath(uri: string): string {
|
|
169
|
+
switch (uri) {
|
|
170
|
+
case 'specverse://schema/json':
|
|
171
|
+
return 'schemas/SPECVERSE-SCHEMA.json';
|
|
172
|
+
case 'specverse://schema/ai-yaml':
|
|
173
|
+
return 'schemas/specverse-ai.yaml';
|
|
174
|
+
case 'specverse://prompts/create':
|
|
175
|
+
return 'prompts/create.prompt.yaml';
|
|
176
|
+
case 'specverse://prompts/analyse':
|
|
177
|
+
return 'prompts/analyse.prompt.yaml';
|
|
178
|
+
case 'specverse://prompts/materialise':
|
|
179
|
+
return 'prompts/materialise.prompt.yaml';
|
|
180
|
+
case 'specverse://prompts/realize':
|
|
181
|
+
return 'prompts/realize.prompt.yaml';
|
|
182
|
+
case 'specverse://libraries/catalog':
|
|
183
|
+
return 'libraries/catalog/library-catalog.yaml';
|
|
184
|
+
case 'specverse://examples/chat-prompts':
|
|
185
|
+
return 'examples/chat-prompts/ecommerce-store-example.md';
|
|
186
|
+
case 'specverse://examples/api-calls':
|
|
187
|
+
return 'examples/api-calls/orchestrator-workflow-example.js';
|
|
188
|
+
default:
|
|
189
|
+
throw new Error(`Unknown resource URI: ${uri}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
isResourceAvailable(uri: string): boolean {
|
|
194
|
+
return this.resourceCatalog.has(uri);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
getCachedResourceCount(): number {
|
|
198
|
+
return Array.from(this.resourceCatalog.values()).filter(r => r.isLoaded()).length;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
getEmbeddedResourcesInfo(): { count: number; totalSize: number; paths: string[] } {
|
|
202
|
+
const paths = Object.keys(this.embeddedResources);
|
|
203
|
+
const totalSize = Object.values(this.embeddedResources).reduce((sum, res) => sum + res.size, 0);
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
count: paths.length,
|
|
207
|
+
totalSize,
|
|
208
|
+
paths
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
package/libs/instance-factories/tools/templates/mcp/static/src/services/EntityModuleService.ts
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EntityModuleService
|
|
3
|
+
*
|
|
4
|
+
* Provides entity module metadata as MCP resources and tools.
|
|
5
|
+
* Loads the entity registry from @specverse/engine-entities and exposes:
|
|
6
|
+
* - Entity module registry (all modules, their facets, dependencies)
|
|
7
|
+
* - Convention grammars per entity (what behavioural constraints are available)
|
|
8
|
+
* - Inference rules per entity (what gets generated from what)
|
|
9
|
+
* - Diagram plugins per entity
|
|
10
|
+
* - Behavioural constraint expansion (tool)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { SpecVerseResource, MCPToolResult } from '../types/index.js';
|
|
14
|
+
|
|
15
|
+
interface EntityModuleInfo {
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
version: string;
|
|
19
|
+
dependsOn: string[];
|
|
20
|
+
hasConventionProcessor: boolean;
|
|
21
|
+
inferenceRuleCount: number;
|
|
22
|
+
inferenceRules: Array<{ id: string; description: string; triggeredBy: string; generates?: string[] }>;
|
|
23
|
+
diagramPlugins: Array<{ type: string; variants?: string[] }>;
|
|
24
|
+
generatorCount: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface ConventionInfo {
|
|
28
|
+
entity: string;
|
|
29
|
+
domain: string;
|
|
30
|
+
conventions: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
pattern: string;
|
|
33
|
+
description: string;
|
|
34
|
+
expandsTo: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class EntityModuleService {
|
|
39
|
+
private registry: any = null;
|
|
40
|
+
private behaviouralProcessor: any = null;
|
|
41
|
+
private loaded = false;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Attempt to load the entity registry from @specverse/engine-entities.
|
|
45
|
+
* Fails gracefully if not available.
|
|
46
|
+
*/
|
|
47
|
+
async initialize(): Promise<boolean> {
|
|
48
|
+
try {
|
|
49
|
+
// Dynamic imports — paths resolved at runtime, not compile time
|
|
50
|
+
// The MCP server sits in tools/specverse-mcp/ but needs to reach src/entities/
|
|
51
|
+
const { resolve, dirname } = await import('path');
|
|
52
|
+
const { fileURLToPath } = await import('url');
|
|
53
|
+
const baseDir = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
|
|
54
|
+
|
|
55
|
+
const entitiesPath = resolve(baseDir, 'dist', 'entities', 'index.js');
|
|
56
|
+
const conventionPath = resolve(baseDir, 'dist', 'entities', '_shared', 'behaviour', 'convention-processor.js');
|
|
57
|
+
|
|
58
|
+
const entitiesModule = await import(entitiesPath);
|
|
59
|
+
entitiesModule.bootstrapEntityModules();
|
|
60
|
+
this.registry = entitiesModule.getEntityRegistry();
|
|
61
|
+
|
|
62
|
+
const { BehaviouralConventionProcessor } = await import(conventionPath);
|
|
63
|
+
this.behaviouralProcessor = new BehaviouralConventionProcessor();
|
|
64
|
+
|
|
65
|
+
// Load grammars from entity module source (grammar.yaml files)
|
|
66
|
+
const entitiesDir = resolve(baseDir, 'src', 'entities');
|
|
67
|
+
this.behaviouralProcessor.loadGrammarsFromEntities(entitiesDir);
|
|
68
|
+
|
|
69
|
+
this.loaded = true;
|
|
70
|
+
return true;
|
|
71
|
+
} catch (error) {
|
|
72
|
+
// Entity modules not available in this deployment context
|
|
73
|
+
this.loaded = false;
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
isAvailable(): boolean {
|
|
79
|
+
return this.loaded;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get entity module metadata for all registered modules.
|
|
84
|
+
*/
|
|
85
|
+
getEntityModules(): EntityModuleInfo[] {
|
|
86
|
+
if (!this.registry) return [];
|
|
87
|
+
|
|
88
|
+
const modules = this.registry.getInDependencyOrder();
|
|
89
|
+
return modules.map((mod: any) => ({
|
|
90
|
+
name: mod.name,
|
|
91
|
+
type: mod.type,
|
|
92
|
+
version: mod.version,
|
|
93
|
+
dependsOn: mod.dependsOn || [],
|
|
94
|
+
hasConventionProcessor: !!mod.conventionProcessor,
|
|
95
|
+
inferenceRuleCount: mod.inferenceRules?.length || 0,
|
|
96
|
+
inferenceRules: (mod.inferenceRules || []).map((r: any) => ({
|
|
97
|
+
id: r.id,
|
|
98
|
+
description: r.description,
|
|
99
|
+
triggeredBy: r.triggeredBy,
|
|
100
|
+
generates: r.generates,
|
|
101
|
+
})),
|
|
102
|
+
diagramPlugins: mod.diagramPlugins || [],
|
|
103
|
+
generatorCount: mod.generators?.length || 0,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get behavioural convention grammars for all entities.
|
|
109
|
+
*/
|
|
110
|
+
getConventionGrammars(): ConventionInfo[] {
|
|
111
|
+
if (!this.behaviouralProcessor) return [];
|
|
112
|
+
|
|
113
|
+
return this.behaviouralProcessor.getGrammars().map((g: any) => ({
|
|
114
|
+
entity: g.entity,
|
|
115
|
+
domain: g.domain,
|
|
116
|
+
conventions: Object.values(g.conventions).map((c: any) => ({
|
|
117
|
+
name: c.name,
|
|
118
|
+
pattern: c.pattern,
|
|
119
|
+
description: c.description,
|
|
120
|
+
expandsTo: c.expandsTo,
|
|
121
|
+
})),
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Expand a behavioural constraint string.
|
|
127
|
+
*/
|
|
128
|
+
expandConstraint(input: string): { success: boolean; result?: any; error?: string } {
|
|
129
|
+
if (!this.behaviouralProcessor) {
|
|
130
|
+
return { success: false, error: 'Behavioural convention processor not available' };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const result = this.behaviouralProcessor.expand(input);
|
|
134
|
+
if (result) {
|
|
135
|
+
return { success: true, result };
|
|
136
|
+
}
|
|
137
|
+
return { success: false, error: `No matching convention pattern for: "${input}"` };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Generate MCP resources from entity module metadata.
|
|
142
|
+
*/
|
|
143
|
+
generateResources(): SpecVerseResource[] {
|
|
144
|
+
if (!this.loaded) return [];
|
|
145
|
+
|
|
146
|
+
const resources: SpecVerseResource[] = [];
|
|
147
|
+
|
|
148
|
+
// 1. Entity registry overview
|
|
149
|
+
const modules = this.getEntityModules();
|
|
150
|
+
resources.push({
|
|
151
|
+
uri: 'specverse://entities/registry',
|
|
152
|
+
name: 'Entity Module Registry',
|
|
153
|
+
description: `All ${modules.length} registered entity modules with their facets, dependencies, and capabilities`,
|
|
154
|
+
mimeType: 'application/json',
|
|
155
|
+
content: JSON.stringify({ entityModules: modules }, null, 2),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// 2. Behavioural conventions catalog
|
|
159
|
+
const grammars = this.getConventionGrammars();
|
|
160
|
+
const totalConventions = grammars.reduce((sum, g) => sum + g.conventions.length, 0);
|
|
161
|
+
resources.push({
|
|
162
|
+
uri: 'specverse://entities/conventions',
|
|
163
|
+
name: 'Behavioural Conventions Catalog',
|
|
164
|
+
description: `${totalConventions} behavioural conventions across ${grammars.length} entities. Use in constraints: section of .specly files.`,
|
|
165
|
+
mimeType: 'application/json',
|
|
166
|
+
content: JSON.stringify({ grammars }, null, 2),
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// 3. Inference rules summary
|
|
170
|
+
const allRules = modules.flatMap(m => m.inferenceRules);
|
|
171
|
+
resources.push({
|
|
172
|
+
uri: 'specverse://entities/inference-rules',
|
|
173
|
+
name: 'Inference Rules Summary',
|
|
174
|
+
description: `${allRules.length} inference rules that generate architecture from specifications`,
|
|
175
|
+
mimeType: 'application/json',
|
|
176
|
+
content: JSON.stringify({ rules: allRules }, null, 2),
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// 4. Diagram plugins summary
|
|
180
|
+
const allPlugins = modules.flatMap(m =>
|
|
181
|
+
m.diagramPlugins.map(p => ({ ...p, entity: m.name }))
|
|
182
|
+
);
|
|
183
|
+
resources.push({
|
|
184
|
+
uri: 'specverse://entities/diagram-plugins',
|
|
185
|
+
name: 'Diagram Plugins',
|
|
186
|
+
description: `${allPlugins.length} diagram types available for visualization`,
|
|
187
|
+
mimeType: 'application/json',
|
|
188
|
+
content: JSON.stringify({ plugins: allPlugins }, null, 2),
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return resources;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Generate MCP tools for entity module interaction.
|
|
196
|
+
*/
|
|
197
|
+
generateTools(): any[] {
|
|
198
|
+
if (!this.loaded) return [];
|
|
199
|
+
|
|
200
|
+
return [
|
|
201
|
+
{
|
|
202
|
+
name: 'specverse_expand_constraint',
|
|
203
|
+
description: 'Expand a behavioural constraint string into a Quint invariant. Example: "models must have attributes"',
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
properties: {
|
|
207
|
+
constraint: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
description: 'Human-readable constraint to expand (e.g., "models must have attributes")',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
required: ['constraint'],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: 'specverse_list_conventions',
|
|
217
|
+
description: 'List available behavioural conventions for a specific entity type',
|
|
218
|
+
inputSchema: {
|
|
219
|
+
type: 'object',
|
|
220
|
+
properties: {
|
|
221
|
+
entity: {
|
|
222
|
+
type: 'string',
|
|
223
|
+
description: 'Entity type (e.g., "models", "controllers", "services")',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
required: ['entity'],
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'specverse_entity_info',
|
|
231
|
+
description: 'Get detailed metadata about an entity module (conventions, inference rules, diagram plugins)',
|
|
232
|
+
inputSchema: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
entity: {
|
|
236
|
+
type: 'string',
|
|
237
|
+
description: 'Entity name (e.g., "models", "controllers", "deployments")',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
required: ['entity'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Execute an entity module tool.
|
|
248
|
+
*/
|
|
249
|
+
async executeTool(name: string, args: Record<string, any>): Promise<MCPToolResult> {
|
|
250
|
+
switch (name) {
|
|
251
|
+
case 'specverse_expand_constraint': {
|
|
252
|
+
const result = this.expandConstraint(args.constraint);
|
|
253
|
+
return {
|
|
254
|
+
content: [{
|
|
255
|
+
type: 'text',
|
|
256
|
+
text: JSON.stringify(result, null, 2),
|
|
257
|
+
}],
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
case 'specverse_list_conventions': {
|
|
262
|
+
const grammars = this.getConventionGrammars();
|
|
263
|
+
const grammar = grammars.find(g => g.entity === args.entity);
|
|
264
|
+
if (!grammar) {
|
|
265
|
+
return {
|
|
266
|
+
content: [{
|
|
267
|
+
type: 'text',
|
|
268
|
+
text: `No conventions found for entity "${args.entity}". Available: ${grammars.map(g => g.entity).join(', ')}`,
|
|
269
|
+
}],
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
content: [{
|
|
274
|
+
type: 'text',
|
|
275
|
+
text: JSON.stringify(grammar, null, 2),
|
|
276
|
+
}],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
case 'specverse_entity_info': {
|
|
281
|
+
const modules = this.getEntityModules();
|
|
282
|
+
const mod = modules.find(m => m.name === args.entity);
|
|
283
|
+
if (!mod) {
|
|
284
|
+
return {
|
|
285
|
+
content: [{
|
|
286
|
+
type: 'text',
|
|
287
|
+
text: `Entity "${args.entity}" not found. Available: ${modules.map(m => m.name).join(', ')}`,
|
|
288
|
+
}],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
content: [{
|
|
293
|
+
type: 'text',
|
|
294
|
+
text: JSON.stringify(mod, null, 2),
|
|
295
|
+
}],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
default:
|
|
300
|
+
return {
|
|
301
|
+
content: [{
|
|
302
|
+
type: 'text',
|
|
303
|
+
text: `Unknown entity module tool: ${name}`,
|
|
304
|
+
}],
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|