@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/OrchestratorToolsService.ts
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator Tools Service for MCP Integration
|
|
3
|
+
*
|
|
4
|
+
* Provides orchestrator workflow capabilities as MCP tools
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { OrchestratorBridge, OrchestratorExecutionContext } from './OrchestratorBridge.js';
|
|
8
|
+
import { EventEmitter } from '../events/EventEmitter.js';
|
|
9
|
+
|
|
10
|
+
export interface OrchestratorToolsConfig {
|
|
11
|
+
orchestratorBridge: OrchestratorBridge;
|
|
12
|
+
eventEmitter: EventEmitter;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AnalyseCodebaseParams {
|
|
16
|
+
codePath: string;
|
|
17
|
+
framework?: string;
|
|
18
|
+
outputPath?: string;
|
|
19
|
+
interactive?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CreateSpecificationParams {
|
|
23
|
+
requirements: string;
|
|
24
|
+
scale?: 'personal' | 'business' | 'enterprise';
|
|
25
|
+
framework?: string;
|
|
26
|
+
outputPath?: string;
|
|
27
|
+
interactive?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface InferSpecificationParams {
|
|
31
|
+
specificationPath: string;
|
|
32
|
+
outputPath?: string;
|
|
33
|
+
framework?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface MaterialiseImplementationParams {
|
|
37
|
+
specificationPath: string;
|
|
38
|
+
framework: string;
|
|
39
|
+
outputPath?: string;
|
|
40
|
+
scale?: 'personal' | 'business' | 'enterprise';
|
|
41
|
+
interactive?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RealizeApplicationParams {
|
|
45
|
+
specificationPath: string;
|
|
46
|
+
framework: string;
|
|
47
|
+
outputPath?: string;
|
|
48
|
+
scale?: 'personal' | 'business' | 'enterprise';
|
|
49
|
+
interactive?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface WorkflowStatusParams {
|
|
53
|
+
sessionId?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class OrchestratorToolsService {
|
|
57
|
+
private orchestratorBridge: OrchestratorBridge;
|
|
58
|
+
private eventEmitter: EventEmitter;
|
|
59
|
+
|
|
60
|
+
constructor(config: OrchestratorToolsConfig) {
|
|
61
|
+
this.orchestratorBridge = config.orchestratorBridge;
|
|
62
|
+
this.eventEmitter = config.eventEmitter;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Analyze existing codebase and extract SpecVerse specifications
|
|
67
|
+
*/
|
|
68
|
+
async analyseCodebase(params: AnalyseCodebaseParams): Promise<string> {
|
|
69
|
+
this.eventEmitter.emit('tool-called', {
|
|
70
|
+
toolName: 'analyse_codebase',
|
|
71
|
+
arguments: params,
|
|
72
|
+
executionTime: 0
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const context: OrchestratorExecutionContext = {
|
|
77
|
+
operation: 'analyse',
|
|
78
|
+
inputPath: params.codePath,
|
|
79
|
+
inputType: 'code',
|
|
80
|
+
outputPath: params.outputPath,
|
|
81
|
+
framework: params.framework,
|
|
82
|
+
interactive: params.interactive || false
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const result = await this.orchestratorBridge.execute(context);
|
|
86
|
+
|
|
87
|
+
if (result.success) {
|
|
88
|
+
const response = {
|
|
89
|
+
operation: 'analyse',
|
|
90
|
+
success: true,
|
|
91
|
+
result: result.content,
|
|
92
|
+
metadata: {
|
|
93
|
+
codePath: params.codePath,
|
|
94
|
+
framework: params.framework || 'auto-detected',
|
|
95
|
+
outputPath: params.outputPath,
|
|
96
|
+
executionTime: result.executionTime,
|
|
97
|
+
provider: result.provider,
|
|
98
|
+
sessionId: result.sessionId
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
if (result.sessionId) {
|
|
103
|
+
response.metadata.sessionId = result.sessionId;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return JSON.stringify(response, null, 2);
|
|
107
|
+
} else {
|
|
108
|
+
const errorResponse = {
|
|
109
|
+
operation: 'analyse',
|
|
110
|
+
success: false,
|
|
111
|
+
error: result.error,
|
|
112
|
+
metadata: {
|
|
113
|
+
codePath: params.codePath,
|
|
114
|
+
executionTime: result.executionTime
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
} catch (error) {
|
|
122
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
123
|
+
|
|
124
|
+
this.eventEmitter.emit('error-occurred', {
|
|
125
|
+
operation: 'analyse_codebase',
|
|
126
|
+
error: errorMessage,
|
|
127
|
+
context: params
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const errorResponse = {
|
|
131
|
+
operation: 'analyse',
|
|
132
|
+
success: false,
|
|
133
|
+
error: errorMessage,
|
|
134
|
+
metadata: {
|
|
135
|
+
codePath: params.codePath
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Create SpecVerse specifications from natural language requirements
|
|
145
|
+
*/
|
|
146
|
+
async createSpecification(params: CreateSpecificationParams): Promise<string> {
|
|
147
|
+
this.eventEmitter.emit('tool-called', {
|
|
148
|
+
toolName: 'create_specification',
|
|
149
|
+
arguments: params,
|
|
150
|
+
executionTime: 0
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
try {
|
|
154
|
+
const context: OrchestratorExecutionContext = {
|
|
155
|
+
operation: 'create',
|
|
156
|
+
input: params.requirements,
|
|
157
|
+
inputType: 'requirements',
|
|
158
|
+
outputPath: params.outputPath,
|
|
159
|
+
framework: params.framework,
|
|
160
|
+
scale: params.scale || 'business',
|
|
161
|
+
interactive: params.interactive || false
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const result = await this.orchestratorBridge.execute(context);
|
|
165
|
+
|
|
166
|
+
if (result.success) {
|
|
167
|
+
const response = {
|
|
168
|
+
operation: 'create',
|
|
169
|
+
success: true,
|
|
170
|
+
result: result.content,
|
|
171
|
+
metadata: {
|
|
172
|
+
requirements: params.requirements,
|
|
173
|
+
scale: params.scale || 'business',
|
|
174
|
+
framework: params.framework,
|
|
175
|
+
outputPath: params.outputPath,
|
|
176
|
+
executionTime: result.executionTime,
|
|
177
|
+
provider: result.provider,
|
|
178
|
+
sessionId: result.sessionId
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
return JSON.stringify(response, null, 2);
|
|
183
|
+
} else {
|
|
184
|
+
const errorResponse = {
|
|
185
|
+
operation: 'create',
|
|
186
|
+
success: false,
|
|
187
|
+
error: result.error,
|
|
188
|
+
metadata: {
|
|
189
|
+
requirements: params.requirements,
|
|
190
|
+
executionTime: result.executionTime
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
} catch (error) {
|
|
198
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
199
|
+
|
|
200
|
+
this.eventEmitter.emit('error-occurred', {
|
|
201
|
+
operation: 'create_specification',
|
|
202
|
+
error: errorMessage,
|
|
203
|
+
context: params
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const errorResponse = {
|
|
207
|
+
operation: 'create',
|
|
208
|
+
success: false,
|
|
209
|
+
error: errorMessage,
|
|
210
|
+
metadata: {
|
|
211
|
+
requirements: params.requirements
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Infer expanded specifications using AI inference engine
|
|
221
|
+
*/
|
|
222
|
+
async inferSpecification(params: InferSpecificationParams): Promise<string> {
|
|
223
|
+
this.eventEmitter.emit('tool-called', {
|
|
224
|
+
toolName: 'infer_specification',
|
|
225
|
+
arguments: params,
|
|
226
|
+
executionTime: 0
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
try {
|
|
230
|
+
// Check if inference is available
|
|
231
|
+
const capabilities = this.orchestratorBridge.getCapabilities();
|
|
232
|
+
if (!capabilities.inferenceEngine) {
|
|
233
|
+
const fallbackResponse = {
|
|
234
|
+
operation: 'infer',
|
|
235
|
+
success: false,
|
|
236
|
+
error: 'Inference operation requires full SpecVerse orchestrator with inference engine',
|
|
237
|
+
suggestion: 'Use get_creation_prompt or get_analysis_prompt tools for AI-assisted specification development',
|
|
238
|
+
metadata: {
|
|
239
|
+
specificationPath: params.specificationPath,
|
|
240
|
+
availableCapabilities: capabilities
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
return JSON.stringify(fallbackResponse, null, 2);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const context: OrchestratorExecutionContext = {
|
|
248
|
+
operation: 'infer',
|
|
249
|
+
inputPath: params.specificationPath,
|
|
250
|
+
inputType: 'specification',
|
|
251
|
+
outputPath: params.outputPath,
|
|
252
|
+
framework: params.framework
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const result = await this.orchestratorBridge.execute(context);
|
|
256
|
+
|
|
257
|
+
if (result.success) {
|
|
258
|
+
const response = {
|
|
259
|
+
operation: 'infer',
|
|
260
|
+
success: true,
|
|
261
|
+
result: result.content,
|
|
262
|
+
metadata: {
|
|
263
|
+
specificationPath: params.specificationPath,
|
|
264
|
+
outputPath: params.outputPath,
|
|
265
|
+
framework: params.framework,
|
|
266
|
+
executionTime: result.executionTime,
|
|
267
|
+
inferenceRules: result.metadata?.inferenceRules,
|
|
268
|
+
provider: result.provider
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
return JSON.stringify(response, null, 2);
|
|
273
|
+
} else {
|
|
274
|
+
const errorResponse = {
|
|
275
|
+
operation: 'infer',
|
|
276
|
+
success: false,
|
|
277
|
+
error: result.error,
|
|
278
|
+
metadata: {
|
|
279
|
+
specificationPath: params.specificationPath,
|
|
280
|
+
executionTime: result.executionTime
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
} catch (error) {
|
|
288
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
289
|
+
|
|
290
|
+
this.eventEmitter.emit('error-occurred', {
|
|
291
|
+
operation: 'infer_specification',
|
|
292
|
+
error: errorMessage,
|
|
293
|
+
context: params
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
const errorResponse = {
|
|
297
|
+
operation: 'infer',
|
|
298
|
+
success: false,
|
|
299
|
+
error: errorMessage,
|
|
300
|
+
metadata: {
|
|
301
|
+
specificationPath: params.specificationPath
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Materialize clean implementation from specifications
|
|
311
|
+
*/
|
|
312
|
+
async materialiseImplementation(params: MaterialiseImplementationParams): Promise<string> {
|
|
313
|
+
this.eventEmitter.emit('tool-called', {
|
|
314
|
+
toolName: 'materialise_implementation',
|
|
315
|
+
arguments: params,
|
|
316
|
+
executionTime: 0
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
try {
|
|
320
|
+
const context: OrchestratorExecutionContext = {
|
|
321
|
+
operation: 'materialise',
|
|
322
|
+
inputPath: params.specificationPath,
|
|
323
|
+
inputType: 'specification',
|
|
324
|
+
outputPath: params.outputPath,
|
|
325
|
+
framework: params.framework,
|
|
326
|
+
scale: params.scale || 'business',
|
|
327
|
+
interactive: params.interactive || false
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
const result = await this.orchestratorBridge.execute(context);
|
|
331
|
+
|
|
332
|
+
if (result.success) {
|
|
333
|
+
const response = {
|
|
334
|
+
operation: 'materialise',
|
|
335
|
+
success: true,
|
|
336
|
+
result: result.content,
|
|
337
|
+
metadata: {
|
|
338
|
+
specificationPath: params.specificationPath,
|
|
339
|
+
framework: params.framework,
|
|
340
|
+
scale: params.scale || 'business',
|
|
341
|
+
outputPath: params.outputPath,
|
|
342
|
+
executionTime: result.executionTime,
|
|
343
|
+
provider: result.provider,
|
|
344
|
+
sessionId: result.sessionId
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
return JSON.stringify(response, null, 2);
|
|
349
|
+
} else {
|
|
350
|
+
const errorResponse = {
|
|
351
|
+
operation: 'materialise',
|
|
352
|
+
success: false,
|
|
353
|
+
error: result.error,
|
|
354
|
+
metadata: {
|
|
355
|
+
specificationPath: params.specificationPath,
|
|
356
|
+
framework: params.framework,
|
|
357
|
+
executionTime: result.executionTime
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
} catch (error) {
|
|
365
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
366
|
+
|
|
367
|
+
this.eventEmitter.emit('error-occurred', {
|
|
368
|
+
operation: 'materialise_implementation',
|
|
369
|
+
error: errorMessage,
|
|
370
|
+
context: params
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
const errorResponse = {
|
|
374
|
+
operation: 'materialise',
|
|
375
|
+
success: false,
|
|
376
|
+
error: errorMessage,
|
|
377
|
+
metadata: {
|
|
378
|
+
specificationPath: params.specificationPath,
|
|
379
|
+
framework: params.framework
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Realize complete application from specifications
|
|
389
|
+
*/
|
|
390
|
+
async realizeApplication(params: RealizeApplicationParams): Promise<string> {
|
|
391
|
+
this.eventEmitter.emit('tool-called', {
|
|
392
|
+
toolName: 'realize_application',
|
|
393
|
+
arguments: params,
|
|
394
|
+
executionTime: 0
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
try {
|
|
398
|
+
const context: OrchestratorExecutionContext = {
|
|
399
|
+
operation: 'realize',
|
|
400
|
+
inputPath: params.specificationPath,
|
|
401
|
+
inputType: 'specification',
|
|
402
|
+
outputPath: params.outputPath,
|
|
403
|
+
framework: params.framework,
|
|
404
|
+
scale: params.scale || 'business',
|
|
405
|
+
interactive: params.interactive || false
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
const result = await this.orchestratorBridge.execute(context);
|
|
409
|
+
|
|
410
|
+
if (result.success) {
|
|
411
|
+
const response = {
|
|
412
|
+
operation: 'realize',
|
|
413
|
+
success: true,
|
|
414
|
+
result: result.content,
|
|
415
|
+
metadata: {
|
|
416
|
+
specificationPath: params.specificationPath,
|
|
417
|
+
framework: params.framework,
|
|
418
|
+
scale: params.scale || 'business',
|
|
419
|
+
outputPath: params.outputPath,
|
|
420
|
+
executionTime: result.executionTime,
|
|
421
|
+
provider: result.provider,
|
|
422
|
+
sessionId: result.sessionId
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
return JSON.stringify(response, null, 2);
|
|
427
|
+
} else {
|
|
428
|
+
const errorResponse = {
|
|
429
|
+
operation: 'realize',
|
|
430
|
+
success: false,
|
|
431
|
+
error: result.error,
|
|
432
|
+
metadata: {
|
|
433
|
+
specificationPath: params.specificationPath,
|
|
434
|
+
framework: params.framework,
|
|
435
|
+
executionTime: result.executionTime
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
} catch (error) {
|
|
443
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
444
|
+
|
|
445
|
+
this.eventEmitter.emit('error-occurred', {
|
|
446
|
+
operation: 'realize_application',
|
|
447
|
+
error: errorMessage,
|
|
448
|
+
context: params
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
const errorResponse = {
|
|
452
|
+
operation: 'realize',
|
|
453
|
+
success: false,
|
|
454
|
+
error: errorMessage,
|
|
455
|
+
metadata: {
|
|
456
|
+
specificationPath: params.specificationPath,
|
|
457
|
+
framework: params.framework
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Get orchestrator workflow status and capabilities
|
|
467
|
+
*/
|
|
468
|
+
async getWorkflowStatus(params: WorkflowStatusParams = {}): Promise<string> {
|
|
469
|
+
this.eventEmitter.emit('tool-called', {
|
|
470
|
+
toolName: 'get_workflow_status',
|
|
471
|
+
arguments: params,
|
|
472
|
+
executionTime: 0
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
try {
|
|
476
|
+
const capabilities = this.orchestratorBridge.getCapabilities();
|
|
477
|
+
const isAvailable = this.orchestratorBridge.isAvailable();
|
|
478
|
+
const supportedOperations = this.orchestratorBridge.getSupportedOperations();
|
|
479
|
+
|
|
480
|
+
const status = {
|
|
481
|
+
orchestratorAvailable: isAvailable,
|
|
482
|
+
capabilities,
|
|
483
|
+
supportedOperations,
|
|
484
|
+
workflowInformation: {
|
|
485
|
+
fullWorkflowSupport: capabilities.hasFullOrchestrator,
|
|
486
|
+
sessionSupport: capabilities.sessionSupport,
|
|
487
|
+
inferenceEngine: capabilities.inferenceEngine,
|
|
488
|
+
workingDirectory: capabilities.workingDirectory,
|
|
489
|
+
...(params.sessionId ? {
|
|
490
|
+
sessionId: params.sessionId,
|
|
491
|
+
sessionStatus: 'Session support requires full orchestrator'
|
|
492
|
+
} : {})
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
const response = {
|
|
497
|
+
operation: 'workflow_status',
|
|
498
|
+
success: true,
|
|
499
|
+
result: status,
|
|
500
|
+
metadata: {
|
|
501
|
+
queryTime: Date.now(),
|
|
502
|
+
hasFullOrchestrator: capabilities.hasFullOrchestrator,
|
|
503
|
+
availableOperations: supportedOperations.length
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
return JSON.stringify(response, null, 2);
|
|
508
|
+
|
|
509
|
+
} catch (error) {
|
|
510
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
511
|
+
|
|
512
|
+
this.eventEmitter.emit('error-occurred', {
|
|
513
|
+
operation: 'get_workflow_status',
|
|
514
|
+
error: errorMessage,
|
|
515
|
+
context: params
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
const errorResponse = {
|
|
519
|
+
operation: 'workflow_status',
|
|
520
|
+
success: false,
|
|
521
|
+
error: errorMessage,
|
|
522
|
+
metadata: {
|
|
523
|
+
queryTime: Date.now()
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
return JSON.stringify(errorResponse, null, 2);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|