@bluefly/openstandardagents 0.3.1 → 0.3.2
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/.devfile.yaml +87 -0
- package/.gitlab-ci-trigger +1 -0
- package/.wiki-config.json +24 -0
- package/CHANGELOG.md +212 -1
- package/README.md +31 -56
- package/dist/adapters/anthropic/runtime.js +2 -2
- package/dist/adapters/anthropic/runtime.js.map +1 -1
- package/dist/bot/architecture-validator-bot.d.ts +8 -0
- package/dist/bot/architecture-validator-bot.d.ts.map +1 -0
- package/dist/bot/architecture-validator-bot.js +15 -0
- package/dist/bot/architecture-validator-bot.js.map +1 -0
- package/dist/bot/ci-pipeline-bot.d.ts +7 -0
- package/dist/bot/ci-pipeline-bot.d.ts.map +1 -0
- package/dist/bot/ci-pipeline-bot.js +7 -0
- package/dist/bot/ci-pipeline-bot.js.map +1 -0
- package/dist/bot/compliance-bot.d.ts +56 -0
- package/dist/bot/compliance-bot.d.ts.map +1 -0
- package/dist/bot/compliance-bot.js +203 -0
- package/dist/bot/compliance-bot.js.map +1 -0
- package/dist/bot/dependency-updater-bot.d.ts +9 -0
- package/dist/bot/dependency-updater-bot.d.ts.map +1 -0
- package/dist/bot/dependency-updater-bot.js +9 -0
- package/dist/bot/dependency-updater-bot.js.map +1 -0
- package/dist/bot/security-scanner-bot.d.ts +11 -0
- package/dist/bot/security-scanner-bot.d.ts.map +1 -0
- package/dist/bot/security-scanner-bot.js +21 -0
- package/dist/bot/security-scanner-bot.js.map +1 -0
- package/dist/cli/commands/agent-card.command.d.ts +11 -0
- package/dist/cli/commands/agent-card.command.d.ts.map +1 -0
- package/dist/cli/commands/agent-card.command.js +285 -0
- package/dist/cli/commands/agent-card.command.js.map +1 -0
- package/dist/cli/commands/agents.command.d.ts +11 -0
- package/dist/cli/commands/agents.command.d.ts.map +1 -0
- package/dist/cli/commands/agents.command.js +326 -0
- package/dist/cli/commands/agents.command.js.map +1 -0
- package/dist/cli/commands/generate.command.d.ts +13 -2
- package/dist/cli/commands/generate.command.d.ts.map +1 -1
- package/dist/cli/commands/generate.command.js +204 -29
- package/dist/cli/commands/generate.command.js.map +1 -1
- package/dist/cli/commands/registry.command.d.ts +14 -0
- package/dist/cli/commands/registry.command.d.ts.map +1 -0
- package/dist/cli/commands/registry.command.js +428 -0
- package/dist/cli/commands/registry.command.js.map +1 -0
- package/dist/cli/commands/workspace.command.d.ts +14 -0
- package/dist/cli/commands/workspace.command.d.ts.map +1 -0
- package/dist/cli/commands/workspace.command.js +467 -0
- package/dist/cli/commands/workspace.command.js.map +1 -0
- package/dist/cli/index.js +9 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/di-container.d.ts.map +1 -1
- package/dist/di-container.js +20 -0
- package/dist/di-container.js.map +1 -1
- package/dist/services/codegen/codegen.service.d.ts +75 -0
- package/dist/services/codegen/codegen.service.d.ts.map +1 -0
- package/dist/services/codegen/codegen.service.js +136 -0
- package/dist/services/codegen/codegen.service.js.map +1 -0
- package/dist/services/codegen/generators/manifest.generator.d.ts +41 -0
- package/dist/services/codegen/generators/manifest.generator.d.ts.map +1 -0
- package/dist/services/codegen/generators/manifest.generator.js +178 -0
- package/dist/services/codegen/generators/manifest.generator.js.map +1 -0
- package/dist/services/codegen/generators/openapi.generator.d.ts +46 -0
- package/dist/services/codegen/generators/openapi.generator.d.ts.map +1 -0
- package/dist/services/codegen/generators/openapi.generator.js +157 -0
- package/dist/services/codegen/generators/openapi.generator.js.map +1 -0
- package/dist/services/codegen/generators/types.generator.d.ts +27 -0
- package/dist/services/codegen/generators/types.generator.d.ts.map +1 -0
- package/dist/services/codegen/generators/types.generator.js +97 -0
- package/dist/services/codegen/generators/types.generator.js.map +1 -0
- package/dist/services/codegen/generators/vscode.generator.d.ts +43 -0
- package/dist/services/codegen/generators/vscode.generator.d.ts.map +1 -0
- package/dist/services/codegen/generators/vscode.generator.js +163 -0
- package/dist/services/codegen/generators/vscode.generator.js.map +1 -0
- package/dist/services/codegen/generators/zod.generator.d.ts +31 -0
- package/dist/services/codegen/generators/zod.generator.d.ts.map +1 -0
- package/dist/services/codegen/generators/zod.generator.js +134 -0
- package/dist/services/codegen/generators/zod.generator.js.map +1 -0
- package/dist/services/codegen/index.d.ts +33 -0
- package/dist/services/codegen/index.d.ts.map +1 -0
- package/dist/services/codegen/index.js +36 -0
- package/dist/services/codegen/index.js.map +1 -0
- package/dist/spec/extensions/openapi/ossa-openapi-extensions.schema.json +804 -0
- package/dist/spec/v0.3.0/examples/drupal-content-writer.ossa.yaml +1 -1
- package/dist/spec/v0.3.0/examples/drupal-moderation-assistant.ossa.yaml +1 -1
- package/dist/spec/v0.3.0/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +1 -1
- package/dist/spec/v0.3.0/runtime-bindings/anthropic.yaml +209 -0
- package/dist/spec/v0.3.1/examples/agent-with-identity.ossa.yaml +68 -0
- package/dist/spec/v0.3.1/examples/drupal-content-writer.ossa.yaml +1 -1
- package/dist/spec/v0.3.1/examples/drupal-moderation-assistant.ossa.yaml +1 -1
- package/dist/spec/v0.3.1/examples/multi-provider-identity.ossa.yaml +236 -0
- package/dist/spec/v0.3.1/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +1 -1
- package/dist/spec/v0.3.1/extensions/agent-identity.yaml +594 -0
- package/dist/spec/v0.3.1/ossa-0.3.1.schema.json +300 -21
- package/dist/spec/v0.3.2/MIGRATION-v0.3.1-to-v0.3.2.md +293 -0
- package/dist/spec/v0.3.2/UNIFIED-SCHEMA.md +120 -0
- package/dist/spec/v0.3.2/access_tiers.yaml +375 -0
- package/dist/spec/v0.3.2/adapters/drupal.md +541 -0
- package/dist/spec/v0.3.2/adapters/symfony.md +659 -0
- package/dist/spec/v0.3.2/agent-test.schema.json +75 -0
- package/dist/spec/v0.3.2/examples/access-tiers/README.md +106 -0
- package/dist/spec/v0.3.2/examples/access-tiers/code-critic.ossa.yaml +119 -0
- package/dist/spec/v0.3.2/examples/access-tiers/compliance-governor.ossa.yaml +234 -0
- package/dist/spec/v0.3.2/examples/access-tiers/deployment-operator.ossa.yaml +201 -0
- package/dist/spec/v0.3.2/examples/access-tiers/doc-generator.ossa.yaml +117 -0
- package/dist/spec/v0.3.2/examples/access-tiers/security-scanner.ossa.yaml +133 -0
- package/dist/spec/v0.3.2/examples/agent-with-identity.ossa.yaml +68 -0
- package/dist/spec/v0.3.2/examples/drupal-content-writer.ossa.yaml +110 -0
- package/dist/spec/v0.3.2/examples/drupal-moderation-assistant.ossa.yaml +96 -0
- package/dist/spec/v0.3.2/examples/multi-provider-identity.ossa.yaml +236 -0
- package/dist/spec/v0.3.2/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +144 -0
- package/dist/spec/v0.3.2/examples/tasks/data-transform.ossa.yaml +147 -0
- package/dist/spec/v0.3.2/examples/tasks/publish-content.ossa.yaml +125 -0
- package/dist/spec/v0.3.2/examples/workflows/content-publishing.ossa.yaml +190 -0
- package/dist/spec/v0.3.2/examples/workflows/deployment-pipeline.ossa.yaml +247 -0
- package/dist/spec/v0.3.2/extensions/agent-identity.yaml +594 -0
- package/dist/spec/v0.3.2/extensions/drupal.md +417 -0
- package/dist/spec/v0.3.2/infrastructure/service-ports.yaml +324 -0
- package/dist/spec/{v0.3.1/ossa-0.3.0.schema.json → v0.3.2/ossa-0.3.2.schema.json} +563 -34
- package/dist/spec/v0.3.2/protocols/delegation.yaml +239 -0
- package/dist/spec/v0.3.2/protocols/sse.md +494 -0
- package/dist/spec/v0.3.2/protocols/webrtc.md +600 -0
- package/dist/spec/v0.3.2/protocols/websocket.md +362 -0
- package/dist/spec/v0.3.2/runtime/RUNTIME.md +457 -0
- package/dist/spec/v0.3.2/runtime/memory-model.yaml +871 -0
- package/dist/spec/v0.3.2/runtime/runtime.yaml +926 -0
- package/dist/spec/v0.3.2/schemas/agent-unified.yaml +165 -0
- package/dist/spec/v0.3.2/schemas/capabilities.yaml +102 -0
- package/dist/spec/v0.3.2/schemas/functions.yaml +75 -0
- package/dist/spec/v0.3.2/schemas/messaging/channel.schema.json +245 -0
- package/dist/spec/v0.3.2/schemas/messaging/delivery-receipt.schema.json +192 -0
- package/dist/spec/v0.3.2/schemas/messaging/message.schema.json +205 -0
- package/dist/spec/v0.3.2/schemas/messaging/subscription.schema.json +214 -0
- package/dist/spec/v0.3.2/schemas/runtime.yaml +102 -0
- package/dist/spec/v0.3.2/schemas/taxonomy.yaml +533 -0
- package/dist/spec/v0.3.2/schemas/unified-llm.yaml +91 -0
- package/dist/spec/v0.3.2/taxonomy.yaml +363 -0
- package/dist/types/generated/ossa-0.3.2.types.d.ts +367 -0
- package/dist/types/generated/ossa-0.3.2.types.d.ts.map +1 -0
- package/dist/types/generated/ossa-0.3.2.types.js +10 -0
- package/dist/types/generated/ossa-0.3.2.types.js.map +1 -0
- package/dist/types/generated/ossa-0.3.2.zod.d.ts +36 -0
- package/dist/types/generated/ossa-0.3.2.zod.d.ts.map +1 -0
- package/dist/types/generated/ossa-0.3.2.zod.js +25 -0
- package/dist/types/generated/ossa-0.3.2.zod.js.map +1 -0
- package/examples/adapters/drupal-eca-mapping.yaml +1 -1
- package/examples/adapters/drupal-eca-task.yaml +1 -1
- package/examples/adapters/drupal-flowdrop-mapping.yaml +1 -1
- package/examples/adapters/drupal-maestro-mapping.yaml +1 -1
- package/examples/adapters/mistral-agent.yaml +1 -1
- package/examples/adapters/symfony-messenger-task.yaml +1 -1
- package/examples/adapters/symfony-messenger-workflow.yaml +1 -1
- package/examples/adk-integration/code-review-workflow.yml +1 -1
- package/examples/adk-integration/customer-support.yml +1 -1
- package/examples/adk-integration/data-pipeline.yml +1 -1
- package/examples/advanced/reasoning-agent.yaml +1 -1
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
- package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
- package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
- package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
- package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
- package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
- package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
- package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
- package/examples/agents/architecture-healer-enterprise.yaml +1 -1
- package/examples/agents/dependency-healer-npm.yaml +1 -1
- package/examples/agents/spec-healer-openapi.yaml +1 -1
- package/examples/agents/wiki-healer-production.yaml +1 -1
- package/examples/agents-md/code-agent.ossa.json +36 -11
- package/examples/agents-md/monorepo-agent.ossa.yaml +1 -1
- package/examples/anthropic/claude-assistant.ossa.json +4 -4
- package/examples/autogen/multi-agent.ossa.json +2 -2
- package/examples/autonomous-evolution/self-evolving-agent.ossa.yaml +1 -1
- package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
- package/examples/claude-code/ossa-validator.ossa.yaml +1 -1
- package/examples/common_npm/agent-router.ossa.yaml +1 -1
- package/examples/contracts/data-consumer.ossa.yaml +1 -1
- package/examples/contracts/data-producer-v2.ossa.yaml +1 -1
- package/examples/contracts/data-producer.ossa.yaml +1 -1
- package/examples/crewai/research-team.ossa.json +2 -2
- package/examples/cursor/code-review-agent.ossa.json +2 -2
- package/examples/drupal/ai_agents_ossa-module/.agents/example-agent/agent.ossa.yaml +1 -1
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +1 -1
- package/examples/extensions/agents-md-advanced.yml +1 -1
- package/examples/extensions/agents-md-basic.yml +1 -1
- package/examples/extensions/agents-md-sync.yml +1 -1
- package/examples/extensions/agents-md-v1.yml +1 -1
- package/examples/extensions/drupal-v1.yml +1 -1
- package/examples/extensions/encryption-multi-provider.yaml +4 -4
- package/examples/extensions/kagent-v1.yml +1 -1
- package/examples/extensions/knowledge-sources.yaml +1 -1
- package/examples/extensions/mcp-full-featured.yaml +1 -1
- package/examples/getting-started/01-minimal-agent.ossa.yaml +3 -3
- package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
- package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
- package/examples/getting-started/04-agent-with-messaging.ossa.yaml +2 -2
- package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +4 -4
- package/examples/kagent/compliance-validator.ossa.yaml +1 -1
- package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
- package/examples/kagent/documentation-agent.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
- package/examples/kagent/security-scanner.ossa.yaml +1 -1
- package/examples/langchain/chain-agent.ossa.json +2 -2
- package/examples/langflow/workflow-agent.ossa.json +2 -2
- package/examples/langgraph/state-machine-agent.ossa.json +2 -2
- package/examples/llamaindex/rag-agent.ossa.json +2 -2
- package/examples/messaging/dependency-healer.ossa.yaml +1 -1
- package/examples/messaging/incident-responder.ossa.yaml +1 -1
- package/examples/messaging/routing-rules.ossa.yaml +3 -3
- package/examples/messaging/security-scanner.ossa.yaml +1 -1
- package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
- package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
- package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
- package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
- package/examples/observability/activity-stream-full.yaml +1 -1
- package/examples/openai/basic-agent.ossa.yaml +1 -1
- package/examples/openai/multi-tool-agent.ossa.json +2 -2
- package/examples/openai/swarm-agent.ossa.json +2 -2
- package/examples/production/document-analyzer-openai.yml +1 -1
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/real-world/gitlab-cicd-optimizer.ossa.yaml +1 -1
- package/examples/real-world/rag-documentation-assistant.ossa.yaml +1 -1
- package/examples/runtime-adapters/bedrock-claude-example.ossa.yaml +1 -1
- package/examples/schema/reusable-components.yaml +1 -1
- package/examples/showcase/ci-pipeline.ossa.yaml +59 -0
- package/examples/showcase/code-assistant.ossa.yaml +118 -0
- package/examples/showcase/code-reviewer.ossa.yaml +61 -0
- package/examples/showcase/compliance-validator.ossa.yaml +62 -0
- package/examples/showcase/content-writer.ossa.yaml +67 -0
- package/examples/showcase/data-transformer.ossa.yaml +78 -0
- package/examples/showcase/doc-generator.ossa.yaml +68 -0
- package/examples/showcase/security-scanner.ossa.yaml +65 -0
- package/examples/showcase/test-generator.ossa.yaml +63 -0
- package/examples/showcase/workflow-orchestrator.ossa.yaml +129 -0
- package/examples/tasks/batch-email-sender.yaml +1 -1
- package/examples/tasks/data-transform.yaml +1 -1
- package/examples/tasks/publish-content.yaml +1 -1
- package/examples/templates/ossa-compliance.yaml +1 -1
- package/examples/unified/security-scanner.ossa.yaml +1 -1
- package/examples/vercel/edge-agent.ossa.json +2 -2
- package/examples/workflows/batch-email-campaign.yaml +1 -1
- package/examples/workflows/content-review-publish.yaml +1 -1
- package/examples/workflows/simple-etl.yaml +1 -1
- package/llms-ctx-full.txt +39 -0
- package/llms-ctx.txt +39 -0
- package/openapi/agent-communication.yaml +1 -1
- package/openapi/agent-crud.yaml +8 -8
- package/openapi/agent-discovery.yaml +2 -2
- package/openapi/agent-identity.yaml +8 -8
- package/openapi/cli-commands.openapi.yaml +231 -0
- package/openapi/core/ossa-core-api.openapi.yaml +1 -1
- package/openapi/core/ossa-registry-api.openapi.yaml +1 -1
- package/openapi/core/ossa-registry.openapi.yaml +1 -1
- package/openapi/core/unified-agent-gateway.openapi.yaml +1 -1
- package/openapi/github-sync.yaml +1 -1
- package/openapi/protocols/sse-streams.yaml +1 -1
- package/openapi/protocols/websocket-events.yaml +2 -2
- package/openapi/reference-implementations/aiflow-bridge-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/compliance-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/crewai-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/critic-agent-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/document-analyzer-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/drupal-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/getting-started-hello-world-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/gitlab-ml-recommender-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/governor-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/helm-generator.openapi.yaml +1 -1
- package/openapi/reference-implementations/integrator-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/judge-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/k8s-troubleshooter-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/langchain-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/monitor-agent-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/orchestrator-agent-api.openapi.yaml +1 -1
- package/openapi/reference-implementations/quickstart-support-agent-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/self-evolving-ecosystem.openapi.yaml +1 -1
- package/openapi/reference-implementations/worker-agent-api.openapi.yaml +2 -2
- package/openapi/reference-implementations/workflow-orchestrator-api.openapi.yaml +1 -1
- package/package.json +13 -3
- package/spec/extensions/openapi/ossa-openapi-extensions.schema.json +804 -0
- package/spec/v0.3.0/examples/drupal-content-writer.ossa.yaml +1 -1
- package/spec/v0.3.0/examples/drupal-moderation-assistant.ossa.yaml +1 -1
- package/spec/v0.3.0/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +1 -1
- package/spec/v0.3.0/runtime-bindings/anthropic.yaml +209 -0
- package/spec/v0.3.1/examples/agent-with-identity.ossa.yaml +68 -0
- package/spec/v0.3.1/examples/drupal-content-writer.ossa.yaml +1 -1
- package/spec/v0.3.1/examples/drupal-moderation-assistant.ossa.yaml +1 -1
- package/spec/v0.3.1/examples/multi-provider-identity.ossa.yaml +236 -0
- package/spec/v0.3.1/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +1 -1
- package/spec/v0.3.1/extensions/agent-identity.yaml +594 -0
- package/spec/v0.3.1/ossa-0.3.1.schema.json +300 -21
- package/spec/v0.3.2/MIGRATION-v0.3.1-to-v0.3.2.md +293 -0
- package/spec/v0.3.2/UNIFIED-SCHEMA.md +120 -0
- package/spec/v0.3.2/access_tiers.yaml +375 -0
- package/spec/v0.3.2/adapters/drupal.md +541 -0
- package/spec/v0.3.2/adapters/symfony.md +659 -0
- package/spec/v0.3.2/agent-test.schema.json +75 -0
- package/spec/v0.3.2/examples/access-tiers/README.md +106 -0
- package/spec/v0.3.2/examples/access-tiers/code-critic.ossa.yaml +119 -0
- package/spec/v0.3.2/examples/access-tiers/compliance-governor.ossa.yaml +234 -0
- package/spec/v0.3.2/examples/access-tiers/deployment-operator.ossa.yaml +201 -0
- package/spec/v0.3.2/examples/access-tiers/doc-generator.ossa.yaml +117 -0
- package/spec/v0.3.2/examples/access-tiers/security-scanner.ossa.yaml +133 -0
- package/spec/v0.3.2/examples/agent-with-identity.ossa.yaml +68 -0
- package/spec/v0.3.2/examples/drupal-content-writer.ossa.yaml +110 -0
- package/spec/v0.3.2/examples/drupal-moderation-assistant.ossa.yaml +96 -0
- package/spec/v0.3.2/examples/multi-provider-identity.ossa.yaml +236 -0
- package/spec/v0.3.2/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +144 -0
- package/spec/v0.3.2/examples/tasks/data-transform.ossa.yaml +147 -0
- package/spec/v0.3.2/examples/tasks/publish-content.ossa.yaml +125 -0
- package/spec/v0.3.2/examples/workflows/content-publishing.ossa.yaml +190 -0
- package/spec/v0.3.2/examples/workflows/deployment-pipeline.ossa.yaml +247 -0
- package/spec/v0.3.2/extensions/agent-identity.yaml +594 -0
- package/spec/v0.3.2/extensions/drupal.md +417 -0
- package/spec/v0.3.2/infrastructure/service-ports.yaml +324 -0
- package/spec/{v0.3.1/ossa-0.3.0.schema.json → v0.3.2/ossa-0.3.2.schema.json} +563 -34
- package/spec/v0.3.2/protocols/delegation.yaml +239 -0
- package/spec/v0.3.2/protocols/sse.md +494 -0
- package/spec/v0.3.2/protocols/webrtc.md +600 -0
- package/spec/v0.3.2/protocols/websocket.md +362 -0
- package/spec/v0.3.2/runtime/RUNTIME.md +457 -0
- package/spec/v0.3.2/runtime/memory-model.yaml +871 -0
- package/spec/v0.3.2/runtime/runtime.yaml +926 -0
- package/spec/v0.3.2/schemas/agent-unified.yaml +165 -0
- package/spec/v0.3.2/schemas/capabilities.yaml +102 -0
- package/spec/v0.3.2/schemas/functions.yaml +75 -0
- package/spec/v0.3.2/schemas/messaging/channel.schema.json +245 -0
- package/spec/v0.3.2/schemas/messaging/delivery-receipt.schema.json +192 -0
- package/spec/v0.3.2/schemas/messaging/message.schema.json +205 -0
- package/spec/v0.3.2/schemas/messaging/subscription.schema.json +214 -0
- package/spec/v0.3.2/schemas/runtime.yaml +102 -0
- package/spec/v0.3.2/schemas/taxonomy.yaml +533 -0
- package/spec/v0.3.2/schemas/unified-llm.yaml +91 -0
- package/spec/v0.3.2/taxonomy.yaml +363 -0
- package/examples/common_npm/agent-router.v0.2.2.ossa.yaml +0 -60
- package/examples/drupal/gitlab-ml-recommender.v0.2.2.ossa.yaml +0 -68
- package/examples/kagent/k8s-troubleshooter-v1.v0.2.2.ossa.yaml +0 -106
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Agent Card Command - A2A Protocol Discovery
|
|
3
|
+
*
|
|
4
|
+
* Subcommands:
|
|
5
|
+
* ossa agent-card generate - Generate agent-card.json from manifest
|
|
6
|
+
* ossa agent-card validate - Validate agent-card.json
|
|
7
|
+
* ossa agent-card serve - Serve agent card at /.well-known/agent-card.json
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import * as fs from 'fs';
|
|
12
|
+
import * as path from 'path';
|
|
13
|
+
import * as yaml from 'yaml';
|
|
14
|
+
import { glob } from 'glob';
|
|
15
|
+
import { getVersion } from '../../utils/version.js';
|
|
16
|
+
export const agentCardCommand = new Command('agent-card')
|
|
17
|
+
.description('Manage A2A Protocol agent cards for discovery');
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Subcommand: agent-card generate
|
|
20
|
+
// ============================================================================
|
|
21
|
+
agentCardCommand
|
|
22
|
+
.command('generate [manifest]')
|
|
23
|
+
.description('Generate agent-card.json from OSSA manifest')
|
|
24
|
+
.option('-o, --output <file>', 'Output file path', '.agents/agent-card.json')
|
|
25
|
+
.option('--url <url>', 'Agent URL for A2A protocol')
|
|
26
|
+
.option('--provider <org>', 'Provider organization name')
|
|
27
|
+
.option('--provider-url <url>', 'Provider URL')
|
|
28
|
+
.action(async (manifestArg, options) => {
|
|
29
|
+
try {
|
|
30
|
+
// Find manifest
|
|
31
|
+
let manifestPath = manifestArg;
|
|
32
|
+
if (!manifestPath) {
|
|
33
|
+
const patterns = [
|
|
34
|
+
'.agents/manifest.ossa.yaml',
|
|
35
|
+
'.agents/*.ossa.yaml',
|
|
36
|
+
'agent.ossa.yaml',
|
|
37
|
+
'*.ossa.yaml',
|
|
38
|
+
];
|
|
39
|
+
for (const pattern of patterns) {
|
|
40
|
+
const matches = await glob(pattern, { cwd: process.cwd() });
|
|
41
|
+
if (matches.length > 0) {
|
|
42
|
+
manifestPath = matches[0];
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!manifestPath || !fs.existsSync(manifestPath)) {
|
|
48
|
+
console.log(chalk.red('✗ No OSSA manifest found'));
|
|
49
|
+
console.log(chalk.gray(' Provide manifest path or run in directory with .agents/'));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
console.log(chalk.blue(`Generating agent card from: ${manifestPath}`));
|
|
53
|
+
const content = fs.readFileSync(manifestPath, 'utf-8');
|
|
54
|
+
const manifest = yaml.parse(content);
|
|
55
|
+
if (!manifest?.metadata?.name) {
|
|
56
|
+
console.log(chalk.red('✗ Invalid manifest: missing metadata.name'));
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
// Build A2A AgentCard
|
|
60
|
+
const agentCard = {
|
|
61
|
+
protocolVersion: '1.0',
|
|
62
|
+
name: manifest.metadata.name,
|
|
63
|
+
description: manifest.metadata.description || `${manifest.metadata.name} - OSSA Agent`,
|
|
64
|
+
url: options?.url || `https://agents.example.com/${manifest.metadata.name}`,
|
|
65
|
+
version: manifest.metadata.version || getVersion(),
|
|
66
|
+
capabilities: {
|
|
67
|
+
streaming: manifest.spec?.capabilities?.streaming ?? true,
|
|
68
|
+
pushNotifications: manifest.spec?.capabilities?.pushNotifications ?? false,
|
|
69
|
+
stateTransitionHistory: manifest.spec?.capabilities?.stateTransitionHistory ?? true,
|
|
70
|
+
},
|
|
71
|
+
skills: [],
|
|
72
|
+
securitySchemes: {
|
|
73
|
+
bearer: {
|
|
74
|
+
type: 'http',
|
|
75
|
+
scheme: 'bearer',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
security: [{ bearer: [] }],
|
|
79
|
+
};
|
|
80
|
+
// Add provider
|
|
81
|
+
if (options?.provider || manifest.spec?.identity?.provider) {
|
|
82
|
+
agentCard.provider = {
|
|
83
|
+
organization: options?.provider || manifest.spec?.identity?.provider?.organization || 'Unknown',
|
|
84
|
+
url: options?.providerUrl || manifest.spec?.identity?.provider?.url || 'https://example.com',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// Add documentation URL
|
|
88
|
+
if (manifest.metadata?.annotations?.['ossa.dev/documentation'] || manifest.spec?.identity?.documentationUrl) {
|
|
89
|
+
agentCard.documentationUrl =
|
|
90
|
+
manifest.metadata?.annotations?.['ossa.dev/documentation'] ||
|
|
91
|
+
manifest.spec?.identity?.documentationUrl;
|
|
92
|
+
}
|
|
93
|
+
// Convert capabilities to skills
|
|
94
|
+
if (manifest.spec?.capabilities) {
|
|
95
|
+
for (const cap of manifest.spec.capabilities) {
|
|
96
|
+
const skill = typeof cap === 'string'
|
|
97
|
+
? {
|
|
98
|
+
id: cap.replace(/\./g, '-'),
|
|
99
|
+
name: cap.split('.').pop() || cap,
|
|
100
|
+
description: `${cap} capability`,
|
|
101
|
+
tags: cap.split('.'),
|
|
102
|
+
examples: [],
|
|
103
|
+
}
|
|
104
|
+
: {
|
|
105
|
+
id: cap.name?.replace(/\./g, '-') || 'unknown',
|
|
106
|
+
name: cap.name || 'Unknown',
|
|
107
|
+
description: cap.description || '',
|
|
108
|
+
tags: cap.tags || [],
|
|
109
|
+
examples: cap.examples || [],
|
|
110
|
+
inputModes: cap.inputModes,
|
|
111
|
+
outputModes: cap.outputModes,
|
|
112
|
+
};
|
|
113
|
+
agentCard.skills.push(skill);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Convert manifest skills
|
|
117
|
+
if (manifest.spec?.skills) {
|
|
118
|
+
for (const skill of manifest.spec.skills) {
|
|
119
|
+
agentCard.skills.push({
|
|
120
|
+
id: skill.id || skill.name?.toLowerCase().replace(/\s+/g, '-'),
|
|
121
|
+
name: skill.name,
|
|
122
|
+
description: skill.description || '',
|
|
123
|
+
tags: skill.tags || [],
|
|
124
|
+
examples: skill.examples || [],
|
|
125
|
+
inputModes: skill.inputModes,
|
|
126
|
+
outputModes: skill.outputModes,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Add supported interfaces
|
|
131
|
+
if (manifest.spec?.interfaces) {
|
|
132
|
+
agentCard.supportedInterfaces = manifest.spec.interfaces.map((iface) => ({
|
|
133
|
+
url: iface.url,
|
|
134
|
+
binding: iface.binding,
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
agentCard.supportedInterfaces = [
|
|
139
|
+
{
|
|
140
|
+
url: agentCard.url,
|
|
141
|
+
binding: 'jsonrpc',
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
// Ensure output directory exists
|
|
146
|
+
const outputPath = options?.output || '.agents/agent-card.json';
|
|
147
|
+
const outputDir = path.dirname(outputPath);
|
|
148
|
+
if (!fs.existsSync(outputDir)) {
|
|
149
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
150
|
+
}
|
|
151
|
+
// Write agent card
|
|
152
|
+
fs.writeFileSync(outputPath, JSON.stringify(agentCard, null, 2));
|
|
153
|
+
console.log(chalk.green(`✓ Agent card generated: ${outputPath}`));
|
|
154
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
155
|
+
console.log(chalk.gray(` Name: ${agentCard.name}`));
|
|
156
|
+
console.log(chalk.gray(` Version: ${agentCard.version}`));
|
|
157
|
+
console.log(chalk.gray(` Skills: ${agentCard.skills.length}`));
|
|
158
|
+
console.log('');
|
|
159
|
+
console.log(chalk.blue('A2A Discovery:'));
|
|
160
|
+
console.log(chalk.gray(` Serve at: GET /.well-known/agent-card.json`));
|
|
161
|
+
process.exit(0);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.error(chalk.red('Error:'), error instanceof Error ? error.message : String(error));
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
// ============================================================================
|
|
169
|
+
// Subcommand: agent-card validate
|
|
170
|
+
// ============================================================================
|
|
171
|
+
agentCardCommand
|
|
172
|
+
.command('validate [file]')
|
|
173
|
+
.description('Validate agent-card.json')
|
|
174
|
+
.action(async (file) => {
|
|
175
|
+
try {
|
|
176
|
+
const cardPath = file || '.agents/agent-card.json';
|
|
177
|
+
if (!fs.existsSync(cardPath)) {
|
|
178
|
+
console.log(chalk.red(`✗ Agent card not found: ${cardPath}`));
|
|
179
|
+
console.log(chalk.gray(' Run `ossa agent-card generate` first'));
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
console.log(chalk.blue(`Validating: ${cardPath}`));
|
|
183
|
+
const content = fs.readFileSync(cardPath, 'utf-8');
|
|
184
|
+
const card = JSON.parse(content);
|
|
185
|
+
const errors = [];
|
|
186
|
+
const warnings = [];
|
|
187
|
+
// Required fields
|
|
188
|
+
if (!card.protocolVersion)
|
|
189
|
+
errors.push('Missing: protocolVersion');
|
|
190
|
+
if (!card.name)
|
|
191
|
+
errors.push('Missing: name');
|
|
192
|
+
if (!card.description)
|
|
193
|
+
errors.push('Missing: description');
|
|
194
|
+
if (!card.url)
|
|
195
|
+
errors.push('Missing: url');
|
|
196
|
+
if (!card.version)
|
|
197
|
+
errors.push('Missing: version');
|
|
198
|
+
if (!card.capabilities)
|
|
199
|
+
errors.push('Missing: capabilities');
|
|
200
|
+
// Validate capabilities
|
|
201
|
+
if (card.capabilities) {
|
|
202
|
+
if (typeof card.capabilities.streaming !== 'boolean') {
|
|
203
|
+
warnings.push('capabilities.streaming should be boolean');
|
|
204
|
+
}
|
|
205
|
+
if (typeof card.capabilities.pushNotifications !== 'boolean') {
|
|
206
|
+
warnings.push('capabilities.pushNotifications should be boolean');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Validate skills
|
|
210
|
+
if (!card.skills || !Array.isArray(card.skills)) {
|
|
211
|
+
errors.push('Missing or invalid: skills (must be array)');
|
|
212
|
+
}
|
|
213
|
+
else if (card.skills.length === 0) {
|
|
214
|
+
warnings.push('No skills defined');
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
for (const skill of card.skills) {
|
|
218
|
+
if (!skill.id)
|
|
219
|
+
errors.push(`Skill missing id`);
|
|
220
|
+
if (!skill.name)
|
|
221
|
+
errors.push(`Skill missing name`);
|
|
222
|
+
if (!skill.description)
|
|
223
|
+
warnings.push(`Skill "${skill.id}" missing description`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Validate security
|
|
227
|
+
if (!card.securitySchemes) {
|
|
228
|
+
warnings.push('No security schemes defined');
|
|
229
|
+
}
|
|
230
|
+
// Output results
|
|
231
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
232
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
233
|
+
console.log(chalk.green('✓ Agent card is valid'));
|
|
234
|
+
console.log('');
|
|
235
|
+
console.log(` Name: ${chalk.cyan(card.name)}`);
|
|
236
|
+
console.log(` Version: ${card.version}`);
|
|
237
|
+
console.log(` Skills: ${card.skills?.length || 0}`);
|
|
238
|
+
console.log(` URL: ${card.url}`);
|
|
239
|
+
process.exit(0);
|
|
240
|
+
}
|
|
241
|
+
if (errors.length > 0) {
|
|
242
|
+
console.log(chalk.red(`\n✗ Errors (${errors.length}):`));
|
|
243
|
+
errors.forEach(e => console.log(` ${chalk.red('•')} ${e}`));
|
|
244
|
+
}
|
|
245
|
+
if (warnings.length > 0) {
|
|
246
|
+
console.log(chalk.yellow(`\n⚠ Warnings (${warnings.length}):`));
|
|
247
|
+
warnings.forEach(w => console.log(` ${chalk.yellow('•')} ${w}`));
|
|
248
|
+
}
|
|
249
|
+
process.exit(errors.length > 0 ? 1 : 0);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
console.error(chalk.red('Error:'), error instanceof Error ? error.message : String(error));
|
|
253
|
+
process.exit(1);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
// ============================================================================
|
|
257
|
+
// Subcommand: agent-card show
|
|
258
|
+
// ============================================================================
|
|
259
|
+
agentCardCommand
|
|
260
|
+
.command('show [file]')
|
|
261
|
+
.description('Display agent card contents')
|
|
262
|
+
.option('--yaml', 'Output as YAML')
|
|
263
|
+
.action(async (file, options) => {
|
|
264
|
+
try {
|
|
265
|
+
const cardPath = file || '.agents/agent-card.json';
|
|
266
|
+
if (!fs.existsSync(cardPath)) {
|
|
267
|
+
console.log(chalk.red(`✗ Agent card not found: ${cardPath}`));
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
const content = fs.readFileSync(cardPath, 'utf-8');
|
|
271
|
+
const card = JSON.parse(content);
|
|
272
|
+
if (options?.yaml) {
|
|
273
|
+
console.log(yaml.stringify(card));
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
console.log(JSON.stringify(card, null, 2));
|
|
277
|
+
}
|
|
278
|
+
process.exit(0);
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
console.error(chalk.red('Error:'), error instanceof Error ? error.message : String(error));
|
|
282
|
+
process.exit(1);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
//# sourceMappingURL=agent-card.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-card.command.js","sourceRoot":"","sources":["../../../src/cli/commands/agent-card.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAwCpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC;KACtD,WAAW,CAAC,+CAA+C,CAAC,CAAC;AAEhE,+EAA+E;AAC/E,kCAAkC;AAClC,+EAA+E;AAC/E,gBAAgB;KACb,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,yBAAyB,CAAC;KAC5E,MAAM,CAAC,aAAa,EAAE,4BAA4B,CAAC;KACnD,MAAM,CAAC,kBAAkB,EAAE,4BAA4B,CAAC;KACxD,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,WAAoB,EAAE,OAAgC,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,gBAAgB;QAChB,IAAI,YAAY,GAAG,WAA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AAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEjC,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Agent CRUD Commands
|
|
3
|
+
* Complete Create, Read, Update, Delete operations for agents
|
|
4
|
+
* Follows DRY, SOLID, Zod, OpenAPI, and CRUD principles
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
/**
|
|
8
|
+
* Agent CRUD Command Group
|
|
9
|
+
*/
|
|
10
|
+
export declare const agentsCommandGroup: Command;
|
|
11
|
+
//# sourceMappingURL=agents.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agents.command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC;;GAEG;AACH,eAAO,MAAM,kBAAkB,SACuB,CAAC"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Agent CRUD Commands
|
|
3
|
+
* Complete Create, Read, Update, Delete operations for agents
|
|
4
|
+
* Follows DRY, SOLID, Zod, OpenAPI, and CRUD principles
|
|
5
|
+
*/
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { container } from '../../di-container.js';
|
|
10
|
+
import { ManifestRepository } from '../../repositories/manifest.repository.js';
|
|
11
|
+
import { ValidationService } from '../../services/validation.service.js';
|
|
12
|
+
import { RegistryService } from '../../services/registry/registry.service.js';
|
|
13
|
+
/**
|
|
14
|
+
* Zod Schemas for CLI Input Validation
|
|
15
|
+
*/
|
|
16
|
+
const AgentIdSchema = z.string().min(1).max(100).regex(/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/);
|
|
17
|
+
const AgentVersionSchema = z.string().regex(/^\d+\.\d+\.\d+(-[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)?(\+[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)?$/);
|
|
18
|
+
const AgentPathSchema = z.string().min(1);
|
|
19
|
+
const AgentUpdateSchema = z.object({
|
|
20
|
+
description: z.string().optional(),
|
|
21
|
+
labels: z.record(z.string(), z.string()).optional(),
|
|
22
|
+
llm: z.object({
|
|
23
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
24
|
+
maxTokens: z.number().min(1).max(200000).optional(),
|
|
25
|
+
}).optional(),
|
|
26
|
+
}).partial();
|
|
27
|
+
/**
|
|
28
|
+
* Agent CRUD Command Group
|
|
29
|
+
*/
|
|
30
|
+
export const agentsCommandGroup = new Command('agents')
|
|
31
|
+
.description('Manage OSSA agents (CRUD operations)');
|
|
32
|
+
/**
|
|
33
|
+
* Create Agent Command
|
|
34
|
+
* POST /agents
|
|
35
|
+
*/
|
|
36
|
+
agentsCommandGroup
|
|
37
|
+
.command('create')
|
|
38
|
+
.alias('add')
|
|
39
|
+
.argument('<path>', 'Path to OSSA agent manifest file')
|
|
40
|
+
.option('--registry <url>', 'Registry URL', 'gitlab')
|
|
41
|
+
.option('--token <token>', 'Authentication token')
|
|
42
|
+
.option('--dry-run', 'Validate without creating')
|
|
43
|
+
.description('Create/register a new agent')
|
|
44
|
+
.action(async (path, options) => {
|
|
45
|
+
try {
|
|
46
|
+
const validatedPath = AgentPathSchema.parse(path);
|
|
47
|
+
const manifestRepo = container.get(ManifestRepository);
|
|
48
|
+
const validationService = container.get(ValidationService);
|
|
49
|
+
console.log(chalk.blue(`Loading agent manifest: ${validatedPath}`));
|
|
50
|
+
const manifest = await manifestRepo.load(validatedPath);
|
|
51
|
+
const result = await validationService.validate(manifest);
|
|
52
|
+
if (!result.valid) {
|
|
53
|
+
console.error(chalk.red('✗ Validation failed'));
|
|
54
|
+
result.errors.forEach((error) => console.error(chalk.red(` - ${error}`)));
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
const agent = result.manifest;
|
|
58
|
+
if (!agent.metadata) {
|
|
59
|
+
console.error(chalk.red('✗ Invalid manifest: missing metadata'));
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
const agentName = agent.metadata.name;
|
|
63
|
+
const agentVersion = agent.metadata.version || '1.0.0';
|
|
64
|
+
AgentIdSchema.parse(agentName);
|
|
65
|
+
AgentVersionSchema.parse(agentVersion);
|
|
66
|
+
console.log(chalk.green(`✓ Validated: ${agentName}@${agentVersion}`));
|
|
67
|
+
if (options.dryRun) {
|
|
68
|
+
console.log(chalk.yellow('\n[DRY RUN] Would create agent:'));
|
|
69
|
+
console.log(` Name: ${agentName}`);
|
|
70
|
+
console.log(` Version: ${agentVersion}`);
|
|
71
|
+
console.log(` Registry: ${options.registry || 'gitlab'}`);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const token = options.token || process.env.GITLAB_TOKEN || process.env.GITLAB_PRIVATE_TOKEN;
|
|
75
|
+
if (!token) {
|
|
76
|
+
console.error(chalk.red('✗ Authentication token required'));
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
const registryService = new RegistryService({
|
|
80
|
+
type: (options.registry || 'gitlab'),
|
|
81
|
+
token,
|
|
82
|
+
});
|
|
83
|
+
await registryService.publish(validatedPath, agentName, agentVersion);
|
|
84
|
+
console.log(chalk.green(`\n✓ Agent created successfully: ${agentName}@${agentVersion}`));
|
|
85
|
+
console.log(chalk.gray(` Registry: ${options.registry || 'gitlab'}`));
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
if (error instanceof z.ZodError) {
|
|
89
|
+
console.error(chalk.red('✗ Validation error:'));
|
|
90
|
+
error.issues.forEach((issue) => {
|
|
91
|
+
console.error(chalk.red(` - ${issue.path.join('.')}: ${issue.message}`));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.error(chalk.red('✗ Failed to create agent:'), error instanceof Error ? error.message : String(error));
|
|
96
|
+
}
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Read Agent Command (List)
|
|
102
|
+
* GET /agents
|
|
103
|
+
*/
|
|
104
|
+
agentsCommandGroup
|
|
105
|
+
.command('list')
|
|
106
|
+
.alias('ls')
|
|
107
|
+
.option('--search <query>', 'Search query')
|
|
108
|
+
.option('--limit <number>', 'Maximum results', '20')
|
|
109
|
+
.option('--type <type>', 'Filter by agent type')
|
|
110
|
+
.option('--status <status>', 'Filter by status')
|
|
111
|
+
.option('--domain <domain>', 'Filter by domain')
|
|
112
|
+
.description('List all agents')
|
|
113
|
+
.action(async (options) => {
|
|
114
|
+
try {
|
|
115
|
+
const limit = z.coerce.number().int().min(1).max(100).parse(options.limit || '20');
|
|
116
|
+
const searchQuery = options.search || '';
|
|
117
|
+
const token = process.env.GITLAB_TOKEN || process.env.GITLAB_PRIVATE_TOKEN;
|
|
118
|
+
if (!token) {
|
|
119
|
+
console.error(chalk.red('✗ GITLAB_TOKEN required'));
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
const registryService = new RegistryService({
|
|
123
|
+
type: 'gitlab',
|
|
124
|
+
token,
|
|
125
|
+
});
|
|
126
|
+
console.log(chalk.blue(`Searching agents${searchQuery ? `: "${searchQuery}"` : ''}...`));
|
|
127
|
+
const agents = await registryService.search(searchQuery, limit);
|
|
128
|
+
if (agents.length === 0) {
|
|
129
|
+
console.log(chalk.yellow(`No agents found${searchQuery ? ` matching "${searchQuery}"` : ''}`));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
console.log(chalk.green(`\nFound ${agents.length} agent(s):\n`));
|
|
133
|
+
agents.forEach((agent) => {
|
|
134
|
+
console.log(chalk.cyan(` ${agent.name}@${agent.version}`));
|
|
135
|
+
if (agent.description) {
|
|
136
|
+
console.log(chalk.gray(` ${agent.description.substring(0, 100)}...`));
|
|
137
|
+
}
|
|
138
|
+
console.log(chalk.gray(` Published: ${new Date(agent.publishedAt).toLocaleDateString()}\n`));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
if (error instanceof z.ZodError) {
|
|
143
|
+
console.error(chalk.red('✗ Validation error:'));
|
|
144
|
+
error.issues.forEach((issue) => {
|
|
145
|
+
console.error(chalk.red(` - ${issue.path.join('.')}: ${issue.message}`));
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
console.error(chalk.red('✗ Failed to list agents:'), error instanceof Error ? error.message : String(error));
|
|
150
|
+
}
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* Read Agent Command (Get by ID)
|
|
156
|
+
* GET /agents/{id}
|
|
157
|
+
*/
|
|
158
|
+
agentsCommandGroup
|
|
159
|
+
.command('get')
|
|
160
|
+
.alias('show')
|
|
161
|
+
.argument('<agent>', 'Agent identifier (name or name@version)')
|
|
162
|
+
.description('Get detailed information about an agent')
|
|
163
|
+
.action(async (agent) => {
|
|
164
|
+
try {
|
|
165
|
+
const parts = agent.split('@');
|
|
166
|
+
const agentName = parts.length > 1 ? parts.slice(0, -1).join('@') : parts[0];
|
|
167
|
+
const version = parts.length > 1 ? parts[parts.length - 1] : 'latest';
|
|
168
|
+
AgentIdSchema.parse(agentName);
|
|
169
|
+
if (version !== 'latest') {
|
|
170
|
+
AgentVersionSchema.parse(version);
|
|
171
|
+
}
|
|
172
|
+
const token = process.env.GITLAB_TOKEN || process.env.GITLAB_PRIVATE_TOKEN;
|
|
173
|
+
if (!token) {
|
|
174
|
+
console.error(chalk.red('✗ GITLAB_TOKEN required'));
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
const registryService = new RegistryService({
|
|
178
|
+
type: 'gitlab',
|
|
179
|
+
token,
|
|
180
|
+
});
|
|
181
|
+
console.log(chalk.blue(`\nFetching info for ${agentName}@${version}...\n`));
|
|
182
|
+
const agentInfo = await registryService.getInfo(agentName, version);
|
|
183
|
+
console.log(chalk.cyan.bold('Agent Information\n'));
|
|
184
|
+
console.log(chalk.white(` Name: ${agentInfo.name}`));
|
|
185
|
+
console.log(chalk.white(` Version: ${agentInfo.version}`));
|
|
186
|
+
console.log(chalk.white(` Tag: ${agentInfo.tag}`));
|
|
187
|
+
console.log(chalk.white(` Published: ${new Date(agentInfo.publishedAt).toLocaleString()}`));
|
|
188
|
+
if (agentInfo.description) {
|
|
189
|
+
console.log(chalk.white(`\n Description:\n ${agentInfo.description.replace(/\n/g, '\n ')}`));
|
|
190
|
+
}
|
|
191
|
+
console.log('');
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
if (error instanceof z.ZodError) {
|
|
195
|
+
console.error(chalk.red('✗ Validation error:'));
|
|
196
|
+
error.issues.forEach((issue) => {
|
|
197
|
+
console.error(chalk.red(` - ${issue.path.join('.')}: ${issue.message}`));
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
console.error(chalk.red('✗ Failed to get agent:'), error instanceof Error ? error.message : String(error));
|
|
202
|
+
}
|
|
203
|
+
process.exit(1);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
/**
|
|
207
|
+
* Update Agent Command
|
|
208
|
+
* PUT /agents/{id}
|
|
209
|
+
*/
|
|
210
|
+
agentsCommandGroup
|
|
211
|
+
.command('update')
|
|
212
|
+
.alias('edit')
|
|
213
|
+
.argument('<agent>', 'Agent identifier (name@version)')
|
|
214
|
+
.option('--description <desc>', 'Update description')
|
|
215
|
+
.option('--label <key=value>', 'Add or update label (can be used multiple times)', [])
|
|
216
|
+
.option('--temperature <num>', 'Update LLM temperature', parseFloat)
|
|
217
|
+
.option('--max-tokens <num>', 'Update LLM max tokens', parseInt)
|
|
218
|
+
.option('--dry-run', 'Preview changes without updating')
|
|
219
|
+
.description('Update an existing agent')
|
|
220
|
+
.action(async (agent, options) => {
|
|
221
|
+
try {
|
|
222
|
+
const parts = agent.split('@');
|
|
223
|
+
if (parts.length !== 2) {
|
|
224
|
+
throw new Error('Agent identifier must be in format: name@version');
|
|
225
|
+
}
|
|
226
|
+
const agentName = parts[0];
|
|
227
|
+
const version = parts[1];
|
|
228
|
+
AgentIdSchema.parse(agentName);
|
|
229
|
+
AgentVersionSchema.parse(version);
|
|
230
|
+
const updatePayload = {};
|
|
231
|
+
if (options.description) {
|
|
232
|
+
updatePayload.description = options.description;
|
|
233
|
+
}
|
|
234
|
+
if (options.label && options.label.length > 0) {
|
|
235
|
+
updatePayload.labels = {};
|
|
236
|
+
options.label.forEach((label) => {
|
|
237
|
+
const [key, value] = label.split('=');
|
|
238
|
+
if (!key || !value) {
|
|
239
|
+
throw new Error(`Invalid label format: ${label}. Use key=value`);
|
|
240
|
+
}
|
|
241
|
+
updatePayload.labels[key] = value;
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
if (options.temperature !== undefined || options.maxTokens !== undefined) {
|
|
245
|
+
updatePayload.llm = {};
|
|
246
|
+
if (options.temperature !== undefined) {
|
|
247
|
+
updatePayload.llm.temperature = options.temperature;
|
|
248
|
+
}
|
|
249
|
+
if (options.maxTokens !== undefined) {
|
|
250
|
+
updatePayload.llm.maxTokens = options.maxTokens;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const validated = AgentUpdateSchema.parse(updatePayload);
|
|
254
|
+
if (options.dryRun) {
|
|
255
|
+
console.log(chalk.yellow('\n[DRY RUN] Would update agent:'));
|
|
256
|
+
console.log(` Agent: ${agentName}@${version}`);
|
|
257
|
+
console.log(` Changes:`, JSON.stringify(validated, null, 2));
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
console.log(chalk.blue(`Updating agent: ${agentName}@${version}`));
|
|
261
|
+
console.log(chalk.yellow('⚠️ Update functionality requires API implementation'));
|
|
262
|
+
console.log(chalk.gray(' Validated update payload:'), JSON.stringify(validated, null, 2));
|
|
263
|
+
console.log(chalk.green(`\n✓ Update validated (API implementation pending)`));
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
if (error instanceof z.ZodError) {
|
|
267
|
+
console.error(chalk.red('✗ Validation error:'));
|
|
268
|
+
error.issues.forEach((issue) => {
|
|
269
|
+
console.error(chalk.red(` - ${issue.path.join('.')}: ${issue.message}`));
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
console.error(chalk.red('✗ Failed to update agent:'), error instanceof Error ? error.message : String(error));
|
|
274
|
+
}
|
|
275
|
+
process.exit(1);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
/**
|
|
279
|
+
* Delete Agent Command
|
|
280
|
+
* DELETE /agents/{id}
|
|
281
|
+
*/
|
|
282
|
+
agentsCommandGroup
|
|
283
|
+
.command('delete')
|
|
284
|
+
.alias('remove')
|
|
285
|
+
.alias('rm')
|
|
286
|
+
.argument('<agent>', 'Agent identifier (name@version)')
|
|
287
|
+
.option('--force', 'Force deletion without confirmation')
|
|
288
|
+
.option('--dry-run', 'Preview deletion without deleting')
|
|
289
|
+
.description('Delete an agent')
|
|
290
|
+
.action(async (agent, options) => {
|
|
291
|
+
try {
|
|
292
|
+
const parts = agent.split('@');
|
|
293
|
+
if (parts.length !== 2) {
|
|
294
|
+
throw new Error('Agent identifier must be in format: name@version');
|
|
295
|
+
}
|
|
296
|
+
const agentName = parts[0];
|
|
297
|
+
const version = parts[1];
|
|
298
|
+
AgentIdSchema.parse(agentName);
|
|
299
|
+
AgentVersionSchema.parse(version);
|
|
300
|
+
if (options.dryRun) {
|
|
301
|
+
console.log(chalk.yellow('\n[DRY RUN] Would delete agent:'));
|
|
302
|
+
console.log(` Agent: ${agentName}@${version}`);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (!options.force) {
|
|
306
|
+
console.log(chalk.yellow(`⚠️ This will delete agent: ${agentName}@${version}`));
|
|
307
|
+
console.log(chalk.yellow(' Use --force to skip confirmation'));
|
|
308
|
+
}
|
|
309
|
+
console.log(chalk.blue(`Deleting agent: ${agentName}@${version}`));
|
|
310
|
+
console.log(chalk.yellow('⚠️ Delete functionality requires API implementation'));
|
|
311
|
+
console.log(chalk.green(`\n✓ Delete validated (API implementation pending)`));
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
if (error instanceof z.ZodError) {
|
|
315
|
+
console.error(chalk.red('✗ Validation error:'));
|
|
316
|
+
error.issues.forEach((issue) => {
|
|
317
|
+
console.error(chalk.red(` - ${issue.path.join('.')}: ${issue.message}`));
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
console.error(chalk.red('✗ Failed to delete agent:'), error instanceof Error ? error.message : String(error));
|
|
322
|
+
}
|
|
323
|
+
process.exit(1);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
//# sourceMappingURL=agents.command.js.map
|