@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,524 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SpecVerse Orchestrator Bridge for MCP Integration
|
|
3
|
+
*
|
|
4
|
+
* Provides orchestrator capabilities as MCP tools while maintaining
|
|
5
|
+
* compatibility across all deployment environments.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { EventEmitter } from '../events/EventEmitter.js';
|
|
9
|
+
|
|
10
|
+
export interface OrchestratorConfig {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
orchestratorPath?: string;
|
|
13
|
+
workingDirectory?: string;
|
|
14
|
+
autoDetect?: boolean;
|
|
15
|
+
logging?: boolean;
|
|
16
|
+
mode?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface OrchestratorCapabilities {
|
|
20
|
+
hasFullOrchestrator: boolean;
|
|
21
|
+
availableOperations: string[];
|
|
22
|
+
workingDirectory?: string;
|
|
23
|
+
sessionSupport: boolean;
|
|
24
|
+
inferenceEngine: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface OrchestratorExecutionContext {
|
|
28
|
+
operation: 'analyse' | 'create' | 'infer' | 'materialise' | 'realize';
|
|
29
|
+
input?: string;
|
|
30
|
+
inputPath?: string;
|
|
31
|
+
inputType?: 'specification' | 'code' | 'requirements' | 'manifest';
|
|
32
|
+
outputPath?: string;
|
|
33
|
+
framework?: string;
|
|
34
|
+
scale?: 'personal' | 'business' | 'enterprise';
|
|
35
|
+
interactive?: boolean;
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface OrchestratorExecutionResult {
|
|
40
|
+
success: boolean;
|
|
41
|
+
content: string;
|
|
42
|
+
operation: string;
|
|
43
|
+
provider?: string;
|
|
44
|
+
sessionId?: string;
|
|
45
|
+
executionTime: number;
|
|
46
|
+
metadata?: {
|
|
47
|
+
framework?: string;
|
|
48
|
+
scale?: string;
|
|
49
|
+
inferenceRules?: number;
|
|
50
|
+
processingTime?: number;
|
|
51
|
+
error?: boolean;
|
|
52
|
+
};
|
|
53
|
+
error?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class OrchestratorBridge {
|
|
57
|
+
private config: OrchestratorConfig;
|
|
58
|
+
private eventEmitter: EventEmitter;
|
|
59
|
+
private capabilities: OrchestratorCapabilities;
|
|
60
|
+
private orchestrator: any = null;
|
|
61
|
+
private initialized: boolean = false;
|
|
62
|
+
|
|
63
|
+
constructor(config: OrchestratorConfig, eventEmitter: EventEmitter) {
|
|
64
|
+
this.config = config;
|
|
65
|
+
this.eventEmitter = eventEmitter;
|
|
66
|
+
this.capabilities = {
|
|
67
|
+
hasFullOrchestrator: false,
|
|
68
|
+
availableOperations: [],
|
|
69
|
+
sessionSupport: false,
|
|
70
|
+
inferenceEngine: false
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Initialize orchestrator bridge with environment detection
|
|
76
|
+
*/
|
|
77
|
+
async initialize(): Promise<void> {
|
|
78
|
+
if (this.initialized) return;
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
// Auto-detect orchestrator availability
|
|
82
|
+
if (this.config.autoDetect !== false) {
|
|
83
|
+
await this.detectOrchestrator();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (this.config.enabled && this.capabilities.hasFullOrchestrator) {
|
|
87
|
+
await this.initializeFullOrchestrator();
|
|
88
|
+
} else {
|
|
89
|
+
await this.initializeFallbackMode();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
this.initialized = true;
|
|
93
|
+
this.eventEmitter.emit('orchestrator-initialized', {
|
|
94
|
+
type: 'orchestrator-initialized',
|
|
95
|
+
capabilities: this.capabilities
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
} catch (error) {
|
|
99
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
100
|
+
if (this.config.logging) {
|
|
101
|
+
console.warn(`Orchestrator initialization failed: ${errorMessage}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Fall back to limited mode
|
|
105
|
+
await this.initializeFallbackMode();
|
|
106
|
+
this.initialized = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Execute orchestrator operation
|
|
112
|
+
*/
|
|
113
|
+
async execute(context: OrchestratorExecutionContext): Promise<OrchestratorExecutionResult> {
|
|
114
|
+
if (!this.initialized) {
|
|
115
|
+
throw new Error('Orchestrator bridge not initialized');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const startTime = Date.now();
|
|
119
|
+
|
|
120
|
+
try {
|
|
121
|
+
let result: OrchestratorExecutionResult;
|
|
122
|
+
|
|
123
|
+
if (this.capabilities.hasFullOrchestrator && this.orchestrator) {
|
|
124
|
+
result = await this.executeWithFullOrchestrator(context);
|
|
125
|
+
} else {
|
|
126
|
+
result = await this.executeWithFallback(context);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const executionTime = Date.now() - startTime;
|
|
130
|
+
result.executionTime = executionTime;
|
|
131
|
+
|
|
132
|
+
this.eventEmitter.emit('orchestrator-execution-completed', {
|
|
133
|
+
type: 'orchestrator-execution-completed',
|
|
134
|
+
operation: context.operation,
|
|
135
|
+
executionTime,
|
|
136
|
+
success: result.success
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
return result;
|
|
140
|
+
|
|
141
|
+
} catch (error) {
|
|
142
|
+
const executionTime = Date.now() - startTime;
|
|
143
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
144
|
+
|
|
145
|
+
this.eventEmitter.emit('orchestrator-execution-failed', {
|
|
146
|
+
type: 'orchestrator-execution-failed',
|
|
147
|
+
operation: context.operation,
|
|
148
|
+
error: errorMessage,
|
|
149
|
+
executionTime
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
success: false,
|
|
154
|
+
content: '',
|
|
155
|
+
operation: context.operation,
|
|
156
|
+
executionTime,
|
|
157
|
+
error: errorMessage
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Get orchestrator capabilities
|
|
164
|
+
*/
|
|
165
|
+
getCapabilities(): OrchestratorCapabilities {
|
|
166
|
+
return { ...this.capabilities };
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Check if orchestrator is available
|
|
171
|
+
*/
|
|
172
|
+
isAvailable(): boolean {
|
|
173
|
+
return this.initialized && (this.capabilities.hasFullOrchestrator || true); // Always available in fallback mode
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Get supported operations
|
|
178
|
+
*/
|
|
179
|
+
getSupportedOperations(): string[] {
|
|
180
|
+
return [...this.capabilities.availableOperations];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Private methods
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Detect orchestrator availability in current environment
|
|
187
|
+
*/
|
|
188
|
+
private async detectOrchestrator(): Promise<void> {
|
|
189
|
+
try {
|
|
190
|
+
// Method 1: Check if we can import the orchestrator from the main project
|
|
191
|
+
const orchestratorPath = this.config.orchestratorPath || '../../../src/orchestrator/index.js';
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
const orchestratorModule = await import(orchestratorPath);
|
|
195
|
+
if (orchestratorModule.SpecVerseOrchestrator) {
|
|
196
|
+
this.capabilities.hasFullOrchestrator = true;
|
|
197
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
198
|
+
console.log('Full orchestrator detected via import');
|
|
199
|
+
}
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
} catch (importError) {
|
|
203
|
+
// Continue with other detection methods
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Method 2: Check if orchestrator exists in parent project structure
|
|
207
|
+
const { existsSync } = await import('fs');
|
|
208
|
+
const { resolve, join } = await import('path');
|
|
209
|
+
|
|
210
|
+
const possiblePaths = [
|
|
211
|
+
resolve(process.cwd(), '../../../src/orchestrator'),
|
|
212
|
+
resolve(process.cwd(), '../../src/orchestrator'),
|
|
213
|
+
resolve(process.cwd(), '../src/orchestrator'),
|
|
214
|
+
resolve(process.cwd(), 'src/orchestrator'),
|
|
215
|
+
join(process.cwd(), '../../dist/orchestrator')
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
for (const path of possiblePaths) {
|
|
219
|
+
if (existsSync(path)) {
|
|
220
|
+
this.capabilities.hasFullOrchestrator = true;
|
|
221
|
+
this.config.orchestratorPath = path;
|
|
222
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
223
|
+
console.log(`Orchestrator detected at: ${path}`);
|
|
224
|
+
}
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Method 3: Check for global SpecVerse CLI installation
|
|
230
|
+
try {
|
|
231
|
+
const { execSync } = await import('child_process');
|
|
232
|
+
execSync('specverse --version', { stdio: 'pipe' });
|
|
233
|
+
this.capabilities.hasFullOrchestrator = true;
|
|
234
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
235
|
+
console.log('Global SpecVerse CLI detected');
|
|
236
|
+
}
|
|
237
|
+
return;
|
|
238
|
+
} catch (cliError) {
|
|
239
|
+
// CLI not available
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
243
|
+
console.log('Full orchestrator not detected, using fallback mode');
|
|
244
|
+
}
|
|
245
|
+
this.capabilities.hasFullOrchestrator = false;
|
|
246
|
+
|
|
247
|
+
} catch (error) {
|
|
248
|
+
if (this.config.logging) {
|
|
249
|
+
console.warn(`Orchestrator detection failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
250
|
+
}
|
|
251
|
+
this.capabilities.hasFullOrchestrator = false;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Initialize full orchestrator with all capabilities
|
|
257
|
+
*/
|
|
258
|
+
private async initializeFullOrchestrator(): Promise<void> {
|
|
259
|
+
try {
|
|
260
|
+
// Import orchestrator dynamically with multiple path attempts
|
|
261
|
+
let orchestratorModule;
|
|
262
|
+
const possiblePaths = [
|
|
263
|
+
this.config.orchestratorPath, // User-specified path
|
|
264
|
+
'../../dist/orchestrator/index.js', // local package path
|
|
265
|
+
'../../../dist/orchestrator/index.js', // parent repo build
|
|
266
|
+
'../../specverse-lang/dist/orchestrator/index.js', // sibling repo
|
|
267
|
+
'../../../src/orchestrator/index.js', // dev repo path
|
|
268
|
+
].filter(Boolean);
|
|
269
|
+
|
|
270
|
+
for (const path of possiblePaths) {
|
|
271
|
+
if (!path) continue; // Skip undefined paths
|
|
272
|
+
try {
|
|
273
|
+
orchestratorModule = await import(path);
|
|
274
|
+
if (orchestratorModule.SpecVerseOrchestrator) {
|
|
275
|
+
if (this.config.logging) {
|
|
276
|
+
console.log(`Successfully loaded orchestrator from: ${path}`);
|
|
277
|
+
}
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
} catch (error) {
|
|
281
|
+
if (this.config.logging) {
|
|
282
|
+
console.debug(`Failed to load orchestrator from ${path}: ${error instanceof Error ? error.message : String(error)}`);
|
|
283
|
+
}
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!orchestratorModule) {
|
|
289
|
+
throw new Error('Could not find orchestrator module in any of the expected locations');
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (!orchestratorModule.SpecVerseOrchestrator) {
|
|
293
|
+
throw new Error('SpecVerseOrchestrator not found in module');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Create orchestrator instance
|
|
297
|
+
this.orchestrator = new orchestratorModule.SpecVerseOrchestrator();
|
|
298
|
+
|
|
299
|
+
// Initialize with default or specified config
|
|
300
|
+
await this.orchestrator.initialize();
|
|
301
|
+
|
|
302
|
+
// Set capabilities
|
|
303
|
+
this.capabilities = {
|
|
304
|
+
hasFullOrchestrator: true,
|
|
305
|
+
availableOperations: ['analyse', 'create', 'infer', 'materialise', 'realize'],
|
|
306
|
+
workingDirectory: this.config.workingDirectory || process.cwd(),
|
|
307
|
+
sessionSupport: true,
|
|
308
|
+
inferenceEngine: true
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
if (this.config.logging) {
|
|
312
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
313
|
+
console.log('Full orchestrator initialized successfully');
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (this.config.logging) {
|
|
317
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
318
|
+
console.log(`Available operations: ${this.capabilities.availableOperations.join(', ')}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
} catch (error) {
|
|
323
|
+
throw new Error(`Failed to initialize full orchestrator: ${error instanceof Error ? error.message : String(error)}`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Initialize fallback mode with limited capabilities
|
|
329
|
+
*/
|
|
330
|
+
private async initializeFallbackMode(): Promise<void> {
|
|
331
|
+
this.capabilities = {
|
|
332
|
+
hasFullOrchestrator: false,
|
|
333
|
+
availableOperations: ['create', 'analyse'], // Basic operations available via prompts
|
|
334
|
+
workingDirectory: this.config.workingDirectory || process.cwd(),
|
|
335
|
+
sessionSupport: false,
|
|
336
|
+
inferenceEngine: false
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
if (this.config.logging) {
|
|
340
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
341
|
+
console.log('Orchestrator bridge initialized in fallback mode');
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (this.config.logging) {
|
|
345
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
346
|
+
console.log(`Limited operations: ${this.capabilities.availableOperations.join(', ')}`);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Execute operation with full orchestrator
|
|
353
|
+
*/
|
|
354
|
+
private async executeWithFullOrchestrator(context: OrchestratorExecutionContext): Promise<OrchestratorExecutionResult> {
|
|
355
|
+
try {
|
|
356
|
+
const orchestrationContext = {
|
|
357
|
+
operation: context.operation,
|
|
358
|
+
input: context.input,
|
|
359
|
+
inputPath: context.inputPath,
|
|
360
|
+
inputType: context.inputType,
|
|
361
|
+
outputPath: context.outputPath,
|
|
362
|
+
framework: context.framework,
|
|
363
|
+
scale: context.scale || 'business',
|
|
364
|
+
interactive: context.interactive || false,
|
|
365
|
+
sessionId: context.sessionId
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
if (this.config.logging) {
|
|
369
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
370
|
+
console.log(`Executing ${context.operation} with full orchestrator...`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const result = await this.orchestrator.execute(orchestrationContext);
|
|
375
|
+
|
|
376
|
+
return {
|
|
377
|
+
success: true,
|
|
378
|
+
content: result.content,
|
|
379
|
+
operation: context.operation,
|
|
380
|
+
provider: result.provider,
|
|
381
|
+
sessionId: result.sessionId,
|
|
382
|
+
executionTime: 0, // Will be set by caller
|
|
383
|
+
metadata: result.metadata
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
} catch (error) {
|
|
387
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
388
|
+
if (this.config.logging) {
|
|
389
|
+
console.error(`Full orchestrator execution failed: ${errorMessage}`);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
success: false,
|
|
394
|
+
content: '',
|
|
395
|
+
operation: context.operation,
|
|
396
|
+
executionTime: 0,
|
|
397
|
+
error: errorMessage
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Execute operation with fallback implementation
|
|
404
|
+
*/
|
|
405
|
+
private async executeWithFallback(context: OrchestratorExecutionContext): Promise<OrchestratorExecutionResult> {
|
|
406
|
+
if (this.config.logging) {
|
|
407
|
+
if (this.config.logging && this.config.mode !== 'local') {
|
|
408
|
+
console.log(`Executing ${context.operation} in fallback mode...`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
switch (context.operation) {
|
|
413
|
+
case 'create':
|
|
414
|
+
return this.executeFallbackCreate(context);
|
|
415
|
+
case 'analyse':
|
|
416
|
+
return this.executeFallbackAnalyse(context);
|
|
417
|
+
case 'infer':
|
|
418
|
+
return this.executeFallbackInfer(context);
|
|
419
|
+
default:
|
|
420
|
+
return {
|
|
421
|
+
success: false,
|
|
422
|
+
content: '',
|
|
423
|
+
operation: context.operation,
|
|
424
|
+
executionTime: 0,
|
|
425
|
+
error: `Operation '${context.operation}' not supported in fallback mode. Full orchestrator required.`
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
private async executeFallbackCreate(context: OrchestratorExecutionContext): Promise<OrchestratorExecutionResult> {
|
|
431
|
+
// Fallback create operation - return structured message indicating prompt expansion needed
|
|
432
|
+
const content = `# SpecVerse Creation (Fallback Mode)
|
|
433
|
+
|
|
434
|
+
**Requirements**: ${context.input || 'No requirements provided'}
|
|
435
|
+
**Scale**: ${context.scale || 'business'}
|
|
436
|
+
**Framework**: ${context.framework || 'auto-detect'}
|
|
437
|
+
|
|
438
|
+
## Next Steps
|
|
439
|
+
|
|
440
|
+
This operation requires the full SpecVerse orchestrator for AI-powered specification creation.
|
|
441
|
+
|
|
442
|
+
In fallback mode, you can:
|
|
443
|
+
1. Use the \`get_creation_prompt\` MCP tool to get an expanded prompt
|
|
444
|
+
2. Use that prompt with your AI assistant to create specifications
|
|
445
|
+
3. Use the SpecVerse CLI locally for full orchestrator capabilities
|
|
446
|
+
|
|
447
|
+
## Fallback Specification Template
|
|
448
|
+
|
|
449
|
+
\`\`\`yaml
|
|
450
|
+
components:
|
|
451
|
+
${context.framework || 'Application'}Component:
|
|
452
|
+
models:
|
|
453
|
+
# Define your models here based on requirements
|
|
454
|
+
ExampleModel:
|
|
455
|
+
attributes:
|
|
456
|
+
name: String required
|
|
457
|
+
description: String optional
|
|
458
|
+
relationships:
|
|
459
|
+
# Add relationships as needed
|
|
460
|
+
\`\`\`
|
|
461
|
+
|
|
462
|
+
**Note**: For full AI-powered creation, install the complete SpecVerse toolchain locally.`;
|
|
463
|
+
|
|
464
|
+
return {
|
|
465
|
+
success: true,
|
|
466
|
+
content,
|
|
467
|
+
operation: context.operation,
|
|
468
|
+
executionTime: 0,
|
|
469
|
+
metadata: {
|
|
470
|
+
scale: context.scale,
|
|
471
|
+
framework: context.framework,
|
|
472
|
+
processingTime: 1
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
private async executeFallbackAnalyse(context: OrchestratorExecutionContext): Promise<OrchestratorExecutionResult> {
|
|
478
|
+
// Fallback analyse operation
|
|
479
|
+
const content = `# SpecVerse Analysis (Fallback Mode)
|
|
480
|
+
|
|
481
|
+
**Target**: ${context.inputPath || context.input || 'No input provided'}
|
|
482
|
+
**Framework**: ${context.framework || 'auto-detect'}
|
|
483
|
+
|
|
484
|
+
## Analysis Summary
|
|
485
|
+
|
|
486
|
+
This operation requires the full SpecVerse orchestrator for AI-powered codebase analysis.
|
|
487
|
+
|
|
488
|
+
In fallback mode, you can:
|
|
489
|
+
1. Use the \`get_analysis_prompt\` MCP tool to get an expanded analysis prompt
|
|
490
|
+
2. Use that prompt with your AI assistant to analyze codebases
|
|
491
|
+
3. Install the complete SpecVerse toolchain for full orchestrator capabilities
|
|
492
|
+
|
|
493
|
+
## Manual Analysis Steps
|
|
494
|
+
|
|
495
|
+
1. **Identify Models**: Look for data structures, entities, classes
|
|
496
|
+
2. **Map Relationships**: Identify how models relate to each other
|
|
497
|
+
3. **Find Controllers**: Locate API endpoints, request handlers
|
|
498
|
+
4. **Discover Services**: Find business logic, processing functions
|
|
499
|
+
5. **Map Events**: Identify event publishing and handling
|
|
500
|
+
|
|
501
|
+
**Note**: For full AI-powered analysis, install the complete SpecVerse toolchain locally.`;
|
|
502
|
+
|
|
503
|
+
return {
|
|
504
|
+
success: true,
|
|
505
|
+
content,
|
|
506
|
+
operation: context.operation,
|
|
507
|
+
executionTime: 0,
|
|
508
|
+
metadata: {
|
|
509
|
+
framework: context.framework,
|
|
510
|
+
processingTime: 1
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
private async executeFallbackInfer(context: OrchestratorExecutionContext): Promise<OrchestratorExecutionResult> {
|
|
516
|
+
return {
|
|
517
|
+
success: false,
|
|
518
|
+
content: '',
|
|
519
|
+
operation: context.operation,
|
|
520
|
+
executionTime: 0,
|
|
521
|
+
error: 'Inference operation requires the full SpecVerse orchestrator with inference engine. Please install the complete SpecVerse toolchain.'
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
}
|