@bluefly/openstandardagents 0.2.4
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/.env.example +41 -0
- package/.eslintrc.cjs +43 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +39 -0
- package/.github/dependabot.yml +58 -0
- package/.github/workflows/ci.yml +154 -0
- package/.github/workflows/codeql.yml +41 -0
- package/.github/workflows/dependabot-auto-merge.yml +28 -0
- package/.github/workflows/release.yml +103 -0
- package/.prettierignore +7 -0
- package/.prettierrc.json +10 -0
- package/.redocly.yaml +9 -0
- package/.releaserc.json +84 -0
- package/.releaserc.json.disabled +81 -0
- package/CHANGELOG.md +152 -0
- package/CONTRIBUTING.md +249 -0
- package/LICENSE +190 -0
- package/README.md +280 -0
- package/bin/ossa +8 -0
- package/bin/validate-ossa-0.2.2.ts +244 -0
- package/dist/di-container.d.ts +18 -0
- package/dist/di-container.d.ts.map +1 -0
- package/dist/di-container.js +43 -0
- package/dist/di-container.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/repositories/manifest.repository.d.ts +26 -0
- package/dist/repositories/manifest.repository.d.ts.map +1 -0
- package/dist/repositories/manifest.repository.js +90 -0
- package/dist/repositories/manifest.repository.js.map +1 -0
- package/dist/repositories/schema.repository.d.ts +30 -0
- package/dist/repositories/schema.repository.d.ts.map +1 -0
- package/dist/repositories/schema.repository.js +143 -0
- package/dist/repositories/schema.repository.js.map +1 -0
- package/dist/services/generation.service.d.ts +54 -0
- package/dist/services/generation.service.d.ts.map +1 -0
- package/dist/services/generation.service.js +298 -0
- package/dist/services/generation.service.js.map +1 -0
- package/dist/services/migration.service.d.ts +30 -0
- package/dist/services/migration.service.d.ts.map +1 -0
- package/dist/services/migration.service.js +231 -0
- package/dist/services/migration.service.js.map +1 -0
- package/dist/services/runtime/openai.adapter.d.ts +94 -0
- package/dist/services/runtime/openai.adapter.d.ts.map +1 -0
- package/dist/services/runtime/openai.adapter.js +209 -0
- package/dist/services/runtime/openai.adapter.js.map +1 -0
- package/dist/services/validation.service.d.ts +45 -0
- package/dist/services/validation.service.d.ts.map +1 -0
- package/dist/services/validation.service.js +362 -0
- package/dist/services/validation.service.js.map +1 -0
- package/dist/services/validators/anthropic.validator.d.ts +9 -0
- package/dist/services/validators/anthropic.validator.d.ts.map +1 -0
- package/dist/services/validators/anthropic.validator.js +105 -0
- package/dist/services/validators/anthropic.validator.js.map +1 -0
- package/dist/services/validators/autogen.validator.d.ts +9 -0
- package/dist/services/validators/autogen.validator.d.ts.map +1 -0
- package/dist/services/validators/autogen.validator.js +111 -0
- package/dist/services/validators/autogen.validator.js.map +1 -0
- package/dist/services/validators/crewai.validator.d.ts +9 -0
- package/dist/services/validators/crewai.validator.d.ts.map +1 -0
- package/dist/services/validators/crewai.validator.js +117 -0
- package/dist/services/validators/crewai.validator.js.map +1 -0
- package/dist/services/validators/cursor.validator.d.ts +9 -0
- package/dist/services/validators/cursor.validator.d.ts.map +1 -0
- package/dist/services/validators/cursor.validator.js +88 -0
- package/dist/services/validators/cursor.validator.js.map +1 -0
- package/dist/services/validators/index.d.ts +15 -0
- package/dist/services/validators/index.d.ts.map +1 -0
- package/dist/services/validators/index.js +15 -0
- package/dist/services/validators/index.js.map +1 -0
- package/dist/services/validators/langchain.validator.d.ts +9 -0
- package/dist/services/validators/langchain.validator.d.ts.map +1 -0
- package/dist/services/validators/langchain.validator.js +103 -0
- package/dist/services/validators/langchain.validator.js.map +1 -0
- package/dist/services/validators/langflow.validator.d.ts +9 -0
- package/dist/services/validators/langflow.validator.d.ts.map +1 -0
- package/dist/services/validators/langflow.validator.js +92 -0
- package/dist/services/validators/langflow.validator.js.map +1 -0
- package/dist/services/validators/langgraph.validator.d.ts +9 -0
- package/dist/services/validators/langgraph.validator.d.ts.map +1 -0
- package/dist/services/validators/langgraph.validator.js +123 -0
- package/dist/services/validators/langgraph.validator.js.map +1 -0
- package/dist/services/validators/llamaindex.validator.d.ts +9 -0
- package/dist/services/validators/llamaindex.validator.d.ts.map +1 -0
- package/dist/services/validators/llamaindex.validator.js +121 -0
- package/dist/services/validators/llamaindex.validator.js.map +1 -0
- package/dist/services/validators/openai.validator.d.ts +9 -0
- package/dist/services/validators/openai.validator.d.ts.map +1 -0
- package/dist/services/validators/openai.validator.js +126 -0
- package/dist/services/validators/openai.validator.js.map +1 -0
- package/dist/services/validators/vercel-ai.validator.d.ts +9 -0
- package/dist/services/validators/vercel-ai.validator.d.ts.map +1 -0
- package/dist/services/validators/vercel-ai.validator.js +99 -0
- package/dist/services/validators/vercel-ai.validator.js.map +1 -0
- package/dist/spec/v0.1.9/agent-autonomous-extensions.json +234 -0
- package/dist/spec/v0.1.9/ecosystem-compliance.json +235 -0
- package/dist/spec/v0.1.9/ossa-v0.1.9.schema.json +695 -0
- package/dist/spec/v0.1.9/ossa-v0.1.9.schema.json.backup +695 -0
- package/dist/spec/v0.1.9/reasoning-compliance.json +654 -0
- package/dist/spec/v0.2.2/kagent-enhancements.json +395 -0
- package/dist/spec/v0.2.2/ossa-0.2.2.schema.json +906 -0
- package/dist/spec/v0.2.2/ossa-0.2.2.yaml +448 -0
- package/dist/spec/v0.2.2/ossa-reasoning-compliance-1.0.schema.json +424 -0
- package/dist/spec/v0.2.3/CHANGELOG.md +176 -0
- package/dist/spec/v0.2.3/README.md +154 -0
- package/dist/spec/v0.2.3/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/dist/spec/v0.2.3/ossa-0.2.3.schema.json +1397 -0
- package/dist/spec/v0.2.3/ossa-0.2.3.yaml +448 -0
- package/dist/spec/v0.2.4-dev/CHANGELOG.md +403 -0
- package/dist/spec/v0.2.4-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.4-dev/ossa-0.2.4-dev.schema.json +1696 -0
- package/dist/spec/v0.2.4-dev/ossa-0.2.4-dev.yaml +581 -0
- package/dist/spec/v0.2.5-dev/CHANGELOG.md +171 -0
- package/dist/spec/v0.2.5-dev/examples/customer-support-graph.ossa.yaml +362 -0
- package/dist/spec/v0.2.5-dev/examples/parallel-processors.ossa.yaml +464 -0
- package/dist/spec/v0.2.5-dev/examples/research-team.ossa.yaml +440 -0
- package/dist/spec/v0.2.5-dev/migrations/v0.2.4-to-v0.2.5.md +317 -0
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.schema.json +1732 -0
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.yaml +409 -0
- package/dist/types/index.d.ts +178 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/openapi-extensions.d.ts +164 -0
- package/dist/types/openapi-extensions.d.ts.map +1 -0
- package/dist/types/openapi-extensions.js +6 -0
- package/dist/types/openapi-extensions.js.map +1 -0
- package/docs/OSSA-COMPLIANT-BADGE.md +248 -0
- package/docs/README.md +31 -0
- package/docs/VERSIONING.md +284 -0
- package/docs/agent-openapi-spec.yml +942 -0
- package/docs/getting-started.md +87 -0
- package/docs/migration/general-agent-schema.yml +255 -0
- package/docs/migration/migration-manifest.json +64 -0
- package/docs/openapi-extensions.md +930 -0
- package/docs/schemas/openapi-extensions.schema.json +486 -0
- package/examples/adk-integration/code-review-workflow.yml +136 -0
- package/examples/adk-integration/customer-support.yml +263 -0
- package/examples/adk-integration/data-pipeline.yml +173 -0
- package/examples/advanced/patterns/compliance-context-production.json +53 -0
- package/examples/advanced/patterns/model-router.ts +274 -0
- package/examples/advanced/patterns/smart-model-routing.ts +248 -0
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +232 -0
- package/examples/agent-manifests/critics/critic-agent.yaml +149 -0
- package/examples/agent-manifests/governors/governor-agent.yaml +128 -0
- package/examples/agent-manifests/integrators/integrator-agent.yaml +103 -0
- package/examples/agent-manifests/judges/judge-agent.yaml +153 -0
- package/examples/agent-manifests/monitors/monitor-agent.yaml +122 -0
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +247 -0
- package/examples/agent-manifests/sample-compliant-agent.yaml +147 -0
- package/examples/agent-manifests/workers/worker-agent.yaml +82 -0
- package/examples/anthropic/claude-assistant.ossa.json +45 -0
- package/examples/architecture/model-configuration/ollama-integration.ts +110 -0
- package/examples/autogen/multi-agent.ossa.json +37 -0
- package/examples/bridge-configurations.yaml +346 -0
- package/examples/bridges/Dockerfile.production +87 -0
- package/examples/bridges/__pycache__/aiflow-bridge-enhanced.cpython-313.pyc +0 -0
- package/examples/bridges/__pycache__/aiflow-phoenix-tracing.cpython-313.pyc +0 -0
- package/examples/bridges/__pycache__/test_aiflow_integration.cpython-313.pyc +0 -0
- package/examples/bridges/aiflow-bridge-enhanced.py +462 -0
- package/examples/bridges/aiflow-bridge-example.yml +310 -0
- package/examples/bridges/aiflow-phoenix-tracing.py +310 -0
- package/examples/bridges/aiflow-registration-api.openapi.yml +439 -0
- package/examples/bridges/k8s/configmap.yaml +121 -0
- package/examples/bridges/k8s/deployment-simple.yaml +34 -0
- package/examples/bridges/k8s/deployment.yaml +275 -0
- package/examples/bridges/k8s/hpa.yaml +126 -0
- package/examples/bridges/k8s/ingress.yaml +155 -0
- package/examples/bridges/kagent-bridge-example.yml +94 -0
- package/examples/bridges/load-tests/Dockerfile +28 -0
- package/examples/bridges/load-tests/k6-load-test.js +302 -0
- package/examples/bridges/load-tests/requirements.txt +20 -0
- package/examples/bridges/loadtest/k6-scenarios.js +270 -0
- package/examples/bridges/phase4/SLO-SLA.yaml +249 -0
- package/examples/bridges/phase4/chaos-tests.yaml +226 -0
- package/examples/bridges/requirements.txt +24 -0
- package/examples/bridges/test_aiflow_integration.py +341 -0
- package/examples/common_npm/agent-router.ossa.yaml +182 -0
- package/examples/common_npm/agent-router.v0.2.2.ossa.yaml +60 -0
- package/examples/compliance-agent.yml +155 -0
- package/examples/crewai/research-team.ossa.json +36 -0
- package/examples/cursor/code-review-agent.ossa.json +47 -0
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +609 -0
- package/examples/drupal/gitlab-ml-recommender.v0.2.2.ossa.yaml +68 -0
- package/examples/enterprise/agent.yml +452 -0
- package/examples/extensions/drupal-v1.yml +266 -0
- package/examples/extensions/kagent-v1.yml +167 -0
- package/examples/getting-started/hello-world-complete.ossa.yaml +266 -0
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +376 -0
- package/examples/kagent/README.md +31 -0
- package/examples/kagent/compliance-validator.ossa.yaml +111 -0
- package/examples/kagent/cost-optimizer.ossa.yaml +93 -0
- package/examples/kagent/documentation-agent.ossa.yaml +91 -0
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +269 -0
- package/examples/kagent/k8s-troubleshooter-v1.v0.2.2.ossa.yaml +106 -0
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +257 -0
- package/examples/kagent/security-scanner.ossa.yaml +140 -0
- package/examples/langchain/chain-agent.ossa.json +42 -0
- package/examples/langflow/workflow-agent.ossa.json +39 -0
- package/examples/langgraph/state-machine-agent.ossa.json +59 -0
- package/examples/llamaindex/rag-agent.ossa.json +41 -0
- package/examples/migration-guides/from-langchain-to-ossa.yaml +309 -0
- package/examples/minimal/agent.yml +152 -0
- package/examples/minimal/openapi.yaml +95 -0
- package/examples/openai/swarm-agent.ossa.json +59 -0
- package/examples/openapi-extensions/README.md +87 -0
- package/examples/openapi-extensions/minimal-agent-api.openapi.yml +288 -0
- package/examples/openapi-extensions/orchestrator-agent-api.openapi.yml +633 -0
- package/examples/openapi-extensions/worker-agent-api.openapi.yml +533 -0
- package/examples/production/agent.yml +713 -0
- package/examples/production/document-analyzer-openai.yml +134 -0
- package/examples/quickstart/support-agent.ossa.yaml +59 -0
- package/examples/service-registry-usage.ts +423 -0
- package/examples/spec-examples/audit-agent.yml +147 -0
- package/examples/spec-examples/chat-agent.yml +189 -0
- package/examples/spec-examples/compliance-agent.yml +204 -0
- package/examples/spec-examples/data-processing-agent.yml +132 -0
- package/examples/spec-examples/development-agent.yml +138 -0
- package/examples/spec-examples/edge-agent.yml +101 -0
- package/examples/spec-examples/integration-agent.yml +129 -0
- package/examples/spec-examples/monitoring-agent.yml +130 -0
- package/examples/spec-examples/serverless-agent.yml +82 -0
- package/examples/spec-examples/workflow-agent.yml +223 -0
- package/examples/templates/ossa-compliance.yaml +56 -0
- package/examples/typescript/advanced/demo-registry.ts +168 -0
- package/examples/typescript/mcpb-agent-example.ts +358 -0
- package/examples/vercel/edge-agent.ossa.json +43 -0
- package/infrastructure/docker-compose.yml +33 -0
- package/junit.xml +1 -0
- package/openapi/drupal-agent-api.openapi.yaml +348 -0
- package/openapi/gitlab-orchestrator.openapi.yaml +330 -0
- package/openapi/helm-generator.openapi.yaml +389 -0
- package/openapi/ossa-core-api.openapi.yaml +1448 -0
- package/openapi/ossa-registry-api.openapi.yaml +980 -0
- package/openapi/ossa-registry.openapi.yaml +782 -0
- package/openapi/self-evolving-ecosystem.openapi.yaml +1530 -0
- package/openapi/unified-agent-gateway.openapi.yaml +833 -0
- package/ossa-website-swarm-tasks.json +105 -0
- package/package.json +132 -0
- package/release.config.js +64 -0
- package/spec/v0.1.9/agent-autonomous-extensions.json +234 -0
- package/spec/v0.1.9/ecosystem-compliance.json +235 -0
- package/spec/v0.1.9/ossa-v0.1.9.schema.json +695 -0
- package/spec/v0.1.9/ossa-v0.1.9.schema.json.backup +695 -0
- package/spec/v0.1.9/reasoning-compliance.json +654 -0
- package/spec/v0.2.2/kagent-enhancements.json +395 -0
- package/spec/v0.2.2/ossa-0.2.2.schema.json +906 -0
- package/spec/v0.2.2/ossa-0.2.2.yaml +448 -0
- package/spec/v0.2.2/ossa-reasoning-compliance-1.0.schema.json +424 -0
- package/spec/v0.2.3/CHANGELOG.md +176 -0
- package/spec/v0.2.3/README.md +154 -0
- package/spec/v0.2.3/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/spec/v0.2.3/ossa-0.2.3.schema.json +1397 -0
- package/spec/v0.2.3/ossa-0.2.3.yaml +448 -0
- package/spec/v0.2.4-dev/CHANGELOG.md +403 -0
- package/spec/v0.2.4-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.4-dev/ossa-0.2.4-dev.schema.json +1696 -0
- package/spec/v0.2.4-dev/ossa-0.2.4-dev.yaml +581 -0
- package/spec/v0.2.5-dev/CHANGELOG.md +171 -0
- package/spec/v0.2.5-dev/examples/customer-support-graph.ossa.yaml +362 -0
- package/spec/v0.2.5-dev/examples/parallel-processors.ossa.yaml +464 -0
- package/spec/v0.2.5-dev/examples/research-team.ossa.yaml +440 -0
- package/spec/v0.2.5-dev/migrations/v0.2.4-to-v0.2.5.md +317 -0
- package/spec/v0.2.5-dev/ossa-0.2.5-dev.schema.json +1732 -0
- package/spec/v0.2.5-dev/ossa-0.2.5-dev.yaml +409 -0
- package/test-results.xml +1 -0
- package/website/.lighthouserc.js +20 -0
- package/website/.prettierrc +10 -0
- package/website/Dockerfile +17 -0
- package/website/app/about/page.tsx +295 -0
- package/website/app/api/validate/route.ts +88 -0
- package/website/app/blog/[slug]/page.tsx +167 -0
- package/website/app/blog/page.tsx +162 -0
- package/website/app/docs/[[...slug]]/page.tsx +349 -0
- package/website/app/docs/core-concepts/project-structure/page.tsx +349 -0
- package/website/app/ecosystem/page.tsx +375 -0
- package/website/app/examples/page.tsx +123 -0
- package/website/app/globals.css +108 -0
- package/website/app/layout.tsx +106 -0
- package/website/app/page.tsx +409 -0
- package/website/app/playground/page.tsx +507 -0
- package/website/app/robots.ts +19 -0
- package/website/app/rss.xml/route.ts +74 -0
- package/website/app/schema/page.tsx +970 -0
- package/website/app/sitemap.ts +56 -0
- package/website/app/specification/page.tsx +211 -0
- package/website/components/InstallCommand.tsx +96 -0
- package/website/components/Logo.tsx +24 -0
- package/website/components/StructuredData.tsx +65 -0
- package/website/components/docs/DocsSearch.tsx +104 -0
- package/website/components/docs/DocsSidebar.tsx +118 -0
- package/website/components/docs/MarkdownContent.tsx +183 -0
- package/website/components/docs/VersionSelector.tsx +49 -0
- package/website/components/examples/ExamplesViewer.tsx +293 -0
- package/website/components/layout/Footer.tsx +111 -0
- package/website/components/layout/Header.tsx +170 -0
- package/website/components/schema/SchemaExplorer.tsx +213 -0
- package/website/content/blog/OpenAPI-AI-Agents-Standard.md +285 -0
- package/website/content/blog/Why-Formal-Standards-Matter-Now.md +209 -0
- package/website/content/blog/introducing-ossa-framework.md +328 -0
- package/website/content/blog/ossa-production-results.md +279 -0
- package/website/content/blog/welcome-to-ossa.md +43 -0
- package/website/content/blog/why-ai-agents-need-open-standard.md +98 -0
- package/website/content/docs/00-HOME.md +160 -0
- package/website/content/docs/AIFlow-Framework-Integration-with-OSSA.md +107 -0
- package/website/content/docs/OpenAPI-Extensions.md +498 -0
- package/website/content/docs/architecture/execution-flow.md +335 -0
- package/website/content/docs/architecture/multi-agent-systems.md +737 -0
- package/website/content/docs/architecture/overview.md +121 -0
- package/website/content/docs/architecture/stack-integration.md +461 -0
- package/website/content/docs/changelog.md +246 -0
- package/website/content/docs/contributing.md +599 -0
- package/website/content/docs/core-concepts/project-structure.md +348 -0
- package/website/content/docs/ecosystem/framework-support.md +821 -0
- package/website/content/docs/ecosystem/overview.md +366 -0
- package/website/content/docs/examples/Migration-Guides.md +214 -0
- package/website/content/docs/examples.md +71 -0
- package/website/content/docs/for-audiences/Enterprises.md +256 -0
- package/website/content/docs/for-audiences/Students-Researchers.md +122 -0
- package/website/content/docs/for-audiences/architects.md +224 -0
- package/website/content/docs/for-audiences/developers.md +220 -0
- package/website/content/docs/getting-started/5-minute-overview.md +85 -0
- package/website/content/docs/getting-started/Hello-World.md +184 -0
- package/website/content/docs/getting-started/first-agent.md +196 -0
- package/website/content/docs/getting-started/installation.md +155 -0
- package/website/content/docs/getting-started/running-agents.md +107 -0
- package/website/content/docs/integrations/aiflow.md +104 -0
- package/website/content/docs/integrations/drupal.md +105 -0
- package/website/content/docs/migration-guides/00-index.md +76 -0
- package/website/content/docs/migration-guides/README.md +133 -0
- package/website/content/docs/migration-guides/anthropic-mcp-to-ossa.md +1750 -0
- package/website/content/docs/migration-guides/crewai-to-ossa.md +274 -0
- package/website/content/docs/migration-guides/drupal-eca-to-ossa.md +2017 -0
- package/website/content/docs/migration-guides/index.md +133 -0
- package/website/content/docs/migration-guides/langchain-to-ossa.md +1714 -0
- package/website/content/docs/migration-guides/langflow-to-ossa.md +2075 -0
- package/website/content/docs/migration-guides/openai-to-ossa.md +1202 -0
- package/website/content/docs/openapi-extensions/examples.md +550 -0
- package/website/content/docs/openapi-extensions/index.md +495 -0
- package/website/content/docs/openapi-extensions/operation-extensions.md +398 -0
- package/website/content/docs/openapi-extensions/root-extensions.md +364 -0
- package/website/content/docs/pre-release/index.md +175 -0
- package/website/content/docs/quick-reference.md +17 -0
- package/website/content/docs/schema-reference/agent-spec.md +406 -0
- package/website/content/docs/schema-reference/autonomy.md +568 -0
- package/website/content/docs/schema-reference/constraints.md +543 -0
- package/website/content/docs/schema-reference/index.md +176 -0
- package/website/content/docs/schema-reference/llm-config.md +445 -0
- package/website/content/docs/schema-reference/observability.md +654 -0
- package/website/content/docs/schema-reference/ossa-manifest.md +309 -0
- package/website/content/docs/schema-reference/taxonomy.md +509 -0
- package/website/content/docs/schema-reference/tools.md +628 -0
- package/website/content/docs/templates/blog-post.md +43 -0
- package/website/content/docs/use-cases/00-index.md +395 -0
- package/website/content/docs/use-cases/cicd-code-review.md +1236 -0
- package/website/content/docs/use-cases/customer-support.md +1234 -0
- package/website/content/docs/use-cases/enterprise-compliance.md +1208 -0
- package/website/content/docs/use-cases/research-multi-agent.md +1161 -0
- package/website/lib/version.ts +18 -0
- package/website/next.config.js +17 -0
- package/website/next.config.ts +16 -0
- package/website/nginx.conf +32 -0
- package/website/package-lock.json +9145 -0
- package/website/package.json +53 -0
- package/website/postcss.config.js +7 -0
- package/website/postcss.config.mjs +9 -0
- package/website/scripts/sync-version.js +44 -0
- package/website/scripts/sync-wiki.ts +261 -0
- package/website/tailwind.config.js +58 -0
- package/website/tailwind.config.ts +65 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# OSSA Agent with OpenAI Bridge Configuration Example
|
|
2
|
+
# Document Analyzer Agent - Proof of Concept
|
|
3
|
+
|
|
4
|
+
apiVersion: ossa/v1
|
|
5
|
+
kind: Agent
|
|
6
|
+
metadata:
|
|
7
|
+
name: document-analyzer
|
|
8
|
+
version: "2.1.0"
|
|
9
|
+
description: Production document analysis agent with NLP capabilities
|
|
10
|
+
labels:
|
|
11
|
+
domain: nlp
|
|
12
|
+
type: document-processing
|
|
13
|
+
annotations:
|
|
14
|
+
author: Bluefly.io
|
|
15
|
+
license: MIT
|
|
16
|
+
|
|
17
|
+
spec:
|
|
18
|
+
taxonomy:
|
|
19
|
+
domain: data_processing
|
|
20
|
+
subdomain: nlp
|
|
21
|
+
capability: document_analysis
|
|
22
|
+
|
|
23
|
+
role: |
|
|
24
|
+
You are a document analysis agent specializing in NLP tasks.
|
|
25
|
+
Your capabilities include:
|
|
26
|
+
- Analyzing documents for sentiment and emotional tone
|
|
27
|
+
- Extracting named entities (people, organizations, locations)
|
|
28
|
+
- Generating concise summaries of document content
|
|
29
|
+
- Classifying documents into predefined categories
|
|
30
|
+
|
|
31
|
+
Always provide clear, actionable insights from document analysis.
|
|
32
|
+
|
|
33
|
+
llm:
|
|
34
|
+
provider: openai
|
|
35
|
+
model: gpt-4o-mini
|
|
36
|
+
temperature: 0.3
|
|
37
|
+
maxTokens: 4096
|
|
38
|
+
|
|
39
|
+
tools:
|
|
40
|
+
- type: function
|
|
41
|
+
name: analyze_document
|
|
42
|
+
capabilities: [analyze_document]
|
|
43
|
+
- type: function
|
|
44
|
+
name: extract_text
|
|
45
|
+
capabilities: [extract_text]
|
|
46
|
+
- type: function
|
|
47
|
+
name: summarize_document
|
|
48
|
+
capabilities: [summarize_document]
|
|
49
|
+
- type: function
|
|
50
|
+
name: classify_document
|
|
51
|
+
capabilities: [classify_document]
|
|
52
|
+
|
|
53
|
+
autonomy:
|
|
54
|
+
level: autonomous
|
|
55
|
+
approval_required: false
|
|
56
|
+
|
|
57
|
+
constraints:
|
|
58
|
+
cost:
|
|
59
|
+
maxTokensPerDay: 1000000
|
|
60
|
+
maxCostPerDay: 50.0
|
|
61
|
+
currency: USD
|
|
62
|
+
performance:
|
|
63
|
+
maxLatencySeconds: 30
|
|
64
|
+
maxConcurrentRequests: 10
|
|
65
|
+
timeoutSeconds: 300
|
|
66
|
+
|
|
67
|
+
observability:
|
|
68
|
+
tracing:
|
|
69
|
+
enabled: true
|
|
70
|
+
exporter: otlp
|
|
71
|
+
endpoint: http://jaeger:4317
|
|
72
|
+
metrics:
|
|
73
|
+
enabled: true
|
|
74
|
+
exporter: prometheus
|
|
75
|
+
endpoint: http://prometheus:9090
|
|
76
|
+
logging:
|
|
77
|
+
level: info
|
|
78
|
+
format: json
|
|
79
|
+
|
|
80
|
+
extensions:
|
|
81
|
+
openai_agents:
|
|
82
|
+
enabled: true
|
|
83
|
+
agent_id: document-analyzer
|
|
84
|
+
instructions: |
|
|
85
|
+
You are a document analysis agent specializing in NLP tasks.
|
|
86
|
+
Analyze documents for sentiment, extract named entities, summarize content,
|
|
87
|
+
and classify documents into categories.
|
|
88
|
+
|
|
89
|
+
When analyzing documents:
|
|
90
|
+
1. Extract all named entities (people, organizations, locations)
|
|
91
|
+
2. Determine sentiment (positive, negative, neutral)
|
|
92
|
+
3. Identify key themes and topics
|
|
93
|
+
4. Provide actionable insights
|
|
94
|
+
model: gpt-4o-mini
|
|
95
|
+
|
|
96
|
+
tools_mapping:
|
|
97
|
+
- ossa_capability: analyze_document
|
|
98
|
+
openai_tool_name: analyze_document
|
|
99
|
+
description: Analyze document text for sentiment analysis and entity extraction
|
|
100
|
+
|
|
101
|
+
- ossa_capability: extract_text
|
|
102
|
+
openai_tool_name: extract_text
|
|
103
|
+
description: Extract text from various document formats (PDF, DOCX, TXT, etc.)
|
|
104
|
+
|
|
105
|
+
- ossa_capability: summarize_document
|
|
106
|
+
openai_tool_name: summarize_document
|
|
107
|
+
description: Generate a concise summary of document content
|
|
108
|
+
|
|
109
|
+
- ossa_capability: classify_document
|
|
110
|
+
openai_tool_name: classify_document
|
|
111
|
+
description: Classify document into predefined categories with confidence score
|
|
112
|
+
|
|
113
|
+
guardrails:
|
|
114
|
+
enabled: true
|
|
115
|
+
policies:
|
|
116
|
+
- GDPR
|
|
117
|
+
- HIPAA
|
|
118
|
+
max_tool_calls: 10
|
|
119
|
+
timeout_seconds: 300
|
|
120
|
+
|
|
121
|
+
memory:
|
|
122
|
+
enabled: true
|
|
123
|
+
type: session
|
|
124
|
+
max_messages: 50
|
|
125
|
+
|
|
126
|
+
tracing:
|
|
127
|
+
enabled: true
|
|
128
|
+
provider: langfuse
|
|
129
|
+
|
|
130
|
+
mcp:
|
|
131
|
+
enabled: true
|
|
132
|
+
server_type: stdio
|
|
133
|
+
server_name: document-analyzer-mcp
|
|
134
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# OSSA Quickstart Example - Customer Support Agent
|
|
2
|
+
# Run with: ossa run examples/quickstart/support-agent.ossa.yaml
|
|
3
|
+
|
|
4
|
+
apiVersion: ossa/v0.2.3
|
|
5
|
+
kind: Agent
|
|
6
|
+
|
|
7
|
+
metadata:
|
|
8
|
+
name: support-agent
|
|
9
|
+
version: 1.0.0
|
|
10
|
+
description: A helpful customer support agent that answers questions and helps with orders
|
|
11
|
+
|
|
12
|
+
spec:
|
|
13
|
+
role: |
|
|
14
|
+
You are a friendly and helpful customer support agent for an e-commerce company.
|
|
15
|
+
|
|
16
|
+
Your responsibilities:
|
|
17
|
+
- Answer questions about orders, shipping, and returns
|
|
18
|
+
- Help customers track their packages
|
|
19
|
+
- Provide information about products
|
|
20
|
+
- Escalate complex issues to human agents when needed
|
|
21
|
+
|
|
22
|
+
Always be polite, concise, and helpful. If you don't know something, say so honestly.
|
|
23
|
+
|
|
24
|
+
llm:
|
|
25
|
+
provider: openai
|
|
26
|
+
model: gpt-4o-mini
|
|
27
|
+
temperature: 0.7
|
|
28
|
+
maxTokens: 1000
|
|
29
|
+
|
|
30
|
+
tools:
|
|
31
|
+
- type: function
|
|
32
|
+
name: get_order_status
|
|
33
|
+
capabilities:
|
|
34
|
+
- order_tracking
|
|
35
|
+
|
|
36
|
+
autonomy:
|
|
37
|
+
level: supervised
|
|
38
|
+
approval_required: false
|
|
39
|
+
|
|
40
|
+
observability:
|
|
41
|
+
logging:
|
|
42
|
+
level: info
|
|
43
|
+
format: json
|
|
44
|
+
|
|
45
|
+
extensions:
|
|
46
|
+
openai_agents:
|
|
47
|
+
model: gpt-4o-mini
|
|
48
|
+
tools_mapping:
|
|
49
|
+
- ossa_capability: order_tracking
|
|
50
|
+
openai_tool_name: get_order_status
|
|
51
|
+
description: Get the status of a customer order by order ID
|
|
52
|
+
parameters:
|
|
53
|
+
type: object
|
|
54
|
+
properties:
|
|
55
|
+
order_id:
|
|
56
|
+
type: string
|
|
57
|
+
description: The order ID to look up (e.g., ORD-12345)
|
|
58
|
+
required:
|
|
59
|
+
- order_id
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Service Registry Usage Example
|
|
3
|
+
* Demonstrates how to use the service registry for service discovery and management
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import ServiceRegistry, {
|
|
7
|
+
ServiceDefinition,
|
|
8
|
+
ServiceHealthStatus,
|
|
9
|
+
ServiceCapability,
|
|
10
|
+
DEFAULT_SERVICE_REGISTRY_CONFIG,
|
|
11
|
+
} from '../src/services/ServiceRegistry.js';
|
|
12
|
+
import createRegistryApiRouter, {
|
|
13
|
+
SimpleRedisClient,
|
|
14
|
+
} from '../src/api/registry.js';
|
|
15
|
+
import express from 'express';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Example: Basic Service Registry Usage
|
|
19
|
+
*/
|
|
20
|
+
async function basicRegistryExample() {
|
|
21
|
+
console.log('=== Basic Service Registry Example ===');
|
|
22
|
+
|
|
23
|
+
// Create a Redis client (using simple in-memory client for demo)
|
|
24
|
+
const redisClient = new SimpleRedisClient();
|
|
25
|
+
|
|
26
|
+
// Create service registry with custom configuration
|
|
27
|
+
const config = {
|
|
28
|
+
...DEFAULT_SERVICE_REGISTRY_CONFIG,
|
|
29
|
+
healthCheck: {
|
|
30
|
+
intervalMs: 15000, // Check every 15 seconds
|
|
31
|
+
timeoutMs: 3000, // 3 second timeout
|
|
32
|
+
failureThreshold: 3,
|
|
33
|
+
successThreshold: 2,
|
|
34
|
+
},
|
|
35
|
+
serviceTtlSeconds: 600, // 10 minute TTL
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const registry = new ServiceRegistry(config, redisClient);
|
|
39
|
+
|
|
40
|
+
// Register a service
|
|
41
|
+
const aiService: Omit<ServiceDefinition, 'registeredAt' | 'updatedAt'> = {
|
|
42
|
+
name: 'ai-text-processor',
|
|
43
|
+
endpoint: 'https://ai-service.company.com:8080',
|
|
44
|
+
version: '2.1.0',
|
|
45
|
+
capabilities: [
|
|
46
|
+
{
|
|
47
|
+
name: 'text-analysis',
|
|
48
|
+
version: '2.0.0',
|
|
49
|
+
description: 'Advanced text analysis with sentiment detection',
|
|
50
|
+
inputs: {
|
|
51
|
+
text: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'Text to analyze',
|
|
54
|
+
},
|
|
55
|
+
options: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
description: 'Analysis options',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
outputs: {
|
|
61
|
+
sentiment: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
description: 'Sentiment analysis results',
|
|
64
|
+
},
|
|
65
|
+
entities: {
|
|
66
|
+
type: 'array',
|
|
67
|
+
description: 'Detected entities',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'text-translation',
|
|
73
|
+
version: '1.5.0',
|
|
74
|
+
description: 'Multi-language text translation',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
health: {
|
|
78
|
+
status: ServiceHealthStatus.UNKNOWN,
|
|
79
|
+
lastCheck: new Date(),
|
|
80
|
+
},
|
|
81
|
+
metadata: {
|
|
82
|
+
description: 'High-performance AI text processing service',
|
|
83
|
+
tags: ['ai', 'nlp', 'text-processing', 'production'],
|
|
84
|
+
author: 'AI Engineering Team',
|
|
85
|
+
documentation: 'https://docs.company.com/ai-text-processor',
|
|
86
|
+
environment: 'production',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
console.log('Registering AI service...');
|
|
91
|
+
const registeredService = await registry.register(aiService);
|
|
92
|
+
console.log(
|
|
93
|
+
`✓ Registered: ${registeredService.name} at ${registeredService.endpoint}`
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Register another service
|
|
97
|
+
const dataService: Omit<ServiceDefinition, 'registeredAt' | 'updatedAt'> = {
|
|
98
|
+
name: 'data-processor',
|
|
99
|
+
endpoint: 'https://data-service.company.com:9090',
|
|
100
|
+
version: '3.0.1',
|
|
101
|
+
capabilities: [
|
|
102
|
+
{
|
|
103
|
+
name: 'data-transformation',
|
|
104
|
+
version: '3.0.0',
|
|
105
|
+
description: 'ETL data transformation pipeline',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'data-validation',
|
|
109
|
+
version: '2.1.0',
|
|
110
|
+
description: 'Data quality validation and cleansing',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
health: {
|
|
114
|
+
status: ServiceHealthStatus.HEALTHY,
|
|
115
|
+
lastCheck: new Date(),
|
|
116
|
+
responseTime: 150,
|
|
117
|
+
},
|
|
118
|
+
metadata: {
|
|
119
|
+
description: 'Enterprise data processing pipeline',
|
|
120
|
+
tags: ['data', 'etl', 'processing', 'production'],
|
|
121
|
+
author: 'Data Engineering Team',
|
|
122
|
+
environment: 'production',
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
console.log('Registering Data service...');
|
|
127
|
+
await registry.register(dataService);
|
|
128
|
+
console.log(`✓ Registered: ${dataService.name} at ${dataService.endpoint}`);
|
|
129
|
+
|
|
130
|
+
// Discover all services
|
|
131
|
+
console.log('\n--- Service Discovery ---');
|
|
132
|
+
const allServices = await registry.discover();
|
|
133
|
+
console.log(`Found ${allServices.length} services:`);
|
|
134
|
+
allServices.forEach((service) => {
|
|
135
|
+
console.log(
|
|
136
|
+
` - ${service.name} v${service.version} (${service.health.status})`
|
|
137
|
+
);
|
|
138
|
+
console.log(
|
|
139
|
+
` Capabilities: ${service.capabilities.map((c) => c.name).join(', ')}`
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Discover services by capability
|
|
144
|
+
console.log('\n--- Discover by Capability ---');
|
|
145
|
+
const textServices = await registry.discover({ capability: 'text-analysis' });
|
|
146
|
+
console.log(`Services with text-analysis capability: ${textServices.length}`);
|
|
147
|
+
textServices.forEach((service) => {
|
|
148
|
+
console.log(` - ${service.name}: ${service.endpoint}`);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Discover services by tags
|
|
152
|
+
console.log('\n--- Discover by Tags ---');
|
|
153
|
+
const aiServices = await registry.discover({ tags: ['ai', 'nlp'] });
|
|
154
|
+
console.log(`Services with AI/NLP tags: ${aiServices.length}`);
|
|
155
|
+
aiServices.forEach((service) => {
|
|
156
|
+
console.log(` - ${service.name}: ${service.metadata?.tags?.join(', ')}`);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// Get registry statistics
|
|
160
|
+
console.log('\n--- Registry Statistics ---');
|
|
161
|
+
const stats = await registry.getStats();
|
|
162
|
+
console.log(`Total Services: ${stats.totalServices}`);
|
|
163
|
+
console.log(
|
|
164
|
+
`Healthy: ${stats.healthyServices}, Unhealthy: ${stats.unhealthyServices}`
|
|
165
|
+
);
|
|
166
|
+
console.log(
|
|
167
|
+
`Degraded: ${stats.degradedServices}, Unknown: ${stats.unknownServices}`
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
// Update a service
|
|
171
|
+
console.log('\n--- Service Update ---');
|
|
172
|
+
const updatedService = await registry.updateService('ai-text-processor', {
|
|
173
|
+
version: '2.1.1',
|
|
174
|
+
metadata: {
|
|
175
|
+
...aiService.metadata,
|
|
176
|
+
description: 'Updated AI text processing service with bug fixes',
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
console.log(
|
|
180
|
+
`✓ Updated ${updatedService?.name} to version ${updatedService?.version}`
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
// Clean up
|
|
184
|
+
await registry.close();
|
|
185
|
+
console.log('\n✓ Registry closed');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Example: REST API Server with Service Registry
|
|
190
|
+
*/
|
|
191
|
+
async function apiServerExample() {
|
|
192
|
+
console.log('\n=== REST API Server Example ===');
|
|
193
|
+
|
|
194
|
+
const redisClient = new SimpleRedisClient();
|
|
195
|
+
const registry = new ServiceRegistry(
|
|
196
|
+
DEFAULT_SERVICE_REGISTRY_CONFIG,
|
|
197
|
+
redisClient
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
// Create Express app
|
|
201
|
+
const app = express();
|
|
202
|
+
app.use(express.json());
|
|
203
|
+
|
|
204
|
+
// Add registry API routes
|
|
205
|
+
app.use('/api/v1/registry', createRegistryApiRouter(registry));
|
|
206
|
+
|
|
207
|
+
// Add a simple health check endpoint
|
|
208
|
+
app.get('/health', (req, res) => {
|
|
209
|
+
res.json({
|
|
210
|
+
status: 'healthy',
|
|
211
|
+
timestamp: new Date().toISOString(),
|
|
212
|
+
service: 'ossa-registry-api',
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Start server
|
|
217
|
+
const port = process.env.PORT || 3002;
|
|
218
|
+
const server = app.listen(port, () => {
|
|
219
|
+
console.log(`✓ Registry API server running on port ${port}`);
|
|
220
|
+
console.log(` - Health: http://localhost:${port}/health`);
|
|
221
|
+
console.log(
|
|
222
|
+
` - Registry API: http://localhost:${port}/api/v1/registry/services`
|
|
223
|
+
);
|
|
224
|
+
console.log(
|
|
225
|
+
` - OpenAPI spec available in: src/api/service-registry.openapi.yml`
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// Handle graceful shutdown
|
|
230
|
+
process.on('SIGINT', async () => {
|
|
231
|
+
console.log('\nShutting down server...');
|
|
232
|
+
server.close();
|
|
233
|
+
await registry.close();
|
|
234
|
+
console.log('✓ Server shut down gracefully');
|
|
235
|
+
process.exit(0);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
return { app, server, registry };
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Example: Health Monitoring with Events
|
|
243
|
+
*/
|
|
244
|
+
async function healthMonitoringExample() {
|
|
245
|
+
console.log('\n=== Health Monitoring Example ===');
|
|
246
|
+
|
|
247
|
+
const redisClient = new SimpleRedisClient();
|
|
248
|
+
const config = {
|
|
249
|
+
...DEFAULT_SERVICE_REGISTRY_CONFIG,
|
|
250
|
+
healthCheck: {
|
|
251
|
+
intervalMs: 5000, // Fast for demo
|
|
252
|
+
timeoutMs: 1000,
|
|
253
|
+
failureThreshold: 2,
|
|
254
|
+
successThreshold: 1,
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const registry = new ServiceRegistry(config, redisClient);
|
|
259
|
+
|
|
260
|
+
// Set up event listeners
|
|
261
|
+
registry.on('service:registered', (service) => {
|
|
262
|
+
console.log(`🎯 Service registered: ${service.name}`);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
registry.on('service:health:changed', (serviceName, oldStatus, newStatus) => {
|
|
266
|
+
console.log(
|
|
267
|
+
`🏥 Health changed: ${serviceName} ${oldStatus} → ${newStatus}`
|
|
268
|
+
);
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
registry.on('service:unregistered', (serviceName) => {
|
|
272
|
+
console.log(`👋 Service unregistered: ${serviceName}`);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
registry.on('registry:error', (error) => {
|
|
276
|
+
console.error(`❌ Registry error: ${error.message}`);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
// Register a test service
|
|
280
|
+
await registry.register({
|
|
281
|
+
name: 'test-health-service',
|
|
282
|
+
endpoint: 'https://test.example.com',
|
|
283
|
+
version: '1.0.0',
|
|
284
|
+
capabilities: [
|
|
285
|
+
{
|
|
286
|
+
name: 'test-capability',
|
|
287
|
+
version: '1.0.0',
|
|
288
|
+
description: 'Test capability',
|
|
289
|
+
},
|
|
290
|
+
],
|
|
291
|
+
health: {
|
|
292
|
+
status: ServiceHealthStatus.UNKNOWN,
|
|
293
|
+
lastCheck: new Date(),
|
|
294
|
+
},
|
|
295
|
+
metadata: {
|
|
296
|
+
description: 'Test service for health monitoring',
|
|
297
|
+
tags: ['test'],
|
|
298
|
+
environment: 'development',
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// Start health monitoring
|
|
303
|
+
console.log('Starting health monitoring...');
|
|
304
|
+
await registry.startHealthMonitoring();
|
|
305
|
+
|
|
306
|
+
// Simulate running for a while then cleanup
|
|
307
|
+
setTimeout(async () => {
|
|
308
|
+
console.log('Stopping health monitoring...');
|
|
309
|
+
registry.stopHealthMonitoring();
|
|
310
|
+
await registry.unregister('test-health-service');
|
|
311
|
+
await registry.close();
|
|
312
|
+
console.log('✓ Health monitoring example completed');
|
|
313
|
+
}, 15000);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Example: Service Capability Discovery
|
|
318
|
+
*/
|
|
319
|
+
async function capabilityDiscoveryExample() {
|
|
320
|
+
console.log('\n=== Capability Discovery Example ===');
|
|
321
|
+
|
|
322
|
+
const redisClient = new SimpleRedisClient();
|
|
323
|
+
const registry = new ServiceRegistry(
|
|
324
|
+
DEFAULT_SERVICE_REGISTRY_CONFIG,
|
|
325
|
+
redisClient
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
// Register services with various capabilities
|
|
329
|
+
const services = [
|
|
330
|
+
{
|
|
331
|
+
name: 'nlp-service-a',
|
|
332
|
+
capabilities: ['text-analysis', 'sentiment-detection'],
|
|
333
|
+
tags: ['ai', 'nlp'],
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'nlp-service-b',
|
|
337
|
+
capabilities: ['text-analysis', 'entity-extraction'],
|
|
338
|
+
tags: ['ai', 'nlp'],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'vision-service',
|
|
342
|
+
capabilities: ['image-recognition', 'object-detection'],
|
|
343
|
+
tags: ['ai', 'vision'],
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: 'data-service',
|
|
347
|
+
capabilities: ['data-transformation', 'data-validation'],
|
|
348
|
+
tags: ['data', 'etl'],
|
|
349
|
+
},
|
|
350
|
+
];
|
|
351
|
+
|
|
352
|
+
for (const serviceInfo of services) {
|
|
353
|
+
await registry.register({
|
|
354
|
+
name: serviceInfo.name,
|
|
355
|
+
endpoint: `https://${serviceInfo.name}.example.com`,
|
|
356
|
+
version: '1.0.0',
|
|
357
|
+
capabilities: serviceInfo.capabilities.map((cap) => ({
|
|
358
|
+
name: cap,
|
|
359
|
+
version: '1.0.0',
|
|
360
|
+
description: `${cap} capability`,
|
|
361
|
+
})),
|
|
362
|
+
health: {
|
|
363
|
+
status: ServiceHealthStatus.HEALTHY,
|
|
364
|
+
lastCheck: new Date(),
|
|
365
|
+
},
|
|
366
|
+
metadata: {
|
|
367
|
+
tags: serviceInfo.tags,
|
|
368
|
+
environment: 'production',
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Discover services by different criteria
|
|
374
|
+
console.log('Services with text-analysis capability:');
|
|
375
|
+
const textServices = await registry.discover({ capability: 'text-analysis' });
|
|
376
|
+
textServices.forEach((s) => console.log(` - ${s.name}`));
|
|
377
|
+
|
|
378
|
+
console.log('\nServices with AI tag:');
|
|
379
|
+
const aiServices = await registry.discover({ tags: ['ai'] });
|
|
380
|
+
aiServices.forEach((s) =>
|
|
381
|
+
console.log(` - ${s.name}: ${s.metadata?.tags?.join(', ')}`)
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
console.log('\nHealthy production services:');
|
|
385
|
+
const healthyServices = await registry.discover({
|
|
386
|
+
healthStatus: ServiceHealthStatus.HEALTHY,
|
|
387
|
+
environment: 'production',
|
|
388
|
+
});
|
|
389
|
+
healthyServices.forEach((s) =>
|
|
390
|
+
console.log(` - ${s.name} (${s.capabilities.length} capabilities)`)
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
await registry.close();
|
|
394
|
+
console.log('✓ Capability discovery example completed');
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Run examples
|
|
398
|
+
async function runExamples() {
|
|
399
|
+
try {
|
|
400
|
+
await basicRegistryExample();
|
|
401
|
+
await capabilityDiscoveryExample();
|
|
402
|
+
|
|
403
|
+
// Uncomment to run health monitoring example (runs for 15 seconds)
|
|
404
|
+
// await healthMonitoringExample();
|
|
405
|
+
|
|
406
|
+
// Uncomment to start the API server (runs until Ctrl+C)
|
|
407
|
+
// await apiServerExample();
|
|
408
|
+
} catch (error) {
|
|
409
|
+
console.error('Error running examples:', error);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Run if this file is executed directly
|
|
414
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
415
|
+
runExamples();
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export {
|
|
419
|
+
basicRegistryExample,
|
|
420
|
+
apiServerExample,
|
|
421
|
+
healthMonitoringExample,
|
|
422
|
+
capabilityDiscoveryExample,
|
|
423
|
+
};
|